dsh-model-think-level 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
 
7
- "use strict";var at=Object.defineProperty;var ui=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var pi=Object.prototype.hasOwnProperty;var gi=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mi=(e,t)=>{for(var n in t)at(e,n,{get:t[n],enumerable:!0})},hi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ci(t))!pi.call(e,o)&&o!==n&&at(e,o,{get:()=>t[o],enumerable:!(r=ui(t,o))||r.enumerable});return e};var bi=e=>hi(at({},"__esModule",{value:!0}),e);var Kn=(e,t,n)=>gi(e,typeof t!="symbol"?t+"":t,n);var ca={};mi(ca,{EffortEditor:()=>Mt,apply:()=>ua,baselineModelsOf:()=>qr,compatOf:()=>hn,createEditorApi:()=>wn,defaultEffortOf:()=>xn,describeNamespace:()=>X,effortsOf:()=>gn,findModelMenu:()=>Dn,findModelTrigger:()=>Pn,inject:()=>fa,inputOf:()=>mn,name:()=>la,nameOf:()=>bn,providerHeadersOf:()=>yn,providersOf:()=>ve,userProvidersOf:()=>pn,writeModelRows:()=>Ve,writeProviderHeaders:()=>vn});module.exports=bi(ca);var Jo=require("react");var z="dsh-model-think-level",Bn="/dsh-model-think-level/raw-models",zn="/dsh-model-think-level/autofill-config",Gn="/dsh-model-think-level/headers-config",Y="llm-pi-ai",ue="reasoningEffortsUnset",xe="inputUnset",He="reasoningEffortsAutofilled",_e="defaultEffort",jt=z;var je=require("react");function Vn(e){let{locale:t}=e,n=(0,je.useCallback)(o=>t.subscribe(o),[t]),r=(0,je.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,je.useSyncExternalStore)(n,r),e.children()}var $n={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",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.",conflict:"The settings document kept changing under this edit. Wait a moment, then apply again.",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",sliderEffortAria:"Reasoning effort",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",sliderEffortTitle:"Reasoning effort \xB7 {name}",sliderEffortTitleError:"Reasoning effort failed: {error}",sliderNoCurrent:"No model selected.",compatTitle:"Endpoint compatibility",budgetFieldLabel:"Thinking budget field",budgetFieldHint:"Which parameter carries the thinking-token budget: some vLLM and self-hosted endpoints read thinking_token_budget, others thinking_budget or thinking_budget_tokens. Unset sends none of them.",budgetUnset:"Not set",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",priorityLabel:"vLLM priority",priorityPlaceholder:"e.g. 0",priorityHint:"Scheduler priority for endpoints started with --priority, where lower runs first. Leave empty to send nothing.",priorityInvalid:"Priority must be an integer \u2014 it is not saved until fixed.",maxOutputLabel:"max_output_tokens in requests",maxOutputUnset:"Unset \u2014 follow the protocol default",maxOutputOn:"Send it",maxOutputOff:"Omit it",maxOutputHint:'For Responses-protocol gateways only, and only when a request carries an output cap: some of them reject the parameter, so "Omit it" keeps the cap out of the request entirely. Unset is the safe choice.',aliasMigrated:"Legacy alias detected \u2014 saving writes the explicit budget field.",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",headersTitle:"Request headers",headersHint:"Sent on every request of this route, the model-listing probe included \u2014 add any gateway, routing, metering, or authentication header here.",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.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Jn={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",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",conflict:"\u8BBE\u7F6E\u6587\u6863\u5728\u4FDD\u5B58\u671F\u95F4\u6301\u7EED\u53D8\u5316\uFF0C\u8BF7\u7A0D\u5019\u518D\u6B21\u5E94\u7528\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",sliderEffortAria:"\u601D\u8003\u5F3A\u5EA6",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",sliderEffortTitle:"\u601D\u8003\u5F3A\u5EA6 \xB7 {name}",sliderEffortTitleError:"\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E\u5931\u8D25\uFF1A{error}",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",compatTitle:"\u7AEF\u70B9\u517C\u5BB9",budgetFieldLabel:"\u601D\u8003\u9884\u7B97\u5B57\u6BB5",budgetFieldHint:"\u601D\u8003 token \u9884\u7B97\u7528\u54EA\u4E2A\u53C2\u6570\u53D1\u9001\uFF1A\u90E8\u5206 vLLM\uFF0F\u81EA\u5EFA\u7AEF\u70B9\u8BFB thinking_token_budget\uFF0C\u53E6\u4E00\u4E9B\u8BFB thinking_budget \u6216 thinking_budget_tokens\u3002\u672A\u8BBE\u7F6E\u8868\u793A\u4E09\u4E2A\u90FD\u4E0D\u53D1\u9001\u3002",budgetUnset:"\u672A\u8BBE\u7F6E",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",priorityLabel:"vLLM \u4F18\u5148\u7EA7",priorityPlaceholder:"\u4F8B\u5982 0",priorityHint:"\u4EE5 --priority \u542F\u52A8\u7684\u7AEF\u70B9\u7684\u8C03\u5EA6\u4F18\u5148\u7EA7\uFF0C\u6570\u503C\u8D8A\u5C0F\u8D8A\u5148\u6267\u884C\u3002\u7559\u7A7A\u8868\u793A\u4E0D\u53D1\u9001\u3002",priorityInvalid:"\u4F18\u5148\u7EA7\u5FC5\u987B\u662F\u6574\u6570\u2014\u2014\u4FEE\u6B63\u524D\u4E0D\u4F1A\u4FDD\u5B58\u3002",maxOutputLabel:"\u8BF7\u6C42\u4E2D\u7684 max_output_tokens",maxOutputUnset:"\u672A\u8BBE\u7F6E\u2014\u2014\u8DDF\u968F\u534F\u8BAE\u9ED8\u8BA4",maxOutputOn:"\u53D1\u9001",maxOutputOff:"\u4E0D\u53D1\u9001",maxOutputHint:'\u4EC5\u5BF9 Responses \u534F\u8BAE\u7684\u7F51\u5173\u751F\u6548\uFF0C\u4E14\u53EA\u5728\u8BF7\u6C42\u5E26\u8F93\u51FA\u4E0A\u9650\u65F6\u624D\u8D77\u4F5C\u7528\uFF1A\u90E8\u5206\u7F51\u5173\u4F1A\u62D2\u6536\u8BE5\u53C2\u6570\uFF0C\u9009"\u4E0D\u53D1\u9001"\u53EF\u8BA9\u8BF7\u6C42\u5B8C\u5168\u4E0D\u643A\u5E26\u8F93\u51FA\u4E0A\u9650\u3002\u672A\u8BBE\u7F6E\u662F\u6700\u5B89\u5168\u7684\u9009\u62E9\u3002',aliasMigrated:"\u68C0\u6D4B\u5230\u65E7\u522B\u540D\u2014\u2014\u4FDD\u5B58\u65F6\u4F1A\u5199\u5165\u663E\u5F0F\u9884\u7B97\u5B57\u6BB5\u3002",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",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\uFF08\u8BC6\u522B\u6A21\u578B\u5217\u8868\u7684\u63A2\u6D4B\u8BF7\u6C42\u4E5F\u5305\u62EC\uFF09\uFF1A\u4E2D\u8F6C\u7AD9\u7684\u8DEF\u7531\u3001\u8BA1\u91CF\u3001\u8BA4\u8BC1\u7B49\u4EFB\u610F\u8BF7\u6C42\u5934\u90FD\u53EF\u4EE5\u5199\u5728\u8FD9\u91CC\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",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 dt="dsh-model-think-level.slider.enabled",xi=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],qe=wi();function wi(){try{let e=window.localStorage.getItem(dt),t=e===null?xi.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var qt=new Set;function Xn(){for(let e of[...qt])e()}function ne(){return qe}function Yn(e){if(qe!==e){qe=e;try{window.localStorage.setItem(dt,String(e))}catch{}Xn()}}function Qn(e){qe!==e&&(qe=e,Xn())}function lt(e){return qt.add(e),()=>{qt.delete(e)}}var ft="dsh-model-think-level.provider-order",Zn=["deepseek-account","deepseek-official"];function De(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?Bt(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function Bt(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 Ie=(()=>{try{return De(window.localStorage.getItem(ft))}catch{return[]}})(),Kt=new Set;function er(){for(let e of[...Kt])e()}function tr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function zt(){return Ie}function nr(e){let t=Bt(e);if(!tr(Ie,t)){Ie=t;try{window.localStorage.setItem(ft,JSON.stringify(Ie))}catch{}er()}}function rr(e){let t=Bt(e);tr(Ie,t)||(Ie=t,er())}function ut(e){return Kt.add(e),()=>{Kt.delete(e)}}function Gt(e){let t=n=>{let r=Zn.indexOf(n);return r<0?Zn.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 Pe(e,t){let n=new Map;for(let i of t)n.has(i)||n.set(i,n.size);let r=[],o=[];e.forEach((i,s)=>{n.has(i)&&(r.push(s),o.push(i))}),o.sort((i,s)=>n.get(i)-n.get(s));let a=[...e];return r.forEach((i,s)=>{a[i]=o[s]}),a}function or(e){return Pe(Gt(e),zt())}function Vt(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let a=Math.max(0,Math.min(o.length,n));return o.splice(a,0,t),o}var ct="dsh-model-think-level.providers.disabled",$t=new Set,we=yi();function yi(){try{return De(window.localStorage.getItem(ct))}catch{return[]}}function ir(e){return De(e)}function sr(){return we}function pt(e){return!we.includes(e)}function ar(e,t){let n=!we.includes(e);t!==n&&lr(t?we.filter(r=>r!==e):[...we,e],!0)}function dr(e){lr(e,!1)}function gt(e){return $t.add(e),()=>{$t.delete(e)}}function vi(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function lr(e,t){if(!vi(we,e)){if(we=[...new Set(e)],t)try{window.localStorage.setItem(ct,JSON.stringify(we))}catch{}for(let n of[...$t])n()}}var mt="dsh-model-think-level.model-order";function Xt(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 a=fr(o.filter(i=>typeof i=="string"));a.length>0&&(n[r]=a)}return n}catch{return{}}}function fr(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 Me=(()=>{try{return Xt(window.localStorage.getItem(mt))}catch{return{}}})(),Jt=new Set;function ur(){for(let e of[...Jt])e()}function ki(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Ei(){try{window.localStorage.setItem(mt,JSON.stringify(Me))}catch{}}function cr(){return Me}function Yt(e){return Me[e]??Mi}var Mi=[];function pr(e,t){if(e.length===0)return;let n=fr(t),r=Yt(e);if(ki(r,n)&&(n.length>0||!(e in Me)))return;let o={...Me};n.length===0?delete o[e]:o[e]=n,Me=o,Ei(),ur()}function gr(e){Me=e,ur()}function ht(e){return Jt.add(e),()=>{Jt.delete(e)}}function Si(e,t){return Pe(e,t)}function mr(e,t){return Pe(t,Yt(e))}function hr(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return Si(e.map(r=>r.id),t).map(r=>n.get(r))}var br=`
7
+ "use strict";var Rt=Object.defineProperty;var qs=Object.getOwnPropertyDescriptor;var Bs=Object.getOwnPropertyNames;var Ws=Object.prototype.hasOwnProperty;var Us=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var js=(e,t)=>{for(var n in t)Rt(e,n,{get:t[n],enumerable:!0})},zs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bs(t))!Ws.call(e,o)&&o!==n&&Rt(e,o,{get:()=>t[o],enumerable:!(r=qs(t,o))||r.enumerable});return e};var Gs=e=>zs(Rt({},"__esModule",{value:!0}),e);var Hr=(e,t,n)=>Us(e,typeof t!="symbol"?t+"":t,n);var Al={};js(Al,{EffortEditor:()=>Qt,apply:()=>Ll,baselineModelsOf:()=>_o,compatOf:()=>$t,createEditorApi:()=>Jt,defaultEffortOf:()=>Xn,describeNamespace:()=>ne,effortsOf:()=>Gt,findModelMenu:()=>kr,findModelTrigger:()=>Er,inject:()=>Sl,inputOf:()=>Vt,name:()=>Ml,nameOf:()=>Yt,providerHeadersOf:()=>Qn,providersOf:()=>ve,userProvidersOf:()=>Jn,writeModelRows:()=>ct,writeProviderHeaders:()=>Zn});module.exports=Gs(Al);var Ts=require("react");var J="dsh-model-think-level",_r="/dsh-model-think-level/raw-models";var Ot="/dsh-model-think-level/provider-key",Nr="/dsh-model-think-level/key-index",Ir="/dsh-model-think-level/autofill-config",Dr="/dsh-model-think-level/headers-config",re="llm-pi-ai",ge="reasoningEffortsUnset",Ee="inputUnset",ze="reasoningEffortsAutofilled",Ge="defaultEffort",Ln=J;var st=require("react");function Pr(e){let{locale:t}=e,n=(0,st.useCallback)(o=>t.subscribe(o),[t]),r=(0,st.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,st.useSyncExternalStore)(n,r),e.children()}var Cr={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptAllHint:"Adapt every model of this provider at once",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.",conflict:"The settings document kept changing under this edit. Wait a moment, then apply again.",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",sliderEffortAria:"Reasoning effort",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",sliderEffortTitle:"Reasoning effort \xB7 {name}",sliderEffortTitleError:"Reasoning effort failed: {error}",sliderNoCurrent:"No model selected.",compatTitle:"Endpoint compatibility",budgetFieldLabel:"Thinking budget field",budgetFieldHint:"Which parameter carries the thinking-token budget: some vLLM and self-hosted endpoints read thinking_token_budget, others thinking_budget or thinking_budget_tokens. Unset sends none of them.",budgetUnset:"Not set",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",priorityLabel:"vLLM priority",priorityPlaceholder:"e.g. 0",priorityHint:"Scheduler priority for endpoints started with --priority, where lower runs first. Leave empty to send nothing.",priorityInvalid:"Priority must be an integer \u2014 it is not saved until fixed.",maxOutputLabel:"max_output_tokens in requests",maxOutputUnset:"Unset \u2014 follow the protocol default",maxOutputOn:"Send it",maxOutputOff:"Omit it",maxOutputHint:'For Responses-protocol gateways only, and only when a request carries an output cap: some of them reject the parameter, so "Omit it" keeps the cap out of the request entirely. Unset is the safe choice.',aliasMigrated:"Legacy alias detected \u2014 saving writes the explicit budget field.",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, the model-listing probe included \u2014 add any gateway, routing, metering, or authentication header here.",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.",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."},Fr={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",autoAdaptAllHint:"\u5C06\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u81EA\u52A8\u9002\u914D\u601D\u8003\u7B49\u7EA7",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",conflict:"\u8BBE\u7F6E\u6587\u6863\u5728\u4FDD\u5B58\u671F\u95F4\u6301\u7EED\u53D8\u5316\uFF0C\u8BF7\u7A0D\u5019\u518D\u6B21\u5E94\u7528\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",sliderEffortAria:"\u601D\u8003\u5F3A\u5EA6",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",sliderEffortTitle:"\u601D\u8003\u5F3A\u5EA6 \xB7 {name}",sliderEffortTitleError:"\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E\u5931\u8D25\uFF1A{error}",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",compatTitle:"\u7AEF\u70B9\u517C\u5BB9",budgetFieldLabel:"\u601D\u8003\u9884\u7B97\u5B57\u6BB5",budgetFieldHint:"\u601D\u8003 token \u9884\u7B97\u7528\u54EA\u4E2A\u53C2\u6570\u53D1\u9001\uFF1A\u90E8\u5206 vLLM\uFF0F\u81EA\u5EFA\u7AEF\u70B9\u8BFB thinking_token_budget\uFF0C\u53E6\u4E00\u4E9B\u8BFB thinking_budget \u6216 thinking_budget_tokens\u3002\u672A\u8BBE\u7F6E\u8868\u793A\u4E09\u4E2A\u90FD\u4E0D\u53D1\u9001\u3002",budgetUnset:"\u672A\u8BBE\u7F6E",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",priorityLabel:"vLLM \u4F18\u5148\u7EA7",priorityPlaceholder:"\u4F8B\u5982 0",priorityHint:"\u4EE5 --priority \u542F\u52A8\u7684\u7AEF\u70B9\u7684\u8C03\u5EA6\u4F18\u5148\u7EA7\uFF0C\u6570\u503C\u8D8A\u5C0F\u8D8A\u5148\u6267\u884C\u3002\u7559\u7A7A\u8868\u793A\u4E0D\u53D1\u9001\u3002",priorityInvalid:"\u4F18\u5148\u7EA7\u5FC5\u987B\u662F\u6574\u6570\u2014\u2014\u4FEE\u6B63\u524D\u4E0D\u4F1A\u4FDD\u5B58\u3002",maxOutputLabel:"\u8BF7\u6C42\u4E2D\u7684 max_output_tokens",maxOutputUnset:"\u672A\u8BBE\u7F6E\u2014\u2014\u8DDF\u968F\u534F\u8BAE\u9ED8\u8BA4",maxOutputOn:"\u53D1\u9001",maxOutputOff:"\u4E0D\u53D1\u9001",maxOutputHint:'\u4EC5\u5BF9 Responses \u534F\u8BAE\u7684\u7F51\u5173\u751F\u6548\uFF0C\u4E14\u53EA\u5728\u8BF7\u6C42\u5E26\u8F93\u51FA\u4E0A\u9650\u65F6\u624D\u8D77\u4F5C\u7528\uFF1A\u90E8\u5206\u7F51\u5173\u4F1A\u62D2\u6536\u8BE5\u53C2\u6570\uFF0C\u9009"\u4E0D\u53D1\u9001"\u53EF\u8BA9\u8BF7\u6C42\u5B8C\u5168\u4E0D\u643A\u5E26\u8F93\u51FA\u4E0A\u9650\u3002\u672A\u8BBE\u7F6E\u662F\u6700\u5B89\u5168\u7684\u9009\u62E9\u3002',aliasMigrated:"\u68C0\u6D4B\u5230\u65E7\u522B\u540D\u2014\u2014\u4FDD\u5B58\u65F6\u4F1A\u5199\u5165\u663E\u5F0F\u9884\u7B97\u5B57\u6BB5\u3002",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\uFF08\u8BC6\u522B\u6A21\u578B\u5217\u8868\u7684\u63A2\u6D4B\u8BF7\u6C42\u4E5F\u5305\u62EC\uFF09\uFF1A\u4E2D\u8F6C\u7AD9\u7684\u8DEF\u7531\u3001\u8BA1\u91CF\u3001\u8BA4\u8BC1\u7B49\u4EFB\u610F\u8BF7\u6C42\u5934\u90FD\u53EF\u4EE5\u5199\u5728\u8FD9\u91CC\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",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 Ht="dsh-model-think-level.slider.enabled",Vs=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],at=$s();function $s(){try{let e=window.localStorage.getItem(Ht),t=e===null?Vs.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var An=new Set;function Kr(){for(let e of[...An])e()}function ae(){return at}function qr(e){if(at!==e){at=e;try{window.localStorage.setItem(Ht,String(e))}catch{}Kr()}}function Br(e){at!==e&&(at=e,Kr())}function _t(e){return An.add(e),()=>{An.delete(e)}}var Nt="dsh-model-think-level.provider-order",Wr=["deepseek-account","deepseek-official"];function $e(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?On(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function On(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 Ve=(()=>{try{return $e(window.localStorage.getItem(Nt))}catch{return[]}})(),Rn=new Set;function Ur(){for(let e of[...Rn])e()}function jr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Hn(){return Ve}function zr(e){let t=On(e);if(!jr(Ve,t)){Ve=t;try{window.localStorage.setItem(Nt,JSON.stringify(Ve))}catch{}Ur()}}function Gr(e){let t=On(e);jr(Ve,t)||(Ve=t,Ur())}function It(e){return Rn.add(e),()=>{Rn.delete(e)}}function _n(e){let t=n=>{let r=Wr.indexOf(n);return r<0?Wr.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 Ye(e,t){let n=new Map;for(let i of t)n.has(i)||n.set(i,n.size);let r=[],o=[];e.forEach((i,s)=>{n.has(i)&&(r.push(s),o.push(i))}),o.sort((i,s)=>n.get(i)-n.get(s));let a=[...e];return r.forEach((i,s)=>{a[i]=o[s]}),a}function Vr(e){return Ye(_n(e),Hn())}function Nn(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let a=Math.max(0,Math.min(o.length,n));return o.splice(a,0,t),o}var Dt="dsh-model-think-level.providers.disabled",In=new Set,Te=Ys();function Ys(){try{return $e(window.localStorage.getItem(Dt))}catch{return[]}}function $r(e){return $e(e)}function Yr(){return Te}function Pt(e){return!Te.includes(e)}function Jr(e,t){let n=!Te.includes(e);t!==n&&Qr(t?Te.filter(r=>r!==e):[...Te,e],!0)}function Xr(e){Qr(e,!1)}function Ct(e){return In.add(e),()=>{In.delete(e)}}function Js(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function Qr(e,t){if(!Js(Te,e)){if(Te=[...new Set(e)],t)try{window.localStorage.setItem(Dt,JSON.stringify(Te))}catch{}for(let n of[...In])n()}}var Ft="dsh-model-think-level.model-order";function Pn(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 a=Zr(o.filter(i=>typeof i=="string"));a.length>0&&(n[r]=a)}return n}catch{return{}}}function Zr(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 Ie=(()=>{try{return Pn(window.localStorage.getItem(Ft))}catch{return{}}})(),Dn=new Set;function eo(){for(let e of[...Dn])e()}function Xs(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Qs(){try{window.localStorage.setItem(Ft,JSON.stringify(Ie))}catch{}}function to(){return Ie}function Cn(e){return Ie[e]??Zs}var Zs=[];function no(e,t){if(e.length===0)return;let n=Zr(t),r=Cn(e);if(Xs(r,n)&&(n.length>0||!(e in Ie)))return;let o={...Ie};n.length===0?delete o[e]:o[e]=n,Ie=o,Qs(),eo()}function ro(e){Ie=e,eo()}function Kt(e){return Dn.add(e),()=>{Dn.delete(e)}}function ea(e,t){return Ye(e,t)}function oo(e,t){return Ye(t,Cn(e))}function io(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return ea(e.map(r=>r.id),t).map(r=>n.get(r))}var so=`
8
8
  /* The injector's mount wrapper. It \u2014 not the editor inside it \u2014 is the item
9
9
  placed into the official row disclosure's repeat(auto-fit, minmax(160px,1fr))
10
10
  grid (context window and max tokens take two cells), so the span belongs
@@ -54,6 +54,13 @@ window.__ModuleLoader__.load({
54
54
  }
55
55
  .bre-link-button:hover { text-decoration: underline; }
56
56
  .bre-link-button:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
57
+ .bre-auto-effort {
58
+ /* Seated in the OFFICIAL catalogue head, beside the host's own fetch link:
59
+ it borrows the plugin's link metrics and only adds the gap the head's own
60
+ controls are spaced by, so it reads as one more control of that row. */
61
+ margin-left: 4px;
62
+ flex: none;
63
+ }
57
64
  .bre-effort-grid {
58
65
  /* Exactly two equal columns mirroring the official capacity pair the editor
59
66
  sits under; an odd row count leaves the last cell in the left column,
@@ -1252,7 +1259,11 @@ li.bre-row-dragging { opacity: .5; }
1252
1259
  li.bre-row-drop-target { border-color: var(--dsw-alias-brand-primary); }
1253
1260
 
1254
1261
  /* The insertion line. A fixed overlay on the body, never a child of the list
1255
- React owns, so writing it cannot trigger anything in the official section. */
1262
+ React owns, so writing it cannot trigger anything in the official section.
1263
+ The layer stack matters more than it looks: the provider list lives inside the
1264
+ settings dialog, whose overlay is fixed and opaque with z-index 1000, so a
1265
+ line in the shell's own range would be drawn behind the dialog and never
1266
+ seen. It clears the dialog, and stays under the header's controls. */
1256
1267
  .bre-drop-line {
1257
1268
  position: fixed;
1258
1269
  display: none;
@@ -1261,7 +1272,7 @@ li.bre-row-drop-target { border-color: var(--dsw-alias-brand-primary); }
1261
1272
  background: var(--dsw-alias-brand-primary, #4d6bfe);
1262
1273
  box-shadow: 0 0 0 1px #ffffffb3, 0 1px 4px var(--dsw-alias-brand-primary, #4d6bfe);
1263
1274
  pointer-events: none;
1264
- z-index: 55;
1275
+ z-index: 1200;
1265
1276
  }
1266
1277
 
1267
1278
  /* The row slide (a FLIP pass driven from the script) is motion; drop it for a
@@ -1364,7 +1375,544 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1364
1375
  .bre-provider-switch,
1365
1376
  .bre-provider-switch::after { transition: none; }
1366
1377
  }
1367
- `;var Ge=require("react"),Fr=require("react-dom");var k=require("react"),dn=require("react-dom");var vr=["off","minimal","low","medium","high","xhigh","max"],Ti=["text","image"];var Li=[{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:105e4,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\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:105e4,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium / High(\u9ED8\u8BA4) / XHigh \u4E14\u4EC5 Responses API\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:105e4,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\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],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.3-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1Bgpt-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-chat",patterns:["gpt-5.1-chat-latest","gpt-5.2-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.2-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\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-astra",patterns:["gpt-6-astra","gpt-6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,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\uFF0C1,050,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\uFF1BAI \u5B98\u65B9\u9ED8\u8BA4\u6863\u4F4D\u672A\u516C\u5E03\uFF0C\u6545\u4E0D\u586B\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\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",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-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 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1BFable 5.1 \u4E0E Mythos 5.1 \u89C1\u5355\u72EC\u6761\u76EE\uFF0CMythos Preview \u4EC5\u81F3 Max\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:{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 Fable 5.1 / Mythos 5.1\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1B\u8FD9\u4E24\u578B\u4E5F\u662F\u5B98\u65B9\u552F\u4E00\u5141\u8BB8\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\u7684\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\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],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 Opus 4.7/4.8 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],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 4.6 \u4EE3\u6863\u4F4D\uFF1ALow / Medium / High / Max\uFF08\u65E0 XHigh\u2014\u2014\u5B98\u65B9\u660E\u8A00\u300C\u652F\u6301 max \u7684\u90E8\u5206\u578B\u53F7\u4E0D\u652F\u6301 xhigh\u300D\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 Fable/Mythos 5\u3001Opus 5/4.6-4.8\u3001Sonnet 5/4.6\u3001Opus 4.5 \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\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\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,note:'Grok 4.7\uFF08\u4E0A\u6E38\u5FEB\u7167 grok-4.7-20260916\uFF09\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\u2014\u2014**\u53D6\u81EA\u516C\u5F00\u76EE\u5F55**\uFF08OpenRouter \u7684 supported_parameters\u3001models.dev \u5BF9 docs.x.ai \u7684\u8F6C\u8FF0\uFF09\uFF0C\u672C\u6B21 xAI \u5B98\u65B9\u6587\u6863\u7AD9\u4E0D\u53EF\u8FBE\u3001\u672A\u80FD\u4E00\u624B\u8BC1\u5B9E\uFF1B\u9ED8\u8BA4\u6863\u4F4D\u4E0E"\u80FD\u5426\u5173\u95ED\u601D\u8003"\u540C\u6837\u672A\u8BC1\u5B9E\uFF0C\u6545\u4E0D\u58F0\u660E Off\uFF0C\u4E5F\u4E0D\u5199\u9ED8\u8BA4\u6863\u3002\u5E26\u56FE\u8F93\u5165\uFF08\u76EE\u5F55\u8BB0 text+image+file\uFF0CPDF \u5B58\u7591\uFF09\uFF0C500K \u4E0A\u4E0B\u6587\uFF1B\u6700\u5927\u8F93\u51FA\u5404\u76EE\u5F55\u7ED9\u51FA 450K \u4E0E 500K \u4E24\u79CD\u503C\uFF0C\u6309"\u5206\u6B67\u5373\u4E0D\u5199"\u5904\u7406\u30022026-08 \u90A3\u6B21"grok-4.7 \u4E0D\u5B58\u5728\uFF08\u5B98\u65B9 404\uFF09"\u7684\u7ED3\u8BBA\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\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",xhigh:"xhigh"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3001\u5E26\u56FE\u8F93\u5165\uFF1Bgrok-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:!1,input:["text"],contextWindow:32768,maxTokens:32768,note:"Magistral \u539F\u751F\u601D\u8003\u7EBF\uFF08\u65E0 effort \u53C2\u6570\uFF0C\u4E3A prompt_mode \u8BED\u4E49\uFF09\uFF0C\u5B98\u65B9\u5DF2\u4E8E 2026-07-28 \u58F0\u660E\u5F03\u7528\u3001\u9010\u6B65\u64A4\u51FA\uFF1B\u73B0\u5F79\u63A8\u7406\u8D70 mistral-small-2603 / mistral-medium-3-5 \u7684 reasoning_effort\uFF08\u89C1\u4E0B\u6761\uFF09\u3002"},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","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\uFF1ANone / High\u2014\u2014\u5B98\u65B9 reasoning_effort \u679A\u4E3E\uFF08mistral-common \u534F\u8BAE\u5E93\uFF09\u5373 none/high\uFF1Bmistral-small-2603\uFF08Small 4\uFF09\u4E0E mistral-medium-3-5 \u7ECF\u5B83\u63A7\u5236\uFF0CMedium 3.5 \u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\u672A\u5728\u5B98\u65B9\u76EE\u5F55\u9875\u5355\u5217\uFF0C\u4E0D\u63D0\u4F9B\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"],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-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-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,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\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"}],Qt={off:null,low:"low",medium:"medium",high:"high"},Ri={"openai-completions":Qt,"openai-responses":Qt,"anthropic-messages":Qt,deepseek:{off:"none",low:"low",high:"high",max:"max"}},Oi={low:"low",medium:"medium",high:"high"};function Be(e){return(e??"").toLowerCase().trim()}function xr(e){return e!==void 0&&/[a-z0-9]/.test(e)}function Ke(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function kr(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!xr(r)&&!xr(o)}function en(e,t){let n=Ke(e)+" "+Ke(t??""),r;for(let o of Li)for(let a of o.patterns){let i=Ke(a),s=n.indexOf(i);for(;s>=0;){if(kr(n,s,i.length)){(r===void 0||i.length>r.length)&&(r={entry:o,length:i.length});break}s=n.indexOf(i,s+1)}}return r?.entry}var Ai={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function Ni(e){let t=Be(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 a=Ai[o.slice(-2).join(".")];if(a!==void 0)return a}}catch{}return"openai-completions"}var bt="openai-completions",Er="anthropic-messages";function Zt(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 Hi(e,t){let n=Be(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===Er){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority","supportsMaxOutputTokens"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n==="openai-responses"){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.supportsMaxOutputTokens===void 0?void 0:{supportsMaxOutputTokens:r.supportsMaxOutputTokens}}if(n===bt)return delete r.forceAdaptiveThinking,delete r.supportsMaxOutputTokens,Object.keys(r).length===0?void 0:r}function _i(e,t){let n=Be(t.api);if(n===bt){let r=e.compat;return r!==void 0&&(r=Hi(r,n)??void 0),r===void 0&&!Zt(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&Zt(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===Er&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var Ii=["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 tn(e){if(Be(e.api)!==bt)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(".")?!Ii.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function wr(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!tn(t)?e:{...e,supportsDeveloperRole:!1}}var yr={off:null,low:"low",medium:"medium",high:"high"},Di=["vl","vision","omni","4o","pixtral","internvl"];function nn(e){let t=Ke(e);for(let n of Di){let r=Ke(n),o=t.indexOf(r);for(;o>=0;){if(kr(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function Pi(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>Ti.includes(n)))return t.includes("image")?["text","image"]:["text"]}function ce(e,t,n){let r=en(e,t.displayName),o,a,i,s;r?.input!==void 0&&(o=r.input,a="knowledge"),r?.contextWindow!==void 0&&(i=r.contextWindow),r?.maxTokens!==void 0&&(s=r.maxTokens);let d=Pi(n?.input);if(d!==void 0&&(o=d,a="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(i=n.contextLength),o===void 0){let v=nn(e);v!==void 0&&(o=v,a="heuristic")}let c={...o===void 0?{}:{input:o},...a===void 0?{}:{inputSource:a},...i===void 0?{}:{contextWindow:i},...s===void 0?{}:{maxTokens:s}},g=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",...g,...c};if(r!==void 0){let v=wr(_i(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}:{},...v===void 0?{}:{compat:v},matched:!0,entryId:r.id,source:r.id,confidence:"high",...g,...c}}let u=Ni(t),h=Ri[u]??Oi,f=Be(t.api)===bt?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,l=f!==void 0&&Zt(t.baseURL)?{...f,thinkingTokenBudgetField:"thinking_token_budget"}:f,p=wr(l,t,!0);return n?.reasoning===!0?{efforts:{...yr},...yr.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...g,...c}:{efforts:h,...h.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"protocol:"+u,confidence:"low",...g,...c}}var Sr="dsh-model-think-level.slider.efforts",rn="breSelectWired";function on(e){return typeof e=="object"&&e!==null&&e.ok===!1}function sn(e){if(!on(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 Se(e,t){return`${e}/${t}`}function Tr(){try{let e=window.localStorage.getItem(Sr);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 Ci(e){try{window.localStorage.setItem(Sr,JSON.stringify(e))}catch{}}function Fi(e,t,n){let r=Tr();r[Se(e,t)]=n,Ci(r)}function Wi(e,t){return Tr()[Se(e,t)]}function xt(e,t,n){let o=e.groups.find(a=>a.id===t)?.models.find(a=>a.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(a=>a.id)}function Ui(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function ji(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function qi(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function Mr(e,t,n,r,o){let a=xt(e,t,n);if(a.length===0)return;let i=Se(t,n),s=r.get(i);if(s!==void 0&&a.includes(s))return s;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&a.includes(d))return d;let c=Wi(t,n);if(c!==void 0&&a.includes(c))return c;let g=ce(n,{}).defaultEffort;if(g!==void 0&&a.includes(g))return g;let u=Ui(e,t,n);return u!==void 0&&a.includes(u)?u:ji(a)}function Lr(e,t){let n=e;if(n[rn]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,a=new Map,i=new Set,s=new Map,d=3,c=0,g=async f=>{let l=++c;if(f.reasoningEffort!==void 0){let w=await o.call(e,f);return!on(w)&&ne()&&(a.set(Se(f.provider,f.model),f.reasoningEffort),Fi(f.provider,f.model,f.reasoningEffort)),w}let p=e.store.getSnapshot();if(!qi(p.current,f)){if(ne()){let w=Se(f.provider,f.model);a.delete(w),i.add(w)}return o.call(e,f)}if(!ne())return o.call(e,f);let v=await Mr(p,f.provider,f.model,a,t),y=e.store.getSnapshot();if(!(c!==l||((w,T)=>w===null||T===null?w!==T:w.provider!==T.provider||w.model!==T.model||w.reasoningEffort!==T.reasoningEffort)(y.current,p.current)))return!ne()||v===void 0||!xt(y,f.provider,f.model).includes(v)?o.call(e,f):o.call(e,{...f,reasoningEffort:v})},u=()=>{let f=e.store.getSnapshot(),l=f.current;if(l===null||l.reasoningEffort!==void 0||!ne())return;let p=Se(l.provider,l.model);if(i.has(p))return;if(xt(f,l.provider,l.model).length===0){i.add(p);return}i.add(p);let v=c;Mr(f,l.provider,l.model,a,t).then(async y=>{if(y===void 0){i.delete(p);return}if(!ne()){i.delete(p);return}let M=e.store.getSnapshot(),w=M.current;if(c!==v||w===null||w.reasoningEffort!==void 0||Se(w.provider,w.model)!==p||!xt(M,w.provider,w.model).includes(y))return;let T=await o.call(e,{provider:w.provider,model:w.model,reasoningEffort:y});if(on(T))throw T}).catch(()=>{let y=(s.get(p)??0)+1;s.set(p,y),y<d&&(i.delete(p),u())})},h=e.store.subscribe(u);return u(),n[rn]=!0,e.select=g,()=>{delete n[rn],h(),r?e.select=o:delete n.select}}function Ki(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 Bi(e){return e.current}function zi(e,t){let n=Bi(t),r=e.findIndex(s=>s.id===n?.reasoningEffort);if(r>=0)return r;let a=t.groups.find(s=>s.id===n?.provider)?.models.find(s=>s.id===n?.model)?.reasoning?.defaultEffort,i=a===void 0?-1:e.findIndex(s=>s.id===a);return i>=0?i:Math.floor((e.length-1)/2)}function Rr(e){return e.models??[]}function wt(e){let t=e;return t.name??t.label??t.title??e.id}function an(e){return(0,k.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function Gi(){return(0,k.createElement)("svg",{className:"bre-option-check",width:14,height:14,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0},(0,k.createElement)("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}))}var Or=new Map;function Vi(e){if(Array.isArray(e.input))return e.input.includes("image");let t=Or.get(e.id);if(t!==void 0)return t;let n=en(e.id,e.name)?.input,r=n!==void 0?n.includes("image"):(nn(e.id)??[]).includes("image");return Or.set(e.id,r),r}function $i(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Ji(e){return(0,k.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,k.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,k.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function Xi(e){return(0,k.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,k.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 Yi(e,t){let n=[];return Vi(e)&&n.push((0,k.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Ji(t("tagVision")))),$i(e)&&n.push((0,k.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Xi(t("tagThinking")))),n.length===0?null:(0,k.createElement)("span",{className:"bre-option-tags"},...n)}function Ar(e){let{directory:t,t:n}=e,r=e.onLayoutChange,o=(0,k.useSyncExternalStore)(E=>t.store.subscribe(E),()=>t.store.getSnapshot()),a=Ki(o),[i,s]=(0,k.useState)(""),[d,c]=(0,k.useState)(null),[g,u]=(0,k.useState)(null),[h,f]=(0,k.useState)(!1),[l,p]=(0,k.useState)(null),v=(0,k.useRef)(null),y=(0,k.useRef)(""),M=(0,k.useRef)(!1),w=o.current!==null&&a.length>=2,T=h||o.status==="selecting",x=l??o.error,R=t.select;(0,k.useEffect)(()=>{if(M.current)return;let E=zi(a,o),J=a[E]?.id??"";y.current=J,s(J),p(null)},[w,a,o]),(0,k.useEffect)(()=>{t.load().catch(()=>{})},[t]);let H=o.current,P=o.groups.find(E=>E.id===H?.provider),O=P?.models.find(E=>E.id===H?.model)?.name??(H===null?n("triggerFallback"):H.model),U=H===null?O:wt(P??{id:H.provider})+" \xB7 "+O,F=a.find(E=>E.id===i)?.name??n("effortDefault"),W=(0,k.useSyncExternalStore)(ut,zt),G=(0,k.useSyncExternalStore)(gt,sr),S=(0,k.useSyncExternalStore)(ht,cr),N=o.groups.filter(E=>Rr(E).length>0&&!G.includes(E.id)).map(E=>E.id),_=Pe(Gt(N),W),q=g!==null&&_.includes(g)?g:H!==null&&_.includes(H.provider)?H.provider:_[0]??null,K=q===null?[]:hr(Rr(o.groups.find(E=>E.id===q)),S[q]??[]),oe=H===null?"":H.provider+"/"+H.model,ie=(0,k.useCallback)(E=>{d!==E&&((0,dn.flushSync)(()=>{c(E)}),r?.())},[r,d]),se=(0,k.useCallback)(()=>{d!==null&&((0,dn.flushSync)(()=>{c(null)}),r?.())},[r,d]),ae=(0,k.useCallback)(()=>{let E=v.current?.closest('[role="menu"]');E!=null&&(E.tabIndex=-1,E.focus({preventScroll:!0}))},[]),Ne=(0,k.useCallback)(async(E,J)=>{if(M.current)return;let B=t.store.getSnapshot().current;if(se(),!(B!==null&&B.provider===E&&B.model===J)){M.current=!0,ae(),f(!0),p(null);try{let de=await R({provider:E,model:J}),Q=sn(de);if(Q!==void 0)throw new Error(Q)}catch(de){p(de instanceof Error?de.message:String(de))}finally{M.current=!1,f(!1)}}},[se,t,ae,R]),Fe=(0,k.useCallback)(async E=>{if(M.current||(se(),E===o.current?.reasoningEffort&&o.status!=="error"))return;M.current=!0;let J=y.current;ae(),f(!0),p(null),s(E);try{let B=o.current;if(B===null)throw new Error(n("sliderNoCurrent"));let de=await R({provider:B.provider,model:B.model,reasoningEffort:E}),Q=sn(de);if(Q!==void 0)throw new Error(Q);let ot=t.store.getSnapshot(),Ue=a.find(it=>it.id===ot.current?.reasoningEffort)?.id??E;y.current=Ue,s(Ue)}catch(B){y.current=J,s(J),p(B instanceof Error?B.message:String(B))}finally{M.current=!1,f(!1)}},[se,t,ae,a,R,o.current,o.status,n]),We=[(0,k.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(d==="model"?" is-open":""),disabled:T,"aria-expanded":d==="model",onClick:()=>{ie(d==="model"?null:"model")}},(0,k.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,k.createElement)("span",{className:"bre-row-value"},U),an(d==="model")),d==="model"?(0,k.createElement)("div",{key:"panel:model",className:"bre-panel bre-panel-models"},(0,k.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},..._.map(E=>(0,k.createElement)("button",{key:E,type:"button",className:"bre-provider"+(E===q?" is-open":"")+(E===H?.provider?" is-current":""),disabled:T,"aria-expanded":E===q,onClick:()=>{u(E)}},(0,k.createElement)("span",{className:"bre-option-name"},wt(o.groups.find(J=>J.id===E))),an(E===q))),..._.length===0?[(0,k.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),(0,k.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...K.length===0?[(0,k.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:K.map(E=>{let J=q+"/"+E.id,B=J===oe;return(0,k.createElement)("button",{key:J,type:"button",className:"bre-option"+(B?" is-active":""),disabled:T,"aria-pressed":B,onClick:()=>{Ne(q,E.id)}},(0,k.createElement)("span",{className:"bre-option-name"},E.name??E.id),Yi(E,n))}))):null,(0,k.createElement)("div",{key:"divider",className:"bre-divider","aria-hidden":!0}),(0,k.createElement)("button",{key:"row:effort",type:"button",role:"menuitem",className:"bre-row-control"+(d==="effort"?" is-open":""),disabled:T||!w,"aria-expanded":w?d==="effort":void 0,onClick:()=>{ie(d==="effort"?null:"effort")}},(0,k.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,k.createElement)("span",{className:"bre-row-value"+(w?"":" is-muted")},w?F:n("sliderNoLevels")),w?an(d==="effort"):null),d==="effort"&&w?(0,k.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...a.map(E=>(0,k.createElement)("button",{key:E.id,type:"button",className:"bre-option"+(E.id===i?" is-active":""),disabled:T,"aria-pressed":E.id===i,onClick:()=>{Fe(E.id)}},(0,k.createElement)("span",{className:"bre-option-name"},E.name),E.id===i?Gi():null))):null];return(0,k.createElement)("div",{className:"bre-slider-body",ref:v},(0,k.createElement)("div",{className:"bre-card"},...We),x===null?null:(0,k.createElement)("div",{className:"bre-model-error",role:"status"},x))}var C=require("react"),Hr='section[role="group"]',fn='button[role="menuitemradio"]';function _r(e){return e.querySelector(Hr)!==null}function ln(e){return Array.from(e.querySelectorAll(fn)).filter(t=>!t.disabled&&t.style.display!=="none")}function Qi(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Nr(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let c=n.get(d);c!==void 0&&(d.style.display=c,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let a=t.trim().toLowerCase().split(/\s+/).filter(Boolean),i=Array.from(e.querySelectorAll(Hr)),s=0;if(a.length===0){for(let d of[...n.keys()])o(d);for(let d of i)s+=d.querySelectorAll(fn).length;return s}for(let d of i){let c=Qi(d),g=Array.from(d.querySelectorAll(fn)),u=0;for(let h of g){let f=(h.getAttribute("title")??"").toLowerCase(),l=(h.textContent??"").toLowerCase(),p=`${c} ${f} ${l}`;a.every(v=>p.includes(v))?(o(h),u+=1):r(h)}u>0?(o(d),s+=u):r(d)}return s}function Ir({menu:e,t}){let[n,r]=(0,C.useState)(""),[o,a]=(0,C.useState)(0),i=(0,C.useRef)(null),s=(0,C.useRef)(""),d=(0,C.useRef)(new Map),c=(0,C.useCallback)(f=>{s.current=f;let l=Nr(e,f,d.current);a(l)},[e]);(0,C.useEffect)(()=>()=>{Nr(e,"",d.current)},[e]),(0,C.useEffect)(()=>{let f=new MutationObserver(()=>{s.current.trim().length!==0&&c(s.current)});return f.observe(e,{childList:!0,subtree:!0}),()=>{f.disconnect()}},[e,c]),(0,C.useEffect)(()=>{let f=l=>{if(s.current.trim().length===0)return;let p=l.key;if(!(p==="ArrowDown"||p==="ArrowUp")&&!(p==="Home"||p==="End"||p==="PageUp"||p==="PageDown")||l.target===i.current||l.target instanceof Node&&!e.contains(l.target))return;let M=ln(e);if(M.length===0)return;let w=M.findIndex(x=>x===document.activeElement),T;p==="Home"||p==="PageUp"?T=0:p==="End"||p==="PageDown"?T=M.length-1:p==="ArrowDown"?T=w===-1?0:(w+1)%M.length:T=w===-1?M.length-1:(w-1+M.length)%M.length,l.preventDefault(),l.stopPropagation(),M[T]?.focus()};return e.addEventListener("keydown",f,!0),()=>{e.removeEventListener("keydown",f,!0)}},[e]);let g=f=>{let l=f.key;if(l==="ArrowDown"){f.preventDefault(),f.stopPropagation(),ln(e)[0]?.focus();return}if(n.trim().length>0&&(l==="ArrowUp"||l==="Home"||l==="PageUp"||l==="End"||l==="PageDown")){let p=ln(e);p.length>0&&(f.preventDefault(),f.stopPropagation(),p[l==="ArrowUp"||l==="End"||l==="PageDown"?p.length-1:0]?.focus());return}l==="Escape"&&n.length>0&&(f.preventDefault(),f.stopPropagation(),r(""),c(""))},u=()=>{r(""),c(""),i.current?.focus({preventScroll:!0})},h=o===0&&n.trim().length>0;return(0,C.createElement)("div",{className:"bre-model-search-box"+(h?" has-empty":""),"data-bre-search":"1"},(0,C.createElement)("div",{className:"bre-search-input-wrapper"},(0,C.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,C.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,C.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,C.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,C.createElement)("input",{ref:i,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:f=>{let l=f.currentTarget.value;r(l),c(l)},onKeyDown:g}),n.length>0?(0,C.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:u},(0,C.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,C.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),h?(0,C.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var yt=require("react"),Dr=require("react-dom"),Pr=require("react-dom/client");function Le(){return document.body}function un(e,t,n){let r=(0,Pr.createRoot)(e);return n?.sync===!0?(0,Dr.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function ze(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var Te=class extends yt.Component{constructor(){super(...arguments);Kn(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,yt.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Cr=()=>{(0,Fr.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Wr(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:a,directory:i}=e,s,d,c,g,u,h,f=()=>{h?.removeAttribute("data-bre-provider"),h=void 0},l=()=>{let x=n();h!==void 0&&h!==x&&f();let R=g?.store.getSnapshot(),H=R?.current;if(x===void 0||H===null||H===void 0){x===h&&f();return}let P=R?.groups.find(O=>O.id===H.provider),j=P===void 0?H.provider:wt(P);if(j.trim()===""){x===h&&f();return}x.dataset.breProvider=j,h=x},p=()=>{let x=i();x!==g&&(u?.(),u=void 0,g=x,x!==void 0&&(u=x.store.subscribe(l))),l()},v=()=>{ze(d),d=void 0},y=x=>{let R=x.querySelector('section[role="group"]'),H=R?.parentElement,P=H!=null&&H.parentElement===x?H:R;if(d===void 0){let j=document.createElement("div");j.dataset.plugin=z,j.dataset.breSearch="1",x.insertBefore(j,P),d=un(j,(0,Ge.createElement)(Te,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,Ge.createElement)(Ir,{menu:x,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==x){x.insertBefore(d.wrapper,P);return}P!==null&&d.wrapper.nextSibling!==P&&x.insertBefore(d.wrapper,P)},M=x=>{if(!a()){ze(s),s=void 0,x.classList.remove("bre-model-menu-host");for(let O of Array.from(x.children))O.getAttribute("role")==="menuitem"&&(O.style.display="");return}let R=i();if(R===void 0)return;if(s===void 0){let O=document.createElement("div");O.dataset.plugin=z,O.dataset.breSlider="1",x.insertBefore(O,x.firstChild),s=un(O,(0,Ge.createElement)(Te,{fallbackText:r("renderFailed"),children:o(()=>(0,Ge.createElement)(Ar,{directory:R,t:r,onLayoutChange:Cr}))}),{sync:!0})}else(s.wrapper.parentElement!==x||x.firstChild!==s.wrapper)&&x.insertBefore(s.wrapper,x.firstChild);x.classList.add("bre-model-menu-host");let H=Array.from(x.children).filter(O=>O.getAttribute("role")==="menuitem"),P=s.wrapper;if(Array.from(x.querySelectorAll('[role="menuitemradio"]')).some(O=>!P.contains(O)))s.wrapper.contains(document.activeElement)&&(x.tabIndex=-1,x.focus({preventScroll:!0})),s.wrapper.style.display="none";else{s.wrapper.style.display="";for(let O of H)O.style.display="none"}};return{reconcile:()=>{p();let x=t();if(x===void 0){ze(s),s=void 0,v(),c=void 0;return}let R=_r(x);R?y(x):v(),M(x),R!==c&&(c=R,(R||a())&&Cr())},dispose:()=>{u?.(),u=void 0,g=void 0,f(),ze(s),s=void 0,v(),c=void 0}}}var A=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Ur(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function cn(e,t){if(!A(e))return[];let n=e[t];return!A(n)||!Array.isArray(n.models)?[]:n.models.filter(A)}function Re(e,t){if(!A(e))return{};let n=e[t];if(!A(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,a=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:a}}var ye=(e,t)=>typeof e[t]=="boolean";function Zi(e,t){if(Array.isArray(e)){for(let n of e)if(A(n)&&n.id===t)return n}}function es(e){if(!A(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...pe(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{...pe(e),reasoning:!0,source:"supported_parameters"};if(ye(e,"supports_reasoning"))return{...pe(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(ye(e,"supportsReasoning"))return{...pe(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(ye(e,"can_reason"))return{...pe(e),reasoning:e.can_reason,source:"can_reason"};if(ye(e,"reasoning"))return{...pe(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{...pe(e),reasoning:!0,source:"reasoning_effort"};let o=A(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let a=o.thinking;if(A(a)&&typeof a.supported=="boolean")return{...pe(e),reasoning:a.supported,source:"capabilities.thinking.supported"};let i=o.effort;if(A(i)&&typeof i.supported=="boolean")return{...pe(e),reasoning:i.supported,source:"capabilities.effort.supported"}}return{...pe(e),reasoning:"unknown",source:null}}function pe(e){let t={},n=i=>{if(!Array.isArray(i))return;let s=i.filter(d=>typeof d=="string");return s.length>0?s.map(d=>d.toLowerCase()):[]},r=A(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let i=A(e.modalities)?e.modalities:void 0;o=n(i?.input)}if(o===void 0){let i=e.capabilities,s=d=>Array.isArray(d)&&d.some(c=>typeof c=="string"&&c.toLowerCase()==="vision");if(s(e.supported_features)||s(i))o=["image"];else if(A(i)){let d=[];for(let c of["image_input","video_input","pdf_input","file_input"]){let g=A(i[c])?i[c]:void 0;if(g===void 0||typeof g.supported!="boolean")continue;let u=c.replace(/_input$/,"");g.supported===!0?d.push(u):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(ye(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:ye(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(ye(e,"supports_images")||ye(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let a=e.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let s=(A(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 g=(A(e.limit)?e.limit:void 0)?.context;typeof g=="number"&&Number.isFinite(g)&&g>0&&(t.contextLength=g)}}}return t}function jr(e,t){let n=Zi(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:es(n)}}function ve(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 vt(e){if(!A(e))return;let t=e.providers;return A(t)?t:void 0}function qr(e,t){for(let n of[e?.user,e?.base]){let r=vt(n)?.[t];if(A(r)&&r.models!==void 0)return r.models}}function pn(e){return vt(e?.user)}function gn(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(a=>a.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(a=>typeof a=="string");return o.length>0?o:void 0}function hn(e,t){let r=e.find(o=>o.id===t)?.compat;if(A(r))return{...r}}function bn(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function xn(e,t){let r=e.find(o=>o.id===t)?.[_e];return typeof r=="string"&&r.length>0?r:void 0}async function ts(e,t){try{let n=await fetch(`${Bn}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?jr(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function wn(e,t=()=>X(e),n,r,o,a){return{async suggest(i,s,d,c){let g=ve((await t()).namespace),u=Re(g,i),h={api:u.api??c?.api,baseURL:u.baseURL??c?.baseURL,displayName:d??u.displayName},f=g[i]===void 0?void 0:await ts(i,s),l=ce(s,h,f);return l.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:l.efforts,...l.compat===void 0?{}:{compat:l.compat},...l.input===void 0?{}:{input:l.input},...l.inputSource===void 0?{}:{inputSource:l.inputSource},...l.contextWindow===void 0?{}:{contextWindow:l.contextWindow},...l.maxTokens===void 0?{}:{maxTokens:l.maxTokens},matched:l.matched,source:l.source,confidence:l.confidence,...l.endpoint===void 0?{}:{endpoint:l.endpoint}}}},commit(i,s,d){if(a?.()===!0){n?.(i,s,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(i,s,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.clearCompatKeys===void 0?{}:{clearCompatKeys:d.clearCompatKeys},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(i,s){o?.(i,s)},stageEfforts(i,s,d,c,g,u){n?.(i,s,d,c,g,u)},async writeEfforts(i,s,d,c,g,u,h){if(r!==void 0)return r(i,s,{efforts:d,...c===void 0?{}:{compat:c},...g===void 0?{}:{input:g},...u===void 0?{}:{clearCompatKeys:u},...h===void 0?{}:{defaultEffort:h}}),{ok:!0,staged:!0};let l=(await Ve(e,i,[{modelId:s,efforts:d,...c===void 0?{}:{compat:c},...g===void 0?{}:{input:g},...u===void 0?{}:{clearCompatKeys:u},...h===void 0?{}:{defaultEffort:h}}],t))[0]??{ok:!1,error:"no-result"};return l.ok?{ok:!0}:l.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:l.error??"conflict"}}}}async function Ve(e,t,n,r=()=>X(e),o){if(n.length===0)return[];let a=!1;for(let i=0;i<3;i++)try{let s=i===0?await r():await X(e,{fresh:!0});if(s.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=qr(s.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(A))return n.map(()=>({ok:!1,error:"invalid-models"}));let g=d.map(f=>f),u=[];for(let f of n){let l=g.findIndex(p=>p.id===f.modelId);if(l<0){u.push(f.modelId);continue}g[l]=ns(g[l],f,a?void 0:f.compat)}if(u.length>0)return n.map(f=>u.includes(f.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let h=await e.settings.mutate(Y,[{op:"set",path:["providers",t,"models"],value:g}],s.namespace.revision);if(!h.ok){if(i===0&&h.error.code==="settings/conflict")continue;let f=h.error.code==="settings/rejected"&&Ur(h.error.message);if(!a&&f&&n.some(l=>l.compat!==void 0)){a=!0;continue}return n.map(()=>({ok:!1,error:h.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 ns(e,t,n){let r={...e},o=t.efforts!=="keep",a=t.efforts==="keep"?void 0:t.efforts;if(o)if(a===void 0)delete r.reasoningEfforts,r[ue]=!0;else if(delete r[ue],delete r[He],a===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...a};let i=A(e.compat)?e.compat:{},s={...i,...n??{}};for(let d of t.clearCompatKeys??[])delete s[d];(Object.keys(i).length>0||Object.keys(s).length>0)&&(Object.keys(s).length===0?delete r.compat:r.compat=s)}return t.input!==void 0&&(t.input===null?(delete r.input,r[xe]=!0):(delete r[xe],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[_e]:r[_e]=t.defaultEffort),r}function yn(e,t){for(let n of[e?.user,e?.base]){let r=vt(n)?.[t];if(!A(r))continue;let o=r.headers;if(o===void 0)continue;if(!A(o))return;let a={};for(let[i,s]of Object.entries(o))typeof s=="string"&&(a[i]=s);return a}}async function vn(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};for(let r=0;r<2;r+=1)try{let o=r===0?await X(e):await X(e,{fresh:!0});if(o.namespace===void 0)return{ok:!1,error:"no-namespace"};if(o.writable!==!0)return{ok:!1,error:"read-only"};if(!rs(o.namespace,t))return{ok:!1,error:"no-route"};let a=await e.settings.mutate(Y,[{op:"set",path:["providers",t,"headers"],value:{...n}}],o.namespace.revision);if(!a.ok){if(r===0&&a.error.code==="settings/conflict")continue;return{ok:!1,error:a.error.message}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}return{ok:!1,error:"conflict"}}function rs(e,t){for(let n of[e?.user,e?.base]){let r=vt(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function X(e,t={}){let n=t.fresh===!0?void 0:os(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(a=>a.ns===Y),writable:r.value.writable}:{namespace:void 0,writable:!1}}function os(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:Y,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}function Kr(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let s=r;return n??(n=X(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let c=new Map;for(let[g,u]of Object.entries(ve(d.namespace))){let h=Array.isArray(u.models)?u.models:[];for(let f of h){if(typeof f!="object"||f===null||Array.isArray(f))continue;let l=f.id,p=f[_e];typeof l=="string"&&typeof p=="string"&&p.length>0&&c.set(`${g}/${l}`,p)}}s===r?t=c:n=void 0}).catch(()=>{s===r&&(n=void 0)})),n};return{of:async(s,d)=>(await o(),t?.get(`${s}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function is(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Br(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,a=n.modalities!==!1;if(!A(e))return;let i={};for(let s of Object.keys(e)){if(!t(s))continue;let d=e[s],c=A(d)&&Array.isArray(d.models)?d.models:void 0;if(c===void 0||c.length===0||!c.every(A))continue;let g=c,u=[],h=!1;for(let f of g){let l=f.reasoningEfforts!==void 0||f[ue]===!0,p=is(f)||f[xe]===!0;if((l||!o)&&(p||!a)){let R=ss(f,e,s);R!==void 0?(h=!0,u.push(R)):u.push(f);continue}let v=typeof f.id=="string"?f.id:"";if(v.length===0){u.push(f);continue}let y=Re(e,s),M=typeof f.name=="string"?f.name:void 0,w=ce(v,{...y,displayName:M??y.displayName});if(w.efforts===void 0){u.push(f);continue}let T={...f},x=!1;if(!l&&o&&(x=!0,T.reasoningEfforts=w.efforts,T[He]=r,w.compat!==void 0)){let R=A(f.compat)?f.compat:{};T.compat={...R,...w.compat}}if(!p&&a&&w.input!==void 0&&(x=!0,T.input=[...w.input]),!x){u.push(f);continue}h=!0,u.push(T)}h&&(i[s]={models:u})}return Object.keys(i).length===0?void 0:{providers:i}}function ss(e,t,n){if(!A(e.reasoningEfforts)||e[ue]===!0)return;let r=e.compat,o=A(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&tn(Re(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function zr(e){let t,n=()=>(t??(t=(async()=>{let o={autofill:!0,modalityAutofill:!0};try{let a=await fetch(zn,{method:"GET"});if(!a.ok)return o;let i=await a.json();return i?.ok!==!0?o:{autofill:i.data?.autofill!==!1,modalityAutofill:i.data?.modalityAutofill!==!1}}catch{return o}})()),t),r=async()=>{try{let o=await n();if(!o.autofill)return;let a=await X(e.api,{fresh:!0}),i=a.namespace;if(i===void 0||a.writable!==!0)return;let s=pn(i);if(s===void 0)return;let d=Br(s,()=>!0,{modalities:o.modalityAutofill},i.revision);if(d===void 0)return;let c=d.providers,g=Object.entries(c).map(([h,f])=>({op:"set",path:["providers",h,"models"],value:f.models})),u=await e.api.settings.mutate(Y,g,i.revision);u.ok||console.error(`[bre] idle autofill refused: ${u.error.message}`)}catch(o){console.error(`[bre] idle autofill failed: ${o instanceof Error?o.message:String(o)}`)}};return{run:()=>{r()}}}var In=require("react"),Fo=require("react-dom/client");var D=require("react");var Oe=vr;function $e(e){let t={};for(let n of Oe){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 kt(e){let t=!1,n=!1,r={};for(let o of Oe){let a=e[o];if(!a.on)continue;if(o==="off"){t=!0;let s=a.wire.trim();r.off=s.length===0?null:s;continue}n=!0;let i=a.wire.trim();r[o]=i.length===0?o:i}return n?r:t?!1:void 0}function Je(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=Oe.filter(o=>e[o]!==void 0),r=Oe.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function Gr(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 b=require("react/jsx-runtime"),Vr=new Intl.NumberFormat("en-US");function Et(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function as(e){return e.declared?e.image?["text","image"]:["text"]:null}var ds={"openai-completions":["thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"],"openai-responses":["supportsMaxOutputTokens"]};function ls(e){return ds[(e??"").toLowerCase()]??[]}function $r(e,t){let n=ls(e);if(n.length===0)return[];let r=new Set(t===void 0?[]:Object.keys(t));return n.filter(o=>!r.has(o))}function fs(e,t){if(t!==void 0)return{clearCompatKeys:$r(e,t)};let n=$r(e,void 0);return n.length===0?{}:{clearCompatKeys:n}}function Jr(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function Mt({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:a,input:i,compat:s,defaultEffort:d,index:c,staged:g=!1,officialInputTypes:u=!1,api:h,readOnly:f,t:l}){let[p,v]=(0,D.useState)(()=>$e(a)),[y,M]=(0,D.useState)(()=>Et(i)),[w,T]=(0,D.useState)(()=>a!==!1),[x,R]=(0,D.useState)(()=>d??""),[H,P]=(0,D.useState)(!1),[j,O]=(0,D.useState)(void 0),[U,F]=(0,D.useState)(void 0),[W,G]=(0,D.useState)(""),[S,N]=(0,D.useState)("low"),_=(0,D.useRef)(void 0),[q,K]=(0,D.useState)(()=>s?.thinkingTokenBudgetField??""),[oe,ie]=(0,D.useState)(()=>s?.vllmPriority===void 0?"":String(s.vllmPriority)),[se,ae]=(0,D.useState)(()=>s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),Ne=(0,D.useRef)(s),[Fe,We]=(0,D.useState)(void 0),[E,J]=(0,D.useState)(void 0),[B,de]=(0,D.useState)(void 0),Q=(0,D.useRef)(!1),ot=(0,D.useRef)(a),Pt=(0,D.useRef)(i),Ue=(0,D.useRef)(d);(0,D.useEffect)(()=>{Je(ot.current,a)||(ot.current=a,Q.current||(v($e(a)),T(a!==!1))),Pt.current!==i&&(Pt.current=i,Q.current||M(Et(i))),Ue.current!==d&&(Ue.current=d,Q.current||R(d??"")),JSON.stringify(Ne.current??null)!==JSON.stringify(s??null)&&(Ne.current=s,Q.current||(K(s?.thinkingTokenBudgetField??""),ie(s?.vllmPriority===void 0?"":String(s.vllmPriority)),ae(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens))))},[a,i,s,d]);let it=()=>{let m={};q!==""&&(m.thinkingTokenBudgetField=q);let I=oe.trim();return I!==""&&/^-?\d+$/.test(I)&&(m.vllmPriority=Number.parseInt(I,10)),se==="true"?m.supportsMaxOutputTokens=!0:se==="false"&&(m.supportsMaxOutputTokens=!1),Object.keys(m).length===0?void 0:m},Xo=()=>{let m=it();return JSON.stringify(m??null)!==JSON.stringify({...s?.thinkingTokenBudgetField===void 0?{}:{thinkingTokenBudgetField:s.thinkingTokenBudgetField},...s?.vllmPriority===void 0?{}:{vllmPriority:s.vllmPriority},...s?.supportsMaxOutputTokens===void 0?{}:{supportsMaxOutputTokens:s.supportsMaxOutputTokens}})},st=Oe.filter(m=>p[m].on),Yo=x===(d??"")?void 0:x===""?null:x,Qo=w?kt(p):!1,Ct=!Je(Qo,a)||!Jr(y,i)||Xo()||Yo!==void 0,Ft=(0,D.useRef)(void 0),le=()=>{Q.current=!0,F(void 0),G(""),N("low"),We(void 0)},fe=(m,I,V,te=w)=>{let be=te?kt(m):!1,Wn=te&&be===void 0&&a===void 0?"keep":be,Wt=Jr(I,i)?void 0:as(I),Un=it(),jn=_.current,Ee=jn!==void 0?{...jn,...Un??{}}:Un;s?.supportsThinkingTokenBudget===!0&&s?.thinkingTokenBudgetField===void 0&&Ee?.thinkingTokenBudgetField===void 0&&(t??"").toLowerCase()==="openai-completions"&&(Ee={...Ee??{},thinkingTokenBudgetField:"thinking_token_budget"});let Ut=V===(d??"")?void 0:V===""?null:V,qn=JSON.stringify([Wn,Wt,Ee??null,Ut??null]);Ft.current!==qn&&(Ft.current=qn,h.commit(e,r,{efforts:Wn,...Ee===void 0?{}:{compat:Ee},...Wt===void 0?{}:{input:Wt},...fs(t,Ee),...Ut===void 0?{}:{defaultEffort:Ut}}))},Zo=(m,I)=>{le();let V=!I&&x===m?"":x;V!==x&&R(V),v(te=>{let be={...te,[m]:{...te[m],on:I}};return I&&m!=="off"&&be[m].wire.trim().length===0&&(be[m]={...be[m],wire:m}),fe(be,y,V),be}),O(void 0)},ei=m=>{le(),T(m);let I=m?x:"";I!==x&&R(I),fe(p,y,I,m),O(void 0)},ti=(m,I)=>{le(),v(V=>{let te={...V,[m]:{...V[m],wire:I}};return fe(te,y,x),te}),O(void 0)},ni=m=>{le();let I={declared:!0,image:m};M(I),fe(p,I,x),O(void 0)},ri=()=>{le();let m={declared:!1,image:!1};M(m),fe(p,m,x),O(void 0)},oi=m=>{le(),K(m),fe(p,y,x),O(void 0)},ii=m=>{le(),ie(m),fe(p,y,x),O(void 0)},si=m=>{le(),ae(m),fe(p,y,x),O(void 0)},Cn=m=>{le(),R(m),fe(p,y,m),O(void 0)},ai=m=>{le();let I=m.efforts!==!1;T(I);let V=$e(m.efforts);v(V);let te=m.input===void 0?y:Et(m.input);m.input!==void 0&&M(te),F(m.efforts),G(m.source),N(m.confidence),_.current=m.compat,We(m.inputSource),J(m.contextWindow),de(m.maxTokens),O({kind:"info",text:l("appliedHint",{source:m.source,confidence:l("confidence_"+m.confidence)})}),fe(V,te,x,I)},di=async()=>{P(!0),O(void 0);try{let m=g?await h.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await h.suggest(e,r,o);if(!m.ok){O({kind:"error",text:m.error==="no-suggestion"?l("noSuggestion"):m.error});return}ai(m.suggestion)}catch(m){O({kind:"error",text:l("writeError",{message:String(m)})})}finally{P(!1)}},li=()=>{Q.current=!1,h.withdraw(e,r),v($e(a)),T(a!==!1),M(Et(i)),R(d??""),K(s?.thinkingTokenBudgetField??""),ie(s?.vllmPriority===void 0?"":String(s.vllmPriority)),ae(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),F(void 0),G(""),N("low"),_.current=void 0,We(void 0),J(void 0),de(void 0),O(void 0),Ft.current=void 0},fi=_.current?.thinkingFormat??ce(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,Fn=Gr(a,fi),Z=f||H;return(0,b.jsxs)("div",{className:"bre-effort-editor","data-plugin":z,children:[(0,b.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,b.jsx)("input",{type:"checkbox",checked:w,disabled:Z,"aria-label":l("thinkingMode")+" "+String(c+1),onChange:m=>{ei(m.target.checked)}}),(0,b.jsx)("span",{className:"bre-effort-level",children:l("thinkingMode")}),w?null:(0,b.jsx)("span",{className:"bre-effort-note",children:l("thinkingModeOff")})]}),w?(0,b.jsxs)("div",{className:"bre-effort-card",children:[(0,b.jsxs)("div",{className:"bre-effort-head",children:[(0,b.jsx)("span",{className:"bre-effort-title",children:l("reasoningEffort")}),(0,b.jsx)("button",{type:"button",className:"bre-link-button",disabled:Z,onClick:()=>{di()},children:l("autoAdapt")})]}),(0,b.jsx)("div",{className:"bre-effort-grid",children:Oe.map(m=>{let I=p[m];return(0,b.jsxs)("label",{className:"bre-effort-row",children:[(0,b.jsx)("input",{type:"checkbox",checked:I.on,disabled:Z,"aria-label":l("level_"+m)+" "+String(c+1),onChange:V=>{Zo(m,V.target.checked)}}),(0,b.jsx)("span",{className:"bre-effort-level",children:l("level_"+m)}),I.on?(0,b.jsx)("input",{type:"text",className:"bre-effort-wire",value:I.wire,disabled:Z,placeholder:l("wirePlaceholder"),"aria-label":l("level_"+m)+" "+l("wireValue"),onChange:V=>{ti(m,V.target.value)}}):(0,b.jsx)("span",{className:"bre-effort-empty"})]},m)})}),st.length>0?(0,b.jsxs)("div",{className:"bre-modality",children:[(0,b.jsx)("span",{className:"bre-effort-title",children:l("defaultEffortLabel")}),(0,b.jsxs)("label",{className:"bre-modality-row",children:[(0,b.jsxs)("select",{className:"bre-select",disabled:Z,"aria-label":l("defaultEffortLabel")+" "+String(c+1),value:x,onChange:m=>{Cn(m.target.value)},children:[(0,b.jsx)("option",{value:"",children:l("defaultEffortUnset")}),(x!==""&&!st.includes(x)?[...st,x]:st).map(m=>(0,b.jsx)("option",{value:m,children:l("level_"+m)},m))]}),x!==""?(0,b.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Z,onClick:()=>{Cn("")},children:l("clearDefaultEffort")}):null]}),(0,b.jsx)("p",{className:"bre-modality-note",children:l("defaultEffortHint")})]}):null,u?null:(0,b.jsxs)("div",{className:"bre-modality",children:[(0,b.jsx)("span",{className:"bre-effort-title",children:l("inputModality")}),(0,b.jsxs)("label",{className:"bre-modality-row",children:[(0,b.jsx)("input",{type:"checkbox",checked:y.declared&&y.image,disabled:Z,"aria-label":l("modalityImage")+" "+String(c+1),onChange:m=>{ni(m.target.checked)}}),(0,b.jsx)("span",{className:"bre-effort-level",children:l("modalityImage")}),y.declared?(0,b.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:Z,onClick:ri,children:l("clearDeclaration")}):null]}),y.declared?null:(0,b.jsx)("p",{className:"bre-modality-note",children:l("modalityInherit")})]}),(t??"").toLowerCase()==="openai-completions"?(0,b.jsxs)("div",{className:"bre-compat",children:[(0,b.jsx)("span",{className:"bre-effort-title",children:l("compatTitle")}),(0,b.jsxs)("label",{className:"bre-compat-row",children:[(0,b.jsx)("span",{className:"bre-compat-label",children:l("budgetFieldLabel")}),(0,b.jsxs)("select",{className:"bre-select",disabled:Z,"aria-label":l("budgetFieldLabel")+" "+String(c+1),value:q,onChange:m=>{oi(m.target.value)},children:[(0,b.jsx)("option",{value:"",children:l("budgetUnset")}),(0,b.jsx)("option",{value:"thinking_token_budget",children:"thinking_token_budget"}),(0,b.jsx)("option",{value:"thinking_budget",children:"thinking_budget"}),(0,b.jsx)("option",{value:"thinking_budget_tokens",children:"thinking_budget_tokens"})]}),(0,b.jsx)("span",{className:"bre-compat-hint",children:l("budgetFieldHint")})]}),(0,b.jsxs)("div",{className:"bre-compat-row",children:[(0,b.jsxs)("label",{className:"bre-compat-field",children:[(0,b.jsx)("span",{className:"bre-compat-label",children:l("priorityLabel")}),(0,b.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-text-input",value:oe,disabled:Z,placeholder:l("priorityPlaceholder"),"aria-label":l("priorityLabel")+" "+String(c+1),onChange:m=>{ii(m.target.value)}})]}),(0,b.jsx)("span",{className:"bre-compat-hint",children:l("priorityHint")}),oe.trim()!==""&&!/^-?\d+$/.test(oe.trim())?(0,b.jsx)("p",{className:"bre-effort-note bre-error",children:l("priorityInvalid")}):null]}),s?.supportsThinkingTokenBudget===!0&&s?.thinkingTokenBudgetField===void 0?(0,b.jsx)("p",{className:"bre-effort-note",children:l("aliasMigrated")}):null]}):null,(t??"").toLowerCase()==="openai-responses"?(0,b.jsxs)("div",{className:"bre-compat",children:[(0,b.jsx)("span",{className:"bre-effort-title",children:l("compatTitle")}),(0,b.jsxs)("label",{className:"bre-compat-row",children:[(0,b.jsx)("span",{className:"bre-compat-label",children:l("maxOutputLabel")}),(0,b.jsxs)("select",{className:"bre-select",disabled:Z,"aria-label":l("maxOutputLabel")+" "+String(c+1),value:se,onChange:m=>{si(m.target.value)},children:[(0,b.jsx)("option",{value:"",children:l("maxOutputUnset")}),(0,b.jsx)("option",{value:"true",children:l("maxOutputOn")}),(0,b.jsx)("option",{value:"false",children:l("maxOutputOff")})]}),(0,b.jsx)("span",{className:"bre-compat-hint",children:l("maxOutputHint")})]})]}):null,g?(0,b.jsx)("p",{className:"bre-effort-note",children:l("stagedHint")}):null,a===!1?(0,b.jsx)("p",{className:"bre-effort-note",children:l("reasoningDisabled")}):null,Fn===void 0?null:(0,b.jsx)("p",{className:"bre-effort-note",children:l(Fn==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),kt(p)===void 0&&a!==void 0?(0,b.jsx)("p",{className:"bre-effort-note",children:l("bareHint")}):null,U!==void 0?(0,b.jsxs)("div",{className:"bre-suggestion",children:[(0,b.jsx)("p",{className:"bre-effort-note",children:l("appliedHint",{source:W,confidence:l("confidence_"+S)})}),Fe===void 0?null:(0,b.jsx)("p",{className:"bre-effort-note",children:l(Fe==="endpoint"?"inputHintEndpoint":Fe==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),E===void 0&&B===void 0?null:(0,b.jsxs)("div",{className:"bre-reference",children:[(0,b.jsx)("span",{className:"bre-reference-title",children:l("referenceTitle")}),(0,b.jsxs)("span",{className:"bre-reference-values",children:[E===void 0?null:(0,b.jsxs)("span",{children:[l("contextWindowLabel")," ",(0,b.jsx)("b",{children:Vr.format(E)})]}),B===void 0?null:(0,b.jsxs)("span",{children:[l("maxTokensLabel")," ",(0,b.jsx)("b",{children:Vr.format(B)})]})]})]})]}):null,j===void 0?null:(0,b.jsx)("p",{className:"bre-effort-message bre-"+j.kind,role:j.kind==="error"?"alert":"status",children:j.text}),Ct?(0,b.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:l("pendingSave")}):null,Ct?(0,b.jsx)("p",{className:"bre-effort-note",children:l("pendingHint")}):null,(0,b.jsx)("div",{className:"bre-effort-actions",children:(0,b.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:Z||!Ct,onClick:li,children:l("reset")})})]}):null]})}function Ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var kn="__breLedgerDocument";function Zr(){let e=globalThis;return e[kn]??(e[kn]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var St="bre:held-writes:v1";function En(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function ge(e){let t=En();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(St);return}let n={document:Zr(),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(St,JSON.stringify(n))}catch{}}function Xr(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,a]=r;if(typeof o!="string"||!Array.isArray(a))return;let i=[];for(let s of a){if(!Array.isArray(s)||s.length!==2)return;let[d,c]=s;if(typeof d!="string"||!A(c)||t!==void 0&&!t(c))return;i.push([d,c])}n.push([o,i])}return n}function us(e){let t=En();if(t!==void 0)try{let n=t.getItem(St);if(n===null)return;let r=JSON.parse(n);if(r.document!==Zr())return;let o=Xr(r.pending),a=Xr(r.queued,ks);if(o===void 0||a===void 0)return;let i=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 a)i.includes(s)&&(e.queued.set(s,new Map(d)),e.committing.add(s))}catch{}}function eo(e,t){(async()=>{try{await Mn(t,e),await Sn(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function to(e,t){(async()=>{try{await Mn(t,e,!0),await Sn(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{En()?.removeItem(St)}catch{}}})()}function no(){let e={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,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet};return us(e),e}async function cs(e,t){if(!t.flushing){t.flushing=!0;try{let n=await Mn(e,t),r=await Sn(e,t);n||r?Yr(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Yr(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 Yr(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function ps(e){return e.queued.size>0||e.pending.size>0}function Tt(e,t,n,r,o,a,i){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},...a===void 0?{}:{input:a},...i===void 0?{}:{defaultEffort:i}}))}finally{ge(e)}}function gs(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),ge(e)}function ms(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),ge(e))}function hs(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),ge(e))}function bs(e,t,n){ms(e,t,n),hs(e,t,n)}function xs(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),ge(e)}function ws(e,t,n){if(t===void 0)return null;let a=t[ue]!==!0&&t.reasoningEfforts!==void 0&&typeof t[He]=="number"||t[ue]!==!0&&n?.efforts!==void 0&&ys(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[ue]===!0||e.efforts==="keep",s=t[xe]!==!0&&n?.input!==void 0&&vs(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[xe]===!0,d=a?"keep":e.efforts,c=s?void 0:e.input,g=e.defaultEffort;return d==="keep"&&c===void 0&&g===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...c===void 0?{}:{input:c},...g===void 0?{}:{defaultEffort:g}}}function ys(e,t){if(e===t)return!0;if(!A(e)||!A(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 vs(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 ks(e){if(!A(e))return!1;let t=e.efforts;if(t!==!1&&t!=="keep"&&!A(t))return!1;let n=e.clearCompatKeys;return n===void 0||Array.isArray(n)&&n.every(r=>typeof r=="string")}async function Es(e,t,n,r,o=!1){let a=await e.describeNamespace(),i=ve(a.namespace),s=[];for(let[u,h]of[...r]){let f=cn(i,n).find(M=>M.id===u);if(f===void 0||t.pending.get(n)?.get(u)!==h)continue;let l=Re(i,n),p=typeof f.name=="string"?f.name:void 0,v=ce(u,p===void 0?l:{...l,displayName:p}),y=ws(h,f,{...v.efforts===void 0?{}:{efforts:v.efforts},...v.input===void 0?{}:{input:v.input}});if(y===null){Tt(t,n,u,void 0);continue}s.push({modelId:u,efforts:y.efforts,...y.compat===void 0?{}:{compat:y.compat},...y.input===void 0?{}:{input:y.input},...y.defaultEffort===void 0?{}:{defaultEffort:y.defaultEffort}})}if(s.length===0)return!1;let d=!1,c=await Ve(e.api,n,s,()=>d?e.describeNamespace():(d=!0,Promise.resolve(a)),o?void 0:io),g=!1;return s.forEach((u,h)=>{let f=c[h];if(f?.aborted!==!0){if(f?.ok===!0||f?.modelNotFound===!0){Tt(t,n,u.modelId,void 0);return}g=!0,console.error(`[bre] staged flush write failed for "${n}"/"${u.modelId}": ${f?.error??"unknown"}`)}}),g}async function Mn(e,t,n=!1){for(let i of[...t.committing])t.queued.has(i)||t.committing.delete(i);if(![...t.queued.keys()].some(i=>t.committing.has(i)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return ge(t),!1;let a=!1;for(let[i,s]of[...t.queued]){if(!t.committing.has(i)&&!t.signalsUnavailable)continue;let c=[...s].map(([h,f])=>({modelId:h,efforts:f.efforts,...f.compat===void 0?{}:{compat:f.compat},...f.input===void 0?{}:{input:f.input},...f.clearCompatKeys===void 0?{}:{clearCompatKeys:f.clearCompatKeys},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort}})),g=await Ve(e.api,i,c,void 0,n?void 0:io),u=!1;c.forEach((h,f)=>{let l=g[f];if(l?.aborted===!0){u=!0;return}if(l?.ok===!0||l?.modelNotFound===!0){s.delete(h.modelId);return}console.error(`[bre] held write failed for "${i}"/"${h.modelId}": ${l?.error??"unknown"}`)}),s.size===0?(t.queued.delete(i),t.committing.delete(i)):u||(a=!0)}return ge(t),a}async function Sn(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ve(r.namespace),a=!1;for(let[i,s]of[...t.pending]){if(s.size===0){t.pending.delete(i);continue}Ye(o,i)&&await Es(e,t,i,s,n)&&(a=!0)}return ge(t),a}function ke(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 ro(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Ms(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=ro(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(a=>a.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function Ss(e){return e.querySelector('[class*="modelInputTypes"]')!==null}function Ts(e){return e.querySelector(`[data-plugin="${z}"]`)!==null}function Ls(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&&Je(e.efforts,t.efforts)&&Os(e.input,t.input)&&Rs(e.compat,t.compat)}function Rs(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 Os(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 As(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 Xe(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&Ye(t,r))return{route:r,staged:!1};if(As(e,n.routeId)){let i=ke(e,n.routeId);return i.length>0&&!Ye(t,i)?{route:i,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let a=Object.entries(t).find(([,i])=>i.displayName===o);if(a!==void 0)return{route:a[0],staged:!1};if(Ye(t,o))return{route:o,staged:!1}}function Ns(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=(u,h)=>(u.textContent??"").trim()===h,a=n.querySelector('[class*="primaryButton"]'),i=n.querySelector('[class*="secondaryButton"]');if(a!==null&&i!==null)return{submit:a,cancel:i};let s=[...r].reverse().find(u=>t.apply.some(h=>o(u,h))),d=[...r].reverse().find(u=>t.cancel.some(h=>o(u,h)));if(s!==void 0&&d!==void 0)return{submit:s,cancel:d};let c=r[r.length-1],g=r[r.length-2];if(!(c===void 0||g===void 0))return{submit:c,cancel:g}}function Qr(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}function oo(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function io(){return oo(Le())!==void 0}function so(e,t,n){if(!e.isConnected)return;let r=t.labels(),o=oo(e)!==void 0,a=Array.from(e.querySelectorAll("button[aria-label]")).some(s=>r.capacity.some(d=>(s.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(n.mounted.size>0){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear()}let s=n.editing;n.editing=!1,(s!==!1||ps(n)&&Date.now()>=n.nextFlushAt)&&cs(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!a)return;n.describePromise??(n.describePromise=t.describeNamespace());let i=s=>{if(!e.isConnected)return;let d=s.namespace,c=ve(d),g=[];for(let u of r.capacity){let h=Array.from(e.querySelectorAll("button[aria-label]")).filter(f=>(f.getAttribute("aria-label")??"").startsWith(u));for(let f of h){let l=Ms(f);if(l===void 0)continue;let p=ro(f);if(p===void 0)continue;let v=f.closest('[class*="modelEntry"]')??p,y=ke(v,r.modelId);y.length!==0&&g.push({container:l,row:v,modelId:y,card:p})}}for(let[u,h]of n.mounted)g.some(f=>f.container===u)||(h.editor.unmount(),n.mounted.delete(u));if(n.pending.size>0){let u=new Map;for(let f of g){let l=Xe(f.card,c,r);if(l===void 0)continue;let p=u.get(l.route);p===void 0&&u.set(l.route,p=new Set),p.add(f.modelId)}let h=new Map;for(let[f,l]of n.pending){if(!Ye(c,f))continue;let p=u.get(f),v=[...l.keys()].filter(y=>!p?.has(y));v.length>0&&h.set(f,new Set(v))}for(let[f,l]of h){let p=n.missedScans.get(f);if(p!==void 0)for(let v of l)p.has(v)&&(Tt(n,f,v,void 0),p.delete(v))}n.missedScans=h}g.forEach((u,h)=>{let f=Xe(u.card,c,r);if(f===void 0)return;let{route:l,staged:p}=f,v=c[l]??{},y=cn(c,l),M=new Set(y.map(K=>K.id)),w=p||!M.has(u.modelId),T=w?n.pending.get(l)?.get(u.modelId)?.efforts:void 0,x=w?T==="keep"?void 0:T:gn(y,u.modelId),R=w?n.pending.get(l)?.get(u.modelId)?.input:mn(y,u.modelId),H=w?n.pending.get(l)?.get(u.modelId)?.compat:hn(y,u.modelId),P=w?n.pending.get(l)?.get(u.modelId)?.defaultEffort??void 0:xn(y,u.modelId),j=w?ke(u.row,r.modelName):"",O=w?j.length>0?j:void 0:bn(y,u.modelId),U=p?ke(u.card,r.apiProtocol):"",F=p?ke(u.card,r.baseUrl):"",W=Ns(u.card,r);W===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Qr(W.submit,n.submitWired,()=>{let K=Xe(u.card,c,r)?.route??l;n.committing.add(K),ge(n)}),Qr(W.cancel,n.cancelWired,()=>{let K=Xe(u.card,c,r)?.route??l;xs(n,K)}));let G=p&&U.length>0?U:typeof v.api=="string"?v.api:void 0,S=p&&F.length>0?F:typeof v.baseURL=="string"?v.baseURL:void 0,N={route:l,routeDisplayName:p?l:typeof v.displayName=="string"?v.displayName:l,...G===void 0?{}:{routeApi:G},...S===void 0?{}:{routeBaseURL:S},modelId:u.modelId,...O===void 0?{}:{modelName:O},...x===void 0?{}:{efforts:x},...R===void 0?{}:{input:R},...H===void 0?{}:{compat:H},...P===void 0?{}:{defaultEffort:P},index:h,staged:w,officialInputTypes:Ss(u.container),api:wn(t.api,void 0,(K,oe,ie,se,ae,Ne)=>{Tt(n,K,oe,ie,se,ae,Ne)},(K,oe,ie)=>{gs(n,K,oe,ie)},K=>{bs(n,K,u.modelId)},()=>(Xe(u.card,c,r)?.staged??p)||!M.has(u.modelId)),readOnly:s.writable!==!0,t:t.t},_=n.mounted.get(u.container);if(_!==void 0){Ls(_.props,N)||(_.props=N,_.editor.render(N));return}if(Ts(u.container))return;let q=t.mount(u.container,N);n.mounted.set(u.container,{editor:q,props:N})})};n.describePromise.then(i,()=>{n.describePromise=void 0})}var Qe="data-bre-drag-handle",Tn="data-bre-row-head",Ln="data-bre-drop-side",Lt="bre-row-dragging",Rt="bre-row-drop-target",po="bre-drag-ghost",go="bre-drop-line",ao="http://www.w3.org/2000/svg",lo=8,fo=28,uo=12,Hs="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",_s='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function Ot(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,drag:void 0}}function re(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function Is(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function Ae(e){return re(e).map((t,n)=>({row:t,key:Is(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function Ze(e,t){let n=Ae(e),r=n.filter(s=>t.includes(s)),o=r.map(s=>n.indexOf(s)),a=t.filter(s=>r.includes(s)),i=new Map;n.forEach((s,d)=>i.set(s,d)),o.forEach((s,d)=>{let c=a[d];c!==void 0&&i.set(c,s)});for(let[s,d]of i){let c=String(d);s.style.order!==c&&(s.style.order=c)}}function Rn(e,t){let n=re(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,a)=>{let i=r[a]-o.offsetTop;i!==0&&(o.style.transition="none",o.style.transform=`translateY(${i}px)`,o.offsetHeight,o.style.transition=Hs,o.style.transform="")})}function et(e,t){return Ae(e).map(n=>t(n)).filter(n=>n!==void 0)}function mo(e,t,n){let r=new Map;for(let[i,s]of t.entries())r.has(s)||r.set(s,i);let a=[...Ae(e).filter(i=>n(i)!==void 0)].sort((i,s)=>{let d=r.get(n(i))??Number.MAX_SAFE_INTEGER,c=r.get(n(s))??Number.MAX_SAFE_INTEGER;return d-c});Ze(e,a)}function At(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function ho(e,t,n,r){let a=e.filter(i=>i!==t).indexOf(n);return a<0?Math.max(0,e.indexOf(t)):r?a+1:a}function bo(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let a=o.getBoundingClientRect(),i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=o)}return n}function Ds(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function xo(e,t){let n=e.getBoundingClientRect();return t?n.bottom+lo/2-1:n.top-lo/2-1}function wo(){let e=document.createElementNS(ao,"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(ao,"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 yo(e,t){let n=document.createElement("div");n.className=po,n.setAttribute("aria-hidden","true"),n.appendChild(wo());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 Ps(e){return!(e instanceof Element)||e.closest(`[${Qe}]`)!==null?!1:e.closest(_s)!==null}function vo(e){return e.parentElement??void 0}function ko(e){for(let t of re(e))t.classList.remove(Rt),t.removeAttribute(Ln)}function Eo(e){let t=e.parentElement;for(;t!==null;){if(Cs(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function Cs(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 Mo(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+fo?-uo:t>n.bottom-fo?uo:0}function So(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 Fs(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=go,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function Ws(e,t,n){let r=Fs(e),o=t.getBoundingClientRect();r.style.top=`${xo(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(Ln,n?"after":"before")}function Us(e){e.line!==void 0&&(e.line.style.display="none")}function js(e){let t=e.drag;e.drag=void 0,t!==void 0&&(So(e,t,0),Us(e),t.row.classList.remove(Lt),ko(t.list),t.dropped||Rn(t.list,()=>{Ze(t.list,t.before)}))}function qs(e,t,n,r){if(Ps(t.target)){t.preventDefault();return}let o=vo(e),a=n.idOf(e);if(o===void 0||a===void 0){t.preventDefault();return}let i={row:e,list:o,before:Ae(o),scroller:Eo(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=i,e.classList.add(Lt);let s=yo(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",a),d.setDragImage(s,Math.round(s.offsetWidth/2),Math.round(s.offsetHeight/2))}catch{}window.setTimeout(()=>{s.remove()},0)}function Ks(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,a=o instanceof Element?r.adapter.rowOf(o,e):void 0,i=Ae(e),s=a!==void 0&&i.includes(a)?a:bo(i,t.clientY);if(s===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let c=Ds(s,t.clientY),g=ho(i,r.row,s,c);g!==i.indexOf(r.row)&&Rn(e,()=>{Ze(e,Vt(i,r.row,g))}),ko(e),s.classList.add(Rt),s.setAttribute(Ln,c?"after":"before"),Ws(n,s,c),So(n,r,r.scroller===void 0?0:Mo(r.scroller,t.clientY))}function Bs(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{Ks(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 zs(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(Tn,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{qs(t,o,n,r)}),e.addEventListener("dragend",()=>{js(r)}))}function Gs(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 a=vo(t);if(a===void 0)return;let i=Ae(a),s=i.indexOf(t);if(s<0)return;let d=s+(o.key==="ArrowUp"?-1:1);d<0||d>=i.length||(o.preventDefault(),Rn(a,()=>{Ze(a,Vt(i,t,d))}),n.commit(a),e.focus())})}function co(e,t,n,r){let o=r.gripLabel(t,n),a=r.gripHint();e.getAttribute(Qe)!==n&&e.setAttribute(Qe,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function Vs(e,t,n,r,o){let a=t.querySelector(`[${Qe}]`);if(a!==null){co(a,e,n,r);return}r.decorate?.(e,t);let i=document.createElement("span");i.className="bre-drag-grip",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("draggable","true"),i.appendChild(wo()),co(i,e,n,r),Gs(i,e,r,o),zs(r.seatDrags?t:i,e,r,o),t.insertBefore(i,t.firstChild)}function Nt(e,t,n,r){if(e.isConnected){Bs(t,r);for(let o of re(t)){let a=n.idOf(o);if(a===void 0)continue;let i=n.seatOf(o);i!==void 0&&Vs(o,i,a,n,r)}r.drag===void 0&&mo(t,n.order(et(t,n.idOf)),n.idOf)}}function Ht(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${Qe}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${Tn}]`)))t.removeAttribute(Tn),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${Lt}, .${Rt}`)))t.classList.remove(Lt,Rt);for(let t of Array.from(document.querySelectorAll(`.${go}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${po}`)))t.remove();e.line=void 0}var tt="data-bre-row-provider",To="{provider}",$s=["rowCard","setupCard"];function Lo(){return Ot()}function On(e){for(let t of $s)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&re(r).length!==0)return r}}function An(e){return e.querySelector('[class*="rowHead"]')??void 0}function _t(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Js(e){let t=e.indexOf(To);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+To.length)}}function Xs(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}function Ys(e){return e.closest('[data-plugin], [class*="bre-"]')!==null}function nt(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=Js(r);if(o!==void 0)for(let a of Array.from(e.querySelectorAll("button[aria-label]"))){if(Ys(a))continue;let i=a.getAttribute("aria-label")??"";if(i.length<=o.prefix.length+o.suffix.length||!i.startsWith(o.prefix)||!i.endsWith(o.suffix))continue;let s=Xs(i.slice(o.prefix.length,i.length-o.suffix.length));if(s!==void 0)return s}}}function Nn(e){let t=e.getAttribute(tt);return t===null||t.length===0?void 0:t}function Qs(e){return et(e,Nn)}function Ro(e,t,n){if(!e.isConnected)return;let r=On(e);if(r===void 0)return;let o=t.labels();for(let a of re(r)){let i=nt(a,o);if(i===void 0){a.removeAttribute(tt);continue}Nn(a)!==i&&a.setAttribute(tt,i)}Nt(e,r,Zs(t),n)}function Zs(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:Nn,labelOf:_t,order:t=>or(t),commit:t=>{nr(Qs(t))},seatOf:An,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:_t(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function Oo(e){Ht(e);let t=Array.from(document.querySelectorAll(`[${tt}]`));At(t);for(let n of t)n.removeAttribute(tt)}var Ce="data-bre-provider-switch",It="bre-row-disabled";function No(){return{switches:new WeakSet}}function Ho(e,t,n){if(!e.isConnected)return;let r=On(e);if(r===void 0)return;let o=t.labels();for(let a of Array.from(r.children)){if(!(a instanceof HTMLElement))continue;let i=nt(a,o);if(i===void 0)continue;let s=An(a);s!==void 0&&(ea(a,s,i,t,n),a.classList.toggle(It,!pt(i)))}}function _o(){for(let e of Array.from(document.querySelectorAll(`[${Ce}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${It}`)))e.classList.remove(It)}function ea(e,t,n,r,o){let a=t.querySelector(`[${Ce}]`);if(a!==null){Ao(a,e,n,r);return}let i=document.createElement("button");i.className="bre-provider-switch",i.setAttribute("type","button"),i.setAttribute("role","switch"),i.setAttribute(Ce,n),Ao(i,e,n,r),ta(i,e,o);let s=t.querySelector('[class*="rowActions"]');s===null?t.appendChild(i):s.insertBefore(i,s.firstChild)}function Ao(e,t,n,r){let o=r.t("providerToggleAria",{provider:_t(t)??n}),a=r.t("providerToggleHint"),i=pt(n)?"true":"false";e.getAttribute(Ce)!==n&&e.setAttribute(Ce,n),e.getAttribute("aria-checked")!==i&&e.setAttribute("aria-checked",i),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function ta(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(Ce);if(o===null)return;let a=!pt(o);ar(o,a),e.setAttribute("aria-checked",a?"true":"false"),t.classList.toggle(It,!a)}))}var rt="data-bre-row-model",Hn="bre-model-grid";function Do(){return Ot()}function na(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))re(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function Dt(e){let t=e.getAttribute(rt);return t===null||t.length===0?void 0:t}function _n(e,t){let n=e.closest("li");if(n!==null)return nt(n,t.labels())}function Io(e,t){let n=ke(e,t.labels().modelName);return n.length>0?n:Dt(e)}function ra(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:Dt,labelOf:n=>Io(n,t),order:n=>{let r=_n(e,t);return r===void 0?n:mr(r,n)},commit:n=>{let r=_n(n,t);r!==void 0&&pr(r,et(n,Dt))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:Io(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(Hn)}}}function Po(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of na(e))if(_n(o,t)!==void 0){for(let a of re(o)){let i=ke(a,r.modelId);if(i.length===0){a.removeAttribute(rt);continue}Dt(a)!==i&&a.setAttribute(rt,i)}Nt(e,o,ra(o,t),n)}}function Co(e){Ht(e);for(let n of Array.from(document.querySelectorAll(`.${Hn}`)))n.classList.remove(Hn);let t=Array.from(document.querySelectorAll(`[${rt}]`));At(t);for(let n of t)n.removeAttribute(rt)}var oa="settings.models",me={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}"]};function Wo(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:a}=e,i=()=>{let U=t.locale.bind(oa),F=([W,...G])=>{let S=U(W);return S===W||S.trim()===""?G:[S,...G]};return{capacity:F(me.capacity),modelId:F(me.modelId),modelName:F(me.modelName),routeId:F(me.routeId),baseUrl:F(me.baseUrl),apiProtocol:F(me.apiProtocol),apply:F(me.apply),cancel:F(me.cancel),editProvider:F(me.editProvider)}},s=120,d=no(),c=Lo(),g={t:r,labels:i},u=No(),h={t:r,labels:i},f=Do(),l={t:r,labels:i},p,v,y,M,w=!1,T={api:n,describeNamespace:()=>X(n),t:r,labels:i,onIdle:o,onBackoff:U=>{x(U)},mount(U,F){let W=document.createElement("div");W.className="bre-effort-slot",W.dataset.plugin=z,U.appendChild(W);let G=(0,Fo.createRoot)(W),S=N=>{G.render((0,In.createElement)(Te,{fallbackText:r("renderFailed"),children:a(()=>(0,In.createElement)(Mt,N))}))};return S(F),{unmount:()=>{G.unmount()},render:S}}};function x(U){w||v!==void 0||(v=window.setTimeout(()=>{v=void 0,R()},U))}function R(){w||p!==void 0||(p=window.setTimeout(()=>{p=void 0,M?.(),so(Le(),T,d),Ro(Le(),g,c),Ho(Le(),h,u),Po(Le(),l,f)},s))}let H=U=>{w||y!==void 0||(M=U,U(),y=new MutationObserver(()=>{U(),R()}),y.observe(document.body,{childList:!0,subtree:!0}),R())},P=()=>{w=!0,p!==void 0&&(window.clearTimeout(p),p=void 0),v!==void 0&&(window.clearTimeout(v),v=void 0),y?.disconnect(),y=void 0};return{state:d,labels:i,start:H,stopObserver:P,teardown:()=>{P(),eo(d,T);for(let[,U]of d.mounted)U.editor.unmount();d.mounted.clear(),Oo(c),_o(),Co(f)},flushOnUnload:()=>{to(d,T)},schedule:R}}function ia(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[a,i]of Object.entries(n?.byId??{}))if(!(i===void 0||(i.retainedBy?.mainView??0)<=0))return typeof i.id=="string"&&i.id.length>0?i.id:a}function Uo(e){let t,n=new Map,r=(i,s)=>{for(let[d,c]of n){if(d===s)continue;let g;try{g=i.directoryFor(c.sessionId)===d}catch{g=!1}g||(c.restore(),n.delete(d))}};return{ensure:()=>{let i=e.ctx,s=i.get?.("sessions"),d=i.get?.("uiSession"),c=i.get?.("modelDirectories"),g=ia(s,d);if(!(g===void 0||c===void 0))try{let u=c.directoryFor(g);return r(c,u),t!==void 0&&t.sessionId===g&&t.directory===u||(n.has(u)||n.set(u,{sessionId:g,restore:Lr(u,{configuredEffort:e.configuredEffort})}),t={sessionId:g,directory:u}),u}catch{t=void 0;return}},dispose:()=>{for(let[,i]of n)i.restore();n.clear()}}}function Dn(e=document){let t=e.querySelector("[data-composer-card]"),n=t??e;for(let o of Array.from(n.querySelectorAll('button[aria-haspopup="menu"][aria-controls]'))){let a=o.getAttribute("aria-controls");if(a===null||a.length===0)continue;let i=e.getElementById(a);if(i!==null&&i.getAttribute("role")==="menu")return i}let r=Array.from(t===null?e.querySelectorAll('[role="menu"]'):t.querySelectorAll('[role="menu"]'));for(let o of r)if(o.previousElementSibling?.matches('button[aria-haspopup="menu"]'))return o}function Pn(e=document){let n=e.querySelector("[data-composer-card]")??e,r=Array.from(n.querySelectorAll('button[aria-haspopup="menu"]'));for(let o of r){let a=o.getAttribute("aria-controls");if(a===null||a.length===0)continue;let i=e.getElementById(a);if(i!==null&&i.getAttribute("role")==="menu")return o}for(let o of r)if(o.nextElementSibling?.matches('[role="menu"]'))return o;return r[0]}function jo(){return Dn()}function qo(){return Pn()}var he=require("react");var $=require("react");var L=require("react/jsx-runtime"),sa=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function Ko(e){let t=0;return{rows:Object.entries(e??{}).map(([n,r])=>({id:t+=1,name:n,value:r}))}}function aa(e){let t={},n=!1;for(let o of e.rows){let a=o.name.trim();a.length!==0&&(t[a]=o.value,a.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function Bo({route:e,api:t,t:n}){let r=(0,$.useId)(),[o,a]=(0,$.useState)(void 0),[i,s]=(0,$.useState)({rows:[]}),[d,c]=(0,$.useState)(!1),[g,u]=(0,$.useState)(!1),[h,f]=(0,$.useState)(!0),[l,p]=(0,$.useState)(!1),[v,y]=(0,$.useState)(!1),[M,w]=(0,$.useState)(void 0),[T,x]=(0,$.useState)(void 0),R=(0,$.useRef)(1);(0,$.useEffect)(()=>{let S=!0;return(async()=>{try{let N=await X(t);if(!S)return;let _=yn(N.namespace,e);a(_),s(Ko(_)),y(N.writable!==!0)}catch{S&&y(!0)}finally{S&&f(!1)}})(),()=>{S=!1}},[t,e]),(0,$.useEffect)(()=>{let S=!0;return(async()=>{try{let _=await(await fetch(Gn,{method:"GET"})).json();S&&_.ok===!0&&_.data!==void 0&&x(_.data)}catch{}})(),()=>{S=!1}},[]);let H=()=>{s(S=>({...S,rows:[...S.rows,{id:R.current+=1,name:"",value:""}]})),w(void 0)},P=(S,N)=>{s(_=>({..._,rows:_.rows.map(q=>q.id===S?{...q,...N}:q)})),w(void 0)},j=S=>{s(N=>({...N,rows:N.rows.filter(_=>_.id!==S)})),w(void 0)},O=()=>{s(Ko(o)),u(!1),w(void 0)},U=async S=>{p(!0),w(void 0);let N;try{N=await vn(t,e,S)}catch(_){N={ok:!1,error:_ instanceof Error?_.message:String(_)}}if(p(!1),!N.ok){w({kind:"error",text:N.error==="no-route"?n("headersNoRoute"):N.error==="read-only"?n("headersReadOnly"):n("headersError",{error:N.error})});return}a(S),u(!1),w({kind:"success",text:Object.keys(S).length===0?n("headersCleared"):n("headersSaved")})},F=Object.entries(o??{}),W=v||l,G=F.length;return(0,L.jsxs)("div",{className:"bre-headers","data-plugin":z,"data-open":d?"1":"0",children:[(0,L.jsx)("div",{className:"bre-headers-head",children:g?(0,L.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,L.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":d,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{c(!d),w(void 0)},children:[(0,L.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),h||G===0?null:(0,L.jsx)("span",{className:"bre-headers-count",children:G}),(0,L.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),!d&&!g?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),T===void 0?null:(0,L.jsxs)(L.Fragment,{children:[T.environment.preferOfficialLayer?(0,L.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,T.conflicts.length===0&&(T.headerConflicts?.length??0)===0?null:(0,L.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),T.environment.siblings.length===0?null:(0,L.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:T.environment.siblings.map(S=>S.name).join(", ")})})]}),h?null:g?(0,L.jsxs)("div",{className:"bre-headers-edit",children:[(0,L.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,L.jsx)("span",{children:n("headersName")}),(0,L.jsx)("span",{children:n("headersValue")}),(0,L.jsx)("span",{})]}),i.rows.map(S=>(0,L.jsxs)("div",{className:"bre-headers-row",children:[(0,L.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:S.name,disabled:W,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:N=>{P(S.id,{name:N.target.value})}}),(0,L.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:S.value,disabled:W,list:S.name.trim().toLowerCase()==="user-agent"?r:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:N=>{P(S.id,{value:N.target.value})}}),(0,L.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:W,"aria-label":`${n("headersClear")} ${S.name}`,onClick:()=>{j(S.id)},children:"\xD7"})]},S.id)),(0,L.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:W,onClick:H,children:n("headersAdd")}),!1,(0,L.jsx)("datalist",{id:r,children:sa.map(S=>(0,L.jsx)("option",{value:S},S))}),(0,L.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),(0,L.jsxs)("div",{className:"bre-effort-actions",children:[(0,L.jsx)("button",{type:"button",className:"bre-primary-button",disabled:W,onClick:()=>{U(aa(i))},children:n("headersSave")}),(0,L.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:O,children:n("headersCancel")})]})]}):(0,L.jsxs)("div",{className:"bre-headers-rows",children:[F.length===0?(0,L.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):F.map(([S,N])=>(0,L.jsxs)("div",{className:"bre-headers-row",children:[(0,L.jsx)("span",{className:"bre-headers-name",children:S}),(0,L.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(N.length,24))})]},S)),v?null:(0,L.jsx)("div",{className:"bre-effort-actions",children:(0,L.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:()=>{u(!0),w(void 0)},children:n("headersEdit")})})]})]}),M===void 0?null:(0,L.jsx)("p",{className:"bre-effort-message bre-"+M.kind,role:M.kind==="error"?"alert":"status",children:M.text})]})}var zo="settings.models.provider-card";function da({provider:e,api:t,t:n}){let r=(0,he.useRef)(null),[o,a]=(0,he.useState)(!1);(0,he.useEffect)(()=>{let s=r.current,d=s?.closest("li")??null;if(s===null||d===null)return;let c=d,g=()=>d.querySelector('[class*="_editor"]')!==null,u=!1,h=()=>{u=!1,a(g())},f=()=>{u||(u=!0,queueMicrotask(h))};h();let l=new MutationObserver(f);return l.observe(c,{childList:!0,subtree:!0}),()=>{u=!1,l.disconnect()}},[]);let i=e?.provider;return typeof i!="string"||i.length===0?null:(0,he.createElement)("div",{ref:r,className:"bre-headers-host","data-edit":o?"1":"0","data-bre-provider":i},(0,he.createElement)(Bo,{route:i,api:t,t:n}))}function Go(e,t,n){let r=e,o=r.slots?.inject(zo,()=>{r.slots?.register({name:zo,key:Y,inject:()=>({api:t,t:n})},da)});return typeof o=="function"?o:()=>{}}var ee=require("react");function Vo(e){let{t}=e,n=(0,ee.useSyncExternalStore)(lt,ne),r=()=>{Yn(!n)};return(0,ee.createElement)("div",{className:"bre-slider-setting"},(0,ee.createElement)("div",{className:"bre-slider-setting-row"},(0,ee.createElement)("div",{className:"bre-slider-setting-copy"},(0,ee.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,ee.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,ee.createElement)("div",{className:"bre-slider-setting-control"},(0,ee.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,ee.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,ee.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function $o(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:z+"-slider-toggle",order:15,inject:()=>({t})},Vo)});return typeof r=="function"?r:()=>{}}var la=z,fa=["slots","locale","connection","remote","remote.settings"];function ua(e){e.effect(()=>e.locale.register(jt,{zh:Jn,en:$n}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=z,t.dataset.pluginStyles=z,t.textContent=br,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let f=e.get?.("configForms");try{let p=f?.get?.(Y);if(p!==void 0)return p}catch{}return e.get?.("settingsScope")?.bind?.({namespace:Y})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(jt),a=()=>{let f=e.locale;return typeof f.subscribe=="function"&&typeof f.getSnapshot=="function"?f:void 0},i=f=>{let l=a();return l===void 0?f():(0,Jo.createElement)(Vn,{locale:l,children:f})},s=Kr({api:r}),d=Uo({ctx:e,configuredEffort:s.of}),c=Wr({menuOf:jo,triggerOf:qo,t:o,refreshed:i,sliderEnabled:ne,directory:d.ensure}),g=zr({api:r}),u=Wo({ctx:e,api:r,t:o,onIdle:g.run,refreshed:i}),h=()=>{d.ensure(),c.reconcile()};e.effect(()=>(u.start(h),()=>{u.teardown(),c.dispose(),d.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let f=()=>{u.flushOnUnload()};return window.addEventListener("pagehide",f),()=>{window.removeEventListener("pagehide",f)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let f=()=>{u.state.describePromise=void 0,s.invalidate(),u.schedule()},l=[e.remote.$on("settings/document-updated",p=>{p===Y&&f()}),e.on("connection/reset",f)];return()=>{for(let p of l)p()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let f=M=>{M.key===dt?Qn(M.newValue!=="false"):M.key===ft?rr(De(M.newValue)):M.key===ct?dr(ir(M.newValue)):M.key===mt&&gr(Xt(M.newValue))};window.addEventListener("storage",f);let l=lt(()=>{u.schedule()}),p=ut(()=>{u.schedule()}),v=gt(()=>{u.schedule()}),y=ht(()=>{u.schedule()});return()=>{window.removeEventListener("storage",f),l(),p(),v(),y()}},"dsh-model-think-level: client preferences"),e.effect(()=>$o(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Go(e,r,o),"dsh-model-think-level: provider-card slot activation")}
1378
+
1379
+ /* ---- The reserved delete seat (Models page) ---- */
1380
+
1381
+ /* A provider the host will not let the user remove renders no delete button, so
1382
+ that row's action group \u2014 pushed right by margin-left:auto \u2014 starts further
1383
+ right than its neighbours' and the column of buttons lines up raggedly. This
1384
+ seat holds the place: it borrows the metrics the official button takes inside
1385
+ an action group (.rowActions button is 28px tall / 12px / 0 10px) and the
1386
+ dimmed treatment the host gives its own disabled buttons (opacity .4 with a
1387
+ default cursor). It is always disabled \u2014 it is the alignment, not an action. */
1388
+ .bre-provider-delete {
1389
+ box-sizing: border-box;
1390
+ display: inline-flex;
1391
+ align-items: center;
1392
+ justify-content: center;
1393
+ height: 28px;
1394
+ padding: 0 10px;
1395
+ border: none;
1396
+ border-radius: var(--dsw-radius-sm, 6px);
1397
+ background: 0 0;
1398
+ color: var(--dsw-alias-state-error-primary, #e5484d);
1399
+ font: inherit;
1400
+ font-size: 12px;
1401
+ line-height: 18px;
1402
+ opacity: .4;
1403
+ cursor: default;
1404
+ }
1405
+
1406
+ /* -----------------------------------------------------------------------
1407
+ The provider editor's three tabs.
1408
+
1409
+ The official editor lays a provider out as one long column \u2014 identity
1410
+ fields, then the model list, then this plugin's request-header section
1411
+ one slot up the card. The tab pass (injection/editor-tabs.ts) tags each
1412
+ region and stamps the card with the active tab; EVERY visibility decision
1413
+ lives here, so the official React tree never moves and a pass failure
1414
+ degrades to the untouched one-column editor.
1415
+ ----------------------------------------------------------------------- */
1416
+
1417
+ /* The segmented control. The plugin's tab-bar component renders it inside the
1418
+ request-header mount, which already holds the card's 12px gap slot \u2014 so the
1419
+ bar reaches the panes in the card's own rhythm WITHOUT this plugin ever
1420
+ inserting a node into the official child list. It stays hidden until the pass
1421
+ marks the card: a card the pass could not take over (the DeepSeek account
1422
+ editor) keeps that mount visible for its request-header section, and must not
1423
+ grow a bar that switches nothing. */
1424
+ .bre-editor-tabs {
1425
+ display: none;
1426
+ gap: 2px;
1427
+ padding: 2px;
1428
+ border-radius: 10px;
1429
+ background: var(--dsw-alias-fill-tertiary, rgba(120, 125, 140, .09));
1430
+ }
1431
+
1432
+ /* Only a taken-over card shows the bar. */
1433
+ .bre-tabbed .bre-editor-tabs { display: flex; }
1434
+
1435
+ /* ...and while the takeover is on, the mount holding that bar MUST be visible.
1436
+ This is the one place the takeover does not delegate its reveal to the
1437
+ official-edit state: the bar lives in here, and gating it on the _editor
1438
+ class probe would make the tabs depend on a probe an official redesign can
1439
+ break \u2014 with data-edit stuck at 0 the bar would be inside a display:none
1440
+ parent and no rule of ours could reach it. The taken-over class is written by
1441
+ the pass itself, in the same frame, so it is the trustworthy half of the
1442
+ pair. The section's own visibility stays a pane decision (below). */
1443
+ .bre-tabbed .bre-headers-host { display: block; }
1444
+
1445
+ .bre-editor-tab {
1446
+ flex: 1 1 0;
1447
+ min-width: 0;
1448
+ height: 28px;
1449
+ padding: 0 10px;
1450
+ border: none;
1451
+ border-radius: 8px;
1452
+ background: transparent;
1453
+ color: var(--dsw-alias-label-secondary, #61666b);
1454
+ font: inherit;
1455
+ font-size: 12px;
1456
+ font-weight: 500;
1457
+ line-height: 1;
1458
+ white-space: nowrap;
1459
+ overflow: hidden;
1460
+ text-overflow: ellipsis;
1461
+ cursor: pointer;
1462
+ transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
1463
+ }
1464
+
1465
+ .bre-editor-tab:hover { color: var(--dsw-alias-label-primary, #0f1115); }
1466
+
1467
+ /* The selected segment lifts out of the track: the page's own surface colour
1468
+ plus the card's own hairline, the same elevation the host uses for raised
1469
+ controls. Hover on a selected tab stays put \u2014 it is already where you are. */
1470
+ .bre-editor-tab[aria-selected='true'],
1471
+ .bre-editor-tab[aria-selected='true']:hover {
1472
+ background: var(--dsw-alias-bg-layer-1, #fff);
1473
+ color: var(--dsw-alias-label-primary, #0f1115);
1474
+ box-shadow: 0 1px 2px #0000001a, 0 0 0 1px var(--dsw-alias-border-l2, #0000001a);
1475
+ }
1476
+
1477
+ .bre-editor-tab:focus-visible {
1478
+ outline: 2px solid var(--dsw-alias-brand-primary, #4d6bfe);
1479
+ outline-offset: 1px;
1480
+ }
1481
+
1482
+ /* An advanced section with no headers mount (pre-first-render, feature off)
1483
+ offers an empty pane \u2014 the button steps aside until the mount exists. */
1484
+ .bre-editor-tab[hidden] { display: none; }
1485
+
1486
+ /* Pane visibility, keyed on the card's active tab. Only the HIDING has to win
1487
+ a specificity fight (against the official sheet and the headers host's own
1488
+ reveal rule); the active pane keeps whatever display the official layout
1489
+ gave it, so showing must not declare a display at all. */
1490
+ .bre-tabbed:not([data-bre-tab='provider']) [data-bre-region='provider'],
1491
+ .bre-tabbed:not([data-bre-tab='models']) [data-bre-region='models'],
1492
+ .bre-tabbed:not([data-bre-tab='advanced']) [data-bre-region='advanced'] {
1493
+ display: none !important;
1494
+ }
1495
+
1496
+ /* The advanced tab: the official body \u2014 fields, model list, action row and the
1497
+ editor's own header \u2014 steps aside for the request-header section, which is a
1498
+ complete form with its own save/cancel and becomes the pane under the very
1499
+ same bar. */
1500
+ .bre-tabbed[data-bre-tab='advanced'] [data-bre-editor-body] {
1501
+ display: none !important;
1502
+ }
1503
+
1504
+ /* The advanced pane shows the section for the same reason the mount is shown:
1505
+ a pane that is already the active one has no business depending on the
1506
+ official-edit probe. The rule above still wins for every other tab, and the
1507
+ base bre-headers rule keeps a collapsed card's section hidden \u2014 a card only
1508
+ carries the taken-over class while its editor is open. */
1509
+ .bre-tabbed[data-bre-tab='advanced'] .bre-headers { display: flex; }
1510
+
1511
+ /* The pane is a card, and the section draws it. On the advanced tab the section
1512
+ is not an appendage to the fields above it any more \u2014 it is the whole surface
1513
+ \u2014 so it takes the inset fill the official module cards use (the add and setup
1514
+ cards): the one fill in this system that stays visible on the content card's
1515
+ own white in the light theme and reads as raised in the dark one, where every
1516
+ theme layer token collapses onto the same value. The hairline goes with it: it
1517
+ divided this section from those fields, and here the bar above ends the pane.
1518
+ The 12px top margin sets the card off the tab bar above it \u2014 the same gap the
1519
+ provider and models panes put between the bar and their own cards \u2014 and the
1520
+ 12px padding is the card's inner inset, not the separator. */
1521
+ .bre-tabbed[data-bre-tab='advanced'] .bre-headers {
1522
+ margin-top: 12px;
1523
+ padding: 12px;
1524
+ border-top: none;
1525
+ border-radius: var(--dsw-radius-lg, 16px);
1526
+ background: var(--dsw-alias-bg-module-platform, #f5f6f7);
1527
+ }
1528
+
1529
+ /* The live editor folds its identity fields and model list into one
1530
+ "Customized" disclosure. Under the tabs the grouping is the panes' job: the
1531
+ group stays expanded (the pass forces it open) and its summary row \u2014 now a
1532
+ toggle with nothing left to toggle \u2014 steps aside. */
1533
+ .bre-tabbed [data-bre-editor-body] details > summary {
1534
+ display: none !important;
1535
+ }
1536
+
1537
+ /* A region that is NOT a pane. The editor's own header repeats the card row's
1538
+ provider name and route tag, and that row is already on screen directly above
1539
+ it, so the header is hidden on every tab. No pane rule above can select this
1540
+ id, which is what keeps it hidden whichever tab is active. */
1541
+ .bre-tabbed [data-bre-region='none'] {
1542
+ display: none !important;
1543
+ }
1544
+
1545
+ /* The Models pane shows the custom model list and the catalogue, and two
1546
+ hairlines used to divide it: the "Customized" group's separator from the key
1547
+ field (which this pane hides) and the catalogue's own, drawn directly above
1548
+ its "Model catalogue" heading. Neither has anything to divide here \u2014 the tab
1549
+ bar already ends the pane above, and the divider between the two lists above
1550
+ the catalogue is the group's boundary, not a rule. Both go, with every top
1551
+ padding that held content off them (the group's 10px, its body's 12px, the
1552
+ catalogue's 12px), so the pane runs from the tab bar into the catalogue with
1553
+ only the official editor's own 14px gap between blocks. */
1554
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] details[class*='customized'] {
1555
+ border-top: none;
1556
+ padding-top: 0;
1557
+ }
1558
+
1559
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] details[class*='customized'] > [class*='customizedBody'] {
1560
+ padding-top: 0;
1561
+ }
1562
+
1563
+ /* The catalogue is a section (its heading, title and meta are the divs inside
1564
+ it), so this probe hits the ruled box and nothing else. */
1565
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] section[class*='modelCatalog'] {
1566
+ border-top: none;
1567
+ padding-top: 0;
1568
+ }
1569
+
1570
+ /* The API-key eye. The official key field is a plain flex column whose input is
1571
+ its last in-flow child, so the button hangs on the field's own box and is
1572
+ measured against the input's 32px row \u2014 the official markup offers no
1573
+ wrapper, and introducing one would mean moving DOM the host owns. The input
1574
+ keeps the room the button needs. */
1575
+ .bre-key-field { position: relative; }
1576
+
1577
+ .bre-key-field > input { padding-right: 34px; }
1578
+
1579
+ /* A field the plugin's key list manages hands its input over: the list below
1580
+ says the same thing once per key and keeps the pick, the alias and the value
1581
+ in one place, so an official box that writes the provider's single key would
1582
+ be a second, conflicting way to do it. The input stays in the DOM \u2014 the
1583
+ host's form still owns it and the reveal pass still finds it \u2014 so unmanaging
1584
+ the field brings the official box back. The marker is what the reveal pass
1585
+ stamps on that input; the direct-child form covers the pass that has not run
1586
+ yet, and the eye is the button the same pass hangs on the field. */
1587
+ .bre-key-managed [data-bre-key-input],
1588
+ .bre-key-managed > input,
1589
+ .bre-key-managed .bre-key-eye { display: none; }
1590
+
1591
+ /* A field that failed validation grows a message line under the input; the eye
1592
+ rides above it so it stays on the input it belongs to (18px line + 6px gap). */
1593
+ .bre-key-field:has(> p) .bre-key-eye { bottom: 24px; }
1594
+
1595
+ .bre-key-eye {
1596
+ position: absolute;
1597
+ right: 4px;
1598
+ bottom: 0;
1599
+ display: inline-flex;
1600
+ align-items: center;
1601
+ justify-content: center;
1602
+ width: 28px;
1603
+ height: 32px;
1604
+ padding: 0;
1605
+ border: 0;
1606
+ border-radius: 8px;
1607
+ background: transparent;
1608
+ color: var(--dsw-alias-label-secondary, #6b7280);
1609
+ cursor: pointer;
1610
+ -webkit-appearance: none;
1611
+ appearance: none;
1612
+ transition: background 140ms ease, color 140ms ease;
1613
+ }
1614
+
1615
+ .bre-key-eye:hover {
1616
+ color: var(--dsw-alias-label-primary, #0f1115);
1617
+ background: var(--dsw-alias-interactive-bg-hover);
1618
+ }
1619
+
1620
+ .bre-key-eye:focus-visible {
1621
+ outline: none;
1622
+ box-shadow: inset 0 0 0 2px var(--dsw-alias-border-l3);
1623
+ }
1624
+
1625
+ /* Resolving a stored key is a same-origin round trip, so the button can be
1626
+ busy: it stays in place and dims rather than changing size or disappearing. */
1627
+ .bre-key-eye[aria-busy='true'] {
1628
+ opacity: 0.55;
1629
+ cursor: progress;
1630
+ }
1631
+
1632
+ .bre-key-eye[hidden] { display: none; }
1633
+
1634
+ /* One glyph at a time. The state lives on the button's own attribute, so a
1635
+ click swaps the icon without the host re-rendering anything. */
1636
+ .bre-key-eye svg[data-bre-icon] { display: none; }
1637
+
1638
+ .bre-key-eye[aria-pressed='false'] svg[data-bre-icon='eye'],
1639
+ .bre-key-eye[aria-pressed='true'] svg[data-bre-icon='eye-off'] { display: block; }
1640
+
1641
+ /* The key list. The plugin mounts it into its own host, a sibling placed right
1642
+ after the official key field, so the list sits under the input without
1643
+ changing the field's own box: the reveal eye is measured against that box
1644
+ (bottom: 0), and a list inside the field would drag the eye down onto the
1645
+ list's last row. The margin only covers the case where the card spaces its
1646
+ fields with margins instead of a gap. */
1647
+ .bre-keys-host {
1648
+ display: block;
1649
+ min-width: 0;
1650
+ margin-top: 4px;
1651
+ }
1652
+
1653
+ .bre-keys { display: flex; flex-direction: column; gap: 8px; }
1654
+
1655
+ /* While the key list is still reading, the panel renders NOTHING (the component
1656
+ returns an empty .bre-keys). An empty ruled box \u2014 or a placeholder line that
1657
+ then swaps to the list \u2014 would paint one frame of a panel that then visibly
1658
+ changes: the "the key section flashes when you press Edit" report. :empty
1659
+ takes the panel out of the layout until the first answer lands, so the list
1660
+ is the first thing the key area ever paints, and nothing under it moves. */
1661
+ .bre-keys:empty { display: none; }
1662
+
1663
+ /* One ruled container holding the keys and the add entry, the way a settings
1664
+ list reads: a single hairline box, and hairlines between rows only. */
1665
+ .bre-keys-list {
1666
+ display: flex;
1667
+ flex-direction: column;
1668
+ margin: 0;
1669
+ padding: 0;
1670
+ border: 0.5px solid var(--dsw-alias-border-l2, #d5d7dd);
1671
+ border-radius: 8px;
1672
+ list-style: none;
1673
+ overflow: hidden;
1674
+ }
1675
+
1676
+ .bre-keys-list > li + li { border-top: 0.5px solid var(--dsw-alias-border-l2, #d5d7dd); }
1677
+
1678
+ .bre-keys-row {
1679
+ display: flex;
1680
+ align-items: center;
1681
+ gap: 8px;
1682
+ min-width: 0;
1683
+ padding: 9px 10px;
1684
+ }
1685
+
1686
+ /* The enable choice closes the row. The radio stays the real input \u2014 so the
1687
+ keys of one provider are one group, choosing one clears the rest, and the
1688
+ pick is keyboard-reachable \u2014 and the circle is its face; the word beside it
1689
+ names the action instead of a state to hunt for. */
1690
+ .bre-keys-enable {
1691
+ display: inline-flex;
1692
+ flex: 0 0 auto;
1693
+ align-items: center;
1694
+ gap: 6px;
1695
+ cursor: pointer;
1696
+ }
1697
+
1698
+ .bre-keys-enable-text {
1699
+ font-size: 11px;
1700
+ line-height: 1.5;
1701
+ color: var(--dsw-alias-label-secondary, #6b7280);
1702
+ }
1703
+
1704
+ .bre-keys-enable:has(.bre-keys-enabled:checked) .bre-keys-enable-text {
1705
+ color: var(--dsw-alias-label-primary, #0f1115);
1706
+ }
1707
+
1708
+ .bre-keys-enabled {
1709
+ position: absolute;
1710
+ width: 1px;
1711
+ height: 1px;
1712
+ margin: -1px;
1713
+ padding: 0;
1714
+ border: 0;
1715
+ overflow: hidden;
1716
+ white-space: nowrap;
1717
+ clip-path: inset(50%);
1718
+ }
1719
+
1720
+ .bre-keys-mark {
1721
+ display: inline-flex;
1722
+ align-items: center;
1723
+ justify-content: center;
1724
+ width: 16px;
1725
+ height: 16px;
1726
+ box-sizing: border-box;
1727
+ border: 1px solid var(--dsw-alias-border-l3, #9aa0aa);
1728
+ border-radius: 50%;
1729
+ color: var(--dsw-alias-bg-layer-1, #ffffff);
1730
+ transition: background 120ms ease, border-color 120ms ease;
1731
+ }
1732
+
1733
+ .bre-keys-mark > svg { width: 12px; height: 12px; }
1734
+
1735
+ .bre-keys-enabled:checked + .bre-keys-mark {
1736
+ border-color: var(--dsw-alias-label-primary, #0f1115);
1737
+ background: var(--dsw-alias-label-primary, #0f1115);
1738
+ }
1739
+
1740
+ .bre-keys-enabled:focus-visible + .bre-keys-mark {
1741
+ outline: none;
1742
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
1743
+ }
1744
+
1745
+ /* With an alias the alias is the row's name and the masked key follows it as a
1746
+ quiet code pill; without one the masked key is the name and takes the row's
1747
+ measure, so a key is always readable as itself. */
1748
+ .bre-keys-alias {
1749
+ flex: 0 1 auto;
1750
+ min-width: 0;
1751
+ overflow: hidden;
1752
+ text-overflow: ellipsis;
1753
+ white-space: nowrap;
1754
+ font-size: 12px;
1755
+ font-weight: 500;
1756
+ color: var(--dsw-alias-label-primary, #0f1115);
1757
+ }
1758
+
1759
+ .bre-keys-mask {
1760
+ flex: 0 1 auto;
1761
+ min-width: 0;
1762
+ overflow: hidden;
1763
+ text-overflow: ellipsis;
1764
+ white-space: nowrap;
1765
+ padding: 1px 6px;
1766
+ border-radius: 4px;
1767
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.08));
1768
+ color: var(--dsw-alias-label-secondary, #6b7280);
1769
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1770
+ font-size: 11px;
1771
+ }
1772
+
1773
+ .bre-keys-mask-plain {
1774
+ flex: 1 1 auto;
1775
+ padding: 0;
1776
+ background: transparent;
1777
+ color: var(--dsw-alias-label-primary, #0f1115);
1778
+ font-family: inherit;
1779
+ font-size: 12px;
1780
+ }
1781
+
1782
+ /* The row's three actions, revealed on hover or keyboard focus rather than
1783
+ removed, so the row keeps its width and nothing shifts under the pointer.
1784
+ Revealing is opacity alone; a pointer that cannot hover simply always sees
1785
+ them, because a hidden action there would be an unreachable one. */
1786
+ .bre-keys-actions {
1787
+ display: inline-flex;
1788
+ flex: 0 0 auto;
1789
+ align-items: center;
1790
+ gap: 10px;
1791
+ margin-left: auto;
1792
+ opacity: 0;
1793
+ pointer-events: none;
1794
+ transition: opacity 120ms ease;
1795
+ }
1796
+
1797
+ .bre-keys-row:hover .bre-keys-actions,
1798
+ .bre-keys-row:focus-within .bre-keys-actions {
1799
+ opacity: 1;
1800
+ pointer-events: auto;
1801
+ }
1802
+
1803
+ @media (hover: none) {
1804
+ .bre-keys-actions { opacity: 1; pointer-events: auto; }
1805
+ }
1806
+
1807
+ .bre-keys-danger { color: var(--dsw-alias-state-error-primary, #c62828); }
1808
+
1809
+ /* The one inline form. It opens under the row it edits, or \u2014 for a new key \u2014 as
1810
+ the list's own last item, which is what keeps adding a key in place instead
1811
+ of in a dialog that has to be found and dismissed. */
1812
+ .bre-keys-form-row { padding: 10px; }
1813
+
1814
+ .bre-keys-form { display: flex; flex-direction: column; gap: 8px; }
1815
+
1816
+ .bre-keys-form-fields {
1817
+ display: grid;
1818
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1819
+ gap: 8px;
1820
+ }
1821
+
1822
+ /* One field means the whole row: the value form holds only the secret, and it
1823
+ must not sit in half a row beside an empty half. */
1824
+ .bre-keys-form-fields > :only-child { grid-column: 1 / -1; }
1825
+
1826
+ /* The shared input caps itself at 240px for the panels it was written for; here
1827
+ the field is the measure. */
1828
+ .bre-keys-form-fields .bre-text-input { max-width: none; }
1829
+
1830
+ .bre-keys-form-actions {
1831
+ display: flex;
1832
+ align-items: center;
1833
+ justify-content: flex-end;
1834
+ gap: 8px;
1835
+ }
1836
+
1837
+ /* The shared primary button is styled inside the headers editor, which is not
1838
+ where this form lives, so the key list carries its own compact copy. */
1839
+ .bre-keys-form-actions .bre-primary-button {
1840
+ height: 28px;
1841
+ padding: 0 12px;
1842
+ border: 0;
1843
+ border-radius: var(--dsw-radius-md, 8px);
1844
+ background: var(--dsw-alias-button-primary-fill, #0f1115);
1845
+ color: var(--dsw-alias-label-primary-foreground, #ffffff);
1846
+ font: inherit;
1847
+ font-size: 12px;
1848
+ cursor: pointer;
1849
+ -webkit-appearance: none;
1850
+ appearance: none;
1851
+ }
1852
+
1853
+ .bre-keys-form-actions .bre-primary-button:hover {
1854
+ background: var(--dsw-alias-button-primary-hover, #43454a);
1855
+ }
1856
+
1857
+ .bre-keys-form-actions .bre-primary-button:disabled { opacity: 0.5; cursor: default; }
1858
+
1859
+ .bre-keys-form-actions .bre-primary-button:focus-visible {
1860
+ outline: none;
1861
+ box-shadow: 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
1862
+ }
1863
+
1864
+ /* The add entry is the list's own last row \u2014 full width, the same shape as the
1865
+ keys it adds to \u2014 so the way in and the thing it makes read as one list. */
1866
+ .bre-keys-add-row { padding: 0; }
1867
+
1868
+ .bre-keys-add {
1869
+ display: flex;
1870
+ align-items: center;
1871
+ gap: 8px;
1872
+ width: 100%;
1873
+ padding: 9px 10px;
1874
+ box-sizing: border-box;
1875
+ border: 0;
1876
+ background: transparent;
1877
+ color: var(--dsw-alias-label-secondary, #6b7280);
1878
+ font: inherit;
1879
+ font-size: 12px;
1880
+ text-align: left;
1881
+ cursor: pointer;
1882
+ -webkit-appearance: none;
1883
+ appearance: none;
1884
+ transition: background 120ms ease, color 120ms ease;
1885
+ }
1886
+
1887
+ .bre-keys-add:hover {
1888
+ background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.08));
1889
+ color: var(--dsw-alias-label-primary, #0f1115);
1890
+ }
1891
+
1892
+ .bre-keys-add:focus-visible {
1893
+ outline: none;
1894
+ box-shadow: inset 0 0 0 2px var(--dsw-alias-brand-primary, #3b82f6);
1895
+ }
1896
+
1897
+ .bre-keys-add:disabled { opacity: 0.55; cursor: default; }
1898
+
1899
+ .bre-keys-add-mark {
1900
+ display: inline-flex;
1901
+ flex: 0 0 auto;
1902
+ align-items: center;
1903
+ justify-content: center;
1904
+ width: 16px;
1905
+ height: 16px;
1906
+ }
1907
+
1908
+ .bre-keys .bre-effort-message { font-size: 11px; }
1909
+
1910
+ @media (prefers-reduced-motion: reduce) {
1911
+ .bre-editor-tab { transition: none; }
1912
+ .bre-key-eye { transition: none; }
1913
+ .bre-keys-mark, .bre-keys-actions, .bre-keys-add { transition: none; }
1914
+ }
1915
+ `;var ut=require("react"),Ao=require("react-dom");var T=require("react"),Vn=require("react-dom");var uo=["off","minimal","low","medium","high","xhigh","max"],ta=["text","image"];var na=[{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:105e4,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\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:105e4,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium / High(\u9ED8\u8BA4) / XHigh \u4E14\u4EC5 Responses API\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:105e4,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\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],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.3-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1Bgpt-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-chat",patterns:["gpt-5.1-chat-latest","gpt-5.2-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.2-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\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-astra",patterns:["gpt-6-astra","gpt-6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,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\uFF0C1,050,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\uFF1BAI \u5B98\u65B9\u9ED8\u8BA4\u6863\u4F4D\u672A\u516C\u5E03\uFF0C\u6545\u4E0D\u586B\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\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",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-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 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1BFable 5.1 \u4E0E Mythos 5.1 \u89C1\u5355\u72EC\u6761\u76EE\uFF0CMythos Preview \u4EC5\u81F3 Max\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:{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 Fable 5.1 / Mythos 5.1\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1B\u8FD9\u4E24\u578B\u4E5F\u662F\u5B98\u65B9\u552F\u4E00\u5141\u8BB8\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\u7684\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\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],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 Opus 4.7/4.8 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],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 4.6 \u4EE3\u6863\u4F4D\uFF1ALow / Medium / High / Max\uFF08\u65E0 XHigh\u2014\u2014\u5B98\u65B9\u660E\u8A00\u300C\u652F\u6301 max \u7684\u90E8\u5206\u578B\u53F7\u4E0D\u652F\u6301 xhigh\u300D\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 Fable/Mythos 5\u3001Opus 5/4.6-4.8\u3001Sonnet 5/4.6\u3001Opus 4.5 \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\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\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,note:'Grok 4.7\uFF08\u4E0A\u6E38\u5FEB\u7167 grok-4.7-20260916\uFF09\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\u2014\u2014**\u53D6\u81EA\u516C\u5F00\u76EE\u5F55**\uFF08OpenRouter \u7684 supported_parameters\u3001models.dev \u5BF9 docs.x.ai \u7684\u8F6C\u8FF0\uFF09\uFF0C\u672C\u6B21 xAI \u5B98\u65B9\u6587\u6863\u7AD9\u4E0D\u53EF\u8FBE\u3001\u672A\u80FD\u4E00\u624B\u8BC1\u5B9E\uFF1B\u9ED8\u8BA4\u6863\u4F4D\u4E0E"\u80FD\u5426\u5173\u95ED\u601D\u8003"\u540C\u6837\u672A\u8BC1\u5B9E\uFF0C\u6545\u4E0D\u58F0\u660E Off\uFF0C\u4E5F\u4E0D\u5199\u9ED8\u8BA4\u6863\u3002\u5E26\u56FE\u8F93\u5165\uFF08\u76EE\u5F55\u8BB0 text+image+file\uFF0CPDF \u5B58\u7591\uFF09\uFF0C500K \u4E0A\u4E0B\u6587\uFF1B\u6700\u5927\u8F93\u51FA\u5404\u76EE\u5F55\u7ED9\u51FA 450K \u4E0E 500K \u4E24\u79CD\u503C\uFF0C\u6309"\u5206\u6B67\u5373\u4E0D\u5199"\u5904\u7406\u30022026-08 \u90A3\u6B21"grok-4.7 \u4E0D\u5B58\u5728\uFF08\u5B98\u65B9 404\uFF09"\u7684\u7ED3\u8BBA\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\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",xhigh:"xhigh"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3001\u5E26\u56FE\u8F93\u5165\uFF1Bgrok-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:!1,input:["text"],contextWindow:32768,maxTokens:32768,note:"Magistral \u539F\u751F\u601D\u8003\u7EBF\uFF08\u65E0 effort \u53C2\u6570\uFF0C\u4E3A prompt_mode \u8BED\u4E49\uFF09\uFF0C\u5B98\u65B9\u5DF2\u4E8E 2026-07-28 \u58F0\u660E\u5F03\u7528\u3001\u9010\u6B65\u64A4\u51FA\uFF1B\u73B0\u5F79\u63A8\u7406\u8D70 mistral-small-2603 / mistral-medium-3-5 \u7684 reasoning_effort\uFF08\u89C1\u4E0B\u6761\uFF09\u3002"},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","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\uFF1ANone / High\u2014\u2014\u5B98\u65B9 reasoning_effort \u679A\u4E3E\uFF08mistral-common \u534F\u8BAE\u5E93\uFF09\u5373 none/high\uFF1Bmistral-small-2603\uFF08Small 4\uFF09\u4E0E mistral-medium-3-5 \u7ECF\u5B83\u63A7\u5236\uFF0CMedium 3.5 \u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\u672A\u5728\u5B98\u65B9\u76EE\u5F55\u9875\u5355\u5217\uFF0C\u4E0D\u63D0\u4F9B\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"],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-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-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,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\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"}],Fn={off:null,low:"low",medium:"medium",high:"high"},ra={"openai-completions":Fn,"openai-responses":Fn,"anthropic-messages":Fn,deepseek:{off:"none",low:"low",high:"high",max:"max"}},oa={low:"low",medium:"medium",high:"high"};function lt(e){return(e??"").toLowerCase().trim()}function ao(e){return e!==void 0&&/[a-z0-9]/.test(e)}function dt(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function co(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!ao(r)&&!ao(o)}function qn(e,t){let n=dt(e)+" "+dt(t??""),r;for(let o of na)for(let a of o.patterns){let i=dt(a),s=n.indexOf(i);for(;s>=0;){if(co(n,s,i.length)){(r===void 0||i.length>r.length)&&(r={entry:o,length:i.length});break}s=n.indexOf(i,s+1)}}return r?.entry}var ia={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function sa(e){let t=lt(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 a=ia[o.slice(-2).join(".")];if(a!==void 0)return a}}catch{}return"openai-completions"}var qt="openai-completions",po="anthropic-messages";function Kn(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 aa(e,t){let n=lt(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===po){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority","supportsMaxOutputTokens"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n==="openai-responses"){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.supportsMaxOutputTokens===void 0?void 0:{supportsMaxOutputTokens:r.supportsMaxOutputTokens}}if(n===qt)return delete r.forceAdaptiveThinking,delete r.supportsMaxOutputTokens,Object.keys(r).length===0?void 0:r}function da(e,t){let n=lt(t.api);if(n===qt){let r=e.compat;return r!==void 0&&(r=aa(r,n)??void 0),r===void 0&&!Kn(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&Kn(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===po&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var la=["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 Bn(e){if(lt(e.api)!==qt)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(".")?!la.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function lo(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!Bn(t)?e:{...e,supportsDeveloperRole:!1}}var fo={off:null,low:"low",medium:"medium",high:"high"},fa=["vl","vision","omni","4o","pixtral","internvl"];function Wn(e){let t=dt(e);for(let n of fa){let r=dt(n),o=t.indexOf(r);for(;o>=0;){if(co(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function ua(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>ta.includes(n)))return t.includes("image")?["text","image"]:["text"]}function he(e,t,n){let r=qn(e,t.displayName),o,a,i,s;r?.input!==void 0&&(o=r.input,a="knowledge"),r?.contextWindow!==void 0&&(i=r.contextWindow),r?.maxTokens!==void 0&&(s=r.maxTokens);let d=ua(n?.input);if(d!==void 0&&(o=d,a="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(i=n.contextLength),o===void 0){let k=Wn(e);k!==void 0&&(o=k,a="heuristic")}let c={...o===void 0?{}:{input:o},...a===void 0?{}:{inputSource:a},...i===void 0?{}:{contextWindow:i},...s===void 0?{}:{maxTokens:s}},m=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",...m,...c};if(r!==void 0){let k=lo(da(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}:{},...k===void 0?{}:{compat:k},matched:!0,entryId:r.id,source:r.id,confidence:"high",...m,...c}}let u=sa(t),g=ra[u]??oa,l=lt(t.api)===qt?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,f=l!==void 0&&Kn(t.baseURL)?{...l,thinkingTokenBudgetField:"thinking_token_budget"}:l,p=lo(f,t,!0);return n?.reasoning===!0?{efforts:{...fo},...fo.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...m,...c}:{efforts:g,...g.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"protocol:"+u,confidence:"low",...m,...c}}var go="dsh-model-think-level.slider.efforts",Un="breSelectWired";function jn(e){return typeof e=="object"&&e!==null&&e.ok===!1}function zn(e){if(!jn(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 De(e,t){return`${e}/${t}`}function ho(){try{let e=window.localStorage.getItem(go);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 ca(e){try{window.localStorage.setItem(go,JSON.stringify(e))}catch{}}function pa(e,t,n){let r=ho();r[De(e,t)]=n,ca(r)}function ma(e,t){return ho()[De(e,t)]}function Bt(e,t,n){let o=e.groups.find(a=>a.id===t)?.models.find(a=>a.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(a=>a.id)}function ga(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function ha(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function ba(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function mo(e,t,n,r,o){let a=Bt(e,t,n);if(a.length===0)return;let i=De(t,n),s=r.get(i);if(s!==void 0&&a.includes(s))return s;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&a.includes(d))return d;let c=ma(t,n);if(c!==void 0&&a.includes(c))return c;let m=he(n,{}).defaultEffort;if(m!==void 0&&a.includes(m))return m;let u=ga(e,t,n);return u!==void 0&&a.includes(u)?u:ha(a)}function bo(e,t){let n=e;if(n[Un]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,a=new Map,i=new Set,s=new Map,d=3,c=0,m=async l=>{let f=++c;if(l.reasoningEffort!==void 0){let v=await o.call(e,l);return!jn(v)&&ae()&&(a.set(De(l.provider,l.model),l.reasoningEffort),pa(l.provider,l.model,l.reasoningEffort)),v}let p=e.store.getSnapshot();if(!ba(p.current,l)){if(ae()){let v=De(l.provider,l.model);a.delete(v),i.add(v)}return o.call(e,l)}if(!ae())return o.call(e,l);let k=await mo(p,l.provider,l.model,a,t),w=e.store.getSnapshot();if(!(c!==f||((v,E)=>v===null||E===null?v!==E:v.provider!==E.provider||v.model!==E.model||v.reasoningEffort!==E.reasoningEffort)(w.current,p.current)))return!ae()||k===void 0||!Bt(w,l.provider,l.model).includes(k)?o.call(e,l):o.call(e,{...l,reasoningEffort:k})},u=()=>{let l=e.store.getSnapshot(),f=l.current;if(f===null||f.reasoningEffort!==void 0||!ae())return;let p=De(f.provider,f.model);if(i.has(p))return;if(Bt(l,f.provider,f.model).length===0){i.add(p);return}i.add(p);let k=c;mo(l,f.provider,f.model,a,t).then(async w=>{if(w===void 0){i.delete(p);return}if(!ae()){i.delete(p);return}let x=e.store.getSnapshot(),v=x.current;if(c!==k||v===null||v.reasoningEffort!==void 0||De(v.provider,v.model)!==p||!Bt(x,v.provider,v.model).includes(w))return;let E=await o.call(e,{provider:v.provider,model:v.model,reasoningEffort:w});if(jn(E))throw E}).catch(()=>{let w=(s.get(p)??0)+1;s.set(p,w),w<d&&(i.delete(p),u())})},g=e.store.subscribe(u);return u(),n[Un]=!0,e.select=m,()=>{delete n[Un],g(),r?e.select=o:delete n.select}}function ya(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 wa(e){return e.current}function xa(e,t){let n=wa(t),r=e.findIndex(s=>s.id===n?.reasoningEffort);if(r>=0)return r;let a=t.groups.find(s=>s.id===n?.provider)?.models.find(s=>s.id===n?.model)?.reasoning?.defaultEffort,i=a===void 0?-1:e.findIndex(s=>s.id===a);return i>=0?i:Math.floor((e.length-1)/2)}function yo(e){return e.models??[]}function Wt(e){let t=e;return t.name??t.label??t.title??e.id}function Gn(e){return(0,T.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function va(){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 wo=new Map;function ka(e){if(Array.isArray(e.input))return e.input.includes("image");let t=wo.get(e.id);if(t!==void 0)return t;let n=qn(e.id,e.name)?.input,r=n!==void 0?n.includes("image"):(Wn(e.id)??[]).includes("image");return wo.set(e.id,r),r}function Ea(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Ta(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 Ma(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 Sa(e,t){let n=[];return ka(e)&&n.push((0,T.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Ta(t("tagVision")))),Ea(e)&&n.push((0,T.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Ma(t("tagThinking")))),n.length===0?null:(0,T.createElement)("span",{className:"bre-option-tags"},...n)}function xo(e){let{directory:t,t:n}=e,r=e.onLayoutChange,o=(0,T.useSyncExternalStore)(M=>t.store.subscribe(M),()=>t.store.getSnapshot()),a=ya(o),[i,s]=(0,T.useState)(""),[d,c]=(0,T.useState)(null),[m,u]=(0,T.useState)(null),[g,l]=(0,T.useState)(!1),[f,p]=(0,T.useState)(null),k=(0,T.useRef)(null),w=(0,T.useRef)(""),x=(0,T.useRef)(!1),v=o.current!==null&&a.length>=2,E=g||o.status==="selecting",b=f??o.error,R=t.select;(0,T.useEffect)(()=>{if(x.current)return;let M=xa(a,o),ee=a[M]?.id??"";w.current=ee,s(ee),p(null)},[v,a,o]),(0,T.useEffect)(()=>{t.load().catch(()=>{})},[t]);let I=o.current,U=o.groups.find(M=>M.id===I?.provider),H=U?.models.find(M=>M.id===I?.model)?.name??(I===null?n("triggerFallback"):I.model),te=I===null?H:Wt(U??{id:I.provider})+" \xB7 "+H,S=a.find(M=>M.id===i)?.name??n("effortDefault"),D=(0,T.useSyncExternalStore)(It,Hn),P=(0,T.useSyncExternalStore)(Ct,Yr),C=(0,T.useSyncExternalStore)(Kt,to),W=o.groups.filter(M=>yo(M).length>0&&!P.includes(M.id)).map(M=>M.id),z=Ye(_n(W),D),j=m!==null&&z.includes(m)?m:I!==null&&z.includes(I.provider)?I.provider:z[0]??null,L=j===null?[]:io(yo(o.groups.find(M=>M.id===j)),C[j]??[]),O=I===null?"":I.provider+"/"+I.model,F=(0,T.useCallback)(M=>{d!==M&&((0,Vn.flushSync)(()=>{c(M)}),r?.())},[r,d]),Z=(0,T.useCallback)(()=>{d!==null&&((0,Vn.flushSync)(()=>{c(null)}),r?.())},[r,d]),fe=(0,T.useCallback)(()=>{let M=k.current?.closest('[role="menu"]');M!=null&&(M.tabIndex=-1,M.focus({preventScroll:!0}))},[]),je=(0,T.useCallback)(async(M,ee)=>{if(x.current)return;let Y=t.store.getSnapshot().current;if(Z(),!(Y!==null&&Y.provider===M&&Y.model===ee)){x.current=!0,fe(),l(!0),p(null);try{let ue=await R({provider:M,model:ee}),oe=zn(ue);if(oe!==void 0)throw new Error(oe)}catch(ue){p(ue instanceof Error?ue.message:String(ue))}finally{x.current=!1,l(!1)}}},[Z,t,fe,R]),_e=(0,T.useCallback)(async M=>{if(x.current||(Z(),M===o.current?.reasoningEffort&&o.status!=="error"))return;x.current=!0;let ee=w.current;fe(),l(!0),p(null),s(M);try{let Y=o.current;if(Y===null)throw new Error(n("sliderNoCurrent"));let ue=await R({provider:Y.provider,model:Y.model,reasoningEffort:M}),oe=zn(ue);if(oe!==void 0)throw new Error(oe);let St=t.store.getSnapshot(),it=a.find(Lt=>Lt.id===St.current?.reasoningEffort)?.id??M;w.current=it,s(it)}catch(Y){w.current=ee,s(ee),p(Y instanceof Error?Y.message:String(Y))}finally{x.current=!1,l(!1)}},[Z,t,fe,a,R,o.current,o.status,n]),ot=[(0,T.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(d==="model"?" is-open":""),disabled:E,"aria-expanded":d==="model",onClick:()=>{F(d==="model"?null:"model")}},(0,T.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"},te),Gn(d==="model")),d==="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")},...z.map(M=>(0,T.createElement)("button",{key:M,type:"button",className:"bre-provider"+(M===j?" is-open":"")+(M===I?.provider?" is-current":""),disabled:E,"aria-expanded":M===j,onClick:()=>{u(M)}},(0,T.createElement)("span",{className:"bre-option-name"},Wt(o.groups.find(ee=>ee.id===M))),Gn(M===j))),...z.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")},...L.length===0?[(0,T.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:L.map(M=>{let ee=j+"/"+M.id,Y=ee===O;return(0,T.createElement)("button",{key:ee,type:"button",className:"bre-option"+(Y?" is-active":""),disabled:E,"aria-pressed":Y,onClick:()=>{je(j,M.id)}},(0,T.createElement)("span",{className:"bre-option-name"},M.name??M.id),Sa(M,n))}))):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"+(d==="effort"?" is-open":""),disabled:E||!v,"aria-expanded":v?d==="effort":void 0,onClick:()=>{F(d==="effort"?null:"effort")}},(0,T.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"+(v?"":" is-muted")},v?S:n("sliderNoLevels")),v?Gn(d==="effort"):null),d==="effort"&&v?(0,T.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...a.map(M=>(0,T.createElement)("button",{key:M.id,type:"button",className:"bre-option"+(M.id===i?" is-active":""),disabled:E,"aria-pressed":M.id===i,onClick:()=>{_e(M.id)}},(0,T.createElement)("span",{className:"bre-option-name"},M.name),M.id===i?va():null))):null];return(0,T.createElement)("div",{className:"bre-slider-body",ref:k},(0,T.createElement)("div",{className:"bre-card"},...ot),b===null?null:(0,T.createElement)("div",{className:"bre-model-error",role:"status"},b))}var G=require("react"),ko='section[role="group"]',Yn='button[role="menuitemradio"]';function Eo(e){return e.querySelector(ko)!==null}function $n(e){return Array.from(e.querySelectorAll(Yn)).filter(t=>!t.disabled&&t.style.display!=="none")}function La(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function vo(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let c=n.get(d);c!==void 0&&(d.style.display=c,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let a=t.trim().toLowerCase().split(/\s+/).filter(Boolean),i=Array.from(e.querySelectorAll(ko)),s=0;if(a.length===0){for(let d of[...n.keys()])o(d);for(let d of i)s+=d.querySelectorAll(Yn).length;return s}for(let d of i){let c=La(d),m=Array.from(d.querySelectorAll(Yn)),u=0;for(let g of m){let l=(g.getAttribute("title")??"").toLowerCase(),f=(g.textContent??"").toLowerCase(),p=`${c} ${l} ${f}`;a.every(k=>p.includes(k))?(o(g),u+=1):r(g)}u>0?(o(d),s+=u):r(d)}return s}function To({menu:e,t}){let[n,r]=(0,G.useState)(""),[o,a]=(0,G.useState)(0),i=(0,G.useRef)(null),s=(0,G.useRef)(""),d=(0,G.useRef)(new Map),c=(0,G.useCallback)(l=>{s.current=l;let f=vo(e,l,d.current);a(f)},[e]);(0,G.useEffect)(()=>()=>{vo(e,"",d.current)},[e]),(0,G.useEffect)(()=>{let l=new MutationObserver(()=>{s.current.trim().length!==0&&c(s.current)});return l.observe(e,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[e,c]),(0,G.useEffect)(()=>{let l=f=>{if(s.current.trim().length===0)return;let p=f.key;if(!(p==="ArrowDown"||p==="ArrowUp")&&!(p==="Home"||p==="End"||p==="PageUp"||p==="PageDown")||f.target===i.current||f.target instanceof Node&&!e.contains(f.target))return;let x=$n(e);if(x.length===0)return;let v=x.findIndex(b=>b===document.activeElement),E;p==="Home"||p==="PageUp"?E=0:p==="End"||p==="PageDown"?E=x.length-1:p==="ArrowDown"?E=v===-1?0:(v+1)%x.length:E=v===-1?x.length-1:(v-1+x.length)%x.length,f.preventDefault(),f.stopPropagation(),x[E]?.focus()};return e.addEventListener("keydown",l,!0),()=>{e.removeEventListener("keydown",l,!0)}},[e]);let m=l=>{let f=l.key;if(f==="ArrowDown"){l.preventDefault(),l.stopPropagation(),$n(e)[0]?.focus();return}if(n.trim().length>0&&(f==="ArrowUp"||f==="Home"||f==="PageUp"||f==="End"||f==="PageDown")){let p=$n(e);p.length>0&&(l.preventDefault(),l.stopPropagation(),p[f==="ArrowUp"||f==="End"||f==="PageDown"?p.length-1:0]?.focus());return}f==="Escape"&&n.length>0&&(l.preventDefault(),l.stopPropagation(),r(""),c(""))},u=()=>{r(""),c(""),i.current?.focus({preventScroll:!0})},g=o===0&&n.trim().length>0;return(0,G.createElement)("div",{className:"bre-model-search-box"+(g?" has-empty":""),"data-bre-search":"1"},(0,G.createElement)("div",{className:"bre-search-input-wrapper"},(0,G.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,G.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,G.createElement)("input",{ref:i,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:l=>{let f=l.currentTarget.value;r(f),c(f)},onKeyDown:m}),n.length>0?(0,G.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:u},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),g?(0,G.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var Ut=require("react"),Mo=require("react-dom"),So=require("react-dom/client");function be(){return document.body}function ft(e,t,n){let r=(0,So.createRoot)(e);return n?.sync===!0?(0,Mo.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Pe(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var xe=class extends Ut.Component{constructor(){super(...arguments);Hr(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,Ut.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Lo=()=>{(0,Ao.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ro(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:a,directory:i}=e,s,d,c,m,u,g,l=()=>{g?.removeAttribute("data-bre-provider"),g=void 0},f=()=>{let b=n();g!==void 0&&g!==b&&l();let R=m?.store.getSnapshot(),I=R?.current;if(b===void 0||I===null||I===void 0){b===g&&l();return}let U=R?.groups.find(H=>H.id===I.provider),B=U===void 0?I.provider:Wt(U);if(B.trim()===""){b===g&&l();return}b.dataset.breProvider=B,g=b},p=()=>{let b=i();b!==m&&(u?.(),u=void 0,m=b,b!==void 0&&(u=b.store.subscribe(f))),f()},k=()=>{Pe(d),d=void 0},w=b=>{let R=b.querySelector('section[role="group"]'),I=R?.parentElement,U=I!=null&&I.parentElement===b?I:R;if(d===void 0){let B=document.createElement("div");B.dataset.plugin=J,B.dataset.breSearch="1",b.insertBefore(B,U),d=ft(B,(0,ut.createElement)(xe,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,ut.createElement)(To,{menu:b,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==b){b.insertBefore(d.wrapper,U);return}U!==null&&d.wrapper.nextSibling!==U&&b.insertBefore(d.wrapper,U)},x=b=>{if(!a()){Pe(s),s=void 0,b.classList.remove("bre-model-menu-host");for(let H of Array.from(b.children))H.getAttribute("role")==="menuitem"&&(H.style.display="");return}let R=i();if(R===void 0)return;if(s===void 0){let H=document.createElement("div");H.dataset.plugin=J,H.dataset.breSlider="1",b.insertBefore(H,b.firstChild),s=ft(H,(0,ut.createElement)(xe,{fallbackText:r("renderFailed"),children:o(()=>(0,ut.createElement)(xo,{directory:R,t:r,onLayoutChange:Lo}))}),{sync:!0})}else(s.wrapper.parentElement!==b||b.firstChild!==s.wrapper)&&b.insertBefore(s.wrapper,b.firstChild);b.classList.add("bre-model-menu-host");let I=Array.from(b.children).filter(H=>H.getAttribute("role")==="menuitem"),U=s.wrapper;if(Array.from(b.querySelectorAll('[role="menuitemradio"]')).some(H=>!U.contains(H)))s.wrapper.contains(document.activeElement)&&(b.tabIndex=-1,b.focus({preventScroll:!0})),s.wrapper.style.display="none";else{s.wrapper.style.display="";for(let H of I)H.style.display="none"}};return{reconcile:()=>{p();let b=t();if(b===void 0){Pe(s),s=void 0,k(),c=void 0;return}let R=Eo(b);R?w(b):k(),x(b),R!==c&&(c=R,(R||a())&&Lo())},dispose:()=>{u?.(),u=void 0,m=void 0,l(),Pe(s),s=void 0,k(),c=void 0}}}var _=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Oo(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function jt(e,t){if(!_(e))return[];let n=e[t];return!_(n)||!Array.isArray(n.models)?[]:n.models.filter(_)}function Ce(e,t){if(!_(e))return{};let n=e[t];if(!_(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,a=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:a}}var Me=(e,t)=>typeof e[t]=="boolean";function Aa(e,t){if(Array.isArray(e)){for(let n of e)if(_(n)&&n.id===t)return n}}function Ra(e){if(!_(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...ye(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{...ye(e),reasoning:!0,source:"supported_parameters"};if(Me(e,"supports_reasoning"))return{...ye(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(Me(e,"supportsReasoning"))return{...ye(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(Me(e,"can_reason"))return{...ye(e),reasoning:e.can_reason,source:"can_reason"};if(Me(e,"reasoning"))return{...ye(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{...ye(e),reasoning:!0,source:"reasoning_effort"};let o=_(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let a=o.thinking;if(_(a)&&typeof a.supported=="boolean")return{...ye(e),reasoning:a.supported,source:"capabilities.thinking.supported"};let i=o.effort;if(_(i)&&typeof i.supported=="boolean")return{...ye(e),reasoning:i.supported,source:"capabilities.effort.supported"}}return{...ye(e),reasoning:"unknown",source:null}}function ye(e){let t={},n=i=>{if(!Array.isArray(i))return;let s=i.filter(d=>typeof d=="string");return s.length>0?s.map(d=>d.toLowerCase()):[]},r=_(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let i=_(e.modalities)?e.modalities:void 0;o=n(i?.input)}if(o===void 0){let i=e.capabilities,s=d=>Array.isArray(d)&&d.some(c=>typeof c=="string"&&c.toLowerCase()==="vision");if(s(e.supported_features)||s(i))o=["image"];else if(_(i)){let d=[];for(let c of["image_input","video_input","pdf_input","file_input"]){let m=_(i[c])?i[c]:void 0;if(m===void 0||typeof m.supported!="boolean")continue;let u=c.replace(/_input$/,"");m.supported===!0?d.push(u):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(Me(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:Me(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(Me(e,"supports_images")||Me(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let a=e.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let s=(_(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 m=(_(e.limit)?e.limit:void 0)?.context;typeof m=="number"&&Number.isFinite(m)&&m>0&&(t.contextLength=m)}}}return t}function Ho(e,t){let n=Aa(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:Ra(n)}}function ve(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 zt(e){if(!_(e))return;let t=e.providers;return _(t)?t:void 0}function _o(e,t){for(let n of[e?.user,e?.base]){let r=zt(n)?.[t];if(_(r)&&r.models!==void 0)return r.models}}function Jn(e){return zt(e?.user)}function Gt(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 Vt(e,t){let r=e.find(a=>a.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(a=>typeof a=="string");return o.length>0?o:void 0}function $t(e,t){let r=e.find(o=>o.id===t)?.compat;if(_(r))return{...r}}function Yt(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function Xn(e,t){let r=e.find(o=>o.id===t)?.[Ge];return typeof r=="string"&&r.length>0?r:void 0}async function Oa(e,t){try{let n=await fetch(`${_r}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?Ho(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function Jt(e,t=()=>ne(e),n,r,o,a){return{async suggest(i,s,d,c){let m=ve((await t()).namespace),u=Ce(m,i),g={api:u.api??c?.api,baseURL:u.baseURL??c?.baseURL,displayName:d??u.displayName},l=m[i]===void 0?void 0:await Oa(i,s),f=he(s,g,l);return f.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:f.efforts,...f.compat===void 0?{}:{compat:f.compat},...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(i,s,d){if(a?.()===!0){n?.(i,s,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(i,s,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.clearCompatKeys===void 0?{}:{clearCompatKeys:d.clearCompatKeys},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(i,s){o?.(i,s)},stageEfforts(i,s,d,c,m,u){n?.(i,s,d,c,m,u)},async writeEfforts(i,s,d,c,m,u,g){if(r!==void 0)return r(i,s,{efforts:d,...c===void 0?{}:{compat:c},...m===void 0?{}:{input:m},...u===void 0?{}:{clearCompatKeys:u},...g===void 0?{}:{defaultEffort:g}}),{ok:!0,staged:!0};let f=(await ct(e,i,[{modelId:s,efforts:d,...c===void 0?{}:{compat:c},...m===void 0?{}:{input:m},...u===void 0?{}:{clearCompatKeys:u},...g===void 0?{}:{defaultEffort:g}}],t))[0]??{ok:!1,error:"no-result"};return f.ok?{ok:!0}:f.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:f.error??"conflict"}}}}async function ct(e,t,n,r=()=>ne(e),o){if(n.length===0)return[];let a=!1;for(let i=0;i<3;i++)try{let s=i===0?await r():await ne(e,{fresh:!0});if(s.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=_o(s.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(_))return n.map(()=>({ok:!1,error:"invalid-models"}));let m=d.map(l=>l),u=[];for(let l of n){let f=m.findIndex(p=>p.id===l.modelId);if(f<0){u.push(l.modelId);continue}m[f]=Ha(m[f],l,a?void 0:l.compat)}if(u.length>0)return n.map(l=>u.includes(l.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let g=await e.settings.mutate(re,[{op:"set",path:["providers",t,"models"],value:m}],s.namespace.revision);if(!g.ok){if(i===0&&g.error.code==="settings/conflict")continue;let l=g.error.code==="settings/rejected"&&Oo(g.error.message);if(!a&&l&&n.some(f=>f.compat!==void 0)){a=!0;continue}return n.map(()=>({ok:!1,error:g.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 Ha(e,t,n){let r={...e},o=t.efforts!=="keep",a=t.efforts==="keep"?void 0:t.efforts;if(o)if(a===void 0)delete r.reasoningEfforts,r[ge]=!0;else if(delete r[ge],delete r[ze],a===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...a};let i=_(e.compat)?e.compat:{},s={...i,...n??{}};for(let d of t.clearCompatKeys??[])delete s[d];(Object.keys(i).length>0||Object.keys(s).length>0)&&(Object.keys(s).length===0?delete r.compat:r.compat=s)}return t.input!==void 0&&(t.input===null?(delete r.input,r[Ee]=!0):(delete r[Ee],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[Ge]:r[Ge]=t.defaultEffort),r}function Qn(e,t){for(let n of[e?.user,e?.base]){let r=zt(n)?.[t];if(!_(r))continue;let o=r.headers;if(o===void 0)continue;if(!_(o))return;let a={};for(let[i,s]of Object.entries(o))typeof s=="string"&&(a[i]=s);return a}}async function Zn(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};for(let r=0;r<2;r+=1)try{let o=r===0?await ne(e):await ne(e,{fresh:!0});if(o.namespace===void 0)return{ok:!1,error:"no-namespace"};if(o.writable!==!0)return{ok:!1,error:"read-only"};if(!_a(o.namespace,t))return{ok:!1,error:"no-route"};let a=await e.settings.mutate(re,[{op:"set",path:["providers",t,"headers"],value:{...n}}],o.namespace.revision);if(!a.ok){if(r===0&&a.error.code==="settings/conflict")continue;return{ok:!1,error:a.error.message}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}return{ok:!1,error:"conflict"}}function _a(e,t){for(let n of[e?.user,e?.base]){let r=zt(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:Na(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(a=>a.ns===re),writable:r.value.writable}:{namespace:void 0,writable:!1}}function Na(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:re,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}function No(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 c=new Map;for(let[m,u]of Object.entries(ve(d.namespace))){let g=Array.isArray(u.models)?u.models:[];for(let l of g){if(typeof l!="object"||l===null||Array.isArray(l))continue;let f=l.id,p=l[Ge];typeof f=="string"&&typeof p=="string"&&p.length>0&&c.set(`${m}/${f}`,p)}}s===r?t=c:n=void 0}).catch(()=>{s===r&&(n=void 0)})),n};return{of:async(s,d)=>(await o(),t?.get(`${s}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function Ia(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Io(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,a=n.modalities!==!1;if(!_(e))return;let i={};for(let s of Object.keys(e)){if(!t(s))continue;let d=e[s],c=_(d)&&Array.isArray(d.models)?d.models:void 0;if(c===void 0||c.length===0||!c.every(_))continue;let m=c,u=[],g=!1;for(let l of m){let f=l.reasoningEfforts!==void 0||l[ge]===!0,p=Ia(l)||l[Ee]===!0;if((f||!o)&&(p||!a)){let R=Da(l,e,s);R!==void 0?(g=!0,u.push(R)):u.push(l);continue}let k=typeof l.id=="string"?l.id:"";if(k.length===0){u.push(l);continue}let w=Ce(e,s),x=typeof l.name=="string"?l.name:void 0,v=he(k,{...w,displayName:x??w.displayName});if(v.efforts===void 0){u.push(l);continue}let E={...l},b=!1;if(!f&&o&&(b=!0,E.reasoningEfforts=v.efforts,E[ze]=r,v.compat!==void 0)){let R=_(l.compat)?l.compat:{};E.compat={...R,...v.compat}}if(!p&&a&&v.input!==void 0&&(b=!0,E.input=[...v.input]),!b){u.push(l);continue}g=!0,u.push(E)}g&&(i[s]={models:u})}return Object.keys(i).length===0?void 0:{providers:i}}function Da(e,t,n){if(!_(e.reasoningEfforts)||e[ge]===!0)return;let r=e.compat,o=_(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&Bn(Ce(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function Do(e){let t,n=()=>(t??(t=(async()=>{let o={autofill:!0,modalityAutofill:!0};try{let a=await fetch(Ir,{method:"GET"});if(!a.ok)return o;let i=await a.json();return i?.ok!==!0?o:{autofill:i.data?.autofill!==!1,modalityAutofill:i.data?.modalityAutofill!==!1}}catch{return o}})()),t),r=async()=>{try{let o=await n();if(!o.autofill)return;let a=await ne(e.api,{fresh:!0}),i=a.namespace;if(i===void 0||a.writable!==!0)return;let s=Jn(i);if(s===void 0)return;let d=Io(s,()=>!0,{modalities:o.modalityAutofill},i.revision);if(d===void 0)return;let c=d.providers,m=Object.entries(c).map(([g,l])=>({op:"set",path:["providers",g,"models"],value:l.models})),u=await e.api.settings.mutate(re,m,i.revision);u.ok||console.error(`[bre] idle autofill refused: ${u.error.message}`)}catch(o){console.error(`[bre] idle autofill failed: ${o instanceof Error?o.message:String(o)}`)}};return{run:()=>{r()}}}var vr=require("react"),cs=require("react-dom/client");var q=require("react");var Fe=uo;function Ke(e){let t={};for(let n of Fe){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 Je(e){let t=!1,n=!1,r={};for(let o of Fe){let a=e[o];if(!a.on)continue;if(o==="off"){t=!0;let s=a.wire.trim();r.off=s.length===0?null:s;continue}n=!0;let i=a.wire.trim();r[o]=i.length===0?o:i}return n?r:t?!1:void 0}function pt(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=Fe.filter(o=>e[o]!==void 0),r=Fe.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function Po(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 er="bre:auto-effort",Co=Promise.resolve();function Fo(e){Co=Co.then(e,e).then(()=>{},()=>{})}function Ko(e,t=document){t.dispatchEvent(new CustomEvent(er,{detail:{route:e}}))}function qo(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(er,n),()=>{t.removeEventListener(er,n)}}var y=require("react/jsx-runtime"),Bo=new Intl.NumberFormat("en-US");function qe(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function tr(e){return e.declared?e.image?["text","image"]:["text"]:null}var Pa={"openai-completions":["thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"],"openai-responses":["supportsMaxOutputTokens"]};function Ca(e){return Pa[(e??"").toLowerCase()]??[]}function Wo(e,t){let n=Ca(e);if(n.length===0)return[];let r=new Set(t===void 0?[]:Object.keys(t));return n.filter(o=>!r.has(o))}function Fa(e,t){if(t!==void 0)return{clearCompatKeys:Wo(e,t)};let n=Wo(e,void 0);return n.length===0?{}:{clearCompatKeys:n}}function Xt(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function nr(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function Uo(e){let t={},n=e?.thinkingTokenBudgetField??"";n!==""&&(t.thinkingTokenBudgetField=n);let o=(e?.vllmPriority===void 0?"":String(e.vllmPriority)).trim();o!==""&&/^-?\d+$/.test(o)&&(t.vllmPriority=Number.parseInt(o,10));let a=e?.supportsMaxOutputTokens===void 0?"":String(e.supportsMaxOutputTokens);return a==="true"?t.supportsMaxOutputTokens=!0:a==="false"&&(t.supportsMaxOutputTokens=!1),Object.keys(t).length===0?void 0:t}function rr(e){let t=e.appliedCompat,n=e.manualCompat,r=t!==void 0?{...t,...n??{}}:n;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&r?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(r={...r??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...r===void 0?{}:{compat:r},...e.input===void 0?{}:{input:e.input},...Fa(e.routeApi,r),...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function Qt({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:a,input:i,compat:s,defaultEffort:d,index:c,staged:m=!1,officialInputTypes:u=!1,api:g,readOnly:l,t:f}){let[p,k]=(0,q.useState)(()=>Ke(a)),[w,x]=(0,q.useState)(()=>qe(i)),[v,E]=(0,q.useState)(()=>a!==!1),[b,R]=(0,q.useState)(()=>d??""),[I,U]=(0,q.useState)(!1),[B,H]=(0,q.useState)(void 0),[te,S]=(0,q.useState)(void 0),[D,P]=(0,q.useState)(""),[C,W]=(0,q.useState)("low"),z=(0,q.useRef)(void 0),[j,L]=(0,q.useState)(()=>s?.thinkingTokenBudgetField??""),[O,F]=(0,q.useState)(()=>s?.vllmPriority===void 0?"":String(s.vllmPriority)),[Z,fe]=(0,q.useState)(()=>s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),je=(0,q.useRef)(s),[_e,ot]=(0,q.useState)(void 0),[M,ee]=(0,q.useState)(void 0),[Y,ue]=(0,q.useState)(void 0),oe=(0,q.useRef)(!1),St=(0,q.useRef)(a),Tn=(0,q.useRef)(i),it=(0,q.useRef)(d),Lt=(0,q.useRef)(void 0);(0,q.useEffect)(()=>qo(h=>{if(h!==e)return;let K=Lt.current;K!==void 0&&Fo(K)}),[e]),(0,q.useEffect)(()=>{pt(St.current,a)||(St.current=a,oe.current||(k(Ke(a)),E(a!==!1))),Tn.current!==i&&(Tn.current=i,oe.current||x(qe(i))),it.current!==d&&(it.current=d,oe.current||R(d??"")),JSON.stringify(je.current??null)!==JSON.stringify(s??null)&&(je.current=s,oe.current||(L(s?.thinkingTokenBudgetField??""),F(s?.vllmPriority===void 0?"":String(s.vllmPriority)),fe(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens))))},[a,i,s,d]);let Mr=()=>{let h={};j!==""&&(h.thinkingTokenBudgetField=j);let K=O.trim();return K!==""&&/^-?\d+$/.test(K)&&(h.vllmPriority=Number.parseInt(K,10)),Z==="true"?h.supportsMaxOutputTokens=!0:Z==="false"&&(h.supportsMaxOutputTokens=!1),Object.keys(h).length===0?void 0:h},Ms=()=>{let h=Mr();return JSON.stringify(h??null)!==JSON.stringify({...s?.thinkingTokenBudgetField===void 0?{}:{thinkingTokenBudgetField:s.thinkingTokenBudgetField},...s?.vllmPriority===void 0?{}:{vllmPriority:s.vllmPriority},...s?.supportsMaxOutputTokens===void 0?{}:{supportsMaxOutputTokens:s.supportsMaxOutputTokens}})},At=Fe.filter(h=>p[h].on),Ss=b===(d??"")?void 0:b===""?null:b,Ls=v?Je(p):!1,Mn=!pt(Ls,a)||!Xt(w,i)||Ms()||Ss!==void 0,Sn=(0,q.useRef)(void 0),ce=()=>{oe.current=!0,S(void 0),P(""),W("low"),ot(void 0)},pe=(h,K,Q,me=v)=>{let Ne=nr(me,Je(h),a),Ks=Xt(K,i)?void 0:tr(K),Rr=rr({efforts:Ne,input:Ks,defaultEffort:Q===(d??"")?void 0:Q===""?null:Q,manualCompat:Mr(),appliedCompat:z.current,routeApi:t,initialCompat:s}),Or=JSON.stringify(Rr);Sn.current!==Or&&(Sn.current=Or,g.commit(e,r,Rr))},As=(h,K)=>{ce();let Q=!K&&b===h?"":b;Q!==b&&R(Q),k(me=>{let Ne={...me,[h]:{...me[h],on:K}};return K&&h!=="off"&&Ne[h].wire.trim().length===0&&(Ne[h]={...Ne[h],wire:h}),pe(Ne,w,Q),Ne}),H(void 0)},Rs=h=>{ce(),E(h);let K=h?b:"";K!==b&&R(K),pe(p,w,K,h),H(void 0)},Os=(h,K)=>{ce(),k(Q=>{let me={...Q,[h]:{...Q[h],wire:K}};return pe(me,w,b),me}),H(void 0)},Hs=h=>{ce();let K={declared:!0,image:h};x(K),pe(p,K,b),H(void 0)},_s=()=>{ce();let h={declared:!1,image:!1};x(h),pe(p,h,b),H(void 0)},Ns=h=>{ce(),L(h),pe(p,w,b),H(void 0)},Is=h=>{ce(),F(h),pe(p,w,b),H(void 0)},Ds=h=>{ce(),fe(h),pe(p,w,b),H(void 0)},Sr=h=>{ce(),R(h),pe(p,w,h),H(void 0)},Ps=h=>{ce();let K=h.efforts!==!1;E(K);let Q=Ke(h.efforts);k(Q);let me=h.input===void 0?w:qe(h.input);h.input!==void 0&&x(me),S(h.efforts),P(h.source),W(h.confidence),z.current=h.compat,ot(h.inputSource),ee(h.contextWindow),ue(h.maxTokens),H({kind:"info",text:f("appliedHint",{source:h.source,confidence:f("confidence_"+h.confidence)})}),pe(Q,me,b,K)},Lr=async()=>{if(!(l||I)){U(!0),H(void 0);try{let h=m?await g.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await g.suggest(e,r,o);if(!h.ok){H({kind:"error",text:h.error==="no-suggestion"?f("noSuggestion"):h.error});return}Ps(h.suggestion)}catch(h){H({kind:"error",text:f("writeError",{message:String(h)})})}finally{U(!1)}}};(0,q.useEffect)(()=>{Lt.current=Lr});let Cs=()=>{oe.current=!1,g.withdraw(e,r),k(Ke(a)),E(a!==!1),x(qe(i)),R(d??""),L(s?.thinkingTokenBudgetField??""),F(s?.vllmPriority===void 0?"":String(s.vllmPriority)),fe(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),S(void 0),P(""),W("low"),z.current=void 0,ot(void 0),ee(void 0),ue(void 0),H(void 0),Sn.current=void 0},Fs=z.current?.thinkingFormat??he(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,Ar=Po(a,Fs),ie=l||I;return(0,y.jsxs)("div",{className:"bre-effort-editor","data-plugin":J,children:[(0,y.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,y.jsx)("input",{type:"checkbox",checked:v,disabled:ie,"aria-label":f("thinkingMode")+" "+String(c+1),onChange:h=>{Rs(h.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("thinkingMode")}),v?null:(0,y.jsx)("span",{className:"bre-effort-note",children:f("thinkingModeOff")})]}),v?(0,y.jsxs)("div",{className:"bre-effort-card",children:[(0,y.jsxs)("div",{className:"bre-effort-head",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("reasoningEffort")}),(0,y.jsx)("button",{type:"button",className:"bre-link-button",disabled:ie,onClick:()=>{Lr()},children:f("autoAdapt")})]}),(0,y.jsx)("div",{className:"bre-effort-grid",children:Fe.map(h=>{let K=p[h];return(0,y.jsxs)("label",{className:"bre-effort-row",children:[(0,y.jsx)("input",{type:"checkbox",checked:K.on,disabled:ie,"aria-label":f("level_"+h)+" "+String(c+1),onChange:Q=>{As(h,Q.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("level_"+h)}),K.on?(0,y.jsx)("input",{type:"text",className:"bre-effort-wire",value:K.wire,disabled:ie,placeholder:f("wirePlaceholder"),"aria-label":f("level_"+h)+" "+f("wireValue"),onChange:Q=>{Os(h,Q.target.value)}}):(0,y.jsx)("span",{className:"bre-effort-empty"})]},h)})}),At.length>0?(0,y.jsxs)("div",{className:"bre-modality",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("defaultEffortLabel")}),(0,y.jsxs)("label",{className:"bre-modality-row",children:[(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("defaultEffortLabel")+" "+String(c+1),value:b,onChange:h=>{Sr(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("defaultEffortUnset")}),(b!==""&&!At.includes(b)?[...At,b]:At).map(h=>(0,y.jsx)("option",{value:h,children:f("level_"+h)},h))]}),b!==""?(0,y.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:()=>{Sr("")},children:f("clearDefaultEffort")}):null]}),(0,y.jsx)("p",{className:"bre-modality-note",children:f("defaultEffortHint")})]}):null,u?null:(0,y.jsxs)("div",{className:"bre-modality",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("inputModality")}),(0,y.jsxs)("label",{className:"bre-modality-row",children:[(0,y.jsx)("input",{type:"checkbox",checked:w.declared&&w.image,disabled:ie,"aria-label":f("modalityImage")+" "+String(c+1),onChange:h=>{Hs(h.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("modalityImage")}),w.declared?(0,y.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:_s,children:f("clearDeclaration")}):null]}),w.declared?null:(0,y.jsx)("p",{className:"bre-modality-note",children:f("modalityInherit")})]}),(t??"").toLowerCase()==="openai-completions"?(0,y.jsxs)("div",{className:"bre-compat",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("compatTitle")}),(0,y.jsxs)("label",{className:"bre-compat-row",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("budgetFieldLabel")}),(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("budgetFieldLabel")+" "+String(c+1),value:j,onChange:h=>{Ns(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("budgetUnset")}),(0,y.jsx)("option",{value:"thinking_token_budget",children:"thinking_token_budget"}),(0,y.jsx)("option",{value:"thinking_budget",children:"thinking_budget"}),(0,y.jsx)("option",{value:"thinking_budget_tokens",children:"thinking_budget_tokens"})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("budgetFieldHint")})]}),(0,y.jsxs)("div",{className:"bre-compat-row",children:[(0,y.jsxs)("label",{className:"bre-compat-field",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("priorityLabel")}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-text-input",value:O,disabled:ie,placeholder:f("priorityPlaceholder"),"aria-label":f("priorityLabel")+" "+String(c+1),onChange:h=>{Is(h.target.value)}})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("priorityHint")}),O.trim()!==""&&!/^-?\d+$/.test(O.trim())?(0,y.jsx)("p",{className:"bre-effort-note bre-error",children:f("priorityInvalid")}):null]}),s?.supportsThinkingTokenBudget===!0&&s?.thinkingTokenBudgetField===void 0?(0,y.jsx)("p",{className:"bre-effort-note",children:f("aliasMigrated")}):null]}):null,(t??"").toLowerCase()==="openai-responses"?(0,y.jsxs)("div",{className:"bre-compat",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("compatTitle")}),(0,y.jsxs)("label",{className:"bre-compat-row",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("maxOutputLabel")}),(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("maxOutputLabel")+" "+String(c+1),value:Z,onChange:h=>{Ds(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("maxOutputUnset")}),(0,y.jsx)("option",{value:"true",children:f("maxOutputOn")}),(0,y.jsx)("option",{value:"false",children:f("maxOutputOff")})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("maxOutputHint")})]})]}):null,m?(0,y.jsx)("p",{className:"bre-effort-note",children:f("stagedHint")}):null,a===!1?(0,y.jsx)("p",{className:"bre-effort-note",children:f("reasoningDisabled")}):null,Ar===void 0?null:(0,y.jsx)("p",{className:"bre-effort-note",children:f(Ar==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),Je(p)===void 0&&a!==void 0?(0,y.jsx)("p",{className:"bre-effort-note",children:f("bareHint")}):null,te!==void 0?(0,y.jsxs)("div",{className:"bre-suggestion",children:[(0,y.jsx)("p",{className:"bre-effort-note",children:f("appliedHint",{source:D,confidence:f("confidence_"+C)})}),_e===void 0?null:(0,y.jsx)("p",{className:"bre-effort-note",children:f(_e==="endpoint"?"inputHintEndpoint":_e==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),M===void 0&&Y===void 0?null:(0,y.jsxs)("div",{className:"bre-reference",children:[(0,y.jsx)("span",{className:"bre-reference-title",children:f("referenceTitle")}),(0,y.jsxs)("span",{className:"bre-reference-values",children:[M===void 0?null:(0,y.jsxs)("span",{children:[f("contextWindowLabel")," ",(0,y.jsx)("b",{children:Bo.format(M)})]}),Y===void 0?null:(0,y.jsxs)("span",{children:[f("maxTokensLabel")," ",(0,y.jsx)("b",{children:Bo.format(Y)})]})]})]})]}):null,B===void 0?null:(0,y.jsx)("p",{className:"bre-effort-message bre-"+B.kind,role:B.kind==="error"?"alert":"status",children:B.text}),Mn?(0,y.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:f("pendingSave")}):null,Mn?(0,y.jsx)("p",{className:"bre-effort-note",children:f("pendingHint")}):null,(0,y.jsx)("div",{className:"bre-effort-actions",children:(0,y.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:ie||!Mn,onClick:Cs,children:f("reset")})})]}):null]})}var Be="data-bre-auto-effort",Ka='[class*="modelCatalog"]',qa='[class*="modelListHead"]',Ba='button[class*="linkButton"]',Wa="bre-link-button bre-auto-effort";function Zt(e,t,n){let r=new Map;for(let i of t)i.route.length!==0&&i.catalogue.isConnected&&r.set(i.catalogue,i.route);let o=n.t("autoAdaptAll"),a=n.t("autoAdaptAllHint");for(let[i,s]of r){let d=i.querySelector(qa)??i,c=d.querySelector(`[${Be}]`)??ja(n),m=Ua(d);m!==null?m.nextElementSibling!==c&&m.after(c):d.lastElementChild!==c&&d.append(c),za(c,s,o,a)}for(let i of Array.from(e.querySelectorAll(`[${Be}]`))){let s=i.closest(Ka);(s===null||!r.has(s))&&i.remove()}}function jo(){for(let e of Array.from(document.querySelectorAll(`[${Be}]`)))e.remove()}function Ua(e){let t=Array.from(e.querySelectorAll(Ba));return t.length===0?null:t[t.length-1]}function ja(e){let t=document.createElement("button");return t.className=Wa,t.setAttribute("type","button"),t.setAttribute(Be,""),t.addEventListener("click",()=>{let n=t.getAttribute(Be)??"";n.length!==0&&(Ko(n),e.onRequest?.(n))}),t}function za(e,t,n,r){e.getAttribute(Be)!==t&&e.setAttribute(Be,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==r&&e.setAttribute("title",r)}function Qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var or="__breLedgerDocument";function $o(){let e=globalThis;return e[or]??(e[or]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var en="bre:held-writes:v1";function ir(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function we(e){let t=ir();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(en);return}let n={document:$o(),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(en,JSON.stringify(n))}catch{}}function zo(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,a]=r;if(typeof o!="string"||!Array.isArray(a))return;let i=[];for(let s of a){if(!Array.isArray(s)||s.length!==2)return;let[d,c]=s;if(typeof d!="string"||!_(c)||t!==void 0&&!t(c))return;i.push([d,c])}n.push([o,i])}return n}function Ga(e){let t=ir();if(t!==void 0)try{let n=t.getItem(en);if(n===null)return;let r=JSON.parse(n);if(r.document!==$o())return;let o=zo(r.pending),a=zo(r.queued,nd);if(o===void 0||a===void 0)return;let i=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 a)i.includes(s)&&(e.queued.set(s,new Map(d)),e.committing.add(s))}catch{}}function Yo(e,t){(async()=>{try{await sr(t,e),await ar(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function Jo(e,t){(async()=>{try{await sr(t,e,!0),await ar(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{ir()?.removeItem(en)}catch{}}})()}function Xo(){let e={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};return Ga(e),e}async function Va(e,t){if(!t.flushing){t.flushing=!0;try{let n=await sr(e,t),r=await ar(e,t);n||r?Go(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Go(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 Go(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function $a(e){return e.queued.size>0||e.pending.size>0}function tn(e,t,n,r,o,a,i){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},...a===void 0?{}:{input:a},...i===void 0?{}:{defaultEffort:i}}))}finally{we(e)}}function Qo(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),we(e)}function Ya(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),we(e))}function Ja(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),we(e))}function Xa(e,t,n){Ya(e,t,n),Ja(e,t,n)}function Qa(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),we(e)}function Za(e,t,n){if(t===void 0)return null;let a=t[ge]!==!0&&t.reasoningEfforts!==void 0&&typeof t[ze]=="number"||t[ge]!==!0&&n?.efforts!==void 0&&ed(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[ge]===!0||e.efforts==="keep",s=t[Ee]!==!0&&n?.input!==void 0&&td(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[Ee]===!0,d=a?"keep":e.efforts,c=s?void 0:e.input,m=e.defaultEffort;return d==="keep"&&c===void 0&&m===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...c===void 0?{}:{input:c},...m===void 0?{}:{defaultEffort:m}}}function ed(e,t){if(e===t)return!0;if(!_(e)||!_(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 td(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 nd(e){if(!_(e))return!1;let t=e.efforts;if(t!==!1&&t!=="keep"&&!_(t))return!1;let n=e.clearCompatKeys;return n===void 0||Array.isArray(n)&&n.every(r=>typeof r=="string")}async function rd(e,t,n,r,o=!1){let a=await e.describeNamespace(),i=ve(a.namespace),s=[];for(let[u,g]of[...r]){let l=jt(i,n).find(x=>x.id===u);if(l===void 0||t.pending.get(n)?.get(u)!==g)continue;let f=Ce(i,n),p=typeof l.name=="string"?l.name:void 0,k=he(u,p===void 0?f:{...f,displayName:p}),w=Za(g,l,{...k.efforts===void 0?{}:{efforts:k.efforts},...k.input===void 0?{}:{input:k.input}});if(w===null){tn(t,n,u,void 0);continue}s.push({modelId:u,efforts:w.efforts,...w.compat===void 0?{}:{compat:w.compat},...w.input===void 0?{}:{input:w.input},...w.defaultEffort===void 0?{}:{defaultEffort:w.defaultEffort}})}if(s.length===0)return!1;let d=!1,c=await ct(e.api,n,s,()=>d?e.describeNamespace():(d=!0,Promise.resolve(a)),o?void 0:ti),m=!1;return s.forEach((u,g)=>{let l=c[g];if(l?.aborted!==!0){if(l?.ok===!0||l?.modelNotFound===!0){tn(t,n,u.modelId,void 0);return}m=!0,console.error(`[bre] staged flush write failed for "${n}"/"${u.modelId}": ${l?.error??"unknown"}`)}}),m}async function sr(e,t,n=!1){for(let i of[...t.committing])t.queued.has(i)||t.committing.delete(i);if(![...t.queued.keys()].some(i=>t.committing.has(i)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return we(t),!1;let a=!1;for(let[i,s]of[...t.queued]){if(!t.committing.has(i)&&!t.signalsUnavailable)continue;let c=[...s].map(([g,l])=>({modelId:g,efforts:l.efforts,...l.compat===void 0?{}:{compat:l.compat},...l.input===void 0?{}:{input:l.input},...l.clearCompatKeys===void 0?{}:{clearCompatKeys:l.clearCompatKeys},...l.defaultEffort===void 0?{}:{defaultEffort:l.defaultEffort}})),m=await ct(e.api,i,c,void 0,n?void 0:ti),u=!1;c.forEach((g,l)=>{let f=m[l];if(f?.aborted===!0){u=!0;return}if(f?.ok===!0||f?.modelNotFound===!0){s.delete(g.modelId);return}console.error(`[bre] held write failed for "${i}"/"${g.modelId}": ${f?.error??"unknown"}`)}),s.size===0?(t.queued.delete(i),t.committing.delete(i)):u||(a=!0)}return we(t),a}async function ar(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=ve(r.namespace),a=!1;for(let[i,s]of[...t.pending]){if(s.size===0){t.pending.delete(i);continue}Qe(o,i)&&await rd(e,t,i,s,n)&&(a=!0)}return we(t),a}function Se(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 Zo(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function od(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=Zo(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(a=>a.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function id(e){return e.querySelector('[class*="modelInputTypes"]')!==null}function sd(e,t,n){let r=[],o=new Set;for(let a of e){if(o.has(a.card))continue;o.add(a.card);let i=Xe(a.card,t,n);if(i===void 0)continue;let s=a.card.querySelector('[class*="modelCatalog"]');s!==null&&r.push({catalogue:s,route:i.route})}return r}async function ad(e,t,n){if(!(n.length===0||e.adapting.has(n))){e.adapting.add(n);try{let r,o=()=>r??(r=t.describeNamespace()),a=await o(),i=ve(a.namespace);if(a.writable!==!0||!Qe(i,n))return;let s=jt(i,n);if(s.length===0)return;let d=i[n]??{},c=typeof d.api=="string"?d.api:void 0,m=new Set;for(let g of e.mounted.values())g.props.route===n&&m.add(g.props.modelId);let u=Jt(t.api,o,void 0,(g,l,f)=>{Qo(e,g,l,f)});for(let g of s){let l=typeof g.id=="string"?g.id:"";if(l.length===0||m.has(l))continue;let f=Gt(s,l),p=Vt(s,l),k=$t(s,l),w=await u.suggest(n,l,Yt(s,l));if(!w.ok)continue;let x=w.suggestion,v=x.efforts!==!1,E=x.input===void 0?qe(p):qe(x.input);u.commit(n,l,rr({efforts:nr(v,Je(Ke(x.efforts)),f),input:Xt(E,p)?void 0:tr(E),manualCompat:Uo(k),appliedCompat:x.compat,routeApi:c,initialCompat:k}))}}catch(r){console.warn("[bre] provider-wide adapt failed:",r)}finally{e.adapting.delete(n)}}}function dd(e){return e.querySelector(`[data-plugin="${J}"]`)!==null}function ld(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&&pt(e.efforts,t.efforts)&&ud(e.input,t.input)&&fd(e.compat,t.compat)}function fd(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 ud(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 cd(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 Xe(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&Qe(t,r))return{route:r,staged:!1};if(cd(e,n.routeId)){let i=Se(e,n.routeId);return i.length>0&&!Qe(t,i)?{route:i,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let a=Object.entries(t).find(([,i])=>i.displayName===o);if(a!==void 0)return{route:a[0],staged:!1};if(Qe(t,o))return{route:o,staged:!1}}function pd(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=(u,g)=>(u.textContent??"").trim()===g,a=n.querySelector('[class*="primaryButton"]'),i=n.querySelector('[class*="secondaryButton"]');if(a!==null&&i!==null)return{submit:a,cancel:i};let s=[...r].reverse().find(u=>t.apply.some(g=>o(u,g))),d=[...r].reverse().find(u=>t.cancel.some(g=>o(u,g)));if(s!==void 0&&d!==void 0)return{submit:s,cancel:d};let c=r[r.length-1],m=r[r.length-2];if(!(c===void 0||m===void 0))return{submit:c,cancel:m}}function Vo(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}function ei(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function ti(){return ei(be())!==void 0}function ni(e,t,n){if(!e.isConnected)return;let r=t.labels(),o=ei(e)!==void 0,a=Array.from(e.querySelectorAll("button[aria-label]")).some(s=>r.capacity.some(d=>(s.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(Zt(e,[],{t:t.t}),n.mounted.size>0){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear()}let s=n.editing;n.editing=!1,(s!==!1||$a(n)&&Date.now()>=n.nextFlushAt)&&Va(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!a){Zt(e,[],{t:t.t});return}n.describePromise??(n.describePromise=t.describeNamespace());let i=s=>{if(!e.isConnected)return;let d=s.namespace,c=ve(d),m=[];for(let u of r.capacity){let g=Array.from(e.querySelectorAll("button[aria-label]")).filter(l=>(l.getAttribute("aria-label")??"").startsWith(u));for(let l of g){let f=Zo(l);if(f===void 0)continue;let p=l.closest('[class*="modelEntry"]')??f,k=Se(p,r.modelId);k.length!==0&&m.push({container:od(l),row:p,modelId:k,card:f})}}Zt(e,sd(m,c,r),{t:t.t,onRequest:u=>{ad(n,t,u)}});for(let[u,g]of n.mounted)m.some(l=>l.container===u)||(g.editor.unmount(),n.mounted.delete(u));if(n.pending.size>0){let u=new Map;for(let l of m){let f=Xe(l.card,c,r);if(f===void 0)continue;let p=u.get(f.route);p===void 0&&u.set(f.route,p=new Set),p.add(l.modelId)}let g=new Map;for(let[l,f]of n.pending){if(!Qe(c,l))continue;let p=u.get(l),k=[...f.keys()].filter(w=>!p?.has(w));k.length>0&&g.set(l,new Set(k))}for(let[l,f]of g){let p=n.missedScans.get(l);if(p!==void 0)for(let k of f)p.has(k)&&(tn(n,l,k,void 0),p.delete(k))}n.missedScans=g}m.forEach((u,g)=>{let l=u.container;if(l===void 0)return;let f=Xe(u.card,c,r);if(f===void 0)return;let{route:p,staged:k}=f,w=c[p]??{},x=jt(c,p),v=new Set(x.map(O=>O.id)),E=k||!v.has(u.modelId),b=E?n.pending.get(p)?.get(u.modelId)?.efforts:void 0,R=E?b==="keep"?void 0:b:Gt(x,u.modelId),I=E?n.pending.get(p)?.get(u.modelId)?.input:Vt(x,u.modelId),U=E?n.pending.get(p)?.get(u.modelId)?.compat:$t(x,u.modelId),B=E?n.pending.get(p)?.get(u.modelId)?.defaultEffort??void 0:Xn(x,u.modelId),H=E?Se(u.row,r.modelName):"",te=E?H.length>0?H:void 0:Yt(x,u.modelId),S=k?Se(u.card,r.apiProtocol):"",D=k?Se(u.card,r.baseUrl):"",P=pd(u.card,r);P===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Vo(P.submit,n.submitWired,()=>{let O=Xe(u.card,c,r)?.route??p;n.committing.add(O),we(n)}),Vo(P.cancel,n.cancelWired,()=>{let O=Xe(u.card,c,r)?.route??p;Qa(n,O)}));let C=k&&S.length>0?S:typeof w.api=="string"?w.api:void 0,W=k&&D.length>0?D:typeof w.baseURL=="string"?w.baseURL:void 0,z={route:p,routeDisplayName:k?p:typeof w.displayName=="string"?w.displayName:p,...C===void 0?{}:{routeApi:C},...W===void 0?{}:{routeBaseURL:W},modelId:u.modelId,...te===void 0?{}:{modelName:te},...R===void 0?{}:{efforts:R},...I===void 0?{}:{input:I},...U===void 0?{}:{compat:U},...B===void 0?{}:{defaultEffort:B},index:g,staged:E,officialInputTypes:id(l),api:Jt(t.api,void 0,(O,F,Z,fe,je,_e)=>{tn(n,O,F,Z,fe,je,_e)},(O,F,Z)=>{Qo(n,O,F,Z)},O=>{Xa(n,O,u.modelId)},()=>(Xe(u.card,c,r)?.staged??k)||!v.has(u.modelId)),readOnly:s.writable!==!0,t:t.t},j=n.mounted.get(l);if(j!==void 0){ld(j.props,z)||(j.props=z,j.editor.render(z));return}if(dd(l))return;let L=t.mount(l,z);n.mounted.set(l,{editor:L,props:z})})};n.describePromise.then(i,()=>{n.describePromise=void 0})}function V(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function mt(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function Le(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function nn(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var dr=require("react");var X=require("react");function ri(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 rn(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}function md(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function gd(e){if(!_(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 hd(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let a of t){let i=gd(a);i!==void 0&&n.push(i)}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 bd(e){let t;try{t=await e.json()}catch{t=void 0}if(!_(t))return{ok:!1};if(t.ok===!0){let r=hd(t);if(r!==void 0)return r}let n=md(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function Ze(e,t){let n=`${Nr}?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 bd(r)}catch{return{ok:!1}}}var oi={list:e=>Ze(e),add:(e,t,n)=>Ze(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),enable:(e,t)=>Ze(e,{op:"enable",ref:t}),rename:(e,t,n)=>Ze(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>Ze(e,{op:"remove",ref:t}),replace:(e,t,n)=>Ze(e,{op:"value",ref:t,value:n}),async reveal(e,t){try{let n=await fetch(`${Ot}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!_(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var A=require("react/jsx-runtime"),yd="M3.9 8.35 6.6 11.05 12.1 5.5",wd=["M8 3.9v8.2","M3.9 8h8.2"];function ii({paths:e}){return(0,A.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,A.jsx)("path",{d:t},t))})}function xd(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function vd(e){return e.alias??e.masked??e.ref}function si(e){let{route:t,t:n}=e,r=e.client??oi,o=(0,X.useId)(),[a,i]=(0,X.useState)(void 0),[s,d]=(0,X.useState)(null),[c,m]=(0,X.useState)(void 0),[u,g]=(0,X.useState)(!1),[l,f]=(0,X.useState)(void 0),[p,k]=(0,X.useState)(""),[w,x]=(0,X.useState)(""),[v,E]=(0,X.useState)(void 0),b=(0,X.useCallback)((S,D)=>{if(!S.ok){m({kind:"error",text:S.error??n("keysUnreachable")});return}i(S.entries),d(S.enabledRef),m(D===void 0?void 0:{kind:"status",text:D})},[n]);(0,X.useEffect)(()=>{let S=!0;return(async()=>{let D=await r.list(t);S&&b(D,void 0)})(),()=>{S=!1}},[b,r,t]);let R=(0,X.useCallback)(async(S,D)=>{g(!0),E(void 0),f(void 0);try{b(await S(),D)}finally{g(!1)}},[b]),I=()=>{f(void 0),k(""),x("")},U=(S,D)=>{f({kind:S,ref:D.ref}),k(S==="alias"?D.alias??"":""),x(""),E(void 0)},B=()=>{if(u||l===void 0)return;let S=l.kind,D=l.ref;if(S!=="alias"&&!rn(w))return;let P=ri(p);g(!0),(async()=>{try{if(S==="add"){let W=await r.add(t,w,P);b(W,n("keysAdded")),W.ok&&I();return}if(D===void 0)return;let C=S==="alias"?await r.rename(t,D,P):await r.replace(t,D,w);b(C,n(S==="alias"?"keysRenamed":"keysReplaced")),C.ok&&I()}finally{g(!1)}})()},H=()=>{if(l===void 0)return null;let S=l.kind,D=S!=="alias",P=D&&w.length>0&&!rn(w);return(0,A.jsxs)("div",{className:"bre-keys-form",children:[(0,A.jsxs)("div",{className:"bre-keys-form-fields",children:[S==="value"?null:(0,A.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:p,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:u,autoFocus:S==="alias",onChange:C=>k(C.target.value)}),D?(0,A.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:w,placeholder:n(S==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":P,disabled:u,autoFocus:!0,onChange:C=>x(C.target.value)}):null]}),P?(0,A.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,A.jsxs)("div",{className:"bre-keys-form-actions",children:[(0,A.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:I,children:n("keysCancel")}),(0,A.jsx)("button",{type:"button",className:"bre-primary-button",disabled:u||D&&!rn(w),onClick:B,children:n(S==="add"?"keysAddConfirm":"keysSave")})]})]})},te=()=>l?.kind==="add"?(0,A.jsx)("li",{className:"bre-keys-form-row",children:H()}):(0,A.jsx)("li",{className:"bre-keys-add-row",children:(0,A.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:u,onClick:()=>{f({kind:"add"}),k(""),x(""),E(void 0)},children:[(0,A.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,A.jsx)(ii,{paths:wd})}),n("keysAdd")]})});return a===void 0?c===void 0?(0,A.jsx)("div",{className:"bre-keys"}):(0,A.jsxs)("div",{className:"bre-keys",children:[(0,A.jsx)("p",{className:"bre-effort-message bre-"+c.kind,role:c.kind==="error"?"alert":"status",children:c.text}),(0,A.jsx)("ul",{className:"bre-keys-list",children:te()})]}):(0,A.jsxs)("div",{className:"bre-keys",children:[(0,A.jsxs)("ul",{className:"bre-keys-list",children:[a.map(S=>{let D=vd(S);return(0,A.jsxs)(X.Fragment,{children:[(0,A.jsxs)("li",{className:"bre-keys-row","data-state":S.configured===!1?"missing":"ready",children:[S.alias===void 0?null:(0,A.jsx)("span",{className:"bre-keys-alias",children:S.alias}),(0,A.jsx)("span",{className:S.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:xd(S,n)}),(0,A.jsx)("span",{className:"bre-keys-actions",children:v===S.ref?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:u,onClick:()=>{R(()=>r.remove(t,S.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,A.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>E(void 0),children:n("keysCancel")})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>{E(S.ref),f(void 0)},children:n("keysRemove")}),(0,A.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>U("alias",S),children:n("keysAlias")}),(0,A.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>U("value",S),children:n("keysEdit")})]})}),(0,A.jsxs)("label",{className:"bre-keys-enable",title:n("keysEnable",{name:D}),children:[(0,A.jsx)("input",{type:"radio",name:o,className:"bre-keys-enabled",checked:S.enabled,disabled:u,"aria-label":n("keysEnable",{name:D}),onChange:()=>{R(()=>r.enable(t,S.ref),n("keysEnabledNote",{name:D}))}}),(0,A.jsx)("span",{className:"bre-keys-mark","aria-hidden":"true",children:S.enabled?(0,A.jsx)(ii,{paths:[yd]}):null}),(0,A.jsx)("span",{className:"bre-keys-enable-text",children:n("keysEnabled")})]})]}),l!==void 0&&l.ref===S.ref?(0,A.jsx)("li",{className:"bre-keys-form-row",children:H()}):null]},S.ref)}),te()]}),c===void 0?null:(0,A.jsx)("p",{className:"bre-effort-message bre-"+c.kind,role:c.kind==="error"?"alert":"status",children:c.text})]})}var sn="bre-key-managed",kd="bre-keys-host",lr="data-bre-key-host",Ed="data-bre-key-input",on="data-bre-region",Ae=new WeakMap;function Td(e){let t=e.querySelector(`input[${Ed}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function ai(e){let t=Ae.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(lr)?n:void 0}function di(e,t){let n=t.route;if(n===void 0||n.length===0||Td(e)===void 0||e.parentElement===null)return;Le(e,sn,!0);let r=Ae.get(e),o=ai(e);o===void 0&&(r!==void 0&&li(e,r),o=e.ownerDocument.createElement("div"),o.className=kd,e.after(o)),V(o,lr,n);let a=e.getAttribute(on);a===null?o.hasAttribute(on)&&o.removeAttribute(on):V(o,on,a);let i=()=>(0,dr.createElement)(xe,{fallbackText:t.t("keysPanelFailed")},(0,dr.createElement)(si,{route:n,t:t.t,client:t.client})),s=Ae.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(i()));return}s!==void 0&&(Ae.delete(e),s.mount.root.unmount()),Ae.set(e,{route:n,host:o,mount:ft(o,i(),{sync:!0}),t:t.t,client:t.client})}function li(e,t){Ae.delete(e),Pe(t.mount)}function an(e){Le(e,sn,!1);let t=Ae.get(e);t!==void 0&&li(e,t),ai(e)?.remove()}function fi(){for(let e of Array.from(document.querySelectorAll(`[${lr}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Ae.has(t)?an(t):e.remove()}}var ui="http://www.w3.org/2000/svg",Md="data-bre-icon";function Sd(e){let t=document.createElementNS(ui,"path");return t.setAttribute("d",e),t}function ci(e,t){let n=document.createElementNS(ui,"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(Md,e),n.append(...t.map(Sd)),n}var ln="bre-key-field",hi="bre-key-eye",dn="data-bre-key-input",bi="data-bre-eye-show",yi="data-bre-eye-hide",pi=["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"],cr=new WeakMap;function fr(e){let t=e.querySelector(`input[${dn}]`);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(hi))return t}function xi(e,t){let n=fr(e);if(n===void 0){fn(e);return}cr.set(e,t),V(n,dn,""),Le(e,ln,!0);let r=wi(e)??Ad(e);V(r,bi,t.t("keyRevealShow")),V(r,yi,t.t("keyRevealHide")),ur(r,n)}function fn(e){let t=wi(e);t!==void 0&&t.remove(),cr.delete(e),Le(e,ln,!1);let n=e.querySelector(`input[${dn}]`);n instanceof HTMLInputElement&&(n.removeAttribute(dn),n.type="password")}async function Ld(e){try{let t=await fetch(`${Ot}?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 ur(e,t){let n=t.type!=="password";V(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?yi:bi);r!==null&&(V(e,"aria-label",r),V(e,"title",r)),mt(e,t.disabled)}function mi(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 Ad(e){let t=document.createElement("button");t.type="button",t.className=hi,t.append(gi("eye"),gi("eye-off"));let n,r=async()=>{let o=fr(e),a=cr.get(e);if(o===void 0||a===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&mi(o,""),n=void 0,o.type="password",ur(t,o);return}let i=a.route;if(i!==void 0&&n===void 0&&o.value.length===0){V(t,"aria-busy","true");let s;try{s=await(a.loadKey??Ld)(i)}catch{s=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),s===void 0){let d=a.t("keyRevealFailed");V(t,"aria-label",d),V(t,"title",d);return}fr(e)===o&&o.value.length===0&&(n=s,mi(o,s))}o.type="text",ur(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function gi(e){let t=e==="eye-off"?[...pi,"M2.5 13.5 13.5 2.5"]:pi;return ci(e,t)}var pr="bre-editor-tabs",Rd="bre-editor-tab",un="data-bre-tab-id",bt="bre-tabbed",Oe="data-bre-tab",vi="data-bre-provider",de="data-bre-region",ht="data-bre-editor-body",yt="data-bre-details";var Od=".bre-headers",Re="provider",et="models",tt="advanced",Hd=[Re,et,tt],_d="none",ki=Hd,Ei=pr,Ti=Rd,Mi=un,cn='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',Nd='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',Si='[class*="rowCard"], [class*="addCard"], li';function Li(){return{warned:new WeakSet}}function mn(e){return e===null?null:e.closest(Si)}function Ai(e,t){V(e,Oe,t),Hi(e)}function mr(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(cn))){let a=o.closest(Si);a!==null&&r.add(a)}for(let o of Array.from(e.querySelectorAll(`.${bt}`)))r.has(o)||pn(o);for(let o of r)try{Fd(o,t)}catch(a){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",a)),pn(o)}}function Ri(){for(let e of Array.from(document.querySelectorAll(`.${bt}`))){e.classList.remove(bt),e.removeAttribute(Oe),e.removeAttribute(ht);for(let t of Array.from(e.querySelectorAll(`[${de}]`)))t.removeAttribute(de)}for(let e of Array.from(document.querySelectorAll(`[${Oe}]`)))e.removeAttribute(Oe);for(let e of Array.from(document.querySelectorAll(`[${de}]`)))e.removeAttribute(de);for(let e of Array.from(document.querySelectorAll(`[${ht}]`)))e.removeAttribute(ht);for(let e of Array.from(document.querySelectorAll(`details[${yt}]`)))e.removeAttribute("open"),e.removeAttribute(yt);for(let e of Array.from(document.querySelectorAll(`.${ln}`)))fn(e);for(let e of Array.from(document.querySelectorAll(`.${sn}`)))an(e);fi()}function Id(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(cn)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(cn);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Dd(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};Oi(e,t,0);let{actions:n,fields:r,header:o,models:a}=t;if(!(n===void 0||r.length===0)&&r.some(i=>i.querySelector("input, select, textarea")!==null))return{header:o,models:a,actions:n,fields:r}}var Pd=4;function Oi(e,t,n){if(!(n>Pd)){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(Nd)){t.models??(t.models=r);continue}if(r.querySelector(cn)!==null){Oi(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}r.querySelector("input, select, textarea")!==null&&t.fields.push(r)}}}function Cd(e){let n=e.querySelector(`[${vi}]`)?.getAttribute(vi);return n==null||n===""?void 0:n}function Fd(e,t){let n=Id(e);if(n===void 0){pn(e);return}let r=Dd(n);if(r===void 0){pn(e);return}let o=e.querySelector(Od),a=Cd(e);for(let d of r.fields)V(d,de,Re),xi(d,{t:t.t,route:a}),di(d,{t:t.t,route:a});r.header!==void 0&&V(r.header,de,_d),r.models!==void 0&&V(r.models,de,et),V(n,ht,""),o!==null&&V(o,de,tt),qd(n);let i=new Set([Re]);r.models!==void 0&&i.add(et),o!==null&&i.add(tt);let s=e.getAttribute(Oe)??Re;V(e,Oe,i.has(s)?s:Re),Le(e,bt,!0),Kd(e,t,i)}function Kd(e,t,n){let r=e.querySelector(`.${pr}`);r!==null&&(V(r,"aria-label",t.t("editorTabsLabel")),nn(gt(r,Re),t.t("editorTabProvider")),nn(gt(r,et),t.t("editorTabModels")),nn(gt(r,tt),t.t("editorTabAdvanced")),mt(gt(r,et),!n.has(et)),mt(gt(r,tt),!n.has(tt)),Hi(e,r))}function Hi(e,t){let n=t??e.querySelector(`.${pr}`);if(n===null)return;let r=e.getAttribute(Oe)??Re;for(let o of Array.from(n.querySelectorAll(`[${un}]`)))V(o,"aria-selected",o.getAttribute(un)===r?"true":"false")}function gt(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(un)===t)return n}function pn(e){e.classList.remove(bt),e.removeAttribute(Oe),e.removeAttribute(ht);for(let t of Array.from(e.querySelectorAll(`[${de}]`)))t.getAttribute(de)===Re&&(fn(t),an(t)),t.removeAttribute(de);Bd(e)}function qd(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(V(t,yt,"closed"),V(t,"open",""))}function Bd(e){for(let t of Array.from(e.querySelectorAll(`details[${yt}]`)))t.removeAttribute("open"),t.removeAttribute(yt)}var wt="data-bre-drag-handle",gr="data-bre-row-head",hr="data-bre-drop-side",gn="bre-row-dragging",hn="bre-row-drop-target",Ci="bre-drag-ghost",Fi="bre-drop-line",_i="http://www.w3.org/2000/svg",Ni=8,Ii=28,Di=12,Wd="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",Ud='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function bn(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,drag:void 0}}function le(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function jd(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function We(e){return le(e).map((t,n)=>({row:t,key:jd(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function xt(e,t){let n=We(e),r=n.filter(s=>t.includes(s)),o=r.map(s=>n.indexOf(s)),a=t.filter(s=>r.includes(s)),i=new Map;n.forEach((s,d)=>i.set(s,d)),o.forEach((s,d)=>{let c=a[d];c!==void 0&&i.set(c,s)});for(let[s,d]of i){let c=String(d);s.style.order!==c&&(s.style.order=c)}}function br(e,t){let n=le(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,a)=>{let i=r[a]-o.offsetTop;i!==0&&(o.style.transition="none",o.style.transform=`translateY(${i}px)`,o.offsetHeight,o.style.transition=Wd,o.style.transform="")})}function vt(e,t){return We(e).map(n=>t(n)).filter(n=>n!==void 0)}function Ki(e,t,n){let r=new Map;for(let[i,s]of t.entries())r.has(s)||r.set(s,i);let a=[...We(e).filter(i=>n(i)!==void 0)].sort((i,s)=>{let d=r.get(n(i))??Number.MAX_SAFE_INTEGER,c=r.get(n(s))??Number.MAX_SAFE_INTEGER;return d-c});xt(e,a)}function yn(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function qi(e,t,n,r){let a=e.filter(i=>i!==t).indexOf(n);return a<0?Math.max(0,e.indexOf(t)):r?a+1:a}function Bi(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let a=o.getBoundingClientRect(),i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=o)}return n}function zd(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function Wi(e,t){let n=e.getBoundingClientRect();return t?n.bottom+Ni/2-1:n.top-Ni/2-1}function Ui(){let e=document.createElementNS(_i,"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(_i,"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 ji(e,t){let n=document.createElement("div");n.className=Ci,n.setAttribute("aria-hidden","true"),n.appendChild(Ui());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 Gd(e){return!(e instanceof Element)||e.closest(`[${wt}]`)!==null?!1:e.closest(Ud)!==null}function zi(e){return e.parentElement??void 0}function Gi(e){for(let t of le(e))t.classList.remove(hn),t.removeAttribute(hr)}function Vi(e){let t=e.parentElement;for(;t!==null;){if(Vd(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function Vd(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 $i(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+Ii?-Di:t>n.bottom-Ii?Di:0}function Yi(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 $d(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=Fi,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function Yd(e,t,n){let r=$d(e),o=t.getBoundingClientRect();r.style.top=`${Wi(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(hr,n?"after":"before")}function Jd(e){e.line!==void 0&&(e.line.style.display="none")}function Xd(e){let t=e.drag;e.drag=void 0,t!==void 0&&(Yi(e,t,0),Jd(e),t.row.classList.remove(gn),Gi(t.list),t.dropped||br(t.list,()=>{xt(t.list,t.before)}))}function Qd(e,t,n,r){if(Gd(t.target)){t.preventDefault();return}let o=zi(e),a=n.idOf(e);if(o===void 0||a===void 0){t.preventDefault();return}let i={row:e,list:o,before:We(o),scroller:Vi(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=i,e.classList.add(gn);let s=ji(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",a),d.setDragImage(s,Math.round(s.offsetWidth/2),Math.round(s.offsetHeight/2))}catch{}window.setTimeout(()=>{s.remove()},0)}function Zd(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,a=o instanceof Element?r.adapter.rowOf(o,e):void 0,i=We(e),s=a!==void 0&&i.includes(a)?a:Bi(i,t.clientY);if(s===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let c=zd(s,t.clientY),m=qi(i,r.row,s,c);m!==i.indexOf(r.row)&&br(e,()=>{xt(e,Nn(i,r.row,m))}),Gi(e),s.classList.add(hn),s.setAttribute(hr,c?"after":"before"),Yd(n,s,c),Yi(n,r,r.scroller===void 0?0:$i(r.scroller,t.clientY))}function el(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{Zd(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 tl(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(gr,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{Qd(t,o,n,r)}),e.addEventListener("dragend",()=>{Xd(r)}))}function nl(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 a=zi(t);if(a===void 0)return;let i=We(a),s=i.indexOf(t);if(s<0)return;let d=s+(o.key==="ArrowUp"?-1:1);d<0||d>=i.length||(o.preventDefault(),br(a,()=>{xt(a,Nn(i,t,d))}),n.commit(a),e.focus())})}function Pi(e,t,n,r){let o=r.gripLabel(t,n),a=r.gripHint();e.getAttribute(wt)!==n&&e.setAttribute(wt,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function rl(e,t,n,r,o){let a=t.querySelector(`[${wt}]`);if(a!==null){Pi(a,e,n,r);return}r.decorate?.(e,t);let i=document.createElement("span");i.className="bre-drag-grip",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("draggable","true"),i.appendChild(Ui()),Pi(i,e,n,r),nl(i,e,r,o),tl(r.seatDrags?t:i,e,r,o),t.insertBefore(i,t.firstChild)}function wn(e,t,n,r){if(e.isConnected){el(t,r);for(let o of le(t)){let a=n.idOf(o);if(a===void 0)continue;let i=n.seatOf(o);i!==void 0&&rl(o,i,a,n,r)}r.drag===void 0&&Ki(t,n.order(vt(t,n.idOf)),n.idOf)}}function xn(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${wt}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${gr}]`)))t.removeAttribute(gr),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${gn}, .${hn}`)))t.classList.remove(gn,hn);for(let t of Array.from(document.querySelectorAll(`.${Fi}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${Ci}`)))t.remove();e.line=void 0}var kt="data-bre-row-provider",Ji="{provider}",ol=["rowCard","setupCard"];function Xi(){return bn()}function Et(e){for(let t of ol)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&le(r).length!==0)return r}}function Tt(e){return e.querySelector('[class*="rowHead"]')??void 0}function nt(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function il(e){let t=e.indexOf(Ji);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Ji.length)}}function sl(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 al='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function dl(e){let t=e.closest(al);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function Ue(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=il(r);if(o!==void 0)for(let a of Array.from(e.querySelectorAll("button[aria-label]"))){if(dl(a))continue;let i=a.getAttribute("aria-label")??"";if(i.length<=o.prefix.length+o.suffix.length||!i.startsWith(o.prefix)||!i.endsWith(o.suffix))continue;let s=sl(i.slice(o.prefix.length,i.length-o.suffix.length));if(s!==void 0)return s}}}function yr(e){let t=e.getAttribute(kt);return t===null||t.length===0?void 0:t}function ll(e){return vt(e,yr)}function Qi(e,t,n){if(!e.isConnected)return;let r=Et(e);if(r===void 0)return;let o=t.labels();for(let a of le(r)){let i=Ue(a,o);if(i===void 0){a.removeAttribute(kt);continue}yr(a)!==i&&a.setAttribute(kt,i)}wn(e,r,fl(t),n)}function fl(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:yr,labelOf:nt,order:t=>Vr(t),commit:t=>{zr(ll(t))},seatOf:Tt,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:nt(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function Zi(e){xn(e);let t=Array.from(document.querySelectorAll(`[${kt}]`));yn(t);for(let n of t)n.removeAttribute(kt)}var rt="data-bre-provider-switch",vn="bre-row-disabled";function ts(){return{switches:new WeakSet}}function ns(e,t,n){if(!e.isConnected)return;let r=Et(e);if(r===void 0)return;let o=t.labels();for(let a of Array.from(r.children)){if(!(a instanceof HTMLElement))continue;let i=Ue(a,o);if(i===void 0)continue;let s=Tt(a);s!==void 0&&(ul(a,s,i,t,n),a.classList.toggle(vn,!Pt(i)))}}function rs(){for(let e of Array.from(document.querySelectorAll(`[${rt}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${vn}`)))e.classList.remove(vn)}function ul(e,t,n,r,o){let a=t.querySelector(`[${rt}]`);if(a!==null){es(a,e,n,r);return}let i=document.createElement("button");i.className="bre-provider-switch",i.setAttribute("type","button"),i.setAttribute("role","switch"),i.setAttribute(rt,n),es(i,e,n,r),cl(i,e,o);let s=t.querySelector('[class*="rowActions"]');s===null?t.appendChild(i):s.insertBefore(i,s.firstChild)}function es(e,t,n,r){let o=r.t("providerToggleAria",{provider:nt(t)??n}),a=r.t("providerToggleHint"),i=Pt(n)?"true":"false";e.getAttribute(rt)!==n&&e.setAttribute(rt,n),e.getAttribute("aria-checked")!==i&&e.setAttribute("aria-checked",i),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function cl(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(rt);if(o===null)return;let a=!Pt(o);Jr(o,a),e.setAttribute("aria-checked",a?"true":"false"),t.classList.toggle(vn,!a)}))}var kn="data-bre-provider-delete",os='[class*="rowActions"]',is='[class*="dangerButton"]',pl="bre-provider-delete";function ss(e,t){if(!e.isConnected)return;let n=Et(e);if(n===void 0)return;let r=t.labels(),o=ml(n)??t.t("providerRemoveDisabled");for(let a of Array.from(n.children)){if(!(a instanceof HTMLElement))continue;let i=Ue(a,r);if(i===void 0)continue;let s=Tt(a);if(s===void 0)continue;let d=s.querySelector(os);if(d===null)continue;let c=d.querySelector(`[${kn}]`);if(d.querySelector(is)!==null){c!==null&&c.remove();continue}let m=c??gl();d.lastElementChild!==m&&d.appendChild(m),hl(m,i,o,t.t("providerRemoveLocked",{provider:nt(a)??i}))}}function as(){for(let e of Array.from(document.querySelectorAll(`[${kn}]`)))e.remove()}function ml(e){let n=e.querySelector(`${os} ${is}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function gl(){let e=document.createElement("button");return e.className=pl,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function hl(e,t,n,r){e.getAttribute(kn)!==t&&e.setAttribute(kn,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 Mt="data-bre-row-model",wr="bre-model-grid";function ls(){return bn()}function bl(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))le(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function En(e){let t=e.getAttribute(Mt);return t===null||t.length===0?void 0:t}function xr(e,t){let n=e.closest("li");if(n!==null)return Ue(n,t.labels())}function ds(e,t){let n=Se(e,t.labels().modelName);return n.length>0?n:En(e)}function yl(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:En,labelOf:n=>ds(n,t),order:n=>{let r=xr(e,t);return r===void 0?n:oo(r,n)},commit:n=>{let r=xr(n,t);r!==void 0&&no(r,vt(n,En))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:ds(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(wr)}}}function fs(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of bl(e))if(xr(o,t)!==void 0){for(let a of le(o)){let i=Se(a,r.modelId);if(i.length===0){a.removeAttribute(Mt);continue}En(a)!==i&&a.setAttribute(Mt,i)}wn(e,o,yl(o,t),n)}}function us(e){xn(e);for(let n of Array.from(document.querySelectorAll(`.${wr}`)))n.classList.remove(wr);let t=Array.from(document.querySelectorAll(`[${Mt}]`));yn(t);for(let n of t)n.removeAttribute(Mt)}var wl="settings.models",ke={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}"]};function ps(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:a}=e,i=()=>{let P=t.locale.bind(wl),C=([W,...z])=>{let j=P(W);return j===W||j.trim()===""?z:[j,...z]};return{capacity:C(ke.capacity),modelId:C(ke.modelId),modelName:C(ke.modelName),routeId:C(ke.routeId),baseUrl:C(ke.baseUrl),apiProtocol:C(ke.apiProtocol),apply:C(ke.apply),cancel:C(ke.cancel),editProvider:C(ke.editProvider)}},s=120,d=Xo(),c=Xi(),m={t:r,labels:i},u=ts(),g={t:r,labels:i},l={t:r,labels:i},f=ls(),p={t:r,labels:i},k=Li(),w={t:r},x,v,E,b,R=!1,I={api:n,describeNamespace:()=>ne(n),t:r,labels:i,onIdle:o,onBackoff:P=>{U(P)},mount(P,C){let W=document.createElement("div");W.className="bre-effort-slot",W.dataset.plugin=J,P.appendChild(W);let z=(0,cs.createRoot)(W),j=L=>{z.render((0,vr.createElement)(xe,{fallbackText:r("renderFailed"),children:a(()=>(0,vr.createElement)(Qt,L))}))};return j(C),{unmount:()=>{z.unmount()},render:j}}};function U(P){R||v!==void 0||(v=window.setTimeout(()=>{v=void 0,B()},P))}function B(){R||x!==void 0||(x=window.setTimeout(()=>{x=void 0,b?.(),ni(be(),I,d),mr(be(),w,k),Qi(be(),m,c),ns(be(),g,u),ss(be(),l),fs(be(),p,f)},s))}let H=P=>{R||E!==void 0||(b=P,P(),E=new MutationObserver(()=>{P(),mr(be(),w,k),B()}),E.observe(document.body,{childList:!0,subtree:!0}),B())},te=()=>{R=!0,x!==void 0&&(window.clearTimeout(x),x=void 0),v!==void 0&&(window.clearTimeout(v),v=void 0),E?.disconnect(),E=void 0};return{state:d,labels:i,start:H,stopObserver:te,teardown:()=>{te(),Yo(d,I);for(let[,P]of d.mounted)P.editor.unmount();d.mounted.clear(),Zi(c),rs(),as(),jo(),us(f),Ri()},flushOnUnload:()=>{Jo(d,I)},schedule:B}}function xl(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[a,i]of Object.entries(n?.byId??{}))if(!(i===void 0||(i.retainedBy?.mainView??0)<=0))return typeof i.id=="string"&&i.id.length>0?i.id:a}function ms(e){let t,n=new Map,r=(i,s)=>{for(let[d,c]of n){if(d===s)continue;let m;try{m=i.directoryFor(c.sessionId)===d}catch{m=!1}m||(c.restore(),n.delete(d))}};return{ensure:()=>{let i=e.ctx,s=i.get?.("sessions"),d=i.get?.("uiSession"),c=i.get?.("modelDirectories"),m=xl(s,d);if(!(m===void 0||c===void 0))try{let u=c.directoryFor(m);return r(c,u),t!==void 0&&t.sessionId===m&&t.directory===u||(n.has(u)||n.set(u,{sessionId:m,restore:bo(u,{configuredEffort:e.configuredEffort})}),t={sessionId:m,directory:u}),u}catch{t=void 0;return}},dispose:()=>{for(let[,i]of n)i.restore();n.clear()}}}function kr(e=document){let t=e.querySelector("[data-composer-card]"),n=t??e;for(let o of Array.from(n.querySelectorAll('button[aria-haspopup="menu"][aria-controls]'))){let a=o.getAttribute("aria-controls");if(a===null||a.length===0)continue;let i=e.getElementById(a);if(i!==null&&i.getAttribute("role")==="menu")return i}let r=Array.from(t===null?e.querySelectorAll('[role="menu"]'):t.querySelectorAll('[role="menu"]'));for(let o of r)if(o.previousElementSibling?.matches('button[aria-haspopup="menu"]'))return o}function Er(e=document){let n=e.querySelector("[data-composer-card]")??e,r=Array.from(n.querySelectorAll('button[aria-haspopup="menu"]'));for(let o of r){let a=o.getAttribute("aria-controls");if(a===null||a.length===0)continue;let i=e.getElementById(a);if(i!==null&&i.getAttribute("role")==="menu")return o}for(let o of r)if(o.nextElementSibling?.matches('[role="menu"]'))return o;return r[0]}function gs(){return kr()}function hs(){return Er()}var He=require("react");var $=require("react");var N=require("react/jsx-runtime"),vl=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function bs(e){let t=0,n=Object.entries(e??{}).map(([r,o])=>({id:t+=1,name:r,value:o}));return n.length===0&&n.push({id:t+=1,name:"",value:""}),{rows:n}}function kl(e){let t={},n=!1;for(let o of e.rows){let a=o.name.trim();a.length!==0&&(t[a]=o.value,a.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function ys({route:e,api:t,t:n}){let r=(0,$.useId)(),[o,a]=(0,$.useState)(void 0),[i,s]=(0,$.useState)({rows:[]}),[d,c]=(0,$.useState)(!1),[m,u]=(0,$.useState)(!1),[g,l]=(0,$.useState)(!0),[f,p]=(0,$.useState)(!1),[k,w]=(0,$.useState)(!1),[x,v]=(0,$.useState)(void 0),[E,b]=(0,$.useState)(void 0),[R,I]=(0,$.useState)(!1),U=(0,$.useRef)(1),B=(0,$.useRef)(null);(0,$.useEffect)(()=>{let L=!0;return(async()=>{try{let O=await ne(t);if(!L)return;let F=Qn(O.namespace,e);a(F),s(bs(F)),w(O.writable!==!0)}catch{L&&w(!0)}finally{L&&l(!1)}})(),()=>{L=!1}},[t,e]),(0,$.useEffect)(()=>{let L=!0;return(async()=>{try{let F=await(await fetch(Dr,{method:"GET"})).json();L&&F.ok===!0&&F.data!==void 0&&b(F.data)}catch{}})(),()=>{L=!1}},[]),(0,$.useEffect)(()=>{let L=B.current;if(L===null)return;let O=()=>{I(L.dataset.breRegion==="advanced")};O();let F=new MutationObserver(O);return F.observe(L,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{F.disconnect()}},[]);let H=()=>{s(L=>({...L,rows:[...L.rows,{id:U.current+=1,name:"",value:""}]})),v(void 0)},te=(L,O)=>{s(F=>({...F,rows:F.rows.map(Z=>Z.id===L?{...Z,...O}:Z)})),v(void 0)},S=L=>{s(O=>({...O,rows:O.rows.filter(F=>F.id!==L)})),v(void 0)},D=()=>{s(bs(o)),u(!1),v(void 0)},P=async L=>{p(!0),v(void 0);let O;try{O=await Zn(t,e,L)}catch(F){O={ok:!1,error:F instanceof Error?F.message:String(F)}}if(p(!1),!O.ok){v({kind:"error",text:O.error==="no-route"?n("headersNoRoute"):O.error==="read-only"?n("headersReadOnly"):n("headersError",{error:O.error})});return}a(L),u(!1),v({kind:"success",text:Object.keys(L).length===0?n("headersCleared"):n("headersSaved")})},C=Object.entries(o??{}),W=k||f,z=C.length,j=R;return(0,N.jsxs)("div",{className:"bre-headers",ref:B,"data-plugin":J,"data-open":d?"1":"0",children:[!R&&(0,N.jsx)("div",{className:"bre-headers-head",children:m?(0,N.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,N.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":d,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{c(!d),v(void 0)},children:[(0,N.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),g||z===0?null:(0,N.jsx)("span",{className:"bre-headers-count",children:z}),(0,N.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),!d&&!m&&!R?null:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),E===void 0?null:(0,N.jsxs)(N.Fragment,{children:[E.environment.preferOfficialLayer?(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,E.conflicts.length===0&&(E.headerConflicts?.length??0)===0?null:(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),E.environment.siblings.length===0?null:(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:E.environment.siblings.map(L=>L.name).join(", ")})})]}),g?null:m||j?(0,N.jsxs)("div",{className:"bre-headers-edit",children:[(0,N.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,N.jsx)("span",{children:n("headersName")}),(0,N.jsx)("span",{children:n("headersValue")}),(0,N.jsx)("span",{})]}),i.rows.map(L=>(0,N.jsxs)("div",{className:"bre-headers-row",children:[(0,N.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:L.name,disabled:W,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:O=>{te(L.id,{name:O.target.value})}}),(0,N.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:L.value,disabled:W,list:L.name.trim().toLowerCase()==="user-agent"?r:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:O=>{te(L.id,{value:O.target.value})}}),(0,N.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:W,"aria-label":`${n("headersClear")} ${L.name}`,onClick:()=>{S(L.id)},children:"\xD7"})]},L.id)),(0,N.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:W,onClick:H,children:n("headersAdd")}),!1,(0,N.jsx)("datalist",{id:r,children:vl.map(L=>(0,N.jsx)("option",{value:L},L))}),(0,N.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),(0,N.jsxs)("div",{className:"bre-effort-actions",children:[(0,N.jsx)("button",{type:"button",className:"bre-primary-button",disabled:W,onClick:()=>{P(kl(i))},children:n("headersSave")}),(0,N.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:D,children:n("headersCancel")})]})]}):(0,N.jsxs)("div",{className:"bre-headers-rows",children:[C.length===0?(0,N.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):C.map(([L,O])=>(0,N.jsxs)("div",{className:"bre-headers-row",children:[(0,N.jsx)("span",{className:"bre-headers-name",children:L}),(0,N.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(O.length,24))})]},L)),k?null:(0,N.jsx)("div",{className:"bre-effort-actions",children:(0,N.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:()=>{u(!0),v(void 0)},children:n("headersEdit")})})]})]}),x===void 0?null:(0,N.jsx)("p",{className:"bre-effort-message bre-"+x.kind,role:x.kind==="error"?"alert":"status",children:x.text})]})}var Tr=require("react");var El={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function ws({host:e,t}){return(0,Tr.createElement)("div",{className:Ei,role:"tablist","aria-label":t("editorTabsLabel")},...ki.map(n=>(0,Tr.createElement)("button",{key:n,type:"button",role:"tab",className:Ti,[Mi]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=mn(e.current);o!==null&&Ai(o,n)}},t(El[n]))))}var xs="settings.models.provider-card";function Tl({provider:e,api:t,t:n}){let r=(0,He.useRef)(null);(0,He.useEffect)(()=>{let a=r.current,i=mn(a);if(a===null||i===null)return;let s=i,d=()=>i.querySelector('[class*="_editor"]')!==null,c=()=>{let u=d()?"1":"0";a.dataset.edit!==u&&(a.dataset.edit=u)};c();let m=new MutationObserver(c);return m.observe(s,{childList:!0,subtree:!0}),()=>{m.disconnect()}},[]);let o=e?.provider;return typeof o!="string"||o.length===0?null:(0,He.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,He.createElement)(ws,{host:r,t:n}),(0,He.createElement)(ys,{route:o,api:t,t:n}))}function vs(e,t,n){let r=e,o=r.slots?.inject(xs,()=>{r.slots?.register({name:xs,key:re,inject:()=>({api:t,t:n})},Tl)});return typeof o=="function"?o:()=>{}}var se=require("react");function ks(e){let{t}=e,n=(0,se.useSyncExternalStore)(_t,ae),r=()=>{qr(!n)};return(0,se.createElement)("div",{className:"bre-slider-setting"},(0,se.createElement)("div",{className:"bre-slider-setting-row"},(0,se.createElement)("div",{className:"bre-slider-setting-copy"},(0,se.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,se.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,se.createElement)("div",{className:"bre-slider-setting-control"},(0,se.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,se.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,se.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Es(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:J+"-slider-toggle",order:15,inject:()=>({t})},ks)});return typeof r=="function"?r:()=>{}}var Ml=J,Sl=["slots","locale","connection","remote","remote.settings"];function Ll(e){e.effect(()=>e.locale.register(Ln,{zh:Fr,en:Cr}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=J,t.dataset.pluginStyles=J,t.textContent=so,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let l=e.get?.("configForms");try{let p=l?.get?.(re);if(p!==void 0)return p}catch{}return e.get?.("settingsScope")?.bind?.({namespace:re})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(Ln),a=()=>{let l=e.locale;return typeof l.subscribe=="function"&&typeof l.getSnapshot=="function"?l:void 0},i=l=>{let f=a();return f===void 0?l():(0,Ts.createElement)(Pr,{locale:f,children:l})},s=No({api:r}),d=ms({ctx:e,configuredEffort:s.of}),c=Ro({menuOf:gs,triggerOf:hs,t:o,refreshed:i,sliderEnabled:ae,directory:d.ensure}),m=Do({api:r}),u=ps({ctx:e,api:r,t:o,onIdle:m.run,refreshed:i}),g=()=>{d.ensure(),c.reconcile()};e.effect(()=>(u.start(g),()=>{u.teardown(),c.dispose(),d.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let l=()=>{u.flushOnUnload()};return window.addEventListener("pagehide",l),()=>{window.removeEventListener("pagehide",l)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let l=()=>{u.state.describePromise=void 0,s.invalidate(),u.schedule()},f=[e.remote.$on("settings/document-updated",p=>{p===re&&l()}),e.on("connection/reset",l)];return()=>{for(let p of f)p()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let l=x=>{x.key===Ht?Br(x.newValue!=="false"):x.key===Nt?Gr($e(x.newValue)):x.key===Dt?Xr($r(x.newValue)):x.key===Ft&&ro(Pn(x.newValue))};window.addEventListener("storage",l);let f=_t(()=>{u.schedule()}),p=It(()=>{u.schedule()}),k=Ct(()=>{u.schedule()}),w=Kt(()=>{u.schedule()});return()=>{window.removeEventListener("storage",l),f(),p(),k(),w()}},"dsh-model-think-level: client preferences"),e.effect(()=>Es(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>vs(e,r,o),"dsh-model-think-level: provider-card slot activation")}
1368
1916
 
1369
1917
  return module.exports;
1370
1918
  }