dsh-model-think-level 1.1.8 → 2.0.2

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.
Files changed (56) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +38 -0
  3. package/assets/NOTICE.md +15 -0
  4. package/assets/unified_bank.json +32910 -0
  5. package/lib/client/ComposerSlider.d.ts +9 -9
  6. package/lib/client/EffortEditor.d.ts +22 -12
  7. package/lib/client/FingerprintPane.d.ts +36 -0
  8. package/lib/client/KeyManager.d.ts +36 -10
  9. package/lib/client/ProtocolMenu.d.ts +51 -0
  10. package/lib/client/capacity.d.ts +30 -0
  11. package/lib/client/events.d.ts +26 -0
  12. package/lib/client/fingerprint-client.d.ts +81 -0
  13. package/lib/client/fingerprint-runner.d.ts +61 -0
  14. package/lib/client/index.d.ts +6 -0
  15. package/lib/client/injection/add-card.d.ts +4 -0
  16. package/lib/client/injection/create-card-pane.d.ts +15 -0
  17. package/lib/client/injection/create-key-seat.d.ts +53 -0
  18. package/lib/client/injection/create-keys-pane.d.ts +46 -0
  19. package/lib/client/injection/editor-tab-bar.d.ts +2 -1
  20. package/lib/client/injection/editor-tabs.d.ts +11 -1
  21. package/lib/client/injection/key-reveal.d.ts +24 -0
  22. package/lib/client/injection/models-page-editor.d.ts +165 -1
  23. package/lib/client/injection/provider-card-slot.d.ts +3 -1
  24. package/lib/client/injection/provider-endpoints.d.ts +70 -0
  25. package/lib/client/injection/staged-keys.d.ts +169 -0
  26. package/lib/client/key-manager-client.d.ts +89 -12
  27. package/lib/client/locales.d.ts +80 -6
  28. package/lib/client/ops.d.ts +4 -0
  29. package/lib/client/refresh-scheduler.d.ts +29 -0
  30. package/lib/client/styles.d.ts +1 -1
  31. package/lib/client/types.d.ts +44 -2
  32. package/lib/client.js +2275 -266
  33. package/lib/client.js.map +4 -4
  34. package/lib/constants.d.ts +11 -0
  35. package/lib/discovery-merge.d.ts +35 -0
  36. package/lib/fingerprint/bank.d.ts +24 -0
  37. package/lib/fingerprint/challenges.d.ts +14 -0
  38. package/lib/fingerprint/core.d.ts +85 -0
  39. package/lib/fingerprint/eligibility.d.ts +8 -0
  40. package/lib/fingerprint/random.d.ts +4 -0
  41. package/lib/fingerprint/run.d.ts +110 -0
  42. package/lib/fingerprint/store.d.ts +31 -0
  43. package/lib/fingerprint/verdict.d.ts +64 -0
  44. package/lib/headers-fetch.d.ts +53 -3
  45. package/lib/headers-pi-ai.d.ts +31 -1
  46. package/lib/index.d.ts +3 -19
  47. package/lib/index.js +2438 -153
  48. package/lib/index.js.map +4 -4
  49. package/lib/key-index.d.ts +58 -1
  50. package/lib/key-probe.d.ts +126 -0
  51. package/lib/key-refs.d.ts +106 -0
  52. package/lib/key-route-core.d.ts +415 -0
  53. package/lib/knowledge.d.ts +6 -5
  54. package/lib/listing.d.ts +118 -0
  55. package/lib/multi-key-listing.d.ts +101 -0
  56. package/package.json +13 -5
package/lib/client.js CHANGED
@@ -4,14 +4,88 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
 
7
- "use strict";var Qt=Object.defineProperty;var Fd=Object.getOwnPropertyDescriptor;var qd=Object.getOwnPropertyNames;var Wd=Object.prototype.hasOwnProperty;var Kd=(e,t,n)=>t in e?Qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bd=(e,t)=>{for(var n in t)Qt(e,n,{get:t[n],enumerable:!0})},Ud=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qd(t))!Wd.call(e,o)&&o!==n&&Qt(e,o,{get:()=>t[o],enumerable:!(r=Fd(t,o))||r.enumerable});return e};var Gd=e=>Ud(Qt({},"__esModule",{value:!0}),e);var Io=(e,t,n)=>Kd(e,typeof t!="symbol"?t+"":t,n);var Ec={};Bd(Ec,{EffortEditor:()=>kn,apply:()=>xc,baselineModelsOf:()=>Ei,compatOf:()=>gn,createEditorApi:()=>yn,defaultEffortOf:()=>bn,describeNamespace:()=>te,effortsOf:()=>pn,findModelMenu:()=>Dr,findModelTrigger:()=>Cr,inject:()=>vc,inputOf:()=>mn,name:()=>wc,nameOf:()=>hn,providerHeadersOf:()=>Lr,providersOf:()=>ce,routeIsDeclared:()=>Ye,userProvidersOf:()=>Mr,writeModelRows:()=>Ht,writeProviderHeaders:()=>Ot});module.exports=Gd(Ec);var Hd=require("react");var re="dsh-model-think-level",No="/dsh-model-think-level/raw-models";var Zt="/dsh-model-think-level/provider-key",Do="/dsh-model-think-level/key-index",Co="/dsh-model-think-level/autofill-config",Po="/dsh-model-think-level/headers-config",fe="llm-pi-ai",ge="reasoningEffortsUnset",_e="inputUnset",st="reasoningEffortsAutofilled",at="defaultEffort",ar=re;var Lt=require("react");function Fo(e){let{locale:t}=e,n=(0,Lt.useCallback)(o=>t.subscribe(o),[t]),r=(0,Lt.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,Lt.useSyncExternalStore)(n,r),e.children()}var qo={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptWorking:"Detecting\u2026",autoAdaptDone:"Adapted {count} \xB7 save to write",autoAdaptEmpty:"All already configured",autoAdaptUnsuggested:"No suggestion available",autoAdaptBlocked:"No models to adapt yet",autoAdaptFailed:"Detection failed: {message}",autoAdaptDoneHint:"Held for {count} model(s): they land when this card is saved.",autoAdaptEmptyHint:"Every model of this provider already declares its thinking levels.",autoAdaptUnsuggestedHint:"The models that still need a declaration have no knowledge-base match \u2014 adapt them one by one.",autoAdaptBlockedHint:"Nothing to adapt yet: the card has no models, is not saved, or the settings document is read-only.",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities (hints only, never auto-filled)",contextWindowLabel:"Context window",maxTokensLabel:"Max output",inputModality:"Input modalities",modalityImage:"Image input",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderNoCurrent:"No model selected.",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level every new session starts this model at \u2014 it outranks the remembered levels. Within a session, a level you pick by hand always wins. Empty follows the memory chain.",clearDefaultEffort:"Clear pick",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Use {name}",keysEnabled:"Enabled",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysEnabledNote:"{name} is now in use.",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",headersTitle:"Request headers",headersHint:"Sent on every request of this route.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersUserAgentTitle:"User-Agent (taken over at the fetch layer)",headersUserAgentHint:"The official adapter discards a configured user-agent \u2014 the name is reserved for client attribution \u2014 so this plugin adds it at the request layer. Filling it in really does replace the outgoing User-Agent.",headersUserAgentClear:"Do not override",headersUserAgentPlaceholder:"e.g. claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerDisabledGroupShow:"Show {count} switched-off provider(s)",providerDisabledGroupHide:"Hide {count} switched-off provider(s)",providerDisabledGroupHint:"A switched-off provider keeps its configuration and folds away here \u2014 unfold it to switch it back on.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Wo={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptWorking:"\u83B7\u53D6\u4E2D\u2026",autoAdaptDone:"\u5DF2\u9002\u914D {count} \u4E2A\xB7\u4FDD\u5B58\u540E\u5199\u5165",autoAdaptEmpty:"\u5DF2\u5168\u90E8\u914D\u7F6E",autoAdaptUnsuggested:"\u6CA1\u6709\u53EF\u7528\u5EFA\u8BAE",autoAdaptBlocked:"\u6682\u65E0\u53EF\u9002\u914D\u6A21\u578B",autoAdaptFailed:"\u83B7\u53D6\u5931\u8D25\uFF1A{message}",autoAdaptDoneHint:"\u5DF2\u6682\u5B58 {count} \u4E2A\u6A21\u578B\u7684\u9002\u914D\u7ED3\u679C\uFF1A\u70B9\u8BE5\u5361\u7247\u7684\u300C\u4FDD\u5B58\u300D\u540E\u5199\u5165\u3002",autoAdaptEmptyHint:"\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u90FD\u5DF2\u58F0\u660E\u601D\u8003\u7B49\u7EA7\u3002",autoAdaptUnsuggestedHint:"\u4ECD\u9700\u58F0\u660E\u7684\u6A21\u578B\u6CA1\u6709\u77E5\u8BC6\u5E93\u5339\u914D\u2014\u2014\u8BF7\u9010\u4E2A\u6253\u5F00\u6A21\u578B\u884C\u624B\u52A8\u9002\u914D\u3002",autoAdaptBlockedHint:"\u6682\u65E0\u53EF\u9002\u914D\u5185\u5BB9\uFF1A\u8BE5\u5361\u7247\u8FD8\u6CA1\u6709\u6A21\u578B\u3001\u5C1A\u672A\u4FDD\u5B58\uFF0C\u6216\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF\uFF08\u4EC5\u63D0\u793A\uFF0C\u4E0D\u81EA\u52A8\u586B\u5145\uFF09",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247\u8F93\u5165",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u6BCF\u4E2A\u65B0\u4F1A\u8BDD\u6253\u5F00\u8BE5\u6A21\u578B\u65F6\u4F7F\u7528\u7684\u6863\u4F4D\u2014\u2014\u4F18\u5148\u4E8E\u8BB0\u4F4F\u7684\u4E0A\u6B21\u6863\u4F4D\u3002\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u7684\u6863\u4F4D\u59CB\u7EC8\u6700\u9AD8\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysEnabled:"\u542F\u7528",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysEnabledNote:"\u5DF2\u542F\u7528 {name}\u3002",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersUserAgentTitle:"User-Agent\uFF08\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u63A5\u7BA1\uFF09",headersUserAgentHint:"\u5B98\u65B9\u9002\u914D\u5668\u4F1A\u4E22\u5F03\u914D\u7F6E\u7684 user-agent\uFF08\u8BE5\u540D\u79F0\u4FDD\u7559\u7ED9\u5BA2\u6237\u7AEF\u5F52\u5C5E\u6807\u8BC6\uFF09\uFF0C\u6240\u4EE5\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u8865\u4E0A\u3002\u586B\u4E86\u5C31\u4F1A\u771F\u6B63\u66FF\u6362\u4E0A\u884C\u8BF7\u6C42\u5934\u91CC\u7684 User-Agent\u3002",headersUserAgentClear:"\u4E0D\u8986\u76D6",headersUserAgentPlaceholder:"\u4F8B\u5982 claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerDisabledGroupShow:"\u5C55\u5F00 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHide:"\u6536\u8D77 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHint:"\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546\u914D\u7F6E\u4ECD\u5728\uFF0C\u53EA\u662F\u6298\u53E0\u5728\u8FD9\u91CC\u2014\u2014\u5C55\u5F00\u540E\u53EF\u4EE5\u91CD\u65B0\u542F\u7528\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var en="dsh-model-think-level.slider.enabled",jd=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],St=zd();function zd(){try{let e=window.localStorage.getItem(en),t=e===null?jd.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var dr=new Set;function Ko(){for(let e of[...dr])e()}function we(){return St}function Bo(e){if(St!==e){St=e;try{window.localStorage.setItem(en,String(e))}catch{}Ko()}}function Uo(e){St!==e&&(St=e,Ko())}function tn(e){return dr.add(e),()=>{dr.delete(e)}}var nn="dsh-model-think-level.provider-order",Go=["deepseek-account","deepseek-official"];function lt(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?ur(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function ur(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var dt=(()=>{try{return lt(window.localStorage.getItem(nn))}catch{return[]}})(),lr=new Set;function jo(){for(let e of[...lr])e()}function zo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function fr(){return dt}function $o(e){let t=ur(e);if(!zo(dt,t)){dt=t;try{window.localStorage.setItem(nn,JSON.stringify(dt))}catch{}jo()}}function Vo(e){let t=ur(e);zo(dt,t)||(dt=t,jo())}function rn(e){return lr.add(e),()=>{lr.delete(e)}}function cr(e){let t=n=>{let r=Go.indexOf(n);return r<0?Go.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function ut(e,t){let n=new Map;for(let s of t)n.has(s)||n.set(s,n.size);let r=[],o=[];e.forEach((s,a)=>{n.has(s)&&(r.push(a),o.push(s))}),o.sort((s,a)=>n.get(s)-n.get(a));let i=[...e];return r.forEach((s,a)=>{i[s]=o[a]}),i}function Yo(e){return ut(cr(e),fr())}function pr(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let i=Math.max(0,Math.min(o.length,n));return o.splice(i,0,t),o}var on="dsh-model-think-level.providers.disabled",mr=new Set,We=$d();function $d(){try{return lt(window.localStorage.getItem(on))}catch{return[]}}function Xo(e){return lt(e)}function Jo(){return We}function ft(e){return!We.includes(e)}function Qo(e,t){let n=!We.includes(e);t!==n&&ei(t?We.filter(r=>r!==e):[...We,e],!0)}function Zo(e){ei(e,!1)}function sn(e){return mr.add(e),()=>{mr.delete(e)}}function Vd(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function ei(e,t){if(!Vd(We,e)){if(We=[...new Set(e)],t)try{window.localStorage.setItem(on,JSON.stringify(We))}catch{}for(let n of[...mr])n()}}var an="dsh-model-think-level.model-order";function hr(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let i=ti(o.filter(s=>typeof s=="string"));i.length>0&&(n[r]=i)}return n}catch{return{}}}function ti(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var ze=(()=>{try{return hr(window.localStorage.getItem(an))}catch{return{}}})(),gr=new Set;function ni(){for(let e of[...gr])e()}function Yd(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Xd(){try{window.localStorage.setItem(an,JSON.stringify(ze))}catch{}}function ri(){return ze}function oi(e){return ze[e]??Jd}var Jd=[];function ii(e,t){if(e.length===0)return;let n=ti(t),r=oi(e);if(Yd(r,n)&&(n.length>0||!(e in ze)))return;let o={...ze};n.length===0?delete o[e]:o[e]=n,ze=o,Xd(),ni()}function si(e){ze=e,ni()}function dn(e){return gr.add(e),()=>{gr.delete(e)}}function Qd(e,t){return ut(e,t)}function ai(e,t){return ut(t,oi(e))}function di(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return Qd(e.map(r=>r.id),t).map(r=>n.get(r))}var li=`
7
+ "use strict";var nr=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var xu=Object.getOwnPropertyNames;var ku=Object.prototype.hasOwnProperty;var Eu=(e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Tu=(e,t)=>{for(var n in t)nr(e,n,{get:t[n],enumerable:!0})},Mu=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xu(t))!ku.call(e,o)&&o!==n&&nr(e,o,{get:()=>t[o],enumerable:!(r=vu(t,o))||r.enumerable});return e};var Su=e=>Mu(nr({},"__esModule",{value:!0}),e);var Fe=(e,t,n)=>Eu(e,typeof t!="symbol"?t+"":t,n);var ig={};Tu(ig,{EffortEditor:()=>Ar,REFRESH_MIN_INTERVAL_MS:()=>wu,apply:()=>og,baselineModelsOf:()=>as,compatOf:()=>wr,createEditorApi:()=>kr,defaultEffortOf:()=>xr,describeNamespace:()=>ne,effortsOf:()=>br,findModelMenu:()=>oi,findModelTrigger:()=>ii,inject:()=>rg,inputOf:()=>yr,invalidateProbeCache:()=>Xo,name:()=>ng,nameOf:()=>vr,providerHeadersOf:()=>Jo,providersOf:()=>ke,routeIsDeclared:()=>He,userProvidersOf:()=>gr,writeModelRows:()=>gn,writeProviderHeaders:()=>bn});module.exports=Su(ig);var yu=require("react");function ya(e,t){let n=!1,r=0,o=!1,i;return{schedule:()=>{if(o||n)return;n=!0;let a=Math.max(0,t-(Date.now()-r));i=setTimeout(()=>{i=void 0,n=!1,r=Date.now(),o||e()},a)},dispose:()=>{o=!0,i!==void 0&&clearTimeout(i),i=void 0,n=!1}}}var pe="dsh-model-think-level",wa="/dsh-model-think-level/raw-models";var rr="/dsh-model-think-level/provider-key",va="/dsh-model-think-level/key-index",xa="/dsh-model-think-level/autofill-config",ka="/dsh-model-think-level/headers-config",Ro="/dsh-model-think-level/fingerprint",xe="llm-pi-ai",Ae="reasoningEffortsUnset",rt="inputUnset",_t="reasoningEffortsAutofilled",Ft="defaultEffort",Ho=pe;var fn=require("react");function Ea(e){let{locale:t}=e,n=(0,fn.useCallback)(o=>t.subscribe(o),[t]),r=(0,fn.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,fn.useSyncExternalStore)(n,r),e.children()}var Ta={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",levelsLabel:"Declared levels",levelsHint:"Click to declare; clear every level to declare nothing \u2014 requests follow the provider default.",stateDeclared:"{count} declared \xB7 default {default}",stateUndeclared:"Nothing declared \u2014 requests follow the provider default.",modalityText:"Text",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptWorking:"Detecting\u2026",autoAdaptDone:"Adapted {count} \xB7 save to write",autoAdaptEmpty:"All already configured",autoAdaptUnsuggested:"No suggestion available",autoAdaptBlocked:"No models to adapt yet",autoAdaptFailed:"Detection failed: {message}",autoAdaptDoneHint:"Held for {count} model(s): they land when this card is saved.",autoAdaptEmptyHint:"Every model of this provider already declares its thinking levels.",autoAdaptUnsuggestedHint:"The models that still need a declaration have no knowledge-base match \u2014 adapt them one by one.",autoAdaptBlockedHint:"Nothing to adapt yet: the card has no models, is not saved, or the settings document is read-only.",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities",contextWindowLabel:"Context window",maxTokensLabel:"Max output",capacityBlank:"Catalogue value",capacityUnitsHint:"Digits or K/M shorthand, e.g. 1,048,576 or 1M.",capacityRule:"Max output above the window is refused upstream; this check is local only.",tokensUnit:"tokens",inputModality:"Input modalities",modalityImage:"Image",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",modalityDeclared:"Declared \u2014 clearing Image goes back to text only.",capacityInherit:"Empty keeps the catalogue value.",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",wireShow:"Edit wire values",wireHide:"Hide wire values",wireHint:"Empty keeps the level's conventional spelling; a non-empty off value is what gets sent when thinking is closed.",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderNoCurrent:"No model selected.",sliderCommitSlow:"The switch is taking too long \u2014 try again.",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level new sessions start at; a level you pick by hand always wins. Empty follows memory.",followMemory:"Follow memory",clearDefaultEffort:"Clear pick",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",editorTabFingerprint:"Fingerprint",fpTitle:"Model fingerprint",fpIntro:"Only GPT and Claude models can be probed \u2014 the fingerprint library covers those two families, and models outside it never appear here.",fpCount:"{count} probeable",fpSummary:"Identified {identified} \xB7 doubtful {doubtful} \xB7 failed {failed}",fpSummaryNone:"Nothing checked yet.",fpRunning:"Checking \xB7 {done} / {total} (keeps going if you leave)",fpDetectAll:"Check all",fpDetect:"Check",fpRetest:"Re-check",fpRetry:"Retry",fpCost:"{count} prompts \xB7 about {seconds}s",fpForget:"Forget",fpStateUnchecked:"Not checked",fpStateRunning:"Checking \xB7 {done}/{total}",fpStateIdentified:"{model} \xB7 {probability}",fpStateDoubtful:"Doubtful \xB7 {probability}",fpStateFailed:"Check failed",fpQueued:"Queued \xB7 #{position}",fpEvidence:"{used} / {total} prompts \xB7 similarity {similarity}",fpFamily:"Family",fpCandidates:"Closest candidates",fpClosedSet:"Closed-set result: a model outside the library is still attributed to the nearest listed one. Read it as a comparison, not a certificate.",fpCheckedAt:"Checked {time}",fpLoadFailed:"Could not read the stored verdicts: {error}",fpRunFailed:"Check failed: {error}",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Enable {name}",keysDisable:"Disable {name}",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysScope:"Models served by {name}",keysModels:"Models",keysScopeAll:"All models",keysScopeNone:"No models found",keysScopeCount:"{count} models",keysScopeSaved:"Model scope saved.",keysScopeHint:"Only the ticked models use this key; the rest go to the provider's other keys.",keysScopeEmpty:"This provider has no models yet. Add models first, then pick them here.",keysMergedOffer:"{count} more models are served by your keys but not added to this provider: {models}.",keysMergedApply:"Add them",keysMergedApplied:"Models added to the provider.",keysProtocolLabel:"Protocol for {name}",keysProtocolCreate:"Protocol",keysProtocolCreateHint:"The wire this key signs with; the addresses the provider has configured decide which families are offered.",keysProtocolDefault:"Auto (per model)",keysProtocolDefaultHint:"Picks each model\u2019s own wire: claude models use the Anthropic address, gemini models the Gemini one, the rest the provider\u2019s protocol (where that address is configured).",keysProtocolAnthropic:"Anthropic",keysProtocolAnthropicHint:"Anthropic API \xB7 Claude models",keysProtocolOpenAI:"Chat Completions",keysProtocolOpenAIHint:"OpenAI API \xB7 GPT models, most agents",keysProtocolResponses:"Responses",keysProtocolResponsesHint:"OpenAI API \xB7 Codex",keysProtocolGemini:"Gemini",keysProtocolGeminiHint:"Google Gemini API \xB7 gemini / gemma models",keysProtocolShortChat:"Chat",keysProtocolShortResponses:"Responses",keysProtocolShortAnthropic:"Anthropic",keysProtocolSaved:"Protocol saved.",keysEndpointOpenAI:"OpenAI",keysEndpointAnthropic:"Anthropic",keysEndpointGemini:"Gemini",keysMoreEndpoints:"More endpoints",keysEndpointsCount:"{count} more",keysEndpointInvalid:"The address must start with http:// or https://",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",keysDraftHint:"Held by this page and stored when the provider is created \u2014 a reload discards them, exactly like the card\u2019s own fields.",keysLastEnabledOff:"The last enabled key cannot be switched off.",headersTitle:"Request headers",headersHint:"Sent on every request of this route.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersRemove:"Remove header",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerDisabledGroupShow:"Show {count} switched-off provider(s)",providerDisabledGroupHide:"Hide {count} switched-off provider(s)",providerDisabledGroupHint:"A switched-off provider keeps its configuration and folds away here \u2014 unfold it to switch it back on.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Ma={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",levelsLabel:"\u652F\u6301\u6863\u4F4D",levelsHint:"\u70B9\u9009\u5373\u58F0\u660E\uFF1B\u5168\u90E8\u53D6\u6D88\u5219\u4E0D\u58F0\u660E\uFF0C\u8BF7\u6C42\u6309\u4F9B\u5E94\u5546\u9ED8\u8BA4\u53D1\u9001\u3002",stateDeclared:"\u5DF2\u58F0\u660E {count} \u6863 \xB7 \u9ED8\u8BA4 {default}",stateUndeclared:"\u672A\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u6309\u4F9B\u5E94\u5546\u9ED8\u8BA4\u53D1\u9001\u3002",modalityText:"\u6587\u672C",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptWorking:"\u83B7\u53D6\u4E2D\u2026",autoAdaptDone:"\u5DF2\u9002\u914D {count} \u4E2A\xB7\u4FDD\u5B58\u540E\u5199\u5165",autoAdaptEmpty:"\u5DF2\u5168\u90E8\u914D\u7F6E",autoAdaptUnsuggested:"\u6CA1\u6709\u53EF\u7528\u5EFA\u8BAE",autoAdaptBlocked:"\u6682\u65E0\u53EF\u9002\u914D\u6A21\u578B",autoAdaptFailed:"\u83B7\u53D6\u5931\u8D25\uFF1A{message}",autoAdaptDoneHint:"\u5DF2\u6682\u5B58 {count} \u4E2A\u6A21\u578B\u7684\u9002\u914D\u7ED3\u679C\uFF1A\u70B9\u8BE5\u5361\u7247\u7684\u300C\u4FDD\u5B58\u300D\u540E\u5199\u5165\u3002",autoAdaptEmptyHint:"\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u90FD\u5DF2\u58F0\u660E\u601D\u8003\u7B49\u7EA7\u3002",autoAdaptUnsuggestedHint:"\u4ECD\u9700\u58F0\u660E\u7684\u6A21\u578B\u6CA1\u6709\u77E5\u8BC6\u5E93\u5339\u914D\u2014\u2014\u8BF7\u9010\u4E2A\u6253\u5F00\u6A21\u578B\u884C\u624B\u52A8\u9002\u914D\u3002",autoAdaptBlockedHint:"\u6682\u65E0\u53EF\u9002\u914D\u5185\u5BB9\uFF1A\u8BE5\u5361\u7247\u8FD8\u6CA1\u6709\u6A21\u578B\u3001\u5C1A\u672A\u4FDD\u5B58\uFF0C\u6216\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",capacityBlank:"\u6CBF\u7528\u76EE\u5F55\u503C",capacityUnitsHint:"\u53EF\u586B\u6570\u5B57\u6216 K/M \u7B80\u5199\uFF0C\u4F8B\u5982 1,048,576 \u6216 1M\u3002",capacityRule:"\u6700\u5927\u8F93\u51FA\u8D85\u8FC7\u7A97\u53E3\u4F1A\u88AB\u4E0A\u6E38\u62D2\u7EDD\uFF0C\u8FD9\u91CC\u53EA\u505A\u672C\u5730\u6821\u9A8C\u3002",tokensUnit:"tokens",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",modalityDeclared:"\u5DF2\u58F0\u660E\u2014\u2014\u53D6\u6D88\u300C\u56FE\u7247\u300D\u5373\u56DE\u5230\u4EC5\u6587\u672C\u3002",capacityInherit:"\u7559\u7A7A\uFF1D\u6CBF\u7528\u6A21\u578B\u76EE\u5F55\u91CC\u7684\u503C\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",wireShow:"\u7F16\u8F91\u7EBF\u4E0A\u53D6\u503C",wireHide:"\u6536\u8D77\u7EBF\u4E0A\u53D6\u503C",wireHint:"\u7559\u7A7A\uFF1D\u6CBF\u7528\u8BE5\u6863\u4F4D\u7684\u7EA6\u5B9A\u62FC\u5199\uFF1Boff \u6863\u586B\u4E86\u975E\u7A7A\u503C\uFF0C\u5C31\u4F1A\u5728\u5173\u95ED\u601D\u8003\u65F6\u53D1\u9001\u8FD9\u4E00\u6BB5\u3002",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",sliderCommitSlow:"\u5207\u6362\u8D85\u65F6\u2014\u2014\u8BF7\u91CD\u8BD5\u3002",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u65B0\u4F1A\u8BDD\u7684\u8D77\u59CB\u6863\u4F4D\uFF1B\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u59CB\u7EC8\u4F18\u5148\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",followMemory:"\u8DDF\u968F\u8BB0\u5FC6",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",editorTabFingerprint:"\u6307\u7EB9\u68C0\u6D4B",fpTitle:"\u6A21\u578B\u6307\u7EB9",fpIntro:"\u53EA\u6709 GPT \u4E0E Claude \u7CFB\u5217\u6A21\u578B\u53EF\u68C0\u6D4B\u2014\u2014\u6307\u7EB9\u5E93\u53EA\u8986\u76D6\u8FD9\u4E24\u4E2A\u5BB6\u65CF\uFF0C\u4E0D\u5728\u6B64\u5217\u7684\u6A21\u578B\u4E0D\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002",fpCount:"{count} \u4E2A\u53EF\u68C0\u6D4B",fpSummary:"\u5DF2\u8BC6\u522B {identified} \xB7 \u5B58\u7591 {doubtful} \xB7 \u5931\u8D25 {failed}",fpSummaryNone:"\u5C1A\u672A\u68C0\u6D4B\u3002",fpRunning:"\u6B63\u5728\u68C0\u6D4B \xB7 {done} / {total}\uFF08\u5207\u8D70\u4E5F\u4F1A\u7EE7\u7EED\uFF09",fpDetectAll:"\u68C0\u6D4B\u5168\u90E8",fpDetect:"\u68C0\u6D4B",fpRetest:"\u91CD\u6D4B",fpRetry:"\u91CD\u8BD5",fpCost:"{count} \u9898 \xB7 \u7EA6 {seconds} \u79D2",fpForget:"\u5FD8\u6389",fpStateUnchecked:"\u672A\u68C0\u6D4B",fpStateRunning:"\u68C0\u6D4B\u4E2D \xB7 {done}/{total}",fpStateIdentified:"{model} \xB7 {probability}",fpStateDoubtful:"\u5B58\u7591 \xB7 {probability}",fpStateFailed:"\u68C0\u6D4B\u5931\u8D25",fpQueued:"\u6392\u961F \xB7 \u7B2C {position} \u4E2A",fpEvidence:"{used} / {total} \u9898 \xB7 \u76F8\u4F3C\u5EA6 {similarity}",fpFamily:"\u5BB6\u65CF",fpCandidates:"\u6700\u63A5\u8FD1\u7684\u5019\u9009",fpClosedSet:"\u95ED\u96C6\u7ED3\u8BBA\uFF1A\u4E0D\u5728\u5E93\u91CC\u7684\u6A21\u578B\u4ECD\u4F1A\u88AB\u5F52\u7ED9\u6700\u63A5\u8FD1\u7684\u90A3\u4E2A\u3002\u8BF7\u5F53\u6210\u4E00\u6B21\u6BD4\u5BF9\uFF0C\u4E0D\u662F\u8BC1\u660E\u3002",fpCheckedAt:"\u68C0\u6D4B\u4E8E {time}",fpLoadFailed:"\u8BFB\u4E0D\u5230\u5DF2\u5B58\u7ED3\u8BBA\uFF1A{error}",fpRunFailed:"\u68C0\u6D4B\u5931\u8D25\uFF1A{error}",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysDisable:"\u505C\u7528 {name}",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysScope:"{name} \u63D0\u4F9B\u670D\u52A1\u7684\u6A21\u578B",keysModels:"\u6A21\u578B",keysScopeAll:"\u5168\u90E8\u6A21\u578B",keysScopeNone:"\u672A\u53D1\u73B0\u6A21\u578B",keysScopeCount:"{count} \u4E2A\u6A21\u578B",keysScopeSaved:"\u5DF2\u4FDD\u5B58\u6A21\u578B\u8303\u56F4\u3002",keysScopeHint:"\u53EA\u6709\u9009\u4E2D\u7684\u6A21\u578B\u4F1A\u7528\u8FD9\u4E2A Key\uFF0C\u5176\u4ED6\u6A21\u578B\u4EA4\u7ED9\u8BE5\u4F9B\u5E94\u5546\u7684\u5176\u4ED6 Key\u3002",keysScopeEmpty:"\u8BE5\u4F9B\u5E94\u5546\u8FD8\u6CA1\u6709\u6A21\u578B\u3002\u8BF7\u5148\u6DFB\u52A0\u6A21\u578B\uFF0C\u518D\u6765\u8FD9\u91CC\u9009\u62E9\u3002",keysMergedOffer:"\u5BC6\u94A5\u8FD8\u63D0\u4F9B\u670D\u52A1\u5546\u5C1A\u672A\u6DFB\u52A0\u7684 {count} \u4E2A\u6A21\u578B\uFF1A{models}\u3002",keysMergedApply:"\u6DFB\u52A0",keysMergedApplied:"\u5DF2\u628A\u6A21\u578B\u6DFB\u52A0\u5230\u8BE5\u4F9B\u5E94\u5546\u3002",keysProtocolLabel:"{name} \u4F7F\u7528\u7684\u534F\u8BAE",keysProtocolCreate:"\u534F\u8BAE",keysProtocolCreateHint:"\u8FD9\u628A\u5BC6\u94A5\u8981\u8D70\u7684\u534F\u8BAE\uFF1B\u53EF\u9009\u54EA\u4E9B\u53D6\u51B3\u4E8E\u4F9B\u5E94\u5546\u5DF2\u914D\u7F6E\u7684\u7AEF\u70B9\u5730\u5740\u3002",keysProtocolDefault:"\u81EA\u52A8\uFF08\u6309\u6A21\u578B\uFF09",keysProtocolDefaultHint:"\u6309\u6A21\u578B\u81EA\u52A8\u9009\u62E9\u534F\u8BAE\uFF1Aclaude \u7CFB\u6A21\u578B\u8D70 Anthropic \u5730\u5740\uFF0Cgemini \u7CFB\u8D70 Gemini \u5730\u5740\uFF0C\u5176\u4F59\u6CBF\u7528\u8BE5\u4F9B\u5E94\u5546\u81EA\u5E26\u7684\u534F\u8BAE\uFF08\u9700\u5DF2\u914D\u7F6E\u5BF9\u5E94\u5730\u5740\uFF09",keysProtocolAnthropic:"Anthropic",keysProtocolAnthropicHint:"Anthropic API \xB7 Claude \u6A21\u578B",keysProtocolOpenAI:"Chat Completions",keysProtocolOpenAIHint:"OpenAI API \xB7 GPT \u6A21\u578B\u3001\u5927\u591A\u6570 agent",keysProtocolResponses:"Responses",keysProtocolResponsesHint:"OpenAI API \xB7 Codex",keysProtocolGemini:"Gemini",keysProtocolGeminiHint:"Google Gemini API \xB7 gemini / gemma \u6A21\u578B",keysProtocolShortChat:"Chat",keysProtocolShortResponses:"Responses",keysProtocolShortAnthropic:"Anthropic",keysProtocolSaved:"\u5DF2\u4FDD\u5B58\u534F\u8BAE\u3002",keysEndpointOpenAI:"OpenAI",keysEndpointAnthropic:"Anthropic",keysEndpointGemini:"Gemini",keysMoreEndpoints:"\u66F4\u591A\u7AEF\u70B9",keysEndpointsCount:"\u53E6\u6709 {count} \u4E2A",keysEndpointInvalid:"\u5730\u5740\u9700\u4EE5 http:// \u6216 https:// \u5F00\u5934",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",keysDraftHint:"\u5BC6\u94A5\u6682\u5B58\u5728\u672C\u9875\uFF0C\u521B\u5EFA\u4F9B\u5E94\u5546\u540E\u81EA\u52A8\u4FDD\u5B58\uFF1B\u5237\u65B0\u9875\u9762\u4F1A\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u8868\u5355\u4E00\u81F4\u3002",keysLastEnabledOff:"\u4E0D\u80FD\u505C\u7528\u6700\u540E\u4E00\u628A\u542F\u7528\u4E2D\u7684\u5BC6\u94A5\u3002",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersRemove:"\u5220\u9664\u8BF7\u6C42\u5934",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerDisabledGroupShow:"\u5C55\u5F00 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHide:"\u6536\u8D77 {count} \u4E2A\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546",providerDisabledGroupHint:"\u5DF2\u7981\u7528\u7684\u4F9B\u5E94\u5546\u914D\u7F6E\u4ECD\u5728\uFF0C\u53EA\u662F\u6298\u53E0\u5728\u8FD9\u91CC\u2014\u2014\u5C55\u5F00\u540E\u53EF\u4EE5\u91CD\u65B0\u542F\u7528\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var or="dsh-model-think-level.slider.enabled",Lu=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],pn=Au();function Au(){try{let e=window.localStorage.getItem(or),t=e===null?Lu.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var Co=new Set;function Sa(){for(let e of[...Co])e()}function Ke(){return pn}function La(e){if(pn!==e){pn=e;try{window.localStorage.setItem(or,String(e))}catch{}Sa()}}function Aa(e){pn!==e&&(pn=e,Sa())}function ir(e){return Co.add(e),()=>{Co.delete(e)}}var ar="dsh-model-think-level.provider-order",Ra=["deepseek-account","deepseek-official"];function qt(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?No(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function No(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var Kt=(()=>{try{return qt(window.localStorage.getItem(ar))}catch{return[]}})(),Oo=new Set;function Ha(){for(let e of[...Oo])e()}function Ca(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Po(){return Kt}function Oa(e){let t=No(e);if(!Ca(Kt,t)){Kt=t;try{window.localStorage.setItem(ar,JSON.stringify(Kt))}catch{}Ha()}}function Na(e){let t=No(e);Ca(Kt,t)||(Kt=t,Ha())}function sr(e){return Oo.add(e),()=>{Oo.delete(e)}}function Do(e){let t=n=>{let r=Ra.indexOf(n);return r<0?Ra.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function Wt(e,t){let n=new Map;for(let a of t)n.has(a)||n.set(a,n.size);let r=[],o=[];e.forEach((a,s)=>{n.has(a)&&(r.push(s),o.push(a))}),o.sort((a,s)=>n.get(a)-n.get(s));let i=[...e];return r.forEach((a,s)=>{i[a]=o[s]}),i}function Pa(e){return Wt(Do(e),Po())}function Io(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let i=Math.max(0,Math.min(o.length,n));return o.splice(i,0,t),o}var dr="dsh-model-think-level.providers.disabled",_o=new Set,ct=Ru();function Ru(){try{return qt(window.localStorage.getItem(dr))}catch{return[]}}function Da(e){return qt(e)}function Ia(){return ct}function Bt(e){return!ct.includes(e)}function _a(e,t){let n=!ct.includes(e);t!==n&&Ka(t?ct.filter(r=>r!==e):[...ct,e],!0)}function Fa(e){Ka(e,!1)}function lr(e){return _o.add(e),()=>{_o.delete(e)}}function Hu(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function Ka(e,t){if(!Hu(ct,e)){if(ct=[...new Set(e)],t)try{window.localStorage.setItem(dr,JSON.stringify(ct))}catch{}for(let n of[..._o])n()}}var cr="dsh-model-think-level.model-order";function Ko(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let i=qa(o.filter(a=>typeof a=="string"));i.length>0&&(n[r]=i)}return n}catch{return{}}}function qa(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var vt=(()=>{try{return Ko(window.localStorage.getItem(cr))}catch{return{}}})(),Fo=new Set;function Wa(){for(let e of[...Fo])e()}function Cu(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Ou(){try{window.localStorage.setItem(cr,JSON.stringify(vt))}catch{}}function Ba(){return vt}function Ga(e){return vt[e]??Nu}var Nu=[];function Ua(e,t){if(e.length===0)return;let n=qa(t),r=Ga(e);if(Cu(r,n)&&(n.length>0||!(e in vt)))return;let o={...vt};n.length===0?delete o[e]:o[e]=n,vt=o,Ou(),Wa()}function za(e){vt=e,Wa()}function ur(e){return Fo.add(e),()=>{Fo.delete(e)}}function Pu(e,t){return Wt(e,t)}function ja(e,t){return Wt(t,Ga(e))}function qo(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return Pu(e.map(r=>r.id),t).map(r=>n.get(r))}var $a=`
8
+ /* ---- Quiet Precision: the plugin's own token layer ----
9
+ Every value below is a HOST design-platform token (--dsw-*) with the light
10
+ theme's literal as the fallback, so the plugin inherits a theme switch for
11
+ free instead of carrying a second palette. The few values the platform has no
12
+ name for (a 10% accent tint, the slider's track grey) are declared here once
13
+ and re-declared under the host's dark attribute \u2014 the plugin never hard-codes
14
+ a colour in a component rule.
15
+
16
+ The layer is declared on BOTH :root and body on purpose. A custom property
17
+ resolves var() where it is DECLARED, not where it is used: declared on :root
18
+ alone, --bre-ink would read the alias chain as the <html> element sees it, and
19
+ the host republishes its dark aliases on body[data-ds-dark-theme] \u2014 a
20
+ descendant \u2014 so every value here would stay frozen at the light fallback.
21
+ Declaring it again on body makes each var() resolve against the element that
22
+ actually carries the theme. */
23
+ :root,
24
+ body {
25
+ --bre-ink: var(--dsw-alias-label-primary, #0f1115);
26
+ --bre-ink-2: var(--dsw-alias-label-secondary, #61666b);
27
+ --bre-ink-3: var(--dsw-alias-label-tertiary, #81858c);
28
+ /* label-dimmed is the host's disabled/skeleton tone \u2014 bluish-200 #e1e5ee on
29
+ white, bluish-750 #43454a on #292929. Invisible as body copy, and it was what
30
+ every placeholder and muted value inherited. Dimmed now stops at tertiary, and
31
+ hint copy gets its own token a step darker so descriptions read without
32
+ competing with real values. */
33
+ --bre-ink-4: var(--dsw-alias-label-tertiary, #81858c);
34
+ --bre-ink-hint: var(--dsw-alias-label-secondary, #61666b);
35
+ --bre-surface: var(--dsw-alias-bg-base, #ffffff);
36
+ --bre-sunken: var(--dsw-alias-bg-module-platform, #f5f6f7);
37
+ --bre-sunken-2: var(--dsw-alias-fill-tertiary, #f1f3f5);
38
+ --bre-track: #e9ecf2;
39
+ --bre-hover: var(--dsw-alias-interactive-bg-hover, #2631480f);
40
+ --bre-active: var(--dsw-alias-interactive-bg-active, #2631481a);
41
+ --bre-line-1: var(--dsw-alias-border-l1, #0000000a);
42
+ --bre-line-2: var(--dsw-alias-border-l2, #0000001a);
43
+ --bre-line-3: var(--dsw-alias-border-l3, #0000001f);
44
+ --bre-line-4: var(--dsw-alias-border-l4, #00000029);
45
+ --bre-accent: var(--dsw-alias-link, #4176e6);
46
+ --bre-accent-ink: #2f4c8f;
47
+ --bre-accent-weak: #edf3fe;
48
+ --bre-accent-line: #4176e640;
49
+ --bre-accent-glow: #4176e61f;
50
+ --bre-ok: var(--dsw-alias-state-success-primary, #22c55e);
51
+ --bre-warn: var(--dsw-alias-state-warn-label, #dd8629);
52
+ --bre-danger: var(--dsw-alias-state-error-primary, #ec1313);
53
+ --bre-danger-weak: #fef2f2;
54
+ --bre-r-xs: 4px;
55
+ --bre-r-sm: 8px;
56
+ --bre-r-md: 12px;
57
+ --bre-r-pill: 999px;
58
+ --bre-switch-track: #cfd3d6;
59
+ --bre-switch-knob: #ffffff;
60
+ --bre-ease: cubic-bezier(.4, 0, .2, 1);
61
+ --bre-t: .16s;
62
+ --bre-shadow-pop: 0 2px 5px #00000009, 0 12px 32px -8px #0f11151f;
63
+ }
64
+ body[data-ds-dark-theme] {
65
+ --bre-ink-4: var(--dsw-alias-label-tertiary, #adb2b8);
66
+ --bre-surface: #292929;
67
+ --bre-sunken: #353638;
68
+ --bre-sunken-2: #3d3e40;
69
+ --bre-track: #434446;
70
+ --bre-accent-ink: #d3e2ff;
71
+ --bre-accent-weak: #1e335c;
72
+ --bre-accent-line: #7aaaff40;
73
+ --bre-accent-glow: #7aaaff26;
74
+ --bre-danger-weak: #3a1b18;
75
+ --bre-switch-track: #4a4b4d;
76
+ --bre-shadow-pop: 0 2px 5px #00000059, 0 12px 32px -8px #000000a6;
77
+ }
78
+
8
79
  /* The injector's mount wrapper. It \u2014 not the editor inside it \u2014 is the item
9
80
  placed into the official row disclosure's repeat(auto-fit, minmax(160px,1fr))
10
81
  grid (context window and max tokens take two cells), so the span belongs
11
82
  here: on the editor itself it would target the wrapper's block box and be
12
- ignored, squeezing the block into one cell. */
83
+ ignored, squeezing the block into one cell. The min-width floors the grid
84
+ item's auto minimum at 0 for the same reason: a one-line hint inside must
85
+ clip at the disclosure's edge, not price the host grid wider than it is. */
13
86
  .bre-effort-slot {
14
87
  grid-column: 1 / -1;
88
+ min-width: 0;
15
89
  }
16
90
  /* The slot wrapper is a plain column: the master thinking switch sits in it,
17
91
  directly above the card it gates. */
@@ -21,27 +95,123 @@ window.__ModuleLoader__.load({
21
95
  gap: 8px;
22
96
  margin: 8px 0 4px;
23
97
  }
24
- /* The \u601D\u8003\u5F3A\u5EA6 card proper \u2014 rendered only while the master switch is on. */
98
+ /* The \u601D\u8003\u5F3A\u5EA6 panel proper \u2014 rendered only while the master switch is on.
99
+ User item 8: the 0.5px outline goes away \u2014 \u6846\u91CC\u753B\u6846, a frame drawn inside a
100
+ frame, was the complaint. User item 3 then dropped the tinted fill too: the
101
+ editor sits INSIDE the official card, so a grey slab read as a second card
102
+ nested in the first. The panel now paints the same fill as the host's own
103
+ row cards and takes its structure from spacing alone. */
25
104
  .bre-effort-card {
26
105
  display: flex;
27
106
  flex-direction: column;
28
- gap: 8px;
29
- padding: 10px 12px;
30
- border: 0.5px solid var(--dsw-alias-border-l2);
31
- border-radius: 8px;
32
- background: var(--dsw-alias-bg-layer-2);
107
+ gap: 13px;
108
+ padding: 13px 15px 12px;
109
+ border: none;
110
+ border-radius: var(--bre-r-md);
111
+ background: var(--dsw-alias-settings-card-fill, #ffffff);
33
112
  box-sizing: border-box;
34
113
  }
35
- .bre-effort-head {
114
+ /* The editor's one-line head: the master switch with its title, the declared
115
+ state, and the applied suggestion's provenance pill. */
116
+ .bre-effort-top {
36
117
  display: flex;
37
118
  align-items: center;
38
- justify-content: space-between;
39
- gap: 8px;
119
+ flex-wrap: wrap;
120
+ gap: 9px;
40
121
  }
41
- .bre-effort-title {
122
+ .bre-effort-state {
42
123
  font-size: 12px;
43
- font-weight: 600;
44
- color: var(--dsw-alias-label-secondary);
124
+ color: var(--bre-ink-3);
125
+ }
126
+ .bre-effort-title {
127
+ /* The section title reads as the panel's own heading: primary ink at the
128
+ design's 13/500, not a grey caption \u2014 it names the row, the hints under
129
+ it carry the explanation. The headers pane borrows the same face. */
130
+ font-size: 13px;
131
+ font-weight: 500;
132
+ letter-spacing: -0.005em;
133
+ color: var(--bre-ink);
134
+ }
135
+ /* The master switch, at the board's small size: a 28x16 track with a 12px knob.
136
+ The native checkbox stays \u2014 it is the accessible control, it keeps the row
137
+ keyboard-operable, and it is what the tests click \u2014 but it is transparent and
138
+ stretched over the track it drives. */
139
+ .bre-thinking-switch {
140
+ position: relative;
141
+ display: inline-flex;
142
+ align-items: center;
143
+ gap: 7px;
144
+ flex: none;
145
+ margin: 0;
146
+ cursor: pointer;
147
+ }
148
+ .bre-thinking-switch input[type='checkbox'] {
149
+ position: absolute;
150
+ left: 0;
151
+ top: 50%;
152
+ z-index: 1;
153
+ width: 28px;
154
+ height: 16px;
155
+ margin: -8px 0 0;
156
+ padding: 0;
157
+ opacity: 0;
158
+ cursor: pointer;
159
+ }
160
+ .bre-effort-switch-track {
161
+ position: relative;
162
+ flex: none;
163
+ width: 28px;
164
+ height: 16px;
165
+ border-radius: var(--bre-r-pill);
166
+ background: var(--bre-switch-track);
167
+ transition: background var(--bre-t) var(--bre-ease);
168
+ }
169
+ .bre-effort-switch-track::after {
170
+ content: '';
171
+ position: absolute;
172
+ top: 2px;
173
+ left: 2px;
174
+ width: 12px;
175
+ height: 12px;
176
+ border-radius: 50%;
177
+ background: var(--bre-switch-knob);
178
+ box-shadow: 0 1px 2px #0f111533;
179
+ transition: transform var(--bre-t) var(--bre-ease);
180
+ }
181
+ .bre-thinking-switch input:checked + .bre-effort-switch-track {
182
+ background: var(--dsw-alias-brand-primary, #4d6bfe);
183
+ }
184
+ .bre-thinking-switch input:checked + .bre-effort-switch-track::after {
185
+ transform: translateX(12px);
186
+ }
187
+ .bre-thinking-switch input:focus-visible + .bre-effort-switch-track {
188
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
189
+ }
190
+ .bre-thinking-switch input:disabled + .bre-effort-switch-track {
191
+ opacity: 0.4;
192
+ cursor: default;
193
+ }
194
+ /* The applied suggestion, as the board's pill: 22px, a hairline, quiet ink, and
195
+ the accent glyph that marks it as advice rather than state. */
196
+ .bre-effort-suggest {
197
+ display: inline-flex;
198
+ align-items: center;
199
+ gap: 5px;
200
+ max-width: 100%;
201
+ height: 22px;
202
+ padding: 0 8px;
203
+ border-radius: var(--bre-r-pill);
204
+ border: 1px solid var(--bre-line-2);
205
+ background: var(--bre-surface);
206
+ font-size: 11px;
207
+ color: var(--bre-ink-2);
208
+ white-space: nowrap;
209
+ overflow: hidden;
210
+ text-overflow: ellipsis;
211
+ }
212
+ .bre-effort-suggest svg {
213
+ flex: none;
214
+ color: var(--bre-accent);
45
215
  }
46
216
  .bre-link-button {
47
217
  background: none;
@@ -81,53 +251,344 @@ window.__ModuleLoader__.load({
81
251
  background: var(--dsw-alias-interactive-bg-hover, #2631480f);
82
252
  color: var(--dsw-alias-label-secondary, #374151);
83
253
  }
84
- .bre-effort-grid {
85
- /* Exactly two equal columns mirroring the official capacity pair the editor
86
- sits under; an odd row count leaves the last cell in the left column,
87
- so the left side carries the extra level. */
88
- display: grid;
89
- grid-template-columns: repeat(2, minmax(0, 1fr));
90
- gap: 4px 16px;
254
+ /* The level ladder is a row of toggle pills: the armed ones carry the accent
255
+ tint alone (\u9009\u4E2D\u7684\u6863\u4F4D\u9AD8\u4EAE\u5373\u53EF\uFF0C\u65E0\u9700\u5BF9\u52FE), the rest stay quiet outlines. One
256
+ click is one declaration. The pills are TIGHT \u2014 seven levels must sit on one
257
+ line in the row disclosure (a wrapped ladder with an orphaned last pill reads
258
+ as two ladders); the wire spellings live folded behind the link beneath. */
259
+ .bre-pillrow {
260
+ display: flex;
261
+ flex-wrap: wrap;
262
+ gap: 6px;
91
263
  }
92
- .bre-effort-row {
93
- display: grid;
94
- grid-template-columns: 20px 76px minmax(0, 1fr);
264
+ /* The level ladder and the modality pair share one pill face: 28px, an
265
+ 8px corner and a hairline stroke, so a row of them reads as one control. The
266
+ armed pill is the DESIGN's selection \u2014 accent tint, accent edge, accent ink,
267
+ and NO tick (\u9009\u4E2D\u7684\u6863\u4F4D\u9AD8\u4EAE\u5373\u53EF\uFF0C\u65E0\u9700\u5BF9\u52FE: a second glyph would also shift the
268
+ row's width every time a level is clicked). */
269
+ .bre-lvl {
270
+ appearance: none;
271
+ display: inline-flex;
95
272
  align-items: center;
96
- gap: 6px;
273
+ gap: 4px;
274
+ height: 28px;
275
+ padding: 0 10px;
276
+ border-radius: var(--bre-r-sm);
277
+ border: 1px solid var(--bre-line-3);
278
+ background: var(--bre-surface);
279
+ color: var(--bre-ink-2);
280
+ font: inherit;
97
281
  font-size: 12px;
282
+ line-height: 1;
283
+ white-space: nowrap;
284
+ cursor: pointer;
285
+ transition: all var(--bre-t) var(--bre-ease);
98
286
  }
99
- .bre-effort-row input[type='checkbox'] {
100
- /* Bigger than the browser default (~13px): a tap/point target that does
101
- not require precision, in the theme accent when checked. */
102
- width: 18px;
287
+ .bre-lvl:hover:not(:disabled) {
288
+ border-color: var(--bre-line-4);
289
+ color: var(--bre-ink);
290
+ }
291
+ .bre-lvl:focus-visible {
292
+ outline: none;
293
+ border-color: var(--bre-accent);
294
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
295
+ }
296
+ .bre-lvl:disabled { opacity: 0.55; cursor: default; }
297
+ .bre-lvl.is-on {
298
+ border-color: var(--bre-accent-line);
299
+ background: var(--bre-accent-weak);
300
+ color: var(--bre-accent-ink);
301
+ font-weight: 500;
302
+ }
303
+ /* A level the stored ladder names but this draft leaves unarmed: still
304
+ clickable, simply standing back (the board's is-dim state). */
305
+ .bre-lvl.is-dim { opacity: 0.45; }
306
+ /* The modality pair: the glyph is the identity, so it takes the wider padding
307
+ and carries its own ink \u2014 quiet when the declaration does not include it, the
308
+ accent when it does. */
309
+ .bre-lvl--opt { gap: 6px; padding: 0 11px; }
310
+ .bre-lvl--opt svg { flex: none; color: var(--bre-ink-3); }
311
+ .bre-lvl--opt.is-on svg { color: var(--bre-accent); }
312
+ /* The slider's head, written above the track (\u8FDB\u5EA6\u6761\u4E0A\u65B9\uFF1A\u601D\u8003\u7B49\u7EA7 + \u5F53\u524D\u7B49\u7EA7):
313
+ the section name on the left, the level under the thumb on the right. One
314
+ accent, so the value reads as "this is the current setting", not as a rank. */
315
+ .bre-effort-slider-head {
316
+ display: flex;
317
+ align-items: baseline;
318
+ justify-content: space-between;
319
+ gap: 8px;
320
+ margin-bottom: 6px;
321
+ }
322
+ .bre-effort-slider-head-label {
323
+ font-size: 11.5px;
324
+ line-height: 18px;
325
+ color: var(--bre-ink-3);
326
+ }
327
+ .bre-effort-slider-head-value {
328
+ font-size: 12.5px;
329
+ line-height: 18px;
330
+ font-weight: 600;
331
+ letter-spacing: -.005em;
332
+ color: var(--bre-accent-ink);
333
+ }
334
+ /* The level slider: the composer menu's reasoning-level footer. A long ladder
335
+ wrapped its capsule row inside the popover (\u601D\u8003\u7B49\u7EA7\u9009\u62E9\u6362\u6210\u8FDB\u5EA6\u6761\u6837\u5F0F); a
336
+ track is fixed-length whatever the ladder's size, the stop names written
337
+ below it.
338
+
339
+ The rainbow ramp is GONE: a red stop read as "danger" where the interface
340
+ meant "more", and the seven-hue scale was the one place the plugin spoke a
341
+ colour language the host never uses. What is left is the host's own accent
342
+ for "where the thumb is" and tick marks for "how many stops there are". */
343
+ .bre-effort-slider {
344
+ position: relative;
103
345
  height: 18px;
346
+ cursor: pointer;
347
+ touch-action: none;
348
+ }
349
+ .bre-effort-slider::before {
350
+ content: '';
351
+ position: absolute;
352
+ left: 0;
353
+ right: 0;
354
+ top: 50%;
355
+ height: 6px;
356
+ transform: translateY(-50%);
357
+ border-radius: 999px;
358
+ background: var(--bre-track);
359
+ }
360
+ .bre-effort-slider:focus-visible {
361
+ outline: none;
362
+ border-radius: 999px;
363
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
364
+ }
365
+ .bre-effort-slider-fill {
366
+ position: absolute;
367
+ left: 0;
368
+ right: 0;
369
+ top: 50%;
370
+ height: 6px;
371
+ transform: translateY(-50%);
372
+ border-radius: 999px;
373
+ background: var(--bre-accent);
374
+ pointer-events: none;
375
+ }
376
+ /* The remaining stops, sunk into the track as 2px holes. Painted white on the
377
+ light theme and near-black on the dark one: they are holes, not dots, so they
378
+ take the surface colour rather than an ink colour. */
379
+ .bre-effort-slider-tick {
380
+ position: absolute;
381
+ top: 50%;
382
+ width: 2px;
383
+ height: 2px;
384
+ margin-left: -1px;
385
+ margin-top: -1px;
386
+ border-radius: 50%;
387
+ background: var(--bre-surface);
388
+ opacity: .9;
389
+ pointer-events: none;
390
+ }
391
+ .bre-effort-slider-thumb {
392
+ position: absolute;
393
+ top: 50%;
394
+ width: 14px;
395
+ height: 14px;
396
+ border-radius: 999px;
397
+ transform: translate(-50%, -50%);
398
+ background: var(--bre-surface);
399
+ box-shadow: 0 0 0 1px var(--bre-accent-line), 0 1px 3px #0f11152e;
400
+ pointer-events: none;
401
+ /* User item 4: a committed level used to teleport the thumb. The two settling
402
+ nodes glide instead \u2014 and the glide is switched off the moment the pointer
403
+ takes the track, or the drag itself would lag one frame behind the finger. */
404
+ transition: left var(--bre-t) var(--bre-ease);
405
+ }
406
+ .bre-effort-slider-fill {
407
+ transition: clip-path var(--bre-t) var(--bre-ease);
408
+ }
409
+ .bre-effort-slider[data-bre-dragging='true'] .bre-effort-slider-thumb,
410
+ .bre-effort-slider[data-bre-dragging='true'] .bre-effort-slider-fill {
411
+ transition: none;
412
+ }
413
+ /* The stops, written under the track: first left-aligned, last right-aligned,
414
+ the middle ones centred on their stop, so the row never wraps. */
415
+ .bre-effort-slider-labels {
416
+ position: relative;
417
+ height: 14px;
418
+ margin: 5px 2px 0;
419
+ }
420
+ .bre-effort-slider-label {
421
+ position: absolute;
422
+ transform: translateX(-50%);
423
+ font-size: 9.5px;
424
+ line-height: 14px;
425
+ letter-spacing: -.02em;
426
+ color: var(--bre-ink-hint);
427
+ white-space: nowrap;
428
+ }
429
+ .bre-effort-slider-label.is-first { transform: none; }
430
+ .bre-effort-slider-label.is-last { transform: translateX(-100%); }
431
+ .bre-effort-slider-label.is-on {
432
+ color: var(--bre-accent-ink);
433
+ font-weight: 600;
434
+ }
435
+ /* A section of the panel: the label row, the hint that explains it, and the
436
+ control group. The board spaces the three at 9px, and gives the label row a
437
+ 22px floor so a section with a trailing action still lines up with one that
438
+ has none. */
439
+ .bre-effort-sec {
440
+ display: flex;
441
+ flex-direction: column;
442
+ gap: 9px;
443
+ }
444
+ .bre-effort-labelrow {
445
+ display: flex;
446
+ align-items: center;
447
+ gap: 8px;
448
+ min-height: 22px;
449
+ }
450
+ .bre-effort-label {
451
+ font-size: 12px;
452
+ font-weight: 500;
453
+ letter-spacing: -0.005em;
454
+ color: var(--bre-ink-2);
455
+ }
456
+ /* User item 8: the explanation moved OUT of the label row. As an ellipsised
457
+ fragment beside the label it was unreadable at the disclosure's width; on its
458
+ own line at 11/16 the whole sentence fits, which is what the board draws. */
459
+ .bre-effort-hint {
460
+ font-size: 11px;
461
+ line-height: 16px;
462
+ color: var(--bre-ink-4);
463
+ }
464
+ .bre-effort-grow { flex: 1 1 auto; min-width: 0; }
465
+ /* The label row's trailing action (\u81EA\u52A8\u9002\u914D): the board's quiet button \u2014 26px,
466
+ a hairline, quiet ink \u2014 not a link. */
467
+ .bre-effort-adapt {
468
+ flex: none;
469
+ display: inline-flex;
470
+ align-items: center;
471
+ gap: 5px;
472
+ height: 26px;
473
+ padding: 0 9px;
474
+ margin-left: auto;
475
+ border: 1px solid var(--bre-line-2);
476
+ border-radius: var(--bre-r-sm);
477
+ background: var(--bre-surface);
478
+ color: var(--bre-ink-2);
479
+ font: inherit;
480
+ font-size: 11.5px;
481
+ cursor: pointer;
482
+ transition: background var(--bre-t) var(--bre-ease), border-color var(--bre-t) var(--bre-ease), color var(--bre-t) var(--bre-ease);
483
+ }
484
+ .bre-effort-adapt:hover:not(:disabled) {
485
+ border-color: var(--bre-line-4);
486
+ color: var(--bre-ink);
487
+ }
488
+ .bre-effort-adapt:disabled { opacity: 0.5; cursor: default; }
489
+ .bre-effort-adapt svg { flex: none; color: var(--bre-accent); }
490
+ /* The quiet link that unfolds the armed levels' wire spellings: 22px tall at
491
+ 11.5px, hanging at the left edge of the group it opens. */
492
+ .bre-effort-wiretoggle {
493
+ align-self: flex-start;
494
+ display: inline-flex;
495
+ align-items: center;
496
+ gap: 4px;
497
+ height: 22px;
104
498
  margin: 0;
105
- accent-color: var(--dsw-alias-brand-primary);
499
+ padding: 0 2px;
500
+ border: none;
501
+ background: none;
502
+ font: inherit;
503
+ font-size: 11.5px;
504
+ color: var(--bre-ink-3);
106
505
  cursor: pointer;
107
506
  }
108
- .bre-effort-level { color: var(--dsw-alias-label-tertiary); }
507
+ .bre-effort-wiretoggle:hover:not(:disabled) { color: var(--bre-ink); }
508
+ .bre-effort-wiretoggle:disabled { opacity: 0.5; cursor: default; }
509
+ .bre-effort-wiretoggle svg { flex: none; }
510
+ /* The wire spellings: the board's own block \u2014 a white sheet on the sunken panel,
511
+ one 92px name column and one value column per armed level, the value set in
512
+ the code face so a spelling's punctuation is legible. */
513
+ .bre-wire {
514
+ display: flex;
515
+ flex-direction: column;
516
+ gap: 8px;
517
+ padding: 10px 12px;
518
+ border: 1px solid var(--bre-line-1);
519
+ border-radius: var(--bre-r-sm);
520
+ background: var(--bre-surface);
521
+ }
522
+ .bre-wire-grid {
523
+ display: grid;
524
+ grid-template-columns: 92px minmax(0, 1fr);
525
+ gap: 6px 10px;
526
+ align-items: center;
527
+ }
528
+ .bre-wire-name {
529
+ font-size: 11px;
530
+ letter-spacing: 0.01em;
531
+ color: var(--bre-ink-4);
532
+ white-space: nowrap;
533
+ overflow: hidden;
534
+ text-overflow: ellipsis;
535
+ }
536
+ /* The sections below the ladder sit in two columns on a wide disclosure and
537
+ stack on a narrow one: the board's 1fr 1fr, floored so a squeezed column
538
+ never wraps a note into three lines. */
539
+ .bre-effort-cols {
540
+ display: grid;
541
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
542
+ gap: 18px;
543
+ align-items: start;
544
+ }
109
545
  .bre-effort-wire {
110
546
  box-sizing: border-box;
547
+ width: 100%;
111
548
  min-width: 0;
112
- height: 24px;
113
- padding: 0 6px;
114
- border: 0.5px solid var(--dsw-alias-border-l4);
115
- border-radius: 4px;
116
- background: var(--dsw-alias-bg-layer-1);
117
- color: var(--dsw-alias-label-primary);
118
- font: inherit;
119
- font-size: 12px;
549
+ height: 26px;
550
+ padding: 0 8px;
551
+ border: 1px solid var(--bre-line-2);
552
+ border-radius: 6px;
553
+ background: var(--bre-surface);
554
+ color: var(--bre-ink-2);
555
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
556
+ font-size: 11px;
557
+ text-overflow: ellipsis;
120
558
  }
559
+ .bre-effort-wire::placeholder { color: var(--bre-ink-4); }
121
560
  .bre-effort-wire:focus {
122
561
  outline: none;
123
- border-color: var(--dsw-alias-brand-primary);
562
+ border-color: var(--bre-accent);
563
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
564
+ }
565
+ /* A hairline between the panel's groups (the board's eff-sep). */
566
+ .bre-effort-sep {
567
+ height: 1px;
568
+ margin: 0;
569
+ border: none;
570
+ background: var(--bre-line-1);
124
571
  }
125
- .bre-effort-empty { min-height: 24px; }
126
572
  .bre-effort-actions {
127
573
  display: flex;
128
574
  gap: 8px;
129
575
  justify-content: flex-end;
130
576
  }
577
+ /* The panel's only action is \u653E\u5F03\u4FEE\u6539, and the board draws it as a ghost \u2014 no
578
+ border, no fill, quiet ink \u2014 so the row does not end on a second button-shaped
579
+ promise beside the card's own \u4FDD\u5B58. */
580
+ .bre-effort-actions .bre-secondary-button {
581
+ height: 28px;
582
+ padding: 0 10px;
583
+ border-color: transparent;
584
+ background: transparent;
585
+ color: var(--bre-ink-2);
586
+ font-size: 12px;
587
+ }
588
+ .bre-effort-actions .bre-secondary-button:hover:not(:disabled) {
589
+ background: var(--bre-hover);
590
+ color: var(--bre-ink);
591
+ }
131
592
  .bre-secondary-button {
132
593
  height: 26px;
133
594
  padding: 0 12px;
@@ -141,31 +602,57 @@ window.__ModuleLoader__.load({
141
602
  .bre-effort-message { font-size: 12px; margin: 0; }
142
603
  .bre-effort-message.bre-error { color: #c62828; }
143
604
  .bre-effort-message.bre-info { color: var(--dsw-alias-link); }
144
- .bre-effort-note { font-size: 11px; margin: 0; color: var(--dsw-alias-label-tertiary); }
145
- /* ---- Input-modality section ---- */
146
- .bre-modality {
147
- display: flex;
148
- flex-direction: column;
149
- gap: 4px;
150
- }
151
- .bre-modality-row {
152
- display: flex;
153
- align-items: center;
154
- gap: 6px;
155
- font-size: 12px;
156
- }
157
- .bre-modality-row input[type='checkbox'] {
158
- width: 18px;
159
- height: 18px;
605
+ /* The note under a control: the board's third level of explanation \u2014 11/16 in
606
+ the faintest ink, an optional 12px glyph hanging in the left margin. Kept as
607
+ flowing text (not a flex row) because the headers pane writes whole sentences
608
+ through this same class and a flex container would make every text run its own
609
+ unwrappable item. */
610
+ .bre-effort-note {
611
+ font-size: 11px;
612
+ line-height: 16px;
160
613
  margin: 0;
161
- accent-color: var(--dsw-alias-brand-primary);
614
+ color: var(--bre-ink-4);
615
+ }
616
+ .bre-effort-note svg {
617
+ display: inline-block;
618
+ vertical-align: -2px;
619
+ margin-right: 6px;
620
+ flex: none;
621
+ color: var(--bre-ink-4);
622
+ }
623
+ /* The default-effort dropdown, drawn as the board's mini-select: a 30px white
624
+ box with a hairline and the same 12px chevron the other selects use, so it
625
+ reads as one of the panel's controls rather than a form field dropped in.
626
+ It stays a REAL select (aria-label included) because that is what the row
627
+ stores a level into. */
628
+ .bre-effort-select {
629
+ flex: none;
630
+ width: 100%;
631
+ max-width: 260px;
632
+ height: 30px;
633
+ min-width: 0;
634
+ padding: 0 30px 0 9px;
635
+ border: 1px solid var(--bre-line-3);
636
+ border-radius: var(--bre-r-sm);
637
+ background-color: var(--bre-surface);
638
+ color: var(--bre-ink);
639
+ font: inherit;
640
+ font-size: 12.5px;
162
641
  cursor: pointer;
642
+ appearance: none;
643
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2381858C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
644
+ background-repeat: no-repeat;
645
+ background-position: right 9px center;
646
+ background-size: 12px 12px;
647
+ transition: border-color var(--bre-t) var(--bre-ease), box-shadow var(--bre-t) var(--bre-ease);
163
648
  }
164
- .bre-modality-clear { margin-left: auto; }
165
- .bre-modality-note { font-size: 11px; margin: 0; color: var(--dsw-alias-label-tertiary); }
166
- /* The master thinking switch, which lives OUTSIDE the card it gates: with it
167
- off that card is not rendered at all, so nothing here has to be hidden. */
168
- .bre-thinking-switch { margin: 0; }
649
+ .bre-effort-select:hover:not(:disabled) { border-color: var(--bre-line-4); }
650
+ .bre-effort-select:focus-visible {
651
+ outline: none;
652
+ border-color: var(--bre-accent);
653
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
654
+ }
655
+ .bre-effort-select:disabled { opacity: 0.55; cursor: default; }
169
656
  .bre-select, .bre-text-input {
170
657
  box-sizing: border-box;
171
658
  width: 100%;
@@ -180,10 +667,15 @@ window.__ModuleLoader__.load({
180
667
  font-size: 14px;
181
668
  line-height: 22px;
182
669
  }
183
- .bre-text-input::placeholder { color: var(--dsw-alias-label-dimmed); }
670
+ /* Dimmed directly would be the host's skeleton tone (#e1e5ee) \u2014 the same trap the
671
+ ink tokens now route around; placeholders read at tertiary like every other one. */
672
+ .bre-text-input::placeholder { color: var(--bre-ink-4); }
184
673
  .bre-select:focus, .bre-text-input:focus {
185
674
  outline: none;
186
675
  border-color: var(--dsw-alias-brand-primary);
676
+ /* The redesign's focus token: brand border over a soft brand halo, so the
677
+ focused field reads at a glance without a hard outline. */
678
+ box-shadow: 0 0 0 3px var(--dsw-alias-brand-primary-muted, rgba(77, 112, 255, .14));
187
679
  }
188
680
  .bre-select:disabled, .bre-text-input:disabled { opacity: 0.6; cursor: default; }
189
681
  .bre-select {
@@ -206,19 +698,64 @@ window.__ModuleLoader__.load({
206
698
  flex-direction: column;
207
699
  gap: 3px;
208
700
  }
209
- .bre-reference {
701
+ /* The two capacities are EDITABLE fields, not a footnote (user request: \u4E0A\u4E0B\u6587
702
+ \u53C2\u6570/\u6700\u5927\u957F\u5EA6\u8FD9\u4E24\u4E2A\u53C2\u6570\u9700\u8981\u53EF\u4EE5\u914D\u7F6E): each is the row's own official input,
703
+ mirrored here, so the label sits above a sunken field with the unit inside it.
704
+ Blank is a value \u2014 \u6CBF\u7528\u76EE\u5F55\u503C \u2014 which is why the placeholder says so. */
705
+ .bre-effort-caps {
706
+ display: grid;
707
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
708
+ gap: 18px;
709
+ }
710
+ .bre-cap {
210
711
  display: flex;
211
- flex-wrap: wrap;
212
- align-items: baseline;
213
- gap: 4px 14px;
214
- padding: 6px 8px;
215
- border: 1px dashed var(--dsw-alias-border-l3);
216
- border-radius: 6px;
217
- font-size: 11px;
218
- color: var(--dsw-alias-label-tertiary);
712
+ flex-direction: column;
713
+ gap: 7px;
714
+ min-width: 0;
715
+ }
716
+ .bre-cap-box {
717
+ display: flex;
718
+ align-items: center;
719
+ gap: 8px;
720
+ height: 30px;
721
+ padding: 0 9px;
722
+ border-radius: var(--bre-r-sm);
723
+ border: 1px solid var(--bre-line-3);
724
+ background: var(--bre-surface);
725
+ transition: border-color var(--bre-t) var(--bre-ease), box-shadow var(--bre-t) var(--bre-ease);
726
+ }
727
+ .bre-cap-box:hover { border-color: var(--bre-line-4); }
728
+ .bre-cap-box:focus-within {
729
+ border-color: var(--bre-accent);
730
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
731
+ }
732
+ .bre-cap-input {
733
+ flex: 1 1 auto;
734
+ min-width: 0;
735
+ border: none;
736
+ background: none;
737
+ outline: none;
738
+ padding: 0;
739
+ font: inherit;
740
+ font-size: 12.5px;
741
+ font-variant-numeric: tabular-nums;
742
+ color: var(--bre-ink);
743
+ }
744
+ .bre-cap-input::placeholder { color: var(--bre-ink-4); }
745
+ .bre-cap-input:disabled { color: var(--bre-ink-4); cursor: default; }
746
+ .bre-cap-unit {
747
+ flex: none;
748
+ font-size: 10.5px;
749
+ letter-spacing: 0.02em;
750
+ color: var(--bre-ink-4);
751
+ }
752
+ /* A warning note: the board keeps the sentence in quiet ink and puts the colour
753
+ on the glyph alone, so a panel with two warnings does not read as two alarms.
754
+ The headers pane has no glyph in its notes and re-colours them for itself. */
755
+ .bre-effort-note.bre-warn {
756
+ color: var(--bre-ink-3);
219
757
  }
220
- .bre-reference-title { font-weight: 600; }
221
- .bre-reference-values { display: inline-flex; gap: 14px; }
758
+ .bre-effort-note.bre-warn svg { color: var(--bre-warn); }
222
759
  /* ---- Composer model menu (mounted inside the OFFICIAL menu) ----
223
760
  The body and host sizing follow HanaAyane's dsh-reasoning-effort (MIT).
224
761
  The model and reasoning-level rows below use the current row/list UI. */
@@ -261,60 +798,173 @@ window.__ModuleLoader__.load({
261
798
  white-space: nowrap;
262
799
  }
263
800
 
264
- /* ---- Model / reasoning-level rows ----
265
- Presentation follows dsh-tauri-model-config's settings rows
266
- (src/client/models/styles.ts: .zGbnIq_rowCard / .zGbnIq_rowHead /
267
- .zGbnIq_iconButton): hairline separators between rows and a list opening
268
- under the row it belongs to. Re-prefixed bre- and routed through the tokens
269
- this file already uses. */
270
- /* Layout only \u2014 it deliberately paints NO background, border, radius or
271
- overflow clip. The replica is mounted inside the OFFICIAL menu, and that
272
- shell already draws its own surface (MenuSurface: a [data-menu-material]
273
- panel whose .material child paints --dsw-menu-surface-fill, i.e.
274
- --dsw-specific-menu, under backdrop-filter: var(--dsw-menu-backdrop-filter),
275
- rounded by --dsw-radius-lg and outlined by --dsw-elevation-prominent).
276
- A second opaque card in here shows that official surface as a grey frame
277
- around it \u2014 two stacked surfaces where every other menu in the app has one. */
801
+ /* ---- Model switcher body ----
802
+ One quiet head names the current model; the provider and model columns are
803
+ ALWAYS visible (no drill-in row); a resident search box sits above them; the
804
+ reasoning level is switched in place on a single-accent track. No panel ever
805
+ opens or closes, so the body's height is settled at mount and the commit paths
806
+ carry no re-measure dance.
807
+
808
+ The redesign's two rules on this surface: no boxed-in-box (the only strokes
809
+ are the search's focus ring and one hairline between the columns), and one
810
+ accent, spent only on "this is the selection". */
278
811
  .bre-card {
279
812
  display: flex;
280
813
  flex-direction: column;
814
+ gap: 6px;
281
815
  }
282
- .bre-row-control {
283
- appearance: none;
284
- box-sizing: border-box;
816
+ /* The head: a small caps-free label on the left, the current model pushed right
817
+ with its provider muted behind it. The level used to be repeated here as a
818
+ pill; it now lives once, in the footer, where it is also editable. */
819
+ .bre-menu-head {
285
820
  display: flex;
286
821
  align-items: center;
287
822
  gap: 8px;
823
+ height: 30px;
824
+ padding: 0 2px;
825
+ }
826
+ .bre-menu-cur {
827
+ display: inline-flex;
828
+ align-items: baseline;
829
+ gap: 6px;
830
+ min-width: 0;
831
+ margin-left: auto;
832
+ }
833
+ .bre-menu-name {
834
+ overflow: hidden;
835
+ text-overflow: ellipsis;
836
+ white-space: nowrap;
837
+ max-width: 150px;
838
+ font-size: 13px;
839
+ font-weight: 600;
840
+ letter-spacing: -.005em;
841
+ color: var(--bre-ink);
842
+ }
843
+ .bre-menu-prov {
844
+ flex: none;
845
+ font-size: 10.5px;
846
+ color: var(--bre-ink-hint);
847
+ white-space: nowrap;
848
+ }
849
+ /* The resident search. Deliberately its OWN class family (not the official
850
+ pane's .bre-search-input-*): the replica and the official search box share a
851
+ menu, and every probe that looks for the official box must not find the
852
+ replica's. The box is a sunken well, not an outlined field: the field's stroke
853
+ would be the second rectangle on a surface that already has the card's edge. */
854
+ .bre-menu-search { padding: 0; }
855
+ .bre-menu-search-box {
856
+ display: flex;
857
+ align-items: center;
858
+ position: relative;
288
859
  width: 100%;
289
- min-height: 38px;
290
- padding: 0 10px;
291
- border: 0;
292
- /* Matches the official menu cells (.u91W7W_cell / .u91W7W_option use
293
- --dsw-radius-md, 8px here) and the .bre-option rows below, now that the
294
- surface behind the rows is the menu's own and hover is no longer clipped
295
- by a card. */
296
- border-radius: 8px;
297
- background: transparent;
860
+ height: 30px;
861
+ padding: 0 4px 0 8px;
862
+ box-sizing: border-box;
863
+ border-radius: var(--bre-r-sm);
864
+ background: var(--bre-sunken);
865
+ border: 1px solid transparent;
866
+ color: var(--bre-ink-4);
867
+ transition: background var(--bre-t) var(--bre-ease), border-color var(--bre-t) var(--bre-ease),
868
+ box-shadow var(--bre-t) var(--bre-ease);
869
+ }
870
+ .bre-menu-search-box:focus-within {
871
+ background: var(--bre-surface);
872
+ border-color: var(--bre-accent);
873
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
874
+ }
875
+ .bre-menu-search-icon {
876
+ display: flex;
877
+ align-items: center;
878
+ justify-content: center;
879
+ flex: 0 0 16px;
880
+ width: 16px;
881
+ height: 16px;
882
+ margin-right: 6px;
298
883
  color: inherit;
884
+ pointer-events: none;
885
+ }
886
+ .bre-menu-search-icon svg { width: 13px; height: 13px; }
887
+ .bre-menu-search-input {
888
+ flex: 1 1 auto;
889
+ min-width: 0;
890
+ height: 100%;
891
+ padding: 0;
892
+ border: none;
893
+ outline: none;
894
+ background: transparent;
895
+ color: var(--bre-ink);
299
896
  font: inherit;
300
- text-align: left;
897
+ font-size: 12.5px;
898
+ line-height: 18px;
899
+ }
900
+ .bre-menu-search-input::placeholder {
901
+ color: var(--bre-ink-4);
902
+ opacity: 1;
903
+ }
904
+ .bre-menu-search-clear {
905
+ display: flex;
906
+ align-items: center;
907
+ justify-content: center;
908
+ flex: 0 0 20px;
909
+ width: 20px;
910
+ height: 20px;
911
+ margin-left: 4px;
912
+ padding: 0;
913
+ border: none;
914
+ border-radius: 5px;
915
+ background: var(--bre-sunken-2);
916
+ color: var(--bre-ink-3);
301
917
  cursor: pointer;
302
- transition: background 120ms ease;
918
+ transition: background var(--bre-t) var(--bre-ease), color var(--bre-t) var(--bre-ease);
303
919
  }
304
- .bre-row-control:hover:not(:disabled) {
305
- background: var(--dsw-alias-interactive-bg-hover, rgba(120, 125, 140, .09));
920
+ .bre-menu-search-clear:hover {
921
+ background: var(--bre-active);
922
+ color: var(--bre-ink);
306
923
  }
307
- .bre-row-control.is-open { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09)); }
308
- .bre-row-control:disabled { cursor: default; opacity: .6; }
309
- .bre-row-control:focus-visible {
310
- outline: none;
311
- box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
924
+ .bre-menu-search-clear svg { width: 12px; height: 12px; }
925
+ /* The provider cell's model count, where the drill chevron used to sit: the
926
+ columns are always open, so the number is the only fact a chevron added. */
927
+ .bre-provider-count {
928
+ flex: none;
929
+ margin-left: auto;
930
+ font-size: 10px;
931
+ font-variant-numeric: tabular-nums;
932
+ color: var(--bre-ink-hint);
933
+ }
934
+ /* While the search holds a query the model column lists matches across every
935
+ provider; the muted prefix says which one each row belongs to. */
936
+ .bre-option-origin { color: var(--bre-ink-hint); }
937
+ /* The footer: the reasoning level switched IN PLACE \u2014 its name on the left and
938
+ the level under the thumb on the right, above a 6px track whose stops are
939
+ tick marks and whose names are written under it. The track spans the full
940
+ width, so each name sits under its own stop whatever the ladder's size. */
941
+ .bre-menu-foot {
942
+ display: flex;
943
+ flex-direction: column;
944
+ padding-top: 8px;
945
+ border-top: 1px solid var(--bre-line-1);
946
+ }
947
+ .bre-menu-slider {
948
+ display: flex;
949
+ flex-direction: column;
950
+ min-width: 0;
312
951
  }
952
+ .bre-menu-slider:focus-within { outline: none; }
953
+ /* Layout only \u2014 it deliberately paints NO background, border, radius or
954
+ overflow clip. The replica is mounted inside the OFFICIAL menu, and that
955
+ shell already draws its own surface (MenuSurface: a [data-menu-material]
956
+ panel whose .material child paints --dsw-menu-surface-fill, i.e.
957
+ --dsw-specific-menu, under backdrop-filter: var(--dsw-menu-backdrop-filter),
958
+ rounded by --dsw-radius-lg and outlined by --dsw-elevation-prominent).
959
+ A second opaque card in here shows that official surface as a grey frame
960
+ around it \u2014 two stacked surfaces where every other menu in the app has one. */
313
961
  .bre-row-label {
314
962
  flex: none;
315
- font-size: 13px;
316
- line-height: 20px;
317
- color: var(--dsw-alias-label-secondary);
963
+ font-size: 11.5px;
964
+ line-height: 18px;
965
+ font-weight: 500;
966
+ letter-spacing: .02em;
967
+ color: var(--bre-ink-hint);
318
968
  }
319
969
  .bre-row-value {
320
970
  flex: 1 1 auto;
@@ -323,86 +973,102 @@ window.__ModuleLoader__.load({
323
973
  text-overflow: ellipsis;
324
974
  white-space: nowrap;
325
975
  text-align: right;
326
- font-size: 13px;
327
- line-height: 20px;
328
- font-weight: 500;
329
- color: var(--dsw-alias-label-primary);
976
+ font-size: 12.5px;
977
+ line-height: 18px;
978
+ font-weight: 600;
979
+ letter-spacing: -.005em;
980
+ color: var(--bre-accent-ink);
330
981
  }
331
- .bre-row-value.is-muted { font-weight: 400; color: var(--dsw-alias-label-tertiary); }
332
- .bre-divider { height: 1px; margin: 0 10px; background: var(--dsw-alias-border-l4); }
982
+ .bre-row-value.is-muted { font-weight: 400; color: var(--bre-ink-hint); }
333
983
  .bre-panel {
334
984
  display: flex;
335
985
  flex-direction: column;
336
- gap: 2px;
986
+ gap: 1px;
337
987
  max-height: 220px;
338
988
  overflow-y: auto;
339
989
  padding: 2px 6px 8px;
340
990
  }
341
991
  /* Provider column + model column of the model list, side by side. The height is
342
992
  FIXED: switching provider must not resize the card, or every click would need
343
- another same-frame re-place and any missed one shows as a jump. */
993
+ another same-frame re-place and any missed one shows as a jump. It is also
994
+ BUDGETED: head + search + panel + footer must not exceed the height the
995
+ official popover measured for the old two-row body, or the popover clips the
996
+ footer's last line (\u5207\u6362\u6A21\u578B\u4E0B\u65B9\u88AB\u622A\u65AD). The slider head above the track
997
+ (.bre-effort-slider-head: 18px of text + 6px of margin) is paid for OUT of
998
+ this height, so the card's total is unchanged. */
344
999
  .bre-panel-models {
345
1000
  flex-direction: row;
346
1001
  align-items: stretch;
347
1002
  gap: 0;
348
- height: 240px;
1003
+ height: 196px;
349
1004
  max-height: none;
350
1005
  overflow: hidden;
351
- padding: 4px 6px 8px;
1006
+ padding: 0;
352
1007
  }
353
1008
  .bre-providers {
354
1009
  flex: none;
355
1010
  display: flex;
356
1011
  flex-direction: column;
357
- gap: 2px;
358
- width: 112px;
1012
+ gap: 1px;
1013
+ width: 104px;
359
1014
  overflow-y: auto;
360
- padding-right: 2px;
1015
+ padding-right: 4px;
361
1016
  }
362
1017
  .bre-provider-models {
363
1018
  flex: 1 1 auto;
364
1019
  min-width: 0;
365
1020
  display: flex;
366
1021
  flex-direction: column;
367
- gap: 2px;
1022
+ gap: 1px;
368
1023
  overflow-y: auto;
369
1024
  margin-left: 6px;
370
1025
  padding-left: 6px;
371
- border-left: 1px solid var(--dsw-alias-border-l4);
1026
+ border-left: 1px solid var(--bre-line-1);
372
1027
  }
373
1028
  .bre-option,
374
1029
  .bre-provider {
375
1030
  appearance: none;
376
1031
  box-sizing: border-box;
1032
+ position: relative;
377
1033
  display: flex;
378
1034
  align-items: center;
379
- gap: 8px;
1035
+ gap: 6px;
380
1036
  width: 100%;
381
1037
  min-height: 30px;
382
- padding: 0 8px;
1038
+ flex: none;
1039
+ padding: 0 6px 0 8px;
383
1040
  border: 0;
384
- border-radius: 8px;
1041
+ border-radius: 7px;
385
1042
  background: transparent;
386
- color: inherit;
1043
+ color: var(--bre-ink);
387
1044
  font: inherit;
388
- font-size: 13px;
389
- line-height: 20px;
1045
+ font-size: 12.5px;
1046
+ line-height: 18px;
390
1047
  text-align: left;
391
1048
  cursor: pointer;
392
- transition: background 120ms ease, color 120ms ease;
393
- }
394
- /* The provider cell carries its chevron hard against the right edge. */
395
- .bre-provider { gap: 4px; padding: 0 4px 0 8px; }
1049
+ transition:
1050
+ background var(--bre-t) var(--bre-ease),
1051
+ color var(--bre-t) var(--bre-ease),
1052
+ opacity var(--bre-t) var(--bre-ease);
1053
+ }
1054
+ /* The provider cell reads one step quieter than its models: it is the index, the
1055
+ models are the content. */
1056
+ .bre-provider { gap: 4px; color: var(--bre-ink-2); }
396
1057
  .bre-option:hover:not(:disabled),
397
1058
  .bre-provider:hover:not(:disabled) {
398
- background: var(--dsw-alias-interactive-bg-hover, rgba(120, 125, 140, .09));
1059
+ background: var(--bre-hover);
399
1060
  }
1061
+ /* User item 4 (the model list "went grey and flashed"): the row dim used to land
1062
+ and lift with no transition, so it read as a hard blink on every pick. It is
1063
+ also a gentler step now \u2014 .55 read as "disabled", which is not what a pick
1064
+ in flight means. Opacity is in the transition list above, so the fade is the
1065
+ same 160ms every other state change on the row uses. */
400
1066
  .bre-option:disabled,
401
- .bre-provider:disabled { cursor: default; opacity: .6; }
1067
+ .bre-provider:disabled { cursor: default; opacity: .72; }
402
1068
  .bre-option:focus-visible,
403
1069
  .bre-provider:focus-visible {
404
- outline: none;
405
- box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
1070
+ outline: 2px solid var(--bre-accent);
1071
+ outline-offset: -2px;
406
1072
  }
407
1073
  .bre-option-name {
408
1074
  flex: 1 1 auto;
@@ -411,33 +1077,48 @@ window.__ModuleLoader__.load({
411
1077
  text-overflow: ellipsis;
412
1078
  white-space: nowrap;
413
1079
  }
1080
+ /* The selection: one accent tint, accent ink, and a 2px bar on the column's own
1081
+ edge \u2014 the bar is what keeps "open provider" readable once the row is tinted
1082
+ (a tint alone at 10% is a whisper in a 104px column). */
414
1083
  .bre-option.is-active {
415
- color: var(--dsw-static-deepseek-500, #4d70ff);
416
- font-weight: 500;
417
- background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
1084
+ background: var(--bre-accent-weak);
1085
+ color: var(--bre-accent-ink);
1086
+ font-weight: 600;
418
1087
  }
419
- /* The open provider is the highlighted one; the provider of the CURRENT model
420
- keeps the accent so the column says where the selection lives. */
421
- .bre-provider.is-open { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09)); }
422
- .bre-provider.is-current .bre-option-name {
423
- color: var(--dsw-static-deepseek-500, #4d70ff);
424
- font-weight: 500;
1088
+ .bre-provider.is-open {
1089
+ background: var(--bre-accent-weak);
1090
+ color: var(--bre-accent-ink);
1091
+ }
1092
+ .bre-provider.is-open::before {
1093
+ content: "";
1094
+ position: absolute;
1095
+ left: -4px;
1096
+ top: 7px;
1097
+ bottom: 7px;
1098
+ width: 2px;
1099
+ border-radius: 2px;
1100
+ background: var(--bre-accent);
425
1101
  }
426
- .bre-provider .bre-row-chevron { width: 14px; height: 14px; font-size: 14px; }
1102
+ .bre-provider.is-open .bre-provider-count { color: var(--bre-accent); opacity: .7; }
1103
+ /* The provider of the CURRENT model keeps its name at full weight, so the column
1104
+ says where the selection lives even when another provider is open. */
1105
+ .bre-provider.is-current .bre-option-name { font-weight: 600; color: var(--bre-ink); }
1106
+ .bre-provider.is-open.is-current .bre-option-name { color: var(--bre-accent-ink); }
427
1107
  /* Capability badges on a model row (image input / thinking). Muted so the name
428
1108
  stays the brightest thing in the row; the badge's own title carries the copy. */
429
1109
  .bre-option-tags {
430
1110
  flex: none;
431
1111
  display: inline-flex;
432
1112
  align-items: center;
433
- gap: 6px;
434
- color: var(--dsw-alias-label-tertiary);
1113
+ gap: 5px;
1114
+ color: var(--bre-ink-3);
1115
+ opacity: .78;
435
1116
  }
436
- .bre-option.is-active .bre-option-tags { color: var(--dsw-static-deepseek-500, #4d70ff); }
1117
+ .bre-option.is-active .bre-option-tags { color: var(--bre-accent); opacity: .9; }
437
1118
  .bre-tag { display: inline-flex; align-items: center; }
438
1119
  .bre-tag-icon { display: block; width: 13px; height: 13px; }
439
- .bre-option-check { flex: none; width: 14px; height: 14px; }
440
- .bre-empty { padding: 6px 8px; font-size: 12px; color: var(--dsw-alias-label-tertiary); }
1120
+ .bre-empty { padding: 8px; font-size: 12px; color: var(--bre-ink-hint); }
1121
+
441
1122
  /* ---- Truncated-label tooltip (custom, replaces the native title) ----
442
1123
  A self-drawn bubble instead of the OS tooltip, which the page cannot style
443
1124
  and which reads harsh next to the menu. Fixed-positioned on <body> so the
@@ -491,20 +1172,6 @@ body:not([data-ds-dark-theme]) .bre-tip {
491
1172
  background: var(--dsw-alias-state-error-tertiary, rgba(220,55,70,.08));
492
1173
  font-size: 11px;
493
1174
  }
494
- .bre-row-chevron {
495
- flex: none;
496
- display: inline-flex;
497
- align-items: center;
498
- justify-content: center;
499
- width: 16px;
500
- height: 16px;
501
- font-size: 18px;
502
- line-height: 1;
503
- color: var(--dsw-alias-label-tertiary);
504
- transform: rotate(0deg);
505
- transition: transform 120ms ease;
506
- }
507
- .bre-row-chevron.is-open { transform: rotate(90deg); }
508
1175
  /* ---- Models-page slider toggle (boxed setting item) ----
509
1176
  Item form ported VERBATIM from upstream .re-setting-row; the surrounding
510
1177
  box is the requested container (border only, transparent background). */
@@ -557,7 +1224,7 @@ body:not([data-ds-dark-theme]) .bre-tip {
557
1224
  outline: 2px solid var(--dsw-static-blue-400, #5d83ff);
558
1225
  outline-offset: 2px;
559
1226
  }
560
- .bre-slider-setting-switch.is-on { background: var(--dsw-alias-state-business-primary, #4f73ff); }
1227
+ .bre-slider-setting-switch.is-on { background: var(--dsw-alias-brand-primary, #4d6bfe); }
561
1228
  .bre-slider-setting-switch-knob {
562
1229
  position: absolute;
563
1230
  top: 2px;
@@ -777,60 +1444,111 @@ body:not([data-ds-dark-theme]) .bre-tip {
777
1444
  line-height: 16px;
778
1445
  text-align: center;
779
1446
  }
1447
+ /* The head is a plain title row on the card's own white \u2014 the tinted strip it
1448
+ used to be drew a second bar inside the card (user item 3). \u5168\u90E8\u6E05\u7A7A sits at
1449
+ the far right, blue like the host's other text actions. */
780
1450
  .bre-headers-head {
781
1451
  display: flex;
782
1452
  align-items: center;
783
- min-height: 32px;
784
- padding: 0 8px;
785
- border-radius: var(--dsw-radius-sm, 8px);
786
- background: var(--dsw-alias-interactive-bg-hover, #2631480f);
1453
+ gap: 8px;
1454
+ min-height: 28px;
1455
+ padding: 0;
1456
+ background: none;
787
1457
  }
788
1458
  .bre-headers-head .bre-effort-title {
789
1459
  color: var(--dsw-alias-label-primary, #0f1115);
790
1460
  font-weight: 600;
791
1461
  }
1462
+ .bre-headers-clear {
1463
+ margin-left: auto;
1464
+ padding: 0 2px;
1465
+ border: none;
1466
+ background: none;
1467
+ color: var(--dsw-alias-link, #4d6bfe);
1468
+ font: inherit;
1469
+ font-size: 13px;
1470
+ line-height: 20px;
1471
+ cursor: pointer;
1472
+ }
1473
+ .bre-headers-clear:hover:not(:disabled) { text-decoration: underline; }
1474
+ .bre-headers-clear:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
792
1475
  .bre-headers-edit, .bre-headers-rows {
793
1476
  display: flex;
794
1477
  flex-direction: column;
795
1478
  gap: 8px;
796
1479
  }
797
1480
 
1481
+ /* Columns and rows share one grid so the captions sit over their inputs. The
1482
+ row itself is bare: the inputs are the boxes, a second border around the
1483
+ pair was the old "framed row" look (board image 4). */
798
1484
  .bre-headers-columns,
799
1485
  .bre-headers-row {
800
1486
  display: grid;
801
- grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.5fr) 28px;
1487
+ grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.6fr) 28px;
802
1488
  align-items: center;
803
- gap: 8px;
1489
+ gap: 10px;
804
1490
  }
805
1491
  .bre-headers-columns {
806
- padding: 0 10px;
1492
+ padding: 0 2px;
807
1493
  color: var(--dsw-alias-label-tertiary, #81858c);
808
- font-size: 11px;
809
- line-height: 16px;
1494
+ font-size: 12px;
1495
+ line-height: 18px;
810
1496
  }
811
1497
  .bre-headers-row {
812
- min-height: 40px;
813
- padding: 4px 6px;
814
- border: 1px solid var(--dsw-alias-border-l2, #0000001a);
815
- border-radius: var(--dsw-radius-sm, 8px);
816
- background: var(--dsw-alias-bg-layer-1, #fff);
1498
+ min-height: 0;
1499
+ padding: 0;
1500
+ border: none;
1501
+ background: none;
817
1502
  }
1503
+ .bre-headers-edit .bre-headers-row { min-height: 38px; }
818
1504
  .bre-headers-add {
819
1505
  align-self: flex-start;
820
- min-height: 30px;
821
- padding: 0 10px;
822
- border: 1px solid var(--dsw-alias-border-l2, #0000001a);
823
- border-radius: var(--dsw-radius-sm, 8px);
1506
+ display: inline-flex;
1507
+ align-items: center;
1508
+ gap: 6px;
1509
+ height: 38px;
1510
+ padding: 0 14px;
1511
+ border: 1px dashed var(--dsw-alias-border-l3, #0000001f);
1512
+ border-radius: var(--dsw-radius-md, 12px);
1513
+ background: transparent;
824
1514
  color: var(--dsw-alias-label-primary, #0f1115);
1515
+ font: inherit;
1516
+ font-size: 13px;
1517
+ line-height: 20px;
1518
+ cursor: pointer;
1519
+ }
1520
+ .bre-headers-add::before {
1521
+ content: '+';
1522
+ color: var(--dsw-alias-label-tertiary, #81858c);
1523
+ font-size: 17px;
1524
+ line-height: 1;
825
1525
  }
826
1526
  .bre-headers-add:hover:not(:disabled) {
1527
+ border-color: var(--dsw-alias-border-l4, #00000033);
827
1528
  background: var(--dsw-alias-interactive-bg-hover, #2631480f);
828
1529
  }
1530
+ .bre-headers-add:disabled { opacity: 0.5; cursor: default; }
829
1531
  .bre-headers-remove {
1532
+ justify-self: center;
1533
+ display: inline-flex;
1534
+ align-items: center;
1535
+ justify-content: center;
830
1536
  width: 28px;
1537
+ height: 28px;
831
1538
  padding: 0;
832
- justify-self: center;
1539
+ border: none;
1540
+ border-radius: 6px;
1541
+ background: transparent;
1542
+ color: var(--dsw-alias-label-tertiary, #81858c);
1543
+ font-size: 18px;
1544
+ line-height: 1;
1545
+ cursor: pointer;
1546
+ }
1547
+ .bre-headers-remove:hover:not(:disabled) {
1548
+ background: var(--dsw-alias-interactive-bg-hover, #2631480f);
1549
+ color: var(--dsw-alias-label-primary, #0f1115);
833
1550
  }
1551
+ .bre-headers-remove:disabled { opacity: 0.5; cursor: default; }
834
1552
  .bre-headers-rows .bre-headers-name {
835
1553
  color: var(--dsw-alias-label-secondary, #61666b);
836
1554
  font-size: 12px;
@@ -920,10 +1638,12 @@ body:not([data-ds-dark-theme]) .bre-tip {
920
1638
  font-size: 12px;
921
1639
  }
922
1640
 
923
- /* The section's own fields, on the official input box. */
1641
+ /* The section's own fields, on the official input box: 38px tall and full
1642
+ width, so the pair reads as one table row like board image 4. */
924
1643
  .bre-headers-edit input.bre-text-input {
925
- height: 32px;
926
- padding: 0 10px;
1644
+ max-width: none;
1645
+ height: 38px;
1646
+ padding: 0 12px;
927
1647
  border: 1px solid var(--dsw-alias-border-l3, #0000001f);
928
1648
  border-radius: var(--dsw-radius-md, 12px);
929
1649
  background: var(--dsw-alias-bg-layer-1, #fff);
@@ -932,7 +1652,8 @@ body:not([data-ds-dark-theme]) .bre-tip {
932
1652
  box-sizing: border-box;
933
1653
  }
934
1654
  .bre-headers-edit input.bre-text-input:focus {
935
- border-color: var(--dsw-alias-label-tertiary, #81858c);
1655
+ border-color: var(--dsw-alias-brand-primary, #4d6bfe);
1656
+ box-shadow: 0 0 0 3px var(--dsw-alias-brand-primary-muted, rgba(77, 112, 255, .14));
936
1657
  outline: none;
937
1658
  }
938
1659
  .bre-headers-edit input.bre-text-input:disabled { opacity: 0.6; cursor: default; }
@@ -1265,12 +1986,17 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1265
1986
  marks the card: a card the pass could not take over (the DeepSeek account
1266
1987
  editor) keeps that mount visible for its request-header section, and must not
1267
1988
  grow a bar that switches nothing. */
1989
+ /* The tab bar. The old segmented track (grey rail + lifted white pill) is
1990
+ retired for the underline form the redesign settles on: a quiet text row over
1991
+ one hairline, the active tab named by a brand bar under its own text \u2014 one
1992
+ emphasis, no second surface to stack on the card's. */
1268
1993
  .bre-editor-tabs {
1269
1994
  display: none;
1270
- gap: 2px;
1271
- padding: 2px;
1272
- border-radius: 10px;
1273
- background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
1995
+ gap: 20px;
1996
+ padding: 0;
1997
+ border-radius: 0;
1998
+ background: transparent;
1999
+ border-bottom: 1px solid var(--dsw-alias-border-l2, #0000001a);
1274
2000
  }
1275
2001
 
1276
2002
  /* Only a taken-over card shows the bar. */
@@ -1299,6 +2025,29 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1299
2025
  display: block;
1300
2026
  }
1301
2027
 
2028
+ /* User item 6: every card on the settings page carried a tinted base fill \u2014 the
2029
+ configured row's card, the add/setup card, the editor body inside it, the
2030
+ advanced pane \u2014 so a stack of cards read as a stack of grey blocks on a white
2031
+ page. The card's own hairline is what draws it here; the fill steps back to
2032
+ the page's background, which is the one value that is "no colour" in both
2033
+ themes (bg-base is the content surface the page itself paints).
2034
+ The marks are the plugin's own where it has one (data-bre-editor-body is the
2035
+ tag this takeover puts on the official editor), and the official module card
2036
+ stems where it does not: those class names carry a build hash, so they are
2037
+ matched by stem and never spelled out. */
2038
+ .bre-tabbed [class*='rowCard'],
2039
+ .bre-tabbed [class*='addCard'],
2040
+ .bre-tabbed [class*='setupCard'],
2041
+ .bre-tabbed [data-bre-editor-body],
2042
+ /* The add-provider card is not a DESCENDANT of the takeover: the takeover sits
2043
+ inside it. The add-card pass marks the card itself, and this pair of
2044
+ selectors is what turns its module-platform fill into the page's white. */
2045
+ [class*='addCard'][data-bre-add-card='1'] {
2046
+ background: var(--dsw-alias-settings-card-fill, #ffffff);
2047
+ }
2048
+
2049
+ /* The advanced pane is whitened where its own rule is defined, further down. */
2050
+
1302
2051
  /* With the custom API form the only way left to add a provider, the official
1303
2052
  "How to add" switch has nothing to switch. The pass hides it ONLY once that
1304
2053
  form is really up: a card that has no custom form to offer, or a takeover
@@ -1309,35 +2058,54 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1309
2058
  }
1310
2059
 
1311
2060
  .bre-editor-tab {
1312
- flex: 1 1 0;
2061
+ flex: 0 1 auto;
1313
2062
  min-width: 0;
1314
- height: 28px;
1315
- padding: 0 10px;
2063
+ height: 32px;
2064
+ padding: 0 2px;
1316
2065
  border: none;
1317
- border-radius: 8px;
2066
+ border-radius: 0;
1318
2067
  background: transparent;
1319
2068
  color: var(--dsw-alias-label-secondary, #61666b);
1320
2069
  font: inherit;
1321
- font-size: 12px;
1322
- font-weight: 500;
2070
+ font-size: 13px;
2071
+ font-weight: 400;
1323
2072
  line-height: 1;
1324
2073
  white-space: nowrap;
1325
2074
  overflow: hidden;
1326
2075
  text-overflow: ellipsis;
1327
2076
  cursor: pointer;
1328
- transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
2077
+ position: relative;
2078
+ transition: color 140ms ease;
1329
2079
  }
1330
2080
 
1331
2081
  .bre-editor-tab:hover { color: var(--dsw-alias-label-primary, #0f1115); }
1332
2082
 
1333
- /* The selected segment lifts out of the track: the page's own surface colour
1334
- plus the card's own hairline, the same elevation the host uses for raised
1335
- controls. Hover on a selected tab stays put \u2014 it is already where you are. */
2083
+ /* The selected tab is named by the bar under its own text, not by a filled
2084
+ pill: the indicator occupies the bar's own hairline, so no second surface
2085
+ and no extra height. Hover on a selected tab stays put \u2014 it is already
2086
+ where you are. */
2087
+ .bre-editor-tab::after {
2088
+ content: '';
2089
+ position: absolute;
2090
+ left: 0;
2091
+ right: 0;
2092
+ bottom: -1px;
2093
+ height: 2px;
2094
+ border-radius: 2px;
2095
+ background: transparent;
2096
+ transition: background 140ms ease;
2097
+ }
2098
+
1336
2099
  .bre-editor-tab[aria-selected='true'],
1337
2100
  .bre-editor-tab[aria-selected='true']:hover {
1338
- background: var(--dsw-alias-bg-layer-1, #fff);
2101
+ background: transparent;
1339
2102
  color: var(--dsw-alias-label-primary, #0f1115);
1340
- box-shadow: 0 1px 2px #0000001a, 0 0 0 1px var(--dsw-alias-border-l2, #0000001a);
2103
+ font-weight: 500;
2104
+ box-shadow: none;
2105
+ }
2106
+
2107
+ .bre-editor-tab[aria-selected='true']::after {
2108
+ background: var(--dsw-alias-brand-primary, #4d6bfe);
1341
2109
  }
1342
2110
 
1343
2111
  .bre-editor-tab:focus-visible {
@@ -1355,10 +2123,49 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1355
2123
  gave it, so showing must not declare a display at all. */
1356
2124
  .bre-tabbed:not([data-bre-tab='provider']) [data-bre-region='provider'],
1357
2125
  .bre-tabbed:not([data-bre-tab='models']) [data-bre-region='models'],
2126
+ .bre-tabbed:not([data-bre-tab='fingerprint']) [data-bre-region='fingerprint'],
1358
2127
  .bre-tabbed:not([data-bre-tab='advanced']) [data-bre-region='advanced'] {
1359
2128
  display: none !important;
1360
2129
  }
1361
2130
 
2131
+ /* The provider pane's form reads as the redesign's two-column grid: the label
2132
+ takes a fixed leading column, the control fills the rest. Promoting the
2133
+ host label's children with display:contents keeps the label-input
2134
+ association (the label element stays the control's parent in the DOM) while
2135
+ letting the span and the control land in their own columns. Scoped to the
2136
+ taken-over provider pane and the host's measured field shape, so a kernel
2137
+ that changed its markup simply keeps its own stacked layout. The endpoint
2138
+ field opts out: its family chip + title row is its own shape (the design's
2139
+ endpoint row), and its title carries the \u66F4\u591A\u7AEF\u70B9 toggle besides. */
2140
+ .bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not([data-bre-endpoint-field]) {
2141
+ display: grid;
2142
+ grid-template-columns: 96px minmax(0, 1fr);
2143
+ align-items: center;
2144
+ column-gap: 8px;
2145
+ }
2146
+ .bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not([data-bre-endpoint-field]) > label {
2147
+ display: contents;
2148
+ }
2149
+ /* The input sits BESIDE its label \u2014 the same two-column shape on every card,
2150
+ create or edit (\u65B0\u589E\u4F9B\u5E94\u5546\u7684 api \u5BC6\u94A5\u5B57\u6BB5\u4E0E\u4FEE\u6539\u5361\u4E0D\u4E00\u81F4). A field with no
2151
+ label of its own (the provider id on the create card) spans the form instead
2152
+ of squeezing into the label column. The endpoint field's input keeps its own
2153
+ grid's second column \u2014 the same specificity race, won back explicitly. */
2154
+ .bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field > input { grid-column: 2; }
2155
+ .bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] .field:not(:has(> label)) > input { grid-column: 1 / -1; }
2156
+ .bre-tabbed[data-bre-tab='provider'] [data-bre-editor-body] [data-bre-endpoint-field] > input { grid-column: 2; }
2157
+ /* The extra address rows need no indent of their own: their chip is the same
2158
+ fixed 96px prefix the field's chip takes, so the row's input already sits in
2159
+ the field input's column (see .bre-endpoint-family above). */
2160
+ /* The card's commit row reads as the footer the design gives every card: one
2161
+ hairline above, the pair right-aligned beneath it, on every tab that shows
2162
+ the card's own fields. */
2163
+ .bre-tabbed [data-bre-editor-body] [class*='editorActions'] {
2164
+ margin-top: 6px;
2165
+ padding-top: 12px;
2166
+ border-top: 1px solid var(--dsw-alias-border-l2, #0000001a);
2167
+ }
2168
+
1362
2169
  /* The advanced tab: the official body \u2014 fields, model list \u2014 steps aside for the
1363
2170
  request-header section, which is a complete form with its own save/cancel and
1364
2171
  becomes the pane under the very same bar. What does NOT step aside is the
@@ -1388,21 +2195,21 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1388
2195
  .bre-tabbed[data-bre-tab='advanced'] .bre-headers { display: flex; }
1389
2196
 
1390
2197
  /* The pane is a card, and the section draws it. On the advanced tab the section
1391
- is not an appendage to the fields above it any more \u2014 it is the whole surface
1392
- \u2014 so it takes the inset fill the official module cards use (the add and setup
1393
- cards): the one fill in this system that stays visible on the content card's
1394
- own white in the light theme and reads as raised in the dark one, where every
1395
- theme layer token collapses onto the same value. The hairline goes with it: it
1396
- divided this section from those fields, and here the bar above ends the pane.
1397
- The 12px top margin sets the card off the tab bar above it \u2014 the same gap the
1398
- provider and models panes put between the bar and their own cards \u2014 and the
1399
- 12px padding is the card's inner inset, not the separator. */
2198
+ is not an appendage to the fields above it any more \u2014 it is the whole surface.
2199
+ The hairline goes: it divided this section from those fields, and here the bar
2200
+ above ends the pane. The 12px top margin sets the card off the tab bar above
2201
+ it \u2014 the same gap the provider and models panes put between the bar and their
2202
+ own cards \u2014 and the 12px padding is the card's inner inset, not the separator.
2203
+ User item 3: the fill is the page's own background, not the tinted module
2204
+ platform. The pane sits on a white card; a grey slab there was a second card
2205
+ drawn inside the first. Its inset is carried by the padding and the bar's
2206
+ hairline, so dropping the fill costs no structure. */
1400
2207
  .bre-tabbed[data-bre-tab='advanced'] .bre-headers {
1401
2208
  margin-top: 12px;
1402
2209
  padding: 12px;
1403
2210
  border-top: none;
1404
2211
  border-radius: var(--dsw-radius-lg, 16px);
1405
- background: var(--dsw-alias-bg-module-platform, #f5f6f7);
2212
+ background: var(--dsw-alias-bg-base, #ffffff);
1406
2213
  }
1407
2214
 
1408
2215
  /* The pane's heading is not a fold head. The grey pill, its hover state and
@@ -1650,6 +2457,13 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1650
2457
  display: block;
1651
2458
  min-width: 0;
1652
2459
  margin-top: 4px;
2460
+ /* User item 5: room for one key row plus the add row, reserved before the list
2461
+ answers. The panel renders nothing while its read is in flight, so without
2462
+ this the card painted at its short height and then grew by a row's height
2463
+ when the keys arrived \u2014 the card visibly re-flowing just after it opened.
2464
+ The reservation is the height the list settles at (40px row + 8px gap + 34px
2465
+ add row + the list's own two 1px rules), so nothing moves once it lands. */
2466
+ min-height: 84px;
1653
2467
  }
1654
2468
 
1655
2469
  .bre-keys { display: flex; flex-direction: column; gap: 8px; }
@@ -1670,7 +2484,7 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1670
2484
  margin: 0;
1671
2485
  padding: 0;
1672
2486
  border: 0.5px solid var(--dsw-alias-border-l2, #d5d7dd);
1673
- border-radius: 8px;
2487
+ border-radius: var(--dsw-radius-md, 12px);
1674
2488
  list-style: none;
1675
2489
  overflow: hidden;
1676
2490
  }
@@ -1683,67 +2497,86 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1683
2497
  gap: 8px;
1684
2498
  min-width: 0;
1685
2499
  padding: 9px 10px;
2500
+ /* The hovered row lifts a shade, the way the redesign's list rows do \u2014 the
2501
+ container clips the corners, so the fill stays inside the ruled box. */
2502
+ transition: background 120ms ease;
1686
2503
  }
1687
2504
 
1688
- /* The enable choice closes the row. The radio stays the real input \u2014 so the
1689
- keys of one provider are one group, choosing one clears the rest, and the
1690
- pick is keyboard-reachable \u2014 and the circle is its face; the word beside it
1691
- names the action instead of a state to hunt for. */
1692
- .bre-keys-enable {
1693
- display: inline-flex;
2505
+ .bre-keys-row:hover { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .07)); }
2506
+
2507
+ /* The switch at the head of every key row: a ring with a check inside it. While
2508
+ the key is switched into use the WHOLE icon is the brand blue \u2014 ring and glyph
2509
+ together; while it is benched it is a bare grey ring with nothing drawn in it.
2510
+ Off is a pause, not a deletion \u2014 the label, scope and protocol stay. With
2511
+ several keys coexisting there is no "default" badge: which key signs a model
2512
+ is the scope's decision. The one state that cannot be clicked is the last
2513
+ enabled key: the host would refuse the switch-off, so the control stands down
2514
+ instead (the disabled shell keeps the lit look \u2014 the key IS selected). */
2515
+ .bre-keys-toggle {
1694
2516
  flex: 0 0 auto;
2517
+ display: inline-flex;
1695
2518
  align-items: center;
1696
- gap: 6px;
2519
+ justify-content: center;
2520
+ width: 20px;
2521
+ height: 20px;
2522
+ padding: 0;
2523
+ border: 0;
2524
+ border-radius: 999px;
2525
+ background: transparent;
1697
2526
  cursor: pointer;
2527
+ -webkit-appearance: none;
2528
+ appearance: none;
2529
+ transition: opacity 140ms ease;
1698
2530
  }
1699
2531
 
1700
- .bre-keys-enable-text {
1701
- font-size: 11px;
1702
- line-height: 1.5;
1703
- color: var(--dsw-alias-label-secondary, #6b7280);
1704
- }
2532
+ .bre-keys-toggle:hover:not(:disabled),
2533
+ .bre-keys-toggle:focus-visible { opacity: 0.8; }
1705
2534
 
1706
- .bre-keys-enable:has(.bre-keys-enabled:checked) .bre-keys-enable-text {
1707
- color: var(--dsw-alias-label-primary, #0f1115);
2535
+ .bre-keys-toggle:focus-visible {
2536
+ outline: none;
2537
+ box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
2538
+ border-radius: 999px;
1708
2539
  }
1709
2540
 
1710
- .bre-keys-enabled {
1711
- position: absolute;
1712
- width: 1px;
1713
- height: 1px;
1714
- margin: -1px;
1715
- padding: 0;
1716
- border: 0;
1717
- overflow: hidden;
1718
- white-space: nowrap;
1719
- clip-path: inset(50%);
1720
- }
2541
+ .bre-keys-toggle:disabled { cursor: default; }
1721
2542
 
1722
- .bre-keys-mark {
2543
+ .bre-keys-toggle-mark {
1723
2544
  display: inline-flex;
1724
2545
  align-items: center;
1725
2546
  justify-content: center;
1726
2547
  width: 16px;
1727
2548
  height: 16px;
1728
- box-sizing: border-box;
1729
- border: 1px solid var(--dsw-alias-border-l3, #9aa0aa);
1730
- border-radius: 50%;
1731
- color: var(--dsw-alias-bg-layer-1, #ffffff);
1732
- transition: background 120ms ease, border-color 120ms ease;
2549
+ border-radius: 999px;
2550
+ background: transparent;
2551
+ box-shadow: inset 0 0 0 1.5px var(--dsw-alias-label-tertiary, #9aa1ab);
2552
+ color: transparent;
2553
+ transition: box-shadow 140ms ease, color 140ms ease;
1733
2554
  }
1734
2555
 
1735
- .bre-keys-mark > svg { width: 12px; height: 12px; }
1736
-
1737
- .bre-keys-enabled:checked + .bre-keys-mark {
1738
- border-color: var(--dsw-alias-label-primary, #0f1115);
1739
- background: var(--dsw-alias-label-primary, #0f1115);
2556
+ .bre-keys-toggle-mark svg {
2557
+ width: 10px;
2558
+ height: 10px;
2559
+ display: none;
1740
2560
  }
1741
2561
 
1742
- .bre-keys-enabled:focus-visible + .bre-keys-mark {
1743
- outline: none;
1744
- box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
2562
+ /* The lit check is PINNED to the plugin's own blue rather than the host's brand
2563
+ token: on the settings surface --dsw-alias-brand-primary can resolve dark \u2014
2564
+ and a var() fallback only covers a token that is unset, so a token defined
2565
+ with a broken value leaves the tick inheriting the body's near-black ink. A
2566
+ checked key must read blue wherever the list is painted, so the blue is not
2567
+ negotiable with the surface. */
2568
+ .bre-keys-toggle.is-on .bre-keys-toggle-mark {
2569
+ box-shadow: inset 0 0 0 1.5px #4d6bfe;
2570
+ color: #4d6bfe;
1745
2571
  }
1746
2572
 
2573
+ .bre-keys-toggle.is-on .bre-keys-toggle-mark svg { display: block; }
2574
+
2575
+ /* A switched-off key stays listed but reads as idle: its name and preview dim,
2576
+ while the actions keep their full strength so the row stays workable. */
2577
+ .bre-keys-row.is-off .bre-keys-alias,
2578
+ .bre-keys-row.is-off .bre-keys-mask { opacity: 0.45; }
2579
+
1747
2580
  /* With an alias the alias is the row's name and the masked key follows it as a
1748
2581
  quiet code pill; without one the masked key is the name and takes the row's
1749
2582
  measure, so a key is always readable as itself. */
@@ -1784,7 +2617,11 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1784
2617
  /* The row's three actions, revealed on hover or keyboard focus rather than
1785
2618
  removed, so the row keeps its width and nothing shifts under the pointer.
1786
2619
  Revealing is opacity alone; a pointer that cannot hover simply always sees
1787
- them, because a hidden action there would be an unreachable one. */
2620
+ them, because a hidden action there would be an unreachable one. The model
2621
+ scope rides on its own button here (its label is the count), so there is no
2622
+ separate summary text beside the key any more. The tray parks at the right
2623
+ edge: no status word is painted on a row any more (\u72B6\u6001\u90FD\u79FB\u9664\u2014\u2014\u4E1C\u897F\u591A\u4E86\uFF0C
2624
+ \u522B\u540D\u88AB\u7701\u7565), so the right edge is the tray's alone. */
1788
2625
  .bre-keys-actions {
1789
2626
  display: inline-flex;
1790
2627
  flex: 0 0 auto;
@@ -1898,6 +2735,65 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1898
2735
 
1899
2736
  .bre-keys-add:disabled { opacity: 0.55; cursor: default; }
1900
2737
 
2738
+ /* The scope field spans the row like the secret field does. */
2739
+ .bre-keys-scope { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
2740
+
2741
+ .bre-keys-hint {
2742
+ margin: 0;
2743
+ font-size: 11px;
2744
+ line-height: 1.5;
2745
+ color: var(--dsw-alias-label-secondary, #6b7280);
2746
+ }
2747
+
2748
+ /* The discover action sits below the ruled list because it acts on every key at
2749
+ once, not on the row it would otherwise live in. */
2750
+ .bre-keys-footer { display: flex; justify-content: flex-end; }
2751
+
2752
+ /* The offer to add the models the keys advertise but the provider does not
2753
+ declare: one sentence and one link, never a silent write. */
2754
+ .bre-keys-note {
2755
+ margin: 6px 0 0;
2756
+ font-size: 11px;
2757
+ line-height: 1.6;
2758
+ color: var(--dsw-alias-label-secondary, #6b7280);
2759
+ }
2760
+
2761
+ .bre-keys-discover {
2762
+ display: inline-flex;
2763
+ align-items: center;
2764
+ gap: 6px;
2765
+ padding: 0;
2766
+ border: 0;
2767
+ background: transparent;
2768
+ color: var(--dsw-alias-label-secondary, #6b7280);
2769
+ font: inherit;
2770
+ font-size: 11px;
2771
+ cursor: pointer;
2772
+ -webkit-appearance: none;
2773
+ appearance: none;
2774
+ transition: color 120ms ease;
2775
+ }
2776
+
2777
+ .bre-keys-discover:hover { color: var(--dsw-alias-label-primary, #0f1115); }
2778
+
2779
+ .bre-keys-discover:focus-visible {
2780
+ outline: none;
2781
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
2782
+ border-radius: 4px;
2783
+ }
2784
+
2785
+ .bre-keys-discover:disabled { opacity: 0.55; cursor: default; }
2786
+
2787
+ .bre-keys-discover-mark {
2788
+ display: inline-flex;
2789
+ align-items: center;
2790
+ justify-content: center;
2791
+ width: 14px;
2792
+ height: 14px;
2793
+ }
2794
+
2795
+ .bre-keys-discover-mark > svg { width: 13px; height: 13px; }
2796
+
1901
2797
  .bre-keys-add-mark {
1902
2798
  display: inline-flex;
1903
2799
  flex: 0 0 auto;
@@ -1909,12 +2805,1125 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1909
2805
 
1910
2806
  .bre-keys .bre-effort-message { font-size: 11px; }
1911
2807
 
2808
+ /* The per-key protocol picker. It lives inside .bre-keys-actions, so it must
2809
+ look like the plain buttons beside it \u2014 same size, same grey, no box of its
2810
+ own \u2014 or the hover tray reads as two different kinds of control. "Default
2811
+ protocol" (the empty value) follows the route's own API protocol.
2812
+ What you read is a LABEL, not a control: a native <select> is as wide as its
2813
+ widest OPTION, so a short value left the chevron floating a hundred pixels to
2814
+ its right (user item 2). The button is exactly as wide as the text and opens
2815
+ this module's own menu, which can explain each protocol (\u53C2\u8003\u56FE\u6837\u5F0F). */
2816
+ .bre-keys-protocol-wrap {
2817
+ position: relative;
2818
+ display: inline-flex;
2819
+ align-items: center;
2820
+ color: var(--dsw-alias-label-secondary, #61666b);
2821
+ }
2822
+
2823
+ .bre-keys-protocol {
2824
+ display: inline-flex;
2825
+ align-items: center;
2826
+ gap: 2px;
2827
+ margin: 0;
2828
+ padding: 2px 6px;
2829
+ border: none;
2830
+ border-radius: 4px;
2831
+ background: none;
2832
+ color: inherit;
2833
+ font: inherit;
2834
+ font-size: 12px;
2835
+ line-height: 1;
2836
+ cursor: pointer;
2837
+ }
2838
+
2839
+ .bre-keys-protocol-label {
2840
+ color: inherit;
2841
+ font: inherit;
2842
+ font-size: 12px;
2843
+ line-height: 1;
2844
+ }
2845
+
2846
+ .bre-keys-protocol-caret {
2847
+ color: inherit;
2848
+ font-size: 12px;
2849
+ line-height: 1;
2850
+ pointer-events: none;
2851
+ }
2852
+
2853
+ /* Hover is a shade, not an underline: the picker reads as a control (every
2854
+ other quiet control in the row lifts on hover), and an underline made it
2855
+ read as a link to somewhere else. */
2856
+ .bre-keys-protocol:hover { background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.08)); }
2857
+
2858
+ /* An open menu is a pressed control: while its list is up, the trigger keeps the
2859
+ tray's colour instead of going back to quiet grey. */
2860
+ .bre-keys-protocol[aria-expanded='true'] { color: var(--dsw-alias-label-primary, #0f1115); }
2861
+
2862
+ .bre-keys-protocol:focus-visible {
2863
+ outline: none;
2864
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
2865
+ }
2866
+
2867
+ .bre-keys-protocol:disabled { opacity: 0.5; cursor: default; }
2868
+
2869
+ /* ---- The protocol menu ----
2870
+ One entry per protocol, its name over the line that says what that wire is
2871
+ for: the names alone do not tell Chat Completions and Responses apart, and the
2872
+ choice is about the models behind the key (user request, \u53C2\u8003\u56FE\u6837\u5F0F). Portalled
2873
+ onto <body> because the key list clips its overflow; the panel wears the same
2874
+ surface, radius and hairline as the app's own menus. */
2875
+ .bre-protocol-menu {
2876
+ position: fixed;
2877
+ z-index: 2147483000;
2878
+ box-sizing: border-box;
2879
+ width: 292px;
2880
+ padding: 6px;
2881
+ border-radius: 12px;
2882
+ border: 0.5px solid var(--dsw-alias-border-l4, rgba(0, 0, 0, .1));
2883
+ background: var(--dsw-alias-bg-layer-1, #ffffff);
2884
+ box-shadow: 0 8px 28px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .08);
2885
+ animation: bre-protocol-menu-in 120ms ease-out;
2886
+ }
2887
+
2888
+ @keyframes bre-protocol-menu-in {
2889
+ from { opacity: 0; transform: translateY(-2px); }
2890
+ to { opacity: 1; transform: translateY(0); }
2891
+ }
2892
+
2893
+ .bre-protocol-menu-title {
2894
+ margin: 0;
2895
+ padding: 6px 10px 4px;
2896
+ color: var(--dsw-alias-label-secondary, #61666b);
2897
+ font-size: 12px;
2898
+ line-height: 18px;
2899
+ }
2900
+
2901
+ .bre-protocol-menu-list {
2902
+ display: flex;
2903
+ flex-direction: column;
2904
+ gap: 2px;
2905
+ margin: 0;
2906
+ padding: 0;
2907
+ list-style: none;
2908
+ }
2909
+
2910
+ .bre-protocol-option {
2911
+ display: flex;
2912
+ align-items: flex-start;
2913
+ gap: 6px;
2914
+ width: 100%;
2915
+ box-sizing: border-box;
2916
+ margin: 0;
2917
+ padding: 8px 10px;
2918
+ border: none;
2919
+ border-radius: 8px;
2920
+ background: none;
2921
+ color: var(--dsw-alias-label-primary, #0f1115);
2922
+ font: inherit;
2923
+ text-align: left;
2924
+ cursor: pointer;
2925
+ }
2926
+
2927
+ .bre-protocol-option:hover { background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09)); }
2928
+
2929
+ .bre-protocol-option:focus-visible {
2930
+ outline: none;
2931
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
2932
+ }
2933
+
2934
+ /* The choice in force is named the way the redesign names every selection:
2935
+ the accent lives in the TITLE and the tick, and the row keeps the menu's
2936
+ own surface \u2014 the grey pillow made the answer look pressed rather than
2937
+ current. The tick rides the right edge (order + auto margin \u2014 the DOM
2938
+ keeps the mark before the text), so the text column starts flush. */
2939
+ .bre-protocol-option-mark {
2940
+ display: inline-flex;
2941
+ align-items: center;
2942
+ justify-content: center;
2943
+ flex: 0 0 auto;
2944
+ order: 2;
2945
+ width: 12px;
2946
+ height: 18px;
2947
+ margin-left: auto;
2948
+ margin-top: 2px;
2949
+ color: var(--dsw-alias-brand-primary, #4d6bfe);
2950
+ }
2951
+
2952
+ .bre-protocol-option[aria-selected='true'] { background: transparent; }
2953
+
2954
+ .bre-protocol-option[aria-selected='true']:hover {
2955
+ background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
2956
+ }
2957
+
2958
+ .bre-protocol-option-text {
2959
+ display: flex;
2960
+ flex-direction: column;
2961
+ gap: 2px;
2962
+ min-width: 0;
2963
+ }
2964
+
2965
+ /* One line each, always: a wrapped hint made one row taller than its neighbours
2966
+ and the column of ticks lost its rhythm. A hint too long for the panel is cut
2967
+ with an ellipsis rather than allowed to reflow the list. */
2968
+ .bre-protocol-option-title,
2969
+ .bre-protocol-option-hint {
2970
+ display: block;
2971
+ overflow: hidden;
2972
+ white-space: nowrap;
2973
+ text-overflow: ellipsis;
2974
+ }
2975
+
2976
+ .bre-protocol-option-title {
2977
+ font-size: 13px;
2978
+ font-weight: 500;
2979
+ line-height: 18px;
2980
+ }
2981
+
2982
+ .bre-protocol-option[aria-selected='true'] .bre-protocol-option-title {
2983
+ color: var(--dsw-alias-brand-primary, #4d6bfe);
2984
+ font-weight: 500;
2985
+ }
2986
+
2987
+ .bre-protocol-option-hint {
2988
+ color: var(--dsw-alias-label-secondary, #61666b);
2989
+ font-size: 12px;
2990
+ line-height: 16px;
2991
+ }
2992
+
1912
2993
  @media (prefers-reduced-motion: reduce) {
1913
- .bre-editor-tab { transition: none; }
1914
- .bre-key-eye { transition: none; }
1915
- .bre-keys-mark, .bre-keys-actions, .bre-keys-add { transition: none; }
2994
+ .bre-protocol-menu { animation: none; }
2995
+ }
2996
+
2997
+ /* The key list's own links read as plain grey text: a row can carry four of them
2998
+ and blue made them compete with the value they act on (user item 3). Danger
2999
+ keeps its hue, and the scope form's primary shortcuts stay untouched. */
3000
+ .bre-keys-actions .bre-link-button { color: var(--dsw-alias-label-secondary, #61666b); }
3001
+ .bre-keys-actions .bre-link-button:hover { color: var(--dsw-alias-label-primary, #0f1115); }
3002
+ .bre-keys-actions .bre-keys-danger { color: var(--dsw-alias-state-error-primary, #d33); }
3003
+
3004
+ /* The API protocol as ONE segmented bar: one segment per protocol, the one in
3005
+ force sitting in a white pill on a shared grey track, so the alternatives read
3006
+ as parts of a single choice instead of three loose buttons (user item 1). The
3007
+ host's own <select> stays in the DOM behind them \u2014 hidden by the module, not
3008
+ removed \u2014 because it is what the host saves and what this module reads the
3009
+ family from. */
3010
+ .bre-protocol-cards {
3011
+ display: inline-flex;
3012
+ flex-wrap: wrap;
3013
+ gap: 2px;
3014
+ padding: 2px;
3015
+ border-radius: 10px;
3016
+ background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
3017
+ }
3018
+
3019
+ .bre-protocol-card {
3020
+ display: inline-flex;
3021
+ align-items: center;
3022
+ justify-content: center;
3023
+ flex: 1 1 0;
3024
+ min-width: max-content;
3025
+ height: 28px;
3026
+ padding: 0 12px;
3027
+ border: none;
3028
+ border-radius: 8px;
3029
+ background: transparent;
3030
+ color: var(--dsw-alias-label-secondary, #61666b);
3031
+ font: inherit;
3032
+ font-size: 12px;
3033
+ font-weight: 500;
3034
+ line-height: 1;
3035
+ white-space: nowrap;
3036
+ text-align: center;
3037
+ cursor: pointer;
3038
+ transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
3039
+ }
3040
+
3041
+ .bre-protocol-card:hover { color: var(--dsw-alias-label-primary, #0f1115); }
3042
+
3043
+ .bre-protocol-card.is-selected {
3044
+ background: var(--dsw-alias-bg-layer-1, #fff);
3045
+ color: var(--dsw-alias-label-primary, #0f1115);
3046
+ box-shadow: 0 1px 2px #0000001a, 0 0 0 1px var(--dsw-alias-border-l2, #0000001a);
3047
+ }
3048
+
3049
+ .bre-protocol-card:focus-visible {
3050
+ outline: none;
3051
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
3052
+ }
3053
+
3054
+ /* The provider card's address tag: the protocol family the base URL serves.
3055
+ A hairline pill, the redesign's quiet badge: centred text inside a 999
3056
+ capsule, never a control. The width is FIXED at the form's label column:
3057
+ OpenAI, Anthropic and Gemini chips then share one 96px prefix column, so
3058
+ the field's input and every \u66F4\u591A\u7AEF\u70B9 row's input start at the same x \u2014
3059
+ a min-width column would drift with each family's name length. */
3060
+ .bre-endpoint-family {
3061
+ flex: 0 0 auto;
3062
+ display: inline-flex;
3063
+ align-items: center;
3064
+ justify-content: center;
3065
+ box-sizing: border-box;
3066
+ width: 96px;
3067
+ height: 22px;
3068
+ border-radius: 999px;
3069
+ box-shadow: inset 0 0 0 1px var(--dsw-alias-border-l3, #0000001f);
3070
+ font-size: 11px;
3071
+ color: var(--dsw-alias-label-secondary, #6b7280);
3072
+ white-space: nowrap;
3073
+ }
3074
+
3075
+ /* The tag sits BESIDE the address input, not stacked above it. The official
3076
+ field is a column flex box (title, then control), so a tag inserted before the
3077
+ control would get a line of its own; a marked field becomes a two-column grid
3078
+ instead \u2014 the title keeps the full width, the tag takes the first column and
3079
+ the input the second. The first column is the SAME 96px the rest of the form
3080
+ labels take, so every input on the card starts at one vertical line. */
3081
+ [data-bre-endpoint-field] {
3082
+ display: grid;
3083
+ grid-template-columns: 96px minmax(0, 1fr);
3084
+ align-items: center;
3085
+ column-gap: 8px;
3086
+ /* One rhythm for the whole address block: the field's own lines AND the
3087
+ \u66F4\u591A\u7AEF\u70B9 rows inside it sit a fixed 8px apart, so the three address
3088
+ inputs read as one evenly spaced stack (API \u5730\u5740\u4E09\u4E2A\u8F93\u5165\u6846\u95F4\u8DDD\u4E0D\u4E00\u6837). */
3089
+ row-gap: 8px;
3090
+ }
3091
+
3092
+ [data-bre-endpoint-field] > [data-bre-endpoint-title] { grid-column: 1 / -1; }
3093
+
3094
+ [data-bre-endpoint-field] > .bre-endpoint-family { grid-column: 1; }
3095
+
3096
+ [data-bre-endpoint-field] > input {
3097
+ grid-column: 2;
3098
+ width: 100%;
3099
+ }
3100
+
3101
+ /* The injected second address rows. They are GRID ITEMS of the address field
3102
+ (the container is transparent to layout), so each row spans both columns and
3103
+ inherits the field's own row-gap \u2014 the uniform spacing the three address
3104
+ lines share. Collapsed until \u66F4\u591A\u7AEF\u70B9 is pressed. The [hidden] rule is not
3105
+ redundant: the display rule below beats the user agent's [hidden] rule, so
3106
+ without this companion the rows would be on screen from the moment they are
3107
+ injected. */
3108
+ [data-bre-endpoint-rows] { display: contents; }
3109
+
3110
+ [data-bre-endpoint-rows][hidden] { display: none; }
3111
+
3112
+ .bre-endpoint-row {
3113
+ grid-column: 1 / -1;
3114
+ display: flex;
3115
+ align-items: center;
3116
+ gap: 8px;
3117
+ }
3118
+
3119
+ .bre-endpoint-row[hidden] { display: none; }
3120
+
3121
+ /* The injected second row's own input. The shared input caps itself at 240px for
3122
+ the narrow panels it was written for; beside a full-width address box that cap
3123
+ showed up as a short field under a long one (user item 5), so the row's input
3124
+ takes the column the main input takes. */
3125
+ .bre-endpoint-url {
3126
+ flex: 1 1 auto;
3127
+ min-width: 0;
3128
+ max-width: none;
3129
+ }
3130
+
3131
+ /* \u66F4\u591A\u7AEF\u70B9: a small grey link riding the API \u5730\u5740 label line itself, right after
3132
+ the label text (user item 4). The official label is an inline-flex box, so the
3133
+ link simply joins its children and the host's own 10px gap spaces it from the
3134
+ words; the row it reveals still opens directly under the field group. */
3135
+ .bre-endpoint-toggle {
3136
+ display: inline-flex;
3137
+ align-items: center;
3138
+ margin: 0 0 0 6px;
3139
+ padding: 0;
3140
+ border: none;
3141
+ background: none;
3142
+ color: var(--dsw-alias-label-secondary, #6b7280);
3143
+ font: inherit;
3144
+ font-size: 12px;
3145
+ font-weight: 400;
3146
+ line-height: 1;
3147
+ cursor: pointer;
3148
+ }
3149
+
3150
+ .bre-endpoint-toggle:hover { color: var(--dsw-alias-label-primary, #0f1115); text-decoration: none; }
3151
+
3152
+ /* The disclosure mark is DRAWN, not typed: two 1.5px strokes make the thin
3153
+ chevron of the reference, and it turns over when the row opens instead of
3154
+ being swapped for a second glyph (user item 2). */
3155
+ .bre-endpoint-toggle::after {
3156
+ content: '';
3157
+ width: 5px;
3158
+ height: 5px;
3159
+ margin-left: 4px;
3160
+ margin-top: -2px;
3161
+ border-right: 1.5px solid currentColor;
3162
+ border-bottom: 1.5px solid currentColor;
3163
+ transform: rotate(45deg);
3164
+ transition: transform 140ms ease, margin-top 140ms ease;
3165
+ }
3166
+
3167
+ .bre-endpoint-toggle[aria-expanded='true']::after {
3168
+ margin-top: 2px;
3169
+ transform: rotate(225deg);
3170
+ }
3171
+
3172
+ .bre-endpoint-toggle:focus-visible {
3173
+ outline: none;
3174
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
3175
+ border-radius: 4px;
3176
+ }
3177
+
3178
+ /* The model-scope chips: the models the provider actually offers, each a toggle.
3179
+ A selected chip takes the brand tint and a tick, so a quick glance tells which
3180
+ models this key claims without reading a list of ids. */
3181
+ .bre-keys-chips {
3182
+ display: flex;
3183
+ flex-wrap: wrap;
3184
+ gap: 6px;
3185
+ }
3186
+
3187
+ .bre-keys-chip {
3188
+ display: inline-flex;
3189
+ align-items: center;
3190
+ gap: 4px;
3191
+ padding: 4px 10px;
3192
+ border: 1px solid var(--dsw-alias-line-regular, #d8dbe2);
3193
+ border-radius: 999px;
3194
+ background: transparent;
3195
+ color: var(--dsw-alias-label-primary, #0f1115);
3196
+ font: inherit;
3197
+ font-size: 12px;
3198
+ cursor: pointer;
3199
+ transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
3200
+ }
3201
+
3202
+ .bre-keys-chip:hover { border-color: var(--dsw-alias-brand-primary, #3b82f6); }
3203
+
3204
+ .bre-keys-chip:focus-visible {
3205
+ outline: none;
3206
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
3207
+ }
3208
+
3209
+ .bre-keys-chip:disabled { opacity: 0.55; cursor: default; }
3210
+
3211
+ /* A selected chip takes the accent tint and a tick; the outline steps aside \u2014
3212
+ the tint IS the border, and a second one doubled the weight. */
3213
+ .bre-keys-chip.is-selected {
3214
+ border-color: transparent;
3215
+ background: var(--dsw-alias-brand-primary-muted, #eef2ff);
3216
+ color: var(--dsw-alias-brand-primary, #3b82f6);
3217
+ }
3218
+
3219
+ .bre-keys-chip-mark {
3220
+ display: inline-flex;
3221
+ align-items: center;
3222
+ justify-content: center;
3223
+ width: 12px;
3224
+ height: 12px;
3225
+ }
3226
+
3227
+ .bre-keys-chip-mark > svg { width: 12px; height: 12px; }
3228
+
3229
+ /* "All models" is a quiet text action inside the scope form's action row. */
3230
+ .bre-keys-allmodels { margin-right: auto; }
3231
+
3232
+ /* The provider's two base URLs: one OpenAI-style, one Anthropic. Kept together
3233
+ below the key list because they belong to the route, not to any one key. */
3234
+ .bre-keys-endpoints {
3235
+ display: flex;
3236
+ flex-direction: column;
3237
+ gap: 6px;
3238
+ margin-top: 8px;
3239
+ padding-top: 8px;
3240
+ border-top: 1px solid var(--dsw-alias-line-faint, #eceef2);
3241
+ }
3242
+
3243
+ .bre-keys-endpoint-row {
3244
+ display: flex;
3245
+ align-items: center;
3246
+ gap: 8px;
3247
+ }
3248
+
3249
+ .bre-keys-endpoint-label {
3250
+ flex: 0 0 auto;
3251
+ width: 104px;
3252
+ font-size: 11px;
3253
+ color: var(--dsw-alias-label-secondary, #6b7280);
3254
+ }
3255
+
3256
+ .bre-keys-endpoint {
3257
+ flex: 1 1 auto;
3258
+ min-width: 0;
3259
+ height: 26px;
3260
+ font-size: 12px;
3261
+ }
3262
+
3263
+ .bre-keys-endpoint-actions { display: flex; justify-content: flex-end; }
3264
+
3265
+ /* ============================================================================
3266
+ Quiet Precision \u2014 the settings surfaces, stated once.
3267
+
3268
+ The blocks below re-describe the key list, the protocol picker, the address
3269
+ rows and the provider card's protocol strip in the redesign's language. They
3270
+ are APPENDED rather than woven into the rules above on purpose: those rules
3271
+ still say what each control IS (a toggle, a menu, a row), and this block only
3272
+ says how it should look, so the two can be diffed when the plugin is next
3273
+ touched. Later rules win, so nothing above needs deleting.
3274
+
3275
+ Three habits it enforces:
3276
+ 1. Grouping is spacing and a heading's job. A box inside a box inside a box
3277
+ is what the old panels read as, so the key list loses its outer rule and
3278
+ keeps only the hairline between rows.
3279
+ 2. One accent, and it only ever means "this one". Chosen states are a tint
3280
+ plus accent ink \u2014 never a solid fill, never a tick.
3281
+ 3. Nothing moves when a state changes: no control grows a glyph on select,
3282
+ because a list that widens under the pointer is a list that misclicks.
3283
+ ========================================================================= */
3284
+
3285
+ /* The provider card's protocol strip: four wires, each with a share of the row's
3286
+ whole width, so the chosen one reads as a segment of the field rather than a
3287
+ chip floating in it. */
3288
+ .bre-protocol-cards {
3289
+ display: flex;
3290
+ width: 100%;
3291
+ box-sizing: border-box;
3292
+ gap: 2px;
3293
+ padding: 2px;
3294
+ border-radius: var(--bre-r-sm);
3295
+ background: var(--bre-sunken);
3296
+ }
3297
+
3298
+ .bre-protocol-card {
3299
+ flex: 1 1 0;
3300
+ height: 28px;
3301
+ min-width: 0;
3302
+ padding: 0 6px;
3303
+ border-radius: 6px;
3304
+ color: var(--bre-ink-2);
3305
+ font-size: 12px;
3306
+ font-weight: 400;
3307
+ overflow: hidden;
3308
+ text-overflow: ellipsis;
3309
+ white-space: nowrap;
3310
+ }
3311
+
3312
+ .bre-protocol-card:hover {
3313
+ color: var(--bre-ink);
3314
+ background: var(--bre-hover);
3315
+ }
3316
+
3317
+ .bre-protocol-card.is-selected {
3318
+ background: var(--bre-accent-weak);
3319
+ color: var(--bre-accent-ink);
3320
+ font-weight: 500;
3321
+ box-shadow: inset 0 0 0 1px var(--bre-accent-line);
3322
+ }
3323
+
3324
+ .bre-protocol-card:focus-visible {
3325
+ outline: none;
3326
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
3327
+ }
3328
+
3329
+ /* The address field: the endpoint's name and its input on ONE line, the name
3330
+ column measured against the longest name it can hold (Anthropic) rather than
3331
+ padded out \u2014 a wider column only buys empty space between the two. */
3332
+ [data-bre-endpoint-field] {
3333
+ grid-template-columns: 76px minmax(0, 1fr);
3334
+ column-gap: 6px;
3335
+ row-gap: 6px;
3336
+ }
3337
+
3338
+ .bre-endpoint-family {
3339
+ width: 76px;
3340
+ height: 24px;
3341
+ justify-content: flex-start;
3342
+ gap: 6px;
3343
+ padding: 0;
3344
+ border-radius: 0;
3345
+ box-shadow: none;
3346
+ background: transparent;
3347
+ color: var(--bre-ink-3);
3348
+ font-size: 11.5px;
3349
+ font-weight: 400;
3350
+ }
3351
+
3352
+ /* The dot names the endpoint's state without a second word: filled once that
3353
+ family has an address, hollow while it is still unset. */
3354
+ .bre-endpoint-family::before {
3355
+ content: '';
3356
+ flex: 0 0 auto;
3357
+ width: 5px;
3358
+ height: 5px;
3359
+ border-radius: 999px;
3360
+ background: var(--bre-line-4);
3361
+ }
3362
+
3363
+ .bre-endpoint-family[data-bre-endpoint-filled='1']::before { background: var(--bre-ok); }
3364
+
3365
+ .bre-endpoint-row {
3366
+ display: grid;
3367
+ grid-template-columns: 76px minmax(0, 1fr);
3368
+ column-gap: 6px;
3369
+ align-items: center;
3370
+ }
3371
+
3372
+ .bre-endpoint-url {
3373
+ height: 30px;
3374
+ border-radius: var(--bre-r-sm);
3375
+ }
3376
+
3377
+ /* \u66F4\u591A\u7AEF\u70B9 and the tally that rides beside it: two quiet words on the field's
3378
+ label line, never a control that looks like another field. */
3379
+ .bre-endpoint-toggle {
3380
+ height: 18px;
3381
+ margin: 0 0 0 4px;
3382
+ padding: 0 4px;
3383
+ border-radius: 5px;
3384
+ color: var(--bre-accent);
3385
+ font-size: 11.5px;
3386
+ }
3387
+
3388
+ .bre-endpoint-toggle:hover {
3389
+ color: var(--bre-accent-ink);
3390
+ background: var(--bre-accent-weak);
3391
+ }
3392
+
3393
+ /* The key list: rows kept apart by a hairline round the block and between the
3394
+ rows. User item 2: with the block's rule removed and the divider at line-1
3395
+ (a 4% black, invisible on white), a resting list read as loose text floating
3396
+ in the card \u2014 the row only existed while the pointer was on it. The box is
3397
+ back, in the same hairline the other groups use, so the extent of a row is
3398
+ legible before it is hovered. */
3399
+ .bre-keys-list {
3400
+ border: 1px solid var(--bre-line-2);
3401
+ border-radius: var(--bre-r-sm);
3402
+ overflow: hidden;
3403
+ }
3404
+
3405
+ .bre-keys-list > li + li { border-top: 1px solid var(--bre-line-2); }
3406
+
3407
+ .bre-keys-row {
3408
+ gap: 8px;
3409
+ min-height: 40px;
3410
+ padding: 0 10px;
3411
+ border-radius: 0;
3412
+ transition: background var(--bre-t) var(--bre-ease);
3413
+ }
3414
+
3415
+ .bre-keys-row:hover { background: var(--bre-hover); }
3416
+
3417
+ /* The enable check: a ring that fills. Filled is accent with a white tick, empty
3418
+ is a grey ring with nothing in it \u2014 the two readings of a checkbox, drawn at
3419
+ the list's own scale. (The tick is the STATE of one control, which is why it
3420
+ survives the no-glyph-on-select rule above: it lives inside the switch, so
3421
+ lighting it cannot change the row's width.) */
3422
+ .bre-keys-toggle-mark {
3423
+ width: 18px;
3424
+ height: 18px;
3425
+ box-shadow: inset 0 0 0 1.5px var(--bre-line-4);
3426
+ transition: background var(--bre-t) var(--bre-ease), box-shadow var(--bre-t) var(--bre-ease);
3427
+ }
3428
+
3429
+ .bre-keys-toggle-mark svg {
3430
+ width: 11px;
3431
+ height: 11px;
3432
+ }
3433
+
3434
+ .bre-keys-toggle.is-on .bre-keys-toggle-mark {
3435
+ background: var(--bre-accent);
3436
+ box-shadow: inset 0 0 0 1.5px var(--bre-accent);
3437
+ color: #ffffff;
3438
+ }
3439
+
3440
+ .bre-keys-toggle:focus-visible {
3441
+ box-shadow: none;
3442
+ }
3443
+
3444
+ .bre-keys-toggle:focus-visible .bre-keys-toggle-mark {
3445
+ box-shadow: inset 0 0 0 1.5px var(--bre-line-4), 0 0 0 3px var(--bre-accent-glow);
3446
+ }
3447
+
3448
+ /* The last enabled key cannot be switched off; it stays lit but stands back, so
3449
+ the refusal is visible before the click rather than after it. */
3450
+ .bre-keys-toggle:disabled .bre-keys-toggle-mark { opacity: 0.45; }
3451
+
3452
+ /* A switched-off key stays listed but reads as idle through its ink alone: the
3453
+ row is still workable, so nothing about it is made fainter than text. */
3454
+ .bre-keys-row.is-off .bre-keys-alias,
3455
+ .bre-keys-row.is-off .bre-keys-mask {
3456
+ opacity: 1;
3457
+ color: var(--bre-ink-4);
3458
+ }
3459
+
3460
+ .bre-keys-alias {
3461
+ font-size: 12px;
3462
+ font-weight: 500;
3463
+ color: var(--bre-ink);
3464
+ }
3465
+
3466
+ .bre-keys-mask {
3467
+ padding: 1px 6px;
3468
+ border-radius: var(--bre-r-xs);
3469
+ background: var(--bre-sunken);
3470
+ color: var(--bre-ink-3);
3471
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
3472
+ font-size: 11px;
3473
+ }
3474
+
3475
+ .bre-keys-mask-plain {
3476
+ padding: 0;
3477
+ border-radius: 0;
3478
+ background: transparent;
3479
+ color: var(--bre-ink);
3480
+ font-family: inherit;
3481
+ font-size: 12px;
3482
+ }
3483
+
3484
+ /* The row's tray: the protocol and the model scope are STATE and stay on the
3485
+ row; the verbs appear on hover. The split is made here rather than in the
3486
+ markup \u2014 the tray stays mounted and only the VERBS inside it are taken out of
3487
+ the line, picked out by :not(.bre-keys-scope): the scope is a <button> too,
3488
+ but its label is a count, not an action.
3489
+ User item 2: they used to be kept in the line and painted away with opacity,
3490
+ to stop the row shifting under the pointer. On a row with no alias that left
3491
+ the two things that ARE always visible \u2014 the protocol pill and the scope
3492
+ count \u2014 held apart by the width of three invisible buttons, so a resting list
3493
+ read as scattered words. A verb that is not showing now takes no room: the
3494
+ state stays together at the row's right edge, and the three actions open in
3495
+ place on hover. The row keeps its own width either way (it is the list's
3496
+ column), so nothing outside the row moves. */
3497
+ .bre-keys-actions {
3498
+ gap: 6px;
3499
+ opacity: 1;
3500
+ pointer-events: auto;
3501
+ }
3502
+
3503
+ .bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
3504
+ display: none;
3505
+ }
3506
+
3507
+ .bre-keys-row:hover .bre-keys-actions .bre-link-button:not(.bre-keys-scope),
3508
+ .bre-keys-row:focus-within .bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
3509
+ display: inline-flex;
3510
+ }
3511
+
3512
+ /* A row waiting on "confirm remove / cancel" must never hide its own question. */
3513
+ .bre-keys-actions.is-confirming .bre-link-button {
3514
+ display: inline-flex;
3515
+ opacity: 1;
3516
+ pointer-events: auto;
3517
+ }
3518
+
3519
+ @media (hover: none) {
3520
+ .bre-keys-actions .bre-link-button:not(.bre-keys-scope) {
3521
+ display: inline-flex;
3522
+ opacity: 1;
3523
+ pointer-events: auto;
3524
+ }
3525
+ }
3526
+
3527
+ .bre-keys-protocol {
3528
+ height: 20px;
3529
+ padding: 0 5px;
3530
+ gap: 3px;
3531
+ border-radius: 5px;
3532
+ background: var(--bre-sunken);
3533
+ color: var(--bre-ink-2);
3534
+ font-size: 11px;
3535
+ line-height: 1;
3536
+ }
3537
+
3538
+ .bre-keys-protocol:hover {
3539
+ background: var(--bre-sunken-2);
3540
+ color: var(--bre-ink);
3541
+ }
3542
+
3543
+ .bre-keys-protocol[aria-expanded='true'] {
3544
+ background: var(--bre-accent-weak);
3545
+ color: var(--bre-accent-ink);
3546
+ }
3547
+
3548
+ .bre-keys-protocol-caret { font-size: 11px; opacity: 0.6; }
3549
+
3550
+ .bre-keys-scope {
3551
+ color: var(--bre-ink-3);
3552
+ font-family: inherit;
3553
+ font-size: 11px;
3554
+ font-variant-numeric: tabular-nums;
3555
+ letter-spacing: 0;
3556
+ }
3557
+
3558
+ /* Verbs are quieter than state: ink-3 at rest, ink on hover, danger for the one
3559
+ that removes a key. */
3560
+ .bre-keys-actions .bre-link-button {
3561
+ color: var(--bre-ink-3);
3562
+ font-size: 11.5px;
3563
+ }
3564
+
3565
+ .bre-keys-actions .bre-link-button:hover { color: var(--bre-ink); }
3566
+
3567
+ .bre-keys-actions .bre-keys-danger { color: var(--bre-danger); }
3568
+
3569
+ .bre-keys-actions .bre-keys-danger:hover { color: var(--bre-danger); }
3570
+
3571
+ /* The inline form: a sunken panel inside the list, never a dialog. */
3572
+ .bre-keys-form-row { padding: 0 0 8px; }
3573
+
3574
+ .bre-keys-form {
3575
+ gap: 8px;
3576
+ padding: 10px;
3577
+ border: none;
3578
+ border-radius: var(--bre-r-sm);
3579
+ background: var(--bre-sunken);
3580
+ }
3581
+
3582
+ .bre-keys-form-fields { gap: 6px; }
3583
+
3584
+ .bre-keys-hint,
3585
+ .bre-keys-note {
3586
+ margin: 0;
3587
+ color: var(--bre-ink-hint);
3588
+ font-size: 11px;
3589
+ line-height: 16px;
3590
+ }
3591
+
3592
+ .bre-keys-form-actions { gap: 6px; }
3593
+
3594
+ .bre-keys-form-actions .bre-primary-button {
3595
+ height: 26px;
3596
+ border-radius: 6px;
3597
+ font-size: 12px;
3598
+ }
3599
+
3600
+ /* The chips \u2014 the models a key serves, and the wire a new key pins: one shape
3601
+ for every choice set in the settings. Selected is a tint, never a tick (see
3602
+ the no-movement rule at the top of this block). */
3603
+ .bre-keys-chips { gap: 6px; }
3604
+
3605
+ .bre-keys-chip {
3606
+ height: 26px;
3607
+ padding: 0 10px;
3608
+ border: 1px solid var(--bre-line-3);
3609
+ border-radius: 999px;
3610
+ background: transparent;
3611
+ color: var(--bre-ink-2);
3612
+ font-size: 11.5px;
3613
+ }
3614
+
3615
+ .bre-keys-chip:hover {
3616
+ border-color: var(--bre-line-4);
3617
+ color: var(--bre-ink);
3618
+ }
3619
+
3620
+ .bre-keys-chip.is-selected {
3621
+ background: var(--bre-accent-weak);
3622
+ border-color: var(--bre-accent-line);
3623
+ color: var(--bre-accent-ink);
3624
+ font-weight: 500;
3625
+ }
3626
+
3627
+ .bre-keys-chip:focus-visible {
3628
+ outline: none;
3629
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
3630
+ }
3631
+
3632
+ /* Adding a key is the list's last line: a dashed invitation, not a button that
3633
+ competes with the row actions. */
3634
+ .bre-keys-add {
3635
+ height: 34px;
3636
+ border: 1px dashed var(--bre-line-3);
3637
+ border-radius: var(--bre-r-sm);
3638
+ color: var(--bre-ink-3);
3639
+ font-size: 12px;
3640
+ }
3641
+
3642
+ .bre-keys-add:hover {
3643
+ border-color: var(--bre-line-4);
3644
+ background: var(--bre-sunken);
3645
+ color: var(--bre-ink);
3646
+ }
3647
+
3648
+ /* The protocol menu: roomy rows, each naming a wire and saying what it signs.
3649
+ The one in force wears the accent tint; no tick, so the rows keep one width
3650
+ and the list cannot shuffle under the pointer. */
3651
+ .bre-protocol-menu {
3652
+ padding: 6px;
3653
+ border: 1px solid var(--bre-line-1);
3654
+ border-radius: var(--bre-r-md);
3655
+ background: var(--bre-surface);
3656
+ box-shadow: var(--bre-shadow-pop);
3657
+ }
3658
+
3659
+ .bre-protocol-menu-title {
3660
+ padding: 4px 8px 6px;
3661
+ color: var(--bre-ink-hint);
3662
+ font-size: 11.5px;
3663
+ font-weight: 500;
3664
+ letter-spacing: 0.02em;
3665
+ }
3666
+
3667
+ .bre-protocol-option {
3668
+ gap: 8px;
3669
+ min-height: 52px;
3670
+ padding: 8px 10px;
3671
+ border-radius: var(--bre-r-sm);
3672
+ }
3673
+
3674
+ .bre-protocol-option:hover { background: var(--bre-hover); }
3675
+
3676
+ .bre-protocol-option[aria-selected='true'],
3677
+ .bre-protocol-option[aria-selected='true']:hover {
3678
+ background: var(--bre-accent-weak);
3679
+ }
3680
+
3681
+ .bre-protocol-option-title {
3682
+ color: var(--bre-ink);
3683
+ font-size: 13px;
3684
+ font-weight: 500;
3685
+ line-height: 18px;
3686
+ }
3687
+
3688
+ .bre-protocol-option[aria-selected='true'] .bre-protocol-option-title {
3689
+ color: var(--bre-accent-ink);
3690
+ }
3691
+
3692
+ .bre-protocol-option-hint {
3693
+ color: var(--bre-ink-hint);
3694
+ font-size: 11.5px;
3695
+ line-height: 16px;
3696
+ }
3697
+
3698
+ .bre-protocol-option[aria-selected='true'] .bre-protocol-option-hint {
3699
+ color: var(--bre-accent-ink);
3700
+ opacity: 0.78;
3701
+ }
3702
+
3703
+ .bre-protocol-option:focus-visible {
3704
+ outline: none;
3705
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
3706
+ }
3707
+
3708
+ @media (prefers-reduced-motion: reduce) {
3709
+ .bre-editor-tab { transition: none; }
3710
+ .bre-key-eye { transition: none; }
3711
+ .bre-keys-actions, .bre-keys-add, .bre-keys-discover, .bre-keys-chip { transition: none; }
3712
+ }
3713
+
3714
+ /* ---- \u6307\u7EB9\u68C0\u6D4B\u9875\u7B7E / the fingerprint tab pane ----------------------------
3715
+
3716
+ A SEPARATE pane, never a field in the model row: the model grid keeps its
3717
+ five columns and its own meaning (one row = one configuration), while this
3718
+ page is one row per model of one provider's health check. Everything here
3719
+ is ours \u2014 the pane's root carries data-bre-fingerprint, which is the bit
3720
+ the tab pass reads to decide the tab exists at all. No overlays, no toasts,
3721
+ no progress bar: progress is the row badge and nothing else (m00702). */
3722
+
3723
+ .bre-fingerprint {
3724
+ display: flex;
3725
+ flex-direction: column;
3726
+ gap: 10px;
3727
+ padding: 4px 0 2px;
3728
+ min-width: 0;
3729
+ }
3730
+
3731
+ .bre-fp-head {
3732
+ display: flex;
3733
+ align-items: center;
3734
+ flex-wrap: wrap;
3735
+ gap: 8px;
3736
+ }
3737
+ .bre-fp-head .grow,
3738
+ .bre-fp-family .grow,
3739
+ .bre-fp-row-head .grow { flex: 1 1 auto; min-width: 0; }
3740
+
3741
+ .bre-fp-title {
3742
+ font-size: 13px;
3743
+ font-weight: 500;
3744
+ color: var(--bre-ink);
3745
+ }
3746
+ .bre-fp-count,
3747
+ .bre-fp-evidence,
3748
+ .bre-fp-k {
3749
+ font-size: 11px;
3750
+ color: var(--bre-ink-3);
3751
+ }
3752
+ /* The status line is a STATUS, not a progress bar \u2014 it reports how the last
3753
+ run came out and, while a batch is going, where it is. \u65E2\u7136\u662F\u72B6\u6001\u884C\uFF0C\u5C31
3754
+ \u4E0D\u8BE5\u6BD4\u5FBD\u7AE0\u66F4\u54CD\u3002 */
3755
+ .bre-fp-summary {
3756
+ font-size: 12px;
3757
+ color: var(--bre-ink-2);
3758
+ }
3759
+ .bre-fp-intro {
3760
+ margin: 0;
3761
+ font-size: 11px;
3762
+ line-height: 16px;
3763
+ color: var(--bre-ink-3);
3764
+ }
3765
+ .bre-fp-error {
3766
+ margin: 0;
3767
+ font-size: 11px;
3768
+ color: var(--bre-danger);
3769
+ }
3770
+
3771
+ /* One button for the whole provider. Quiet by default and quiet while it
3772
+ runs \u2014 it only greys out. \u4E00\u4E2A\u5F3A\u8C03\u8272\u53EA\u8868\u8FBE\u72B6\u6001\uFF0C\u800C"\u6B63\u5728\u8DD1"\u5DF2\u7ECF\u5728\u5FBD\u7AE0\u548C
3773
+ \u72B6\u6001\u884C\u4E0A\u8BF4\u4E86\u4E24\u904D\u3002 */
3774
+ .bre-fp-all,
3775
+ .bre-fp-action {
3776
+ appearance: none;
3777
+ height: 26px;
3778
+ padding: 0 11px;
3779
+ border: 1px solid var(--bre-line-3);
3780
+ border-radius: var(--bre-r-sm);
3781
+ background: var(--bre-surface);
3782
+ color: var(--bre-ink-2);
3783
+ font: inherit;
3784
+ font-size: 11.5px;
3785
+ line-height: 1;
3786
+ white-space: nowrap;
3787
+ cursor: pointer;
3788
+ transition: all var(--bre-t) var(--bre-ease);
3789
+ }
3790
+ .bre-fp-all:hover:not(:disabled),
3791
+ .bre-fp-action:hover:not(:disabled) {
3792
+ border-color: var(--bre-line-4);
3793
+ color: var(--bre-ink);
3794
+ }
3795
+ .bre-fp-all:focus-visible,
3796
+ .bre-fp-action:focus-visible {
3797
+ outline: none;
3798
+ border-color: var(--bre-accent);
3799
+ box-shadow: 0 0 0 3px var(--bre-accent-glow);
3800
+ }
3801
+ .bre-fp-all:disabled,
3802
+ .bre-fp-action:disabled { opacity: 0.55; cursor: default; }
3803
+
3804
+ .bre-fp-rows {
3805
+ display: flex;
3806
+ flex-direction: column;
3807
+ gap: 8px;
3808
+ }
3809
+ .bre-fp-row {
3810
+ border: 1px solid var(--bre-line-2);
3811
+ border-radius: var(--bre-r-md);
3812
+ background: var(--bre-surface);
3813
+ overflow: hidden;
3814
+ }
3815
+ .bre-fp-row-head {
3816
+ display: flex;
3817
+ align-items: center;
3818
+ flex-wrap: wrap;
3819
+ gap: 10px;
3820
+ min-height: 44px;
3821
+ padding: 6px 12px;
3822
+ }
3823
+ .bre-fp-model {
3824
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
3825
+ font-size: 12px;
3826
+ color: var(--bre-ink);
3827
+ overflow-wrap: anywhere;
3828
+ }
3829
+
3830
+ /* The badge is the ONLY place a verdict is painted. 19px, a 5px corner and a
3831
+ hairline stroke, so a column of them reads as one instrument. State is the
3832
+ colour; the words say which state. */
3833
+ .bre-fp-badge {
3834
+ display: inline-flex;
3835
+ align-items: center;
3836
+ height: 19px;
3837
+ padding: 0 6px;
3838
+ border: 1px solid var(--bre-line-3);
3839
+ border-radius: 5px;
3840
+ background: var(--bre-surface);
3841
+ color: var(--bre-ink-3);
3842
+ font-size: 11px;
3843
+ line-height: 1;
3844
+ white-space: nowrap;
3845
+ }
3846
+ .bre-fp-badge.is-idle { color: var(--bre-ink-3); }
3847
+ .bre-fp-badge.is-queued { color: var(--bre-ink-3); border-style: dashed; }
3848
+ .bre-fp-badge.is-running {
3849
+ border-color: var(--bre-accent-line);
3850
+ background: var(--bre-accent-weak);
3851
+ color: var(--bre-accent-ink);
3852
+ }
3853
+ .bre-fp-badge.is-identified {
3854
+ border-color: var(--bre-accent-line);
3855
+ background: var(--bre-accent-weak);
3856
+ color: var(--bre-accent-ink);
3857
+ }
3858
+ .bre-fp-badge.is-doubtful { color: var(--bre-warn); border-color: var(--bre-warn); }
3859
+ .bre-fp-badge.is-failed { color: var(--bre-danger); background: var(--bre-danger-weak); }
3860
+
3861
+ /* The result card: where the numbers came from, what they say, and what they
3862
+ cannot say. Sunken, so it reads as evidence under the row rather than as
3863
+ another row. */
3864
+ .bre-fp-body {
3865
+ padding: 10px 12px 12px;
3866
+ background: var(--bre-sunken);
3867
+ border-top: 1px solid var(--bre-line-1);
3868
+ }
3869
+ .bre-fp-family {
3870
+ display: flex;
3871
+ align-items: baseline;
3872
+ flex-wrap: wrap;
3873
+ gap: 8px;
3874
+ }
3875
+ .bre-fp-v {
3876
+ font-size: 12px;
3877
+ font-weight: 500;
3878
+ color: var(--bre-ink);
3879
+ }
3880
+ .bre-fp-bars {
3881
+ display: flex;
3882
+ flex-direction: column;
3883
+ gap: 6px;
3884
+ margin-top: 6px;
3885
+ }
3886
+ .bre-fp-bar {
3887
+ display: flex;
3888
+ align-items: center;
3889
+ gap: 8px;
3890
+ }
3891
+ .bre-fp-bar-name {
3892
+ width: 132px;
3893
+ flex: 0 0 auto;
3894
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
3895
+ font-size: 11px;
3896
+ color: var(--bre-ink-2);
3897
+ overflow-wrap: anywhere;
3898
+ }
3899
+ /* The bar is a measurement, so it gets no colour of its own \u2014 only the top
3900
+ candidate is tinted. \u4E00\u4E2A\u5F3A\u8C03\u8272\u53EA\u8868\u8FBE\u72B6\u6001\uFF0C\u800C"\u7B2C\u4E00\u540D"\u5C31\u662F\u8FD9\u91CC\u7684\u7ED3\u8BBA\u3002 */
3901
+ .bre-fp-bar-fill {
3902
+ height: 6px;
3903
+ min-width: 2px;
3904
+ flex: 0 1 auto;
3905
+ border-radius: var(--bre-r-pill);
3906
+ background: var(--bre-line-3);
3907
+ }
3908
+ .bre-fp-bar-fill.is-top { background: var(--bre-accent); }
3909
+ .bre-fp-bar-value {
3910
+ font-size: 11px;
3911
+ color: var(--bre-ink-3);
3912
+ font-variant-numeric: tabular-nums;
3913
+ }
3914
+ .bre-fp-note {
3915
+ margin: 10px 0 0;
3916
+ font-size: 11px;
3917
+ line-height: 16px;
3918
+ color: var(--bre-ink-3);
3919
+ }
3920
+
3921
+ @media (prefers-reduced-motion: reduce) {
3922
+ .bre-fp-all, .bre-fp-action { transition: none; }
1916
3923
  }
1917
- `;var _t=require("react"),Wi=require("react-dom");var T=require("react"),Rr=require("react-dom"),Li=require("react-dom");var pi=["off","minimal","low","medium","high","xhigh","max"],Zd=["text","image"];var el=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF08\u65E0 Max \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 High(\u9ED8\u8BA4) / XHigh\u30011.05M \u4E0A\u4E0B\u6587\u4E14\u4EC5 Responses API\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF081.05M\uFF09\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1B2026-10 \u6821\u51C6\uFF1ANone \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8865\u56DE\uFF08\u6B64\u524D\u6309\u65E7\u6A21\u578B\u9875\u8BB0\u4E3A\u65E0 None\uFF09\u3002gpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-gpt-5-2-chat",patterns:["gpt-5.2-chat"],efforts:{off:null,medium:"medium",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-5.2-Chat\uFF08\u5B98\u65B9 id gpt-5.2-chat-latest\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u8BB0\u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5 Medium / XHigh \u4E24\u6863\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\uFF0C128K / 16,384 \u8F93\u51FA\u30022026-10 \u65B0\u589E\u6761\u76EE\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002gpt-5.2-chat \u53E6\u6709\u63A8\u7406\u6761\u76EE\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6",patterns:["gpt-6-luna","gpt-6-sol","gpt-6-terra","gpt-6.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 \u7CFB\uFF08luna/sol/terra\uFF0C2026-10 \u6821\u51C6\u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C272,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\u3002gpt-6-astra \u89C1\u5355\u72EC\u6761\u76EE\uFF08\u88F8 "gpt-6" \u4E0E 6.1-sol \u7531 astra \u6761\u76EE\u627F\u63A5\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C"none" \u672A\u8BC1\u5B9E\u53EF\u624B\u8C03\uFF09\u3002'},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6","gpt-6.1-sol"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF1B2026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002gpt-6 luna/sol/terra \u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u88F8 "gpt-6" \u4E0E 6.1-sol\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\u7531\u672C\u6761\u76EE\u627F\u63A5\u3002'},{id:"openai-gpt-daybreak",patterns:["gpt-daybreak"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-Daybreak\uFF08blue-latest 1.05M / red-latest 400K\uFF0C2026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165 / 128,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-realtime",patterns:["gpt-realtime"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:32e3,note:"GPT-Realtime 2.1\uFF082026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D Minimal / Low / Medium / High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C128,000 \u4E0A\u4E0B\u6587 / 32,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5-5",patterns:["claude-haiku-5.5","claude-opus-5-5","claude-sonnet-5-5","haiku-5.5","claude-5-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5.5 \u4EE3\uFF08Haiku 5.5 / Opus 5.5 / Sonnet 5.5\uFF09\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5168\u6863 Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\u3002off/minimal \u4EE5\u7701\u7565\u8868\u8FBE\uFF08\u76EE\u5F55\u5C06\u4E24\u952E\u8BB0\u4E3A null\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5DF2\u6536\u7D27\u4E3A XHigh / Max\uFF08low/medium/high \u6863\u5DF2\u4ECE\u8BE5\u4EE3 effort \u76EE\u5F55\u79FB\u9664\uFF1BFable 5 \u4E0E Opus 5 \u53E6\u63A5\u53D7\u4EE5\u7701\u7565\u8868\u8FBE\u7684 off\uFF0CSonnet 5 \u65E0 off\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D XHigh / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1BFable 5.1 \u652F\u6301\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002pi-ai 1.2.0 \u76EE\u5F55\u65E0 mythos \u6761\u76EE\uFF0C\u672C\u6863\u4F4D\u6CBF\u7528\u5B98\u65B9 effort \u77E9\u9635\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u6863\u4F4D\u4EC5 XHigh / Max\uFF08low/medium/high \u5DF2\u4ECE\u8BE5\u4EE3\u76EE\u5F55\u79FB\u9664\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\uFF08Opus 4.6 / Sonnet 4.6\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u4EC5\u5269 Max \u4E00\u6863\uFF08low/medium/high/xhigh \u5747\u5DF2\u4ECE\u76EE\u5F55\u79FB\u9664\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 5.5/5/5.1 \u4EE3\u3001Opus 4.5/4.6/4.7/4.8\u3001Sonnet 4.6 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002Haiku 5.5 \u53CA\u6574\u4E2A 5.5 \u4EE3\u89C1\u4E0A\u65B9 anthropic-claude-5-5 \u6761\u76EE\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002Gemma-4 \u89C1\u4E0B\u6761\u3002"},{id:"google-gemma-4",patterns:["gemma-4"],efforts:{off:null,minimal:"MINIMAL",high:"HIGH"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:32768,note:"Gemma 4\uFF0826b/31b-it\uFF09\uFF1A\u4E09\u6863 Minimal / High\uFF08\u6863\u4F4D\u7EBF\u4E3A\u5B98\u65B9\u5927\u5199\u679A\u4E3E\u62FC\u5199\uFF09\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF1BLow/Medium \u4E0D\u88AB\u63A5\u53D7\u3002\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 32,768\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,maxTokens:5e5,note:'Grok 4.7\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF08off \u4EC5\u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C500K \u4E0A\u4E0B\u6587 / 500K \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u786E\u8BA4\u6863\u4F4D\u4E0E\u5BB9\u91CF\uFF0C"\u4E0A\u6E38 404"\u4E0E"\u6863\u4F4D\u672A\u8BC1\u5B9E"\u4E24\u6761\u65E7\u8BB0\u5F55\u4F5C\u5E9F\uFF09\u3002grok-4.5 \u4F20 xhigh \u88AB\u9759\u9ED8\u6309 High \u5904\u7406\u7684\u8BF4\u660E\u89C1\u5176\u6761\u76EE\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:3e4,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low(\u9ED8\u8BA4) / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 30,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1AXHigh \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u79FB\u9664\u2014\u2014\u5B83\u81EA 4.6 \u8D77\u624D\u52A0\u5165\uFF1B\u5E26\u56FE\u8F93\u5165\uFF09\u3002grok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:16384,note:'Magistral\uFF08magistral-medium-latest\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u663E\u793A\u73B0\u5F79 magistral \u8D70 mistral-conversations \u534F\u8BAE\u5E76\u63A5\u53D7 effort\uFF08None / High \u4E24\u6863\uFF0C\u9ED8\u8BA4 None\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 16,384\u3002\u65E9\u524D"\u8BE5\u7EBF\u65E0 effort \u53C2\u6570\u4E14\u5DF2\u5F03\u7528"\u7684\u8BB0\u5F55\u4F5C\u5E9F\u3002'},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-large-4","mistral-medium-2604","mistral-medium-latest","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF082026-10 \u6269\u5145\uFF09\uFF1ANone / High \u4E24\u6863\uFF0C\u5B98\u65B9 reasoning_effort \u679A\u4E3E\u5373 none/high\uFF1B\u73B0\u5F79\u578B\u53F7 mistral-large-4\uFF081M\uFF09\u3001mistral-medium-3.5\uFF082604/latest\uFF09\u3001mistral-small-2603\uFF08Small 4\uFF09\u7ECF\u5B83\u63A7\u5236\uFF0C\u5747\u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\uFF1Alarge-4 262,144 \u8F93\u51FA\u3001medium 262,144 \u8F93\u51FA\u3001small 256,000 \u8F93\u51FA\uFF08\u4E0A\u4E0B\u6587\u5747 262,144\uFF09\u3002\u975E\u63A8\u7406\u65E7\u6B3E\u89C1\u4E0B\u6761\u3002"},{id:"mistral-legacy",patterns:["mistral-large-2411","mistral-large-latest","mistral-large-2512","mistral-medium-2505","mistral-medium-2508","mistral-small-2506","mistral-nemo","devstral","ministral","codestral","pixtral","voxtral"],efforts:!1,input:["text","image"],note:"Mistral \u975E\u63A8\u7406\u7EBF\uFF082026-10 \u65B0\u589E\u6761\u76EE\uFF09\uFF1Alarge-2411/2512/latest\u3001medium-2505/2508\u3001small-2506\u3001nemo \u53CA devstral/ministral/codestral/pixtral/voxtral \u7B49\u4E13\u7528\u7EBF\u5747\u4E0D\u63A5\u53D7 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002\u591A\u6570\u73B0\u5F79\u6B3E\u5E26\u89C6\u89C9\uFF08large-2411 \u4E3A\u7EAF\u6587\u672C\uFF09\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash","glm-5.3-flashx"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-for-coding",patterns:["kimi-for-coding"],efforts:{low:"low",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:32768,note:"Kimi for Coding\uFF1AMoonshot \u7F16\u7801\u4E13\u7EBF\u8D70 anthropic-messages \u534F\u8BAE\u3001\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D Low / High / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\u3002\u9AD8\u901F\u7248\uFF08-highspeed\uFF09\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m2",patterns:["minimax-m2"],efforts:!1,input:["text"],contextWindow:204800,maxTokens:131072,note:"MiniMax-M2 / M2.5\uFF08\u542B -highspeed\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\u3001\u65E0 effort \u53C2\u6570\uFF08M3 \u624D\u5F15\u5165 thinking \u53C2\u6570\uFF09\uFF0C\u7EAF\u6587\u672C\uFF0C204,800 / 131,072\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BM3 \u89C1\u4E0B\u6761\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,maxTokens:512e3,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 512,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u8865\u5BB9\u91CF\uFF09\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"},{id:"fireworks-ember",patterns:["ember-1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"Fireworks ember-1\uFF1Aanthropic-messages \u534F\u8BAE\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D None(\u5173) / Low / Medium / High / Max\uFF08off \u663E\u5F0F none \u62FC\u5199\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"thinkingmachines-inkling",patterns:["inkling"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:524288,maxTokens:131072,note:"Thinking Machines Inkling\uFF1A\u5168\u6863 Minimal / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF0Coff \u663E\u5F0F none\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C512K \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1Btogether \u4E2D\u7EE7\u4FA7 effort \u53C2\u6570\u672A\u5F00\u653E\uFF0C\u9700\u652F\u6301\u65B9\u8F6C\u53D1\uFF09\u3002"},{id:"antling-ring",patterns:["ring-2.6"],efforts:{high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,maxTokens:65536,note:"\u8682\u8681 Ling Ring-2.6-1T\uFF1A\u6863\u4F4D High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B262,144 / 65,536\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"antling-ling",patterns:["ling-2.6"],efforts:!1,input:["text"],note:"\u8682\u8681 Ling-2.6\uFF08\u542B -flash\uFF09\uFF1A\u975E\u601D\u8003\u6A21\u578B\uFF0C\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BRing-2.6 \u601D\u8003\u7EBF\u89C1\u4E0A\u6761\uFF09\u3002"}],br={off:null,low:"low",medium:"medium",high:"high"},tl={"openai-completions":br,"openai-responses":br,"anthropic-messages":br,deepseek:{off:"none",low:"low",high:"high",max:"max"}},nl={low:"low",medium:"medium",high:"high"};function Rt(e){return(e??"").toLowerCase().trim()}function ui(e){return e!==void 0&&/[a-z0-9]/.test(e)}function At(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function mi(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!ui(r)&&!ui(o)}function wr(e,t){let n=At(e)+" "+At(t??""),r;for(let o of el)for(let i of o.patterns){let s=At(i),a=n.indexOf(s);for(;a>=0;){if(mi(n,a,s.length)){(r===void 0||s.length>r.length)&&(r={entry:o,length:s.length});break}a=n.indexOf(s,a+1)}}return r?.entry}var rl={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function ol(e){let t=Rt(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let i=rl[o.slice(-2).join(".")];if(i!==void 0)return i}}catch{}return"openai-completions"}var ln="openai-completions",gi="anthropic-messages";function yr(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function il(e,t){let n=Rt(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===gi){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n===ln)return delete r.forceAdaptiveThinking,Object.keys(r).length===0?void 0:r}function sl(e,t){let n=Rt(t.api);if(n===ln){let r=e.compat;return r!==void 0&&(r=il(r,n)??void 0),r===void 0&&!yr(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&yr(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===gi&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var al=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function vr(e){if(Rt(e.api)!==ln)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!al.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function fi(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!vr(t)?e:{...e,supportsDeveloperRole:!1}}var ci={off:null,low:"low",medium:"medium",high:"high"},dl=["vl","vision","omni","4o","pixtral","internvl"];function xr(e){let t=At(e);for(let n of dl){let r=At(n),o=t.indexOf(r);for(;o>=0;){if(mi(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function ll(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>Zd.includes(n)))return t.includes("image")?["text","image"]:["text"]}function ke(e,t,n){let r=wr(e,t.displayName),o,i,s,a;r?.input!==void 0&&(o=r.input,i="knowledge"),r?.contextWindow!==void 0&&(s=r.contextWindow),r?.maxTokens!==void 0&&(a=r.maxTokens);let d=ll(n?.input);if(d!==void 0&&(o=d,i="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(s=n.contextLength),o===void 0){let h=xr(e);h!==void 0&&(o=h,i="heuristic")}let l={...o===void 0?{}:{input:o},...i===void 0?{}:{inputSource:i},...s===void 0?{}:{contextWindow:s},...a===void 0?{}:{maxTokens:a}},p=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...p,...l};if(r!==void 0){let h=fi(sl(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...h===void 0?{}:{compat:h},matched:!0,entryId:r.id,source:r.id,confidence:"high",...p,...l}}let g=ol(t),c=tl[g]??nl,u=Rt(t.api)===ln?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,f=u!==void 0&&yr(t.baseURL)?{...u,thinkingTokenBudgetField:"thinking_token_budget"}:u,m=fi(f,t,!0);return n?.reasoning===!0?{efforts:{...ci},...ci.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...p,...l}:{efforts:c,...c.medium!==void 0?{defaultEffort:"medium"}:{},...m===void 0?{}:{compat:m},matched:!1,source:"protocol:"+g,confidence:"low",...p,...l}}var bi="dsh-model-think-level.slider.efforts",Er="breSelectWired";function kr(e){return typeof e=="object"&&e!==null&&e.ok===!1}function Tr(e){if(!kr(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function $e(e,t){return`${e}/${t}`}function yi(){try{let e=window.localStorage.getItem(bi);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function ul(e){try{window.localStorage.setItem(bi,JSON.stringify(e))}catch{}}function fl(e,t,n){let r=yi();r[$e(e,t)]=n,ul(r)}function cl(e,t){return yi()[$e(e,t)]}function un(e,t,n){let o=e.groups.find(i=>i.id===t)?.models.find(i=>i.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(i=>i.id)}function pl(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function ml(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function gl(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function hi(e,t,n,r,o){let i=un(e,t,n);if(i.length===0)return;let s=$e(t,n),a=r.get(s);if(a!==void 0&&i.includes(a))return a;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&i.includes(d))return d;let l=cl(t,n);if(l!==void 0&&i.includes(l))return l;let p=ke(n,{}).defaultEffort;if(p!==void 0&&i.includes(p))return p;let g=pl(e,t,n);return g!==void 0&&i.includes(g)?g:ml(i)}function wi(e,t){let n=e;if(n[Er]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,i=new Map,s=new Set,a=new Map,d=3,l=0,p=async u=>{let f=++l;if(u.reasoningEffort!==void 0){let b=await o.call(e,u);return!kr(b)&&we()&&(i.set($e(u.provider,u.model),u.reasoningEffort),fl(u.provider,u.model,u.reasoningEffort)),b}let m=e.store.getSnapshot();if(!gl(m.current,u)){if(we()){let b=$e(u.provider,u.model);i.delete(b),s.add(b)}return o.call(e,u)}if(!we())return o.call(e,u);let h=await hi(m,u.provider,u.model,i,t),v=e.store.getSnapshot();if(!(l!==f||((b,A)=>b===null||A===null?b!==A:b.provider!==A.provider||b.model!==A.model||b.reasoningEffort!==A.reasoningEffort)(v.current,m.current)))return!we()||h===void 0||!un(v,u.provider,u.model).includes(h)?o.call(e,u):o.call(e,{...u,reasoningEffort:h})},g=()=>{let u=e.store.getSnapshot(),f=u.current;if(f===null||f.reasoningEffort!==void 0||!we())return;let m=$e(f.provider,f.model);if(s.has(m))return;if(un(u,f.provider,f.model).length===0){s.add(m);return}s.add(m);let h=l;hi(u,f.provider,f.model,i,t).then(async v=>{if(v===void 0){s.delete(m);return}if(!we()){s.delete(m);return}let x=e.store.getSnapshot(),b=x.current;if(l!==h||b===null||b.reasoningEffort!==void 0||$e(b.provider,b.model)!==m||!un(x,b.provider,b.model).includes(v))return;let A=await o.call(e,{provider:b.provider,model:b.model,reasoningEffort:v});if(kr(A))throw A}).catch(()=>{let v=(a.get(m)??0)+1;a.set(m,v),v<d&&(s.delete(m),g())})},c=e.store.subscribe(g);return g(),n[Er]=!0,e.select=p,()=>{delete n[Er],c(),r?e.select=o:delete n.select}}var C=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function vi(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function fn(e,t){if(!C(e))return[];let n=e[t];return!C(n)||!Array.isArray(n.models)?[]:n.models.filter(C)}function Ve(e,t){if(!C(e))return{};let n=e[t];if(!C(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,i=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:i}}var Ke=(e,t)=>typeof e[t]=="boolean";function hl(e,t){if(Array.isArray(e)){for(let n of e)if(C(n)&&n.id===t)return n}}function bl(e){if(!C(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...he(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...he(e),reasoning:!0,source:"supported_parameters"};if(Ke(e,"supports_reasoning"))return{...he(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(Ke(e,"supportsReasoning"))return{...he(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(Ke(e,"can_reason"))return{...he(e),reasoning:e.can_reason,source:"can_reason"};if(Ke(e,"reasoning"))return{...he(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...he(e),reasoning:!0,source:"reasoning_effort"};let o=C(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let i=o.thinking,s=C(i)&&typeof i.supported=="boolean"?i.supported:void 0,a=o.effort,d=C(a)&&typeof a.supported=="boolean"?a.supported:void 0;if(d===!0)return{...he(e),reasoning:!0,source:"capabilities.effort.supported"};if(s===!0)return{...he(e),reasoning:!0,source:"capabilities.thinking.supported"};if(s===!1)return{...he(e),reasoning:!1,source:"capabilities.thinking.supported"};if(d===!1)return{...he(e),reasoning:!1,source:"capabilities.effort.supported"}}return{...he(e),reasoning:"unknown",source:null}}function he(e){let t={},n=s=>{if(!Array.isArray(s))return;let a=s.filter(d=>typeof d=="string");return a.length>0?a.map(d=>d.toLowerCase()):[]},r=C(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let s=C(e.modalities)?e.modalities:void 0;o=n(s?.input)}if(o===void 0){let s=e.capabilities,a=d=>Array.isArray(d)&&d.some(l=>typeof l=="string"&&l.toLowerCase()==="vision");if(a(e.supported_features)||a(s))o=["image"];else if(C(s)){let d=[];for(let l of["image_input","video_input","pdf_input","file_input"]){let p=C(s[l])?s[l]:void 0;if(p===void 0||typeof p.supported!="boolean")continue;let g=l.replace(/_input$/,"");p.supported===!0?d.push(g):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(Ke(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:Ke(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(Ke(e,"supports_images")||Ke(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let i=e.context_length;if(typeof i=="number"&&Number.isFinite(i)&&i>0)t.contextLength=i;else{let a=(C(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let p=(C(e.limit)?e.limit:void 0)?.context;typeof p=="number"&&Number.isFinite(p)&&p>0&&(t.contextLength=p)}}}return t}function xi(e,t){let n=hl(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:bl(n)}}function ce(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function cn(e){if(!C(e))return;let t=e.providers;return C(t)?t:void 0}function Ei(e,t){for(let n of[e?.user,e?.base]){let r=cn(n)?.[t];if(C(r)&&r.models!==void 0)return r.models}}function Mr(e){return cn(e?.user)}function pn(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function mn(e,t){let r=e.find(i=>i.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(i=>typeof i=="string");return o.length>0?o:void 0}function gn(e,t){let r=e.find(o=>o.id===t)?.compat;if(C(r))return{...r}}function hn(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function bn(e,t){let r=e.find(o=>o.id===t)?.[at];return typeof r=="string"&&r.length>0?r:void 0}async function yl(e,t){try{let n=await fetch(`${No}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?xi(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function yn(e,t=()=>te(e),n,r,o,i){return{async suggest(s,a,d,l){let p=ce((await t()).namespace),g=Ve(p,s),c={api:g.api??l?.api,baseURL:g.baseURL??l?.baseURL,displayName:d??g.displayName},u=p[s]===void 0?void 0:await yl(s,a),f=ke(a,c,u);return f.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:f.efforts,...f.compat===void 0?{}:{compat:f.compat},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.input===void 0?{}:{input:f.input},...f.inputSource===void 0?{}:{inputSource:f.inputSource},...f.contextWindow===void 0?{}:{contextWindow:f.contextWindow},...f.maxTokens===void 0?{}:{maxTokens:f.maxTokens},matched:f.matched,source:f.source,confidence:f.confidence,...f.endpoint===void 0?{}:{endpoint:f.endpoint}}}},commit(s,a,d){if(i?.()===!0){n?.(s,a,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(s,a,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(s,a){o?.(s,a)},stageEfforts(s,a,d,l,p,g){n?.(s,a,d,l,p,g)},async writeEfforts(s,a,d,l,p,g){if(r!==void 0)return r(s,a,{efforts:d,...l===void 0?{}:{compat:l},...p===void 0?{}:{input:p},...g===void 0?{}:{defaultEffort:g}}),{ok:!0,staged:!0};let u=(await Ht(e,s,[{modelId:a,efforts:d,...l===void 0?{}:{compat:l},...p===void 0?{}:{input:p},...g===void 0?{}:{defaultEffort:g}}],t))[0]??{ok:!1,error:"no-result"};return u.ok?{ok:!0}:u.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:u.error??"conflict"}}}}async function Ht(e,t,n,r=()=>te(e),o){if(n.length===0)return[];let i=!1;for(let s=0;s<3;s++)try{let a=s===0?await r():await te(e,{fresh:!0});if(a.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=Ei(a.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(C))return n.map(()=>({ok:!1,error:"invalid-models"}));let p=d.map(u=>u),g=[];for(let u of n){let f=p.findIndex(m=>m.id===u.modelId);if(f<0){g.push(u.modelId);continue}p[f]=wl(p[f],u,i?void 0:u.compat)}if(g.length>0)return n.map(u=>g.includes(u.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let c=await e.settings.mutate(fe,[{op:"set",path:["providers",t,"models"],value:p}],a.namespace.revision);if(!c.ok){if(s===0&&c.error.code==="settings/conflict")continue;let u=c.error.code==="settings/rejected"&&vi(c.error.message);if(!i&&u&&n.some(f=>f.compat!==void 0)){i=!0;continue}return n.map(()=>({ok:!1,error:c.error.message}))}return n.map(()=>({ok:!0}))}catch(a){return n.map(()=>({ok:!1,error:a instanceof Error?a.message:String(a)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function wl(e,t,n){let r={...e},o=t.efforts!=="keep",i=t.efforts==="keep"?void 0:t.efforts;if(o)if(i===void 0)delete r.reasoningEfforts,r[ge]=!0;else if(delete r[ge],delete r[st],i===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...i};let a={...C(e.compat)?e.compat:{},...n??{}};Object.keys(a).length>0&&(r.compat=a)}return t.input!==void 0&&(t.input===null?(delete r.input,r[_e]=!0):(delete r[_e],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[at]:r[at]=t.defaultEffort),r}function Lr(e,t){for(let n of[e?.user,e?.base]){let r=cn(n)?.[t];if(!C(r))continue;let o=r.headers;if(o===void 0)continue;if(!C(o))return;let i={};for(let[s,a]of Object.entries(o))typeof a=="string"&&(i[s]=a);return i}}async function Ot(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};let r=!1;for(let o=0;o<2;o+=1)try{let i=o===0?await te(e):await te(e,{fresh:!0});if(i.namespace===void 0)return{ok:!1,error:"no-namespace"};if(i.writable!==!0)return{ok:!1,error:"read-only"};if(!Ye(i.namespace,t)){r=!0;continue}let s=await e.settings.mutate(fe,[{op:"set",path:["providers",t,"headers"],value:{...n}}],i.namespace.revision);if(!s.ok){if(o===0&&s.error.code==="settings/conflict")continue;return{ok:!1,error:s.error.message}}return{ok:!0}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}return r?{ok:!1,error:"no-route"}:{ok:!1,error:"conflict"}}function Ye(e,t){if(Object.prototype.hasOwnProperty.call(ce(e),t))return!0;for(let n of[e?.user,e?.base]){let r=cn(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function te(e,t={}){let n=t.fresh===!0?void 0:vl(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(i=>i.ns===fe),writable:r.value.writable}:{namespace:void 0,writable:!1}}function vl(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:fe,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}var Sr=new Map;function ki(e){let t=Sr,n=!1,r,o=0,i=new Set,s=()=>{for(let d of[...i])d()},a=()=>{if(n)return Promise.resolve();if(r!==void 0)return r;let d=o;return r=te(e,{fresh:!0}).then(l=>{if(d!==o||l.namespace===void 0)return;let p=new Map;for(let[g,c]of Object.entries(ce(l.namespace))){let u=new Map,f=Array.isArray(c.models)?c.models:[];for(let m of f){if(!C(m)||typeof m.id!="string"||!Array.isArray(m.input))continue;let h=m.input.filter(v=>typeof v=="string");h.length>0&&u.set(m.id,h)}u.size>0&&p.set(g,u)}t=p,n=!0,s()}).catch(()=>{}).finally(()=>{d===o&&(r=void 0)}),r};return{getSnapshot:()=>t,subscribe(d){return i.add(d),()=>{i.delete(d)}},load:a,invalidate(){o+=1,n=!1,r=void 0,i.size>0&&a()}}}function xl(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function El(e){return e.current}function kl(e,t){let n=El(t),r=e.findIndex(a=>a.id===n?.reasoningEffort);if(r>=0)return r;let i=t.groups.find(a=>a.id===n?.provider)?.models.find(a=>a.id===n?.model)?.reasoning?.defaultEffort,s=i===void 0?-1:e.findIndex(a=>a.id===i);return s>=0?s:Math.floor((e.length-1)/2)}function Ti(e){return e.models??[]}function ct(e){let t=e;return t.name??t.label??t.title??e.id}function Ar(e){return(0,T.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function Tl(){let[e,t]=(0,T.useState)(null),n=(0,T.useRef)(0);(0,T.useEffect)(()=>()=>{window.clearTimeout(n.current)},[]);let r=(0,T.useCallback)(()=>{window.clearTimeout(n.current),t(null)},[]),o=(0,T.useCallback)((i,s)=>{window.clearTimeout(n.current);let a=i.currentTarget;a.scrollWidth<=a.clientWidth+1||(n.current=window.setTimeout(()=>{t({target:a,text:s})},300))},[]);return{tip:e,onEnter:o,onLeave:r}}function Ml({state:e}){if(typeof document>"u")return null;let t=e.target.getBoundingClientRect(),n=Math.max(12,Math.min(t.right,window.innerWidth-12));return(0,Li.createPortal)((0,T.createElement)("div",{className:"bre-tip",role:"tooltip",style:{top:Math.min(t.bottom+6,window.innerHeight-40),right:Math.max(12,window.innerWidth-n)}},e.text),document.body)}function Ll(){return(0,T.createElement)("svg",{className:"bre-option-check",width:14,height:14,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0},(0,T.createElement)("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}))}var Mi=new Map;function Sl(e,t){let n=t??e.input;if(Array.isArray(n)&&n.length>0)return n.includes("image");let r=JSON.stringify([e.id,e.name]),o=Mi.get(r);if(o!==void 0)return o;let i=wr(e.id,e.name)?.input,s=i!==void 0?i.includes("image"):(xr(e.id)??[]).includes("image");return Mi.set(r,s),s}function Al(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Rl(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,T.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function Hl(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}function Ol(e,t,n){let r=[];return Sl(e,n)&&r.push((0,T.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Rl(t("tagVision")))),Al(e)&&r.push((0,T.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Hl(t("tagThinking")))),r.length===0?null:(0,T.createElement)("span",{className:"bre-option-tags"},...r)}function Si(e){let{directory:t,t:n,configuredInputs:r}=e,o=e.onLayoutChange,i=(0,T.useSyncExternalStore)(k=>t.store.subscribe(k),()=>t.store.getSnapshot()),s=(0,T.useSyncExternalStore)(k=>r?.subscribe(k)??(()=>{}),()=>r?.getSnapshot()??Sr),a=xl(i),[d,l]=(0,T.useState)(""),[p,g]=(0,T.useState)(null),[c,u]=(0,T.useState)(null),[f,m]=(0,T.useState)(!1),[h,v]=(0,T.useState)(null),x=(0,T.useRef)(null),b=(0,T.useRef)(""),A=(0,T.useRef)(!1),R=i.current!==null&&a.length>=2,H=f||i.status==="selecting",O=h??i.error,L=t.select;(0,T.useEffect)(()=>{if(A.current)return;let k=kl(a,i),ne=a[k]?.id??"";b.current=ne,l(ne),v(null)},[R,a,i]),(0,T.useEffect)(()=>{t.load().catch(()=>{})},[t]),(0,T.useEffect)(()=>{r?.load().catch(()=>{})},[r]);let F=i.current,y=i.groups.find(k=>k.id===F?.provider),w=y?.models.find(k=>k.id===F?.model)?.name??(F===null?n("triggerFallback"):F.model),M=F===null?w:ct(y??{id:F.provider})+" \xB7 "+w,N=a.find(k=>k.id===d)?.name??n("effortDefault"),W=(0,T.useSyncExternalStore)(rn,fr),X=(0,T.useSyncExternalStore)(sn,Jo),oe=(0,T.useSyncExternalStore)(dn,ri),J=i.groups.filter(k=>Ti(k).length>0&&!X.includes(k.id)).map(k=>k.id),Q=ut(cr(J),W),Z=c!==null&&Q.includes(c)?c:F!==null&&Q.includes(F.provider)?F.provider:Q[0]??null,G=Z===null?[]:di(Ti(i.groups.find(k=>k.id===Z)),oe[Z]??[]),q=F===null?"":F.provider+"/"+F.model,B=(0,T.useCallback)(k=>{p!==k&&((0,Rr.flushSync)(()=>{g(k)}),o?.())},[o,p]),U=(0,T.useCallback)(()=>{p!==null&&((0,Rr.flushSync)(()=>{g(null)}),o?.())},[o,p]),S=(0,T.useCallback)(()=>{let k=x.current?.closest('[role="menu"], [role="group"]');k!=null&&(k.tabIndex=-1,k.focus({preventScroll:!0}))},[]),K=(0,T.useCallback)(async(k,ne)=>{if(A.current)return;let ie=t.store.getSnapshot().current;if(U(),!(ie!==null&&ie.provider===k&&ie.model===ne)){A.current=!0,S(),m(!0),v(null);try{let ue=await L({provider:k,model:ne}),Re=Tr(ue);if(Re!==void 0)throw new Error(Re)}catch(ue){v(ue instanceof Error?ue.message:String(ue))}finally{A.current=!1,m(!1)}}},[U,t,S,L]),Y=(0,T.useCallback)(async k=>{if(A.current||(U(),k===i.current?.reasoningEffort&&i.status!=="error"))return;A.current=!0;let ne=b.current;S(),m(!0),v(null),l(k);try{let ie=i.current;if(ie===null)throw new Error(n("sliderNoCurrent"));let ue=await L({provider:ie.provider,model:ie.model,reasoningEffort:k}),Re=Tr(ue);if(Re!==void 0)throw new Error(Re);let He=t.store.getSnapshot(),Jt=a.find(sr=>sr.id===He.current?.reasoningEffort)?.id??k;b.current=Jt,l(Jt)}catch(ie){b.current=ne,l(ne),v(ie instanceof Error?ie.message:String(ie))}finally{A.current=!1,m(!1)}},[U,t,S,a,L,i.current,i.status,n]),{tip:le,onEnter:ot,onLeave:it}=Tl(),Xt=[(0,T.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(p==="model"?" is-open":""),disabled:H,"aria-expanded":p==="model",onMouseLeave:it,onClick:()=>{B(p==="model"?null:"model")}},(0,T.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,T.createElement)("span",{className:"bre-row-value","aria-label":M,onMouseEnter:k=>{ot(k,M)}},M),Ar(p==="model")),p==="model"?(0,T.createElement)("div",{key:"panel:model",className:"bre-panel bre-panel-models"},(0,T.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...Q.map(k=>(0,T.createElement)("button",{key:k,type:"button",className:"bre-provider"+(k===Z?" is-open":"")+(k===F?.provider?" is-current":""),disabled:H,"aria-expanded":k===Z,onMouseLeave:it,onClick:()=>{u(k)}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":ct(i.groups.find(ne=>ne.id===k)),onMouseEnter:ne=>{ot(ne,ct(i.groups.find(ie=>ie.id===k)))}},ct(i.groups.find(ne=>ne.id===k))),Ar(k===Z))),...Q.length===0?[(0,T.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),(0,T.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...G.length===0?[(0,T.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:G.map(k=>{let ne=Z+"/"+k.id,ie=ne===q;return(0,T.createElement)("button",{key:ne,type:"button",className:"bre-option"+(ie?" is-active":""),disabled:H,"aria-pressed":ie,onMouseLeave:it,onClick:()=>{K(Z,k.id)}},(0,T.createElement)("span",{className:"bre-option-name","aria-label":k.name??k.id,onMouseEnter:ue=>{ot(ue,k.name??k.id)}},k.name??k.id),Ol(k,n,s.get(Z)?.get(k.id)))}))):null,(0,T.createElement)("div",{key:"divider",className:"bre-divider","aria-hidden":!0}),(0,T.createElement)("button",{key:"row:effort",type:"button",role:"menuitem",className:"bre-row-control"+(p==="effort"?" is-open":""),disabled:H||!R,"aria-expanded":R?p==="effort":void 0,onClick:()=>{B(p==="effort"?null:"effort")}},(0,T.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"+(R?"":" is-muted")},R?N:n("sliderNoLevels")),R?Ar(p==="effort"):null),p==="effort"&&R?(0,T.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...a.map(k=>(0,T.createElement)("button",{key:k.id,type:"button",className:"bre-option"+(k.id===d?" is-active":""),disabled:H,"aria-pressed":k.id===d,onClick:()=>{Y(k.id)}},(0,T.createElement)("span",{className:"bre-option-name"},k.name),k.id===d?Ll():null))):null];return(0,T.createElement)("div",{className:"bre-slider-body",ref:x},(0,T.createElement)("div",{className:"bre-card"},...Xt),O===null?null:(0,T.createElement)("div",{className:"bre-model-error",role:"status"},O),le===null?null:(0,T.createElement)(Ml,{key:"tip",state:le}))}var V=require("react"),Ri='section[role="group"]',Or='button[role="menuitemradio"]';function Hi(e){return e.querySelector(Ri)!==null}function Hr(e){return Array.from(e.querySelectorAll(Or)).filter(t=>!t.disabled&&t.style.display!=="none")}function _l(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Ai(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let l=n.get(d);l!==void 0&&(d.style.display=l,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean),s=Array.from(e.querySelectorAll(Ri)),a=0;if(i.length===0){for(let d of[...n.keys()])o(d);for(let d of s)a+=d.querySelectorAll(Or).length;return a}for(let d of s){let l=_l(d),p=Array.from(d.querySelectorAll(Or)),g=0;for(let c of p){let u=(c.getAttribute("title")??"").toLowerCase(),f=(c.textContent??"").toLowerCase(),m=`${l} ${u} ${f}`;i.every(h=>m.includes(h))?(o(c),g+=1):r(c)}g>0?(o(d),a+=g):r(d)}return a}function Oi({menu:e,t}){let[n,r]=(0,V.useState)(""),[o,i]=(0,V.useState)(0),s=(0,V.useRef)(null),a=(0,V.useRef)(""),d=(0,V.useRef)(new Map),l=(0,V.useCallback)(u=>{a.current=u;let f=Ai(e,u,d.current);i(f)},[e]);(0,V.useEffect)(()=>()=>{Ai(e,"",d.current)},[e]),(0,V.useEffect)(()=>{let u=new MutationObserver(()=>{a.current.trim().length!==0&&l(a.current)});return u.observe(e,{childList:!0,subtree:!0}),()=>{u.disconnect()}},[e,l]),(0,V.useEffect)(()=>{let u=f=>{if(a.current.trim().length===0)return;let m=f.key;if(!(m==="ArrowDown"||m==="ArrowUp")&&!(m==="Home"||m==="End"||m==="PageUp"||m==="PageDown")||f.target===s.current||f.target instanceof Node&&!e.contains(f.target))return;let x=Hr(e);if(x.length===0)return;let b=x.findIndex(R=>R===document.activeElement),A;m==="Home"||m==="PageUp"?A=0:m==="End"||m==="PageDown"?A=x.length-1:m==="ArrowDown"?A=b===-1?0:(b+1)%x.length:A=b===-1?x.length-1:(b-1+x.length)%x.length,f.preventDefault(),f.stopPropagation(),x[A]?.focus()};return e.addEventListener("keydown",u,!0),()=>{e.removeEventListener("keydown",u,!0)}},[e]);let p=u=>{let f=u.key;if(f==="ArrowDown"){u.preventDefault(),u.stopPropagation(),Hr(e)[0]?.focus();return}if(n.trim().length>0&&(f==="ArrowUp"||f==="Home"||f==="PageUp"||f==="End"||f==="PageDown")){let m=Hr(e);m.length>0&&(u.preventDefault(),u.stopPropagation(),m[f==="ArrowUp"||f==="End"||f==="PageDown"?m.length-1:0]?.focus());return}f==="Escape"&&n.length>0&&(u.preventDefault(),u.stopPropagation(),r(""),l(""))},g=()=>{r(""),l(""),s.current?.focus({preventScroll:!0})},c=o===0&&n.trim().length>0;return(0,V.createElement)("div",{className:"bre-model-search-box"+(c?" has-empty":""),"data-bre-search":"1"},(0,V.createElement)("div",{className:"bre-search-input-wrapper"},(0,V.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,V.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,V.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,V.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,V.createElement)("input",{ref:s,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:u=>{let f=u.currentTarget.value;r(f),l(f)},onKeyDown:p}),n.length>0?(0,V.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:g},(0,V.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,V.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),c?(0,V.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var wn=require("react"),_i=require("react-dom"),Ii=require("react-dom/client");function Te(){return document.body}function Xe(e,t,n){let r=(0,Ii.createRoot)(e);return n?.sync===!0?(0,_i.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Ne(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var Ie=class extends wn.Component{constructor(){super(...arguments);Io(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,wn.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Il="conversation.input.model";function Ni(e){return e.querySelector("[data-composer-card]")??void 0}function _r(e){return e.querySelector(`[data-slot="${Il}"]`)??void 0}function Di(e){let t=_r(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function Ir(e){if(e==null)return!1;let t=e.getAttribute("role");return t==="menu"||t==="group"}function Nr(e){return e.getAttribute("role")==="group"}function Ci(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);return Ir(r)?r:void 0}function Dr(e=document){let t=Ni(e);if(t===void 0)return;for(let r of Di(t)){let o=Ci(r,e);if(o!==void 0)return o}let n=_r(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"], [role="group"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]')&&Ir(r)&&!(r.getAttribute("role")==="group"&&r.querySelector('[role="menuitemradio"], section[role="group"]')===null))return r}function Cr(e=document){let t=Ni(e);if(t===void 0)return;let n=_r(t),r=Di(t),o=r[0];if(o!==void 0){for(let i of r)if(Ci(i,e)!==void 0)return i;for(let i of r)if(Ir(i.nextElementSibling))return i;return n===void 0?r.at(-1):o}}function Pi(){return Dr()}function Fi(){return Cr()}var qi=()=>{(0,Wi.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ki(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:i,directory:s}=e,a,d,l,p,g,c,u,f=()=>{u?.removeAttribute("data-bre-provider"),u=void 0},m=()=>{let y=n();u!==void 0&&u!==y&&f();let I=g?.store.getSnapshot(),w=I?.current;if(y===void 0||w===null||w===void 0){y===u&&f();return}let M=I?.groups.find(W=>W.id===w.provider),N=M===void 0?w.provider:ct(M);if(N.trim()===""){y===u&&f();return}y.dataset.breProvider=N,u=y},h=()=>{let y=s();y!==g&&(c?.(),c=void 0,g=y,y!==void 0&&(c=y.store.subscribe(m))),m()},v=()=>{Ne(d),d=void 0},x=new Map,b=()=>{for(let[y,I]of x)y.style.display=I;x.clear()},A=y=>y.getAttribute("aria-hidden")!=="true"||y.childElementCount>0?!1:(y.textContent??"").trim()==="",R=(y,I)=>{for(let N of Array.from(x.keys()))(!N.isConnected||N.parentElement!==y)&&x.delete(N);let w=[];for(let N of Array.from(y.children))N!==I&&(A(N)||w.push(N));let M=document.activeElement;M!==null&&M!==I&&!I.contains(M)&&w.some(N=>N.contains(M))&&(y.tabIndex=-1,y.focus({preventScroll:!0}));for(let N of w)x.has(N)||x.set(N,N.style.display),N.style.display!=="none"&&(N.style.display="none")},H=y=>{let I=y.querySelector('section[role="group"]'),w=I?.parentElement,M=w!=null&&w.parentElement===y?w:I;if(d===void 0){let N=document.createElement("div");N.dataset.plugin=re,N.dataset.breSearch="1",y.insertBefore(N,M),d=Xe(N,(0,_t.createElement)(Ie,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,_t.createElement)(Oi,{menu:y,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==y){y.insertBefore(d.wrapper,M);return}M!==null&&d.wrapper.nextSibling!==M&&y.insertBefore(d.wrapper,M)},O=y=>{if(!i()){Ne(a),a=void 0,y.classList.remove("bre-model-menu-host"),b();for(let W of Array.from(y.children))W.getAttribute("role")==="menuitem"&&(W.style.display="");return}let I=s();if(I===void 0)return;if(a===void 0){let W=document.createElement("div");W.dataset.plugin=re,W.dataset.breSlider="1",y.insertBefore(W,y.firstChild),a=Xe(W,(0,_t.createElement)(Ie,{fallbackText:r("renderFailed"),children:o(()=>(0,_t.createElement)(Si,{directory:I,configuredInputs:e.configuredInputs,t:r,onLayoutChange:qi}))}),{sync:!0})}else(a.wrapper.parentElement!==y||y.firstChild!==a.wrapper)&&y.insertBefore(a.wrapper,y.firstChild);y.classList.add("bre-model-menu-host");let w=Array.from(y.children).filter(W=>W.getAttribute("role")==="menuitem"),M=a.wrapper;if(Nr(y)){M.style.display="",R(y,M);return}if(b(),Array.from(y.querySelectorAll('[role="menuitemradio"]')).some(W=>!M.contains(W)))a.wrapper.contains(document.activeElement)&&(y.tabIndex=-1,y.focus({preventScroll:!0})),a.wrapper.style.display="none";else{a.wrapper.style.display="";for(let W of w)W.style.display="none"}};return{reconcile:()=>{h();let y=t();if(y===void 0){Ne(a),a=void 0,v(),l=void 0,p=void 0,b();return}let I=Nr(y),w=I&&i(),M=!I&&Hi(y);M?H(y):v(),O(y),(M!==l||w!==p)&&(l=M,p=w,(M||w||i())&&qi())},dispose:()=>{c?.(),c=void 0,g=void 0,f(),Ne(a),a=void 0,v(),b(),l=void 0,p=void 0}}}function Bi(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let a=r;return n??(n=te(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let l=new Map;for(let[p,g]of Object.entries(ce(d.namespace))){let c=Array.isArray(g.models)?g.models:[];for(let u of c){if(typeof u!="object"||u===null||Array.isArray(u))continue;let f=u.id,m=u[at];typeof f=="string"&&typeof m=="string"&&m.length>0&&l.set(`${p}/${f}`,m)}}a===r?t=l:n=void 0}).catch(()=>{a===r&&(n=void 0)})),n};return{of:async(a,d)=>(await o(),t?.get(`${a}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function Nl(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Ui(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,i=n.modalities!==!1;if(!C(e))return;let s={};for(let a of Object.keys(e)){if(!t(a))continue;let d=e[a],l=C(d)&&Array.isArray(d.models)?d.models:void 0;if(l===void 0||l.length===0||!l.every(C))continue;let p=l,g=[],c=!1;for(let u of p){let f=u.reasoningEfforts!==void 0||u[ge]===!0,m=Nl(u)||u[_e]===!0;if((f||!o)&&(m||!i)){let H=Dl(u,e,a);H!==void 0?(c=!0,g.push(H)):g.push(u);continue}let h=typeof u.id=="string"?u.id:"";if(h.length===0){g.push(u);continue}let v=Ve(e,a),x=typeof u.name=="string"?u.name:void 0,b=ke(h,{...v,displayName:x??v.displayName});if(b.efforts===void 0){g.push(u);continue}let A={...u},R=!1;if(!f&&o&&(R=!0,A.reasoningEfforts=b.efforts,A[st]=r,b.compat!==void 0)){let H=C(u.compat)?u.compat:{};A.compat={...H,...b.compat}}if(!m&&i&&b.input!==void 0&&(R=!0,A.input=[...b.input]),!R){g.push(u);continue}c=!0,g.push(A)}c&&(s[a]={models:g})}return Object.keys(s).length===0?void 0:{providers:s}}function Dl(e,t,n){if(!C(e.reasoningEfforts)||e[ge]===!0)return;let r=e.compat,o=C(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&vr(Ve(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function Gi(e){let t,n=0,r=()=>{if(t!==void 0)return t;let i=(async()=>{try{let s=await fetch(Co,{method:"GET"});if(!s.ok)return;let a=await s.json();return a?.ok!==!0?void 0:{autofill:a.data?.autofill!==!1,modalityAutofill:a.data?.modalityAutofill!==!1}}catch{return}})().then(s=>(s===void 0&&t===i&&(t=void 0),s??{autofill:!0,modalityAutofill:!0}));return t=i,i},o=async()=>{let i=n;try{let s=await r();if(i!==n||!s.autofill)return;let a=await te(e.api,{fresh:!0}),d=a.namespace;if(i!==n||d===void 0||a.writable!==!0)return;let l=Mr(d);if(l===void 0)return;let p=Ui(l,()=>!0,{modalities:s.modalityAutofill},d.revision);if(p===void 0)return;let g=p.providers,c=Object.entries(g).map(([f,m])=>({op:"set",path:["providers",f,"models"],value:m.models})),u=await e.api.settings.mutate(fe,c,d.revision);u.ok||console.error(`[bre] idle autofill refused: ${u.error.message}`)}catch(s){console.error(`[bre] idle autofill failed: ${s instanceof Error?s.message:String(s)}`)}};return{run:()=>{o()},invalidate:()=>{n+=1,t=void 0}}}var So=require("react"),kd=require("react-dom/client");var j=require("react");var Je=pi;function Qe(e){let t={};for(let n of Je){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function pt(e){let t=!1,n=!1,r={};for(let o of Je){let i=e[o];if(!i.on)continue;if(o==="off"){t=!0;let a=i.wire.trim();r.off=a.length===0?null:a;continue}n=!0;let s=i.wire.trim();r[o]=s.length===0?o:s}return n?r:t?!1:void 0}function It(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=Je.filter(o=>e[o]!==void 0),r=Je.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function ji(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var Pr="bre:auto-effort",zi=Promise.resolve();function $i(e){zi=zi.then(e,e).then(()=>{},()=>{})}function Vi(e,t=document){t.dispatchEvent(new CustomEvent(Pr,{detail:{route:e}}))}function Yi(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(Pr,n),()=>{t.removeEventListener(Pr,n)}}var _=require("react/jsx-runtime"),Xi=new Intl.NumberFormat("en-US");function Ze(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function xn(e){return e.declared?e.image?["text","image"]:["text"]:null}function vn(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function Fr(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function En(e){let t=e.appliedCompat;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&t?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(t={...t??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...t===void 0?{}:{compat:t},...e.input===void 0?{}:{input:e.input},...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function kn({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:i,effortsUnset:s=!1,input:a,compat:d,defaultEffort:l,index:p,staged:g=!1,officialInputTypes:c=!1,api:u,readOnly:f,t:m}){let[h,v]=(0,j.useState)(()=>Qe(i)),[x,b]=(0,j.useState)(()=>Ze(a)),[A,R]=(0,j.useState)(()=>i!==!1),[H,O]=(0,j.useState)(()=>l??""),[L,F]=(0,j.useState)(!1),[y,I]=(0,j.useState)(void 0),[w,M]=(0,j.useState)(void 0),[N,W]=(0,j.useState)(""),[X,oe]=(0,j.useState)("low"),J=(0,j.useRef)(void 0),[Q,Z]=(0,j.useState)(void 0),[G,q]=(0,j.useState)(void 0),[B,U]=(0,j.useState)(void 0),S=(0,j.useRef)(!1),K=(0,j.useRef)(i),Y=(0,j.useRef)(a),le=(0,j.useRef)(l),ot=(0,j.useRef)(void 0),it=(0,j.useRef)(i);it.current=i;let Xt=(0,j.useRef)(s);Xt.current=s,(0,j.useEffect)(()=>Yi(E=>{if(E!==e||it.current!==void 0||Xt.current)return;let $=ot.current;$!==void 0&&$i($)}),[e]),(0,j.useEffect)(()=>{It(K.current,i)||(K.current=i,S.current||(v(Qe(i)),R(i!==!1))),Y.current!==a&&(Y.current=a,S.current||b(Ze(a))),le.current!==l&&(le.current=l,S.current||O(l??""))},[i,a,l]);let k=Je.filter(E=>h[E].on),ne=H===(l??"")?void 0:H===""?null:H,ie=A?pt(h):!1,ue=!It(ie,i)||!vn(x,a)||ne!==void 0,Re=(0,j.useRef)(void 0),He=()=>{S.current=!0,M(void 0),W(""),oe("low"),Z(void 0)},qe=(E,$,ae,Ee=A)=>{let ye=Fr(Ee,pt(E),i),Pd=vn($,a)?void 0:xn($),Oo=En({efforts:ye,input:Pd,defaultEffort:ae===(l??"")?void 0:ae===""?null:ae,appliedCompat:J.current,routeApi:t,initialCompat:d}),_o=JSON.stringify(Oo);Re.current!==_o&&(Re.current=_o,u.commit(e,r,Oo))},Jt=(E,$)=>{He();let ae=!$&&H===E?"":H;ae!==H&&O(ae),v(Ee=>{let ye={...Ee,[E]:{...Ee[E],on:$}};return $&&E!=="off"&&ye[E].wire.trim().length===0&&(ye[E]={...ye[E],wire:E}),qe(ye,x,ae),ye}),I(void 0)},sr=E=>{He(),R(E);let $=E?H:"";$!==H&&O($),qe(h,x,$,E),I(void 0)},Od=(E,$)=>{He(),v(ae=>{let Ee={...ae,[E]:{...ae[E],wire:$}};return qe(Ee,x,H),Ee}),I(void 0)},_d=E=>{He();let $={declared:!0,image:E};b($),qe(h,$,H),I(void 0)},Id=()=>{He();let E={declared:!1,image:!1};b(E),qe(h,E,H),I(void 0)},Ao=E=>{He(),O(E),qe(h,x,E),I(void 0)},Nd=E=>{He();let $=E.efforts!==!1;R($);let ae=Qe(E.efforts);v(ae);let Ee=E.input===void 0?x:Ze(E.input);E.input!==void 0&&b(Ee);let ye=H===""&&E.defaultEffort!==void 0?E.defaultEffort:H;ye!==H&&O(ye),M(E.efforts),W(E.source),oe(E.confidence),J.current=E.compat,Z(E.inputSource),q(E.contextWindow),U(E.maxTokens),I({kind:"info",text:m("appliedHint",{source:E.source,confidence:m("confidence_"+E.confidence)})}),qe(ae,Ee,ye,$)},Ro=async()=>{if(!(f||L)){F(!0),I(void 0);try{let E=g?await u.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await u.suggest(e,r,o);if(!E.ok){I({kind:"error",text:E.error==="no-suggestion"?m("noSuggestion"):E.error});return}Nd(E.suggestion)}catch(E){I({kind:"error",text:m("writeError",{message:String(E)})})}finally{F(!1)}}};(0,j.useEffect)(()=>{ot.current=Ro});let Dd=()=>{S.current=!1,u.withdraw(e,r),v(Qe(i)),R(i!==!1),b(Ze(a)),O(l??""),M(void 0),W(""),oe("low"),J.current=void 0,Z(void 0),q(void 0),U(void 0),I(void 0),Re.current=void 0},Cd=J.current?.thinkingFormat??ke(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,Ho=ji(i,Cd),Oe=f||L;return(0,_.jsxs)("div",{className:"bre-effort-editor","data-plugin":re,children:[(0,_.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,_.jsx)("input",{type:"checkbox",checked:A,disabled:Oe,"aria-label":m("thinkingMode")+" "+String(p+1),onChange:E=>{sr(E.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("thinkingMode")}),A?null:(0,_.jsx)("span",{className:"bre-effort-note",children:m("thinkingModeOff")})]}),A?(0,_.jsxs)("div",{className:"bre-effort-card",children:[(0,_.jsxs)("div",{className:"bre-effort-head",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("reasoningEffort")}),(0,_.jsx)("button",{type:"button",className:"bre-link-button",disabled:Oe,onClick:()=>{Ro()},children:m("autoAdapt")})]}),(0,_.jsx)("div",{className:"bre-effort-grid",children:Je.map(E=>{let $=h[E];return(0,_.jsxs)("label",{className:"bre-effort-row",children:[(0,_.jsx)("input",{type:"checkbox",checked:$.on,disabled:Oe,"aria-label":m("level_"+E)+" "+String(p+1),onChange:ae=>{Jt(E,ae.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("level_"+E)}),$.on?(0,_.jsx)("input",{type:"text",className:"bre-effort-wire",value:$.wire,disabled:Oe,placeholder:m("wirePlaceholder"),"aria-label":m("level_"+E)+" "+m("wireValue"),onChange:ae=>{Od(E,ae.target.value)}}):(0,_.jsx)("span",{className:"bre-effort-empty"})]},E)})}),k.length>0?(0,_.jsxs)("div",{className:"bre-modality",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("defaultEffortLabel")}),(0,_.jsxs)("label",{className:"bre-modality-row",children:[(0,_.jsxs)("select",{className:"bre-select",disabled:Oe,"aria-label":m("defaultEffortLabel")+" "+String(p+1),value:H,onChange:E=>{Ao(E.target.value)},children:[(0,_.jsx)("option",{value:"",children:m("defaultEffortUnset")}),(H!==""&&!k.includes(H)?[...k,H]:k).map(E=>(0,_.jsx)("option",{value:E,children:m("level_"+E)},E))]}),H!==""?(0,_.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Oe,onClick:()=>{Ao("")},children:m("clearDefaultEffort")}):null]}),(0,_.jsx)("p",{className:"bre-modality-note",children:m("defaultEffortHint")})]}):null,c?null:(0,_.jsxs)("div",{className:"bre-modality",children:[(0,_.jsx)("span",{className:"bre-effort-title",children:m("inputModality")}),(0,_.jsxs)("label",{className:"bre-modality-row",children:[(0,_.jsx)("input",{type:"checkbox",checked:x.declared&&x.image,disabled:Oe,"aria-label":m("modalityImage")+" "+String(p+1),onChange:E=>{_d(E.target.checked)}}),(0,_.jsx)("span",{className:"bre-effort-level",children:m("modalityImage")}),x.declared?(0,_.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Oe,onClick:Id,children:m("clearDeclaration")}):null]}),x.declared?null:(0,_.jsx)("p",{className:"bre-modality-note",children:m("modalityInherit")})]}),g?(0,_.jsx)("p",{className:"bre-effort-note",children:m("stagedHint")}):null,i===!1?(0,_.jsx)("p",{className:"bre-effort-note",children:m("reasoningDisabled")}):null,Ho===void 0?null:(0,_.jsx)("p",{className:"bre-effort-note",children:m(Ho==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),pt(h)===void 0&&i!==void 0?(0,_.jsx)("p",{className:"bre-effort-note",children:m("bareHint")}):null,w!==void 0?(0,_.jsxs)("div",{className:"bre-suggestion",children:[(0,_.jsx)("p",{className:"bre-effort-note",children:m("appliedHint",{source:N,confidence:m("confidence_"+X)})}),Q===void 0?null:(0,_.jsx)("p",{className:"bre-effort-note",children:m(Q==="endpoint"?"inputHintEndpoint":Q==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),G===void 0&&B===void 0?null:(0,_.jsxs)("div",{className:"bre-reference",children:[(0,_.jsx)("span",{className:"bre-reference-title",children:m("referenceTitle")}),(0,_.jsxs)("span",{className:"bre-reference-values",children:[G===void 0?null:(0,_.jsxs)("span",{children:[m("contextWindowLabel")," ",(0,_.jsx)("b",{children:Xi.format(G)})]}),B===void 0?null:(0,_.jsxs)("span",{children:[m("maxTokensLabel")," ",(0,_.jsx)("b",{children:Xi.format(B)})]})]})]})]}):null,y===void 0?null:(0,_.jsx)("p",{className:"bre-effort-message bre-"+y.kind,role:y.kind==="error"?"alert":"status",children:y.text}),ue?(0,_.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:m("pendingSave")}):null,ue?(0,_.jsx)("p",{className:"bre-effort-note",children:m("pendingHint")}):null,(0,_.jsx)("div",{className:"bre-effort-actions",children:(0,_.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:Oe||!ue,onClick:Dd,children:m("reset")})})]}):null]})}var Be="data-bre-auto-effort",qr='[class*="modelCatalog"]',Cl='[class*="modelListHead"]',Pl='button[class*="linkButton"]',Fl="bre-auto-effort",ql="bre-auto-effort-note",Wl="data-bre-auto-effort-phase",Qi="bre-auto-effort-note-text",Zi="bre-auto-effort-note-detail",Kl=3e3;function Bl(e){return e.blocked==="busy"?null:e.failed!==void 0?{phase:"failed",count:0,missed:0,detail:e.failed}:e.blocked!==void 0?{phase:"blocked",count:0,missed:0,detail:""}:e.held>0?{phase:"done",count:e.held,missed:e.unsuggested,detail:""}:e.unsuggested>0?{phase:"unsuggested",count:0,missed:e.unsuggested,detail:""}:{phase:"empty",count:0,missed:0,detail:""}}function Wr(e){return Array.from(e.querySelectorAll(qr)).filter(t=>(t.parentElement?.closest(qr)??null)===null)}function Tn(e,t,n){let r=new Map;for(let a of t)a.route.length!==0&&a.catalogue.isConnected&&r.set(a.catalogue,a.route);let o=n.t("autoAdaptAll");for(let[a,d]of r){let l=a.querySelector(Cl)??a,p=l.querySelector(`[${Be}]`)??Gl();ts.set(p,n);let g=Ul(l);g!==null?g.nextElementSibling!==p&&g.after(p):l.lastElementChild!==p&&l.append(p),Vl(p,d,o)}let i=new Set,s=new Set(r.values());for(let a of Array.from(e.querySelectorAll(`[${Be}]`))){let d=a.closest(qr),l=a.getAttribute(Be)??"";if(d===null||!r.has(d)||i.has(d)){a.remove(),l.length>0&&!s.has(l)&&Kr(l);continue}i.add(d)}}function Kr(e){let t=et.get(e);t!==void 0&&(t.timer!==null&&clearTimeout(t.timer),t.note.remove(),et.delete(e))}function es(){for(let e of Array.from(document.querySelectorAll(`[${Be}]`)))e.remove();for(let e of et.values())e.timer!==null&&clearTimeout(e.timer),e.note.remove();et.clear()}function Ul(e){let t=Array.from(e.querySelectorAll(Pl));return t.length===0?null:t[t.length-1]}function Gl(){let e=document.createElement("button");return e.className=Fl,e.setAttribute("type","button"),e.setAttribute(Be,""),e.addEventListener("click",()=>{let t=e.getAttribute(Be)??"";if(t.length===0)return;let n=ts.get(e);n!==void 0&&(Vi(t),jl(t,n))}),e}async function jl(e,t){if(t.onRequest===void 0)return;Ji(e,{phase:"working",count:0,missed:0,detail:""},t,0);let n;try{n=await t.onRequest(e)}catch(o){n={held:0,unsuggested:0,failed:String(o)}}if(n===void 0){Kr(e);return}let r=Bl(n);r!==null&&Ji(e,r,t,Kl)}function Ji(e,t,n,r){let o=et.get(e);o!==void 0&&!o.note.isConnected&&(o.timer!==null&&clearTimeout(o.timer),et.delete(e),o=void 0),o!==void 0&&o.timer!==null&&clearTimeout(o.timer);let i=o?.note??zl();i.setAttribute(Wl,t.phase);let s=i.querySelector(`.${Qi}`),a=i.querySelector(`.${Zi}`),d=$l(t,n);s.textContent!==d.text&&(s.textContent=d.text),a.textContent!==d.detail&&(a.textContent=d.detail),a.hidden=d.detail.length===0,o===void 0&&document.body.append(i);let l=r>0?setTimeout(()=>{Kr(e)},r):null;i.style.setProperty("--bre-note-hold",`${r}ms`),et.set(e,{note:i,timer:l})}function zl(){let e=document.createElement("div");return e.className=ql,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<span class="${Qi}"></span><span class="${Zi}"></span>`,e}var ts=new WeakMap,et=new Map;function $l(e,t){switch(e.phase){case"working":return{text:t.t("autoAdaptWorking"),detail:""};case"done":return{text:t.t("autoAdaptDone",{count:e.count}),detail:e.missed>0?`${t.t("autoAdaptDoneHint",{count:e.count})} ${t.t("autoAdaptUnsuggestedHint")}`:t.t("autoAdaptDoneHint",{count:e.count})};case"empty":return{text:t.t("autoAdaptEmpty"),detail:t.t("autoAdaptEmptyHint")};case"unsuggested":return{text:t.t("autoAdaptUnsuggested"),detail:t.t("autoAdaptUnsuggestedHint")};case"blocked":return{text:t.t("autoAdaptBlocked"),detail:t.t("autoAdaptBlockedHint")};case"failed":return{text:t.t("autoAdaptFailed",{message:e.detail}),detail:e.detail}}}function Vl(e,t,n){e.getAttribute(Be)!==t&&e.setAttribute(Be,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==null&&e.removeAttribute("title")}var Nt="data-bre-drag-handle",Br="data-bre-row-head",Ur="data-bre-drop-side",Mn="bre-row-dragging",Ln="bre-row-drop-target",as="bre-drag-ghost",ds="bre-drop-line",ns="http://www.w3.org/2000/svg",rs=8,os=28,is=12,Yl="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",Xl='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function Sn(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,sighted:new WeakMap,drag:void 0}}function de(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function Jl(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function tt(e){return de(e).map((t,n)=>({row:t,key:Jl(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function ls(e,t){let n=e.filter(s=>t.includes(s)),r=n.map(s=>e.indexOf(s)),o=t.filter(s=>n.includes(s)),i=new Map;e.forEach((s,a)=>i.set(s,a)),r.forEach((s,a)=>{let d=o[a];d!==void 0&&i.set(d,s)});for(let[s,a]of i){let d=String(a);s.style.order!==d&&(s.style.order=d)}}function An(e,t){ls(tt(e),t)}function Gr(e,t){let n=de(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,i)=>{let s=r[i]-o.offsetTop;s!==0&&(o.style.transition="none",o.style.transform=`translateY(${s}px)`,o.offsetHeight,o.style.transition=Yl,o.style.transform="")})}function Dt(e,t){return tt(e).map(n=>t(n)).filter(n=>n!==void 0)}function Ql(e,t,n){let r=Dt(e,t);if(n===void 0||!Zl(e,n))return r;let o=new Map;return n.ids.forEach((i,s)=>{o.has(i)||o.set(i,s)}),r.map((i,s)=>({id:i,key:o.get(i)??n.ids.length+s})).sort((i,s)=>i.key-s.key).map(i=>i.id)}function Zl(e,t){return t.rows.some(n=>!e.contains(n))}function eu(e,t){let n=[];for(let o of tt(e)){let i=t(o);i!==void 0&&n.push(i)}let r=[];for(let o of de(e))t(o)!==void 0&&r.push(o);return{ids:n,rows:r}}function us(e,t,n){let r=new Map;for(let[a,d]of t.entries())r.has(d)||r.set(d,a);let o=de(e),s=[...o.filter(a=>n(a)!==void 0)].sort((a,d)=>{let l=r.get(n(a))??Number.MAX_SAFE_INTEGER,p=r.get(n(d))??Number.MAX_SAFE_INTEGER;return l-p});ls(o,s)}function Rn(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function fs(e,t,n,r){let i=e.filter(s=>s!==t).indexOf(n);return i<0?Math.max(0,e.indexOf(t)):r?i+1:i}function cs(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let i=o.getBoundingClientRect(),s=t<i.top?i.top-t:t>i.bottom?t-i.bottom:0;s<r&&(r=s,n=o)}return n}function tu(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function ps(e,t){let n=e.getBoundingClientRect();return t?n.bottom+rs/2-1:n.top-rs/2-1}function ms(){let e=document.createElementNS(ns,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(ns,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function gs(e,t){let n=document.createElement("div");n.className=as,n.setAttribute("aria-hidden","true"),n.appendChild(ms());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function nu(e){return!(e instanceof Element)||e.closest(`[${Nt}]`)!==null?!1:e.closest(Xl)!==null}function hs(e){return e.parentElement??void 0}function bs(e){for(let t of de(e))t.classList.remove(Ln),t.removeAttribute(Ur)}function Hn(e){let t=e.parentElement;for(;t!==null;){if(ys(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function jr(e){let t=[],n=e.parentElement;for(;n!==null;)ys(n)&&t.push(n),n=n.parentElement;let r=document.scrollingElement;return r instanceof HTMLElement&&r.scrollHeight>r.clientHeight&&!t.includes(r)&&t.push(r),t}function ys(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function ws(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+os?-is:t>n.bottom-os?is:0}function vs(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function ru(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=ds,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function ou(e,t,n){let r=ru(e),o=t.getBoundingClientRect();r.style.top=`${ps(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(Ur,n?"after":"before")}function iu(e){e.line!==void 0&&(e.line.style.display="none")}function su(e){let t=e.drag;e.drag=void 0,t!==void 0&&(vs(e,t,0),iu(e),t.row.classList.remove(Mn),bs(t.list),t.dropped||Gr(t.list,()=>{An(t.list,t.before)}))}function au(e,t,n,r){if(nu(t.target)){t.preventDefault();return}let o=hs(e),i=n.idOf(e);if(o===void 0||i===void 0){t.preventDefault();return}let s={row:e,list:o,before:tt(o),scroller:Hn(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=s,e.classList.add(Mn);let a=gs(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(a.style.left=`${t.clientX}px`,a.style.top=`${t.clientY}px`),document.body.appendChild(a);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",i),d.setDragImage(a,Math.round(a.offsetWidth/2),Math.round(a.offsetHeight/2))}catch{}window.setTimeout(()=>{a.remove()},0)}function du(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,i=o instanceof Element?r.adapter.rowOf(o,e):void 0,s=tt(e),a=i!==void 0&&s.includes(i)?i:cs(s,t.clientY);if(a===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let l=tu(a,t.clientY),p=fs(s,r.row,a,l);p!==s.indexOf(r.row)&&Gr(e,()=>{An(e,pr(s,r.row,p))}),bs(e),a.classList.add(Ln),a.setAttribute(Ur,l?"after":"before"),ou(n,a,l),vs(n,r,r.scroller===void 0?0:ws(r.scroller,t.clientY))}function lu(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{du(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function uu(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(Br,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{au(t,o,n,r)}),e.addEventListener("dragend",()=>{su(r)}))}function fu(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let i=hs(t);if(i===void 0)return;let s=tt(i),a=s.indexOf(t);if(a<0)return;let d=a+(o.key==="ArrowUp"?-1:1);d<0||d>=s.length||(o.preventDefault(),Gr(i,()=>{An(i,pr(s,t,d))}),n.commit(i),e.focus())})}function ss(e,t,n,r){let o=r.gripLabel(t,n),i=r.gripHint();e.getAttribute(Nt)!==n&&e.setAttribute(Nt,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function cu(e,t,n,r,o){let i=t.querySelector(`[${Nt}]`);if(i!==null){ss(i,e,n,r);return}r.decorate?.(e,t);let s=document.createElement("span");s.className="bre-drag-grip",s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("draggable","true"),s.appendChild(ms()),ss(s,e,n,r),fu(s,e,r,o),uu(r.seatDrags?t:s,e,r,o),t.insertBefore(s,t.firstChild)}function On(e,t,n,r){if(!e.isConnected)return;lu(t,r);for(let i of de(t)){let s=n.idOf(i);if(s===void 0)continue;let a=n.seatOf(i);a!==void 0&&cu(i,a,s,n,r)}if(r.drag!==void 0)return;let o=Ql(t,n.idOf,r.sighted.get(t));us(t,n.order(o),n.idOf),r.sighted.set(t,eu(t,n.idOf))}function _n(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${Nt}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${Br}]`)))t.removeAttribute(Br),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${Mn}, .${Ln}`)))t.classList.remove(Mn,Ln);for(let t of Array.from(document.querySelectorAll(`.${ds}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${as}`)))t.remove();e.line=void 0}function mt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var zr="__breLedgerDocument";function Ls(){let e=globalThis;return e[zr]??(e[zr]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var Nn="bre:held-writes:v1";function Qr(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function Me(e){let t=Qr();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(Nn);return}let n={document:Ls(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(Nn,JSON.stringify(n))}catch{}}function xs(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,i]=r;if(typeof o!="string"||!Array.isArray(i))return;let s=[];for(let a of i){if(!Array.isArray(a)||a.length!==2)return;let[d,l]=a;if(typeof d!="string"||!C(l)||t!==void 0&&!t(l))return;s.push([d,l])}n.push([o,s])}return n}function pu(e){let t=Qr();if(t!==void 0)try{let n=t.getItem(Nn);if(n===null)return;let r=JSON.parse(n);if(r.document!==Ls())return;let o=xs(r.pending),i=xs(r.queued,ku);if(o===void 0||i===void 0)return;let s=Array.isArray(r.committed)?r.committed.filter(a=>typeof a=="string"):[];for(let[a,d]of o)e.pending.set(a,new Map(d));for(let[a,d]of i)s.includes(a)&&(e.queued.set(a,new Map(d)),e.committing.add(a))}catch{}}function Ss(e,t){(async()=>{try{await Zr(t,e),await eo(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function As(e,t){(async()=>{try{await Zr(t,e,!0),await eo(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{Qr()?.removeItem(Nn)}catch{}}})()}function Rs(){let e={disposed:!1,mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet,disclosureWired:new WeakSet,editWired:new WeakSet};return pu(e),e}async function mu(e,t){if(!t.flushing){t.flushing=!0;try{let n=await Zr(e,t),r=await eo(e,t);n||r?Es(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Es(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function Es(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function gu(e){return e.queued.size>0||e.pending.size>0}function Pt(e,t,n,r,o,i,s){try{let a=e.pending.get(t);if(r===void 0){if(a===void 0)return;a.delete(n),a.size===0&&e.pending.delete(t);return}e.pending.set(t,(a??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...i===void 0?{}:{input:i},...s===void 0?{}:{defaultEffort:s}}))}finally{Me(e)}}function Hs(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),Me(e)}function hu(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),Me(e))}function bu(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),Me(e))}function yu(e,t,n){hu(e,t,n),bu(e,t,n)}function wu(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),Me(e)}function vu(e,t,n){if(t===void 0)return null;let i=t[ge]!==!0&&t.reasoningEfforts!==void 0&&typeof t[st]=="number"||t[ge]!==!0&&n?.efforts!==void 0&&xu(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[ge]===!0||e.efforts==="keep",a=t[_e]!==!0&&n?.input!==void 0&&Eu(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[_e]===!0,d=i?"keep":e.efforts,l=a?void 0:e.input,p=e.defaultEffort;return d==="keep"&&l===void 0&&p===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...l===void 0?{}:{input:l},...p===void 0?{}:{defaultEffort:p}}}function xu(e,t){if(e===t)return!0;if(!C(e)||!C(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function Eu(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function ku(e){if(!C(e))return!1;let t=e.efforts;return t===!1||t==="keep"||C(t)}async function Tu(e,t,n,r,o=!1){let i=await e.describeNamespace(),s=ce(i.namespace),a=[];for(let[g,c]of[...r]){let u=fn(s,n).find(x=>x.id===g);if(u===void 0||t.pending.get(n)?.get(g)!==c)continue;let f=Ve(s,n),m=typeof u.name=="string"?u.name:void 0,h=ke(g,m===void 0?f:{...f,displayName:m}),v=vu(c,u,{...h.efforts===void 0?{}:{efforts:h.efforts},...h.input===void 0?{}:{input:h.input}});if(v===null){Pt(t,n,g,void 0);continue}a.push({modelId:g,efforts:v.efforts,...v.compat===void 0?{}:{compat:v.compat},...v.input===void 0?{}:{input:v.input},...v.defaultEffort===void 0?{}:{defaultEffort:v.defaultEffort}})}if(a.length===0)return!1;let d=!1,l=await Ht(e.api,n,a,()=>d?e.describeNamespace():(d=!0,Promise.resolve(i)),o?void 0:Us),p=!1;return a.forEach((g,c)=>{let u=l[c];if(u?.aborted!==!0){if(u?.ok===!0||u?.modelNotFound===!0){Pt(t,n,g.modelId,void 0);return}p=!0,console.error(`[bre] staged flush write failed for "${n}"/"${g.modelId}": ${u?.error??"unknown"}`)}}),p}async function Zr(e,t,n=!1){for(let s of[...t.committing])t.queued.has(s)||t.committing.delete(s);if(![...t.queued.keys()].some(s=>t.committing.has(s)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return Me(t),!1;let i=!1;for(let[s,a]of[...t.queued]){if(!t.committing.has(s)&&!t.signalsUnavailable)continue;let l=[...a].map(([c,u])=>({modelId:c,efforts:u.efforts,...u.compat===void 0?{}:{compat:u.compat},...u.input===void 0?{}:{input:u.input},...u.defaultEffort===void 0?{}:{defaultEffort:u.defaultEffort}})),p=await Ht(e.api,s,l,void 0,n?void 0:Us),g=!1;l.forEach((c,u)=>{let f=p[u];if(f?.aborted===!0){g=!0;return}if(f?.ok===!0||f?.modelNotFound===!0){a.delete(c.modelId);return}console.error(`[bre] held write failed for "${s}"/"${c.modelId}": ${f?.error??"unknown"}`)}),a.size===0?(t.queued.delete(s),t.committing.delete(s)):g||(i=!0)}return Me(t),i}async function eo(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ce(r.namespace),i=!1;for(let[s,a]of[...t.pending]){if(a.size===0){t.pending.delete(s);continue}mt(o,s)&&await Tu(e,t,s,a,n)&&(i=!0)}return Me(t),i}function pe(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function Ft(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Mu(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=Ft(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(i=>i.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function Lu(e,t){return Array.from(e.querySelectorAll("button[aria-label]")).find(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function Su(){return new Promise(e=>{if(typeof window.requestAnimationFrame!="function"){e();return}let t,n=()=>{window.clearTimeout(r),t!==void 0&&window.cancelAnimationFrame(t),e()},r=window.setTimeout(n,100);t=window.requestAnimationFrame(n)})}function In(e){return e.querySelector('[class*="modelInputTypes"]')!==null}var Au="modelReasoning",Yr="data-bre-reasoning-hidden";function Os(e){return e.querySelector(`[class*="${Au}"]`)??void 0}function Ru(e){let t=Os(e);t!==void 0&&t.style.display!=="none"&&(t.setAttribute(Yr,"1"),t.style.display="none")}function $r(e){let t=Os(e);t!==void 0&&t.getAttribute(Yr)==="1"&&(t.removeAttribute(Yr),t.style.display==="none"&&(t.style.display=""))}function _s(e,t){let n=e.querySelector('[class*="modelInputTypes"]');if(n===null)return;let r=Array.from(n.querySelectorAll('input[type="checkbox"]')),o=r.find(i=>{let s=i.closest("label")?.textContent?.trim();return s!==void 0&&t.includes(s)});return o!==void 0?o:r.length===2?r[1]:void 0}function Dn(e,t,n){let r=_s(e,n);return r===void 0||r.disabled?!1:(r.checked!==t&&r.click(),!0)}function Xr(e,t,n){return t==null||e===void 0?t:Dn(e,t.includes("image"),n)?void 0:t}async function Hu(e,t,n){if(e===void 0)return!1;let r=t.inputImage;if(In(e))return Dn(e,!0,r);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return!1;let i=Lu(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),In(o)||await n();try{return In(o)&&Dn(o,!0,r)}finally{i.click()}}function Ou(e,t,n,r,o){n.disposed||!e.isConnected||no(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(s=>o.capacity.some(a=>(s.getAttribute("aria-label")??"").startsWith(a)))||Tn(e,_u(e,ce(r.namespace),o),{t:t.t,onRequest:s=>Is(n,t,s)})}function _u(e,t,n){let r=[];for(let o of Wr(e)){let i=Ft(o);if(i===void 0)continue;let s=De(i,t,n);s===void 0||s.staged||r.push({catalogue:o,route:s.route})}return r}function Iu(e,t,n){let r=[],o=new Set;for(let i of e){if(o.has(i.card))continue;o.add(i.card);let s=De(i.card,t,n);if(s===void 0)continue;let[a]=Wr(i.card);a!==void 0&&r.push({catalogue:a,route:s.route})}return r}function Nu(e,t,n,r){let o=[],i=new Set;for(let s of r.capacity){let a=Array.from(e.querySelectorAll("button[aria-label]")).filter(d=>(d.getAttribute("aria-label")??"").startsWith(s));for(let d of a){let l=Ft(d);if(l===void 0)continue;let p=d.closest('[class*="modelEntry"]')??l,g=pe(p,r.modelId);g.length===0||i.has(g)||De(l,n,r)?.route===t&&(i.add(g),o.push({id:g,name:pe(p,r.modelName),row:p}))}}return o}async function Is(e,t,n,r=[]){if(n.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};if(e.adapting.has(n))return{held:0,unsuggested:0,blocked:"busy"};e.adapting.add(n);let o=0,i=0;try{let s,a=()=>s??(s=t.describeNamespace()),d=await a(),l=ce(d.namespace);if(d.writable!==!0)return{held:0,unsuggested:0,blocked:"unwritable"};if(!mt(l,n)&&r.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};let g=fn(l,n),c=new Set;for(let O of g){let L=typeof O.id=="string"?O.id:"";L.length>0&&c.add(L)}let u=g.slice();for(let O of r)O.id.length===0||c.has(O.id)||u.push({id:O.id,name:O.name});if(u.length===0)return{held:0,unsuggested:0,blocked:"no-models"};let f=l[n]??{},m=typeof f.api=="string"?f.api:void 0,h=new Set,v=new Map;for(let[O,L]of e.mounted)L.props.route===n&&(v.set(L.props.modelId,O),L.props.efforts!==void 0&&h.add(L.props.modelId));let x=new Map;for(let O of r)O.row!==void 0&&x.set(O.id,O.row);let b=!1,A=(O,L)=>Xr(v.get(O),L,t.labels().inputImage),R=async(O,L)=>{if(L.image!==!0)return!1;let F=v.get(O)??x.get(O);return F===void 0?!1:Hu(F,t.labels(),Su)},H=yn(t.api,a,(O,L,F,y,I,w)=>{Pt(e,O,L,F,y,A(L,I),w)},(O,L,F)=>{Hs(e,O,L,{...F,input:A(L,F.input)})},void 0,()=>b);for(let O of u){let L=typeof O.id=="string"?O.id:"";if(L.length===0)continue;let F=pn(u,L),y=mn(u,L),I=F!==void 0||O[ge]===!0,w=Array.isArray(y)&&y.length>0||O[_e]===!0;if(h.has(L)&&!I)continue;if(I&&w){let q=v.get(L)??x.get(L);if(Array.isArray(y)&&y.includes("image")&&q!==void 0){let B=t.labels().inputImage,U=_s(q,B);U!==void 0&&!U.disabled&&!U.checked&&Dn(q,!0,B)}continue}let M=gn(u,L),N=bn(u,L)??"",W=await H.suggest(n,L,hn(u,L));if(!W.ok){i+=1;continue}let X=W.suggestion,oe=X.efforts!==!1,J=X.input===void 0?Ze(y):Ze(X.input);if(I){if(!J.image||e.queued.get(n)?.has(L)===!0)continue;if(await R(L,J)){o+=1;continue}b=!c.has(L),H.commit(n,L,En({efforts:"keep",input:xn(J)})),b&&t.onPendingChanged?.(),b=!1,o+=1;continue}let Q=X.defaultEffort??N,Z=Q===N?void 0:Q===""?null:Q;b=!c.has(L);let G=await R(L,J);H.commit(n,L,En({efforts:Fr(oe,pt(Qe(X.efforts)),F),input:G||vn(J,y)?void 0:xn(J),defaultEffort:Z,appliedCompat:X.compat,routeApi:m,initialCompat:M})),b&&t.onPendingChanged?.(),b=!1,o+=1}return{held:o,unsuggested:i}}catch(s){return console.warn("[bre] provider-wide adapt failed:",s),{held:o,unsuggested:i,failed:s instanceof Error?s.message:String(s)}}finally{e.adapting.delete(n)}}function Du(e){return e.querySelector(`[data-plugin="${re}"]`)!==null}function Cu(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&e.effortsUnset===t.effortsUnset&&It(e.efforts,t.efforts)&&Fu(e.input,t.input)&&Pu(e.compat,t.compat)}function Pu(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function Fu(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function qu(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function De(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&mt(t,r))return{route:r,staged:!1};if(qu(e,n.routeId)){let s=pe(e,n.routeId);return s.length>0&&!mt(t,s)?{route:s,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let i=Object.entries(t).find(([,s])=>s.displayName===o);if(i!==void 0)return{route:i[0],staged:!1};if(mt(t,o))return{route:o,staged:!1}}function Wu(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(g,c)=>(g.textContent??"").trim()===c,i=n.querySelector('[class*="primaryButton"]'),s=n.querySelector('[class*="secondaryButton"]');if(i!==null&&s!==null)return{submit:i,cancel:s};let a=[...r].reverse().find(g=>t.apply.some(c=>o(g,c))),d=[...r].reverse().find(g=>t.cancel.some(c=>o(g,c)));if(a!==void 0&&d!==void 0)return{submit:a,cancel:d};let l=r[r.length-1],p=r[r.length-2];if(!(l===void 0||p===void 0))return{submit:l,cancel:p}}function Cn(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}var Vr=new WeakMap,Jr=new Set;function Ns(){for(let e of Array.from(Jr))e.release()}var to=420,Ku=320,Bu=160,ks=2e3,Uu=150,Ds=new Set(["PageUp","PageDown","Home","End","ArrowUp","ArrowDown"," "]);function Fn(e,t){let n=jr(e),r=n[0];if(r===void 0||!e.isConnected)return;let o=performance.now(),i=Vr.get(r);if(i!==void 0){i.deadline=Math.min(Math.max(i.deadline,o+t),i.startedAt+ks);return}let s=e.getBoundingClientRect(),a=s.top,d=s.height,l=new Map,p=new Map;for(let x of n)l.set(x,x.scrollTop),p.set(x,x.style.overflowAnchor),x.style.overflowAnchor="none";let g=new Set(n),c={deadline:o+t,startedAt:o,frame:void 0,release:()=>{}},u=()=>{if(Jr.delete(c)){c.frame!==void 0&&(window.cancelAnimationFrame(c.frame),c.frame=void 0);for(let[x,b]of p)x.style.overflowAnchor=b;Vr.delete(r),document.removeEventListener("wheel",f,!0),document.removeEventListener("touchstart",f,!0),document.removeEventListener("pointerdown",f,!0),document.removeEventListener("keydown",m,!0)}};function f(){u()}function m(x){Ds.has(x.key)&&u()}c.release=u,Vr.set(r,c),Jr.add(c),document.addEventListener("wheel",f,{capture:!0,passive:!0}),document.addEventListener("touchstart",f,{capture:!0,passive:!0}),document.addEventListener("pointerdown",f,{capture:!0}),document.addEventListener("keydown",m,{capture:!0});let h=0,v=()=>{if(c.frame=void 0,h+=1,!e.isConnected||h>=Uu){u();return}let x=e.getBoundingClientRect(),b=Math.abs(x.height-d)>.5;if(!b&&[...g].some(H=>H.scrollTop!==l.get(H))){u();return}let A=x.top-a;A!==0&&Gu(n,g,l,A);let R=performance.now();if(b&&(d=x.height,c.deadline=Math.min(Math.max(c.deadline,R+Bu),c.startedAt+ks)),R>=c.deadline){u();return}c.frame=window.requestAnimationFrame(v)};c.frame=window.requestAnimationFrame(v)}function Gu(e,t,n,r){let o=r;for(let i of[...t,...e]){if(o===0)break;let s=i.scrollTop;if(s!==n.get(i))continue;i.scrollTop=s+o;let a=i.scrollTop;a!==s&&(n.set(i,a),t.add(i),o-=a-s)}}var Cs='[class*="modelList"]',ju="bre-list-slack",zu=3e3,qn,gt=new WeakMap,ht=new Set;function Ps(e){if(!(e instanceof Element))return;let t=e.closest(Cs);if(t===null)return;let n=jr(t).map(r=>({host:r,top:r.scrollTop}));n.length!==0&&(qn={targets:n,at:performance.now()})}function Ce(){qn=void 0}function Fs(e){Ps(e.target)}function qs(e){if(Ds.has(e.key)){Ce();return}Ps(e.target)}var Ct=0;function Ws(){Ct+=1,!(Ct>1)&&(document.addEventListener("click",Fs,!0),document.addEventListener("keydown",qs,!0),document.addEventListener("focusin",Ce,!0),document.addEventListener("pointerdown",Ce,!0),document.addEventListener("wheel",Ce,{capture:!0,passive:!0}),document.addEventListener("touchstart",Ce,{capture:!0,passive:!0}))}function Pn(e){let t=gt.get(e);t!==void 0&&(gt.delete(e),ht.delete(t),t.scrollTarget.removeEventListener("scroll",t.onScroll),t.spacer.remove())}function $u(e){return e===document.scrollingElement?document:e}function Vu(){if(ht.size!==0)for(let e of Array.from(ht)){let t=e.host;if(!e.spacer.isConnected){gt.delete(t),ht.delete(e),e.scrollTarget.removeEventListener("scroll",e.onScroll);continue}t.scrollTop<=t.scrollHeight-t.clientHeight-e.height&&Pn(t)}}function Ts(e,t){return e.scrollTop>e.scrollHeight-e.clientHeight-t}function Yu(e=performance.now()){let t=qn;if(!(t===void 0||e-t.at>zu))for(let n of t.targets){let r=n.host;if(!r.isConnected)continue;let o=gt.get(r),i=o===void 0?0:o.height,s=r.scrollHeight-r.clientHeight-i,a=n.top-s;if(a<=0){o!==void 0&&!Ts(r,o.height)&&Pn(r);continue}let d=o;if(d===void 0){let l=document.createElement("div");l.className=ju,l.dataset.plugin=re,l.setAttribute("aria-hidden","true"),l.style.height="0px",(r===document.scrollingElement?document.body??r:r).appendChild(l);let g=()=>{let c=gt.get(r);c!==void 0&&!Ts(r,c.height)&&Pn(r)};d={host:r,spacer:l,height:0,onScroll:g,scrollTarget:$u(r)},gt.set(r,d),ht.add(d),d.scrollTarget.addEventListener("scroll",g,{passive:!0})}d.height!==a&&(d.height=a,d.spacer.style.height=`${a}px`),r.scrollTop!==n.top&&(r.scrollTop=n.top)}}function Ks(){if(Ct=Math.max(0,Ct-1),!(Ct>0)){document.removeEventListener("click",Fs,!0),document.removeEventListener("keydown",qs,!0),document.removeEventListener("focusin",Ce,!0),document.removeEventListener("pointerdown",Ce,!0),document.removeEventListener("wheel",Ce,!0),document.removeEventListener("touchstart",Ce,!0),qn=void 0;for(let e of Array.from(ht))Pn(e.host)}}function Bs(e,t=to){Yu(),Vu();let n=new Set;for(let r of Array.from(e.querySelectorAll(Cs))){let o=r.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');o===null||n.has(o)||(n.add(o),Fn(o,t))}}function Xu(e,t){Cn(e,t,()=>{let n=e.closest('[class*="modelEntry"]')??e.closest('[class*="rowCard"]');n!==null&&Fn(e.closest('[class*="rowCard"]')??n,to)})}var Ms="{provider}";function Ju(e,t){let n=t.editProvider.map(o=>{let i=o.indexOf(Ms);return i<0?void 0:{prefix:o.slice(0,i),suffix:o.slice(i+Ms.length)}}).filter(o=>o!==void 0);if(n.length===0)return[];let r=[];for(let o of Array.from(e.querySelectorAll("button[aria-label]"))){let i=o.getAttribute("aria-label")??"";n.some(s=>i.length>s.prefix.length+s.suffix.length&&i.startsWith(s.prefix)&&i.endsWith(s.suffix))&&o.closest("[data-plugin]")===null&&r.push(o)}return r}function Qu(e,t){Cn(e,t,()=>{let n=e.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');n!==null&&Fn(n,to)})}function no(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function Us(){return no(Te())!==void 0}function Gs(e,t,n){if(n.disposed||!e.isConnected)return;let r=t.labels(),o=no(e)!==void 0;for(let a of Array.from(e.querySelectorAll('[class*="rowCard"], [class*="setupCard"]')))for(let d of Ju(a,r))Qu(d,n.editWired);let i=Array.from(e.querySelectorAll("button[aria-label]")).some(a=>r.capacity.some(d=>(a.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(Tn(e,[],{t:t.t}),n.mounted.size>0){for(let[d,l]of n.mounted)$r(d),l.editor.unmount();n.mounted.clear()}let a=n.editing;n.editing=!1,(a!==!1||gu(n)&&Date.now()>=n.nextFlushAt)&&mu(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!i){for(let[d,l]of n.mounted)$r(d),l.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let a=r;n.describePromise.then(d=>{Ou(e,t,n,d,a)}).catch(d=>{console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}for(let a of r.capacity)for(let d of Array.from(e.querySelectorAll("button[aria-label]")))(d.getAttribute("aria-label")??"").startsWith(a)&&Xu(d,n.disclosureWired);n.describePromise??(n.describePromise=t.describeNamespace());let s=a=>{if(n.disposed||!e.isConnected)return;let d=a.namespace,l=ce(d),p=[];for(let c of r.capacity){let u=Array.from(e.querySelectorAll("button[aria-label]")).filter(f=>(f.getAttribute("aria-label")??"").startsWith(c));for(let f of u){let m=Ft(f);if(m===void 0)continue;let h=f.closest('[class*="modelEntry"]')??m,v=pe(h,r.modelId);v.length!==0&&p.push({container:Mu(f),row:h,modelId:v,card:m})}}Tn(e,Iu(p,l,r),{t:t.t,onRequest:c=>Is(n,t,c,Nu(e,c,l,r))});for(let[c,u]of n.mounted)p.some(f=>f.container===c)||($r(c),u.editor.unmount(),n.mounted.delete(c));if(n.pending.size>0){let c=new Map;for(let f of p){let m=De(f.card,l,r);if(m===void 0)continue;let h=c.get(m.route);h===void 0&&c.set(m.route,h=new Set),h.add(f.modelId)}let u=new Map;for(let[f,m]of n.pending){if(!mt(l,f))continue;let h=c.get(f),v=[...m.keys()].filter(x=>!h?.has(x));v.length>0&&u.set(f,new Set(v))}for(let[f,m]of u){let h=n.missedScans.get(f);if(h!==void 0)for(let v of m)h.has(v)&&(Pt(n,f,v,void 0),h.delete(v))}n.missedScans=u}let g=new Set(p.map(c=>c.card));for(let c of g){let u=De(c,l,r);if(u===void 0)continue;let f=u.route,m=Wu(c,r);m===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Cn(m.submit,n.submitWired,()=>{let h=De(c,l,r)?.route??f;n.committing.add(h),Me(n)}),Cn(m.cancel,n.cancelWired,()=>{let h=De(c,l,r)?.route??f;wu(n,h)}))}p.forEach((c,u)=>{let f=c.container;if(f===void 0)return;let m=De(c.card,l,r);if(m===void 0)return;let{route:h,staged:v}=m,x=l[h]??{},b=fn(l,h),A=new Set(b.map(G=>G.id)),R=v||!A.has(c.modelId),H=R?n.pending.get(h)?.get(c.modelId)?.efforts:void 0,O=R?H==="keep"?void 0:H:pn(b,c.modelId),L=!R&&b.some(G=>G.id===c.modelId&&G[ge]===!0),F=R?n.pending.get(h)?.get(c.modelId)?.input:mn(b,c.modelId),y=R?n.pending.get(h)?.get(c.modelId)?.compat:gn(b,c.modelId),I=R?n.pending.get(h)?.get(c.modelId)?.defaultEffort??void 0:bn(b,c.modelId),w=R?pe(c.row,r.modelName):"",M=R?w.length>0?w:void 0:hn(b,c.modelId),N=v?pe(c.card,r.apiProtocol):"",W=v?pe(c.card,r.baseUrl):"",X=v&&N.length>0?N:typeof x.api=="string"?x.api:void 0,oe=v&&W.length>0?W:typeof x.baseURL=="string"?x.baseURL:void 0,J={route:h,routeDisplayName:v?h:typeof x.displayName=="string"?x.displayName:h,...X===void 0?{}:{routeApi:X},...oe===void 0?{}:{routeBaseURL:oe},modelId:c.modelId,...M===void 0?{}:{modelName:M},...O===void 0?{}:{efforts:O},...L?{effortsUnset:L}:{},...F===void 0?{}:{input:F},...y===void 0?{}:{compat:y},...I===void 0?{}:{defaultEffort:I},index:u,staged:R,officialInputTypes:In(f),api:yn(t.api,void 0,(G,q,B,U,S,K)=>{Pt(n,G,q,B,U,Xr(f,S,r.inputImage),K)},(G,q,B)=>{Hs(n,G,q,{...B,input:Xr(f,B.input,r.inputImage)})},G=>{yu(n,G,c.modelId)},()=>(De(c.card,l,r)?.staged??v)||!A.has(c.modelId)),readOnly:a.writable!==!0,t:t.t};Ru(f);let Q=n.mounted.get(f);if(Q!==void 0){Cu(Q.props,J)||(Q.props=J,Q.editor.render(J));return}if(Du(f))return;Fn(Ft(f)??c.card,Ku);let Z=t.mount(f,J);n.mounted.set(f,{editor:Z,props:J})})};n.describePromise.then(s,()=>{n.describePromise=void 0})}function z(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qt(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function ve(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function Wn(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var ro=require("react");var se=require("react");function js(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,40)}function Kn(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}function Zu(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function ef(e){if(!C(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled===!0,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{}}}function tf(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let i of t){let s=ef(i);s!==void 0&&n.push(s)}let r=e.enabledRef,o=e.route;return{ok:!0,route:typeof o=="string"?o:"",enabledRef:typeof r=="string"&&r.length>0?r:null,entries:n}}async function nf(e){let t;try{t=await e.json()}catch{t=void 0}if(!C(t))return{ok:!1};if(t.ok===!0){let r=tf(t);if(r!==void 0)return r}let n=Zu(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function bt(e,t){let n=`${Do}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await nf(r)}catch{return{ok:!1}}}var zs={list:e=>bt(e),add:(e,t,n)=>bt(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),enable:(e,t)=>bt(e,{op:"enable",ref:t}),rename:(e,t,n)=>bt(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>bt(e,{op:"remove",ref:t}),replace:(e,t,n)=>bt(e,{op:"value",ref:t,value:n}),async reveal(e,t){try{let n=await fetch(`${Zt}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!C(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var P=require("react/jsx-runtime"),rf="M3.9 8.35 6.6 11.05 12.1 5.5",of=["M8 3.9v8.2","M3.9 8h8.2"];function $s({paths:e}){return(0,P.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,P.jsx)("path",{d:t},t))})}function sf(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function af(e){return e.alias??e.masked??e.ref}function Vs(e){let{route:t,t:n}=e,r=e.client??zs,o=(0,se.useId)(),[i,s]=(0,se.useState)(void 0),[a,d]=(0,se.useState)(null),[l,p]=(0,se.useState)(void 0),[g,c]=(0,se.useState)(!1),[u,f]=(0,se.useState)(void 0),[m,h]=(0,se.useState)(""),[v,x]=(0,se.useState)(""),[b,A]=(0,se.useState)(void 0),R=(0,se.useCallback)((w,M)=>{if(!w.ok){p({kind:"error",text:w.error??n("keysUnreachable")});return}s(w.entries),d(w.enabledRef),p(M===void 0?void 0:{kind:"status",text:M})},[n]);(0,se.useEffect)(()=>{let w=!0;return(async()=>{let M=await r.list(t);w&&R(M,void 0)})(),()=>{w=!1}},[R,r,t]);let H=(0,se.useCallback)(async(w,M)=>{c(!0),A(void 0),f(void 0);try{R(await w(),M)}finally{c(!1)}},[R]),O=()=>{f(void 0),h(""),x("")},L=(w,M)=>{f({kind:w,ref:M.ref}),h(w==="alias"?M.alias??"":""),x(""),A(void 0)},F=()=>{if(g||u===void 0)return;let w=u.kind,M=u.ref;if(w!=="alias"&&!Kn(v))return;let N=js(m);c(!0),(async()=>{try{if(w==="add"){let X=await r.add(t,v,N);R(X,n("keysAdded")),X.ok&&O();return}if(M===void 0)return;let W=w==="alias"?await r.rename(t,M,N):await r.replace(t,M,v);R(W,n(w==="alias"?"keysRenamed":"keysReplaced")),W.ok&&O()}finally{c(!1)}})()},y=()=>{if(u===void 0)return null;let w=u.kind,M=w!=="alias",N=M&&v.length>0&&!Kn(v);return(0,P.jsxs)("div",{className:"bre-keys-form",children:[(0,P.jsxs)("div",{className:"bre-keys-form-fields",children:[w==="value"?null:(0,P.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:m,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:g,autoFocus:w==="alias",onChange:W=>h(W.target.value)}),M?(0,P.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:v,placeholder:n(w==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":N,disabled:g,autoFocus:!0,onChange:W=>x(W.target.value)}):null]}),N?(0,P.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,P.jsxs)("div",{className:"bre-keys-form-actions",children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:O,children:n("keysCancel")}),(0,P.jsx)("button",{type:"button",className:"bre-primary-button",disabled:g||M&&!Kn(v),onClick:F,children:n(w==="add"?"keysAddConfirm":"keysSave")})]})]})},I=()=>u?.kind==="add"?(0,P.jsx)("li",{className:"bre-keys-form-row",children:y()}):(0,P.jsx)("li",{className:"bre-keys-add-row",children:(0,P.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:g,onClick:()=>{f({kind:"add"}),h(""),x(""),A(void 0)},children:[(0,P.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,P.jsx)($s,{paths:of})}),n("keysAdd")]})});return i===void 0?l===void 0?(0,P.jsx)("div",{className:"bre-keys"}):(0,P.jsxs)("div",{className:"bre-keys",children:[(0,P.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),(0,P.jsx)("ul",{className:"bre-keys-list",children:I()})]}):(0,P.jsxs)("div",{className:"bre-keys",children:[(0,P.jsxs)("ul",{className:"bre-keys-list",children:[i.map(w=>{let M=af(w);return(0,P.jsxs)(se.Fragment,{children:[(0,P.jsxs)("li",{className:"bre-keys-row","data-state":w.configured===!1?"missing":"ready",children:[w.alias===void 0?null:(0,P.jsx)("span",{className:"bre-keys-alias",children:w.alias}),(0,P.jsx)("span",{className:w.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:sf(w,n)}),(0,P.jsx)("span",{className:"bre-keys-actions",children:b===w.ref?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:g,onClick:()=>{H(()=>r.remove(t,w.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>A(void 0),children:n("keysCancel")})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>{A(w.ref),f(void 0)},children:n("keysRemove")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>L("alias",w),children:n("keysAlias")}),(0,P.jsx)("button",{type:"button",className:"bre-link-button",disabled:g,onClick:()=>L("value",w),children:n("keysEdit")})]})}),(0,P.jsxs)("label",{className:"bre-keys-enable",title:n("keysEnable",{name:M}),children:[(0,P.jsx)("input",{type:"radio",name:o,className:"bre-keys-enabled",checked:w.enabled,disabled:g,"aria-label":n("keysEnable",{name:M}),onChange:()=>{H(()=>r.enable(t,w.ref),n("keysEnabledNote",{name:M}))}}),(0,P.jsx)("span",{className:"bre-keys-mark","aria-hidden":"true",children:w.enabled?(0,P.jsx)($s,{paths:[rf]}):null}),(0,P.jsx)("span",{className:"bre-keys-enable-text",children:n("keysEnabled")})]})]}),u!==void 0&&u.ref===w.ref?(0,P.jsx)("li",{className:"bre-keys-form-row",children:y()}):null]},w.ref)}),I()]}),l===void 0?null:(0,P.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text})]})}var Un="bre-key-managed",df="bre-keys-host",oo="data-bre-key-host",lf="data-bre-key-input",Bn="data-bre-region",Ue=new WeakMap;function uf(e){let t=e.querySelector(`input[${lf}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Ys(e){let t=Ue.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(oo)?n:void 0}function Xs(e,t){let n=t.route;if(n===void 0||n.length===0||uf(e)===void 0||e.parentElement===null)return;ve(e,Un,!0);let r=Ue.get(e),o=Ys(e);o===void 0&&(r!==void 0&&Js(e,r),o=e.ownerDocument.createElement("div"),o.className=df,e.after(o)),z(o,oo,n);let i=e.getAttribute(Bn);i===null?o.hasAttribute(Bn)&&o.removeAttribute(Bn):z(o,Bn,i);let s=()=>(0,ro.createElement)(Ie,{fallbackText:t.t("keysPanelFailed")},(0,ro.createElement)(Vs,{route:n,t:t.t,client:t.client})),a=Ue.get(e);if(a!==void 0&&a.route===n){(a.t!==t.t||a.client!==t.client)&&(a.t=t.t,a.client=t.client,a.mount.root.render(s()));return}a!==void 0&&(Ue.delete(e),a.mount.root.unmount()),Ue.set(e,{route:n,host:o,mount:Xe(o,s(),{sync:!0}),t:t.t,client:t.client})}function Js(e,t){Ue.delete(e),Ne(t.mount)}function Gn(e){ve(e,Un,!1);let t=Ue.get(e);t!==void 0&&Js(e,t),Ys(e)?.remove()}function Qs(){for(let e of Array.from(document.querySelectorAll(`[${oo}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Ue.has(t)?Gn(t):e.remove()}}var Zs="http://www.w3.org/2000/svg",ff="data-bre-icon";function cf(e){let t=document.createElementNS(Zs,"path");return t.setAttribute("d",e),t}function ea(e,t){let n=document.createElementNS(Zs,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute(ff,e),n.append(...t.map(cf)),n}var zn="bre-key-field",oa="bre-key-eye",jn="data-bre-key-input",ia="data-bre-eye-show",sa="data-bre-eye-hide",ta=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],ao=new WeakMap;function io(e){let t=e.querySelector(`input[${jn}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function aa(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(oa))return t}function da(e,t){let n=io(e);if(n===void 0){$n(e);return}ao.set(e,t),z(n,jn,""),ve(e,zn,!0);let r=aa(e)??mf(e);z(r,ia,t.t("keyRevealShow")),z(r,sa,t.t("keyRevealHide")),so(r,n)}function $n(e){let t=aa(e);t!==void 0&&t.remove(),ao.delete(e),ve(e,zn,!1);let n=e.querySelector(`input[${jn}]`);n instanceof HTMLInputElement&&(n.removeAttribute(jn),n.type="password")}async function pf(e){try{let t=await fetch(`${Zt}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function so(e,t){let n=t.type!=="password";z(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?sa:ia);r!==null&&(z(e,"aria-label",r),z(e,"title",r)),qt(e,t.disabled)}function na(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function mf(e){let t=document.createElement("button");t.type="button",t.className=oa,t.append(ra("eye"),ra("eye-off"));let n,r=async()=>{let o=io(e),i=ao.get(e);if(o===void 0||i===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&na(o,""),n=void 0,o.type="password",so(t,o);return}let s=i.route;if(s!==void 0&&n===void 0&&o.value.length===0){z(t,"aria-busy","true");let a;try{a=await(i.loadKey??pf)(s)}catch{a=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),a===void 0){let d=i.t("keyRevealFailed");z(t,"aria-label",d),z(t,"title",d);return}io(e)===o&&o.value.length===0&&(n=a,na(o,a))}o.type="text",so(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function ra(e){let t=e==="eye-off"?[...ta,"M2.5 13.5 13.5 2.5"]:ta;return ea(e,t)}var lo="bre-editor-tabs",gf="bre-editor-tab",Vn="data-bre-tab-id",Bt="bre-tabbed",je="data-bre-tab",la="data-bre-provider",xe="data-bre-region",Kt="data-bre-editor-body",vt="data-bre-footer",hf="row",bf="path",Ut="data-bre-details";var yf=".bre-headers",Ge="provider",yt="models",wt="advanced",wf=[Ge,yt,wt],vf="none",ua=wf,fa=lo,ca=gf,pa=Vn,Yn='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',xf='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',ma='[class*="rowCard"], [class*="addCard"], li',Ef='[class*="addPanel"]',kf=".bre-create-host";function ga(){return{warned:new WeakSet}}function Gt(e){return e===null?null:e.closest(ma)}function ha(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.matches(Ef)&&!t.hidden)return t;return e}function ba(e,t){let n=Hn(e),r=e.getBoundingClientRect().top,o=n?.scrollTop??0;n!==void 0&&(n.style.overflowAnchor="none"),z(e,je,t),va(e),n!==void 0&&requestAnimationFrame(()=>{if(n.style.overflowAnchor="",n.scrollTop!==o)return;let i=e.getBoundingClientRect().top-r;i!==0&&(n.scrollTop+=i)})}function uo(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(Yn))){let i=o.closest(ma);i!==null&&r.add(i)}for(let o of Array.from(e.querySelectorAll(`.${Bt}`)))r.has(o)||Xn(o);for(let o of r)try{Rf(o,t)}catch(i){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",i)),Xn(o)}}function ya(){for(let e of Array.from(document.querySelectorAll(`.${Bt}`))){e.classList.remove(Bt),e.removeAttribute(je),e.removeAttribute(Kt);for(let t of Array.from(e.querySelectorAll(`[${xe}]`)))t.removeAttribute(xe)}for(let e of Array.from(document.querySelectorAll(`[${je}]`)))e.removeAttribute(je);for(let e of Array.from(document.querySelectorAll(`[${xe}]`)))e.removeAttribute(xe);for(let e of Array.from(document.querySelectorAll(`[${Kt}]`)))e.removeAttribute(Kt);for(let e of Array.from(document.querySelectorAll(`[${vt}]`)))e.removeAttribute(vt);for(let e of Array.from(document.querySelectorAll(`details[${Ut}]`)))e.removeAttribute("open"),e.removeAttribute(Ut);for(let e of Array.from(document.querySelectorAll(`.${zn}`)))$n(e);for(let e of Array.from(document.querySelectorAll(`.${Un}`)))Gn(e);Qs()}function Tf(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(Yn)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(Yn);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Mf(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};wa(e,t,0);let{actions:n,fields:r,header:o,models:i}=t;if(!(n===void 0||r.length===0)&&r.some(s=>s.querySelector("input, select, textarea")!==null))return{header:o,models:i,actions:n,fields:r}}var Lf=4;function wa(e,t,n){if(!(n>Lf)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(xf)){t.models??(t.models=r);continue}if(r.querySelector(Yn)!==null){wa(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}if(r.querySelector("input, select, textarea")!==null){t.fields.push(r);continue}(r.matches("p, small, em, i")||r.matches('[class*="Hint"], [class*="error"]'))&&t.fields.push(r)}}}function Sf(e,t){if(!t.contains(e))return;z(e,vt,hf);let n=e.parentElement;for(;n!==null&&(z(n,vt,bf),n!==t);)n=n.parentElement}function Af(e){let n=e.querySelector(`[${la}]`)?.getAttribute(la);return n==null||n===""?void 0:n}function Rf(e,t){let n=ha(e),r=Tf(n);if(r===void 0){Xn(e);return}let o=Mf(r);if(o===void 0){Xn(e);return}let i=n.querySelector(yf),s=Af(n);for(let l of o.fields)z(l,xe,Ge),da(l,{t:t.t,route:s}),Xs(l,{t:t.t,route:s});o.header!==void 0&&z(o.header,xe,vf),o.models!==void 0&&z(o.models,xe,yt),z(r,Kt,""),n.querySelector(kf)!==null&&Sf(o.actions,r),i!==null&&z(i,xe,wt),Of(r);let a=new Set([Ge]);o.models!==void 0&&a.add(yt),i!==null&&a.add(wt);let d=e.getAttribute(je)??Ge;z(e,je,a.has(d)?d:Ge),ve(e,Bt,!0),Hf(e,n,t,a)}function Hf(e,t,n,r){let o=t.querySelector(`.${lo}`);o!==null&&(z(o,"aria-label",n.t("editorTabsLabel")),Wn(Wt(o,Ge),n.t("editorTabProvider")),Wn(Wt(o,yt),n.t("editorTabModels")),Wn(Wt(o,wt),n.t("editorTabAdvanced")),qt(Wt(o,yt),!r.has(yt)),qt(Wt(o,wt),!r.has(wt)),va(e,o))}function va(e,t){let n=t??ha(e).querySelector(`.${lo}`);if(n===null)return;let r=e.getAttribute(je)??Ge;for(let o of Array.from(n.querySelectorAll(`[${Vn}]`)))z(o,"aria-selected",o.getAttribute(Vn)===r?"true":"false")}function Wt(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(Vn)===t)return n}function Xn(e){e.classList.remove(Bt),e.removeAttribute(je),e.removeAttribute(Kt);for(let t of Array.from(e.querySelectorAll(`[${xe}]`)))t.getAttribute(xe)===Ge&&($n(t),Gn(t)),t.removeAttribute(xe);for(let t of Array.from(e.querySelectorAll(`[${vt}]`)))t.removeAttribute(vt);_f(e)}function Of(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(z(t,Ut,"closed"),z(t,"open",""))}function _f(e){for(let t of Array.from(e.querySelectorAll(`details[${Ut}]`)))t.removeAttribute("open"),t.removeAttribute(Ut)}var $a=require("react");var me=require("react");var ee=require("react");var If='p[class*="savedNotice"]',ka="data-bre-saved-hidden",Nf="bre-auto-effort-note",Df="data-bre-auto-effort-phase",xa="bre-auto-effort-note-text",xt=new Map,Ea=new WeakMap,Et=null,Jn=null;function Ta(e){let t=Array.from(e.querySelectorAll(If));for(let n of t){let r=n.textContent?.trim()??"";Ea.get(n)!==r&&(Ea.set(n,r),r.length>0&&Aa(r)),!xt.has(n)&&(xt.set(n,n.style.display),n.setAttribute(ka,""),n.style.display="none")}for(let[n,r]of Array.from(xt))n.isConnected&&t.includes(n)||(La(n,r),xt.delete(n))}function Ma(){for(let[e,t]of Array.from(xt))La(e,t);xt.clear(),fo()}function La(e,t){e.style.display=t,e.removeAttribute(ka)}function Sa(e){Aa(e)}function Aa(e){if(Et!==null&&Et.isConnected&&Et.textContent===e)return;fo();let t=document.createElement("div");t.className=Nf,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute(Df,"done"),t.innerHTML=`<span class="${xa}"></span>`;let n=t.querySelector(`.${xa}`);n!==null&&(n.textContent=e),t.style.setProperty("--bre-note-hold","3000ms"),document.body.append(t),Et=t,Jn=setTimeout(()=>{fo()},3e3)}function fo(){Jn!==null&&(clearTimeout(Jn),Jn=null),Et?.remove(),Et=null}var nt="data-bre-settle",Ra='[class*="rowActions"] > button:not(.bre-provider-switch)';var Le=null,co=0,Qn=0,jt=!1,kt=null;function Ha(e){return e.className.includes("dangerButton")?"remove":"edit"}function po(e,t){return Array.from(e.querySelectorAll(Ra)).find(r=>Ha(r)===t)??null}function Cf(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Pf(e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e)}function Oa(e=document){zt();let t=[];for(let n of Array.from(e.querySelectorAll(Ra))){if(n.disabled)continue;let r=n.closest("li")??n.parentElement;if(r===null)continue;let o=Ha(n);t.some(i=>i.row===r&&i.role===o)||t.push({row:r,role:o})}t.length!==0&&(Le=t,Qn=Date.now(),co=Qn+8e3,Ff(),_a())}function mo(){if(Le===null)return;let e=Date.now();if(e>co){zt();return}let t=0;if(Le=Le.filter(n=>{if(!n.row.isConnected)return!1;let r=po(n.row,n.role);return r===null||(r.disabled?(jt=!0,t+=1,r.hasAttribute(nt)||r.setAttribute(nt,"")):jt&&r.hasAttribute(nt)&&r.removeAttribute(nt)),!0}),jt&&t===0){zt();return}if(!jt&&e-Qn>1500){zt();return}_a()}function _a(){kt!==null||Le===null||(kt=Cf(()=>{kt=null,mo()}))}function Ff(){if(Le!==null)for(let e of Le){let t=po(e.row,e.role);t!==null&&!t.hasAttribute(nt)&&t.setAttribute(nt,"")}}function Ia(){zt()}function zt(){if(kt!==null&&(Pf(kt),kt=null),Le!==null)for(let e of Le){let t=po(e.row,e.role);t!==null&&t.removeAttribute(nt)}Le=null,jt=!1,co=0,Qn=0}var D=require("react/jsx-runtime"),qf=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function Na(e,t){let n=()=>t.current+=1,r=Object.entries(e??{}).map(([o,i])=>({id:n(),name:o,value:i}));return r.length===0&&r.push({id:n(),name:"",value:""}),{rows:r}}function Da(e){let t={},n=!1;for(let o of e.rows){let i=o.name.trim();i.length!==0&&(t[i]=o.value,i.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function Zn({route:e,api:t,t:n,onDismiss:r,deferred:o}){let i=(0,ee.useId)(),[s,a]=(0,ee.useState)(void 0),[d,l]=(0,ee.useState)({rows:[]}),[p,g]=(0,ee.useState)(!1),[c,u]=(0,ee.useState)(!1),[f,m]=(0,ee.useState)(!0),[h,v]=(0,ee.useState)(!1),[x,b]=(0,ee.useState)(!1),[A,R]=(0,ee.useState)(void 0),[H,O]=(0,ee.useState)(void 0),[L,F]=(0,ee.useState)(!1),y=(0,ee.useRef)(0),I=(0,ee.useRef)(null),w=o!==void 0,M=o?.onDraft,N=(0,ee.useRef)(void 0);(0,ee.useEffect)(()=>{if(w&&N.current!==void 0)return;N.current=e;let S=!0;return(async()=>{try{let K=await te(t);if(!S)return;let Y=Lr(K.namespace,e);a(Y),l(Na(Y,y)),b(K.writable!==!0)}catch{S&&b(!0)}finally{S&&m(!1)}})(),()=>{S=!1}},[t,e,w]),(0,ee.useEffect)(()=>{M!==void 0&&M(Da(d))},[d,M]),(0,ee.useEffect)(()=>{let S=!0;return(async()=>{try{let Y=await(await fetch(Po,{method:"GET"})).json();S&&Y.ok===!0&&Y.data!==void 0&&O(Y.data)}catch{}})(),()=>{S=!1}},[]),(0,ee.useEffect)(()=>{let S=I.current;if(S===null)return;let K=()=>{F(S.dataset.breRegion==="advanced")};K();let Y=new MutationObserver(K);return Y.observe(S,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{Y.disconnect()}},[]);let W=()=>{l(S=>({...S,rows:[...S.rows,{id:y.current+=1,name:"",value:""}]})),R(void 0)},X=(S,K)=>{l(Y=>({...Y,rows:Y.rows.map(le=>le.id===S?{...le,...K}:le)})),R(void 0)},oe=S=>{l(K=>({...K,rows:K.rows.filter(Y=>Y.id!==S)})),R(void 0)},J=()=>{if(l(Na(s,y)),u(!1),R(void 0),o!==void 0){o.onCancel();return}L&&r?.()},Q=async S=>{v(!0),R(void 0),Oa();let K;try{K=await Ot(t,e,S)}catch(le){K={ok:!1,error:le instanceof Error?le.message:String(le)}}if(v(!1),!K.ok){R({kind:"error",text:K.error==="no-route"?n("headersNoRoute"):K.error==="read-only"?n("headersReadOnly"):n("headersError",{error:K.error})});return}a(S),u(!1);let Y=Object.keys(S).length===0?n("headersCleared"):n("headersSaved");if(L){Sa(Y),r?.();return}R({kind:"success",text:Y})},Z=Object.entries(s??{}),G=x||h,q=Z.length,B=L||w,U=p||c||B;return(0,D.jsxs)("div",{className:"bre-headers",ref:I,"data-plugin":re,"data-open":p?"1":"0",children:[(0,D.jsx)("div",{className:"bre-headers-head",children:c||B?(0,D.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,D.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":p,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{g(!p),R(void 0)},children:[(0,D.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),f||q===0?null:(0,D.jsx)("span",{className:"bre-headers-count",children:q}),(0,D.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),U?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),H===void 0?null:(0,D.jsxs)(D.Fragment,{children:[H.environment.preferOfficialLayer?(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,H.conflicts.length===0&&(H.headerConflicts?.length??0)===0?null:(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),H.environment.siblings.length===0?null:(0,D.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:H.environment.siblings.map(S=>S.name).join(", ")})})]}),f?null:c||B?(0,D.jsxs)("div",{className:"bre-headers-edit",children:[(0,D.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,D.jsx)("span",{children:n("headersName")}),(0,D.jsx)("span",{children:n("headersValue")}),(0,D.jsx)("span",{})]}),d.rows.map(S=>(0,D.jsxs)("div",{className:"bre-headers-row",children:[(0,D.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:S.name,disabled:G,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:K=>{X(S.id,{name:K.target.value})}}),(0,D.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:S.value,disabled:G,list:S.name.trim().toLowerCase()==="user-agent"?i:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:K=>{X(S.id,{value:K.target.value})}}),(0,D.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:G,"aria-label":`${n("headersClear")} ${S.name}`,onClick:()=>{oe(S.id)},children:"\xD7"})]},S.id)),(0,D.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:G,onClick:W,children:n("headersAdd")}),!1,(0,D.jsx)("datalist",{id:i,children:qf.map(S=>(0,D.jsx)("option",{value:S},S))}),(0,D.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),w?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("p",{className:"bre-effort-note",children:n("pendingSave")}),(0,D.jsx)("p",{className:"bre-effort-note",children:n("pendingHint")})]}):null]}):(0,D.jsxs)("div",{className:"bre-headers-rows",children:[Z.length===0?(0,D.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):Z.map(([S,K])=>(0,D.jsxs)("div",{className:"bre-headers-row",children:[(0,D.jsx)("span",{className:"bre-headers-name",children:S}),(0,D.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(K.length,24))})]},S)),x?null:(0,D.jsx)("div",{className:"bre-effort-actions",children:(0,D.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:G,onClick:()=>{u(!0),R(void 0)},children:n("headersEdit")})})]})]}):null,!f&&(B||c)?(0,D.jsxs)("div",{className:"bre-effort-actions bre-headers-actions",children:[(0,D.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:h,onClick:J,children:n("headersCancel")}),w?null:(0,D.jsx)("button",{type:"button",className:"bre-primary-button",disabled:G,onClick:()=>{Q(Da(d))},children:n("headersSave")})]}):null,A===void 0?null:(0,D.jsx)("p",{className:"bre-effort-message bre-"+A.kind,role:A.kind==="error"?"alert":"status",children:A.text})]})}var go=require("react");var Wf={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function er({host:e,t}){return(0,go.createElement)("div",{className:fa,role:"tablist","aria-label":t("editorTabsLabel")},...ua.map(n=>(0,go.createElement)("button",{key:n,type:"button",role:"tab",className:ca,[pa]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=Gt(e.current);o!==null&&ba(o,n)}},t(Wf[n]))))}var Kf=15e3;function Pa(){return{intents:new Map,baseline:new Map,flushing:!1}}function ho(e,t,n){if(t.length===0)return;let r={...n};if(Object.keys(r).length===0){e.intents.delete(t);return}let o=e.intents.get(t);if(o===void 0){e.intents.set(t,{headers:r,declaredBefore:e.baseline.get(t)});return}o.headers=r}function bo(e,t){e.intents.delete(t)}function Fa(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function qa(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function Wa(e,t){return t.length>0&&!e.baseline.has(t)}async function Ka(e,t){if(e.flushing)return Ca(e);if(e.intents.size===0)return 0;e.flushing=!0;try{let n=await te(t),r,o=async s=>Ye(n.namespace,s)?!0:(r??(r=await te(t,{fresh:!0})),Ye(r.namespace,s)),i=Date.now();for(let[s,a]of Array.from(e.intents)){if(a.declaredBefore===void 0){a.releasedAt!==void 0&&a.noted!==!0&&(a.noted=!0,console.warn("[bre] deferred request headers: nobody said whether this id existed before, so the draft is held:",s));continue}if(a.declaredBefore){e.intents.delete(s);continue}if(!await o(s)){a.releasedAt!==void 0&&i-a.releasedAt>Kf?(e.intents.delete(s),console.info("[bre] deferred request headers: gave up on a draft whose card closed first:",s)):a.releasedAt!==void 0&&console.info("[bre] deferred request headers: waiting for the closed card to declare",s);continue}console.info("[bre] deferred request headers: the route is declared, writing the held draft:",s);let d;try{d=await Ot(t,s,a.headers)}catch(l){d={ok:!1,error:l instanceof Error?l.message:String(l)}}if(d.ok){e.intents.delete(s),console.info("[bre] deferred request headers: saved",s,Object.keys(a.headers).length,"header(s)");continue}d.error!=="no-route"&&(e.intents.delete(s),console.error("[bre] deferred request headers: the write was refused:",d.error,s))}}catch(n){console.error("[bre] deferred request headers: could not read the settings document:",n)}finally{e.flushing=!1}return Ca(e)}function Ca(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var rt=require("react/jsx-runtime");function Ga({host:e,api:t,t:n,routeIdLabels:r,staged:o}){let[i,s]=(0,me.useState)(()=>Ua(e.current,r)),a=(0,me.useRef)(i),d=(0,me.useRef)(void 0),l=(0,me.useRef)(new Set),p=(0,me.useRef)(!1),g=(0,me.useRef)(null);return g.current===null&&(g.current={onDraft:c=>{d.current=c;let u=a.current;if(u.length===0){!p.current&&Object.keys(c).length>0&&(p.current=!0,console.info("[bre] deferred request headers: holding a draft until the provider id is typed"));return}ho(o,u,c),Ba(t,o,u,l.current)},onCancel:()=>{d.current=void 0,bo(o,a.current)}}),(0,me.useEffect)(()=>{let c=ja(e.current);if(c===null)return;let u=()=>{s(Ua(e.current,r))};return c.addEventListener("input",u,!0),()=>{c.removeEventListener("input",u,!0)}},[e,r]),(0,me.useEffect)(()=>{i.length>0&&Ba(t,o,i,l.current)},[t,o,i]),(0,me.useEffect)(()=>{let c=a.current;if(c===i)return;bo(o,c),a.current=i;let u=d.current;u!==void 0&&i.length>0&&ho(o,i,u)},[i,o]),(0,me.useEffect)(()=>()=>{Fa(o,a.current)},[o]),(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(er,{host:e,t:n}),(0,rt.jsx)(Zn,{route:i,api:t,t:n,deferred:g.current})]})}function Ba(e,t,n,r){!Wa(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await te(e);qa(t,n,Ye(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred request headers: could not read the settings document for this route:",o)}})())}function ja(e){let t=e?.parentElement;return t==null?null:t.parentElement?.closest('[class*="addCard"]')??t}function Ua(e,t){let n=e?.parentElement;if(n==null)return"";let r=t(),o=pe(n,r).trim();if(o.length>0)return o;let i=ja(e);return i===null||i===n?"":pe(i,r).trim()}var wo="bre-create-host",yo="bre-add-mode-picker",Bf='[class*="addCard"]',Uf='[class*="addPanel"]',Gf='[class*="addModes"]',jf="-custom-panel",zf="-custom";function Va(){return{hosts:new Map}}function vo(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(Bf)))if(o.isConnected)try{$f(o,t,n),r.add(o)}catch(i){tr(o,n),Ya(o,!1),console.warn("[bre] add provider card: left the official form in place:",i)}for(let o of Array.from(n.hosts.keys()))(!r.has(o)||!o.isConnected)&&tr(o,n)}function $f(e,t,n){let r=Vf(e,jf);if(r===void 0){za(e);return}if(r.hidden){za(e);return}Xf(e,r,t,n),Ya(e,!0)}function Ya(e,t){let n=Xa(e);n!==void 0&&ve(n,yo,t)}function Vf(e,t){for(let n of Array.from(e.querySelectorAll(Uf)))if(n.id.endsWith(t))return n}function Xa(e){let t=e.querySelector(Gf);if(t!==null){for(let n of Array.from(t.children))if(n instanceof HTMLElement&&n.getAttribute("role")==="tablist")return n}}function za(e){let t=Xa(e);if(t!==void 0){for(let n of Array.from(t.querySelectorAll('[role="tab"]')))if(n.id.endsWith(zf)){if(n.disabled)return;n.getAttribute("aria-selected")!=="true"&&n.click();return}}}function Yf(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.classList.contains(wo))return t}function Xf(e,t,n,r){let o=r.hosts.get(e),i=Yf(t);if(i!==void 0&&o!==void 0&&o.host===i)return;tr(e,r),i!==void 0&&i.remove();let s=e.ownerDocument.createElement("div");s.className=wo,t.insertBefore(s,t.firstChild);let a=Xe(s,n.refreshed(()=>(0,$a.createElement)(Ga,{host:{current:s},api:n.api,t:n.t,routeIdLabels:n.routeIdLabels,staged:n.staged})),{sync:!0});r.hosts.set(e,{host:s,mount:a})}function tr(e,t){let n=t.hosts.get(e);n!==void 0&&(t.hosts.delete(e),Ne(n.mount))}function Ja(e){for(let t of Array.from(e.hosts.keys()))tr(t,e);for(let t of Array.from(document.querySelectorAll(`.${wo}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${yo}`)))ve(t,yo,!1)}var $t="data-bre-row-provider",Qa="{provider}",Jf=["rowCard","setupCard"];function Za(){return Sn()}function Pe(e){for(let t of Jf)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&de(r).length!==0)return r}}function Vt(e){return e.querySelector('[class*="rowHead"]')??void 0}function Tt(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Qf(e){let t=e.indexOf(Qa);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Qa.length)}}function Zf(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var ec='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function tc(e){let t=e.closest(ec);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function Fe(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=Qf(r);if(o!==void 0)for(let i of Array.from(e.querySelectorAll("button[aria-label]"))){if(tc(i))continue;let s=i.getAttribute("aria-label")??"";if(s.length<=o.prefix.length+o.suffix.length||!s.startsWith(o.prefix)||!s.endsWith(o.suffix))continue;let a=Zf(s.slice(o.prefix.length,s.length-o.suffix.length));if(a!==void 0)return a}}}function xo(e){let t=e.getAttribute($t);return t===null||t.length===0?void 0:t}function nc(e){return Dt(e,xo)}function ed(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=t.labels();for(let i of de(r)){let s=Fe(i,o);if(s===void 0){i.removeAttribute($t);continue}xo(i)!==s&&i.setAttribute($t,s)}On(e,r,rc(t),n)}function rc(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:xo,labelOf:Tt,order:t=>Yo(t),commit:t=>{$o(nc(t))},seatOf:Vt,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:Tt(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function td(e){_n(e);let t=Array.from(document.querySelectorAll(`[${$t}]`));Rn(t);for(let n of t)n.removeAttribute($t)}var Mt="data-bre-provider-switch",nr="bre-row-disabled";function rd(){return{switches:new WeakSet}}function od(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=t.labels();for(let i of Array.from(r.children)){if(!(i instanceof HTMLElement))continue;let s=Fe(i,o);if(s===void 0)continue;let a=Vt(i);a!==void 0&&(oc(i,a,s,t,n),i.classList.toggle(nr,!ft(s)))}}function id(){for(let e of Array.from(document.querySelectorAll(`[${Mt}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${nr}`)))e.classList.remove(nr)}function oc(e,t,n,r,o){let i=t.querySelector(`[${Mt}]`);if(i!==null){nd(i,e,n,r);return}let s=document.createElement("button");s.className="bre-provider-switch",s.setAttribute("type","button"),s.setAttribute("role","switch"),s.setAttribute(Mt,n),nd(s,e,n,r),ic(s,e,o);let a=t.querySelector('[class*="rowActions"]');a===null?t.appendChild(s):a.insertBefore(s,a.firstChild)}function nd(e,t,n,r){let o=r.t("providerToggleAria",{provider:Tt(t)??n}),i=r.t("providerToggleHint"),s=ft(n)?"true":"false";e.getAttribute(Mt)!==n&&e.setAttribute(Mt,n),e.getAttribute("aria-checked")!==s&&e.setAttribute("aria-checked",s),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function ic(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(Mt);if(o===null)return;let i=!ft(o);Qo(o,i),e.setAttribute("aria-checked",i?"true":"false"),t.classList.toggle(nr,!i)}))}var rr="data-bre-provider-delete",sd='[class*="rowActions"]',ad='[class*="dangerButton"]',sc="bre-provider-delete";function dd(e,t){if(!e.isConnected)return;let n=Pe(e);if(n===void 0)return;let r=t.labels(),o=ac(n)??t.t("providerRemoveDisabled");for(let i of Array.from(n.children)){if(!(i instanceof HTMLElement))continue;let s=Fe(i,r);if(s===void 0)continue;let a=Vt(i);if(a===void 0)continue;let d=a.querySelector(sd);if(d===null)continue;let l=d.querySelector(`[${rr}]`);if(d.querySelector(ad)!==null){l!==null&&l.remove();continue}let p=l??dc();d.lastElementChild!==p&&d.appendChild(p),lc(p,s,o,t.t("providerRemoveLocked",{provider:Tt(i)??s}))}}function ld(){for(let e of Array.from(document.querySelectorAll(`[${rr}]`)))e.remove()}function ac(e){let n=e.querySelector(`${sd} ${ad}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function dc(){let e=document.createElement("button");return e.className=sc,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function lc(e,t,n,r){e.getAttribute(rr)!==t&&e.setAttribute(rr,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var or="data-bre-provider-disabled-group",uc="bre-provider-disabled-seat",ud="bre-provider-disabled-group",Eo="bre-row-folded",ko="bre-row-hidden";function fd(){return{expanded:!1}}function cd(e,t,n){if(!e.isConnected)return;let r=Pe(e);if(r===void 0)return;let o=md(r,t.labels()),i=o.filter(l=>!l.enabled).length,s=gd(r);if(i===0){s!==void 0&&s.remove(),To(o,n);return}let a=s??fc(r,t,n);(a.parentElement!==r||r.lastElementChild!==a)&&r.append(a),To(o,n);let d=hd(a);d!==void 0&&bd(d,i,t,n)}function pd(){for(let e of Array.from(document.querySelectorAll(`[${or}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${ko}, .${Eo}`)))e.classList.remove(ko,Eo)}function md(e,t){let n=[];for(let r of Array.from(e.children)){if(!(r instanceof HTMLElement)||r.getAttribute(or)!==null)continue;let o=Fe(r,t);o!==void 0&&n.push({row:r,id:o,enabled:ft(o)})}return n}function To(e,t){for(let n of e){let r=!n.enabled;n.row.classList.toggle(Eo,r),n.row.classList.toggle(ko,r&&!t.expanded)}}function gd(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.getAttribute(or)!==null)return t}function hd(e){return e.querySelector(`button.${ud}`)??void 0}function fc(e,t,n){let r=document.createElement("li");r.className=uc,r.setAttribute(or,"");let o=document.createElement("button");return o.className=ud,o.setAttribute("type","button"),o.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n.expanded=!n.expanded,cc(e,t,n)}),r.appendChild(o),e.append(r),r}function cc(e,t,n){let r=md(e,t.labels());To(r,n);let o=gd(e);if(o===void 0)return;let i=r.filter(a=>!a.enabled).length;if(i===0){o.remove();return}let s=hd(o);s!==void 0&&bd(s,i,t,n)}function bd(e,t,n,r){let o=n.t(r.expanded?"providerDisabledGroupHide":"providerDisabledGroupShow",{count:t}),i=n.t("providerDisabledGroupHint"),s=r.expanded?"true":"false";e.textContent!==o&&(e.textContent=o),e.getAttribute("aria-expanded")!==s&&e.setAttribute("aria-expanded",s),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}var Yt="data-bre-row-model",Mo="bre-model-grid";function wd(){return Sn()}function pc(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))de(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function vd(e){for(let t of e){if(t.type!=="childList")continue;let n=t.target;if(n instanceof HTMLElement&&n.matches('[class*="modelList"]')&&de(n).some(r=>r.matches('[class*="modelEntry"]')))return!0;for(let r of[t.addedNodes,t.removedNodes])for(let o of Array.from(r))if(o instanceof HTMLElement&&o.matches('[class*="modelEntry"]'))return!0}return!1}function ir(e){let t=e.getAttribute(Yt);return t===null||t.length===0?void 0:t}function Lo(e,t){let n=e.closest("li");if(n!==null)return Fe(n,t.labels())}function yd(e,t){let n=pe(e,t.labels().modelName);return n.length>0?n:ir(e)}function mc(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:ir,labelOf:n=>yd(n,t),order:n=>{let r=Lo(e,t);return r===void 0?n:ai(r,n)},commit:n=>{let r=Lo(n,t);r!==void 0&&ii(r,Dt(n,ir))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:yd(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(Mo)}}}function xd(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of pc(e))if(Lo(o,t)!==void 0){for(let i of de(o)){let s=pe(i,r.modelId);if(s.length===0){i.removeAttribute(Yt);continue}ir(i)!==s&&i.setAttribute(Yt,s)}On(e,o,mc(o,t),n)}}function Ed(e){_n(e);for(let n of Array.from(document.querySelectorAll(`.${Mo}`)))n.classList.remove(Mo);let t=Array.from(document.querySelectorAll(`[${Yt}]`));Rn(t);for(let n of t)n.removeAttribute(Yt)}var gc="settings.models",Se={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"],inputImage:["modelInputImage","Image"]};function Td(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:i}=e,s=()=>{let q=t.locale.bind(gc),B=([U,...S])=>{let K=q(U);return K===U||K.trim()===""?S:[K,...S]};return{capacity:B(Se.capacity),modelId:B(Se.modelId),modelName:B(Se.modelName),routeId:B(Se.routeId),baseUrl:B(Se.baseUrl),apiProtocol:B(Se.apiProtocol),apply:B(Se.apply),cancel:B(Se.cancel),editProvider:B(Se.editProvider),inputImage:B(Se.inputImage)}},a=120,d=1e3,l=Rs(),p=Za(),g={t:r,labels:s},c=rd(),u={t:r,labels:s},f={t:r,labels:s},m=fd(),h={t:r,labels:s},v=wd(),x={t:r,labels:s},b=ga(),A={t:r},R=Va(),H=Pa(),O={t:r,api:n,routeIdLabels:()=>s().routeId,staged:H,refreshed:i},L,F,y,I,w=!1,M={api:n,describeNamespace:()=>te(n),t:r,labels:s,onIdle:o,onBackoff:q=>{N(q)},onPendingChanged:()=>{oe()},mount(q,B){let U=document.createElement("div");U.className="bre-effort-slot",U.dataset.plugin=re,q.appendChild(U);let S=(0,kd.createRoot)(U),K=Y=>{S.render((0,So.createElement)(Ie,{fallbackText:r("renderFailed"),children:i(()=>(0,So.createElement)(kn,Y))}))};return K(B),{unmount:()=>{try{S.unmount()}finally{U.remove()}},render:K}}};function N(q){w||F!==void 0||(F=window.setTimeout(()=>{F=void 0,oe()},q))}let W=()=>{let q=Te();Pe(q)!==void 0&&(ed(q,g,p),od(q,u,c),dd(q,f),cd(q,h,m),xd(q,x,v),mo(),Ta(q))},X=(q,B)=>{try{B()}catch(U){console.error(`[bre] ${q} failed:`,U)}};function oe(){w||L!==void 0||(L=window.setTimeout(()=>{L=void 0,X("composer mutation",()=>{I?.()}),Gs(Te(),M,l),vo(Te(),O,R),uo(Te(),A,b),W(),Ka(H,n).then(q=>{q>0&&N(d)})},a))}let J=q=>{if(w||y!==void 0)return;I=q,X("models page startup",()=>{q(),W()}),Ws();let B=U=>{q(),vo(Te(),O,R),uo(Te(),A,b),W(),vd(U)&&Bs(Te())};y=new MutationObserver(U=>{X("models mutation",()=>{B(U)}),oe()}),y.observe(document.body,{childList:!0,subtree:!0}),oe()},Q=()=>{w=!0,L!==void 0&&(window.clearTimeout(L),L=void 0),F!==void 0&&(window.clearTimeout(F),F=void 0),y?.disconnect(),y=void 0};return{state:l,labels:s,start:J,stopObserver:Q,teardown:()=>{if(!l.disposed){Q(),l.disposed=!0,Ns(),Ss(l,M);for(let[,q]of l.mounted)q.editor.unmount();l.mounted.clear(),td(p),id(),ld(),pd(),es(),Ma(),Ia(),Ed(v),Ja(R),ya(),Ks()}},flushOnUnload:()=>{As(l,M)},schedule:oe}}function hc(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[i,s]of Object.entries(n?.byId??{}))if(!(s===void 0||(s.retainedBy?.mainView??0)<=0))return typeof s.id=="string"&&s.id.length>0?s.id:i}function Md(e){let t,n=new Map,r=(s,a)=>{for(let[d,l]of n){if(d===a)continue;let p;try{p=s.directoryFor(l.sessionId)===d}catch{p=!1}p||(l.restore(),n.delete(d))}};return{ensure:()=>{let s=e.ctx,a=s.get?.("sessions"),d=s.get?.("uiSession"),l=s.get?.("modelDirectories"),p=hc(a,d);if(!(p===void 0||l===void 0))try{let g=l.directoryFor(p);return r(l,g),t!==void 0&&t.sessionId===p&&t.directory===g||(n.has(g)||n.set(g,{sessionId:p,restore:wi(g,{configuredEffort:e.configuredEffort})}),t={sessionId:p,directory:g}),g}catch{t=void 0;return}},dispose:()=>{for(let[,s]of n)s.restore();n.clear()}}}var Ae=require("react");var Ld="settings.models.provider-card";function bc(e){if(e===null)return;let t=e.querySelector('[class*="editorActions"]');if(t===null)return;let n=Array.from(t.querySelectorAll("button")),r=t.querySelector('button[class*="secondaryButton"]')??n.at(-2)??null;r!==null&&(r instanceof HTMLButtonElement&&r.disabled||r.click())}function yc({provider:e,api:t,t:n}){let r=(0,Ae.useRef)(null),o=e?.provider,i=(0,Ae.useCallback)(()=>{bc(Gt(r.current))},[]);return(0,Ae.useEffect)(()=>{let s=r.current,a=Gt(s);if(s===null||a===null)return;let d=a,l=()=>a.querySelector('[class*="_editor"]')!==null,p=()=>{let c=l()?"1":"0";s.dataset.edit!==c&&(s.dataset.edit=c)};p();let g=new MutationObserver(p);return g.observe(d,{childList:!0,subtree:!0}),()=>{g.disconnect()}},[o]),typeof o!="string"||o.length===0?null:(0,Ae.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,Ae.createElement)(er,{host:r,t:n}),(0,Ae.createElement)(Zn,{route:o,api:t,t:n,onDismiss:i}))}function Sd(e,t,n){let r=e,o=r.slots?.inject(Ld,()=>{r.slots?.register({name:Ld,key:fe,inject:()=>({api:t,t:n})},yc)});return typeof o=="function"?o:()=>{}}var be=require("react");function Ad(e){let{t}=e,n=(0,be.useSyncExternalStore)(tn,we),r=()=>{Bo(!n)};return(0,be.createElement)("div",{className:"bre-slider-setting"},(0,be.createElement)("div",{className:"bre-slider-setting-row"},(0,be.createElement)("div",{className:"bre-slider-setting-copy"},(0,be.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,be.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,be.createElement)("div",{className:"bre-slider-setting-control"},(0,be.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,be.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,be.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Rd(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:re+"-slider-toggle",order:15,inject:()=>({t})},Ad)});return typeof r=="function"?r:()=>{}}var wc=re,vc=["slots","locale","connection","remote","remote.settings"];function xc(e){e.effect(()=>e.locale.register(ar,{zh:Wo,en:qo}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=re,t.dataset.pluginStyles=re,t.textContent=li,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let f=e.get?.("configForms");try{let h=f?.get?.(fe);if(h!==void 0)return h}catch{}return e.get?.("settingsScope")?.bind?.({namespace:fe})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(ar),i=()=>{let f=e.locale;return typeof f.subscribe=="function"&&typeof f.getSnapshot=="function"?f:void 0},s=f=>{let m=i();return m===void 0?f():(0,Hd.createElement)(Fo,{locale:m,children:f})},a=Bi({api:r}),d=ki(r),l=Md({ctx:e,configuredEffort:a.of}),p=Ki({menuOf:Pi,triggerOf:Fi,t:o,refreshed:s,sliderEnabled:we,directory:l.ensure,configuredInputs:d}),g=Gi({api:r}),c=Td({ctx:e,api:r,t:o,onIdle:g.run,refreshed:s}),u=()=>{l.ensure(),p.reconcile()};e.effect(()=>(c.start(u),()=>{c.teardown(),p.dispose(),l.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let f=()=>{c.flushOnUnload()};return window.addEventListener("pagehide",f),()=>{window.removeEventListener("pagehide",f)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let f=()=>{c.state.describePromise=void 0,a.invalidate(),d.invalidate(),g.invalidate(),c.schedule()},m=[e.remote.$on("settings/document-updated",h=>{h===fe&&f()}),e.on("connection/reset",f)];return()=>{for(let h of m)h()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let f=b=>{b.key===en?Uo(b.newValue!=="false"):b.key===nn?Vo(lt(b.newValue)):b.key===on?Zo(Xo(b.newValue)):b.key===an&&si(hr(b.newValue))};window.addEventListener("storage",f);let m=tn(()=>{c.schedule()}),h=rn(()=>{c.schedule()}),v=sn(()=>{c.schedule()}),x=dn(()=>{c.schedule()});return()=>{window.removeEventListener("storage",f),m(),h(),v(),x()}},"dsh-model-think-level: client preferences"),e.effect(()=>Rd(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Sd(e,r,o),"dsh-model-think-level: provider-card slot activation")}
3924
+ `;var yn=require("react"),Ts=require("react-dom");var E=require("react"),us=require("react-dom");var Ja=["off","minimal","low","medium","high","xhigh","max"],Du=["text","image"];var Iu=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF08\u65E0 Max \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 High(\u9ED8\u8BA4) / XHigh\u30011.05M \u4E0A\u4E0B\u6587\u4E14\u4EC5 Responses API\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF081.05M\uFF09\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u30022026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1B2026-10 \u6821\u51C6\uFF1ANone \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8865\u56DE\uFF08\u6B64\u524D\u6309\u65E7\u6A21\u578B\u9875\u8BB0\u4E3A\u65E0 None\uFF09\u3002gpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-gpt-5-2-chat",patterns:["gpt-5.2-chat"],efforts:{off:null,medium:"medium",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-5.2-Chat\uFF08\u5B98\u65B9 id gpt-5.2-chat-latest\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u8BB0\u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5 Medium / XHigh \u4E24\u6863\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\uFF0C128K / 16,384 \u8F93\u51FA\u30022026-10 \u65B0\u589E\u6761\u76EE\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002gpt-5.2-chat \u53E6\u6709\u63A8\u7406\u6761\u76EE\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6",patterns:["gpt-6-luna","gpt-6-sol","gpt-6-terra","gpt-6.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 \u7CFB\uFF08luna/sol/terra\uFF0C2026-10 \u6821\u51C6\u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C272,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\u3002gpt-6-astra \u89C1\u5355\u72EC\u6761\u76EE\uFF08\u88F8 "gpt-6" \u4E0E 6.1-sol \u7531 astra \u6761\u76EE\u627F\u63A5\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF0C"none" \u672A\u8BC1\u5B9E\u53EF\u624B\u8C03\uFF09\u3002'},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6","gpt-6.1-sol"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:272e3,maxTokens:128e3,note:'GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF1B2026-10 \u6821\u51C6\uFF1A\u4E0A\u4E0B\u6587\u6309 pi-ai 1.2.0 \u76EE\u5F55\u8BB0 272,000\uFF08\u6B64\u524D\u8BEF\u8BB0 1,050,000\uFF09\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002gpt-6 luna/sol/terra \u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u88F8 "gpt-6" \u4E0E 6.1-sol\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\u7531\u672C\u6761\u76EE\u627F\u63A5\u3002'},{id:"openai-gpt-daybreak",patterns:["gpt-daybreak"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-Daybreak\uFF08blue-latest 1.05M / red-latest 400K\uFF0C2026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u5168\u6863 None / Low / Medium / High / XHigh / Max\uFF0C\u5E26\u56FE\u8F93\u5165 / 128,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-realtime",patterns:["gpt-realtime"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:128e3,maxTokens:32e3,note:"GPT-Realtime 2.1\uFF082026-10 \u65B0\u589E\uFF09\uFF1Api-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D Minimal / Low / Medium / High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C128,000 \u4E0A\u4E0B\u6587 / 32,000 \u8F93\u51FA\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5-5",patterns:["claude-haiku-5.5","claude-opus-5-5","claude-sonnet-5-5","haiku-5.5","claude-5-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5.5 \u4EE3\uFF08Haiku 5.5 / Opus 5.5 / Sonnet 5.5\uFF09\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5168\u6863 Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\u3002off/minimal \u4EE5\u7701\u7565\u8868\u8FBE\uFF08\u76EE\u5F55\u5C06\u4E24\u952E\u8BB0\u4E3A null\uFF0C\u975E\u663E\u5F0F\u5173\u95ED\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u5DF2\u6536\u7D27\u4E3A XHigh / Max\uFF08low/medium/high \u6863\u5DF2\u4ECE\u8BE5\u4EE3 effort \u76EE\u5F55\u79FB\u9664\uFF1BFable 5 \u4E0E Opus 5 \u53E6\u63A5\u53D7\u4EE5\u7701\u7565\u8868\u8FBE\u7684 off\uFF0CSonnet 5 \u65E0 off\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u6863\u4F4D XHigh / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1BFable 5.1 \u652F\u6301\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002pi-ai 1.2.0 \u76EE\u5F55\u65E0 mythos \u6761\u76EE\uFF0C\u672C\u6863\u4F4D\u6CBF\u7528\u5B98\u65B9 effort \u77E9\u9635\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{xhigh:"xhigh",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u6863\u4F4D\u4EC5 XHigh / Max\uFF08low/medium/high \u5DF2\u4ECE\u8BE5\u4EE3\u76EE\u5F55\u79FB\u9664\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\uFF08Opus 4.6 / Sonnet 4.6\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u4EC5\u5269 Max \u4E00\u6863\uFF08low/medium/high/xhigh \u5747\u5DF2\u4ECE\u76EE\u5F55\u79FB\u9664\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 5.5/5/5.1 \u4EE3\u3001Opus 4.5/4.6/4.7/4.8\u3001Sonnet 4.6 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002Haiku 5.5 \u53CA\u6574\u4E2A 5.5 \u4EE3\u89C1\u4E0A\u65B9 anthropic-claude-5-5 \u6761\u76EE\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002Gemma-4 \u89C1\u4E0B\u6761\u3002"},{id:"google-gemma-4",patterns:["gemma-4"],efforts:{off:null,minimal:"MINIMAL",high:"HIGH"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:32768,note:"Gemma 4\uFF0826b/31b-it\uFF09\uFF1A\u4E09\u6863 Minimal / High\uFF08\u6863\u4F4D\u7EBF\u4E3A\u5B98\u65B9\u5927\u5199\u679A\u4E3E\u62FC\u5199\uFF09\uFF0Coff \u4EE5\u7701\u7565\u8868\u8FBE\uFF1BLow/Medium \u4E0D\u88AB\u63A5\u53D7\u3002\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 32,768\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,maxTokens:5e5,note:'Grok 4.7\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF08off \u4EC5\u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C500K \u4E0A\u4E0B\u6587 / 500K \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1Api-ai 1.2.0 \u5B98\u65B9\u76EE\u5F55\u786E\u8BA4\u6863\u4F4D\u4E0E\u5BB9\u91CF\uFF0C"\u4E0A\u6E38 404"\u4E0E"\u6863\u4F4D\u672A\u8BC1\u5B9E"\u4E24\u6761\u65E7\u8BB0\u5F55\u4F5C\u5E9F\uFF09\u3002grok-4.5 \u4F20 xhigh \u88AB\u9759\u9ED8\u6309 High \u5904\u7406\u7684\u8BF4\u660E\u89C1\u5176\u6761\u76EE\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:3e4,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low(\u9ED8\u8BA4) / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 30,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\uFF1AXHigh \u6863\u6309 pi-ai 1.2.0 \u76EE\u5F55\u79FB\u9664\u2014\u2014\u5B83\u81EA 4.6 \u8D77\u624D\u52A0\u5165\uFF1B\u5E26\u56FE\u8F93\u5165\uFF09\u3002grok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,maxTokens:16384,note:'Magistral\uFF08magistral-medium-latest\uFF09\uFF1A2026-10 \u6821\u51C6\u2014\u2014pi-ai 1.2.0 \u76EE\u5F55\u663E\u793A\u73B0\u5F79 magistral \u8D70 mistral-conversations \u534F\u8BAE\u5E76\u63A5\u53D7 effort\uFF08None / High \u4E24\u6863\uFF0C\u9ED8\u8BA4 None\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\uFF0C262,144 / 16,384\u3002\u65E9\u524D"\u8BE5\u7EBF\u65E0 effort \u53C2\u6570\u4E14\u5DF2\u5F03\u7528"\u7684\u8BB0\u5F55\u4F5C\u5E9F\u3002'},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-large-4","mistral-medium-2604","mistral-medium-latest","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF082026-10 \u6269\u5145\uFF09\uFF1ANone / High \u4E24\u6863\uFF0C\u5B98\u65B9 reasoning_effort \u679A\u4E3E\u5373 none/high\uFF1B\u73B0\u5F79\u578B\u53F7 mistral-large-4\uFF081M\uFF09\u3001mistral-medium-3.5\uFF082604/latest\uFF09\u3001mistral-small-2603\uFF08Small 4\uFF09\u7ECF\u5B83\u63A7\u5236\uFF0C\u5747\u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\uFF1Alarge-4 262,144 \u8F93\u51FA\u3001medium 262,144 \u8F93\u51FA\u3001small 256,000 \u8F93\u51FA\uFF08\u4E0A\u4E0B\u6587\u5747 262,144\uFF09\u3002\u975E\u63A8\u7406\u65E7\u6B3E\u89C1\u4E0B\u6761\u3002"},{id:"mistral-legacy",patterns:["mistral-large-2411","mistral-large-latest","mistral-large-2512","mistral-medium-2505","mistral-medium-2508","mistral-small-2506","mistral-nemo","devstral","ministral","codestral","pixtral","voxtral"],efforts:!1,input:["text","image"],note:"Mistral \u975E\u63A8\u7406\u7EBF\uFF082026-10 \u65B0\u589E\u6761\u76EE\uFF09\uFF1Alarge-2411/2512/latest\u3001medium-2505/2508\u3001small-2506\u3001nemo \u53CA devstral/ministral/codestral/pixtral/voxtral \u7B49\u4E13\u7528\u7EBF\u5747\u4E0D\u63A5\u53D7 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002\u591A\u6570\u73B0\u5F79\u6B3E\u5E26\u89C6\u89C9\uFF08large-2411 \u4E3A\u7EAF\u6587\u672C\uFF09\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash","glm-5.3-flashx"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-for-coding",patterns:["kimi-for-coding"],efforts:{low:"low",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:32768,note:"Kimi for Coding\uFF1AMoonshot \u7F16\u7801\u4E13\u7EBF\u8D70 anthropic-messages \u534F\u8BAE\u3001\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D Low / High / Max\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\u3002\u9AD8\u901F\u7248\uFF08-highspeed\uFF09\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m2",patterns:["minimax-m2"],efforts:!1,input:["text"],contextWindow:204800,maxTokens:131072,note:"MiniMax-M2 / M2.5\uFF08\u542B -highspeed\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\u3001\u65E0 effort \u53C2\u6570\uFF08M3 \u624D\u5F15\u5165 thinking \u53C2\u6570\uFF09\uFF0C\u7EAF\u6587\u672C\uFF0C204,800 / 131,072\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BM3 \u89C1\u4E0B\u6761\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,maxTokens:512e3,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 512,000 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u8865\u5BB9\u91CF\uFF09\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"},{id:"fireworks-ember",patterns:["ember-1"],efforts:{off:"none",low:"low",medium:"medium",high:"high",max:"max"},compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"Fireworks ember-1\uFF1Aanthropic-messages \u534F\u8BAE\u81EA\u9002\u5E94\u601D\u8003\uFF0C\u6863\u4F4D None(\u5173) / Low / Medium / High / Max\uFF08off \u663E\u5F0F none \u62FC\u5199\uFF09\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C1M \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"thinkingmachines-inkling",patterns:["inkling"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:524288,maxTokens:131072,note:"Thinking Machines Inkling\uFF1A\u5168\u6863 Minimal / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF0Coff \u663E\u5F0F none\uFF1B\u5E26\u56FE\u8F93\u5165\uFF0C512K \u4E0A\u4E0B\u6587 / 131,072 \u8F93\u51FA\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1Btogether \u4E2D\u7EE7\u4FA7 effort \u53C2\u6570\u672A\u5F00\u653E\uFF0C\u9700\u652F\u6301\u65B9\u8F6C\u53D1\uFF09\u3002"},{id:"antling-ring",patterns:["ring-2.6"],efforts:{high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,maxTokens:65536,note:"\u8682\u8681 Ling Ring-2.6-1T\uFF1A\u6863\u4F4D High / XHigh\uFF08off \u4EE5\u7701\u7565\u8868\u8FBE\uFF09\uFF1B262,144 / 65,536\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF09\u3002"},{id:"antling-ling",patterns:["ling-2.6"],efforts:!1,input:["text"],note:"\u8682\u8681 Ling-2.6\uFF08\u542B -flash\uFF09\uFF1A\u975E\u601D\u8003\u6A21\u578B\uFF0C\u65E0 effort \u63A7\u4EF6\uFF082026-10 \u6821\u51C6\u65B0\u589E\uFF1BRing-2.6 \u601D\u8003\u7EBF\u89C1\u4E0A\u6761\uFF09\u3002"}],Wo={off:null,low:"low",medium:"medium",high:"high"},_u={"openai-completions":Wo,"openai-responses":Wo,"anthropic-messages":Wo,deepseek:{off:"none",low:"low",high:"high",max:"max"}},Fu={low:"low",medium:"medium",high:"high"};function hn(e){return(e??"").toLowerCase().trim()}function Va(e){return e!==void 0&&/[a-z0-9]/.test(e)}function mn(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function Qa(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!Va(r)&&!Va(o)}function Go(e,t){let n=mn(e)+" "+mn(t??""),r;for(let o of Iu)for(let i of o.patterns){let a=mn(i),s=n.indexOf(a);for(;s>=0;){if(Qa(n,s,a.length)){(r===void 0||a.length>r.length)&&(r={entry:o,length:a.length});break}s=n.indexOf(a,s+1)}}return r?.entry}var Ku={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function qu(e){let t=hn(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let i=Ku[o.slice(-2).join(".")];if(i!==void 0)return i}}catch{}return"openai-completions"}var fr="openai-completions",Za="anthropic-messages";function Bo(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function Wu(e,t){let n=hn(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===Za){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n===fr)return delete r.forceAdaptiveThinking,Object.keys(r).length===0?void 0:r}function Bu(e,t){let n=hn(t.api);if(n===fr){let r=e.compat;return r!==void 0&&(r=Wu(r,n)??void 0),r===void 0&&!Bo(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&Bo(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===Za&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var Gu=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function Uo(e){if(hn(e.api)!==fr)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!Gu.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function Ya(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!Uo(t)?e:{...e,supportsDeveloperRole:!1}}var Xa={off:null,low:"low",medium:"medium",high:"high"},Uu=["vl","vision","omni","4o","pixtral","internvl"];function zo(e){let t=mn(e);for(let n of Uu){let r=mn(n),o=t.indexOf(r);for(;o>=0;){if(Qa(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function zu(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>Du.includes(n)))return t.includes("image")?["text","image"]:["text"]}function $e(e,t,n){let r=Go(e,t.displayName),o,i,a,s;r?.input!==void 0&&(o=r.input,i="knowledge"),r?.contextWindow!==void 0&&(a=r.contextWindow),r?.maxTokens!==void 0&&(s=r.maxTokens);let d=zu(n?.input);if(d!==void 0&&(o=d,i="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(a=n.contextLength),o===void 0){let h=zo(e);h!==void 0&&(o=h,i="heuristic")}let l={...o===void 0?{}:{input:o},...i===void 0?{}:{inputSource:i},...a===void 0?{}:{contextWindow:a},...s===void 0?{}:{maxTokens:s}},f=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...f,...l};if(r!==void 0){let h=Ya(Bu(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...h===void 0?{}:{compat:h},matched:!0,entryId:r.id,source:r.id,confidence:"high",...f,...l}}let m=qu(t),u=_u[m]??Fu,c=hn(t.api)===fr?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,p=c!==void 0&&Bo(t.baseURL)?{...c,thinkingTokenBudgetField:"thinking_token_budget"}:c,b=Ya(p,t,!0);return n?.reasoning===!0?{efforts:{...Xa},...Xa.medium!==void 0?{defaultEffort:"medium"}:{},...b===void 0?{}:{compat:b},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...f,...l}:{efforts:u,...u.medium!==void 0?{defaultEffort:"medium"}:{},...b===void 0?{}:{compat:b},matched:!1,source:"protocol:"+m,confidence:"low",...f,...l}}var ts="dsh-model-think-level.slider.efforts",jo="breSelectWired",ju=400;function $u(e){return e===void 0?Promise.resolve(void 0):new Promise(t=>{let n=!1,r=i=>{n||(n=!0,t(i))},o=setTimeout(()=>r(void 0),ju);e.then(i=>{clearTimeout(o),r(i)},()=>{clearTimeout(o),r(void 0)})})}function $o(e){return typeof e=="object"&&e!==null&&e.ok===!1}function Vo(e){if(!$o(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function xt(e,t){return`${e}/${t}`}function ns(){try{let e=window.localStorage.getItem(ts);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function Vu(e){try{window.localStorage.setItem(ts,JSON.stringify(e))}catch{}}function Yu(e,t,n){let r=ns();r[xt(e,t)]=n,Vu(r)}function Xu(e,t){return ns()[xt(e,t)]}function pr(e,t,n){let o=e.groups.find(i=>i.id===t)?.models.find(i=>i.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(i=>i.id)}function Ju(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function Qu(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function Zu(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function es(e,t,n,r,o){let i=pr(e,t,n);if(i.length===0)return;let a=xt(t,n),s=r.get(a);if(s!==void 0&&i.includes(s))return s;let d=await $u(o?.configuredEffort===void 0?void 0:o.configuredEffort(t,n));if(d!==void 0&&i.includes(d))return d;let l=Xu(t,n);if(l!==void 0&&i.includes(l))return l;let f=$e(n,{}).defaultEffort;if(f!==void 0&&i.includes(f))return f;let m=Ju(e,t,n);return m!==void 0&&i.includes(m)?m:Qu(i)}function rs(e,t){let n=e;if(n[jo]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,i=new Map,a=new Set,s=new Map,d=3,l=0,f=async c=>{let p=++l;if(c.reasoningEffort!==void 0){let v=await o.call(e,c);return!$o(v)&&Ke()&&(i.set(xt(c.provider,c.model),c.reasoningEffort),Yu(c.provider,c.model,c.reasoningEffort)),v}let b=e.store.getSnapshot();if(!Zu(b.current,c)){if(Ke()){let v=xt(c.provider,c.model);i.delete(v),a.add(v)}return o.call(e,c)}if(!Ke())return o.call(e,c);let h=await es(b,c.provider,c.model,i,t);if(l!==p)return;let x=e.store.getSnapshot(),S=x.current!==null&&x.current.provider===c.provider&&x.current.model===c.model;return!Ke()||h===void 0||!pr(x,c.provider,c.model).includes(h)?S?void 0:o.call(e,c):o.call(e,{...c,reasoningEffort:h})},m=()=>{let c=e.store.getSnapshot(),p=c.current;if(p===null||p.reasoningEffort!==void 0||!Ke())return;let b=xt(p.provider,p.model);if(a.has(b))return;if(pr(c,p.provider,p.model).length===0){a.add(b);return}a.add(b);let h=l;es(c,p.provider,p.model,i,t).then(async x=>{if(x===void 0){a.delete(b);return}if(!Ke()){a.delete(b);return}let S=e.store.getSnapshot(),v=S.current;if(l!==h||v===null||v.reasoningEffort!==void 0||xt(v.provider,v.model)!==b||!pr(S,v.provider,v.model).includes(x))return;let P=await o.call(e,{provider:v.provider,model:v.model,reasoningEffort:x});if($o(P))throw P}).catch(()=>{let x=(s.get(b)??0)+1;s.set(b,x),x<d&&(a.delete(b),m())})},u=e.store.subscribe(m);return m(),n[jo]=!0,e.select=f,()=>{delete n[jo],u(),r?e.select=o:delete n.select}}var K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function os(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function Gt(e,t){if(!K(e))return[];let n=e[t];return!K(n)||!Array.isArray(n.models)?[]:n.models.filter(K)}function kt(e,t){if(!K(e))return{};let n=e[t];if(!K(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,i=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:i}}var ut=(e,t)=>typeof e[t]=="boolean";function ef(e,t){if(Array.isArray(e)){for(let n of e)if(K(n)&&n.id===t)return n}}function tf(e){if(!K(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...Re(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...Re(e),reasoning:!0,source:"supported_parameters"};if(ut(e,"supports_reasoning"))return{...Re(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(ut(e,"supportsReasoning"))return{...Re(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(ut(e,"can_reason"))return{...Re(e),reasoning:e.can_reason,source:"can_reason"};if(ut(e,"reasoning"))return{...Re(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...Re(e),reasoning:!0,source:"reasoning_effort"};let o=K(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let i=o.thinking,a=K(i)&&typeof i.supported=="boolean"?i.supported:void 0,s=o.effort,d=K(s)&&typeof s.supported=="boolean"?s.supported:void 0;if(d===!0)return{...Re(e),reasoning:!0,source:"capabilities.effort.supported"};if(a===!0)return{...Re(e),reasoning:!0,source:"capabilities.thinking.supported"};if(a===!1)return{...Re(e),reasoning:!1,source:"capabilities.thinking.supported"};if(d===!1)return{...Re(e),reasoning:!1,source:"capabilities.effort.supported"}}return{...Re(e),reasoning:"unknown",source:null}}function Re(e){let t={},n=a=>{if(!Array.isArray(a))return;let s=a.filter(d=>typeof d=="string");return s.length>0?s.map(d=>d.toLowerCase()):[]},r=K(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let a=K(e.modalities)?e.modalities:void 0;o=n(a?.input)}if(o===void 0){let a=e.capabilities,s=d=>Array.isArray(d)&&d.some(l=>typeof l=="string"&&l.toLowerCase()==="vision");if(s(e.supported_features)||s(a))o=["image"];else if(K(a)){let d=[];for(let l of["image_input","video_input","pdf_input","file_input"]){let f=K(a[l])?a[l]:void 0;if(f===void 0||typeof f.supported!="boolean")continue;let m=l.replace(/_input$/,"");f.supported===!0?d.push(m):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(ut(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:ut(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(ut(e,"supports_images")||ut(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let i=e.context_length;if(typeof i=="number"&&Number.isFinite(i)&&i>0)t.contextLength=i;else{let s=(K(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof s=="number"&&Number.isFinite(s)&&s>0)t.contextLength=s;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let f=(K(e.limit)?e.limit:void 0)?.context;typeof f=="number"&&Number.isFinite(f)&&f>0&&(t.contextLength=f)}}}return t}function is(e,t){let n=ef(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:tf(n)}}function ke(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function hr(e){if(!K(e))return;let t=e.providers;return K(t)?t:void 0}function as(e,t){for(let n of[e?.user,e?.base]){let r=hr(n)?.[t];if(K(r)&&r.models!==void 0)return r.models}}function gr(e){return hr(e?.user)}function br(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function yr(e,t){let r=e.find(i=>i.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(i=>typeof i=="string");return o.length>0?o:void 0}function wr(e,t){let r=e.find(o=>o.id===t)?.compat;if(K(r))return{...r}}function vr(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function xr(e,t){let r=e.find(o=>o.id===t)?.[Ft];return typeof r=="string"&&r.length>0?r:void 0}var nf=3e4,Yo=new Map,mr=new Map;async function rf(e){let t=Yo.get(e);if(t!==void 0&&Date.now()-t.at<nf)return t.data;let n=mr.get(e);if(n!==void 0)return n;let r=(async()=>{try{let o=await fetch(`${wa}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!o.ok)return;let i=await o.json();return i?.ok?(Yo.set(e,{at:Date.now(),data:i.data}),i.data):void 0}catch{return}finally{mr.delete(e)}})();return mr.set(e,r),r}function Xo(){Yo.clear(),mr.clear()}async function of(e,t){let n=await rf(e);return n===void 0?{reasoning:"unknown",source:null}:is(n,t).signal}function kr(e,t=()=>ne(e),n,r,o,i){return{async suggest(a,s,d,l){let f=ke((await t()).namespace),m=kt(f,a),u={api:m.api??l?.api,baseURL:m.baseURL??l?.baseURL,displayName:d??m.displayName},c=f[a]===void 0?void 0:await of(a,s),p=$e(s,u,c);return p.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:p.efforts,...p.compat===void 0?{}:{compat:p.compat},...p.defaultEffort===void 0?{}:{defaultEffort:p.defaultEffort},...p.input===void 0?{}:{input:p.input},...p.inputSource===void 0?{}:{inputSource:p.inputSource},...p.contextWindow===void 0?{}:{contextWindow:p.contextWindow},...p.maxTokens===void 0?{}:{maxTokens:p.maxTokens},matched:p.matched,source:p.source,confidence:p.confidence,...p.endpoint===void 0?{}:{endpoint:p.endpoint}}}},commit(a,s,d){if(i?.()===!0){n?.(a,s,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(a,s,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(a,s){o?.(a,s)},stageEfforts(a,s,d,l,f,m){n?.(a,s,d,l,f,m)},async writeEfforts(a,s,d,l,f,m){if(r!==void 0)return r(a,s,{efforts:d,...l===void 0?{}:{compat:l},...f===void 0?{}:{input:f},...m===void 0?{}:{defaultEffort:m}}),{ok:!0,staged:!0};let c=(await gn(e,a,[{modelId:s,efforts:d,...l===void 0?{}:{compat:l},...f===void 0?{}:{input:f},...m===void 0?{}:{defaultEffort:m}}],t))[0]??{ok:!1,error:"no-result"};return c.ok?{ok:!0}:c.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:c.error??"conflict"}}}}async function gn(e,t,n,r=()=>ne(e),o){if(n.length===0)return[];let i=!1;for(let a=0;a<3;a++)try{let s=a===0?await r():await ne(e,{fresh:!0});if(s.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=as(s.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(K))return n.map(()=>({ok:!1,error:"invalid-models"}));let f=d.map(c=>c),m=[];for(let c of n){let p=f.findIndex(b=>b.id===c.modelId);if(p<0){m.push(c.modelId);continue}f[p]=af(f[p],c,i?void 0:c.compat)}if(m.length>0)return n.map(c=>m.includes(c.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let u=await e.settings.mutate(xe,[{op:"set",path:["providers",t,"models"],value:f}],s.namespace.revision);if(!u.ok){if(a===0&&u.error.code==="settings/conflict")continue;let c=u.error.code==="settings/rejected"&&os(u.error.message);if(!i&&c&&n.some(p=>p.compat!==void 0)){i=!0;continue}return n.map(()=>({ok:!1,error:u.error.message}))}return n.map(()=>({ok:!0}))}catch(s){return n.map(()=>({ok:!1,error:s instanceof Error?s.message:String(s)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function af(e,t,n){let r={...e},o=t.efforts!=="keep",i=t.efforts==="keep"?void 0:t.efforts;if(o)if(i===void 0)delete r.reasoningEfforts,r[Ae]=!0;else if(delete r[Ae],delete r[_t],i===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...i};let s={...K(e.compat)?e.compat:{},...n??{}};Object.keys(s).length>0&&(r.compat=s)}return t.input!==void 0&&(t.input===null?(delete r.input,r[rt]=!0):(delete r[rt],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[Ft]:r[Ft]=t.defaultEffort),r}function Jo(e,t){for(let n of[e?.user,e?.base]){let r=hr(n)?.[t];if(!K(r))continue;let o=r.headers;if(o===void 0)continue;if(!K(o))return;let i={};for(let[a,s]of Object.entries(o))typeof s=="string"&&(i[a]=s);return i}}async function bn(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};let r=!1;for(let o=0;o<2;o+=1)try{let i=o===0?await ne(e):await ne(e,{fresh:!0});if(i.namespace===void 0)return{ok:!1,error:"no-namespace"};if(i.writable!==!0)return{ok:!1,error:"read-only"};if(!He(i.namespace,t)){r=!0;continue}let a=await e.settings.mutate(xe,[{op:"set",path:["providers",t,"headers"],value:{...n}}],i.namespace.revision);if(!a.ok){if(o===0&&a.error.code==="settings/conflict")continue;return{ok:!1,error:a.error.message}}return{ok:!0}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}return r?{ok:!1,error:"no-route"}:{ok:!1,error:"conflict"}}function He(e,t){if(Object.prototype.hasOwnProperty.call(ke(e),t))return!0;for(let n of[e?.user,e?.base]){let r=hr(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function ne(e,t={}){let n=t.fresh===!0?void 0:sf(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(i=>i.ns===xe),writable:r.value.writable,source:"wire"}:{namespace:void 0,writable:!1,source:"wire"}}function sf(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:xe,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0,source:"scope"}}var Qo=new Map;function ss(e){let t=Qo,n=!1,r,o=0,i=new Set,a=()=>{for(let d of[...i])d()},s=()=>{if(n)return Promise.resolve();if(r!==void 0)return r;let d=o;return r=ne(e,{fresh:!0}).then(l=>{if(d!==o||l.namespace===void 0)return;let f=new Map;for(let[m,u]of Object.entries(ke(l.namespace))){let c=new Map,p=Array.isArray(u.models)?u.models:[];for(let b of p){if(!K(b)||typeof b.id!="string"||!Array.isArray(b.input))continue;let h=b.input.filter(x=>typeof x=="string");h.length>0&&c.set(b.id,h)}c.size>0&&f.set(m,c)}t=f,n=!0,a()}).catch(()=>{}).finally(()=>{d===o&&(r=void 0)}),r};return{getSnapshot:()=>t,subscribe(d){return i.add(d),()=>{i.delete(d)}},load:s,invalidate(){o+=1,n=!1,r=void 0,i.size>0&&s()}}}var df=1e4;function ds(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function lf(e){return e.current}function ls(e,t){let n=lf(t),r=e.findIndex(s=>s.id===n?.reasoningEffort);if(r>=0)return r;let i=t.groups.find(s=>s.id===n?.provider)?.models.find(s=>s.id===n?.model)?.reasoning?.defaultEffort,a=i===void 0?-1:e.findIndex(s=>s.id===i);return a>=0?a:Math.floor((e.length-1)/2)}function Er(e){return e.models??[]}function ft(e){let t=e;return t.name??t.label??t.title??e.id}function cf(){let[e,t]=(0,E.useState)(null),n=(0,E.useRef)(0);(0,E.useEffect)(()=>()=>{window.clearTimeout(n.current)},[]);let r=(0,E.useCallback)(()=>{window.clearTimeout(n.current),t(null)},[]),o=(0,E.useCallback)((i,a)=>{window.clearTimeout(n.current);let s=i.currentTarget;s.scrollWidth<=s.clientWidth+1||(n.current=window.setTimeout(()=>{t({target:s,text:a})},300))},[]);return{tip:e,onEnter:o,onLeave:r}}function uf({state:e}){if(typeof document>"u")return null;let t=e.target.getBoundingClientRect(),n=Math.max(12,Math.min(t.right,window.innerWidth-12));return(0,us.createPortal)((0,E.createElement)("div",{className:"bre-tip",role:"tooltip",style:{top:Math.min(t.bottom+6,window.innerHeight-40),right:Math.max(12,window.innerWidth-n)}},e.text),document.body)}var cs=new Map;function ff(e,t){let n=t??e.input;if(Array.isArray(n)&&n.length>0)return n.includes("image");let r=JSON.stringify([e.id,e.name]),o=cs.get(r);if(o!==void 0)return o;let i=Go(e.id,e.name)?.input,a=i!==void 0?i.includes("image"):(zo(e.id)??[]).includes("image");return cs.set(r,a),a}function pf(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function mf(e){return(0,E.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,E.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,E.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function hf(e){return(0,E.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,E.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}var gf=["#22c55e","#a3e635","#eab308","#f97316","#ef4444"],qg=gf.map(e=>[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]);function bf(e,t,n){let r=[];return ff(e,n)&&r.push((0,E.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},mf(t("tagVision")))),pf(e)&&r.push((0,E.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},hf(t("tagThinking")))),r.length===0?null:(0,E.createElement)("span",{className:"bre-option-tags"},...r)}function fs(e){let{directory:t,t:n,configuredInputs:r}=e,o=(0,E.useSyncExternalStore)(y=>t.store.subscribe(y),()=>t.store.getSnapshot()),i=(0,E.useSyncExternalStore)(y=>r?.subscribe(y)??(()=>{}),()=>r?.getSnapshot()??Qo),a=ds(o),[s,d]=(0,E.useState)(()=>{let y=t.store.getSnapshot(),H=ds(y);return H[ls(H,y)]?.id??""}),[l,f]=(0,E.useState)(""),[m,u]=(0,E.useState)(null),[c,p]=(0,E.useState)(!1),[b,h]=(0,E.useState)(null),x=(0,E.useRef)(null),S=(0,E.useRef)(""),v=(0,E.useRef)(!1),P=o.current!==null&&a.length>=2,D=c,z=b??o.error,oe=t.select,k=(0,E.useCallback)(()=>setTimeout(()=>{v.current&&(v.current=!1,p(!1),h(n("sliderCommitSlow")))},df),[n]);(0,E.useLayoutEffect)(()=>{if(v.current||ie.current)return;let y=ls(a,o),H=a[y]?.id??"";S.current=H,d(te=>te===H?te:H),h(null)},[P,a,o]),(0,E.useEffect)(()=>{t.load().catch(()=>{})},[t]),(0,E.useEffect)(()=>{r?.load().catch(()=>{})},[r]);let M=o.current,W=o.groups.find(y=>y.id===M?.provider),R=W?.models.find(y=>y.id===M?.model)?.name??(M===null?n("triggerFallback"):M.model),N=M===null?"":ft(W??{id:M.provider}),B=a.find(y=>y.id===s)?.name??n("effortDefault"),O=(0,E.useSyncExternalStore)(sr,Po),U=(0,E.useSyncExternalStore)(lr,Ia),X=(0,E.useSyncExternalStore)(ur,Ba),ce=o.groups.filter(y=>Er(y).length>0&&!U.includes(y.id)).map(y=>y.id),j=Wt(Do(ce),O),re=m!==null&&j.includes(m)?m:M!==null&&j.includes(M.provider)?M.provider:j[0]??null,J=l.trim().toLowerCase(),$=J!=="",de=$?j.flatMap(y=>qo(Er(o.groups.find(H=>H.id===y)),X[y]??[]).filter(H=>(H.name??H.id).toLowerCase().includes(J)||H.id.toLowerCase().includes(J)).map(H=>({provider:y,choice:H}))):[],fe=$?de:re===null?[]:qo(Er(o.groups.find(y=>y.id===re)),X[re]??[]).map(y=>({provider:re,choice:y})),F=M===null?"":M.provider+"/"+M.model,G=(0,E.useCallback)(()=>{let y=x.current?.closest('[role="menu"], [role="group"]');y!=null&&(y.tabIndex=-1,y.focus({preventScroll:!0}))},[]),g=(0,E.useCallback)(async(y,H)=>{if(v.current)return;let te=t.store.getSnapshot().current;if($&&f(""),te!==null&&te.provider===y&&te.model===H)return;v.current=!0,G(),p(!0),h(null);let he=k();try{let ge=await oe({provider:y,model:H}),je=Vo(ge);if(je!==void 0)throw new Error(je)}catch(ge){h(ge instanceof Error?ge.message:String(ge))}finally{clearTimeout(he),v.current=!1,p(!1)}},[k,t,G,$,oe]),L=(0,E.useCallback)(async y=>{if(v.current||y===o.current?.reasoningEffort&&o.status!=="error")return;v.current=!0;let H=S.current;G(),p(!0),h(null),d(y);let te=k();try{let he=o.current;if(he===null)throw new Error(n("sliderNoCurrent"));let ge=await oe({provider:he.provider,model:he.model,reasoningEffort:y}),je=Vo(ge);if(je!==void 0)throw new Error(je);let w=t.store.getSnapshot(),ue=a.find(ye=>ye.id===w.current?.reasoningEffort)?.id??y;S.current=ue,d(ue)}catch(he){S.current=H,d(H),h(he instanceof Error?he.message:String(he))}finally{clearTimeout(te),v.current=!1,p(!1)}},[k,t,G,a,oe,o.current,o.status,n]),_=(0,E.useRef)(null),V=(0,E.useRef)(null),Q=(0,E.useRef)(null),ie=(0,E.useRef)(!1),me=(0,E.useRef)(null),Se=(0,E.useRef)(null),Le=(0,E.useRef)(null),[tt,Pt]=(0,E.useState)(null),[Vn,ve]=(0,E.useState)(null),Eo=Math.max(0,a.findIndex(y=>y.id===s)),ze=tt??Eo,Dt=(Vn??(a.length>1?ze/(a.length-1):0))*100,yt=y=>{let H=_.current;if(H===null)return 0;let te=H.getBoundingClientRect();return te.width<=0?0:Math.min(1,Math.max(0,(y-te.left)/te.width))},_e=y=>a.length>1?Math.round(y*(a.length-1)):0,nt=y=>{Se.current=y;let H=y*100;V.current!==null&&(V.current.style.clipPath=`inset(0 ${100-H}% 0 0)`),Q.current!==null&&(Q.current.style.left=`${H}%`)},Yn=y=>{if(a.length===0)return;let H=yt(y);Le.current===null&&(Le.current=requestAnimationFrame(()=>{Le.current=null,ie.current&&Se.current!==null&&nt(Se.current)})),Se.current=H;let te=_e(H);te!==me.current&&(me.current=te,Pt(te),ve(H))},Xn=()=>{me.current=null,Se.current=null,Le.current!==null&&(cancelAnimationFrame(Le.current),Le.current=null),Pt(null),ve(null)},To=y=>{if(P){if(y.preventDefault(),ie.current=!0,typeof y.currentTarget.setPointerCapture=="function")try{y.currentTarget.setPointerCapture(y.pointerId)}catch{}me.current=_e(yt(y.clientX)),Yn(y.clientX),Pt(me.current),ve(Se.current)}},Jn=y=>{ie.current&&Yn(y.clientX)},Qn=y=>{if(!ie.current)return;if(ie.current=!1,typeof y.currentTarget.releasePointerCapture=="function"&&y.currentTarget.hasPointerCapture?.(y.pointerId)===!0)try{y.currentTarget.releasePointerCapture(y.pointerId)}catch{}let H=_e(yt(y.clientX)),te=a[H];if(te===void 0){Xn();return}L(te.id).finally(Xn)},Mo=y=>{if(!P)return;let H;if(y.key==="ArrowRight"||y.key==="ArrowUp"?H=Math.min(a.length-1,ze+1):y.key==="ArrowLeft"||y.key==="ArrowDown"?H=Math.max(0,ze-1):y.key==="Home"?H=0:y.key==="End"&&(H=a.length-1),H===void 0)return;y.preventDefault();let te=a[H];te!==void 0&&L(te.id)},{tip:cn,onEnter:It,onLeave:un}=cf(),Zn=(0,E.createElement)("div",{className:"bre-menu-head"},(0,E.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,E.createElement)("span",{className:"bre-menu-cur"},(0,E.createElement)("span",{className:"bre-menu-name","aria-label":M===null?R:N+" \xB7 "+R,onMouseEnter:y=>{It(y,M===null?R:N+" \xB7 "+R)},onMouseLeave:un},R),N===""?null:(0,E.createElement)("span",{className:"bre-menu-prov"},N))),So=(0,E.createElement)("div",{className:"bre-menu-search"},(0,E.createElement)("div",{className:"bre-menu-search-box"},(0,E.createElement)("span",{className:"bre-menu-search-icon","aria-hidden":!0},(0,E.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,E.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,E.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,E.createElement)("input",{type:"text",className:"bre-menu-search-input",role:"searchbox",placeholder:n("modelSearchPlaceholder"),"aria-label":n("modelSearchPlaceholder"),value:l,spellCheck:!1,autoComplete:"off",onChange:y=>{f(y.currentTarget.value)}}),l===""?null:(0,E.createElement)("button",{type:"button",className:"bre-menu-search-clear",title:n("modelSearchClear"),"aria-label":n("modelSearchClear"),onClick:()=>{f("")}},(0,E.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,E.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))))),Lo=(0,E.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...j.map(y=>{let H=o.groups.find(te=>te.id===y);return(0,E.createElement)("button",{key:y,type:"button",className:"bre-provider"+(y===re?" is-open":"")+(y===M?.provider?" is-current":""),disabled:D,"aria-expanded":y===re,onMouseLeave:un,onClick:()=>{u(y),f("")}},(0,E.createElement)("span",{className:"bre-option-name","aria-label":ft(H),onMouseEnter:te=>{It(te,ft(H))}},ft(H)),(0,E.createElement)("span",{className:"bre-provider-count"},String(Er(H).length)))}),...j.length===0?[(0,E.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),Ao=(0,E.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...fe.length===0?[(0,E.createElement)("div",{key:"no-models",className:"bre-empty"},n($?"modelSearchNoMatches":"sliderNoCurrent"))]:fe.map(({provider:y,choice:H})=>{let te=y+"/"+H.id,he=te===F,ge=H.name??H.id,je=$?ft(o.groups.find(w=>w.id===y))+" \xB7 "+ge:ge;return(0,E.createElement)("button",{key:te,type:"button",className:"bre-option"+(he?" is-active":""),disabled:D,"aria-pressed":he,onMouseLeave:un,onClick:()=>{g(y,H.id)}},(0,E.createElement)("span",{className:"bre-option-name","aria-label":je,onMouseEnter:w=>{It(w,je)}},$?(0,E.createElement)("span",{className:"bre-option-origin"},ft(o.groups.find(w=>w.id===y))+" \xB7 "):null,ge),bf(H,n,i.get(y)?.get(H.id)))})),er=(0,E.createElement)("div",{className:"bre-menu-foot"},P?(0,E.createElement)("div",{className:"bre-menu-slider"},(0,E.createElement)("div",{className:"bre-effort-slider-head","aria-hidden":!0},(0,E.createElement)("span",{className:"bre-effort-slider-head-label"},n("effortRowLabel")),(0,E.createElement)("span",{className:"bre-effort-slider-head-value"},a[ze]?.name??B)),(0,E.createElement)("div",{className:"bre-effort-slider",ref:_,role:"slider",tabIndex:0,"aria-label":n("effortRowLabel"),"aria-valuemin":0,"aria-valuemax":a.length-1,"aria-valuenow":ze,"aria-valuetext":a[ze]?.name,"aria-disabled":D||void 0,"data-bre-dragging":tt===null?void 0:"true",onPointerDown:To,onPointerMove:Jn,onPointerUp:Qn,onPointerCancel:Qn,onKeyDown:Mo},(0,E.createElement)("span",{className:"bre-effort-slider-fill",ref:V,style:{clipPath:`inset(0 ${100-Dt}% 0 0)`}}),...a.map((y,H)=>H===ze?null:(0,E.createElement)("span",{key:"tick-"+y.id,className:"bre-effort-slider-tick",style:{left:a.length>1?`${H/(a.length-1)*100}%`:"0%"}})),(0,E.createElement)("span",{className:"bre-effort-slider-thumb",ref:Q,style:{left:`${Dt}%`}})),(0,E.createElement)("div",{className:"bre-effort-slider-labels","aria-hidden":!0},...a.map((y,H)=>(0,E.createElement)("span",{key:y.id,className:"bre-effort-slider-label"+(H===0?" is-first":"")+(H===a.length-1?" is-last":"")+(H===ze?" is-on":""),style:{left:a.length>1?`${H/(a.length-1)*100}%`:"0%"}},y.name)))):(0,E.createElement)("span",{className:"bre-row-value is-muted"},n("sliderNoLevels")));return(0,E.createElement)("div",{className:"bre-slider-body",ref:x},(0,E.createElement)("div",{className:"bre-card"},Zn,So,(0,E.createElement)("div",{className:"bre-panel bre-panel-models"},Lo,Ao),er),z===null?null:(0,E.createElement)("div",{className:"bre-model-error",role:"status"},z),cn===null?null:(0,E.createElement)(uf,{key:"tip",state:cn}))}var ae=require("react"),ms='section[role="group"]',ei='button[role="menuitemradio"]';function hs(e){return e.querySelector(ms)!==null}function Zo(e){return Array.from(e.querySelectorAll(ei)).filter(t=>!t.disabled&&t.style.display!=="none")}function yf(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function ps(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let l=n.get(d);l!==void 0&&(d.style.display=l,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean),a=Array.from(e.querySelectorAll(ms)),s=0;if(i.length===0){for(let d of[...n.keys()])o(d);for(let d of a)s+=d.querySelectorAll(ei).length;return s}for(let d of a){let l=yf(d),f=Array.from(d.querySelectorAll(ei)),m=0;for(let u of f){let c=(u.getAttribute("title")??"").toLowerCase(),p=(u.textContent??"").toLowerCase(),b=`${l} ${c} ${p}`;i.every(h=>b.includes(h))?(o(u),m+=1):r(u)}m>0?(o(d),s+=m):r(d)}return s}function gs({menu:e,t}){let[n,r]=(0,ae.useState)(""),[o,i]=(0,ae.useState)(0),a=(0,ae.useRef)(null),s=(0,ae.useRef)(""),d=(0,ae.useRef)(new Map),l=(0,ae.useCallback)(c=>{s.current=c;let p=ps(e,c,d.current);i(p)},[e]);(0,ae.useEffect)(()=>()=>{ps(e,"",d.current)},[e]),(0,ae.useEffect)(()=>{let c=new MutationObserver(()=>{s.current.trim().length!==0&&l(s.current)});return c.observe(e,{childList:!0,subtree:!0}),()=>{c.disconnect()}},[e,l]),(0,ae.useEffect)(()=>{let c=p=>{if(s.current.trim().length===0)return;let b=p.key;if(!(b==="ArrowDown"||b==="ArrowUp")&&!(b==="Home"||b==="End"||b==="PageUp"||b==="PageDown")||p.target===a.current||p.target instanceof Node&&!e.contains(p.target))return;let S=Zo(e);if(S.length===0)return;let v=S.findIndex(D=>D===document.activeElement),P;b==="Home"||b==="PageUp"?P=0:b==="End"||b==="PageDown"?P=S.length-1:b==="ArrowDown"?P=v===-1?0:(v+1)%S.length:P=v===-1?S.length-1:(v-1+S.length)%S.length,p.preventDefault(),p.stopPropagation(),S[P]?.focus()};return e.addEventListener("keydown",c,!0),()=>{e.removeEventListener("keydown",c,!0)}},[e]);let f=c=>{let p=c.key;if(p==="ArrowDown"){c.preventDefault(),c.stopPropagation(),Zo(e)[0]?.focus();return}if(n.trim().length>0&&(p==="ArrowUp"||p==="Home"||p==="PageUp"||p==="End"||p==="PageDown")){let b=Zo(e);b.length>0&&(c.preventDefault(),c.stopPropagation(),b[p==="ArrowUp"||p==="End"||p==="PageDown"?b.length-1:0]?.focus());return}p==="Escape"&&n.length>0&&(c.preventDefault(),c.stopPropagation(),r(""),l(""))},m=()=>{r(""),l(""),a.current?.focus({preventScroll:!0})},u=o===0&&n.trim().length>0;return(0,ae.createElement)("div",{className:"bre-model-search-box"+(u?" has-empty":""),"data-bre-search":"1"},(0,ae.createElement)("div",{className:"bre-search-input-wrapper"},(0,ae.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,ae.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,ae.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,ae.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,ae.createElement)("input",{ref:a,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:c=>{let p=c.currentTarget.value;r(p),l(p)},onKeyDown:f}),n.length>0?(0,ae.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:m},(0,ae.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,ae.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),u?(0,ae.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var Tr=require("react"),bs=require("react-dom"),ys=require("react-dom/client");function We(){return document.body}function ot(e,t,n){let r=(0,ys.createRoot)(e);return n?.sync===!0?(0,bs.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Ce(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var qe=class extends Tr.Component{constructor(){super(...arguments);Fe(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,Tr.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var wf="conversation.input.model";function ws(e){return e.querySelector("[data-composer-card]")??void 0}function ti(e){return e.querySelector(`[data-slot="${wf}"]`)??void 0}function vs(e){let t=ti(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function ni(e){if(e==null)return!1;let t=e.getAttribute("role");return t==="menu"||t==="group"}function ri(e){return e.getAttribute("role")==="group"}function xs(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);return ni(r)?r:void 0}function oi(e=document){let t=ws(e);if(t===void 0)return;for(let r of vs(t)){let o=xs(r,e);if(o!==void 0)return o}let n=ti(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"], [role="group"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]')&&ni(r)&&!(r.getAttribute("role")==="group"&&r.querySelector('[role="menuitemradio"], section[role="group"]')===null))return r}function ii(e=document){let t=ws(e);if(t===void 0)return;let n=ti(t),r=vs(t),o=r[0];if(o!==void 0){for(let i of r)if(xs(i,e)!==void 0)return i;for(let i of r)if(ni(i.nextElementSibling))return i;return n===void 0?r.at(-1):o}}function ks(){return oi()}function Es(){return ii()}var vf=()=>{(0,Ts.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ms(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:i,directory:a}=e,s,d,l,f,m,u,c,p,b=()=>{p?.removeAttribute("data-bre-provider"),p=void 0},h=()=>{let T=n();p!==void 0&&p!==T&&b();let R=u?.store.getSnapshot(),N=R?.current;if(T===void 0||N===null||N===void 0){T===p&&b();return}let B=R?.groups.find(U=>U.id===N.provider),O=B===void 0?N.provider:ft(B);if(O.trim()===""){T===p&&b();return}T.dataset.breProvider=O,p=T},x=()=>{let T=a();T!==u&&(c?.(),c=void 0,u=T,T!==void 0&&(c=T.store.subscribe(h))),h()},S=()=>{Ce(l),l=void 0},v=new Map,P=()=>{for(let[T,R]of v)T.style.display=R;v.clear()},D=T=>T.getAttribute("aria-hidden")!=="true"||T.childElementCount>0?!1:(T.textContent??"").trim()==="",z=(T,R)=>{for(let O of Array.from(v.keys()))(!O.isConnected||O.parentElement!==T)&&v.delete(O);let N=[];for(let O of Array.from(T.children))O!==R&&(D(O)||N.push(O));let B=document.activeElement;B!==null&&B!==R&&!R.contains(B)&&N.some(O=>O.contains(B))&&(T.tabIndex=-1,T.focus({preventScroll:!0}));for(let O of N)v.has(O)||v.set(O,O.style.display),O.style.display!=="none"&&(O.style.display="none")},oe=T=>{let R=T.querySelector('section[role="group"]'),N=R?.parentElement,B=N!=null&&N.parentElement===T?N:R;if(l===void 0){let O=document.createElement("div");O.dataset.plugin=pe,O.dataset.breSearch="1",T.insertBefore(O,B),l=ot(O,(0,yn.createElement)(qe,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,yn.createElement)(gs,{menu:T,t:r}))}),{sync:!0});return}if(l.wrapper.parentElement!==T){T.insertBefore(l.wrapper,B);return}B!==null&&l.wrapper.nextSibling!==B&&T.insertBefore(l.wrapper,B)},k=T=>{if(!i()){Ce(s),s=void 0,d=void 0,T.classList.remove("bre-model-menu-host"),P();for(let U of Array.from(T.children))U.getAttribute("role")==="menuitem"&&(U.style.display="");return}let R=a();if(R===void 0)return;if(s!==void 0&&d!==R&&(Ce(s),s=void 0,d=void 0),s===void 0){d=R;let U=document.createElement("div");U.dataset.plugin=pe,U.dataset.breSlider="1",T.insertBefore(U,T.firstChild),s=ot(U,(0,yn.createElement)(qe,{fallbackText:r("renderFailed"),children:o(()=>(0,yn.createElement)(fs,{directory:R,configuredInputs:e.configuredInputs,t:r}))}),{sync:!0})}else(s.wrapper.parentElement!==T||T.firstChild!==s.wrapper)&&T.insertBefore(s.wrapper,T.firstChild);T.classList.add("bre-model-menu-host");let N=Array.from(T.children).filter(U=>U.getAttribute("role")==="menuitem"),B=s.wrapper;if(ri(T)){B.style.display="",z(T,B);return}if(P(),Array.from(T.querySelectorAll('[role="menuitemradio"]')).some(U=>!B.contains(U)))s.wrapper.contains(document.activeElement)&&(T.tabIndex=-1,T.focus({preventScroll:!0})),s.wrapper.style.display="none";else{s.wrapper.style.display="";for(let U of N)U.style.display="none"}};return{reconcile:()=>{x();let T=t();if(T===void 0){s!==void 0&&(i()?s.wrapper.remove():(Ce(s),s=void 0,d=void 0)),S(),f=void 0,m=void 0,P();return}let R=ri(T),N=R&&i(),B=!R&&hs(T);B?oe(T):S(),k(T),(B!==f||N!==m)&&(f=B,m=N,(B||N||i())&&vf())},dispose:()=>{c?.(),c=void 0,u=void 0,b(),Ce(s),s=void 0,d=void 0,S(),P(),f=void 0,m=void 0}}}var xf=350;function Ss(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let s=r;return n??(n=ne(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let l=new Map;for(let[f,m]of Object.entries(ke(d.namespace))){let u=Array.isArray(m.models)?m.models:[];for(let c of u){if(typeof c!="object"||c===null||Array.isArray(c))continue;let p=c.id,b=c[Ft];typeof p=="string"&&typeof b=="string"&&b.length>0&&l.set(`${f}/${p}`,b)}}s===r?t=l:n=void 0}).catch(()=>{s===r&&(n=void 0)})),n};return{of:async(s,d)=>{if(t===void 0){let l=o();await new Promise(f=>{let m=!1,u=()=>{m||(m=!0,f())},c=setTimeout(u,xf);l.then(()=>{clearTimeout(c),u()},()=>{clearTimeout(c),u()})})}return t?.get(`${s}/${d}`)},invalidate:()=>{r+=1,t=void 0,n=void 0}}}function kf(e){let t=e.input;return Array.isArray(t)&&t.length>0}function ai(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,i=n.modalities!==!1;if(!K(e))return;let a={};for(let s of Object.keys(e)){if(!t(s))continue;let d=e[s],l=K(d)&&Array.isArray(d.models)?d.models:void 0;if(l===void 0||l.length===0||!l.every(K))continue;let f=l,m=[],u=!1;for(let c of f){let p=c.reasoningEfforts!==void 0||c[Ae]===!0,b=kf(c)||c[rt]===!0;if((p||!o)&&(b||!i)){let z=Ef(c,e,s);z!==void 0?(u=!0,m.push(z)):m.push(c);continue}let h=typeof c.id=="string"?c.id:"";if(h.length===0){m.push(c);continue}let x=kt(e,s),S=typeof c.name=="string"?c.name:void 0,v=$e(h,{...x,displayName:S??x.displayName});if(v.efforts===void 0){m.push(c);continue}let P={...c},D=!1;if(!p&&o&&(D=!0,P.reasoningEfforts=v.efforts,P[_t]=r,v.compat!==void 0)){let z=K(c.compat)?c.compat:{};P.compat={...z,...v.compat}}if(!b&&i&&v.input!==void 0&&(D=!0,P.input=[...v.input]),!D){m.push(c);continue}u=!0,m.push(P)}u&&(a[s]={models:m})}return Object.keys(a).length===0?void 0:{providers:a}}function Ef(e,t,n){if(!K(e.reasoningEfforts)||e[Ae]===!0)return;let r=e.compat,o=K(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&Uo(kt(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function Ls(e){let t,n=0,r=()=>{if(t!==void 0)return t;let i=(async()=>{try{let a=await fetch(xa,{method:"GET"});if(!a.ok)return;let s=await a.json();return s?.ok!==!0?void 0:{autofill:s.data?.autofill!==!1,modalityAutofill:s.data?.modalityAutofill!==!1}}catch{return}})().then(a=>(a===void 0&&t===i&&(t=void 0),a??{autofill:!0,modalityAutofill:!0}));return t=i,i},o=async()=>{let i=n;try{let a=await r();if(i!==n||!a.autofill)return;let s=await ne(e.api),d=s.namespace;if(i!==n||d===void 0||s.writable!==!0)return;let l=gr(d);if(l===void 0||ai(l,()=>!0,{modalities:a.modalityAutofill},d.revision)===void 0)return;let m=s.source==="scope"?await ne(e.api,{fresh:!0}):s,u=m.namespace;if(i!==n||u===void 0||m.writable!==!0)return;let c=gr(u);if(c===void 0)return;let p=ai(c,()=>!0,{modalities:a.modalityAutofill},u.revision);if(p===void 0)return;let b=p.providers,h=Object.entries(b).map(([S,v])=>({op:"set",path:["providers",S,"models"],value:v.models})),x=await e.api.settings.mutate(xe,h,u.revision);x.ok||console.error(`[bre] idle autofill refused: ${x.error.message}`)}catch(a){console.error(`[bre] idle autofill failed: ${a instanceof Error?a.message:String(a)}`)}};return{run:()=>{o()},invalidate:()=>{n+=1,t=void 0}}}var ua=require("react"),tu=require("react-dom"),nu=require("react-dom/client");var Y=require("react");var pt=Ja;function Et(e){let t={};for(let n of pt){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function Ut(e){let t=!1,n=!1,r={};for(let o of pt){let i=e[o];if(!i.on)continue;if(o==="off"){t=!0;let s=i.wire.trim();r.off=s.length===0?null:s;continue}n=!0;let a=i.wire.trim();r[o]=a.length===0?o:a}return n?r:t?!1:void 0}function wn(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=pt.filter(o=>e[o]!==void 0),r=pt.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function As(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var si="bre:auto-effort",Rs=Promise.resolve();function Hs(e){Rs=Rs.then(e,e).then(()=>{},()=>{})}function Cs(e,t=document){t.dispatchEvent(new CustomEvent(si,{detail:{route:e}}))}function Os(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(si,n),()=>{t.removeEventListener(si,n)}}var Tf=new Intl.NumberFormat("en-US"),Mf=/^(\d+(?:\.\d+)?)([km])?$/i;function Ve(e){let t=e.replace(/[,_\s]/g,"");if(t==="")return;let n=Mf.exec(t);if(n===null)return;let r=n[2]===void 0?1:n[2].toLowerCase()==="m"?1e6:1e3,o=Math.round(Number(n[1])*r);return Number.isFinite(o)&&o>0?o:void 0}function Be(e){return e===void 0?"":Tf.format(e)}var A=require("react/jsx-runtime"),Sf=["M3.4 4.2h9.2","M8 4.2v8.2","M5.9 12.4h4.2"],Lf=["M4.4 3.4h7.2a1.9 1.9 0 0 1 1.9 1.9v5.4a1.9 1.9 0 0 1-1.9 1.9H4.4a1.9 1.9 0 0 1-1.9-1.9V5.3a1.9 1.9 0 0 1 1.9-1.9Z","M6.2 7.2a.9.9 0 1 0 0-1.8.9.9 0 0 0 0 1.8Z","M2.9 11.2 6.1 8.4l2.1 1.9 1.8-1.5 2.7 2.4"],Af=["M8 3.2 13.6 12.8H2.4L8 3.2Z","M8 6.9v2.5","M8 11.3h.01"],Rf=["M8 2.6 9.1 6.4 12.9 7.5 9.1 8.6 8 12.4 6.9 8.6 3.1 7.5 6.9 6.4Z","M12.3 2.4v1.9M11.35 3.35h1.9"],Hf=["M4.5 6.5 8 10 11.5 6.5"],Cf=["M6.5 4.5 10 8 6.5 11.5"];function vn({paths:e}){return(0,A.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,A.jsx)("path",{d:t},t))})}function Tt(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function Sr(e){return e.declared?e.image?["text","image"]:["text"]:null}function Mr(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function di(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function Lr(e){let t=e.appliedCompat;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&t?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(t={...t??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...t===void 0?{}:{compat:t},...e.input===void 0?{}:{input:e.input},...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function Ar({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:i,effortsUnset:a=!1,input:s,compat:d,defaultEffort:l,index:f,staged:m=!1,officialInputTypes:u=!1,onCoverageChange:c,api:p,readOnly:b,t:h}){let[x,S]=(0,Y.useState)(()=>Et(i)),[v,P]=(0,Y.useState)(()=>Tt(s)),[D,z]=(0,Y.useState)(()=>i!==!1),oe=(0,Y.useRef)(c);oe.current=c,(0,Y.useEffect)(()=>{oe.current?.(D)},[D]);let[k,M]=(0,Y.useState)(()=>l??""),[W,T]=(0,Y.useState)(!1),[R,N]=(0,Y.useState)(void 0),[B,O]=(0,Y.useState)(void 0),[U,X]=(0,Y.useState)(""),[ce,j]=(0,Y.useState)("low"),[re,J]=(0,Y.useState)(()=>pt.some(w=>x[w].on&&x[w].wire.trim()!==(w==="off"?"":w))),$=(0,Y.useRef)(void 0),[de,fe]=(0,Y.useState)(void 0),F=(0,Y.useRef)(void 0);F.current===void 0&&(F.current=p.readCapacities?.()??{});let[G,g]=(0,Y.useState)(()=>Be(F.current?.contextWindow)),[L,_]=(0,Y.useState)(()=>Be(F.current?.maxTokens)),[V,Q]=(0,Y.useState)(void 0),ie=(0,Y.useRef)(!1),me=(0,Y.useRef)(i),Se=(0,Y.useRef)(s),Le=(0,Y.useRef)(l),tt=(0,Y.useRef)(void 0),Pt=(0,Y.useRef)(i);Pt.current=i;let Vn=(0,Y.useRef)(a);Vn.current=a,(0,Y.useEffect)(()=>Os(w=>{if(w!==e||Pt.current!==void 0||Vn.current)return;let Z=tt.current;Z!==void 0&&Hs(Z)}),[e]),(0,Y.useEffect)(()=>{wn(me.current,i)||(me.current=i,ie.current||(S(Et(i)),z(i!==!1))),Se.current!==s&&(Se.current=s,ie.current||P(Tt(s))),Le.current!==l&&(Le.current=l,ie.current||M(l??""))},[i,s,l]);let ve=pt.filter(w=>x[w].on),Eo=k===(l??"")?void 0:k===""?null:k,ze=D?Ut(x):!1,Dt=!wn(ze,i)||!Mr(v,s)||Eo!==void 0,yt=(0,Y.useRef)(void 0),_e=()=>{ie.current=!0,O(void 0),X(""),j("low"),fe(void 0)},nt=(w,Z,ue,ye=D)=>{let wt=di(ye,Ut(w),i),tr=Mr(Z,s)?void 0:Sr(Z),ga=Lr({efforts:wt,input:tr,defaultEffort:ue===(l??"")?void 0:ue===""?null:ue,appliedCompat:$.current,routeApi:t,initialCompat:d}),ba=JSON.stringify(ga);yt.current!==ba&&(yt.current=ba,p.commit(e,r,ga))},Yn=(w,Z)=>{_e();let ue=!Z&&k===w?"":k;ue!==k&&M(ue);let ye={...x,[w]:{...x[w],on:Z}};Z&&w!=="off"&&ye[w].wire.trim().length===0&&(ye[w]={...ye[w],wire:w}),S(ye),nt(ye,v,ue),N(void 0)},Xn=w=>{_e(),z(w);let Z=w?k:"";Z!==k&&M(Z),nt(x,v,Z,w),N(void 0)},To=(w,Z)=>{_e();let ue={...x,[w]:{...x[w],wire:Z}};S(ue),nt(ue,v,k),N(void 0)},Jn=w=>{_e();let Z={declared:!0,image:w};P(Z),nt(x,Z,k),N(void 0)},Qn=()=>{_e();let w={declared:!1,image:!1};P(w),nt(x,w,k),N(void 0)},Mo=w=>{_e(),M(w),nt(x,v,w),N(void 0)},cn=(w,Z)=>{let ue=Z.slice(0,20),ye=w==="context"?ue:G,wt=w==="output"?ue:L;Q(w),w==="context"?g(ue):_(ue),p.setCapacities?.({contextWindow:Ve(ye),maxTokens:Ve(wt)})},It=w=>{w==="context"?g(Z=>Be(Ve(Z))):_(Z=>Be(Ve(Z))),Q(void 0)},un=w=>{_e();let Z=w.efforts!==!1;z(Z);let ue=Et(w.efforts);S(ue);let ye=w.input===void 0?v:Tt(w.input);w.input!==void 0&&P(ye);let wt=k===""&&w.defaultEffort!==void 0?w.defaultEffort:k;if(wt!==k&&M(wt),O(w.efforts),X(w.source),j(w.confidence),$.current=w.compat,fe(w.inputSource),w.contextWindow!==void 0||w.maxTokens!==void 0){p.fillCapacities?.(w.contextWindow,w.maxTokens);let tr=p.readCapacities?.();g(Be(tr?.contextWindow)),_(Be(tr?.maxTokens))}N({kind:"info",text:h("appliedHint",{source:w.source,confidence:h("confidence_"+w.confidence)})}),nt(ue,ye,wt,Z)},Zn=async()=>{if(!(b||W)){T(!0),N(void 0);try{let w=m?await p.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await p.suggest(e,r,o);if(!w.ok){N({kind:"error",text:w.error==="no-suggestion"?h("noSuggestion"):w.error});return}un(w.suggestion)}catch(w){N({kind:"error",text:h("writeError",{message:String(w)})})}finally{T(!1)}}};(0,Y.useEffect)(()=>{tt.current=Zn});let So=()=>{ie.current=!1,p.withdraw(e,r),S(Et(i)),z(i!==!1),P(Tt(s)),M(l??""),O(void 0),X(""),j("low"),$.current=void 0,fe(void 0);let w=F.current??{};g(Be(w.contextWindow)),_(Be(w.maxTokens)),Q(void 0),p.setCapacities?.({contextWindow:w.contextWindow,maxTokens:w.maxTokens}),N(void 0),yt.current=void 0},Lo=(0,Y.useMemo)(()=>$e(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,[r,t,n]),Ao=$.current?.thinkingFormat??Lo,er=As(i,Ao),y=b||W,H=D?ve.length===0?h("stateUndeclared"):h("stateDeclared",{count:ve.length,default:h(k===""?"defaultEffortUnset":"level_"+k)}):h("thinkingModeOff"),te=k!==""&&!ve.includes(k)?[...ve,k]:ve,he=Ve(G),ge=Ve(L),je=he!==void 0&&ge!==void 0&&ge>he;return(0,A.jsxs)("div",{className:"bre-effort-editor","data-plugin":pe,children:[(0,A.jsxs)("div",{className:"bre-effort-top",children:[(0,A.jsxs)("label",{className:"bre-thinking-switch",children:[(0,A.jsx)("input",{type:"checkbox",checked:D,disabled:y,"aria-label":h("thinkingMode")+" "+String(f+1),onChange:w=>{Xn(w.target.checked)}}),(0,A.jsx)("span",{className:"bre-effort-switch-track","aria-hidden":"true"}),(0,A.jsx)("span",{className:"bre-effort-title",children:h("thinkingMode")})]}),(0,A.jsx)("span",{className:"bre-effort-state",children:H}),B===void 0?null:(0,A.jsx)("span",{className:"bre-effort-suggest",role:"status",children:h("appliedHint",{source:U,confidence:h("confidence_"+ce)})})]}),D?(0,A.jsxs)("div",{className:"bre-effort-card",children:[(0,A.jsxs)("div",{className:"bre-effort-sec",children:[(0,A.jsxs)("div",{className:"bre-effort-labelrow",children:[(0,A.jsx)("span",{className:"bre-effort-label",children:h("levelsLabel")}),(0,A.jsx)("span",{className:"bre-effort-grow"}),(0,A.jsxs)("button",{type:"button",className:"bre-effort-adapt",disabled:y,onClick:()=>{Zn()},children:[(0,A.jsx)(vn,{paths:Rf}),h("autoAdapt")]})]}),(0,A.jsx)("p",{className:"bre-effort-hint",children:h("levelsHint")}),(0,A.jsx)("div",{className:"bre-pillrow",role:"group","aria-label":h("levelsLabel"),children:pt.map(w=>{let Z=x[w];return(0,A.jsx)("button",{type:"button",className:Z.on?"bre-lvl is-on":"bre-lvl",disabled:y,"aria-pressed":Z.on,"aria-label":h("level_"+w)+" "+String(f+1),title:h("level_"+w),onClick:()=>{Yn(w,!Z.on)},children:h("level_"+w)},w)})}),ve.length===0?null:(0,A.jsxs)("button",{type:"button",className:"bre-effort-wiretoggle",disabled:y,"aria-expanded":re,onClick:()=>{J(!re)},children:[(0,A.jsx)(vn,{paths:re?Hf:Cf}),h(re?"wireHide":"wireShow")]}),ve.length===0||!re?null:(0,A.jsxs)("div",{className:"bre-wire",children:[(0,A.jsx)("div",{className:"bre-wire-grid",children:ve.map(w=>(0,A.jsxs)(Y.Fragment,{children:[(0,A.jsx)("span",{className:"bre-wire-name",children:h("level_"+w)}),(0,A.jsx)("input",{type:"text",className:"bre-effort-wire",value:x[w].wire,disabled:y,placeholder:h("wirePlaceholder"),"aria-label":h("level_"+w)+" "+h("wireValue"),onChange:Z=>{To(w,Z.target.value)}})]},w))}),(0,A.jsx)("p",{className:"bre-effort-note",children:h("wireHint")})]})]}),(0,A.jsxs)("div",{className:"bre-effort-cols",children:[ve.length===0?null:(0,A.jsxs)("div",{className:"bre-effort-sec",children:[(0,A.jsx)("span",{className:"bre-effort-label",children:h("defaultEffortLabel")}),(0,A.jsxs)("select",{className:"bre-effort-select",value:k,disabled:y,"aria-label":h("defaultEffortLabel"),onChange:w=>{Mo(w.target.value)},children:[(0,A.jsx)("option",{value:"",children:h("followMemory")}),te.map(w=>(0,A.jsx)("option",{value:w,children:h("level_"+w)},w))]}),(0,A.jsx)("p",{className:"bre-effort-note",children:h("defaultEffortHint")})]}),(0,A.jsxs)("div",{className:"bre-effort-sec",children:[(0,A.jsx)("span",{className:"bre-effort-label",children:h("inputModality")}),(0,A.jsxs)("div",{className:"bre-pillrow",role:"group","aria-label":h("inputModality"),children:[(0,A.jsxs)("button",{type:"button",className:v.declared?"bre-lvl bre-lvl--opt is-on":"bre-lvl bre-lvl--opt",disabled:y,"aria-pressed":v.declared,"aria-label":h("modalityText")+" "+String(f+1),title:h("modalityText"),onClick:()=>{v.declared?Qn():Jn(!1)},children:[(0,A.jsx)(vn,{paths:Sf}),h("modalityText")]}),(0,A.jsxs)("button",{type:"button",className:v.declared&&v.image?"bre-lvl bre-lvl--opt is-on":"bre-lvl bre-lvl--opt",disabled:y,"aria-pressed":v.declared&&v.image,"aria-label":h("modalityImage")+" "+String(f+1),title:h("modalityImage"),onClick:()=>{Jn(!(v.declared&&v.image))},children:[(0,A.jsx)(vn,{paths:Lf}),h("modalityImage")]})]}),(0,A.jsx)("p",{className:"bre-effort-note",children:v.declared?h("modalityDeclared"):h("modalityInherit")})]})]}),(0,A.jsx)("span",{className:"bre-effort-sep"}),m?(0,A.jsx)("p",{className:"bre-effort-note",children:h("stagedHint")}):null,je?(0,A.jsxs)("p",{className:"bre-effort-note bre-warn",children:[(0,A.jsx)(vn,{paths:Af}),h("capacityRule")]}):null,i===!1?(0,A.jsx)("p",{className:"bre-effort-note",children:h("reasoningDisabled")}):null,er===void 0?null:(0,A.jsx)("p",{className:"bre-effort-note",children:h(er==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),Ut(x)===void 0&&i!==void 0?(0,A.jsx)("p",{className:"bre-effort-note",children:h("bareHint")}):null,(0,A.jsxs)("div",{className:"bre-effort-cols",children:[(0,A.jsxs)("div",{className:"bre-effort-sec",children:[(0,A.jsx)("span",{className:"bre-effort-label",children:h("contextWindowLabel")}),(0,A.jsxs)("span",{className:"bre-cap-box",children:[(0,A.jsx)("input",{type:"text",inputMode:"text",className:"bre-cap-input",value:V==="context"?G:Be(he),disabled:y,placeholder:h("capacityBlank"),"aria-label":h("contextWindowLabel")+" "+String(f+1),onFocus:()=>{Q("context")},onBlur:()=>{It("context")},onChange:w=>{cn("context",w.target.value)}}),(0,A.jsx)("span",{className:"bre-cap-unit",children:h("tokensUnit")})]}),(0,A.jsx)("p",{className:"bre-effort-note",children:h("capacityInherit")})]}),(0,A.jsxs)("div",{className:"bre-effort-sec",children:[(0,A.jsx)("span",{className:"bre-effort-label",children:h("maxTokensLabel")}),(0,A.jsxs)("span",{className:"bre-cap-box",children:[(0,A.jsx)("input",{type:"text",inputMode:"text",className:"bre-cap-input",value:V==="output"?L:Be(ge),disabled:y,placeholder:h("capacityBlank"),"aria-label":h("maxTokensLabel")+" "+String(f+1),onFocus:()=>{Q("output")},onBlur:()=>{It("output")},onChange:w=>{cn("output",w.target.value)}}),(0,A.jsx)("span",{className:"bre-cap-unit",children:h("tokensUnit")})]}),(0,A.jsx)("p",{className:"bre-effort-note",children:h("capacityUnitsHint")})]})]}),B===void 0?null:(0,A.jsx)("div",{className:"bre-suggestion",children:de===void 0?null:(0,A.jsx)("p",{className:"bre-effort-note",children:h(de==="endpoint"?"inputHintEndpoint":de==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")})}),R===void 0?null:(0,A.jsx)("p",{className:"bre-effort-message bre-"+R.kind,role:R.kind==="error"?"alert":"status",children:R.text}),Dt?(0,A.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:h("pendingSave")}):null,Dt?(0,A.jsx)("p",{className:"bre-effort-note",children:h("pendingHint")}):null,(0,A.jsx)("div",{className:"bre-effort-actions",children:(0,A.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:y||!Dt,onClick:So,children:h("reset")})})]}):null]})}function ee(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ge(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function be(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function xn(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var mt="data-bre-auto-effort",li='[class*="modelCatalog"]',Of='[class*="modelListHead"]',Nf='button[class*="linkButton"]',Pf="bre-auto-effort",Df="bre-auto-effort-note",If="data-bre-auto-effort-phase",Ps="bre-auto-effort-note-text",Ds="bre-auto-effort-note-detail",_f=3e3;function Ff(e){return e.blocked==="busy"?null:e.failed!==void 0?{phase:"failed",count:0,missed:0,detail:e.failed}:e.blocked!==void 0?{phase:"blocked",count:0,missed:0,detail:""}:e.held>0?{phase:"done",count:e.held,missed:e.unsuggested,detail:""}:e.unsuggested>0?{phase:"unsuggested",count:0,missed:e.unsuggested,detail:""}:{phase:"empty",count:0,missed:0,detail:""}}function ci(e){return Array.from(e.querySelectorAll(li)).filter(t=>(t.parentElement?.closest(li)??null)===null)}function Rr(e,t,n){let r=new Map;for(let s of t)s.route.length!==0&&s.catalogue.isConnected&&r.set(s.catalogue,s.route);let o=n.t("autoAdaptAll");for(let[s,d]of r){let l=s.querySelector(Of)??s,f=l.querySelector(`[${mt}]`)??qf();_s.set(f,n);let m=Kf(l);m!==null?m.nextElementSibling!==f&&m.after(f):l.lastElementChild!==f&&l.append(f),Uf(f,d,o)}let i=new Set,a=new Set(r.values());for(let s of Array.from(e.querySelectorAll(`[${mt}]`))){let d=s.closest(li),l=s.getAttribute(mt)??"";if(d===null||!r.has(d)||i.has(d)){s.remove(),l.length>0&&!a.has(l)&&ui(l);continue}i.add(d)}}function ui(e){let t=Mt.get(e);t!==void 0&&(t.timer!==null&&clearTimeout(t.timer),t.note.remove(),Mt.delete(e))}function Is(){for(let e of Array.from(document.querySelectorAll(`[${mt}]`)))e.remove();for(let e of Mt.values())e.timer!==null&&clearTimeout(e.timer),e.note.remove();Mt.clear()}function Kf(e){let t=Array.from(e.querySelectorAll(Nf));return t.length===0?null:t[t.length-1]}function qf(){let e=document.createElement("button");return e.className=Pf,e.setAttribute("type","button"),e.setAttribute(mt,""),e.addEventListener("click",()=>{let t=e.getAttribute(mt)??"";if(t.length===0)return;let n=_s.get(e);n!==void 0&&(Cs(t),Wf(t,n))}),e}async function Wf(e,t){if(t.onRequest===void 0)return;Ns(e,{phase:"working",count:0,missed:0,detail:""},t,0);let n;try{n=await t.onRequest(e)}catch(o){n={held:0,unsuggested:0,failed:String(o)}}if(n===void 0){ui(e);return}let r=Ff(n);r!==null&&Ns(e,r,t,_f)}function Ns(e,t,n,r){let o=Mt.get(e);o!==void 0&&!o.note.isConnected&&(o.timer!==null&&clearTimeout(o.timer),Mt.delete(e),o=void 0),o!==void 0&&o.timer!==null&&clearTimeout(o.timer);let i=o?.note??Bf();i.setAttribute(If,t.phase);let a=i.querySelector(`.${Ps}`),s=i.querySelector(`.${Ds}`),d=Gf(t,n);a.textContent!==d.text&&(a.textContent=d.text),s.textContent!==d.detail&&(s.textContent=d.detail),Ge(s,d.detail.length===0),o===void 0&&document.body.append(i);let l=r>0?setTimeout(()=>{ui(e)},r):null;i.style.setProperty("--bre-note-hold",`${r}ms`),Mt.set(e,{note:i,timer:l})}function Bf(){let e=document.createElement("div");return e.className=Df,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<span class="${Ps}"></span><span class="${Ds}"></span>`,e}var _s=new WeakMap,Mt=new Map;function Gf(e,t){switch(e.phase){case"working":return{text:t.t("autoAdaptWorking"),detail:""};case"done":return{text:t.t("autoAdaptDone",{count:e.count}),detail:e.missed>0?`${t.t("autoAdaptDoneHint",{count:e.count})} ${t.t("autoAdaptUnsuggestedHint")}`:t.t("autoAdaptDoneHint",{count:e.count})};case"empty":return{text:t.t("autoAdaptEmpty"),detail:t.t("autoAdaptEmptyHint")};case"unsuggested":return{text:t.t("autoAdaptUnsuggested"),detail:t.t("autoAdaptUnsuggestedHint")};case"blocked":return{text:t.t("autoAdaptBlocked"),detail:t.t("autoAdaptBlockedHint")};case"failed":return{text:t.t("autoAdaptFailed",{message:e.detail}),detail:e.detail}}}function Uf(e,t,n){e.getAttribute(mt)!==t&&e.setAttribute(mt,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==null&&e.removeAttribute("title")}var kn="data-bre-drag-handle",fi="data-bre-row-head",pi="data-bre-drop-side",Hr="bre-row-dragging",Cr="bre-row-drop-target",Gs="bre-drag-ghost",Us="bre-drop-line",Fs="http://www.w3.org/2000/svg",Ks=8,qs=28,Ws=12,zf="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",jf='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function Or(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,sighted:new WeakMap,drag:void 0}}function we(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function $f(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function St(e){return we(e).map((t,n)=>({row:t,key:$f(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function zs(e,t){let n=e.filter(a=>t.includes(a)),r=n.map(a=>e.indexOf(a)),o=t.filter(a=>n.includes(a)),i=new Map;e.forEach((a,s)=>i.set(a,s)),r.forEach((a,s)=>{let d=o[s];d!==void 0&&i.set(d,a)});for(let[a,s]of i){let d=String(s);a.style.order!==d&&(a.style.order=d)}}function Nr(e,t){zs(St(e),t)}function mi(e,t){let n=we(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,i)=>{let a=r[i]-o.offsetTop;a!==0&&(o.style.transition="none",o.style.transform=`translateY(${a}px)`,o.offsetHeight,o.style.transition=zf,o.style.transform="")})}function En(e,t){return St(e).map(n=>t(n)).filter(n=>n!==void 0)}function Vf(e,t,n){let r=En(e,t);if(n===void 0||!Yf(e,n))return r;let o=new Map;return n.ids.forEach((i,a)=>{o.has(i)||o.set(i,a)}),r.map((i,a)=>({id:i,key:o.get(i)??n.ids.length+a})).sort((i,a)=>i.key-a.key).map(i=>i.id)}function Yf(e,t){return t.rows.some(n=>!e.contains(n))}function Xf(e,t){let n=[];for(let o of St(e)){let i=t(o);i!==void 0&&n.push(i)}let r=[];for(let o of we(e))t(o)!==void 0&&r.push(o);return{ids:n,rows:r}}function js(e,t,n){let r=new Map;for(let[s,d]of t.entries())r.has(d)||r.set(d,s);let o=we(e),a=[...o.filter(s=>n(s)!==void 0)].sort((s,d)=>{let l=r.get(n(s))??Number.MAX_SAFE_INTEGER,f=r.get(n(d))??Number.MAX_SAFE_INTEGER;return l-f});zs(o,a)}function Pr(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function $s(e,t,n,r){let i=e.filter(a=>a!==t).indexOf(n);return i<0?Math.max(0,e.indexOf(t)):r?i+1:i}function Vs(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let i=o.getBoundingClientRect(),a=t<i.top?i.top-t:t>i.bottom?t-i.bottom:0;a<r&&(r=a,n=o)}return n}function Jf(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function Ys(e,t){let n=e.getBoundingClientRect();return t?n.bottom+Ks/2-1:n.top-Ks/2-1}function Xs(){let e=document.createElementNS(Fs,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(Fs,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function Js(e,t){let n=document.createElement("div");n.className=Gs,n.setAttribute("aria-hidden","true"),n.appendChild(Xs());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function Qf(e){return!(e instanceof Element)||e.closest(`[${kn}]`)!==null?!1:e.closest(jf)!==null}function Qs(e){return e.parentElement??void 0}function Zs(e){for(let t of we(e))t.classList.remove(Cr),t.removeAttribute(pi)}function Dr(e){let t=e.parentElement;for(;t!==null;){if(ed(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function Ir(e){let t=[],n=e.parentElement;for(;n!==null;)ed(n)&&t.push(n),n=n.parentElement;let r=document.scrollingElement;return r instanceof HTMLElement&&r.scrollHeight>r.clientHeight&&!t.includes(r)&&t.push(r),t}function ed(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function td(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+qs?-Ws:t>n.bottom-qs?Ws:0}function nd(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function Zf(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=Us,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function ep(e,t,n){let r=Zf(e),o=t.getBoundingClientRect();r.style.top=`${Ys(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(pi,n?"after":"before")}function tp(e){e.line!==void 0&&(e.line.style.display="none")}function np(e){let t=e.drag;e.drag=void 0,t!==void 0&&(nd(e,t,0),tp(e),t.row.classList.remove(Hr),Zs(t.list),t.dropped||mi(t.list,()=>{Nr(t.list,t.before)}))}function rp(e,t,n,r){if(Qf(t.target)){t.preventDefault();return}let o=Qs(e),i=n.idOf(e);if(o===void 0||i===void 0){t.preventDefault();return}let a={row:e,list:o,before:St(o),scroller:Dr(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=a,e.classList.add(Hr);let s=Js(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(s.style.left=`${t.clientX}px`,s.style.top=`${t.clientY}px`),document.body.appendChild(s);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",i),d.setDragImage(s,Math.round(s.offsetWidth/2),Math.round(s.offsetHeight/2))}catch{}window.setTimeout(()=>{s.remove()},0)}function op(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,i=o instanceof Element?r.adapter.rowOf(o,e):void 0,a=St(e),s=i!==void 0&&a.includes(i)?i:Vs(a,t.clientY);if(s===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let l=Jf(s,t.clientY),f=$s(a,r.row,s,l);f!==a.indexOf(r.row)&&mi(e,()=>{Nr(e,Io(a,r.row,f))}),Zs(e),s.classList.add(Cr),s.setAttribute(pi,l?"after":"before"),ep(n,s,l),nd(n,r,r.scroller===void 0?0:td(r.scroller,t.clientY))}function ip(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{op(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function ap(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(fi,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{rp(t,o,n,r)}),e.addEventListener("dragend",()=>{np(r)}))}function sp(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let i=Qs(t);if(i===void 0)return;let a=St(i),s=a.indexOf(t);if(s<0)return;let d=s+(o.key==="ArrowUp"?-1:1);d<0||d>=a.length||(o.preventDefault(),mi(i,()=>{Nr(i,Io(a,t,d))}),n.commit(i),e.focus())})}function Bs(e,t,n,r){let o=r.gripLabel(t,n),i=r.gripHint();e.getAttribute(kn)!==n&&e.setAttribute(kn,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function dp(e,t,n,r,o){let i=t.querySelector(`[${kn}]`);if(i!==null){Bs(i,e,n,r);return}r.decorate?.(e,t);let a=document.createElement("span");a.className="bre-drag-grip",a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("draggable","true"),a.appendChild(Xs()),Bs(a,e,n,r),sp(a,e,r,o),ap(r.seatDrags?t:a,e,r,o),t.insertBefore(a,t.firstChild)}function _r(e,t,n,r){if(!e.isConnected)return;ip(t,r);for(let i of we(t)){let a=n.idOf(i);if(a===void 0)continue;let s=n.seatOf(i);s!==void 0&&dp(i,s,a,n,r)}if(r.drag!==void 0)return;let o=Vf(t,n.idOf,r.sighted.get(t));js(t,n.order(o),n.idOf),r.sighted.set(t,Xf(t,n.idOf))}function Fr(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${kn}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${fi}]`)))t.removeAttribute(fi),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${Hr}, .${Cr}`)))t.classList.remove(Hr,Cr);for(let t of Array.from(document.querySelectorAll(`.${Us}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${Gs}`)))t.remove();e.line=void 0}var rd=["openai","anthropic","gemini"];function Kr(e){return e==="anthropic-messages"?"anthropic":e==="google-generative-ai"?"gemini":"openai"}function od(e){return e==="openai-completions"||e==="anthropic-messages"||e==="openai-responses"||e==="google-generative-ai"}var lp=40;function id(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,lp)}function Lt(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}var cp=12;function ad(e){return e.length===0?"":e.length<cp?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":`${e.slice(0,4)}...${e.slice(-4)}`}var Tn="bre:endpoints-changed";function up(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function qr(e){if(!Array.isArray(e))return;let t=[];for(let n of e)typeof n=="string"&&n.length>0&&t.push(n);return t}function fp(e){if(!K(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked,i=qr(e.models),a=e.protocol,s=e.rest,d=K(s)&&typeof s.remainingMs=="number"?s.remainingMs:void 0,l=K(s)&&typeof s.failures=="number"?s.failures:void 0;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled!==!1,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{},...i===void 0?{}:{models:i},...od(a)?{protocol:a}:{},...d!==void 0&&d>=0&&l!==void 0?{rest:{remainingMs:d,failures:l}}:{}}}function pp(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let m of t){let u=fp(m);u!==void 0&&n.push(u)}let r=e.route,o=qr(e.models),i=qr(e.mergedModels),a=qr(e.unmergedModels),s=e.endpoints,d=K(s)&&typeof s.openai=="string"?s.openai:null,l=K(s)&&typeof s.anthropic=="string"?s.anthropic:null,f=K(s)&&typeof s.gemini=="string"?s.gemini:null;return{ok:!0,route:typeof r=="string"?r:"",entries:n,...o===void 0?{}:{models:o},...i===void 0?{}:{mergedModels:i},...a===void 0||a.length===0?{}:{unmergedModels:a},endpoints:{openai:d,anthropic:l,gemini:f}}}async function mp(e){let t;try{t=await e.json()}catch{t=void 0}if(!K(t))return{ok:!1};if(t.ok===!0){let r=pp(t);if(r!==void 0)return r}let n=up(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function Ye(e,t){let n=`${va}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await mp(r)}catch{return{ok:!1}}}var Xe={list:e=>Ye(e),add:(e,t,n)=>Ye(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),rename:(e,t,n)=>Ye(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>Ye(e,{op:"remove",ref:t}),replace:(e,t,n)=>Ye(e,{op:"value",ref:t,value:n}),setScope:(e,t,n)=>Ye(e,{op:"scope",ref:t,...n===void 0?{}:{models:n}}),setEnabled:(e,t,n)=>Ye(e,{op:"enable",ref:t,enabled:n}),setProtocol:(e,t,n)=>Ye(e,{op:"protocol",ref:t,...n===void 0?{}:{protocol:n}}),setEndpoints:(e,t,n,r)=>Ye(e,{op:"endpoints",openai:t??"",anthropic:n??"",gemini:r??""}),applyMerged:e=>Ye(e,{op:"applyMerged"}),async reveal(e,t){try{let n=await fetch(`${rr}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!K(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var Mn="data-bre-endpoint-rows",it="data-bre-endpoint-row",Br="data-bre-endpoint-family",sd="data-bre-endpoint-filled",Gr="data-bre-endpoint-field",Ur="data-bre-endpoint-title",Sn="data-bre-endpoint-toggle",pd="data-bre-endpoint-count",zr="data-bre-field-order",Ln="data-bre-endpoint-serving",dd="data-bre-protocol-watch",ld=new WeakSet,cd="data-bre-row-provider",bi="data-bre-protocol-cards",zt="data-bre-protocol-value",yi="data-bre-protocol-source";function Oe(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0)return r}}function jt(e,t){let n=Oe(e,t);if(n===void 0)return;let r=n.closest("label");return r!==null&&r.parentElement!==null?r:n.parentElement??void 0}function hi(e,t){let n=e;for(;n!==null&&n.parentElement!==t;)n=n.parentElement;return n===null||n===t?void 0:n}function hp(e,t,n){for(let r=t.parentElement;r!==null;r=r.parentElement){if(!r.contains(n)||e!==void 0&&!r.contains(e))continue;let o=hi(t,r),i=hi(n,r);if(o===void 0||i===void 0||o===i)continue;let a=e===void 0?void 0:hi(e,r);return{container:r,protocol:o,url:i,name:a}}}function md(e,t){let n=Oe(e,t);return n instanceof HTMLSelectElement||n instanceof HTMLInputElement?n.value.trim():""}function gp(e,t){let n=md(e,t.apiProtocol);return n==="anthropic-messages"||n==="openai-completions"||n==="openai-responses"||n==="google-generative-ai"?n:void 0}function Je(e,t){let n=gp(e,t);return n===void 0?void 0:Kr(n)}function Rn(e,t){let n=md(e,t.routeId);return n.length>0?n:(e.closest(`[${cd}]`)?.getAttribute(cd)??"").trim()}function hd(e,t){return e==="anthropic"?t("keysEndpointAnthropic"):e==="openai"?t("keysEndpointOpenAI"):e==="gemini"?t("keysEndpointGemini"):""}function bp(e,t){let n=Oe(e,t.modelName),r=Oe(e,t.apiProtocol),o=Oe(e,t.baseUrl);if(r===void 0||o===void 0)return;let i=hp(n,r,o);if(i===void 0)return;let{container:a,protocol:s,url:d,name:l}=i,f=u=>Array.from(a.children).indexOf(u);if((l===void 0||f(l)<f(s))&&f(s)<f(d)){e.setAttribute(zr,"1");return}a.insertBefore(s,d),l!==void 0&&a.insertBefore(l,s),e.setAttribute(zr,"1")}function gd(e,t){for(let n of Array.from(e.children))if(!(n===t||n.contains(t))&&!n.hasAttribute(Br)&&!n.hasAttribute(Sn)&&n instanceof HTMLElement&&(n.textContent??"").trim().length>0)return n}function jr(e,t){let n=t?"1":"0";e.getAttribute(sd)!==n&&e.setAttribute(sd,n)}function yp(e,t,n){let r=gd(e,t);if(!n){e.removeAttribute(Gr),r?.removeAttribute(Ur);return}e.setAttribute(Gr,"1"),r?.setAttribute(Ur,"1")}function bd(e,t,n){let r=Oe(e,t.baseUrl);if(r===void 0)return;let o=jt(e,t.baseUrl);if(o===void 0)return;let i=hd(Je(e,t),n),a=o.querySelector(`[${Br}]`);if(a===null&&i.length>0){a=document.createElement("span"),a.setAttribute(Br,"1"),a.className="bre-endpoint-family";let d=r.closest("label");d!==null&&d.contains(r)?d.insertBefore(a,r):o.insertBefore(a,r)}a!==null&&(a.textContent!==i&&(a.textContent=i),Ge(a,i.length===0),jr(a,r instanceof HTMLInputElement&&r.value.trim().length>0)),yp(o,r,a!==null&&i.length>0);let s=Je(e,t);s===void 0?o.removeAttribute(Ln):o.setAttribute(Ln,s)}function wp(e,t){let n=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;n===void 0?e.value=t:n.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function yd(e,t){for(let n of Array.from(t.querySelectorAll(`[${zt}]`))){let r=n.getAttribute(zt)===e.value;n.classList.toggle("is-selected",r),n.setAttribute("aria-checked",r?"true":"false"),n.tabIndex=r?0:-1}}function vp(e,t,n){let r=Array.from(t.querySelectorAll(`[${zt}]`)),o=Array.from(e.options).filter(i=>i.value.length>0);return r.length!==o.length?!1:o.every((i,a)=>{let s=r[a];return s!==void 0&&s.getAttribute(zt)===i.value&&(s.textContent??"")===wd(i.value,(i.textContent??i.value).trim(),n.t)})}var xp="google-generative-ai",ud="data-bre-protocol-option";function wd(e,t,n){return e==="openai-completions"?n("keysProtocolShortChat"):e==="openai-responses"?n("keysProtocolShortResponses"):e==="anthropic-messages"?n("keysProtocolShortAnthropic"):e==="google-generative-ai"?n("keysProtocolGemini"):t}function fd(e,t,n){t.replaceChildren();for(let r of Array.from(e.options)){let o=r.value;if(o.length===0)continue;let i=document.createElement("button");i.type="button",i.className="bre-protocol-card",i.setAttribute("role","radio"),i.setAttribute(zt,o),i.textContent=wd(o,(r.textContent??o).trim(),n.t),i.title=(r.textContent??o).trim(),i.addEventListener("click",()=>{e.value!==o&&(wp(e,o),yd(e,t))}),t.appendChild(i)}}function kp(e,t,n){let r=Oe(e,t.apiProtocol);if(!(r instanceof HTMLSelectElement))return;let o=jt(e,t.apiProtocol);if(o===void 0)return;let i=r.querySelector(`option[${ud}]`);i===null&&(i=document.createElement("option"),i.setAttribute(ud,"1"),i.value=xp,r.appendChild(i));let a=n.t("keysProtocolGemini");i.textContent!==a&&(i.textContent=a);let s=o.querySelector(`[${bi}]`);if(s===null){let d=document.createElement("div");s=d,d.setAttribute(bi,"1"),d.className="bre-protocol-cards",d.setAttribute("role","radiogroup");let l=r.getAttribute("aria-label");l!==null&&d.setAttribute("aria-label",l),r.setAttribute(yi,"1"),r.after(d),fd(r,d,n),d.addEventListener("keydown",f=>{let m=f.key==="ArrowRight"||f.key==="ArrowDown"?1:f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:0,u=Array.from(d.querySelectorAll(`[${zt}]`));if(u.length===0)return;if(f.key==="Home"||f.key==="End"){f.preventDefault();let b=f.key==="Home"?u[0]:u[u.length-1];b?.click(),b?.focus();return}if(m===0)return;f.preventDefault();let c=u.findIndex(b=>b.classList.contains("is-selected")),p=u[(Math.max(c,0)+m+u.length)%u.length];p?.click(),p?.focus()})}else vp(r,s,n)||fd(r,s,n);Ge(r,!0),yd(r,s)}function vd(e,t,n){let r=e===null?0:e.querySelectorAll(`[${it}]`).length,o=r===0?"":n.t("keysEndpointsCount",{count:r});if(o.length===0){t.hasAttribute("title")&&t.removeAttribute("title");return}t.getAttribute("title")!==o&&t.setAttribute("title",o)}function Ep(e,t,n){let r=e.querySelector(`[${Sn}]`);if(jt(e,t.apiProtocol)===void 0){r?.remove(),e.querySelector(`[${pd}]`)?.remove();return}let o=jt(e,t.baseUrl);if(o===void 0)return;let i=Oe(e,t.baseUrl);if(i===void 0)return;let a=gd(o,i);if(a===void 0||a===r)return;let s=()=>e.querySelector(`[${Mn}]`),d=f=>{let m=n.t("keysMoreEndpoints");f.textContent!==m&&(f.textContent=m);let u=s();f.setAttribute("aria-expanded",u!==null&&!u.hidden?"true":"false"),vd(u,f,n)};if(r!==null){r.parentElement!==a&&a.append(r),d(r);return}let l=document.createElement("button");l.type="button",l.setAttribute(Sn,"1"),l.className="bre-endpoint-toggle",l.textContent=n.t("keysMoreEndpoints"),l.addEventListener("click",()=>{let f=s();if(f!==null&&(f.hidden=!f.hidden,d(l),!f.hidden)){let m=Rn(e,t);m.length>0&&Sp(f,m,n,e,t)}}),a.append(l),d(l)}var gi=new WeakMap,Tp=1e3,xd=new WeakMap,wi=0,Wr=new Map;function Mp(e,t){wi+=1,typeof CustomEvent=="function"&&document.dispatchEvent(new CustomEvent(Tn,{detail:{route:e,openai:t.openai??"",anthropic:t.anthropic??"",gemini:t.gemini??""}}))}function An(e){let t=e.getAttribute(it);return t==="openai"||t==="anthropic"||t==="gemini"?t:void 0}async function Sp(e,t,n,r,o){for(let i of Array.from(e.querySelectorAll(`[${it}]`)))await kd(i,t,n,r,o)}async function kd(e,t,n,r,o){let i=e.querySelector(".bre-endpoint-url"),a=An(e);if(i===null||a===void 0)return;let s=(gi.get(e)??0)+1;gi.set(e,s),xd.set(e,{at:Date.now(),epoch:wi});let d=n.client??Xe,l=await $r(t,d);if(l===void 0||gi.get(e)!==s||An(e)!==a||document.activeElement===i)return;await Ed(r,o,n,t,Je(r,o),l);let f=l[a];i.value!==f&&(i.value=f);let m=e.querySelector(".bre-endpoint-family");m!==null&&jr(m,f.length>0)}async function Ed(e,t,n,r,o,i,a=!1){if(o===void 0||!a&&i[o].length>0)return;let s=Oe(e,t.baseUrl);if(!(s instanceof HTMLInputElement)||document.activeElement===s)return;let d=s.value.trim();if(d.length===0&&!a)return;let l=n.client??Xe;await xi(r,l,f=>{if(!(!a&&f[o].length>0)&&f[o]!==d)return{openai:o==="openai"?d:f.openai,anthropic:o==="anthropic"?d:f.anthropic,gemini:o==="gemini"?d:f.gemini}})}function vi(e,t,n){let r=jt(e,t.baseUrl);if(r===void 0||r.parentElement===null)return;let o=Je(e,t);if(o===void 0)return;let i=r.querySelector(`:scope > [${Mn}]`);i===null&&(i=e.querySelector(`[${Mn}]`),i!==null&&r.appendChild(i)),i===null&&(i=document.createElement("div"),i.setAttribute(Mn,"1"),i.hidden=!0,r.appendChild(i));let a=rd.filter(m=>m!==o),s=Array.from(i.children).filter(m=>m instanceof HTMLElement&&m.hasAttribute(it));if(!(a.length===s.length&&a.every((m,u)=>An(s[u])===m)))for(let m of a){let u=i.querySelector(`[${it}="${m}"]`);u===null&&(u=Lp(e,t,n,m)),i.appendChild(u)}for(let m of Array.from(i.querySelectorAll(`[${it}]`))){let u=An(m);u!==void 0&&u!==o||m.remove()}let l=e.querySelector(`[${Sn}]`);l!==null&&(l.setAttribute("aria-expanded",i.hidden?"false":"true"),vd(i,l,n));let f=Rn(e,t);if(f.length>0)for(let m of Array.from(i.querySelectorAll(`[${it}]`))){let u=xd.get(m);(u===void 0||u.epoch!==wi||Date.now()-u.at>=Tp)&&kd(m,f,n,e,t)}}function Lp(e,t,n,r){let o=document.createElement("div");o.setAttribute(it,r),o.className="bre-endpoint-row";let i=document.createElement("span");i.className="bre-endpoint-family",i.textContent=hd(r,n.t),jr(i,!1);let a=document.createElement("input");a.type="url",a.className="bre-text-input bre-endpoint-url",a.spellcheck=!1,a.placeholder="https://\u2026";let s=n.client??Xe;return a.addEventListener("change",()=>{let d=Rn(e,t);if(d.length===0)return;let l=a.value.trim();if(l.length>0&&!/^https?:\/\//i.test(l)){a.setAttribute("aria-invalid","true"),a.title=n.t("keysEndpointInvalid");return}a.hasAttribute("aria-invalid")&&a.removeAttribute("aria-invalid"),a.hasAttribute("title")&&a.removeAttribute("title"),jr(i,l.length>0),(async()=>await xi(d,s,f=>{let m=An(o);if(m!==void 0)return{openai:m==="openai"?l:f.openai,anthropic:m==="anthropic"?l:f.anthropic,gemini:m==="gemini"?l:f.gemini}}))()}),o.append(i,a),o}async function Ap(e,t,n,r,o){let i=Rn(e,t),a=Oe(e,t.baseUrl);if(i.length===0||!(a instanceof HTMLInputElement))return;let s=n.client??Xe,d=await $r(i,s);if(d===void 0||Je(e,t)!==o)return;let l=a.value.trim();if(l.length>0&&l!==d[r]){let u=await xi(i,s,c=>{if(Je(e,t)===o)return{openai:r==="openai"?l:c.openai,anthropic:r==="anthropic"?l:c.anthropic,gemini:r==="gemini"?l:c.gemini}});if(u===void 0||(d=u,Je(e,t)!==o))return}let f=d[o];if(a.value===f)return;let m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;m===void 0?a.value=f:m.call(a,f),a.dispatchEvent(new Event("input",{bubbles:!0})),a.dispatchEvent(new Event("change",{bubbles:!0})),vi(e,t,n)}async function xi(e,t,n){let o=(Wr.get(e)??Promise.resolve()).then(async()=>{let i=await $r(e,t);if(i===void 0)return;let a=n(i);if(a===void 0)return;let s=await t.setEndpoints(e,a.openai,a.anthropic,a.gemini);if(!s.ok)return;let d={openai:s.endpoints.openai??"",anthropic:s.endpoints.anthropic??"",gemini:s.endpoints.gemini??""};return Mp(e,s.endpoints),d});Wr.set(e,o);try{return await o}finally{Wr.get(e)===o&&Wr.delete(e)}}async function $r(e,t){let n=await t.list(e);if(n.ok)return{openai:n.endpoints.openai??"",anthropic:n.endpoints.anthropic??"",gemini:n.endpoints.gemini??""}}function Rp(e,t,n){let r=jt(e,t.baseUrl),o=Je(e,t),i=r?.getAttribute(Ln);bd(e,t,n.t),vi(e,t,n),!(r===void 0||i===void 0||o===void 0)&&i!==o&&(i!=="openai"&&i!=="anthropic"&&i!=="gemini"||Ap(e,t,n,i,o))}function Td(e,t,n){bp(e,t),kp(e,t,n),bd(e,t,n.t),Ep(e,t,n),vi(e,t,n);let r=Oe(e,t.apiProtocol);r instanceof HTMLSelectElement&&!r.hasAttribute(dd)&&(r.setAttribute(dd,"1"),r.addEventListener("change",()=>Rp(e,t,n)));let o=Oe(e,t.baseUrl);o instanceof HTMLInputElement&&!ld.has(o)&&(ld.add(o),o.addEventListener("change",()=>{let i=Rn(e,t),a=Je(e,t);if(i.length===0||a===void 0)return;let s=n.client??Xe;(async()=>{let d=await $r(i,s);d!==void 0&&Je(e,t)===a&&await Ed(e,t,n,i,a,d,!0)})()}))}function Hp(){for(let e of Array.from(document.querySelectorAll(`select[${yi}]`)))e.hidden=!1,e.removeAttribute(yi)}function Md(){Hp();for(let e of Array.from(document.querySelectorAll(`[${Mn}], [${it}], [${Sn}], [${pd}], [${bi}], [${Br}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`[${zr}], [${Gr}], [${Ur}], [${Ln}]`)))e.removeAttribute(zr),e.removeAttribute(Gr),e.removeAttribute(Ur),e.removeAttribute(Ln)}function $t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ki="__breLedgerDocument";function Dd(){let e=globalThis;return e[ki]??(e[ki]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var Vr="bre:held-writes:v1";function Ri(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function Qe(e){let t=Ri();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(Vr);return}let n={document:Dd(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(Vr,JSON.stringify(n))}catch{}}function Sd(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,i]=r;if(typeof o!="string"||!Array.isArray(i))return;let a=[];for(let s of i){if(!Array.isArray(s)||s.length!==2)return;let[d,l]=s;if(typeof d!="string"||!K(l)||t!==void 0&&!t(l))return;a.push([d,l])}n.push([o,a])}return n}function Cp(e){let t=Ri();if(t!==void 0)try{let n=t.getItem(Vr);if(n===null)return;let r=JSON.parse(n);if(r.document!==Dd())return;let o=Sd(r.pending),i=Sd(r.queued,Wp);if(o===void 0||i===void 0)return;let a=Array.isArray(r.committed)?r.committed.filter(s=>typeof s=="string"):[];for(let[s,d]of o)e.pending.set(s,new Map(d));for(let[s,d]of i)a.includes(s)&&(e.queued.set(s,new Map(d)),e.committing.add(s))}catch{}}function Id(e,t){(async()=>{try{await Hi(t,e),await Ci(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function _d(e,t){(async()=>{try{await Hi(t,e,!0),await Ci(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{Ri()?.removeItem(Vr)}catch{}}})()}function Fd(){let e={disposed:!1,mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet,disclosureWired:new WeakSet,editWired:new WeakSet};return Cp(e),e}async function Op(e,t){if(!t.flushing){t.flushing=!0;try{let n=await Hi(e,t),r=await Ci(e,t);n||r?Ld(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Ld(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function Ld(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function Np(e){return e.queued.size>0||e.pending.size>0}function Pn(e,t,n,r,o,i,a){try{let s=e.pending.get(t);if(r===void 0){if(s===void 0)return;s.delete(n),s.size===0&&e.pending.delete(t);return}e.pending.set(t,(s??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...i===void 0?{}:{input:i},...a===void 0?{}:{defaultEffort:a}}))}finally{Qe(e)}}function Kd(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),Qe(e)}function Pp(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),Qe(e))}function Dp(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),Qe(e))}function Ip(e,t,n){Pp(e,t,n),Dp(e,t,n)}function _p(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),Qe(e)}function Fp(e,t,n){if(t===void 0)return null;let i=t[Ae]!==!0&&t.reasoningEfforts!==void 0&&typeof t[_t]=="number"||t[Ae]!==!0&&n?.efforts!==void 0&&Kp(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[Ae]===!0||e.efforts==="keep",s=t[rt]!==!0&&n?.input!==void 0&&qp(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[rt]===!0,d=i?"keep":e.efforts,l=s?void 0:e.input,f=e.defaultEffort;return d==="keep"&&l===void 0&&f===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...l===void 0?{}:{input:l},...f===void 0?{}:{defaultEffort:f}}}function Kp(e,t){if(e===t)return!0;if(!K(e)||!K(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function qp(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function Wp(e){if(!K(e))return!1;let t=e.efforts;return t===!1||t==="keep"||K(t)}async function Bp(e,t,n,r,o=!1){let i=await e.describeNamespace(),a=ke(i.namespace),s=[];for(let[m,u]of[...r]){let c=Gt(a,n).find(S=>S.id===m);if(c===void 0||t.pending.get(n)?.get(m)!==u)continue;let p=kt(a,n),b=typeof c.name=="string"?c.name:void 0,h=$e(m,b===void 0?p:{...p,displayName:b}),x=Fp(u,c,{...h.efforts===void 0?{}:{efforts:h.efforts},...h.input===void 0?{}:{input:h.input}});if(x===null){Pn(t,n,m,void 0);continue}s.push({modelId:m,efforts:x.efforts,...x.compat===void 0?{}:{compat:x.compat},...x.input===void 0?{}:{input:x.input},...x.defaultEffort===void 0?{}:{defaultEffort:x.defaultEffort}})}if(s.length===0)return!1;let d=!1,l=await gn(e.api,n,s,()=>d?e.describeNamespace():(d=!0,Promise.resolve(i)),o?void 0:ol),f=!1;return s.forEach((m,u)=>{let c=l[u];if(c?.aborted!==!0){if(c?.ok===!0||c?.modelNotFound===!0){Pn(t,n,m.modelId,void 0);return}f=!0,console.error(`[bre] staged flush write failed for "${n}"/"${m.modelId}": ${c?.error??"unknown"}`)}}),f}async function Hi(e,t,n=!1){for(let a of[...t.committing])t.queued.has(a)||t.committing.delete(a);if(![...t.queued.keys()].some(a=>t.committing.has(a)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return Qe(t),!1;let i=!1;for(let[a,s]of[...t.queued]){if(!t.committing.has(a)&&!t.signalsUnavailable)continue;let l=[...s].map(([u,c])=>({modelId:u,efforts:c.efforts,...c.compat===void 0?{}:{compat:c.compat},...c.input===void 0?{}:{input:c.input},...c.defaultEffort===void 0?{}:{defaultEffort:c.defaultEffort}})),f=await gn(e.api,a,l,void 0,n?void 0:ol),m=!1;l.forEach((u,c)=>{let p=f[c];if(p?.aborted===!0){m=!0;return}if(p?.ok===!0||p?.modelNotFound===!0){s.delete(u.modelId);return}console.error(`[bre] held write failed for "${a}"/"${u.modelId}": ${p?.error??"unknown"}`)}),s.size===0?(t.queued.delete(a),t.committing.delete(a)):m||(i=!0)}return Qe(t),i}async function Ci(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ke(r.namespace),i=!1;for(let[a,s]of[...t.pending]){if(s.size===0){t.pending.delete(a);continue}$t(o,a)&&await Bp(e,t,a,s,n)&&(i=!0)}return Qe(t),i}function Ee(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function Dn(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Gp(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=Dn(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(i=>i.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function qd(e,t){return Array.from(e.querySelectorAll("button[aria-label]")).find(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function Ad(){return new Promise(e=>{if(typeof window.requestAnimationFrame!="function"){e();return}let t,n=()=>{window.clearTimeout(r),t!==void 0&&window.cancelAnimationFrame(t),e()},r=window.setTimeout(n,100);t=window.requestAnimationFrame(n)})}function Cn(e){return e.querySelector('[class*="modelInputTypes"]')!==null}var Up="modelReasoning",Ti="data-bre-reasoning-hidden";function Wd(e){return e.querySelector(`[class*="${Up}"]`)??void 0}function Oi(e){let t=Wd(e);t!==void 0&&t.style.display!=="none"&&(t.setAttribute(Ti,"1"),t.style.display="none")}function On(e){let t=Wd(e);t!==void 0&&t.getAttribute(Ti)==="1"&&(t.removeAttribute(Ti),t.style.display==="none"&&(t.style.display=""))}var Mi="data-bre-capacity-hidden";function Bd(e){return Array.from(e.children).filter(t=>{if(t.nodeType!==1)return!1;let n=t;return n.matches('[class*="modelField"]')||n.matches('[class*="modelInputTypes"]')})}function Rd(e){for(let t of Bd(e))t.style.display!=="none"&&(t.setAttribute(Mi,"1"),t.style.display="none")}function Hn(e){for(let t of Bd(e))t.getAttribute(Mi)==="1"&&(t.removeAttribute(Mi),t.style.display==="none"&&(t.style.display=""))}function Gd(e,t){let n=e.querySelector('[class*="modelInputTypes"]');if(n===null)return;let r=Array.from(n.querySelectorAll('input[type="checkbox"]')),o=r.find(i=>{let a=i.closest("label")?.textContent?.trim();return a!==void 0&&t.includes(a)});return o!==void 0?o:r.length===2?r[1]:void 0}function In(e,t,n){let r=Gd(e,n);return r===void 0||r.disabled?!1:(r.checked!==t&&r.click(),!0)}function Si(e,t,n){return t==null||e===void 0?t:In(e,t.includes("image"),n)?void 0:t}function Hd(e,t){let n=e.getAttribute("aria-label")??"";if(t.some(o=>n.startsWith(o)))return!0;let r=e.closest("label")?.textContent?.trim()??"";return r.length>0&&t.some(o=>r.includes(o))}function Ni(e,t){let n=[...t.modelId,...t.modelName],r=Array.from(e.querySelectorAll("input")).filter(s=>s.type!=="checkbox"&&s.type!=="radio").filter(s=>s.closest("[data-plugin]")===null).filter(s=>!n.some(d=>(s.getAttribute("aria-label")??"").startsWith(d))),o=r.find(s=>Hd(s,t.contextWindow)),i=r.find(s=>Hd(s,t.maxOutput));if(o!==void 0&&i!==void 0)return{contextWindow:o,maxOutput:i};let a=r.filter(s=>s!==o&&s!==i);return{contextWindow:o??a[0],maxOutput:i??(o!==void 0?a[0]:a[1])}}function Ud(e,t,n){let r=Ni(e,t),o=(i,a)=>i===void 0||i.disabled||a===void 0||!Number.isFinite(a)||a<=0||Ve(i.value)!==void 0?!1:zd(i,String(a));return{contextWindow:o(r.contextWindow,n.contextWindow),maxOutput:o(r.maxOutput,n.maxTokens)}}function zd(e,t){return e.disabled?!1:(e.value===t||(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))),!0)}function zp(e,t){let n=Ni(e,t),r=a=>{if(a!==void 0)return Ve(a.value)},o=r(n.contextWindow),i=r(n.maxOutput);return{...o===void 0?{}:{contextWindow:o},...i===void 0?{}:{maxTokens:i}}}function jp(e,t,n){let r=Ni(e,t),o=(i,a)=>i===void 0?!1:zd(i,a===void 0||!Number.isFinite(a)||a<=0?"":String(a));return{contextWindow:"contextWindow"in n?o(r.contextWindow,n.contextWindow):!1,maxOutput:"maxTokens"in n?o(r.maxOutput,n.maxTokens):!1}}async function $p(e,t,n){if(e===void 0)return!1;let r=t.inputImage;if(Cn(e))return In(e,!0,r);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return!1;let i=qd(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),Cn(o)||await n();try{return Cn(o)&&In(o,!0,r)}finally{i.click()}}async function Vp(e,t,n,r){if(e.matches('[class*="modelAdvanced"]'))return r(e);let o=e.closest('[class*="modelEntry"]')??e;if(o.querySelector('[class*="modelAdvanced"]')!==null)return r(o);let i=qd(o,t.capacity);if(i===void 0||i.disabled)return!1;i.click(),o.querySelector('[class*="modelAdvanced"]')===null&&await n();try{return o.querySelector('[class*="modelAdvanced"]')!==null?r(o):!1}finally{i.click()}}function Yp(e,t,n,r,o){n.disposed||!e.isConnected||Di(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(a=>o.capacity.some(s=>(a.getAttribute("aria-label")??"").startsWith(s)))||Rr(e,Xp(e,ke(r.namespace),o),{t:t.t,onRequest:a=>jd(n,t,a)})}function Xp(e,t,n){let r=[];for(let o of ci(e)){let i=Dn(o);if(i===void 0)continue;let a=at(i,t,n);a===void 0||a.staged||r.push({catalogue:o,route:a.route})}return r}function Jp(e,t,n){let r=[],o=new Set;for(let i of e){if(o.has(i.card))continue;o.add(i.card);let a=at(i.card,t,n);if(a===void 0)continue;let[s]=ci(i.card);s!==void 0&&r.push({catalogue:s,route:a.route})}return r}function Qp(e,t,n,r){let o=[],i=new Set;for(let a of r.capacity){let s=Array.from(e.querySelectorAll("button[aria-label]")).filter(d=>(d.getAttribute("aria-label")??"").startsWith(a));for(let d of s){let l=Dn(d);if(l===void 0)continue;let f=d.closest('[class*="modelEntry"]')??l,m=Ee(f,r.modelId);m.length===0||i.has(m)||at(l,n,r)?.route===t&&(i.add(m),o.push({id:m,name:Ee(f,r.modelName),row:f}))}}return o}async function jd(e,t,n,r=[]){if(n.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};if(e.adapting.has(n))return{held:0,unsuggested:0,blocked:"busy"};e.adapting.add(n);let o=0,i=0;try{Xo();let a,s=()=>a??(a=t.describeNamespace()),d=await s(),l=ke(d.namespace);if(d.writable!==!0)return{held:0,unsuggested:0,blocked:"unwritable"};if(!$t(l,n)&&r.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};let m=Gt(l,n),u=new Set;for(let k of m){let M=typeof k.id=="string"?k.id:"";M.length>0&&u.add(M)}let c=m.slice();for(let k of r)k.id.length===0||u.has(k.id)||c.push({id:k.id,name:k.name});if(c.length===0)return{held:0,unsuggested:0,blocked:"no-models"};let p=l[n]??{},b=typeof p.api=="string"?p.api:void 0,h=new Set,x=new Map;for(let[k,M]of e.mounted)M.props.route===n&&(x.set(M.props.modelId,k),M.props.efforts!==void 0&&h.add(M.props.modelId));let S=new Map;for(let k of r)k.row!==void 0&&S.set(k.id,k.row);let v=!1,P=(k,M)=>Si(x.get(k),M,t.labels().inputImage),D=async(k,M)=>{if(M.image!==!0)return!1;let W=x.get(k)??S.get(k);return W===void 0?!1:$p(W,t.labels(),Ad)},z=async(k,M,W)=>{let T=M.image===!0,R=W.contextWindow!==void 0||W.maxTokens!==void 0;if(!T&&!R)return!1;let N=x.get(k)??S.get(k);if(N===void 0)return!1;let B=t.labels();return Vp(N,B,Ad,O=>{let U=T&&Cn(O)&&In(O,!0,B.inputImage),X=R?Ud(O,B,W):{contextWindow:!1,maxOutput:!1};return{modality:U,capacities:X.contextWindow||X.maxOutput}})},oe=kr(t.api,s,(k,M,W,T,R,N)=>{Pn(e,k,M,W,T,P(M,R),N)},(k,M,W)=>{Kd(e,k,M,{...W,input:P(M,W.input)})},void 0,()=>v);for(let k of c){let M=typeof k.id=="string"?k.id:"";if(M.length===0)continue;let W=br(c,M),T=yr(c,M),R=W!==void 0||k[Ae]===!0,N=Array.isArray(T)&&T.length>0||k[rt]===!0;if(h.has(M)&&!R)continue;if(R&&N){let fe=x.get(M)??S.get(M);if(Array.isArray(T)&&T.includes("image")&&fe!==void 0){let F=t.labels().inputImage,G=Gd(fe,F);G!==void 0&&!G.disabled&&!G.checked&&In(fe,!0,F)}continue}let B=wr(c,M),O=xr(c,M)??"",U=await oe.suggest(n,M,vr(c,M));if(!U.ok){i+=1;continue}let X=U.suggestion,ce=X.efforts!==!1,j=X.input===void 0?Tt(T):Tt(X.input);if(R){if(!j.image||e.queued.get(n)?.has(M)===!0)continue;if(await D(M,j)){o+=1;continue}v=!u.has(M),oe.commit(n,M,Lr({efforts:"keep",input:Sr(j)})),v&&t.onPendingChanged?.(),v=!1,o+=1;continue}let re=X.defaultEffort??O,J=re===O?void 0:re===""?null:re;v=!u.has(M);let $=await z(M,j,{...X.contextWindow===void 0?{}:{contextWindow:X.contextWindow},...X.maxTokens===void 0?{}:{maxTokens:X.maxTokens}}),de=$!==!1&&$.modality;oe.commit(n,M,Lr({efforts:di(ce,Ut(Et(X.efforts)),W),input:de||Mr(j,T)?void 0:Sr(j),defaultEffort:J,appliedCompat:X.compat,routeApi:b,initialCompat:B})),v&&t.onPendingChanged?.(),v=!1,o+=1}return{held:o,unsuggested:i}}catch(a){return console.warn("[bre] provider-wide adapt failed:",a),{held:o,unsuggested:i,failed:a instanceof Error?a.message:String(a)}}finally{e.adapting.delete(n)}}function Zp(e){return e.querySelector(`[data-plugin="${pe}"]`)!==null}function em(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&e.effortsUnset===t.effortsUnset&&wn(e.efforts,t.efforts)&&nm(e.input,t.input)&&tm(e.compat,t.compat)}function tm(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function nm(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function Li(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function at(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&$t(t,r))return{route:r,staged:!1};if(Li(e,n.routeId)){let a=Ee(e,n.routeId);return a.length>0&&!$t(t,a)?{route:a,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let i=Object.entries(t).find(([,a])=>a.displayName===o);if(i!==void 0)return{route:i[0],staged:!1};if($t(t,o))return{route:o,staged:!1}}function rm(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(m,u)=>(m.textContent??"").trim()===u,i=n.querySelector('[class*="primaryButton"]'),a=n.querySelector('[class*="secondaryButton"]');if(i!==null&&a!==null)return{submit:i,cancel:a};let s=[...r].reverse().find(m=>t.apply.some(u=>o(m,u))),d=[...r].reverse().find(m=>t.cancel.some(u=>o(m,u)));if(s!==void 0&&d!==void 0)return{submit:s,cancel:d};let l=r[r.length-1],f=r[r.length-2];if(!(l===void 0||f===void 0))return{submit:l,cancel:f}}function Yr(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}var Ei=new WeakMap,Ai=new Set;function $d(){for(let e of Array.from(Ai))e.release()}var Pi=420,Vd=320,om=160,Cd=2e3,im=150,Yd=new Set(["PageUp","PageDown","Home","End","ArrowUp","ArrowDown"," "]);function Xd(e,t=Vd){for(let n of Ir(e)){let r=Xr.get(n);if(r!==void 0){window.clearTimeout(r.timer),r.timer=window.setTimeout(()=>Od(n),t);continue}Xr.set(n,{saved:n.style.overflowAnchor,timer:window.setTimeout(()=>Od(n),t)}),n.style.overflowAnchor="none"}}var Xr=new Map;function Od(e){let t=Xr.get(e);t!==void 0&&(Xr.delete(e),e.style.overflowAnchor=t.saved)}function Qr(e,t){let n=Ir(e),r=n[0];if(r===void 0||!e.isConnected)return;let o=performance.now(),i=Ei.get(r);if(i!==void 0){i.deadline=Math.min(Math.max(i.deadline,o+t),i.startedAt+Cd);return}let a=e.getBoundingClientRect(),s=a.top,d=a.height,l=new Map,f=new Map;for(let S of n)l.set(S,S.scrollTop),f.set(S,S.style.overflowAnchor),S.style.overflowAnchor="none";let m=new Set(n),u={deadline:o+t,startedAt:o,frame:void 0,release:()=>{}},c=()=>{if(Ai.delete(u)){u.frame!==void 0&&(window.cancelAnimationFrame(u.frame),u.frame=void 0);for(let[S,v]of f)S.style.overflowAnchor=v;Ei.delete(r),document.removeEventListener("wheel",p,!0),document.removeEventListener("touchstart",p,!0),document.removeEventListener("pointerdown",p,!0),document.removeEventListener("keydown",b,!0)}};function p(){c()}function b(S){Yd.has(S.key)&&c()}u.release=c,Ei.set(r,u),Ai.add(u),document.addEventListener("wheel",p,{capture:!0,passive:!0}),document.addEventListener("touchstart",p,{capture:!0,passive:!0}),document.addEventListener("pointerdown",p,{capture:!0}),document.addEventListener("keydown",b,{capture:!0});let h=0,x=()=>{if(u.frame=void 0,h+=1,!e.isConnected||h>=im){c();return}let S=e.getBoundingClientRect(),v=Math.abs(S.height-d)>.5;if(!v&&[...m].some(z=>z.scrollTop!==l.get(z))){c();return}let P=S.top-s;P!==0&&am(n,m,l,P);let D=performance.now();if(v&&(d=S.height,u.deadline=Math.min(Math.max(u.deadline,D+om),u.startedAt+Cd)),D>=u.deadline){c();return}u.frame=window.requestAnimationFrame(x)};u.frame=window.requestAnimationFrame(x)}function am(e,t,n,r){let o=r;for(let i of[...t,...e]){if(o===0)break;let a=i.scrollTop;if(a!==n.get(i))continue;i.scrollTop=a+o;let s=i.scrollTop;s!==a&&(n.set(i,s),t.add(i),o-=s-a)}}var Jd='[class*="modelList"]',sm="bre-list-slack",dm=3e3,Zr,Vt=new WeakMap,Yt=new Set;function Qd(e){if(!(e instanceof Element))return;let t=e.closest(Jd);if(t===null)return;let n=Ir(t).map(r=>({host:r,top:r.scrollTop}));n.length!==0&&(Zr={targets:n,at:performance.now()})}function st(){Zr=void 0}function Zd(e){Qd(e.target)}function el(e){if(Yd.has(e.key)){st();return}Qd(e.target)}var Nn=0;function tl(){Nn+=1,!(Nn>1)&&(document.addEventListener("click",Zd,!0),document.addEventListener("keydown",el,!0),document.addEventListener("focusin",st,!0),document.addEventListener("pointerdown",st,!0),document.addEventListener("wheel",st,{capture:!0,passive:!0}),document.addEventListener("touchstart",st,{capture:!0,passive:!0}))}function Jr(e){let t=Vt.get(e);t!==void 0&&(Vt.delete(e),Yt.delete(t),t.scrollTarget.removeEventListener("scroll",t.onScroll),t.spacer.remove())}function lm(e){return e===document.scrollingElement?document:e}function cm(){if(Yt.size!==0)for(let e of Array.from(Yt)){let t=e.host;if(!e.spacer.isConnected){Vt.delete(t),Yt.delete(e),e.scrollTarget.removeEventListener("scroll",e.onScroll);continue}t.scrollTop<=t.scrollHeight-t.clientHeight-e.height&&Jr(t)}}function Nd(e,t){return e.scrollTop>e.scrollHeight-e.clientHeight-t}function um(e=performance.now()){let t=Zr;if(!(t===void 0||e-t.at>dm))for(let n of t.targets){let r=n.host;if(!r.isConnected)continue;let o=Vt.get(r),i=o===void 0?0:o.height,a=r.scrollHeight-r.clientHeight-i,s=n.top-a;if(s<=0){o!==void 0&&!Nd(r,o.height)&&Jr(r);continue}let d=o;if(d===void 0){let l=document.createElement("div");l.className=sm,l.dataset.plugin=pe,l.setAttribute("aria-hidden","true"),l.style.height="0px",(r===document.scrollingElement?document.body??r:r).appendChild(l);let m=()=>{let u=Vt.get(r);u!==void 0&&!Nd(r,u.height)&&Jr(r)};d={host:r,spacer:l,height:0,onScroll:m,scrollTarget:lm(r)},Vt.set(r,d),Yt.add(d),d.scrollTarget.addEventListener("scroll",m,{passive:!0})}d.height!==s&&(d.height=s,d.spacer.style.height=`${s}px`),r.scrollTop!==n.top&&(r.scrollTop=n.top)}}function nl(){if(Nn=Math.max(0,Nn-1),!(Nn>0)){document.removeEventListener("click",Zd,!0),document.removeEventListener("keydown",el,!0),document.removeEventListener("focusin",st,!0),document.removeEventListener("pointerdown",st,!0),document.removeEventListener("wheel",st,!0),document.removeEventListener("touchstart",st,!0),Zr=void 0;for(let e of Array.from(Yt))Jr(e.host)}}function rl(e,t=Pi){um(),cm();let n=new Set;for(let r of Array.from(e.querySelectorAll(Jd))){let o=r.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');o===null||n.has(o)||(n.add(o),Qr(o,t))}}function fm(e,t){Yr(e,t,()=>{let n=e.closest('[class*="modelEntry"]')??e.closest('[class*="rowCard"]');n!==null&&Qr(e.closest('[class*="rowCard"]')??n,Pi)})}var Pd="{provider}";function pm(e,t){let n=t.editProvider.map(o=>{let i=o.indexOf(Pd);return i<0?void 0:{prefix:o.slice(0,i),suffix:o.slice(i+Pd.length)}}).filter(o=>o!==void 0);if(n.length===0)return[];let r=[];for(let o of Array.from(e.querySelectorAll("button[aria-label]"))){let i=o.getAttribute("aria-label")??"";n.some(a=>i.length>a.prefix.length+a.suffix.length&&i.startsWith(a.prefix)&&i.endsWith(a.suffix))&&o.closest("[data-plugin]")===null&&r.push(o)}return r}function mm(e,t){Yr(e,t,()=>{let n=e.closest('[class*="rowCard"], [class*="setupCard"], [class*="addCard"]');n!==null&&Qr(n,Pi)})}function Di(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function ol(){return Di(We())!==void 0}function hm(e,t,n){let r={routeId:t.routeId,modelName:t.modelName,baseUrl:t.baseUrl,apiProtocol:t.apiProtocol},o=new Set;for(let i of Array.from(e.querySelectorAll('[class*="editor"], [class*="addCard"], [class*="rowCard"]')))Li(i,t.apiProtocol)&&Li(i,t.baseUrl)&&o.add(i);for(let i of o)Td(i,r,{t:n})}function Ii(e,t,n){if(n.disposed||!e.isConnected)return;let r=t.labels(),o=Di(e)!==void 0;for(let s of Array.from(e.querySelectorAll('[class*="rowCard"], [class*="setupCard"]')))for(let d of pm(s,r))mm(d,n.editWired);hm(e,r,t.t);let i=Array.from(e.querySelectorAll("button[aria-label]")).some(s=>r.capacity.some(d=>(s.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(Rr(e,[],{t:t.t}),n.mounted.size>0){for(let[d,l]of n.mounted)On(d),Hn(d),l.editor.unmount();n.mounted.clear()}let s=n.editing;n.editing=!1,(s!==!1||Np(n)&&Date.now()>=n.nextFlushAt)&&Op(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!i){for(let[d,l]of n.mounted)On(d),Hn(d),l.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let s=r;n.describePromise.then(d=>{Yp(e,t,n,d,s)}).catch(d=>{n.describePromise=void 0,console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}for(let s of r.capacity)for(let d of Array.from(e.querySelectorAll("button[aria-label]")))(d.getAttribute("aria-label")??"").startsWith(s)&&fm(d,n.disclosureWired);n.describePromise??(n.describePromise=t.describeNamespace());let a=s=>{if(n.disposed||!e.isConnected)return;let d=s.namespace,l=ke(d),f=[];for(let u of r.capacity){let c=Array.from(e.querySelectorAll("button[aria-label]")).filter(p=>(p.getAttribute("aria-label")??"").startsWith(u));for(let p of c){let b=Dn(p);if(b===void 0)continue;let h=p.closest('[class*="modelEntry"]')??b,x=Ee(h,r.modelId);x.length!==0&&f.push({container:Gp(p),row:h,modelId:x,card:b})}}Rr(e,Jp(f,l,r),{t:t.t,onRequest:u=>jd(n,t,u,Qp(e,u,l,r))});for(let[u,c]of n.mounted)f.some(p=>p.container===u)||(On(u),Hn(u),c.editor.unmount(),n.mounted.delete(u));if(n.pending.size>0){let u=new Map;for(let p of f){let b=at(p.card,l,r);if(b===void 0)continue;let h=u.get(b.route);h===void 0&&u.set(b.route,h=new Set),h.add(p.modelId)}let c=new Map;for(let[p,b]of n.pending){if(!$t(l,p))continue;let h=u.get(p),x=[...b.keys()].filter(S=>!h?.has(S));x.length>0&&c.set(p,new Set(x))}for(let[p,b]of c){let h=n.missedScans.get(p);if(h!==void 0)for(let x of b)h.has(x)&&(Pn(n,p,x,void 0),h.delete(x),b.delete(x))}n.missedScans=c}else n.missedScans=new Map;let m=new Set(f.map(u=>u.card));for(let u of m){let c=at(u,l,r);if(c===void 0)continue;let p=c.route,b=rm(u,r);b===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Yr(b.submit,n.submitWired,()=>{let h=at(u,l,r)?.route??p;n.committing.add(h),Qe(n)}),Yr(b.cancel,n.cancelWired,()=>{let h=at(u,l,r)?.route??p;_p(n,h)}))}f.forEach((u,c)=>{let p=u.container;if(p===void 0)return;let b=at(u.card,l,r);if(b===void 0)return;let{route:h,staged:x}=b,S=l[h]??{},v=Gt(l,h),P=new Set(v.map(J=>J.id)),D=x||!P.has(u.modelId),z=D?n.pending.get(h)?.get(u.modelId)?.efforts:void 0,oe=D?z==="keep"?void 0:z:br(v,u.modelId),k=!D&&v.some(J=>J.id===u.modelId&&J[Ae]===!0),M=D?n.pending.get(h)?.get(u.modelId)?.input:yr(v,u.modelId),W=D?n.pending.get(h)?.get(u.modelId)?.compat:wr(v,u.modelId),T=D?n.pending.get(h)?.get(u.modelId)?.defaultEffort??void 0:xr(v,u.modelId),R=D?Ee(u.row,r.modelName):"",N=D?R.length>0?R:void 0:vr(v,u.modelId),B=x?Ee(u.card,r.apiProtocol):"",O=x?Ee(u.card,r.baseUrl):"",U=x&&B.length>0?B:typeof S.api=="string"?S.api:void 0,X=x&&O.length>0?O:typeof S.baseURL=="string"?S.baseURL:void 0,ce={route:h,routeDisplayName:x?h:typeof S.displayName=="string"?S.displayName:h,...U===void 0?{}:{routeApi:U},...X===void 0?{}:{routeBaseURL:X},modelId:u.modelId,...N===void 0?{}:{modelName:N},...oe===void 0?{}:{efforts:oe},...k?{effortsUnset:k}:{},...M===void 0?{}:{input:M},...W===void 0?{}:{compat:W},...T===void 0?{}:{defaultEffort:T},index:c,staged:D,officialInputTypes:Cn(p),onCoverageChange:J=>{J?Rd(p):Hn(p)},api:{...kr(t.api,void 0,(J,$,de,fe,F,G)=>{Pn(n,J,$,de,fe,Si(p,F,r.inputImage),G)},(J,$,de)=>{Kd(n,J,$,{...de,input:Si(p,de.input,r.inputImage)})},J=>{Ip(n,J,u.modelId)},()=>(at(u.card,l,r)?.staged??x)||!P.has(u.modelId)),fillCapacities:(J,$)=>{Ud(p,r,{...J===void 0?{}:{contextWindow:J},...$===void 0?{}:{maxTokens:$}})},readCapacities:()=>zp(p,r),setCapacities:J=>{jp(p,r,J)}},readOnly:s.writable!==!0,t:t.t};Oi(p),oe===!1?Hn(p):Rd(p);let j=n.mounted.get(p);if(j!==void 0){em(j.props,ce)||(j.props=ce,j.editor.render(ce));return}if(Zp(p))return;Qr(Dn(p)??u.card,Vd);let re=t.mount(p,ce);n.mounted.set(p,{editor:re,props:ce})})};n.describePromise.then(a,()=>{n.describePromise=void 0}).catch(s=>{console.error(`[bre] editor reconcile failed: ${s instanceof Error?s.message:String(s)}`)})}var _i=require("react");var se=require("react");var Ne=require("react"),sl=require("react-dom"),Ze=require("react/jsx-runtime"),il=6,gm=292,eo=8,bm=52;function al(e,t){let n=e.getBoundingClientRect(),r=t*bm+46,o=window.innerWidth||0,i=window.innerHeight||0,a=Math.max(eo,Math.min(n.left,o-gm-eo)),s=n.bottom+il,d=n.top-il-r,l=i>0&&s+r>i-eo&&d>eo?d:s;return{left:a,top:l}}function dl(e){let{anchor:t,label:n,options:r,selected:o,onPick:i,onClose:a}=e,[s,d]=(0,Ne.useState)(()=>al(t,r.length)),l=(0,Ne.useRef)(null),f=(0,Ne.useRef)([]);(0,Ne.useLayoutEffect)(()=>{let c=()=>{d(al(t,r.length))};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,r.length]),(0,Ne.useEffect)(()=>{let c=Math.max(0,r.findIndex(p=>p.value===o));f.current[c]?.focus()},[r,o]),(0,Ne.useEffect)(()=>{let c=p=>{let b=p.target;b instanceof Node&&l.current?.contains(b)!==!0&&(t.contains(b)||a())};return document.addEventListener("pointerdown",c,!0),()=>{document.removeEventListener("pointerdown",c,!0)}},[t,a]);let m=(0,Ne.useCallback)(c=>{if(r.length===0)return;let p=(c+r.length)%r.length;f.current[p]?.focus()},[r.length]),u=c=>{let p=f.current.findIndex(b=>b===document.activeElement);if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),a();return}if(c.key==="ArrowDown"){c.preventDefault(),m(p+1);return}if(c.key==="ArrowUp"){c.preventDefault(),m(p<0?r.length-1:p-1);return}if(c.key==="Home"){c.preventDefault(),m(0);return}c.key==="End"&&(c.preventDefault(),m(r.length-1))};return(0,sl.createPortal)((0,Ze.jsxs)("div",{ref:l,className:"bre-protocol-menu",style:{left:s.left,top:s.top},onKeyDown:u,children:[(0,Ze.jsx)("p",{className:"bre-protocol-menu-title",children:n}),(0,Ze.jsx)("ul",{className:"bre-protocol-menu-list",role:"listbox","aria-label":n,children:r.map((c,p)=>{let b=c.value===o;return(0,Ze.jsx)("li",{children:(0,Ze.jsx)("button",{ref:h=>{f.current[p]=h},type:"button",role:"option","aria-selected":b,"aria-checked":b,"data-protocol-value":c.value,className:"bre-protocol-option",tabIndex:-1,onClick:()=>{i(c.value)},children:(0,Ze.jsxs)("span",{className:"bre-protocol-option-text",children:[(0,Ze.jsx)("span",{className:"bre-protocol-option-title",children:c.title}),(0,Ze.jsx)("span",{className:"bre-protocol-option-hint",children:c.hint})]})})},c.value)})})]}),document.body)}var C=require("react/jsx-runtime"),ym=["M8 3.9v8.2","M3.9 8h8.2"],wm="M3.9 8.35 6.6 11.05 12.1 5.5";function ll({paths:e}){return(0,C.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,C.jsx)("path",{d:t},t))})}function vm(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function cl(e){return e.alias??e.masked??e.ref}function xm(e,t){return e.models===void 0?t("keysScopeAll"):e.models.length===0?t("keysScopeNone"):t("keysScopeCount",{count:e.models.length})}var pl=["openai-completions","openai-responses","anthropic-messages","google-generative-ai"],km={openai:null,anthropic:null,gemini:null},ul=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Em(e,t){return pl.filter(n=>n===t?!0:(e[Kr(n)]??"").length>0)}function ml(e,t){return t(e==="anthropic-messages"?"keysProtocolAnthropic":e==="openai-responses"?"keysProtocolResponses":e==="openai-completions"?"keysProtocolOpenAI":e==="google-generative-ai"?"keysProtocolGemini":"keysProtocolDefault")}function Tm(e,t){return t(e==="anthropic-messages"?"keysProtocolAnthropicHint":e==="openai-responses"?"keysProtocolResponsesHint":e==="openai-completions"?"keysProtocolOpenAIHint":e==="google-generative-ai"?"keysProtocolGeminiHint":"keysProtocolDefaultHint")}function fl(e,t,n,r=!1){return[void 0,...r?pl:Em(e,t)].map(i=>({value:i??"",title:ml(i,n),hint:Tm(i,n)}))}function to(e){let{route:t,t:n,draft:r}=e,o=e.client??Xe,[i,a]=(0,se.useState)(void 0),[s,d]=(0,se.useState)([]),[l,f]=(0,se.useState)(void 0),[m,u]=(0,se.useState)(!1),[c,p]=(0,se.useState)(void 0),[b,h]=(0,se.useState)(""),[x,S]=(0,se.useState)(""),[v,P]=(0,se.useState)([]),[D,z]=(0,se.useState)(void 0);(0,se.useEffect)(()=>{r===!0&&p({kind:"add"})},[r]);let[oe,k]=(0,se.useState)(void 0),[M,W]=(0,se.useState)(void 0),[T,R]=(0,se.useState)(km),[N,B]=(0,se.useState)([]),O=(0,se.useCallback)((g,L)=>{if(!g.ok){f({kind:"error",text:g.error??n("keysUnreachable")});return}a(g.entries),d(g.models??[]),B((g.unmergedModels??[]).slice().sort(ul.compare)),R(g.endpoints),f(L===void 0?void 0:{kind:"status",text:L})},[n]);(0,se.useEffect)(()=>{let g=!0;return(async()=>{let L=await o.list(t);g&&O(L,void 0)})(),()=>{g=!1}},[O,o,t]),(0,se.useEffect)(()=>{let g=L=>{let V=L.detail?.route;V!==void 0&&V!==t||(async()=>{let Q=await o.list(t);Q.ok&&O(Q,void 0)})()};return document.addEventListener(Tn,g),()=>{document.removeEventListener(Tn,g)}},[O,o,t]);let U=()=>{p(void 0),h(""),S(""),P([]),z(void 0)},X=(0,se.useCallback)(async(g,L)=>{let _=c;u(!0),k(void 0);try{let V=await g();O(V,L),V.ok&&_!==void 0&&_.kind!=="add"&&!V.entries.some(Q=>Q.ref===_.ref)&&U()}finally{u(!1)}},[O,c]),ce=(g,L)=>{p({kind:g,ref:L.ref}),h(g==="alias"?L.alias??"":""),S(""),P(L.models??[]),z(void 0),k(void 0)},j=()=>{if(m||c===void 0)return;let g=c.kind,L=c.ref;if(g!=="alias"&&g!=="scope"&&!Lt(x))return;let _=id(b),V=D;u(!0),(async()=>{try{if(g==="add"){let ie=new Set((i??[]).map(tt=>tt.ref)),me=await o.add(t,x,_);if(!me.ok){O(me,n("keysAdded"));return}let Se=V===void 0?void 0:me.entries.find(tt=>!ie.has(tt.ref)),Le=Se===void 0?me:await o.setProtocol(t,Se.ref,V);O(Le,n("keysAdded")),Le.ok&&U();return}if(L===void 0)return;if(g==="scope"){let ie=await o.setScope(t,L,v.length===0?void 0:v);O(ie,n("keysScopeSaved")),ie.ok&&U();return}let Q=g==="alias"?await o.rename(t,L,_):await o.replace(t,L,x);O(Q,n(g==="alias"?"keysRenamed":"keysReplaced")),Q.ok&&U()}finally{u(!1)}})()},re=g=>{P(L=>L.includes(g)?L.filter(_=>_!==g):[...L,g])},J=[...s,...N].sort(ul.compare),$=()=>{if(c===void 0)return null;let g=c.kind,L=g==="add"||g==="value",_=g==="scope",V=L&&x.length>0&&!Lt(x);return(0,C.jsxs)("div",{className:"bre-keys-form",children:[_?(0,C.jsx)("div",{className:"bre-keys-chips",role:"group","aria-label":n("keysScope"),children:J.length===0?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysScopeEmpty")}):J.map(Q=>{let ie=v.includes(Q);return(0,C.jsx)("button",{type:"button",className:ie?"bre-keys-chip is-selected":"bre-keys-chip","aria-pressed":ie,disabled:m,onClick:()=>re(Q),children:Q},Q)})}):(0,C.jsxs)("div",{className:"bre-keys-form-fields",children:[g==="value"?null:(0,C.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:b,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:m,autoFocus:g==="alias",onChange:Q=>h(Q.target.value)}),L?(0,C.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:x,placeholder:n(g==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":V,disabled:m,autoFocus:!0,onChange:Q=>S(Q.target.value)}):null]}),g==="add"?(0,C.jsx)("div",{className:"bre-keys-chips",role:"group","aria-label":n("keysProtocolCreate"),children:fl(T,void 0,n,r===!0).map(Q=>{let ie=Q.value===""?void 0:Q.value,me=D===ie;return(0,C.jsx)("button",{type:"button",className:me?"bre-keys-chip is-selected":"bre-keys-chip","aria-pressed":me,title:Q.hint,disabled:m,onClick:()=>z(ie),children:Q.title},Q.value)})}):null,g==="add"?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysProtocolCreateHint")}):null,_?(0,C.jsx)("p",{className:"bre-keys-hint",children:n("keysScopeHint")}):null,V?(0,C.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,C.jsxs)("div",{className:"bre-keys-form-actions",children:[_?(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-allmodels",disabled:m,onClick:()=>P([]),children:n("keysScopeAll")}):null,(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:U,children:n("keysCancel")}),(0,C.jsx)("button",{type:"button",className:"bre-primary-button",disabled:m||L&&!Lt(x),onClick:j,children:n(g==="add"?"keysAddConfirm":"keysSave")})]})]})},de=()=>c?.kind==="add"?(0,C.jsx)("li",{className:"bre-keys-form-row",children:$()}):(0,C.jsx)("li",{className:"bre-keys-add-row",children:(0,C.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:m,onClick:()=>{p({kind:"add"}),h(""),S(""),P([]),k(void 0)},children:[(0,C.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,C.jsx)(ll,{paths:ym})}),n("keysAdd")]})}),fe=(g,L)=>{let _=L===""?void 0:L;W(void 0),X(()=>o.setProtocol(t,g.ref,_),n("keysProtocolSaved"))},F=M===void 0?void 0:i?.find(g=>g.ref===M.ref);if(i===void 0)return l===void 0?(0,C.jsx)("div",{className:"bre-keys"}):(0,C.jsxs)("div",{className:"bre-keys",children:[(0,C.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),(0,C.jsx)("ul",{className:"bre-keys-list",children:de()})]});let G=i.reduce((g,L)=>L.enabled?g+1:g,0);return(0,C.jsxs)("div",{className:"bre-keys",children:[(0,C.jsxs)("ul",{className:"bre-keys-list",children:[i.map(g=>{let L=cl(g),_=g.enabled&&G<=1;return(0,C.jsxs)(se.Fragment,{children:[(0,C.jsxs)("li",{className:g.enabled?"bre-keys-row":"bre-keys-row is-off","data-state":g.configured===!1?"missing":"ready",children:[(0,C.jsx)("button",{type:"button",className:g.enabled?"bre-keys-toggle is-on":"bre-keys-toggle","aria-pressed":g.enabled,"aria-label":n(g.enabled?"keysDisable":"keysEnable",{name:L}),title:n(g.enabled?"keysDisable":"keysEnable",{name:L}),disabled:m||_,onClick:()=>{X(()=>o.setEnabled(t,g.ref,!g.enabled),void 0)},children:(0,C.jsx)("span",{className:"bre-keys-toggle-mark","aria-hidden":"true",children:(0,C.jsx)(ll,{paths:[wm]})})}),g.alias===void 0?null:(0,C.jsx)("span",{className:"bre-keys-alias",children:g.alias}),(0,C.jsx)("span",{className:g.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:vm(g,n)}),(0,C.jsx)("span",{className:oe===g.ref?"bre-keys-actions is-confirming":"bre-keys-actions",children:oe===g.ref?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:m,onClick:()=>{X(()=>o.remove(t,g.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:()=>k(void 0),children:n("keysCancel")})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"bre-keys-protocol-wrap",children:(0,C.jsxs)("button",{type:"button",className:"bre-keys-protocol","aria-haspopup":"listbox","aria-expanded":M?.ref===g.ref,"aria-label":n("keysProtocolLabel",{name:L}),title:n("keysProtocolLabel",{name:L}),disabled:m,onClick:V=>{let Q=V.currentTarget;W(ie=>ie?.ref===g.ref?void 0:{ref:g.ref,anchor:Q}),k(void 0)},children:[(0,C.jsx)("span",{className:"bre-keys-protocol-label",children:ml(g.protocol,n)}),(0,C.jsx)("span",{className:"bre-keys-protocol-caret","aria-hidden":"true",children:"\u203A"})]})}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:()=>{k(g.ref),p(void 0)},children:n("keysRemove")}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:()=>ce("alias",g),children:n("keysAlias")}),r===!0?null:(0,C.jsx)("button",{type:"button",className:"bre-link-button bre-keys-scope",disabled:m,title:n("keysScope",{name:L}),onClick:()=>ce("scope",g),children:xm(g,n)}),(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:()=>ce("value",g),children:n("keysEdit")})]})})]}),c!==void 0&&c.ref===g.ref?(0,C.jsx)("li",{className:"bre-keys-form-row",children:$()}):null]},g.ref)}),de()]}),r===!0?(0,C.jsx)("p",{className:"bre-keys-note",children:n("keysDraftHint")}):null,N.length===0?null:(0,C.jsxs)("p",{className:"bre-keys-note",children:[n("keysMergedOffer",{count:N.length,models:N.join(", ")})," ",(0,C.jsx)("button",{type:"button",className:"bre-link-button",disabled:m,onClick:()=>{X(()=>o.applyMerged(t),n("keysMergedApplied"))},children:n("keysMergedApply")})]}),l===void 0?null:(0,C.jsx)("p",{className:"bre-effort-message bre-"+l.kind,role:l.kind==="error"?"alert":"status",children:l.text}),M===void 0||F===void 0?null:(0,C.jsx)(dl,{anchor:M.anchor,label:n("keysProtocolLabel",{name:cl(F)}),options:fl(T,F.protocol,n,r===!0),selected:F.protocol??"",onPick:g=>fe(F,g),onClose:()=>W(void 0)})]})}var At="bre-key-managed",Mm="bre-keys-host",Fi="data-bre-key-host",Sm="data-bre-key-input",no="data-bre-region",ht=new WeakMap;function Lm(e){let t=e.querySelector(`input[${Sm}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function hl(e){let t=ht.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(Fi)?n:void 0}function gl(e,t){let n=t.route;if(n===void 0||n.length===0||Lm(e)===void 0||e.parentElement===null)return;be(e,At,!0);let r=ht.get(e),o=hl(e);o===void 0&&(r!==void 0&&bl(e,r),o=e.ownerDocument.createElement("div"),o.className=Mm,e.after(o)),ee(o,Fi,n);let i=e.getAttribute(no);i===null?o.hasAttribute(no)&&o.removeAttribute(no):ee(o,no,i);let a=()=>(0,_i.createElement)(qe,{fallbackText:t.t("keysPanelFailed")},(0,_i.createElement)(to,{route:n,t:t.t,client:t.client})),s=ht.get(e);if(s!==void 0&&s.route===n){(s.t!==t.t||s.client!==t.client)&&(s.t=t.t,s.client=t.client,s.mount.root.render(a()));return}s!==void 0&&(ht.delete(e),s.mount.root.unmount()),ht.set(e,{route:n,host:o,mount:ot(o,a(),{sync:!0}),t:t.t,client:t.client})}function bl(e,t){ht.delete(e),Ce(t.mount)}function ro(e){be(e,At,!1);let t=ht.get(e);t!==void 0&&bl(e,t),hl(e)?.remove()}function yl(){for(let e of Array.from(document.querySelectorAll(`[${Fi}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&ht.has(t)?ro(t):e.remove()}}var wl="http://www.w3.org/2000/svg",Am="data-bre-icon";function Rm(e){let t=document.createElementNS(wl,"path");return t.setAttribute("d",e),t}function vl(e,t){let n=document.createElementNS(wl,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute(Am,e),n.append(...t.map(Rm)),n}var Ht="bre-key-field",El="bre-key-eye",_n="data-bre-key-input",Tl="data-bre-eye-show",Ml="data-bre-eye-hide",xl=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],oo=new WeakMap,Rt=new WeakMap;function io(e){let t=e.querySelector(`input[${_n}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Wi(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(El))return t}function Sl(e){let t=io(e);t!==void 0&&(ee(t,_n,""),be(e,Ht,!0))}function Ll(e,t){let n=io(e);if(n===void 0){Xt(e);return}oo.get(e)?.route!==t.route&&Rt.delete(e),oo.set(e,t),ee(n,_n,""),be(e,Ht,!0);let r=Wi(e)??Cm(e);ee(r,Tl,t.t("keyRevealShow")),ee(r,Ml,t.t("keyRevealHide")),Ki(r,n)}function Xt(e){let t=Wi(e);t!==void 0&&t.remove(),oo.delete(e),be(e,Ht,!1);let n=e.querySelector(`input[${_n}]`);n instanceof HTMLInputElement&&(n.removeAttribute(_n),n.type="password");let r=Rt.get(e);Rt.delete(e),r!==void 0&&n instanceof HTMLInputElement&&n.value===r&&qi(n,"")}async function Hm(e){try{let t=await fetch(`${rr}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function Ki(e,t){let n=t.type!=="password";ee(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?Ml:Tl);r!==null&&(ee(e,"aria-label",r),ee(e,"title",r)),Ge(e,t.disabled)}function qi(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function Cm(e){let t=document.createElement("button");t.type="button",t.className=El,t.append(kl("eye"),kl("eye-off"));let n=async()=>{let r=io(e),o=oo.get(e);if(r===void 0||o===void 0)return;if(r.type!=="password"){let a=Rt.get(e);Rt.delete(e),a!==void 0&&r.value===a&&qi(r,""),r.type="password",Ki(t,r);return}let i=o.route;if(i!==void 0&&Rt.get(e)===void 0&&r.value.length===0){ee(t,"aria-busy","true");let a;try{a=await(o.loadKey??Hm)(i)}catch{a=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),a===void 0){let s=o.t("keyRevealFailed");ee(t,"aria-label",s),ee(t,"title",s);return}if(Wi(e)!==t||!t.isConnected||io(e)!==r||r.value.length>0)return;Rt.set(e,a),qi(r,a)}r.type="text",Ki(t,r)};return t.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n()}),e.append(t),t}function kl(e){let t=e==="eye-off"?[...xl,"M2.5 13.5 13.5 2.5"]:xl;return vl(e,t)}var Gi="bre-editor-tabs",Om="bre-editor-tab",ao="data-bre-tab-id",Kn="bre-tabbed",bt="data-bre-tab",Al="data-bre-provider",Pe="data-bre-region",Fn="data-bre-editor-body",en="data-bre-footer",Nm="row",Pm="path",qn="data-bre-details";var Dm=".bre-headers",Im=".bre-fingerprint",_m="data-bre-fingerprint",gt="provider",Jt="models",Qt="fingerprint",Zt="advanced",Fm=[gt,Jt,Qt,Zt],Km="none",Rl=Fm,Hl=Gi,Cl=Om,Ol=ao,so='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',qm='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',Nl='[class*="rowCard"], [class*="addCard"], li',Wm='[class*="addPanel"]',Bi=".bre-create-host";function Pl(){return{warned:new WeakSet}}function tn(e){return e===null?null:e.closest(Nl)}function Dl(e){let t=tn(e);return t!==null&&t.querySelector(Bi)!==null}function Il(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.matches(Wm)&&!t.hidden)return t;return e}function _l(e,t){let n=Dr(e),r=e.getBoundingClientRect().top,o=n?.scrollTop??0;n!==void 0&&(n.style.overflowAnchor="none"),ee(e,bt,t),ql(e),n!==void 0&&requestAnimationFrame(()=>{if(n.style.overflowAnchor="",n.scrollTop!==o)return;let i=e.getBoundingClientRect().top-r;i!==0&&(n.scrollTop+=i)})}function Ui(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(so))){let i=o.closest(Nl);i!==null&&r.add(i)}for(let o of Array.from(e.querySelectorAll(`.${Kn}`)))r.has(o)||lo(o);for(let o of r)try{$m(o,t)}catch(i){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",i)),lo(o)}}function Fl(){for(let e of Array.from(document.querySelectorAll(`.${Kn}`))){e.classList.remove(Kn),e.removeAttribute(bt),e.removeAttribute(Fn);for(let t of Array.from(e.querySelectorAll(`[${Pe}]`)))t.removeAttribute(Pe)}for(let e of Array.from(document.querySelectorAll(`[${bt}]`)))e.removeAttribute(bt);for(let e of Array.from(document.querySelectorAll(`[${Pe}]`)))e.removeAttribute(Pe);for(let e of Array.from(document.querySelectorAll(`[${Fn}]`)))e.removeAttribute(Fn);for(let e of Array.from(document.querySelectorAll(`[${en}]`)))e.removeAttribute(en);for(let e of Array.from(document.querySelectorAll(`details[${qn}]`)))e.removeAttribute("open"),e.removeAttribute(qn);for(let e of Array.from(document.querySelectorAll(`.${Ht}`)))Xt(e);for(let e of Array.from(document.querySelectorAll(`.${At}`)))ro(e);yl()}function Bm(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(so)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(so);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Gm(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};Kl(e,t,0);let{actions:n,fields:r,header:o,models:i}=t;if(!(n===void 0||r.length===0)&&r.some(a=>a.querySelector("input, select, textarea")!==null))return{header:o,models:i,actions:n,fields:r}}var Um=4;function Kl(e,t,n){if(!(n>Um)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(qm)){t.models??(t.models=r);continue}if(r.querySelector(so)!==null){Kl(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}if(r.querySelector("input, select, textarea")!==null){t.fields.push(r);continue}(r.matches("p, small, em, i")||r.matches('[class*="Hint"], [class*="error"]'))&&t.fields.push(r)}}}function zm(e,t){if(!t.contains(e))return;ee(e,en,Nm);let n=e.parentElement;for(;n!==null&&(ee(n,en,Pm),n!==t);)n=n.parentElement}function jm(e){let n=e.querySelector(`[${Al}]`)?.getAttribute(Al);return n==null||n===""?void 0:n}function $m(e,t){let n=Il(e),r=Bm(n);if(r===void 0){lo(e);return}let o=Gm(r);if(o===void 0){lo(e);return}let i=n.querySelector(Dm),a=jm(n);for(let m of o.fields)ee(m,Pe,gt),Ll(m,{t:t.t,route:a}),gl(m,{t:t.t,route:a});o.header!==void 0&&ee(o.header,Pe,Km),o.models!==void 0&&ee(o.models,Pe,Jt),ee(r,Fn,""),n.querySelector(Bi)!==null&&zm(o.actions,r),i!==null&&ee(i,Pe,Zt);let s=n.querySelector(Im);s!==null&&ee(s,Pe,Qt),Ym(r);let d=new Set([gt]);o.models!==void 0&&d.add(Jt),i!==null&&d.add(Zt);let l=n.querySelector(Bi)!==null;s!==null&&!l&&s.getAttribute(_m)==="ready"&&d.add(Qt);let f=e.getAttribute(bt)??gt;ee(e,bt,d.has(f)?f:gt),be(e,Kn,!0),Vm(e,n,t,d)}function Vm(e,t,n,r){let o=t.querySelector(`.${Gi}`);o!==null&&(ee(o,"aria-label",n.t("editorTabsLabel")),xn(Ct(o,gt),n.t("editorTabProvider")),xn(Ct(o,Jt),n.t("editorTabModels")),xn(Ct(o,Zt),n.t("editorTabAdvanced")),xn(Ct(o,Qt),n.t("editorTabFingerprint")),Ge(Ct(o,Jt),!r.has(Jt)),Ge(Ct(o,Zt),!r.has(Zt)),Ge(Ct(o,Qt),!r.has(Qt)),ql(e,o))}function ql(e,t){let n=t??Il(e).querySelector(`.${Gi}`);if(n===null)return;let r=e.getAttribute(bt)??gt;for(let o of Array.from(n.querySelectorAll(`[${ao}]`)))ee(o,"aria-selected",o.getAttribute(ao)===r?"true":"false")}function Ct(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(ao)===t)return n}function lo(e){e.classList.remove(Kn),e.removeAttribute(bt),e.removeAttribute(Fn);for(let t of Array.from(e.querySelectorAll(`[${Pe}]`)))t.getAttribute(Pe)===gt&&(Xt(t),ro(t)),t.removeAttribute(Pe);for(let t of Array.from(e.querySelectorAll(`[${en}]`)))t.removeAttribute(en);Xm(e)}function Ym(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(ee(t,qn,"closed"),ee(t,"open",""))}function Xm(e){for(let t of Array.from(e.querySelectorAll(`details[${qn}]`)))t.removeAttribute("open"),t.removeAttribute(qn)}var Mc=require("react");var Te=require("react");var le=require("react");var Jm='p[class*="savedNotice"]',Gl="data-bre-saved-hidden",Qm="bre-auto-effort-note",Zm="data-bre-auto-effort-phase",Wl="bre-auto-effort-note-text",nn=new Map,Bl=new WeakMap,rn=null,co=null;function Ul(e){let t=Array.from(e.querySelectorAll(Jm));for(let n of t){let r=n.textContent?.trim()??"";Bl.get(n)!==r&&(Bl.set(n,r),r.length>0&&Vl(r)),!nn.has(n)&&(nn.set(n,n.style.display),n.setAttribute(Gl,""),n.style.display="none")}for(let[n,r]of Array.from(nn))n.isConnected&&t.includes(n)||(jl(n,r),nn.delete(n))}function zl(){for(let[e,t]of Array.from(nn))jl(e,t);nn.clear(),zi()}function jl(e,t){e.style.display=t,e.removeAttribute(Gl)}function $l(e){Vl(e)}function Vl(e){if(rn!==null&&rn.isConnected&&rn.textContent===e)return;zi();let t=document.createElement("div");t.className=Qm,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute(Zm,"done"),t.innerHTML=`<span class="${Wl}"></span>`;let n=t.querySelector(`.${Wl}`);n!==null&&(n.textContent=e),t.style.setProperty("--bre-note-hold","3000ms"),document.body.append(t),rn=t,co=setTimeout(()=>{zi()},3e3)}function zi(){co!==null&&(clearTimeout(co),co=null),rn?.remove(),rn=null}var Ot="data-bre-settle",Yl='[class*="rowActions"] > button:not(.bre-provider-switch):not(.bre-provider-delete)';var et=null,ji=0,uo=0,Wn=!1,on=null;function Xl(e){return e.className.includes("dangerButton")?"remove":"edit"}function $i(e,t){return Array.from(e.querySelectorAll(Yl)).find(r=>Xl(r)===t)??null}function eh(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function th(e){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e)}function Jl(e=document){Bn();let t=[];for(let n of Array.from(e.querySelectorAll(Yl))){if(n.disabled)continue;let r=n.closest("li")??n.parentElement;if(r===null)continue;let o=Xl(n);t.some(i=>i.row===r&&i.role===o)||t.push({row:r,role:o})}t.length!==0&&(et=t,uo=Date.now(),ji=uo+8e3,nh(),Ql())}function Vi(){if(et===null)return;let e=Date.now();if(e>ji){Bn();return}let t=0;if(et=et.filter(n=>{if(!n.row.isConnected)return!1;let r=$i(n.row,n.role);return r===null||(r.disabled?(Wn=!0,t+=1,r.hasAttribute(Ot)||r.setAttribute(Ot,"")):Wn&&r.hasAttribute(Ot)&&r.removeAttribute(Ot)),!0}),Wn&&t===0){Bn();return}if(!Wn&&e-uo>1500){Bn();return}Ql()}function Ql(){on!==null||et===null||(on=eh(()=>{on=null,Vi()}))}function nh(){if(et!==null)for(let e of et){let t=$i(e.row,e.role);t!==null&&!t.hasAttribute(Ot)&&t.setAttribute(Ot,"")}}function Zl(){Bn()}function Bn(){if(on!==null&&(th(on),on=null),et!==null)for(let e of et){let t=$i(e.row,e.role);t!==null&&t.removeAttribute(Ot)}et=null,Wn=!1,ji=0,uo=0}var q=require("react/jsx-runtime"),rh=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function ec(e,t){let n=()=>t.current+=1,r=Object.entries(e??{}).map(([o,i])=>({id:n(),name:o,value:i}));return r.length===0&&r.push({id:n(),name:"",value:""}),{rows:r}}function tc(e){let t={},n=!1;for(let o of e.rows){let i=o.name.trim();i.length!==0&&(t[i]=o.value,i.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function fo({route:e,api:t,t:n,onDismiss:r,deferred:o}){let i=(0,le.useId)(),[a,s]=(0,le.useState)(void 0),[d,l]=(0,le.useState)({rows:[]}),[f,m]=(0,le.useState)(!1),[u,c]=(0,le.useState)(!1),[p,b]=(0,le.useState)(!0),[h,x]=(0,le.useState)(!1),[S,v]=(0,le.useState)(!1),[P,D]=(0,le.useState)(void 0),[z,oe]=(0,le.useState)(void 0),[k,M]=(0,le.useState)(!1),W=(0,le.useRef)(0),T=(0,le.useRef)(null),R=o!==void 0,N=o?.onDraft,B=(0,le.useRef)(void 0);(0,le.useEffect)(()=>{if(R&&B.current!==void 0)return;B.current=e;let g=!0;return(async()=>{try{let L=await ne(t);if(!g)return;let _=Jo(L.namespace,e);s(_),l(ec(_,W)),v(L.writable!==!0)}catch{g&&v(!0)}finally{g&&b(!1)}})(),()=>{g=!1}},[t,e,R]),(0,le.useEffect)(()=>{N!==void 0&&N(tc(d))},[d,N]),(0,le.useEffect)(()=>{let g=!0;return(async()=>{try{let _=await(await fetch(ka,{method:"GET"})).json();g&&_.ok===!0&&_.data!==void 0&&oe(_.data)}catch{}})(),()=>{g=!1}},[]),(0,le.useEffect)(()=>{let g=T.current;if(g===null)return;let L=()=>{M(g.dataset.breRegion==="advanced")};L();let _=new MutationObserver(L);return _.observe(g,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{_.disconnect()}},[]);let O=()=>{l(g=>({...g,rows:[...g.rows,{id:W.current+=1,name:"",value:""}]})),D(void 0)},U=(g,L)=>{l(_=>({..._,rows:_.rows.map(V=>V.id===g?{...V,...L}:V)})),D(void 0)},X=g=>{l(L=>({...L,rows:L.rows.filter(_=>_.id!==g)})),D(void 0)},ce=()=>{l({rows:[{id:W.current+=1,name:"",value:""}]}),D(void 0)},j=()=>{if(l(ec(a,W)),c(!1),D(void 0),o!==void 0){o.onCancel();return}k&&r?.()},re=async g=>{x(!0),D(void 0),Jl();let L;try{L=await bn(t,e,g)}catch(V){L={ok:!1,error:V instanceof Error?V.message:String(V)}}if(x(!1),!L.ok){D({kind:"error",text:L.error==="no-route"?n("headersNoRoute"):L.error==="read-only"?n("headersReadOnly"):n("headersError",{error:L.error})});return}s(g),c(!1);let _=Object.keys(g).length===0?n("headersCleared"):n("headersSaved");if(k){$l(_),r?.();return}D({kind:"success",text:_})},J=Object.entries(a??{}),$=S||h,de=k||R,fe=u||de?d.rows.filter(g=>g.name.trim().length>0).length:J.length,F=d.rows.some(g=>g.name.trim().length>0||g.value.length>0),G=f||u||de;return(0,q.jsxs)("div",{className:"bre-headers",ref:T,"data-plugin":pe,"data-open":f?"1":"0",children:[(0,q.jsx)("div",{className:"bre-headers-head",children:u||de?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),fe===0?null:(0,q.jsx)("span",{className:"bre-headers-count",children:fe}),S||!F?null:(0,q.jsx)("button",{type:"button",className:"bre-headers-clear",disabled:$,onClick:ce,children:n("headersClear")})]}):(0,q.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":f,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{m(!f),D(void 0)},children:[(0,q.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),p||fe===0?null:(0,q.jsx)("span",{className:"bre-headers-count",children:fe}),(0,q.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),G?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),z===void 0?null:(0,q.jsxs)(q.Fragment,{children:[z.environment.preferOfficialLayer?(0,q.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,z.conflicts.length===0&&(z.headerConflicts?.length??0)===0?null:(0,q.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),z.environment.siblings.length===0?null:(0,q.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:z.environment.siblings.map(g=>g.name).join(", ")})})]}),p?null:u||de?(0,q.jsxs)("div",{className:"bre-headers-edit",children:[(0,q.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,q.jsx)("span",{children:n("headersName")}),(0,q.jsx)("span",{children:n("headersValue")}),(0,q.jsx)("span",{})]}),d.rows.map(g=>(0,q.jsxs)("div",{className:"bre-headers-row",children:[(0,q.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:g.name,disabled:$,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:L=>{U(g.id,{name:L.target.value})}}),(0,q.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:g.value,disabled:$,list:g.name.trim().toLowerCase()==="user-agent"?i:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:L=>{U(g.id,{value:L.target.value})}}),(0,q.jsx)("button",{type:"button",className:"bre-headers-remove",disabled:$,"aria-label":`${n("headersRemove")} ${g.name}`,title:n("headersRemove"),onClick:()=>{X(g.id)},children:"\xD7"})]},g.id)),(0,q.jsx)("button",{type:"button",className:"bre-headers-add",disabled:$,onClick:O,children:n("headersAdd")}),(0,q.jsx)("datalist",{id:i,children:rh.map(g=>(0,q.jsx)("option",{value:g},g))}),R?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("p",{className:"bre-effort-note",children:n("pendingSave")}),(0,q.jsx)("p",{className:"bre-effort-note",children:n("pendingHint")})]}):null]}):(0,q.jsxs)("div",{className:"bre-headers-rows",children:[J.length===0?(0,q.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):J.map(([g,L])=>(0,q.jsxs)("div",{className:"bre-headers-row",children:[(0,q.jsx)("span",{className:"bre-headers-name",children:g}),(0,q.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(L.length,24))})]},g)),S?null:(0,q.jsx)("div",{className:"bre-effort-actions",children:(0,q.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:$,onClick:()=>{c(!0),D(void 0)},children:n("headersEdit")})})]})]}):null,!p&&(de||u)?(0,q.jsxs)("div",{className:"bre-effort-actions bre-headers-actions",children:[(0,q.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:h,onClick:j,children:n("headersCancel")}),R?null:(0,q.jsx)("button",{type:"button",className:"bre-primary-button",disabled:$,onClick:()=>{re(tc(d))},children:n("headersSave")})]}):null,P===void 0?null:(0,q.jsx)("p",{className:"bre-effort-message bre-"+P.kind,role:P.kind==="error"?"alert":"status",children:P.text})]})}var Yi=require("react");var oh={provider:"editorTabProvider",models:"editorTabModels",fingerprint:"editorTabFingerprint",advanced:"editorTabAdvanced"};function po({host:e,t}){return(0,Yi.createElement)("div",{className:Hl,role:"tablist","aria-label":t("editorTabsLabel")},...Rl.map(n=>(0,Yi.createElement)("button",{key:n,type:"button",role:"tab",className:Cl,[Ol]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=tn(e.current);o!==null&&_l(o,n)}},t(oh[n]))))}var ih=15e3;function rc(){return{intents:new Map,baseline:new Map,flushing:!1}}function Xi(e,t,n){if(t.length===0)return;let r={...n};if(Object.keys(r).length===0){e.intents.delete(t);return}let o=e.intents.get(t);if(o===void 0){e.intents.set(t,{headers:r,declaredBefore:e.baseline.get(t)});return}o.headers=r}function Ji(e,t){e.intents.delete(t)}function oc(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function ic(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function ac(e,t){return t.length>0&&!e.baseline.has(t)}async function sc(e,t){if(e.flushing)return nc(e);if(e.intents.size===0)return 0;e.flushing=!0;try{let n=await ne(t),r,o=async a=>He(n.namespace,a)?!0:(r??(r=await ne(t,{fresh:!0})),He(r.namespace,a)),i=Date.now();for(let[a,s]of Array.from(e.intents)){if(s.declaredBefore===void 0){s.releasedAt!==void 0&&s.noted!==!0&&(s.noted=!0,console.warn("[bre] deferred request headers: nobody said whether this id existed before, so the draft is held:",a));continue}if(s.declaredBefore){e.intents.delete(a);continue}if(!await o(a)){s.releasedAt!==void 0&&i-s.releasedAt>ih?(e.intents.delete(a),console.info("[bre] deferred request headers: gave up on a draft whose card closed first:",a)):s.releasedAt!==void 0&&console.info("[bre] deferred request headers: waiting for the closed card to declare",a);continue}console.info("[bre] deferred request headers: the route is declared, writing the held draft:",a);let d;try{d=await bn(t,a,s.headers)}catch(l){d={ok:!1,error:l instanceof Error?l.message:String(l)}}if(d.ok){e.intents.delete(a),console.info("[bre] deferred request headers: saved",a,Object.keys(s.headers).length,"header(s)");continue}d.error!=="no-route"&&(e.intents.delete(a),console.error("[bre] deferred request headers: the write was refused:",d.error,a))}}catch(n){console.error("[bre] deferred request headers: could not read the settings document:",n)}finally{e.flushing=!1}return nc(e)}function nc(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var Nt=require("react/jsx-runtime");function lc({host:e,api:t,t:n,routeIdLabels:r,staged:o}){let[i,a]=(0,Te.useState)(()=>Gn(e.current,r)),s=(0,Te.useRef)(i),d=(0,Te.useRef)(void 0),l=(0,Te.useRef)(new Set),f=(0,Te.useRef)(!1),m=(0,Te.useRef)(null);return m.current===null&&(m.current={onDraft:u=>{d.current=u;let c=s.current;if(c.length===0){!f.current&&Object.keys(u).length>0&&(f.current=!0,console.info("[bre] deferred request headers: holding a draft until the provider id is typed"));return}Xi(o,c,u),dc(t,o,c,l.current)},onCancel:()=>{d.current=void 0,Ji(o,s.current)}}),(0,Te.useEffect)(()=>{let u=mo(e.current);if(u===null)return;let c=()=>{a(Gn(e.current,r))};return u.addEventListener("input",c,!0),()=>{u.removeEventListener("input",c,!0)}},[e,r]),(0,Te.useEffect)(()=>{i.length>0&&dc(t,o,i,l.current)},[t,o,i]),(0,Te.useEffect)(()=>{let u=s.current;if(u===i)return;Ji(o,u),s.current=i;let c=d.current;c!==void 0&&i.length>0&&Xi(o,i,c)},[i,o]),(0,Te.useEffect)(()=>()=>{oc(o,s.current)},[o]),(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(po,{host:e,t:n}),(0,Nt.jsx)(fo,{route:i,api:t,t:n,deferred:m.current})]})}function dc(e,t,n,r){!ac(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await ne(e);ic(t,n,He(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred request headers: could not read the settings document for this route:",o)}})())}function mo(e){let t=e?.parentElement;return t==null?null:t.parentElement?.closest('[class*="addCard"]')??t}function Gn(e,t){let n=e?.parentElement;if(n==null)return"";let r=t(),o=Ee(n,r).trim();if(o.length>0)return o;let i=mo(e);return i===null||i===n?"":Ee(i,r).trim()}var Zi=require("react");var Me=require("react");var ah=15e3,sh=3;function uc(){return{intents:new Map,baseline:new Map,draining:!1}}function Qi(e,t,n){if(t.length===0)return;if(n.length===0){e.intents.delete(t);return}let r=e.intents.get(t);if(r===void 0){e.intents.set(t,{drafts:[...n],landed:[],declaredBefore:e.baseline.get(t),attempts:0});return}r.drafts=[...n]}function fc(e,t){e.intents.delete(t)}function pc(e,t){let n=e.intents.get(t);n!==void 0&&(n.releasedAt=Date.now())}function mc(e,t,n){if(t.length===0)return;e.baseline.set(t,n);let r=e.intents.get(t);r!==void 0&&(r.declaredBefore=n)}function hc(e,t){return t.length>0&&!e.baseline.has(t)}async function gc(e,t,n){if(e.draining)return cc(e);if(e.intents.size===0)return 0;e.draining=!0;try{let r=await ne(t),o,i=async s=>He(r.namespace,s)?!0:(o??(o=await ne(t,{fresh:!0})),He(o.namespace,s)),a=Date.now();for(let[s,d]of Array.from(e.intents)){if(d.declaredBefore===void 0){d.releasedAt!==void 0&&d.noted!==!0&&(d.noted=!0,console.warn("[bre] deferred api keys: nobody said whether this id existed before, so the drafts are held:",s));continue}if(d.declaredBefore){e.intents.delete(s);continue}if(!await i(s)){d.releasedAt!==void 0&&a-d.releasedAt>ah&&(e.intents.delete(s),console.info("[bre] deferred api keys: gave up on drafts whose card closed first:",s));continue}await dh(s,d,n)&&(e.intents.delete(s),console.info("[bre] deferred api keys: the route is declared, saved the held key list:",s))}}catch(r){console.error("[bre] deferred api keys: could not read the settings document:",r)}finally{e.draining=!1}return cc(e)}async function dh(e,t,n){let r=!1,o=!1,i=()=>{r=!0,t.attempts+=1};for(let a of t.drafts){if(t.landed.some(l=>l.ref===a.ref))continue;let s=await n.add(e,a.value,a.alias);if(!s.ok){i();break}let d=s.entries.map(l=>l.ref).find(l=>!t.landed.some(f=>f.hostRef===l));if(d===void 0){i();break}t.landed.push({ref:a.ref,hostRef:d,done:!1}),o=!0}if(!r)for(let a of t.drafts){let s=t.landed.find(d=>d.ref===a.ref);if(!(s===void 0||s.done)){if(a.protocol!==void 0){if(!(await n.setProtocol(e,s.hostRef,a.protocol)).ok){i();break}o=!0}if(!a.enabled){if(!(await n.setEnabled(e,s.hostRef,!1)).ok){i();break}o=!0}s.done=!0}}return r?(o&&(t.attempts=0),t.attempts>=sh?(console.error("[bre] deferred api keys: the write was refused; giving up on the held key list:",e),!0):!1):!0}function cc(e){let t=0;for(let n of e.intents.values())n.releasedAt!==void 0&&(t+=1);return t}var lh={openai:null,anthropic:null,gemini:null};function ch(e){let t=new Set(e.map(n=>n.ref));for(let n=1;n<=999;n+=1){let r=`key-${n}`;if(!t.has(r))return r}return`key-${Date.now()}`}function bc(e,t){let n=()=>({ok:!0,route:"",entries:e.drafts.map(a=>({ref:a.ref,...a.alias===void 0?{}:{alias:a.alias},enabled:a.enabled,configured:!0,masked:ad(a.value),...a.protocol===void 0?{}:{protocol:a.protocol}})),endpoints:lh}),r=()=>(t.onChange(e.drafts),n()),o=a=>e.drafts.find(s=>s.ref===a),i=(a,s)=>(e.drafts=e.drafts.map(d=>d.ref===a?s:d),r());return{list:async()=>n(),add:async(a,s,d)=>Lt(s)?(e.drafts=[...e.drafts,{ref:ch(e.drafts),value:s,enabled:!0,...d===void 0?{}:{alias:d}}],r()):{ok:!1,error:t.t("keysAddIllegal")},rename:async(a,s,d)=>{let l=o(s);if(l===void 0)return{ok:!1};let{alias:f,...m}=l;return i(s,{...m,...d===void 0?{}:{alias:d}})},replace:async(a,s,d)=>{let l=o(s);return l===void 0||!Lt(d)?{ok:!1,error:t.t("keysAddIllegal")}:i(s,{...l,value:d})},remove:async(a,s)=>(e.drafts=e.drafts.filter(d=>d.ref!==s),r()),setScope:async()=>n(),setEnabled:async(a,s,d)=>{let l=o(s);return l===void 0?{ok:!1}:!d&&!e.drafts.some(f=>f.ref!==s&&f.enabled)?{ok:!1,error:t.t("keysLastEnabledOff")}:i(s,{...l,enabled:d})},setProtocol:async(a,s,d)=>{let l=o(s);if(l===void 0)return{ok:!1};let{protocol:f,...m}=l;return i(s,{...m,...d===void 0?{}:{protocol:d}})},setEndpoints:async()=>n(),applyMerged:async()=>n(),reveal:async(a,s)=>o(s)?.value}}var wc=require("react/jsx-runtime");function yc({host:e,store:t,api:n,t:r,routeIdLabels:o,staged:i}){let[a,s]=(0,Me.useState)(()=>Gn(e.current,o)),d=(0,Me.useRef)(a),l=(0,Me.useRef)(new Set),f=(0,Me.useRef)(!1),m=(0,Me.useMemo)(()=>bc(t,{t:r,onChange:u=>{let c=d.current;if(c.length===0){!f.current&&u.length>0&&(f.current=!0,console.info("[bre] deferred api keys: holding the list until the provider id is typed"));return}Qi(i,c,u)}}),[i,t,r]);return(0,Me.useEffect)(()=>{let u=mo(e.current);if(u===null)return;let c=()=>{s(Gn(e.current,o))};return u.addEventListener("input",c,!0),()=>{u.removeEventListener("input",c,!0)}},[e,o]),(0,Me.useEffect)(()=>{a.length>0&&uh(n,i,a,l.current)},[n,i,a]),(0,Me.useEffect)(()=>{let u=d.current;u!==a&&(fc(i,u),d.current=a,t.drafts.length>0&&a.length>0&&Qi(i,a,t.drafts))},[a,i,t]),(0,Me.useEffect)(()=>()=>{pc(i,d.current)},[i]),(0,wc.jsx)(to,{route:a,t:r,client:m,draft:!0})}function uh(e,t,n,r){!hc(t,n)||r.has(n)||(r.add(n),(async()=>{try{let o=await ne(e);mc(t,n,He(o.namespace,n))}catch(o){r.delete(n),console.warn("[bre] deferred api keys: could not read the settings document for this route:",o)}})())}var go="data-bre-create-keys",fh="bre-keys-host",ph="data-bre-key-input",ho="data-bre-region",an=new WeakMap;function mh(e){let t=e.querySelector(`input[${ph}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function vc(e){let t=an.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLDivElement&&n.hasAttribute(go)?n:void 0}function xc(e,t){if(e.closest(`[${go}]`)!==null){sn(e);return}if(mh(e)===void 0){sn(e);return}if(e.parentElement===null)return;be(e,At,!0);let r=an.get(e),o=vc(e);o===void 0&&(r!==void 0&&ea(e,r),o=e.ownerDocument.createElement("div"),o.className=fh,e.after(o)),ee(o,go,"");let i=e.getAttribute(ho);if(i===null?o.hasAttribute(ho)&&o.removeAttribute(ho):ee(o,ho,i),r!==void 0&&r.host===o)return;r!==void 0&&ea(e,r);let a={drafts:[]},s=o,d=ot(o,t.refreshed(()=>(0,Zi.createElement)(qe,{fallbackText:t.t("keysPanelFailed")},(0,Zi.createElement)(yc,{host:{current:s},store:a,api:t.api,t:t.t,routeIdLabels:t.routeIdLabels,staged:t.staged}))),{sync:!0});an.set(e,{host:o,mount:d})}function ea(e,t){an.delete(e),Ce(t.mount)}function sn(e){be(e,At,!1);let t=an.get(e);t!==void 0&&ea(e,t),vc(e)?.remove()}function kc(){for(let e of Array.from(document.querySelectorAll(`[${go}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&an.has(t)?sn(t):e.remove()}}var na="bre-create-host",ta="bre-add-mode-picker",hh='[class*="addCard"]',gh='[class*="addPanel"]',bh='[class*="addModes"]',Ec="-custom-panel",yh="-custom";function Sc(){return{hosts:new Map}}function ra(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(hh)))if(o.isConnected)try{wh(o,t,n),r.add(o)}catch(i){bo(o,n);for(let a of oa(o))try{sn(a)}catch{}Lc(o,!1),console.warn("[bre] add provider card: left the official form in place:",i)}for(let o of Array.from(n.hosts.keys()))(!r.has(o)||!o.isConnected)&&bo(o,n)}function wh(e,t,n){let r=Tc(e,Ec);(r===void 0||r.hidden)&&(Th(e),r=Tc(e,Ec),r===void 0||r.hidden)||(e.getAttribute("data-bre-add-card")!=="1"&&e.setAttribute("data-bre-add-card","1"),Sh(e,r,t,n),kh(e),Eh(r,t),Lc(e,!0))}var vh=".field, label",xh=".bre-keys-host, .bre-keys, .bre-create-host";function oa(e){let t=[],n=e.querySelectorAll('input[type="password"], input[data-bre-key-input]');for(let r of Array.from(n)){if(r.closest(xh)!==null)continue;let o=r.closest(vh)??r.parentElement;o!==null&&!t.includes(o)&&t.push(o)}return t}function kh(e){for(let t of oa(e))try{Sl(t)}catch(n){console.warn("[bre] add provider card: could not mark a key field:",n)}}function Eh(e,t){for(let n of oa(e))try{xc(n,{t:t.t,api:t.api,routeIdLabels:t.routeIdLabels,staged:t.stagedKeys,refreshed:t.refreshed})}catch(r){sn(n),console.warn("[bre] add provider card: could not mount the key list:",r)}}function Lc(e,t){let n=Ac(e);n!==void 0&&be(n,ta,t)}function Tc(e,t){for(let n of Array.from(e.querySelectorAll(gh)))if(n.id.endsWith(t))return n}function Ac(e){let t=e.querySelector(bh);if(t!==null){for(let n of Array.from(t.children))if(n instanceof HTMLElement&&n.getAttribute("role")==="tablist")return n}}function Th(e){let t=Ac(e);if(t!==void 0){for(let n of Array.from(t.querySelectorAll('[role="tab"]')))if(n.id.endsWith(yh)){if(n.disabled)return;n.getAttribute("aria-selected")!=="true"&&n.click();return}}}function Mh(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.classList.contains(na))return t}function Sh(e,t,n,r){let o=r.hosts.get(e),i=Mh(t);if(i!==void 0&&o!==void 0&&o.host===i)return;bo(e,r),i!==void 0&&i.remove();let a=e.ownerDocument.createElement("div");a.className=na,t.insertBefore(a,t.firstChild),Xd(e);let s=ot(a,n.refreshed(()=>(0,Mc.createElement)(lc,{host:{current:a},api:n.api,t:n.t,routeIdLabels:n.routeIdLabels,staged:n.staged})),{sync:!0});r.hosts.set(e,{host:a,mount:s})}function bo(e,t){let n=t.hosts.get(e);n!==void 0&&(t.hosts.delete(e),Ce(n.mount))}function Rc(e){for(let t of Array.from(e.hosts.keys()))bo(t,e);for(let t of Array.from(document.querySelectorAll(`.${na}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${ta}`)))be(t,ta,!1);for(let t of Array.from(document.querySelectorAll(`.${Ht}`)))Xt(t);kc()}var Un="data-bre-row-provider",Hc="{provider}",Lh=["rowCard","setupCard"];function Cc(){return Or()}function dt(e){for(let t of Lh)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&we(r).length!==0)return r}}function zn(e){return e.querySelector('[class*="rowHead"]')??void 0}function dn(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Ah(e){let t=e.indexOf(Hc);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Hc.length)}}function Rh(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var Hh='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function Ch(e){let t=e.closest(Hh);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function lt(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=Ah(r);if(o!==void 0)for(let i of Array.from(e.querySelectorAll("button[aria-label]"))){if(Ch(i))continue;let a=i.getAttribute("aria-label")??"";if(a.length<=o.prefix.length+o.suffix.length||!a.startsWith(o.prefix)||!a.endsWith(o.suffix))continue;let s=Rh(a.slice(o.prefix.length,a.length-o.suffix.length));if(s!==void 0)return s}}}function ia(e){let t=e.getAttribute(Un);return t===null||t.length===0?void 0:t}function Oh(e){return En(e,ia)}function Oc(e,t,n){if(!e.isConnected)return;let r=dt(e);if(r===void 0)return;let o=t.labels();for(let i of we(r)){let a=lt(i,o);if(a===void 0){i.removeAttribute(Un);continue}ia(i)!==a&&i.setAttribute(Un,a)}_r(e,r,Nh(t),n)}function Nh(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:ia,labelOf:dn,order:t=>Pa(t),commit:t=>{Oa(Oh(t))},seatOf:zn,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:dn(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function Nc(e){Fr(e);let t=Array.from(document.querySelectorAll(`[${Un}]`));Pr(t);for(let n of t)n.removeAttribute(Un)}var ln="data-bre-provider-switch",yo="bre-row-disabled";function Dc(){return{switches:new WeakSet}}function Ic(e,t,n){if(!e.isConnected)return;let r=dt(e);if(r===void 0)return;let o=t.labels();for(let i of Array.from(r.children)){if(!(i instanceof HTMLElement))continue;let a=lt(i,o);if(a===void 0)continue;let s=zn(i);s!==void 0&&(Ph(i,s,a,t,n),i.classList.toggle(yo,!Bt(a)))}}function _c(){for(let e of Array.from(document.querySelectorAll(`[${ln}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${yo}`)))e.classList.remove(yo)}function Ph(e,t,n,r,o){let i=t.querySelector(`[${ln}]`);if(i!==null){Pc(i,e,n,r);return}let a=document.createElement("button");a.className="bre-provider-switch",a.setAttribute("type","button"),a.setAttribute("role","switch"),a.setAttribute(ln,n),Pc(a,e,n,r),Dh(a,e,o);let s=t.querySelector('[class*="rowActions"]');s===null?t.appendChild(a):s.insertBefore(a,s.firstChild)}function Pc(e,t,n,r){let o=r.t("providerToggleAria",{provider:dn(t)??n}),i=r.t("providerToggleHint"),a=Bt(n)?"true":"false";e.getAttribute(ln)!==n&&e.setAttribute(ln,n),e.getAttribute("aria-checked")!==a&&e.setAttribute("aria-checked",a),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function Dh(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(ln);if(o===null)return;let i=!Bt(o);_a(o,i),e.setAttribute("aria-checked",i?"true":"false"),t.classList.toggle(yo,!i)}))}var wo="data-bre-provider-delete",Fc='[class*="rowActions"]',Kc='[class*="dangerButton"]',Ih="bre-provider-delete";function qc(e,t){if(!e.isConnected)return;let n=dt(e);if(n===void 0)return;let r=t.labels(),o=_h(n)??t.t("providerRemoveDisabled");for(let i of Array.from(n.children)){if(!(i instanceof HTMLElement))continue;let a=lt(i,r);if(a===void 0)continue;let s=zn(i);if(s===void 0)continue;let d=s.querySelector(Fc);if(d===null)continue;let l=d.querySelector(`[${wo}]`);if(d.querySelector(Kc)!==null){l!==null&&l.remove();continue}let f=l??Fh();d.lastElementChild!==f&&d.appendChild(f),Kh(f,a,o,t.t("providerRemoveLocked",{provider:dn(i)??a}))}}function Wc(){for(let e of Array.from(document.querySelectorAll(`[${wo}]`)))e.remove()}function _h(e){let n=e.querySelector(`${Fc} ${Kc}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function Fh(){let e=document.createElement("button");return e.className=Ih,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function Kh(e,t,n,r){e.getAttribute(wo)!==t&&e.setAttribute(wo,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var vo="data-bre-provider-disabled-group",qh="bre-provider-disabled-seat",Bc="bre-provider-disabled-group",aa="bre-row-folded",sa="bre-row-hidden";function Gc(){return{expanded:!1}}function Uc(e,t,n){if(!e.isConnected)return;let r=dt(e);if(r===void 0)return;let o=jc(r,t.labels()),i=o.filter(l=>!l.enabled).length,a=$c(r);if(i===0){a!==void 0&&a.remove(),da(o,n);return}let s=a??Wh(r,t,n);(s.parentElement!==r||r.lastElementChild!==s)&&r.append(s),da(o,n);let d=Vc(s);d!==void 0&&Yc(d,i,t,n)}function zc(){for(let e of Array.from(document.querySelectorAll(`[${vo}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${sa}, .${aa}`)))e.classList.remove(sa,aa)}function jc(e,t){let n=[];for(let r of Array.from(e.children)){if(!(r instanceof HTMLElement)||r.getAttribute(vo)!==null)continue;let o=lt(r,t);o!==void 0&&n.push({row:r,id:o,enabled:Bt(o)})}return n}function da(e,t){for(let n of e){let r=!n.enabled;n.row.classList.toggle(aa,r),n.row.classList.toggle(sa,r&&!t.expanded)}}function $c(e){for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.getAttribute(vo)!==null)return t}function Vc(e){return e.querySelector(`button.${Bc}`)??void 0}function Wh(e,t,n){let r=document.createElement("li");r.className=qh,r.setAttribute(vo,"");let o=document.createElement("button");return o.className=Bc,o.setAttribute("type","button"),o.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n.expanded=!n.expanded,Bh(e,t,n)}),r.appendChild(o),e.append(r),r}function Bh(e,t,n){let r=jc(e,t.labels());da(r,n);let o=$c(e);if(o===void 0)return;let i=r.filter(s=>!s.enabled).length;if(i===0){o.remove();return}let a=Vc(o);a!==void 0&&Yc(a,i,t,n)}function Yc(e,t,n,r){let o=n.t(r.expanded?"providerDisabledGroupHide":"providerDisabledGroupShow",{count:t}),i=n.t("providerDisabledGroupHint"),a=r.expanded?"true":"false";e.textContent!==o&&(e.textContent=o),e.getAttribute("aria-expanded")!==a&&e.setAttribute("aria-expanded",a),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}var jn="data-bre-row-model",la="bre-model-grid";function Jc(){return Or()}function Gh(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))we(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function Qc(e){for(let t of e){if(t.type!=="childList")continue;let n=t.target;if(n instanceof HTMLElement&&n.matches('[class*="modelList"]')&&we(n).some(r=>r.matches('[class*="modelEntry"]')))return!0;for(let r of[t.addedNodes,t.removedNodes])for(let o of Array.from(r))if(o instanceof HTMLElement&&o.matches('[class*="modelEntry"]'))return!0}return!1}function xo(e){let t=e.getAttribute(jn);return t===null||t.length===0?void 0:t}function ca(e,t){let n=e.closest("li");if(n!==null)return lt(n,t.labels())}function Xc(e,t){let n=Ee(e,t.labels().modelName);return n.length>0?n:xo(e)}function Uh(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:xo,labelOf:n=>Xc(n,t),order:n=>{let r=ca(e,t);return r===void 0?n:ja(r,n)},commit:n=>{let r=ca(n,t);r!==void 0&&Ua(r,En(n,xo))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:Xc(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(la)}}}function Zc(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of Gh(e))if(ca(o,t)!==void 0){for(let i of we(o)){let a=Ee(i,r.modelId);if(a.length===0){i.removeAttribute(jn);continue}xo(i)!==a&&i.setAttribute(jn,a)}_r(e,o,Uh(o,t),n)}}function eu(e){Fr(e);for(let n of Array.from(document.querySelectorAll(`.${la}`)))n.classList.remove(la);let t=Array.from(document.querySelectorAll(`[${jn}]`));Pr(t);for(let n of t)n.removeAttribute(jn)}var zh="settings.models",De={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"],inputImage:["modelInputImage","Image"],contextWindow:["modelContextWindow","contextWindow","Context window","\u4E0A\u4E0B\u6587\u7A97\u53E3"],maxOutput:["modelMaxOutput","maxOutput","maxTokens","Max output","\u6700\u5927\u8F93\u51FA"]};function ru(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:i}=e,a=()=>{let F=t.locale.bind(zh),G=g=>{let L=[];for(let _ of g){let V=F(_);V!==_&&V.trim()!==""&&!L.includes(V)&&L.push(V)}return L.length===0?g:[...L,...g.filter(_=>!L.includes(_))]};return{capacity:G(De.capacity),modelId:G(De.modelId),modelName:G(De.modelName),routeId:G(De.routeId),baseUrl:G(De.baseUrl),apiProtocol:G(De.apiProtocol),apply:G(De.apply),cancel:G(De.cancel),editProvider:G(De.editProvider),inputImage:G(De.inputImage),contextWindow:G(De.contextWindow),maxOutput:G(De.maxOutput)}},s=120,d=1e3,l=Fd(),f=Cc(),m={t:r,labels:a},u=Dc(),c={t:r,labels:a},p={t:r,labels:a},b=Gc(),h={t:r,labels:a},x=Jc(),S={t:r,labels:a},v=Pl(),P={t:r},D=Sc(),z=rc(),oe=uc(),k={t:r,api:n,routeIdLabels:()=>a().routeId,staged:z,stagedKeys:oe,refreshed:i},M,W,T,R,N=F=>{for(let G of F)for(let g of Array.from(G.addedNodes)){if(!(g instanceof HTMLElement))continue;let L=g.matches('[class*="modelAdvanced"]')?[g]:Array.from(g.querySelectorAll('[class*="modelAdvanced"]'));for(let _ of L)Oi(_)}},B=!1,O={api:n,describeNamespace:()=>ne(n),t:r,labels:a,onIdle:o,onBackoff:F=>{X(F)},onPendingChanged:()=>{re()},mount(F,G){let g=document.createElement("div");g.className="bre-effort-slot",g.dataset.plugin=pe,F.appendChild(g);let L=(0,nu.createRoot)(g),_=V=>{L.render((0,ua.createElement)(qe,{fallbackText:r("renderFailed"),children:i(()=>(0,ua.createElement)(Ar,V))}))};return(0,tu.flushSync)(()=>{_(G)}),{unmount:()=>{try{L.unmount()}finally{g.remove()}},render:_}}},U=0;function X(F){if(B)return;let G=Date.now()+F;W!==void 0&&G>=U||(W!==void 0&&window.clearTimeout(W),U=G,W=window.setTimeout(()=>{W=void 0,U=0,re()},F))}let ce=()=>{let F=We();dt(F)!==void 0&&(Oc(F,m,f),Ic(F,c,u),qc(F,p),Uc(F,h,b),Zc(F,S,x),Vi(),Ul(F))},j=(F,G)=>{try{G()}catch(g){console.error(`[bre] ${F} failed:`,g)}};function re(){B||M!==void 0||(M=window.setTimeout(()=>{M=void 0,j("composer mutation",()=>{R?.()}),j("editor reconcile",()=>{Ii(We(),O,l)}),j("add-card reconcile",()=>{ra(We(),k,D)}),j("editor tabs reconcile",()=>{Ui(We(),P,v)}),j("dom decorations",()=>{ce()}),sc(z,n).then(F=>{F>0&&X(d)}),gc(oe,n,Xe).then(F=>{F>0&&X(d)})},s))}let J=F=>{if(B||T!==void 0)return;R=F,j("models page startup",()=>{F(),ce()}),tl();let G=g=>{F(),j("editor reconcile",()=>{Ii(We(),O,l)}),ra(We(),k,D),Ui(We(),P,v),ce(),Qc(g)&&rl(We())};T=new MutationObserver(g=>{j("models mutation",()=>{G(g)}),j("early reasoning hide",()=>{N(g)}),re()}),T.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden"]}),re()},$=()=>{B=!0,M!==void 0&&(window.clearTimeout(M),M=void 0),W!==void 0&&(window.clearTimeout(W),W=void 0),T?.disconnect(),T=void 0};return{state:l,labels:a,start:J,stopObserver:$,teardown:()=>{if(!l.disposed){$(),l.disposed=!0,$d(),Id(l,O);for(let[F,G]of l.mounted)On(F),G.editor.unmount();l.mounted.clear(),Nc(f),_c(),Wc(),zc(),Is(),zl(),Zl(),eu(x),Rc(D),Fl(),Md(),nl()}},flushOnUnload:()=>{_d(l,O)},schedule:re}}var iu=e=>`?route=${encodeURIComponent(e)}`;async function au(e){try{let t=await e.json();if(typeof t.error=="string"&&t.error.length>0)return t.error}catch{}return`fingerprint request failed (${e.status})`}async function fa(e){try{let t=await fetch(`${Ro}${iu(e)}`,{method:"GET"}),n=await t.json();if(t.ok&&n.ok===!0){let r=n.data;return{ok:!0,data:{bank:r?.bank??{},records:Array.isArray(r?.records)?r.records:[]}}}return{ok:!1,error:typeof n.error=="string"?n.error:await au(t)}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}function su(e,t,n){let r=new AbortController,o=!1;return{done:(async()=>{let a;try{let s=await fetch(`${Ro}${iu(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({model:t}),signal:r.signal});if(!s.ok)return{ok:!1,error:await au(s)};let d=s.body?.getReader();if(d===void 0)return{ok:!1,error:"the fingerprint route sent no body"};let l=new TextDecoder,f="";for(;;){let{done:u,value:c}=await d.read();if(u)break;f+=l.decode(c,{stream:!0});let p=f.indexOf(`
3925
+ `);for(;p>=0;){let b=f.slice(0,p).trim();if(f=f.slice(p+1),b.length>0){let h=ou(b);h!==void 0&&(n(h),h.type==="result"?a={ok:!0,record:h.record}:h.type==="error"&&(a={ok:!1,error:h.error}))}p=f.indexOf(`
3926
+ `)}}let m=f.trim();if(m.length>0){let u=ou(m);u!==void 0&&(n(u),u.type==="result"?a={ok:!0,record:u.record}:u.type==="error"&&(a={ok:!1,error:u.error}))}}catch(s){return o?{ok:!1,error:"cancelled"}:{ok:!1,error:s instanceof Error?s.message:String(s)}}return a!==void 0?a:o?{ok:!1,error:"cancelled"}:{ok:!1,error:"the fingerprint route ended without a verdict"}})(),abort:()=>{o=!0,r.abort()}}}function ou(e){let t;try{t=JSON.parse(e)}catch{return}if(typeof t!="object"||t===null)return;let n=t,r=n.type;if(r==="progress")return{type:"progress",index:Number(n.index??0),ok:n.ok===!0,...typeof n.error=="string"?{error:n.error}:{}};if(r==="result"){let o=n.record;return typeof o!="object"||o===null?void 0:{type:"result",record:o}}if(r==="error")return{type:"error",error:typeof n.error=="string"?n.error:"fingerprint route failed"}}var jh=3,pa=new Map;function $h(e){return pa.get(e)??{run:(t,n,r)=>su(t,n,r)}}var ma=class{constructor(t){Fe(this,"route",t);Fe(this,"listeners",new Set);Fe(this,"recordListeners",new Set);Fe(this,"failureListeners",new Set);Fe(this,"state",{running:new Map,queued:[]});Fe(this,"inflight");Fe(this,"draining",!1);Fe(this,"disposed",!1)}getState(){return this.state}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onRecord(t){return this.recordListeners.add(t),()=>{this.recordListeners.delete(t)}}onFailure(t){return this.failureListeners.add(t),()=>{this.failureListeners.delete(t)}}idle(){return this.state.running.size===0&&this.state.queued.length===0}check(t){this.checkAll([t])}checkAll(t){if(this.disposed)return;let n=[...this.state.queued];for(let r of t)n.includes(r)||this.state.running.has(r)||n.push(r);n.length!==this.state.queued.length&&(this.publish({...this.state,queued:n}),this.drain())}abort(){this.publish({running:new Map,queued:[]}),this.inflight?.abort(),this.inflight=void 0}dispose(){this.disposed||(this.disposed=!0,this.abort(),this.listeners.clear(),this.recordListeners.clear(),this.failureListeners.clear(),ko.delete(this.route),pa.delete(this.route))}setSender(t){pa.set(this.route,t)}publish(t){this.state=t;for(let n of[...this.listeners])n()}async drain(){if(!(this.draining||this.disposed)){this.draining=!0;try{for(;;){let t=this.state.queued[0];if(t===void 0||(this.publish({running:new Map(this.state.running).set(t,0),queued:this.state.queued.slice(1)}),await this.runOne(t),this.disposed))break}}finally{this.draining=!1}}}async runOne(t){let n=$h(this.route),r=0,o=n.run(this.route,t,s=>{s.type==="progress"&&(r+=1,this.publish({running:new Map(this.state.running).set(t,Math.min(r,jh)),queued:this.state.queued}))});this.inflight=o;let i=await o.done;if(this.inflight=void 0,this.disposed)return;let a=new Map(this.state.running);if(a.delete(t),this.publish({running:a,queued:this.state.queued}),i.ok)for(let s of[...this.recordListeners])s(i.record);else for(let s of[...this.failureListeners])s(t,i.error)}},ko=new Map;function du(e){let t=ko.get(e);return t===void 0&&(t=new ma(e),ko.set(e,t)),t}function lu(){for(let e of[...ko.values()])e.dispose()}function Vh(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[i,a]of Object.entries(n?.byId??{}))if(!(a===void 0||(a.retainedBy?.mainView??0)<=0))return typeof a.id=="string"&&a.id.length>0?a.id:i}function cu(e){let t,n=new Map,r=(a,s)=>{for(let[d,l]of n){if(d===s)continue;let f;try{f=a.directoryFor(l.sessionId)===d}catch{f=!1}f||(l.restore(),n.delete(d))}};return{ensure:()=>{let a=e.ctx,s=a.get?.("sessions"),d=a.get?.("uiSession"),l=a.get?.("modelDirectories"),f=Vh(s,d);if(!(f===void 0||l===void 0))try{let m=l.directoryFor(f);return r(l,m),t!==void 0&&t.sessionId===f&&t.directory===m||(n.has(m)||n.set(m,{sessionId:f,restore:rs(m,{configuredEffort:e.configuredEffort})}),t={sessionId:f,directory:m}),m}catch{t=void 0;return}},dispose:()=>{for(let[,a]of n)a.restore();n.clear()}}}var Ue=require("react");var I=require("react");var Yh=/^(gpt-|chatgpt-|o[134](-|$)|claude-)/;function Xh(e){let t=String(e??"").trim(),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function uu(e){let t=Xh(e).toLowerCase();return t.length>0&&Yh.test(t)}var fu={running:new Map,queued:[]};function $n(e){return typeof e!="number"||!Number.isFinite(e)?"\u2014":`${Math.round(e*100)}%`}function Jh(e){return!Number.isFinite(e)||e<=0?"\u2014":new Date(e).toLocaleString()}function pu({route:e,api:t,t:n,ctx:r,host:o}){let[i]=(0,I.useState)(()=>Dl(o.current)),[a,s]=(0,I.useState)([]),[d,l]=(0,I.useState)(new Map),[f,m]=(0,I.useState)(void 0),[u,c]=(0,I.useState)(void 0),p=(0,I.useMemo)(()=>i?void 0:du(e),[i,e]),b=(0,I.useSyncExternalStore)((0,I.useCallback)(k=>p?.subscribe(k)??(()=>{}),[p]),(0,I.useCallback)(()=>p?.getState()??fu,[p]),(0,I.useCallback)(()=>fu,[]));(0,I.useEffect)(()=>{if(p!==void 0)return p.onRecord(k=>{c(void 0),l(M=>{let W=new Map(M);return W.set(k.model,k),W})})},[p]),(0,I.useEffect)(()=>{if(p!==void 0)return p.onFailure((k,M)=>{c({model:k,error:M})})},[p]);let h=(0,I.useCallback)(async()=>{if(i)return;let M=(await ne(t)).namespace?.value?.providers,W=Gt(M,e).map(R=>R.id).filter(R=>typeof R=="string"&&R.length>0).filter(uu);s(W.map(R=>({model:R})));let T=await fa(e);T.ok?(m(void 0),l(new Map(T.data.records.map(R=>[R.model,R])))):m(T.error)},[t,i,e]);if((0,I.useEffect)(()=>{i||h()},[i,h]),(0,I.useEffect)(()=>{if(!(i||r===void 0))return r.remote.$on("settings/document-updated",()=>{h()})},[i,r,h]),i)return null;let x=a.length,S=a.filter(k=>d.has(k.model)).length,v=a.filter(k=>d.get(k.model)?.status==="identified").length,P=a.filter(k=>d.get(k.model)?.status==="doubtful").length,D=a.filter(k=>d.get(k.model)?.status==="failed").length,z=b.running.size>0,oe=b.running.size+b.queued.length;return(0,I.createElement)("div",{className:"bre-fingerprint","data-bre-fingerprint":x>0?"ready":"none"},(0,I.createElement)("div",{className:"bre-fp-head"},(0,I.createElement)("span",{className:"bre-fp-title"},n("fpTitle")),(0,I.createElement)("span",{className:"bre-fp-count"},n("fpCount",{count:x})),(0,I.createElement)("span",{className:"bre-fp-summary",role:"status","aria-live":"polite"},z?n("fpRunning",{done:b.running.size,total:oe}):S===0?n("fpSummaryNone"):n("fpSummary",{identified:v,doubtful:P,failed:D})),(0,I.createElement)("span",{className:"grow"}),(0,I.createElement)("button",{type:"button",className:"bre-fp-all",disabled:z||x===0,onClick:()=>{p?.checkAll(a.map(k=>k.model))}},n("fpDetectAll"))),(0,I.createElement)("p",{className:"bre-fp-intro"},n("fpIntro")),f!==void 0?(0,I.createElement)("p",{className:"bre-fp-error"},n("fpLoadFailed",{error:f})):null,u!==void 0?(0,I.createElement)("p",{className:"bre-fp-error",role:"alert"},n("fpRunFailed",{error:`${u.model}: ${u.error}`})):null,(0,I.createElement)("div",{className:"bre-fp-rows"},...a.map(k=>Qh(k,{t:n,runner:p,runnerState:b,records:d,route:e}))))}function Qh(e,t){let{t:n,runner:r,runnerState:o,records:i}=t,a=i.get(e.model),s=o.running.get(e.model),d=o.queued.indexOf(e.model),l=s!==void 0,f=d>=0,m=l?{className:"is-running",text:n("fpStateRunning",{done:s,total:3})}:f?{className:"is-queued",text:n("fpQueued",{position:d+1})}:a===void 0?{className:"is-idle",text:n("fpStateUnchecked")}:a.status==="failed"?{className:"is-failed",text:n("fpStateFailed")}:a.status==="doubtful"?{className:"is-doubtful",text:n("fpStateDoubtful",{probability:$n(a.probability)})}:{className:"is-identified",text:n("fpStateIdentified",{model:a.predictionName??a.prediction??e.model,probability:$n(a.probability)})},u=a===void 0?"fpDetect":a.status==="failed"?"fpRetry":"fpRetest";return(0,I.createElement)("div",{className:"bre-fp-row",key:e.model},(0,I.createElement)("div",{className:"bre-fp-row-head"},(0,I.createElement)("span",{className:"bre-fp-model"},e.model),(0,I.createElement)("span",{className:`bre-fp-badge ${m.className}`},m.text),(0,I.createElement)("span",{className:"grow"}),(0,I.createElement)("span",{className:"bre-fp-evidence"},a===void 0?n("fpCost",{count:3,seconds:15}):n("fpEvidence",{used:a.usedOutputs,total:3,similarity:$n(a.top?.[0]?.similarity)})),(0,I.createElement)("button",{type:"button",className:"bre-fp-action",disabled:l||f,onClick:()=>{r?.check(e.model)}},n(u))),a!==void 0&&a.status!=="failed"?Zh(a,n):a!==void 0&&a.error!==void 0?(0,I.createElement)("div",{className:"bre-fp-body"},(0,I.createElement)("p",{className:"bre-fp-error"},a.error)):null)}function Zh(e,t){let n=e.top??[];return(0,I.createElement)("div",{className:"bre-fp-body"},(0,I.createElement)("div",{className:"bre-fp-family"},(0,I.createElement)("span",{className:"bre-fp-k"},t("fpFamily")),(0,I.createElement)("span",{className:"bre-fp-v"},`${e.familyPrediction??"\u2014"} \xB7 ${$n(e.familyProbability)}`),(0,I.createElement)("span",{className:"grow"}),(0,I.createElement)("span",{className:"bre-fp-k"},t("fpCheckedAt",{time:Jh(e.checkedAt)}))),(0,I.createElement)("div",{className:"bre-fp-k",style:{marginTop:"8px"}},t("fpCandidates")),(0,I.createElement)("div",{className:"bre-fp-bars"},...n.map((r,o)=>(0,I.createElement)("div",{className:"bre-fp-bar",key:r.model},(0,I.createElement)("span",{className:"bre-fp-bar-name"},r.model),(0,I.createElement)("span",{className:`bre-fp-bar-fill${o===0?" is-top":""}`,style:{width:`${Math.max(2,Math.round(r.probability*100))}%`}}),(0,I.createElement)("span",{className:"bre-fp-bar-value"},$n(r.probability))))),(0,I.createElement)("p",{className:"bre-fp-note"},t("fpClosedSet")))}var mu="settings.models.provider-card";function eg(e){if(e===null)return;let t=e.querySelector('[class*="editorActions"]');if(t===null)return;let n=Array.from(t.querySelectorAll("button")),r=t.querySelector('button[class*="secondaryButton"]')??n.at(-2)??null;r!==null&&(r instanceof HTMLButtonElement&&r.disabled||r.click())}function tg({provider:e,api:t,t:n,ctx:r}){let o=(0,Ue.useRef)(null),i=e?.provider,a=(0,Ue.useCallback)(()=>{eg(tn(o.current))},[]);return(0,Ue.useLayoutEffect)(()=>{let s=o.current,d=tn(s);if(s===null||d===null)return;let l=d,f=()=>d.querySelector('[class*="_editor"]')!==null,m=()=>{let c=f()?"1":"0";s.dataset.edit!==c&&(s.dataset.edit=c)};m();let u=new MutationObserver(m);return u.observe(l,{childList:!0,subtree:!0}),()=>{u.disconnect()}},[i]),typeof i!="string"||i.length===0?null:(0,Ue.createElement)("div",{ref:o,className:"bre-headers-host","data-bre-provider":i},(0,Ue.createElement)(po,{host:o,t:n}),(0,Ue.createElement)(fo,{route:i,api:t,t:n,onDismiss:a}),(0,Ue.createElement)(pu,{route:i,api:t,t:n,ctx:r,host:o}))}function hu(e,t,n){let r=e,o=r.slots?.inject(mu,()=>{r.slots?.register({name:mu,key:xe,inject:()=>({api:t,t:n,ctx:e})},tg)});return typeof o=="function"?o:()=>{}}var Ie=require("react");function gu(e){let{t}=e,n=(0,Ie.useSyncExternalStore)(ir,Ke),r=()=>{La(!n)};return(0,Ie.createElement)("div",{className:"bre-slider-setting"},(0,Ie.createElement)("div",{className:"bre-slider-setting-row"},(0,Ie.createElement)("div",{className:"bre-slider-setting-copy"},(0,Ie.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,Ie.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,Ie.createElement)("div",{className:"bre-slider-setting-control"},(0,Ie.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,Ie.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,Ie.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function bu(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:pe+"-slider-toggle",order:15,inject:()=>({t})},gu)});return typeof r=="function"?r:()=>{}}var wu=200,ng=pe,rg=["slots","locale","connection","remote","remote.settings"];function og(e){e.effect(()=>e.locale.register(Ho,{zh:Ma,en:Ta}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=pe,t.dataset.pluginStyles=pe,t.textContent=$a,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let p=e.get?.("configForms");try{let h=p?.get?.(xe);if(h!==void 0)return h}catch{}return e.get?.("settingsScope")?.bind?.({namespace:xe})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(Ho),i=()=>{let p=e.locale;return typeof p.subscribe=="function"&&typeof p.getSnapshot=="function"?p:void 0},a=p=>{let b=i();return b===void 0?p():(0,yu.createElement)(Ea,{locale:b,children:p})},s=Ss({api:r}),d=ss(r),l=cu({ctx:e,configuredEffort:s.of}),f=Ms({menuOf:ks,triggerOf:Es,t:o,refreshed:a,sliderEnabled:Ke,directory:l.ensure,configuredInputs:d}),m=Ls({api:r}),u=ru({ctx:e,api:r,t:o,onIdle:m.run,refreshed:a}),c=()=>{l.ensure(),f.reconcile()};e.effect(()=>(u.start(c),()=>{u.teardown(),f.dispose(),l.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let p=()=>{u.flushOnUnload(),lu()};return window.addEventListener("pagehide",p),()=>{window.removeEventListener("pagehide",p)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let b=ya(()=>{u.state.describePromise=void 0,s.invalidate(),d.invalidate(),m.invalidate(),u.schedule()},wu),h=[e.remote.$on("settings/document-updated",x=>{x===xe&&b.schedule()}),e.on("connection/reset",b.schedule)];return()=>{b.dispose();for(let x of h)x()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let p=v=>{v.key===or?Aa(v.newValue!=="false"):v.key===ar?Na(qt(v.newValue)):v.key===dr?Fa(Da(v.newValue)):v.key===cr&&za(Ko(v.newValue))};window.addEventListener("storage",p);let b=ir(()=>{u.schedule()}),h=sr(()=>{u.schedule()}),x=lr(()=>{u.schedule()}),S=ur(()=>{u.schedule()});return()=>{window.removeEventListener("storage",p),b(),h(),x(),S()}},"dsh-model-think-level: client preferences"),e.effect(()=>bu(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>hu(e,r,o),"dsh-model-think-level: provider-card slot activation")}
1918
3927
 
1919
3928
  return module.exports;
1920
3929
  }