@github/copilot-language-server 1.474.6 → 1.474.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +3 -3
- package/package.json +8 -8
package/dist/main.js
CHANGED
|
@@ -1727,7 +1727,7 @@ ${r}+- `:"";return e+this.description+o}}},rh=class{constructor(e,r,n,o){this.la
|
|
|
1727
1727
|
(using_declaration)
|
|
1728
1728
|
(alias_declaration)
|
|
1729
1729
|
(static_assert_declaration)
|
|
1730
|
-
] @statement`}};var YP=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return rh.isSupported(e)}static isTrimmedByDefault(e){return rh.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=Gmt(n,rh.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{$mt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var J8e=class extends YP{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndex<s?this.asCompletionOffset(r.node.endIndex):n;let c=r,l=r.nextSibling;for(;l&&l.node.endIndex<=s&&!this.hasNonStatementContentAfter(c)&&!this.isCompoundStatement(l);)c=l,l=l.nextSibling;return l&&c.node.endIndex>o&&c.node.endIndex<s?this.asCompletionOffset(c.node.endIndex):n}};async function lHr(t,e){var l=[];try{let r=t.getText();let n=t.offsetAt(e);let o=Gmt(l,rh.create(t.detectedLanguageId,r,0,r.length));await o.build();let s=o.statementAt(n);if(!s)return"non-block";if(!s.isCompoundStatementType&&s.children.length===0)return s.parent&&!s.nextSibling&&s.node.endPosition.row<=e.line?"block-end":s.parent?"mid-block":"non-block";if(s.children.length===0)return"empty-block";let c=s.children[s.children.length-1];if(n<c.node.startIndex)return"mid-block";return"block-end"}catch(u){var d=u,p=!0}finally{$mt(l,d,p)}}a(lHr,"getBlockPositionType");f();function Eeo(t){return t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy}a(Eeo,"getProxyFromEnvironment");function _eo(t){return t.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}a(_eo,"getRejectUnauthorizedFromEnvironment");var uHr=S.Object({proxy:S.Optional(S.String()),proxyStrictSSL:S.Optional(S.Boolean()),proxyAuthorization:S.Optional(S.String()),proxyKerberosServicePrincipal:S.Optional(S.String()),noProxy:S.Optional(S.Array(S.String()))});function dHr(t){let e=Eeo(t),r=pye({proxy:e,proxyStrictSSL:_eo(t)}),n=t.GH_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.GITHUB_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.AGENT_KERBEROS_SERVICE_PRINCIPAL;return n&&(r.proxyKerberosServicePrincipal=n),r}a(dHr,"getHttpSettingsFromEnvironment");function pye(t){if(!t.proxy)return{...t,proxy:""};try{let{protocol:e,host:r,username:n,password:o,pathname:s,search:c,hash:l}=new URL(t.proxy);return{...t,proxy:`${e}//${r}${s}${c}${l}`,proxyAuthorization:t.proxyAuthorization||Ceo(n,o),noProxy:t.noProxy||[]}}catch{return{...t,proxy:""}}}a(pye,"normalizeHttpSettings");function Ceo(t,e){return!t||!e?"":`${decodeURIComponent(t)}:${decodeURIComponent(e)}`}a(Ceo,"getAuth");var Awt={};ai(Awt,{build:()=>Ieo,buildType:()=>xeo,default:()=>Neo,dependencies:()=>keo,description:()=>Teo,devDependencies:()=>Peo,displayName:()=>beo,engines:()=>weo,name:()=>veo,overrides:()=>Deo,scripts:()=>Reo,version:()=>Seo});var veo="copilot",beo="GitHub Copilot",Teo="Your AI pair programmer",Seo="1.474.6",Ieo="159",xeo="prod",weo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},Reo={postinstall:"tsx script/copyCopilotSdkFiles.ts",build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},Peo={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.10.0","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/benchmark":"^2.1.5","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.0","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.7.0","@types/semver":"^7.7.0","@types/sinon":"^21.0.0","@types/uuid":"^10.0.0","@types/vscode":"1.115.0","@types/yargs":"^17.0.24","@vscode/test-electron":"^2.5.2","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.14.2",benchmark:"^2.1.4",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.3.10",esbuild:"^0.27.3","esbuild-plugin-copy":"^2.1.1",eslint:"^9.32.0","eslint-formatter-visualstudio":"^8.40.0","eslint-plugin-mocha":"^10.5.0",globals:"^17.4.0","js-yaml":"^4.1.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.33.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.33.0",sinon:"^21.0.3","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.2.0",tsx:"^4.21.0",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},keo={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.21.0","@anthropic-ai/sdk":"^0.95.0","@github/copilot":"1.0.43","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.26.0","@octokit/graphql":"^8.0.1","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.33","@types/vscode-webview":"^1.57.4","@vscode/chat-lib":"^0.42.0","@vscode/codicons":"^0.0.39","@vscode/copilot-api":"^0.2.2","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.2","@vscode/prompt-tsx":"^0.4.0-alpha.5","@vscode/webview-ui-toolkit":"^1.3.1","await-lock":"^2.2.2","crypto-js":"^4.2.0",diff:"^8.0.2",dldr:"^0.0.10",events:"^3.3.0","get-stream":"^6.0.1","git-url-parse":"^16.0.3",glob:"^11.1.0",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.1.0",microjob:"^0.7.0",minimatch:"^9.0.3",open:"^10.2.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1",semver:"^7.7.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.24.6",uuid:"^11.1.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0","windows-ca-certs":"^0.2.2",ws:"^8.19.0",yargs:"^17.7.2"},Deo={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.8"},Neo={name:veo,displayName:beo,description:Teo,version:Seo,build:Ieo,buildType:xeo,engines:weo,scripts:Reo,devDependencies:Peo,dependencies:keo,overrides:Deo};var Ke={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",AnthropicThinkingEffort:"internal.anthropic.thinkingEffort",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled"};function fHr(t){return["server","parsingandserver"].includes(t)}a(fHr,"shouldDoServerTrimming");var Fx=class{static{a(this,"BlockModeConfig")}},_re=class extends Fx{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Ht).overrideBlockMode(n);if(o)return ywt(o,r);let s=e.get(Ht).enableProgressiveReveal(n);return(hr(e,Ke.AlwaysRequestMultiline)??s)||YP.isTrimmedByDefault(r)?ywt("moremultiline",r):r=="ruby"?"parsing":B1(r)?"parsingandserver":"server"}};function Meo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(Meo,"blockModeRequiresTreeSitter");function ywt(t,e){return t==="moremultiline"&&rh.isSupported(e)?t:Meo(t)&&!B1(e)?"server":t}a(ywt,"toApplicableBlockMode");var Mc=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},Cre=class extends Mc{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return Oeo(r)}getOptionalConfig(r){return Beo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Vj=class extends Mc{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new xi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new xi;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=pye(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ke.ShowEditorCompletions,Ke.EnableAutoCompletions,Ke.DelayCompletions,Ke.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function pHr(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(pHr,"getConfigKeyRecursively");function Oeo(t){if(X8e.has(t))return X8e.get(t);throw new Error(`Missing config default value: ${hgt}.${t}`)}a(Oeo,"getConfigDefaultForKey");function Beo(t){return X8e.get(t)}a(Beo,"getOptionalConfigDefaultForKey");function Z8e(t){return t.get(Mc).getExplicitlySetConfigs()}a(Z8e,"getExplicitlySetConfigs");var Leo={[Ke.DebugOverrideCppHeadersEnableSwitch]:!1,[Ke.RelatedFilesVSCodeCSharp]:!1,[Ke.RelatedFilesVSCodeTypeScript]:!1,[Ke.RelatedFilesVSCode]:!1,[Ke.IncludeNeighboringFiles]:!1,[Ke.ExcludeRelatedFiles]:!1,[Ke.ContextProviders]:[],[Ke.DebugUseEditorFetcher]:null,[Ke.DebugUseElectronFetcher]:null,[Ke.DebugOverrideLogLevels]:{},[Ke.DebugSnippyOverrideUrl]:"",[Ke.FetchStrategy]:"auto",[Ke.ToolConfirmAutoApprove]:!1,[Ke.AutoApproveUnmatchedTerminal]:void 0,[Ke.AutoApproveUnmatchedFileOp]:void 0,[Ke.TrustToolAnnotations]:!1,[Ke.AutoApproveYoloMode]:!1,[Ke.EditorHandlesAllConfirmation]:!1,[Ke.MaxToolCallingLoop]:25,[Ke.AutoCompress]:!1,[Ke.AnthropicThinkingBudgetToken]:1024,[Ke.EnableSkills]:!1,[Ke.UseAgentsMd]:!1,[Ke.UseNestedAgentsMd]:!1,[Ke.UseClaudeMd]:!1,[Ke.UseNestedClaudeMd]:!1,[Ke.UseSubsetMatching]:null,[Ke.ContextProviderTimeBudget]:void 0,[Ke.DebugOverrideCapiUrl]:"",[Ke.DebugTestOverrideCapiUrl]:"",[Ke.DebugOverrideProxyUrl]:"",[Ke.DebugTestOverrideProxyUrl]:"",[Ke.DebugOverrideEngine]:"",[Ke.AlwaysRequestMultiline]:void 0,[Ke.ModelAlwaysTerminatesSingleline]:void 0,[Ke.TrimCompletionsAggressively]:void 0,[Ke.CompletionsDebounce]:void 0,[Ke.NESXTab]:void 0,[Ke.UseWorkspaceContextCoordinator]:void 0,[Ke.ShowWorkspaceContextDebugger]:!1,[Ke.CompletionsDelay]:void 0,[Ke.UseSplitContextPrompt]:void 0,[Ke.UseCompletionsComparisonPanel]:void 0,[Ke.ComparisonPanelModelIds]:void 0,[Ke.ComparisonPanelRandomizedMode]:void 0,[Ke.UseFetchFetcher]:void 0,[Ke.UseChatLibCompletions]:void 0,[Ke.TranscriptDirectory]:void 0,[Ke.EnableThinking]:!0,[Ke.ShowEditorCompletions]:void 0,[Ke.EnableAutoCompletions]:void 0,[Ke.DelayCompletions]:void 0,[Ke.FilterCompletions]:void 0,[Ke.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ke.UserSelectedCompletionModel]:"",[Ke.DebugFilterLogCategories]:[],[Ke.DebugOverrideEngineLegacy]:"",[Ke.DebugTestOverrideProxyUrlLegacy]:"",[Ke.DebugOverrideProxyUrlLegacy]:"",[Ke.DebugTestOverrideCapiUrlLegacy]:"",[Ke.DebugOverrideCapiUrlLegacy]:"",[Ke.HookErrorOccurredStackTrace]:!1,[Ke.NESUseExplicitRejection]:!1,[Ke.AppendPromptTokenCache]:"",[Ke.PromptPersistBasePath]:void 0,[Ke.AnthropicMessagesEndpoint]:"",[Ke.AnthropicThinkingEffort]:"unset",[Ke.EnableMapCodeFallback]:"enabled",[Ke.SearchAgent]:"",[Ke.PerfEnabled]:"",[Ke.NESExtendedRange]:!1},X8e=new Map(Object.entries(Leo));for(let t of Object.values(Ke))if(!X8e.has(t))throw new Error(`Missing config default value ${hgt}.${t}`);function hr(t,e){return t.get(Mc).getConfig(e)}a(hr,"getConfig");function m5r(t){return t.get(Mc).dumpForTelemetry()}a(m5r,"dumpForTelemetry");var Go=class{constructor(){this.packageJson=Awt}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function vgt(t){return t.get(Go).isProduction()}a(vgt,"isProduction");function cBe(t){return t.get(Go).getBuildType()==="dev"}a(cBe,"isDevBuild");function LL(t){return t.get(Go).getBuildType()}a(LL,"getBuildType");function g5r(t){return t.get(Go).getBuild()}a(g5r,"getBuild");function XC(t){return t.get(Go).getVersion()}a(XC,"getVersion");var Hs=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function qC({name:t,version:e}){return`${t}/${e}`}a(qC,"formatNameAndVersion");var Pr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}};function mg(t){let e=t.get(Pr);return{"Editor-Version":qC(e.getEditorInfo()),"Editor-Plugin-Version":qC(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":XC(t)}}a(mg,"editorVersionHeaders");var ox="Iv1.b507a08c87ecfe98",Feo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Ewt="Ov23liV9UpD7Rnfnskm3",Ueo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",Qeo={[ox]:Feo,[Ewt]:Ueo},Kc=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??ox}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=Qeo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};var ur=class{static{a(this,"Fetcher")}getImplementation(){return this}};function YM(t,e,r,n,o,s,c,l,u,d,p,h){let m={...l,Authorization:`Bearer ${r}`,...mg(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Hs).sessionId,m["VScode-MachineId"]=t.get(Hs).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};p&&h&&p.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(ur);if(c){let E=new AbortController;c.onCancellationRequested(()=>{lt(t,"networking.cancelRequest",Ot.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(qeo(E))return lt(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(YM,"postRequest");function qeo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(qeo,"isInterruptedNetworkError");var Heo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function jeo(t){return Heo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(jeo,"isOomError");function h6(t,e,r,n=_r){if(!Xp(e)){if(e instanceof Error){let o=e;jeo(o)?t.get(Ds).setWarning("Out of memory"):o.code==="EMFILE"||o.code==="ENFILE"?t.get(Ds).setWarning("Too many open files"):o.code==="CopilotPromptLoadFailure"?t.get(Ds).setWarning("Corrupted Copilot installation"):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(Ds).setWarning("Worker unexpectedly exited"):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(Ds).setWarning("Current working directory does not exist")}n.exception(t,e,r)}}a(h6,"handleException");function hHr(t){process.addListener("uncaughtException",r=>{h6(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,h6(t,r,"unhandledRejection")}finally{e=!1}})}a(hHr,"registerDefaultHandlers");async function mHr(t){try{await eye}catch(e){h6(t,e,"initializeTokenizers")}}a(mHr,"waitForTokenizers");f();var KM=require("fs"),gHr=require("os"),e6e=le(require("path")),vre=require("process");var Ci=class{static{a(this,"PersistenceManager")}},_wt=class extends Ci{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await KM.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=e6e.dirname(s);c!==this.directory&&await KM.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await hye.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await KM.promises.writeFile(s,JSON.stringify(u)+`
|
|
1730
|
+
] @statement`}};var YP=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return rh.isSupported(e)}static isTrimmedByDefault(e){return rh.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=Gmt(n,rh.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{$mt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var J8e=class extends YP{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndex<s?this.asCompletionOffset(r.node.endIndex):n;let c=r,l=r.nextSibling;for(;l&&l.node.endIndex<=s&&!this.hasNonStatementContentAfter(c)&&!this.isCompoundStatement(l);)c=l,l=l.nextSibling;return l&&c.node.endIndex>o&&c.node.endIndex<s?this.asCompletionOffset(c.node.endIndex):n}};async function lHr(t,e){var l=[];try{let r=t.getText();let n=t.offsetAt(e);let o=Gmt(l,rh.create(t.detectedLanguageId,r,0,r.length));await o.build();let s=o.statementAt(n);if(!s)return"non-block";if(!s.isCompoundStatementType&&s.children.length===0)return s.parent&&!s.nextSibling&&s.node.endPosition.row<=e.line?"block-end":s.parent?"mid-block":"non-block";if(s.children.length===0)return"empty-block";let c=s.children[s.children.length-1];if(n<c.node.startIndex)return"mid-block";return"block-end"}catch(u){var d=u,p=!0}finally{$mt(l,d,p)}}a(lHr,"getBlockPositionType");f();function Eeo(t){return t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy}a(Eeo,"getProxyFromEnvironment");function _eo(t){return t.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}a(_eo,"getRejectUnauthorizedFromEnvironment");var uHr=S.Object({proxy:S.Optional(S.String()),proxyStrictSSL:S.Optional(S.Boolean()),proxyAuthorization:S.Optional(S.String()),proxyKerberosServicePrincipal:S.Optional(S.String()),noProxy:S.Optional(S.Array(S.String()))});function dHr(t){let e=Eeo(t),r=pye({proxy:e,proxyStrictSSL:_eo(t)}),n=t.GH_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.GITHUB_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.AGENT_KERBEROS_SERVICE_PRINCIPAL;return n&&(r.proxyKerberosServicePrincipal=n),r}a(dHr,"getHttpSettingsFromEnvironment");function pye(t){if(!t.proxy)return{...t,proxy:""};try{let{protocol:e,host:r,username:n,password:o,pathname:s,search:c,hash:l}=new URL(t.proxy);return{...t,proxy:`${e}//${r}${s}${c}${l}`,proxyAuthorization:t.proxyAuthorization||Ceo(n,o),noProxy:t.noProxy||[]}}catch{return{...t,proxy:""}}}a(pye,"normalizeHttpSettings");function Ceo(t,e){return!t||!e?"":`${decodeURIComponent(t)}:${decodeURIComponent(e)}`}a(Ceo,"getAuth");var Awt={};ai(Awt,{build:()=>Ieo,buildType:()=>xeo,default:()=>Neo,dependencies:()=>keo,description:()=>Teo,devDependencies:()=>Peo,displayName:()=>beo,engines:()=>weo,name:()=>veo,overrides:()=>Deo,scripts:()=>Reo,version:()=>Seo});var veo="copilot",beo="GitHub Copilot",Teo="Your AI pair programmer",Seo="1.474.7",Ieo="162",xeo="prod",weo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},Reo={postinstall:"tsx script/copyCopilotSdkFiles.ts",build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},Peo={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.10.0","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/benchmark":"^2.1.5","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.0","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.7.0","@types/semver":"^7.7.0","@types/sinon":"^21.0.0","@types/uuid":"^10.0.0","@types/vscode":"1.115.0","@types/yargs":"^17.0.24","@vscode/test-electron":"^2.5.2","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.14.2",benchmark:"^2.1.4",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.3.10",esbuild:"^0.27.3","esbuild-plugin-copy":"^2.1.1",eslint:"^9.32.0","eslint-formatter-visualstudio":"^8.40.0","eslint-plugin-mocha":"^10.5.0",globals:"^17.4.0","js-yaml":"^4.1.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.33.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.33.0",sinon:"^21.0.3","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.2.0",tsx:"^4.21.0",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},keo={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.21.0","@anthropic-ai/sdk":"^0.95.0","@github/copilot":"1.0.43","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.26.0","@octokit/graphql":"^8.0.1","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.33","@types/vscode-webview":"^1.57.4","@vscode/chat-lib":"^0.42.0","@vscode/codicons":"^0.0.39","@vscode/copilot-api":"^0.2.2","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.2","@vscode/prompt-tsx":"^0.4.0-alpha.5","@vscode/webview-ui-toolkit":"^1.3.1","await-lock":"^2.2.2","crypto-js":"^4.2.0",diff:"^8.0.2",dldr:"^0.0.10",events:"^3.3.0","get-stream":"^6.0.1","git-url-parse":"^16.0.3",glob:"^11.1.0",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.1.0",microjob:"^0.7.0",minimatch:"^9.0.3",open:"^10.2.0","os-browserify":"^0.3.0","path-browserify":"^1.0.1",semver:"^7.7.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.24.6",uuid:"^11.1.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0","windows-ca-certs":"^0.2.2",ws:"^8.19.0",yargs:"^17.7.2"},Deo={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.8"},Neo={name:veo,displayName:beo,description:Teo,version:Seo,build:Ieo,buildType:xeo,engines:weo,scripts:Reo,devDependencies:Peo,dependencies:keo,overrides:Deo};var Ke={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",AnthropicThinkingEffort:"internal.anthropic.thinkingEffort",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled"};function fHr(t){return["server","parsingandserver"].includes(t)}a(fHr,"shouldDoServerTrimming");var Fx=class{static{a(this,"BlockModeConfig")}},_re=class extends Fx{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Ht).overrideBlockMode(n);if(o)return ywt(o,r);let s=e.get(Ht).enableProgressiveReveal(n);return(hr(e,Ke.AlwaysRequestMultiline)??s)||YP.isTrimmedByDefault(r)?ywt("moremultiline",r):r=="ruby"?"parsing":B1(r)?"parsingandserver":"server"}};function Meo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(Meo,"blockModeRequiresTreeSitter");function ywt(t,e){return t==="moremultiline"&&rh.isSupported(e)?t:Meo(t)&&!B1(e)?"server":t}a(ywt,"toApplicableBlockMode");var Mc=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},Cre=class extends Mc{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return Oeo(r)}getOptionalConfig(r){return Beo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Vj=class extends Mc{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new xi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new xi;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=pye(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ke.ShowEditorCompletions,Ke.EnableAutoCompletions,Ke.DelayCompletions,Ke.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function pHr(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(pHr,"getConfigKeyRecursively");function Oeo(t){if(X8e.has(t))return X8e.get(t);throw new Error(`Missing config default value: ${hgt}.${t}`)}a(Oeo,"getConfigDefaultForKey");function Beo(t){return X8e.get(t)}a(Beo,"getOptionalConfigDefaultForKey");function Z8e(t){return t.get(Mc).getExplicitlySetConfigs()}a(Z8e,"getExplicitlySetConfigs");var Leo={[Ke.DebugOverrideCppHeadersEnableSwitch]:!1,[Ke.RelatedFilesVSCodeCSharp]:!1,[Ke.RelatedFilesVSCodeTypeScript]:!1,[Ke.RelatedFilesVSCode]:!1,[Ke.IncludeNeighboringFiles]:!1,[Ke.ExcludeRelatedFiles]:!1,[Ke.ContextProviders]:[],[Ke.DebugUseEditorFetcher]:null,[Ke.DebugUseElectronFetcher]:null,[Ke.DebugOverrideLogLevels]:{},[Ke.DebugSnippyOverrideUrl]:"",[Ke.FetchStrategy]:"auto",[Ke.ToolConfirmAutoApprove]:!1,[Ke.AutoApproveUnmatchedTerminal]:void 0,[Ke.AutoApproveUnmatchedFileOp]:void 0,[Ke.TrustToolAnnotations]:!1,[Ke.AutoApproveYoloMode]:!1,[Ke.EditorHandlesAllConfirmation]:!1,[Ke.MaxToolCallingLoop]:25,[Ke.AutoCompress]:!1,[Ke.AnthropicThinkingBudgetToken]:1024,[Ke.EnableSkills]:!1,[Ke.UseAgentsMd]:!1,[Ke.UseNestedAgentsMd]:!1,[Ke.UseClaudeMd]:!1,[Ke.UseNestedClaudeMd]:!1,[Ke.UseSubsetMatching]:null,[Ke.ContextProviderTimeBudget]:void 0,[Ke.DebugOverrideCapiUrl]:"",[Ke.DebugTestOverrideCapiUrl]:"",[Ke.DebugOverrideProxyUrl]:"",[Ke.DebugTestOverrideProxyUrl]:"",[Ke.DebugOverrideEngine]:"",[Ke.AlwaysRequestMultiline]:void 0,[Ke.ModelAlwaysTerminatesSingleline]:void 0,[Ke.TrimCompletionsAggressively]:void 0,[Ke.CompletionsDebounce]:void 0,[Ke.NESXTab]:void 0,[Ke.UseWorkspaceContextCoordinator]:void 0,[Ke.ShowWorkspaceContextDebugger]:!1,[Ke.CompletionsDelay]:void 0,[Ke.UseSplitContextPrompt]:void 0,[Ke.UseCompletionsComparisonPanel]:void 0,[Ke.ComparisonPanelModelIds]:void 0,[Ke.ComparisonPanelRandomizedMode]:void 0,[Ke.UseFetchFetcher]:void 0,[Ke.UseChatLibCompletions]:void 0,[Ke.TranscriptDirectory]:void 0,[Ke.EnableThinking]:!0,[Ke.ShowEditorCompletions]:void 0,[Ke.EnableAutoCompletions]:void 0,[Ke.DelayCompletions]:void 0,[Ke.FilterCompletions]:void 0,[Ke.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ke.UserSelectedCompletionModel]:"",[Ke.DebugFilterLogCategories]:[],[Ke.DebugOverrideEngineLegacy]:"",[Ke.DebugTestOverrideProxyUrlLegacy]:"",[Ke.DebugOverrideProxyUrlLegacy]:"",[Ke.DebugTestOverrideCapiUrlLegacy]:"",[Ke.DebugOverrideCapiUrlLegacy]:"",[Ke.HookErrorOccurredStackTrace]:!1,[Ke.NESUseExplicitRejection]:!1,[Ke.AppendPromptTokenCache]:"",[Ke.PromptPersistBasePath]:void 0,[Ke.AnthropicMessagesEndpoint]:"",[Ke.AnthropicThinkingEffort]:"unset",[Ke.EnableMapCodeFallback]:"enabled",[Ke.SearchAgent]:"",[Ke.PerfEnabled]:"",[Ke.NESExtendedRange]:!1},X8e=new Map(Object.entries(Leo));for(let t of Object.values(Ke))if(!X8e.has(t))throw new Error(`Missing config default value ${hgt}.${t}`);function hr(t,e){return t.get(Mc).getConfig(e)}a(hr,"getConfig");function m5r(t){return t.get(Mc).dumpForTelemetry()}a(m5r,"dumpForTelemetry");var Go=class{constructor(){this.packageJson=Awt}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function vgt(t){return t.get(Go).isProduction()}a(vgt,"isProduction");function cBe(t){return t.get(Go).getBuildType()==="dev"}a(cBe,"isDevBuild");function LL(t){return t.get(Go).getBuildType()}a(LL,"getBuildType");function g5r(t){return t.get(Go).getBuild()}a(g5r,"getBuild");function XC(t){return t.get(Go).getVersion()}a(XC,"getVersion");var Hs=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function qC({name:t,version:e}){return`${t}/${e}`}a(qC,"formatNameAndVersion");var Pr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}};function mg(t){let e=t.get(Pr);return{"Editor-Version":qC(e.getEditorInfo()),"Editor-Plugin-Version":qC(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":XC(t)}}a(mg,"editorVersionHeaders");var ox="Iv1.b507a08c87ecfe98",Feo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Ewt="Ov23liV9UpD7Rnfnskm3",Ueo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",Qeo={[ox]:Feo,[Ewt]:Ueo},Kc=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??ox}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=Qeo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};var ur=class{static{a(this,"Fetcher")}getImplementation(){return this}};function YM(t,e,r,n,o,s,c,l,u,d,p,h){let m={...l,Authorization:`Bearer ${r}`,...mg(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Hs).sessionId,m["VScode-MachineId"]=t.get(Hs).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};p&&h&&p.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(ur);if(c){let E=new AbortController;c.onCancellationRequested(()=>{lt(t,"networking.cancelRequest",Ot.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(qeo(E))return lt(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(YM,"postRequest");function qeo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(qeo,"isInterruptedNetworkError");var Heo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function jeo(t){return Heo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(jeo,"isOomError");function h6(t,e,r,n=_r){if(!Xp(e)){if(e instanceof Error){let o=e;jeo(o)?t.get(Ds).setWarning("Out of memory"):o.code==="EMFILE"||o.code==="ENFILE"?t.get(Ds).setWarning("Too many open files"):o.code==="CopilotPromptLoadFailure"?t.get(Ds).setWarning("Corrupted Copilot installation"):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(Ds).setWarning("Worker unexpectedly exited"):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(Ds).setWarning("Current working directory does not exist")}n.exception(t,e,r)}}a(h6,"handleException");function hHr(t){process.addListener("uncaughtException",r=>{h6(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,h6(t,r,"unhandledRejection")}finally{e=!1}})}a(hHr,"registerDefaultHandlers");async function mHr(t){try{await eye}catch(e){h6(t,e,"initializeTokenizers")}}a(mHr,"waitForTokenizers");f();var KM=require("fs"),gHr=require("os"),e6e=le(require("path")),vre=require("process");var Ci=class{static{a(this,"PersistenceManager")}},_wt=class extends Ci{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await KM.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=e6e.dirname(s);c!==this.directory&&await KM.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await hye.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await KM.promises.writeFile(s,JSON.stringify(u)+`
|
|
1731
1731
|
`,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await hye.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+`
|
|
1732
1732
|
`;l===`{}
|
|
1733
1733
|
`?await KM.promises.rm(o):await KM.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await hye.acquire(n),await KM.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await KM.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await KM.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},hye=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r<this.DEFAULT_TIMEOUT_MS;){let n=this.locks.get(e);if(!n)return;let o=this.DEFAULT_TIMEOUT_MS-(Date.now()-r);if(o<=0)return;let s=new Promise((c,l)=>{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function Cwt(){return vre.env.XDG_CONFIG_HOME&&e6e.isAbsolute(vre.env.XDG_CONFIG_HOME)?vre.env.XDG_CONFIG_HOME+"/github-copilot":(0,gHr.platform)()==="win32"?vre.env.USERPROFILE+"\\AppData\\Local\\github-copilot":vre.env.HOME+"/.config/github-copilot"}a(Cwt,"getXdgConfigPath");function AHr(){return new _wt(Cwt())}a(AHr,"makeXdgPersistenceManager");f();f();f();var JM={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};f();f();var yHr=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],EHr={".php":[".blade"]},Wj=Object.keys(JM).flatMap(t=>JM[t].extensions);var vwt=le(require("node:path"));var Tre=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},mye=class{static{a(this,"LanguageDetection")}},bwt=new Map,bre=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(JM)){for(let n of e)bwt.set(n,[...bwt.get(n)??[],t]);for(let n of r??[])bre.set(n,[...bre.get(n)??[],t])}var Twt=class extends mye{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=ci(e.uri),n=vwt.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Tre(s.languageId,s.isGuess,c):new Tre(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(yHr.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=vwt.extname(n).toLowerCase();if(o.length>0&&Wj.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=EHr[e];return!n||n.includes(r)}detectLanguageId(e,r){if(bre.has(e))return{languageId:bre.get(e)[0],isGuess:!1};let n=bwt.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),bre.has(e))return{languageId:bre.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},Swt=class extends mye{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new Tre("cpp",n.isGuess,n.fileExtension):n}},Iwt=class extends mye{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Tre(r.languageId,!0,""):this.delegate.detectLanguage(r)}},Geo=new Swt(new Iwt(new Twt));function KP({uri:t,languageId:e}){let r=Geo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(KP,"detectLanguage");f();f();f();f();function cp(t){if(t.isCancellationRequested)throw new t6e}a(cp,"throwIfCancellationRequested");function Ux(t){return t instanceof t6e?!0:t instanceof Error&&t.name===xwt&&t.message===xwt}a(Ux,"isCancellationError");var t6e=class extends Error{static{a(this,"CancellationError")}constructor(){super(xwt),this.name=this.message}},xwt="Canceled",r6e=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function zj(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(zj,"isTypeDefinition");var nl=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=CHr(e,e.length,o),_Hr(n,r);o<this.end;)e[o]!=="\r"&&e[o]!==`
|
|
@@ -2133,7 +2133,7 @@ ${p.join(`
|
|
|
2133
2133
|
|
|
2134
2134
|
... and ${n.length-e} more leaking disposables
|
|
2135
2135
|
|
|
2136
|
-
`),{leaks:n,details:c}}};function zso(t){Jre=t}a(zso,"setDisposableTracker");if(Wso){let t="__is_disposable_tracked__";zso(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==py.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==py.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function ePt(t){return Jre?.trackDisposable(t),t}a(ePt,"trackDisposable");function tPt(t){Jre?.markAsDisposed(t)}a(tPt,"markAsDisposed");function Z2t(t,e){Jre?.setParent(t,e)}a(Z2t,"setParentOfDisposable");function Yso(t,e){if(Jre)for(let r of t)Jre.setParent(r,e)}a(Yso,"setParentOfDisposables");function zWr(t){if(Y2t.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(zWr,"dispose");function YWr(...t){let e=k9e(()=>zWr(t));return Yso(t,e),e}a(YWr,"combinedDisposable");function k9e(t){let e=ePt({dispose:z2t(()=>{tPt(e),t()})});return e}a(k9e,"toDisposable");var G6=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;ePt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(tPt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{zWr(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Z2t(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Z2t(e,null))}},py=class{constructor(){this._store=new G6;ePt(this),Z2t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){tPt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};f();function KWr(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(KWr,"formatResetDate");var $6=class{static{a(this,"QuotaWarningNotifier")}};var IG=class{static{a(this,"QuotaChangeNotifier")}};var rPt=[50,75,90,95],hy=class extends py{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._ctx=r,this._register(Mo(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),p=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:p}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(IG).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date<new Date(r.resetDate):!1}_buildWarningParams(r,n){return{title:"Copilot Quota Usage Alert",message:r,severity:n,chat:this._quotaInfo?.chat,completions:this._quotaInfo?.completions,premium_interactions:this._quotaInfo?.premium_interactions,copilotPlan:this._copilotPlan}}clearStaleThresholds(r,n){if(!r||r.quota<=0){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o<s&&n.delete(s)}checkThreshold(r,n){if(!r||r.quota<=0)return;let o=100-r.percentRemaining;for(let s=rPt.length-1;s>=0;s--){let c=rPt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(rPt[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get($6).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get($6).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${KWr(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function D9e(t){let e=await t.get(zr).getSession();if(e){let r=await mhe(t,e);if(r.ok){let n=await r.json();t.get(hy).processUserInfoQuotaSnapshot(n)}}}a(D9e,"refreshUserQuota");f();f();var Yx=class{static{a(this,"RateLimitNotifier")}},N9e=class extends Yx{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var nPt=[50,75,90,95],ok=class extends py{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(Mo(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(Yx).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o<s&&n.delete(s)}checkThreshold(r,n,o){if(!r)return;let s=100-r.percentRemaining;for(let c=nPt.length-1;c>=0;c--){let l=nPt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(nPt[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=this.formatResetDate(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}formatResetDate(r){let n=new Date(r);if(Number.isNaN(n.getTime()))return r;let o=new Date,s=n.getFullYear()!==o.getFullYear();return new Intl.DateTimeFormat("en-US",s?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(n)}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};f();f();f();var V6="copilot-edits-session";f();f();f();f();function M9e(t,e,r,n,o,s,c){return p5r(t,e,r,o,n),{completionText:e,meanLogProb:Kso(t,r),meanAlternativeLogProb:Jso(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Cr(),finishReason:r.finish_reason}}a(M9e,"convertToAPIChoice");function Kso(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s<e.logprobs.token_logprobs.length-1&&o>0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){_r.exception(t,r,"Error calculating mean prob")}}a(Kso,"calculateMeanLogProb");function Jso(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s<e.logprobs.token_logprobs.length-1&&o>0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){_r.exception(t,r,"Error calculating mean prob")}}a(Jso,"calculateMeanAlternativeLogProb");function Xre(t,e){return QC(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Xre,"getTemperatureForSamples");var Xso={markdown:[`
|
|
2136
|
+
`),{leaks:n,details:c}}};function zso(t){Jre=t}a(zso,"setDisposableTracker");if(Wso){let t="__is_disposable_tracked__";zso(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==py.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==py.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function ePt(t){return Jre?.trackDisposable(t),t}a(ePt,"trackDisposable");function tPt(t){Jre?.markAsDisposed(t)}a(tPt,"markAsDisposed");function Z2t(t,e){Jre?.setParent(t,e)}a(Z2t,"setParentOfDisposable");function Yso(t,e){if(Jre)for(let r of t)Jre.setParent(r,e)}a(Yso,"setParentOfDisposables");function zWr(t){if(Y2t.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(zWr,"dispose");function YWr(...t){let e=k9e(()=>zWr(t));return Yso(t,e),e}a(YWr,"combinedDisposable");function k9e(t){let e=ePt({dispose:z2t(()=>{tPt(e),t()})});return e}a(k9e,"toDisposable");var G6=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;ePt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(tPt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{zWr(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Z2t(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Z2t(e,null))}},py=class{constructor(){this._store=new G6;ePt(this),Z2t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){tPt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};f();function KWr(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(KWr,"formatResetDate");var $6=class{static{a(this,"QuotaWarningNotifier")}};var IG=class{static{a(this,"QuotaChangeNotifier")}};var rPt=[50,75,90,95],hy=class extends py{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._ctx=r,this._register(Mo(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),p=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:p}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(IG).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date<new Date(r.resetDate):!1}_buildWarningParams(r,n){return{title:"Copilot Quota Usage Alert",message:r,severity:n,chat:this._quotaInfo?.chat,completions:this._quotaInfo?.completions,premium_interactions:this._quotaInfo?.premium_interactions,copilotPlan:this._copilotPlan}}clearStaleThresholds(r,n){if(!r||r.quota<=0){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o<s&&n.delete(s)}checkThreshold(r,n){if(!r||r.quota<=0)return;let o=100-r.percentRemaining;for(let s=rPt.length-1;s>=0;s--){let c=rPt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(rPt[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get($6).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get($6).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${KWr(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function D9e(t){let e=await t.get(zr).getSession();if(e){let r=await mhe(t,e);if(r.ok){let n=await r.json();t.get(hy).processUserInfoQuotaSnapshot(n)}}}a(D9e,"refreshUserQuota");f();f();var Yx=class{static{a(this,"RateLimitNotifier")}},N9e=class extends Yx{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var nPt=[50,75,90,95],ok=class extends py{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(Mo(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(Yx).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o<s&&n.delete(s)}checkThreshold(r,n,o){if(!r)return;let s=100-r.percentRemaining;for(let c=nPt.length-1;c>=0;c--){let l=nPt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(nPt[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=this.formatResetDate(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}formatResetDate(r){let n=new Date(r);if(Number.isNaN(n.getTime()))return r;let o=new Date,s=n.getFullYear()!==o.getFullYear();return new Intl.DateTimeFormat("en-US",s?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(n)}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};f();f();f();var V6="copilot-edits-session";f();f();f();f();function M9e(t,e,r,n,o,s,c){return p5r(t,e,r,o,n),{completionText:e,meanLogProb:Kso(t,r),meanAlternativeLogProb:Jso(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Cr(),finishReason:r.finish_reason}}a(M9e,"convertToAPIChoice");function Kso(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s<e.logprobs.token_logprobs.length-1&&o>0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){_r.exception(t,r,"Error calculating mean prob")}}a(Kso,"calculateMeanLogProb");function Jso(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s<e.logprobs.token_logprobs.length-1&&o>0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){_r.exception(t,r,"Error calculating mean prob")}}a(Jso,"calculateMeanAlternativeLogProb");function Xre(t,e){return QC(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Xre,"getTemperatureForSamples");var Xso={markdown:[`
|
|
2137
2137
|
|
|
2138
2138
|
|
|
2139
2139
|
`],python:[`
|
|
@@ -2279,7 +2279,7 @@ main().catch(e => { console.error(e); process.exit(1); });
|
|
|
2279
2279
|
`;await this.serializedAppend(c,l)}catch(r){je.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=J1.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+`
|
|
2280
2280
|
`;await this.serializedAppend(n,o)}catch(r){je.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=J1.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+`
|
|
2281
2281
|
`;await this.serializedAppend(n,o)}catch(r){je.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=J1.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+`
|
|
2282
|
-
`;await this.serializedAppend(n,o)}catch(r){je.debug(this.ctx,"Failed to append tool-in-out entry",r)}}serializedAppend(e,r){let o=(this.appendQueues.get(e)??Promise.resolve()).then(()=>this.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};f();var wUe=require("fs"),fk=le(require("path"));var XYr=require("stream");var qco={mkdir:a((t,e)=>wUe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>wUe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>wUe.promises.appendFile(t,e,r),"appendFile")},xUe,RUe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??qco,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){xUe=void 0,JYr(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return hr(this.ctx,Ke.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return xUe||(xUe=this.initHttpLogDir()),xUe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await mkt(this.basePath,this.toPersistenceFileOps()),r=fk.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{je.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{je.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=gkt(e);if(!r)return;let n=fk.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(fk.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{je.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(fk.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(fk.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},p=JSON.stringify(d,null,2);await this.fileOps.writeFile(fk.join(r,c),p,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(fk.join(m,c),p,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},p=JSON.stringify(d,null,2);await this.fileOps.writeFile(fk.join(n,c),p,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(fk.join(m,c),p,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},PUe=class extends H2{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new XYr.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};f();f();var QG=class t extends py{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new be("AutoModelService"),this._register(Mo(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(rl).getMetadata(),c;if(o.active.model.toLowerCase().includes("grok")&&n)c=[tn.Gpt41];else{let d=s.find(p=>p.id===o?.active?.model);d?.capabilities?.family?c=[d.capabilities.family]:c=[o.active.model]}let l=await this._ctx.get(Sa).getBestChatModelConfig(c);l.copilotSessionToken=o.active.sessionToken,l.autoModeDiscountedCost=o.active.discountedCost;let u=s.find(d=>d.capabilities.family===o.active.model);return l.originalBillingMultiplier=u?.billing?.multiplier??0,l}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await A8e(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var kUe="Auto",X1="auto",ZYr="custom",bo=class{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new Ja(e.get(Ci)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(rl).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n,o,s,c){if(n===X1)return await e.get(QG).resolveModelConfiguration(s??"unknown",c);if(n)return e.get(Sa).getBestChatModelConfig([n],void 0,!0);{let l=await e.get(Dt).getToken(),u=!!l.userInfo?.isTBBEnabled,d=!!l.userInfo?.isFreeUser,p=e.get(hy);if(!u&&p.quotaExhausted&&!d){let h=await e.get(rl).getFallbackModel();if(h?.id)return e.get(Sa).getBestChatModelConfig([h.id])}return e.get(Sa).getBestChatModelConfig(ay(r,u),o)}}static transformMessages(e,r){return r===tn.O1Ga||r===tn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=Akt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var mf=new be("fetchChat"),Hco=new Set([500,502,504]),jco=[1e3,1e4,1e4],DUe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let p=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(p==="not-sent")return{type:"canceled",reason:"before fetch request"};l=p}catch(p){if(Xp(p)||!Pb(p))throw p;mf.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(p)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw p}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(Vco(l.status)){mf.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let p=await this.retryAfterError(e,r,n,s,c);if(p&&"canceled"in p)return this.destroyResponseBody(e,l),p.canceled;p&&"response"in p&&(this.destroyResponseBody(e,l),l=p.response)}if(l.status!==200){let p=this.createTelemetryData(r.endpoint,e,r),h=await bo.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,p,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(hy).processQuotaHeaders(l.headers),e.get(ok).processRateLimitHeaders(l.headers);let u=zx.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){mf.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await Wco(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){mf.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}mf.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Ot.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=zx.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return OWr(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await Gco(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let p=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;mf.error(e,p),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),lt(e,"request.shownWarning",r),n.status===401)try{let p=await n.text(),h=JSON.parse(p);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Dt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return mf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let p=xX(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return zt(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:p??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:p,capiErrorCode:h}}if(n.status===466)return mf.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400&&c.includes("off_topic"))return{type:"failed",reason:"filtered as off_topic by intent classifier: message was not programming related",code:n.status};if(n.status===400&&c.includes("model_not_supported"))return{type:"failed",reason:o?`model is not supported: ${o}`:"model is not supported.",code:n.status};if(n.status==400&&c.includes("model_max_prompt_tokens_exceeded"))return{type:"failed",reason:"model max prompt tokens exceeded.",code:n.status};if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Dt).getToken();if(n.status===402){if(c.includes("free_quota_exceeded"))return{type:"failed",reason:u?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(u).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",code:n.status};if(c.includes("overage_limit_reached"))return{type:"failed",reason:"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.",code:n.status};if(c.includes("quota_exceeded")){let h=xX(n),m="";switch(h!==void 0&&(m=` Quota resets on ${new Date(Date.now()+h*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`),d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual":case"individual_pro":return{type:"failed",reason:`You've used your monthly AI Credits. Please enable additional overages, upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual_max":return{type:"failed",reason:`You've used your monthly AI Credits. Please enable additional overages or wait for your allowance to renew.${m}`,code:n.status};case"business":case"enterprise":return{type:"failed",reason:`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to enable additional overages or wait for your allowance to renew.${m}`,code:n.status};default:return{type:"failed",reason:`You've used your monthly AI Credits.${m}`,code:n.status}}}else if(c.includes("session_quota_exceeded")){let h=xX(n);return{type:"failed",reason:h!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+h*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.",code:n.status}}else if(c.includes("billing_not_configured"))return{type:"failed",reason:"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.",code:n.status};return{type:"failed",reason:"Quota Exceeded.",code:n.status}}return n.status===503?{type:"failed",reason:c,code:n.status}:(mf.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function Gco(t,e,r,n,o,s,c,l,u,d,p,h,m,g,A,y,E){let _=n===""&&o===""?r:jo(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});L9e(c,v,["messages"]),v.properties.headerRequestId=s,lt(t,"request.sent",v);let b=hc(),I=czr(u),x={...N1(t),...p.toCapiHeaders()};QI()&&(x=await ure(t,x)),c.messages?.some(R=>Array.isArray(R.content)?R.content.some(D=>"image_url"in D):!1)&&(x["Copilot-Vision-Request"]="true"),h&&(x["api-key"]=h),g&&(x[V6]=g),A&&(x["copilot-session-token"]=A),o==="v1/messages"&&!E&&(x["anthropic-beta"]="interleaved-thinking-2025-05-14"),c.messages&&c.messages.forEach(R=>{$co(R)&&R.tool_calls&&(R.tool_calls=R.tool_calls.map(D=>mzr(D)))});let P=ote(()=>IUe(t)?new RUe(t):void 0,void 0);return YM(t,_,l,I,s,c,y,x,void 0,m,P,e).then(R=>{let D=iO(R);v.extendWithRequestId(D);let k=hc()-b;return v.measurements.totalTimeMs=k,mf.info(t,`Request ${s} at <${_}> finished with ${R.status} status after ${k}ms`),mf.debug(t,"request.response properties",v.properties),mf.debug(t,"request.response measurements",v.measurements),mf.debug(t,"messages:",JSON.stringify(e)),lt(t,"request.response",v),P?new PUe(R,P,s,b):R}).catch(R=>{if(Xp(R))throw R;let D=v.extendedBy({error:"Network exception"});lt(t,"request.shownWarning",D),v.properties.message=String(pp(R,"name")??""),v.properties.code=String(pp(R,"code")??""),v.properties.errno=String(pp(R,"errno")??""),v.properties.type=String(pp(R,"type")??"");let k=hc()-b;throw v.measurements.totalTimeMs=k,mf.info(t,`Request ${s} at <${_}> rejected with ${String(R)} after ${k}ms`),mf.debug(t,"request.error properties",v.properties),mf.debug(t,"request.error measurements",v.measurements),lt(t,"request.error",v),R}).finally(()=>{tne(t,e,v)})}a(Gco,"fetchWithInstrumentation");function $co(t){return"tool_calls"in t}a($co,"isChatMessageWithToolCalls");function Vco(t){return Hco.has(t)}a(Vco,"shouldRetryStatusCode");async function Wco(t,e,r,n,o=jco){let s=t.get(ur),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(mf.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let p;try{await Promise.race([uT(d),new Promise(h=>{if(n.isCancellationRequested){h();return}p=n.onCancellationRequested(()=>{h()})})])}finally{p?.dispose()}}else await uT(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let p=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(p.status>=200&&p.status<300)return mf.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${p.status}: ${p.statusText??""}`,u=p.headers.get("x-github-request-id")??void 0,mf.info(t,`CAPI ping returned status ${p.status}, retrying ping...`)}catch(p){l=String(p),u=void 0,mf.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return mf.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(Wco,"checkNetworkConnectivity");f();var zco=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function NUe(t){let e=t.slice();return e.reverse(),eKr(e)||eKr(e.filter(r=>r.trim().length>0))}a(NUe,"isRepetitive");function eKr(t){let e=Yco(t);for(let r of zco){if(t.length<r.last_tokens_to_consider)continue;if(r.last_tokens_to_consider-1-e[r.last_tokens_to_consider-1]<=r.max_token_sequence_length)return!0}return!1}a(eKr,"isRepeatedPattern");function Yco(t){let e=Array(t.length).fill(0);e[0]=-1;let r=-1;for(let n=1;n<t.length;n++){for(;r>=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Yco,"kmp_prefix_function");var la=class{constructor(e){this.ctx=e;this.fetcher=new DUe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Cr(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},p=e.modelConfiguration;p&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&p.maxResponseTokens!==void 0&&(d.max_tokens=p.maxResponseTokens),d.stream=!!p.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Dt).getToken(),g=!h&&hr(this.ctx,Ke.EnableThinking);if(g&&m.getTokenValue("editor_preview_features")!=="0"&&e.modelConfiguration?.providerName===void 0&&MWr(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let k=hr(this.ctx,Ke.AnthropicThinkingEffort),F=k==="unset"||!k?v9e(e.modelConfiguration?.reasoningEfforts)??"medium":k;F!=="none"&&(d.thinking_effort=F)}else{let k=hr(this.ctx,Ke.AnthropicThinkingBudgetToken);if(k&&k>0){let F=k<1024?1024:k;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,F)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!Wre(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await wWr(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===As.Azure)if(e.modelConfiguration.deploymentUrl)A=RWr(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(E9e(e.modelConfiguration?.providerName))A=U2t[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=Db(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let k=p?await T9e(this.ctx,p):!1;y=b9e(p,k)}je.debug(this.ctx,`Endpoint routing: model=${p?.modelId}, supportedEndpoints=${JSON.stringify(p?.supportedEndpoints)}, selected=${y}`)}let v=p?.copilotSessionToken,b=e.authToken??m.token,I=zx.getStrategy(y),x=e.engineName??I.engineName,P={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:x,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:p?.supportsThinking,supportsAdaptiveThinking:p?.supportsAdaptiveThinking,reasoningEfforts:p?.reasoningEfforts,enableThinking:g};p&&(P.model=p.modelId),e.tools&&e.tools?.length>0&&(p===void 0||p.toolCalls)&&(P.tools=e.tools,P.tool_choice=e.tool_choice??"auto");let R=await this.fetch(P,o,r,n);if(c){let k=c.maxRetryAttempts??3;for(let F=1;F<=k&&!(!c.shouldRetry(R)||R.type==="failed"&&R.noRetry);F++){let M=R;if(await c.onRetry?.(M,F),M.type==="failed"&&M.retryAfter!==void 0&&M.retryAfter>0){let O=M.retryAfter;if(await new Promise(j=>{let B=setTimeout(()=>{N.dispose(),j()},O*1e3),N=r.onCancellationRequested(()=>{clearTimeout(B),N.dispose(),j()})}),r.isCancellationRequested)break}R=await this.fetch(P,o,r,n),zt(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:R.type,modelId:p?p.providerName?"custom-byok":p.modelId:"unknown"},{retryAfter:M.type==="failed"?M.retryAfter??-1:-1,resultCode:R.type==="failed"?R.code??-1:-1})}}let D=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,R,n,D,y),ite(()=>{if(s)return s.persistLLMRequest({requestId:P.ourRequestId,messages:P.messages,tools:P.tools,model:P.model,response:R,durationMs:D})},k=>je.debug(this.ctx,"persistLLMRequest failed",k)),R}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=eEe(r.chatCompletions,u=>this.postProcess(u,o));je.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)je.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:un(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:un(u.message?.content)??"",usage:u.usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>un(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return NUe(e.tokens)?(r.extendWithRequestId(e.requestId),lt(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return je.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(Xp(e))return{type:"canceled",reason:"network request aborted",requestId:r};{je.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof UG?!0:void 0}}}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),zt(this.ctx,"chatfetcher.response",c,l)}};f();f();f();f();f();f();f();f();var hp=class{static{a(this,"ConversationInspector")}};f();f();var mp=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},ykt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},Ekt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},ch=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new ykt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new Ekt(this._processor(e),this.id)}};f();f();var une=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},dne=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new une(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};f();var tKr=new be("EncodingConfigurationService"),pk=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),tKr.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),tKr.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};f();f();f();f();f();var rKr=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};f();var Kco=globalThis.performance&&typeof globalThis.performance.now=="function",MUe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=Kco&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var nKr=!1,Jco=!1,CEe;(B=>{B.None=a(()=>py.None,"None");function e(N){if(Jco){let{onDidAddListener:U}=N,Q=_Ee.create(),L=0;N.onDidAddListener=()=>{++L===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),U?.()}}}a(e,"_addLeakageTraceLogic");function r(N,U){return g(N,()=>{},0,void 0,!0,void 0,U)}B.defer=r,a(r,"defer");function n(N){return(U,Q=null,L)=>{let H=!1,$;return $=N(W=>{if(!H)return $?$.dispose():H=!0,U.call(Q,W)},null,L),H&&$.dispose(),$}}B.once=n,a(n,"once");function o(N,U){return B.once(B.filter(N,U))}B.onceIf=o,a(o,"onceIf");function s(N,U,Q){return h((L,H=null,$)=>N(W=>L.call(H,U(W)),null,$),Q)}B.map=s,a(s,"map");function c(N,U,Q){return h((L,H=null,$)=>N(W=>{U(W),L.call(H,W)},null,$),Q)}B.forEach=c,a(c,"forEach");function l(N,U,Q){return h((L,H=null,$)=>N(W=>U(W)&&L.call(H,W),null,$),Q)}B.filter=l,a(l,"filter");function u(N){return N}B.signal=u,a(u,"signal");function d(...N){return(U,Q=null,L)=>{let H=YWr(...N.map($=>$(W=>U.call(Q,W))));return m(H,L)}}B.any=d,a(d,"any");function p(N,U,Q,L){let H=Q;return s(N,$=>(H=U(H,$),H),L)}B.reduce=p,a(p,"reduce");function h(N,U){let Q,L={onWillAddFirstListener(){Q=N(H.fire,H)},onDidRemoveLastListener(){Q?.dispose()}};U||e(L);let H=new Z1(L);return U?.add(H),H.event}a(h,"snapshot");function m(N,U){return U instanceof Array?U.push(N):U&&U.add(N),N}a(m,"addAndReturnDisposable");function g(N,U,Q=100,L=!1,H=!1,$,W){let G,ce,J,Se=0,fe,Ne={leakWarningThreshold:$,onWillAddFirstListener(){G=N(Qe=>{Se++,ce=U(ce,Qe),L&&!J&&(Ve.fire(ce),ce=void 0),fe=a(()=>{let Je=ce;ce=void 0,J=void 0,(!L||Se>1)&&Ve.fire(Je),Se=0},"doFire"),typeof Q=="number"?(clearTimeout(J),J=setTimeout(fe,Q)):J===void 0&&(J=0,queueMicrotask(fe))})},onWillRemoveListener(){H&&Se>0&&fe?.()},onDidRemoveLastListener(){fe=void 0,G.dispose()}};W||e(Ne);let Ve=new Z1(Ne);return W?.add(Ve),Ve.event}B.debounce=g,a(g,"debounce");function A(N,U=0,Q){return B.debounce(N,(L,H)=>L?(L.push(H),L):[H],U,void 0,!0,void 0,Q)}B.accumulate=A,a(A,"accumulate");function y(N,U=(L,H)=>L===H,Q){let L=!0,H;return l(N,$=>{let W=L||!U($,H);return L=!1,H=$,W},Q)}B.latch=y,a(y,"latch");function E(N,U,Q){return[B.filter(N,U,Q),B.filter(N,L=>!U(L),Q)]}B.split=E,a(E,"split");function _(N,U=!1,Q=[],L){let H=Q.slice(),$=N(ce=>{H?H.push(ce):G.fire(ce)});L&&L.add($);let W=a(()=>{H?.forEach(ce=>G.fire(ce)),H=null},"flush"),G=new Z1({onWillAddFirstListener(){$||($=N(ce=>G.fire(ce)),L&&L.add($))},onDidAddFirstListener(){H&&(U?setTimeout(W):W())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return L&&L.add(G),G.event}B.buffer=_,a(_,"buffer");function v(N,U){return a((L,H,$)=>{let W=U(new I);return N(function(G){let ce=W.evaluate(G);ce!==b&&L.call(H,ce)},void 0,$)},"fn")}B.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class I{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(Q=>(U(Q),Q)),this}filter(U){return this.steps.push(Q=>U(Q)?Q:b),this}reduce(U,Q){let L=Q;return this.steps.push(H=>(L=U(L,H),L)),this}latch(U=(Q,L)=>Q===L){let Q=!0,L;return this.steps.push(H=>{let $=Q||!U(H,L);return Q=!1,L=H,$?H:b}),this}evaluate(U){for(let Q of this.steps)if(U=Q(U),U===b)break;return U}}function x(N,U,Q=L=>L){let L=a((...G)=>W.fire(Q(...G)),"fn"),H=a(()=>N.on(U,L),"onFirstListenerAdd"),$=a(()=>N.removeListener(U,L),"onLastListenerRemove"),W=new Z1({onWillAddFirstListener:H,onDidRemoveLastListener:$});return W.event}B.fromNodeEventEmitter=x,a(x,"fromNodeEventEmitter");function P(N,U,Q=L=>L){let L=a((...G)=>W.fire(Q(...G)),"fn"),H=a(()=>N.addEventListener(U,L),"onFirstListenerAdd"),$=a(()=>N.removeEventListener(U,L),"onLastListenerRemove"),W=new Z1({onWillAddFirstListener:H,onDidRemoveLastListener:$});return W.event}B.fromDOMEventEmitter=P,a(P,"fromDOMEventEmitter");function R(N,U){return new Promise(Q=>n(N)(Q,null,U))}B.toPromise=R,a(R,"toPromise");function D(N){let U=new Z1;return N.then(Q=>{U.fire(Q)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}B.fromPromise=D,a(D,"fromPromise");function k(N,U){return N(Q=>U.fire(Q))}B.forward=k,a(k,"forward");function F(N,U,Q){return U(Q),N(L=>U(L))}B.runAndSubscribe=F,a(F,"runAndSubscribe");class M{constructor(U,Q){this._observable=U;this._counter=0;this._hasChanged=!1;let L={onWillAddFirstListener:a(()=>{U.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{U.removeObserver(this)},"onDidRemoveLastListener")};Q||e(L),this.emitter=new Z1(L),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,Q){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function O(N,U){return new M(N,U).emitter.event}B.fromObservable=O,a(O,"fromObservable");function j(N){return(U,Q,L)=>{let H=0,$=!1,W={beginUpdate(){H++},endUpdate(){H--,H===0&&(N.reportChanges(),$&&($=!1,U.call(Q)))},handlePossibleChange(){},handleChange(){$=!0}};N.addObserver(W),N.reportChanges();let G={dispose(){N.removeObserver(W)}};return L instanceof G6?L.add(G):Array.isArray(L)&&L.push(G),G}}B.fromObservableLight=j,a(j,"fromObservableLight")})(CEe||={});var _kt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new MUe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},iKr=-1;var Ckt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,c]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${c}):`;console.warn(l),console.warn(s);let u=new vkt(l,s);this._errorHandler(u)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r<o)&&(e=[n,o],r=o);return e}},_Ee=class t{constructor(e){this.value=e}static{a(this,"Stacktrace")}static create(){let e=new Error;return new t(e.stack??"")}print(){console.warn(this.value.split(`
|
|
2282
|
+
`;await this.serializedAppend(n,o)}catch(r){je.debug(this.ctx,"Failed to append tool-in-out entry",r)}}serializedAppend(e,r){let o=(this.appendQueues.get(e)??Promise.resolve()).then(()=>this.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};f();var wUe=require("fs"),fk=le(require("path"));var XYr=require("stream");var qco={mkdir:a((t,e)=>wUe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>wUe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>wUe.promises.appendFile(t,e,r),"appendFile")},xUe,RUe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??qco,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){xUe=void 0,JYr(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return hr(this.ctx,Ke.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return xUe||(xUe=this.initHttpLogDir()),xUe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await mkt(this.basePath,this.toPersistenceFileOps()),r=fk.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{je.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{je.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=gkt(e);if(!r)return;let n=fk.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(fk.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{je.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(fk.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(fk.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},p=JSON.stringify(d,null,2);await this.fileOps.writeFile(fk.join(r,c),p,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(fk.join(m,c),p,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},p=JSON.stringify(d,null,2);await this.fileOps.writeFile(fk.join(n,c),p,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(fk.join(m,c),p,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},PUe=class extends H2{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new XYr.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};f();f();var QG=class t extends py{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new be("AutoModelService"),this._register(Mo(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(rl).getMetadata(),c;if(o.active.model.toLowerCase().includes("grok")&&n)c=[tn.Gpt41];else{let d=s.find(p=>p.id===o?.active?.model);d?.capabilities?.family?c=[d.capabilities.family]:c=[o.active.model]}let l=await this._ctx.get(Sa).getBestChatModelConfig(c);l.copilotSessionToken=o.active.sessionToken,l.autoModeDiscountedCost=o.active.discountedCost;let u=s.find(d=>d.capabilities.family===o.active.model);return l.originalBillingMultiplier=u?.billing?.multiplier??0,l}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await A8e(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var kUe="Auto",X1="auto",ZYr="custom",bo=class{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new Ja(e.get(Ci)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(rl).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n,o,s,c){if(n===X1)return await e.get(QG).resolveModelConfiguration(s??"unknown",c);if(n)return e.get(Sa).getBestChatModelConfig([n],void 0,!0);{let l=await e.get(Dt).getToken(),u=!!l.userInfo?.isTBBEnabled,d=!!l.userInfo?.isFreeUser,p=e.get(hy);if(!u&&p.quotaExhausted&&!d){let h=await e.get(rl).getFallbackModel();if(h?.id)return e.get(Sa).getBestChatModelConfig([h.id])}return e.get(Sa).getBestChatModelConfig(ay(r,u),o)}}static transformMessages(e,r){return r===tn.O1Ga||r===tn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=Akt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var mf=new be("fetchChat"),Hco=new Set([500,502,504]),jco=[1e3,1e4,1e4],DUe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let p=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(p==="not-sent")return{type:"canceled",reason:"before fetch request"};l=p}catch(p){if(Xp(p)||!Pb(p))throw p;mf.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(p)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw p}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(Vco(l.status)){mf.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let p=await this.retryAfterError(e,r,n,s,c);if(p&&"canceled"in p)return this.destroyResponseBody(e,l),p.canceled;p&&"response"in p&&(this.destroyResponseBody(e,l),l=p.response)}if(l.status!==200){let p=this.createTelemetryData(r.endpoint,e,r),h=await bo.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,p,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(hy).processQuotaHeaders(l.headers),e.get(ok).processRateLimitHeaders(l.headers);let u=zx.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){mf.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await Wco(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){mf.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}mf.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Ot.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=zx.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return OWr(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await Gco(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let p=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;mf.error(e,p),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),lt(e,"request.shownWarning",r),n.status===401)try{let p=await n.text(),h=JSON.parse(p);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Dt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return mf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let p=xX(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return zt(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:p??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:p,capiErrorCode:h}}if(n.status===466)return mf.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400&&c.includes("off_topic"))return{type:"failed",reason:"filtered as off_topic by intent classifier: message was not programming related",code:n.status};if(n.status===400&&c.includes("model_not_supported"))return{type:"failed",reason:o?`model is not supported: ${o}`:"model is not supported.",code:n.status};if(n.status==400&&c.includes("model_max_prompt_tokens_exceeded"))return{type:"failed",reason:"model max prompt tokens exceeded.",code:n.status};if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Dt).getToken();if(n.status===402){if(c.includes("free_quota_exceeded"))return{type:"failed",reason:u?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(u).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",code:n.status};if(c.includes("overage_limit_reached"))return{type:"failed",reason:"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.",code:n.status};if(c.includes("quota_exceeded"))if(d.userInfo?.isTBBEnabled){let h=xX(n),m="";switch(h!==void 0&&(m=` Quota resets on ${new Date(Date.now()+h*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`),d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual":case"individual_pro":return{type:"failed",reason:`You've used your monthly AI Credits. Please enable additional overages, upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual_max":return{type:"failed",reason:`You've used your monthly AI Credits. Please enable additional overages or wait for your allowance to renew.${m}`,code:n.status};case"business":case"enterprise":return{type:"failed",reason:`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to enable additional overages or wait for your allowance to renew.${m}`,code:n.status};default:return{type:"failed",reason:`You've used your monthly AI Credits.${m}`,code:n.status}}}else switch(d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.",code:n.status};case"individual":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.",code:n.status};case"individual_pro":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.",code:n.status};case"business":case"enterprise":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.",code:n.status};default:return{type:"failed",reason:"You've reached your monthly chat messages quota.",code:n.status}}else if(c.includes("session_quota_exceeded")){let h=xX(n);return{type:"failed",reason:h!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+h*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.",code:n.status}}else if(c.includes("billing_not_configured"))return{type:"failed",reason:"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.",code:n.status};return{type:"failed",reason:"Quota Exceeded.",code:n.status}}return n.status===503?{type:"failed",reason:c,code:n.status}:(mf.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function Gco(t,e,r,n,o,s,c,l,u,d,p,h,m,g,A,y,E){let _=n===""&&o===""?r:jo(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});L9e(c,v,["messages"]),v.properties.headerRequestId=s,lt(t,"request.sent",v);let b=hc(),I=czr(u),x={...N1(t),...p.toCapiHeaders()};QI()&&(x=await ure(t,x)),c.messages?.some(R=>Array.isArray(R.content)?R.content.some(D=>"image_url"in D):!1)&&(x["Copilot-Vision-Request"]="true"),h&&(x["api-key"]=h),g&&(x[V6]=g),A&&(x["copilot-session-token"]=A),o==="v1/messages"&&!E&&(x["anthropic-beta"]="interleaved-thinking-2025-05-14"),c.messages&&c.messages.forEach(R=>{$co(R)&&R.tool_calls&&(R.tool_calls=R.tool_calls.map(D=>mzr(D)))});let P=ote(()=>IUe(t)?new RUe(t):void 0,void 0);return YM(t,_,l,I,s,c,y,x,void 0,m,P,e).then(R=>{let D=iO(R);v.extendWithRequestId(D);let k=hc()-b;return v.measurements.totalTimeMs=k,mf.info(t,`Request ${s} at <${_}> finished with ${R.status} status after ${k}ms`),mf.debug(t,"request.response properties",v.properties),mf.debug(t,"request.response measurements",v.measurements),mf.debug(t,"messages:",JSON.stringify(e)),lt(t,"request.response",v),P?new PUe(R,P,s,b):R}).catch(R=>{if(Xp(R))throw R;let D=v.extendedBy({error:"Network exception"});lt(t,"request.shownWarning",D),v.properties.message=String(pp(R,"name")??""),v.properties.code=String(pp(R,"code")??""),v.properties.errno=String(pp(R,"errno")??""),v.properties.type=String(pp(R,"type")??"");let k=hc()-b;throw v.measurements.totalTimeMs=k,mf.info(t,`Request ${s} at <${_}> rejected with ${String(R)} after ${k}ms`),mf.debug(t,"request.error properties",v.properties),mf.debug(t,"request.error measurements",v.measurements),lt(t,"request.error",v),R}).finally(()=>{tne(t,e,v)})}a(Gco,"fetchWithInstrumentation");function $co(t){return"tool_calls"in t}a($co,"isChatMessageWithToolCalls");function Vco(t){return Hco.has(t)}a(Vco,"shouldRetryStatusCode");async function Wco(t,e,r,n,o=jco){let s=t.get(ur),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(mf.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let p;try{await Promise.race([uT(d),new Promise(h=>{if(n.isCancellationRequested){h();return}p=n.onCancellationRequested(()=>{h()})})])}finally{p?.dispose()}}else await uT(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let p=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(p.status>=200&&p.status<300)return mf.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${p.status}: ${p.statusText??""}`,u=p.headers.get("x-github-request-id")??void 0,mf.info(t,`CAPI ping returned status ${p.status}, retrying ping...`)}catch(p){l=String(p),u=void 0,mf.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return mf.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(Wco,"checkNetworkConnectivity");f();var zco=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function NUe(t){let e=t.slice();return e.reverse(),eKr(e)||eKr(e.filter(r=>r.trim().length>0))}a(NUe,"isRepetitive");function eKr(t){let e=Yco(t);for(let r of zco){if(t.length<r.last_tokens_to_consider)continue;if(r.last_tokens_to_consider-1-e[r.last_tokens_to_consider-1]<=r.max_token_sequence_length)return!0}return!1}a(eKr,"isRepeatedPattern");function Yco(t){let e=Array(t.length).fill(0);e[0]=-1;let r=-1;for(let n=1;n<t.length;n++){for(;r>=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Yco,"kmp_prefix_function");var la=class{constructor(e){this.ctx=e;this.fetcher=new DUe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Cr(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},p=e.modelConfiguration;p&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&p.maxResponseTokens!==void 0&&(d.max_tokens=p.maxResponseTokens),d.stream=!!p.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Dt).getToken(),g=!h&&hr(this.ctx,Ke.EnableThinking);if(g&&m.getTokenValue("editor_preview_features")!=="0"&&e.modelConfiguration?.providerName===void 0&&MWr(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let k=hr(this.ctx,Ke.AnthropicThinkingEffort),F=k==="unset"||!k?v9e(e.modelConfiguration?.reasoningEfforts)??"medium":k;F!=="none"&&(d.thinking_effort=F)}else{let k=hr(this.ctx,Ke.AnthropicThinkingBudgetToken);if(k&&k>0){let F=k<1024?1024:k;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,F)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!Wre(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await wWr(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===As.Azure)if(e.modelConfiguration.deploymentUrl)A=RWr(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(E9e(e.modelConfiguration?.providerName))A=U2t[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=Db(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let k=p?await T9e(this.ctx,p):!1;y=b9e(p,k)}je.debug(this.ctx,`Endpoint routing: model=${p?.modelId}, supportedEndpoints=${JSON.stringify(p?.supportedEndpoints)}, selected=${y}`)}let v=p?.copilotSessionToken,b=e.authToken??m.token,I=zx.getStrategy(y),x=e.engineName??I.engineName,P={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:x,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:p?.supportsThinking,supportsAdaptiveThinking:p?.supportsAdaptiveThinking,reasoningEfforts:p?.reasoningEfforts,enableThinking:g};p&&(P.model=p.modelId),e.tools&&e.tools?.length>0&&(p===void 0||p.toolCalls)&&(P.tools=e.tools,P.tool_choice=e.tool_choice??"auto");let R=await this.fetch(P,o,r,n);if(c){let k=c.maxRetryAttempts??3;for(let F=1;F<=k&&!(!c.shouldRetry(R)||R.type==="failed"&&R.noRetry);F++){let M=R;if(await c.onRetry?.(M,F),M.type==="failed"&&M.retryAfter!==void 0&&M.retryAfter>0){let O=M.retryAfter;if(await new Promise(j=>{let B=setTimeout(()=>{N.dispose(),j()},O*1e3),N=r.onCancellationRequested(()=>{clearTimeout(B),N.dispose(),j()})}),r.isCancellationRequested)break}R=await this.fetch(P,o,r,n),zt(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:R.type,modelId:p?p.providerName?"custom-byok":p.modelId:"unknown"},{retryAfter:M.type==="failed"?M.retryAfter??-1:-1,resultCode:R.type==="failed"?R.code??-1:-1})}}let D=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,R,n,D,y),ite(()=>{if(s)return s.persistLLMRequest({requestId:P.ourRequestId,messages:P.messages,tools:P.tools,model:P.model,response:R,durationMs:D})},k=>je.debug(this.ctx,"persistLLMRequest failed",k)),R}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=eEe(r.chatCompletions,u=>this.postProcess(u,o));je.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)je.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:un(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:un(u.message?.content)??"",usage:u.usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>un(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return NUe(e.tokens)?(r.extendWithRequestId(e.requestId),lt(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return je.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(Xp(e))return{type:"canceled",reason:"network request aborted",requestId:r};{je.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof UG?!0:void 0}}}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),zt(this.ctx,"chatfetcher.response",c,l)}};f();f();f();f();f();f();f();f();var hp=class{static{a(this,"ConversationInspector")}};f();f();var mp=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},ykt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},Ekt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},ch=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new ykt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new Ekt(this._processor(e),this.id)}};f();f();var une=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},dne=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new une(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};f();var tKr=new be("EncodingConfigurationService"),pk=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),tKr.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),tKr.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};f();f();f();f();f();var rKr=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};f();var Kco=globalThis.performance&&typeof globalThis.performance.now=="function",MUe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=Kco&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var nKr=!1,Jco=!1,CEe;(B=>{B.None=a(()=>py.None,"None");function e(N){if(Jco){let{onDidAddListener:U}=N,Q=_Ee.create(),L=0;N.onDidAddListener=()=>{++L===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),U?.()}}}a(e,"_addLeakageTraceLogic");function r(N,U){return g(N,()=>{},0,void 0,!0,void 0,U)}B.defer=r,a(r,"defer");function n(N){return(U,Q=null,L)=>{let H=!1,$;return $=N(W=>{if(!H)return $?$.dispose():H=!0,U.call(Q,W)},null,L),H&&$.dispose(),$}}B.once=n,a(n,"once");function o(N,U){return B.once(B.filter(N,U))}B.onceIf=o,a(o,"onceIf");function s(N,U,Q){return h((L,H=null,$)=>N(W=>L.call(H,U(W)),null,$),Q)}B.map=s,a(s,"map");function c(N,U,Q){return h((L,H=null,$)=>N(W=>{U(W),L.call(H,W)},null,$),Q)}B.forEach=c,a(c,"forEach");function l(N,U,Q){return h((L,H=null,$)=>N(W=>U(W)&&L.call(H,W),null,$),Q)}B.filter=l,a(l,"filter");function u(N){return N}B.signal=u,a(u,"signal");function d(...N){return(U,Q=null,L)=>{let H=YWr(...N.map($=>$(W=>U.call(Q,W))));return m(H,L)}}B.any=d,a(d,"any");function p(N,U,Q,L){let H=Q;return s(N,$=>(H=U(H,$),H),L)}B.reduce=p,a(p,"reduce");function h(N,U){let Q,L={onWillAddFirstListener(){Q=N(H.fire,H)},onDidRemoveLastListener(){Q?.dispose()}};U||e(L);let H=new Z1(L);return U?.add(H),H.event}a(h,"snapshot");function m(N,U){return U instanceof Array?U.push(N):U&&U.add(N),N}a(m,"addAndReturnDisposable");function g(N,U,Q=100,L=!1,H=!1,$,W){let G,ce,J,Se=0,fe,Ne={leakWarningThreshold:$,onWillAddFirstListener(){G=N(Qe=>{Se++,ce=U(ce,Qe),L&&!J&&(Ve.fire(ce),ce=void 0),fe=a(()=>{let Je=ce;ce=void 0,J=void 0,(!L||Se>1)&&Ve.fire(Je),Se=0},"doFire"),typeof Q=="number"?(clearTimeout(J),J=setTimeout(fe,Q)):J===void 0&&(J=0,queueMicrotask(fe))})},onWillRemoveListener(){H&&Se>0&&fe?.()},onDidRemoveLastListener(){fe=void 0,G.dispose()}};W||e(Ne);let Ve=new Z1(Ne);return W?.add(Ve),Ve.event}B.debounce=g,a(g,"debounce");function A(N,U=0,Q){return B.debounce(N,(L,H)=>L?(L.push(H),L):[H],U,void 0,!0,void 0,Q)}B.accumulate=A,a(A,"accumulate");function y(N,U=(L,H)=>L===H,Q){let L=!0,H;return l(N,$=>{let W=L||!U($,H);return L=!1,H=$,W},Q)}B.latch=y,a(y,"latch");function E(N,U,Q){return[B.filter(N,U,Q),B.filter(N,L=>!U(L),Q)]}B.split=E,a(E,"split");function _(N,U=!1,Q=[],L){let H=Q.slice(),$=N(ce=>{H?H.push(ce):G.fire(ce)});L&&L.add($);let W=a(()=>{H?.forEach(ce=>G.fire(ce)),H=null},"flush"),G=new Z1({onWillAddFirstListener(){$||($=N(ce=>G.fire(ce)),L&&L.add($))},onDidAddFirstListener(){H&&(U?setTimeout(W):W())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return L&&L.add(G),G.event}B.buffer=_,a(_,"buffer");function v(N,U){return a((L,H,$)=>{let W=U(new I);return N(function(G){let ce=W.evaluate(G);ce!==b&&L.call(H,ce)},void 0,$)},"fn")}B.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class I{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(Q=>(U(Q),Q)),this}filter(U){return this.steps.push(Q=>U(Q)?Q:b),this}reduce(U,Q){let L=Q;return this.steps.push(H=>(L=U(L,H),L)),this}latch(U=(Q,L)=>Q===L){let Q=!0,L;return this.steps.push(H=>{let $=Q||!U(H,L);return Q=!1,L=H,$?H:b}),this}evaluate(U){for(let Q of this.steps)if(U=Q(U),U===b)break;return U}}function x(N,U,Q=L=>L){let L=a((...G)=>W.fire(Q(...G)),"fn"),H=a(()=>N.on(U,L),"onFirstListenerAdd"),$=a(()=>N.removeListener(U,L),"onLastListenerRemove"),W=new Z1({onWillAddFirstListener:H,onDidRemoveLastListener:$});return W.event}B.fromNodeEventEmitter=x,a(x,"fromNodeEventEmitter");function P(N,U,Q=L=>L){let L=a((...G)=>W.fire(Q(...G)),"fn"),H=a(()=>N.addEventListener(U,L),"onFirstListenerAdd"),$=a(()=>N.removeEventListener(U,L),"onLastListenerRemove"),W=new Z1({onWillAddFirstListener:H,onDidRemoveLastListener:$});return W.event}B.fromDOMEventEmitter=P,a(P,"fromDOMEventEmitter");function R(N,U){return new Promise(Q=>n(N)(Q,null,U))}B.toPromise=R,a(R,"toPromise");function D(N){let U=new Z1;return N.then(Q=>{U.fire(Q)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}B.fromPromise=D,a(D,"fromPromise");function k(N,U){return N(Q=>U.fire(Q))}B.forward=k,a(k,"forward");function F(N,U,Q){return U(Q),N(L=>U(L))}B.runAndSubscribe=F,a(F,"runAndSubscribe");class M{constructor(U,Q){this._observable=U;this._counter=0;this._hasChanged=!1;let L={onWillAddFirstListener:a(()=>{U.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{U.removeObserver(this)},"onDidRemoveLastListener")};Q||e(L),this.emitter=new Z1(L),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,Q){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function O(N,U){return new M(N,U).emitter.event}B.fromObservable=O,a(O,"fromObservable");function j(N){return(U,Q,L)=>{let H=0,$=!1,W={beginUpdate(){H++},endUpdate(){H--,H===0&&(N.reportChanges(),$&&($=!1,U.call(Q)))},handlePossibleChange(){},handleChange(){$=!0}};N.addObserver(W),N.reportChanges();let G={dispose(){N.removeObserver(W)}};return L instanceof G6?L.add(G):Array.isArray(L)&&L.push(G),G}}B.fromObservableLight=j,a(j,"fromObservableLight")})(CEe||={});var _kt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new MUe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},iKr=-1;var Ckt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,c]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${c}):`;console.warn(l),console.warn(s);let u=new vkt(l,s);this._errorHandler(u)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r<o)&&(e=[n,o],r=o);return e}},_Ee=class t{constructor(e){this.value=e}static{a(this,"Stacktrace")}static create(){let e=new Error;return new t(e.stack??"")}print(){console.warn(this.value.split(`
|
|
2283
2283
|
`).slice(2).join(`
|
|
2284
2284
|
`))}},vkt=class extends Error{static{a(this,"ListenerLeakError")}constructor(e,r){super(e),this.name="ListenerLeakError",this.stack=r}},bkt=class extends Error{static{a(this,"ListenerRefusalError")}constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},Xco=0,fne=class{constructor(e){this.value=e;this.id=Xco++}static{a(this,"UniqueContainer")}},Zco=2,elo=a((t,e)=>{if(t instanceof fne)e(t);else for(let r=0;r<t.length;r++){let n=t[r];n&&e(n)}},"forEachListener"),Z1=class{constructor(e){this._size=0;this._options=e,this._leakageMon=iKr>0||this._options?.leakWarningThreshold?new Ckt(e?.onListenerError??zre,this._options?.leakWarningThreshold??iKr):void 0,this._perfMon=this._options?._profName?new _kt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(nKr){let e=this._listeners;queueMicrotask(()=>{elo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],p=new bkt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||zre)(p),py.None}if(this._disposed)return py.None;r&&(e=e.bind(r));let o=new fne(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=_Ee.create(),s=this._leakageMon.check(o.stack,this._size+1)),nKr&&(o.stack=c??_Ee.create()),this._listeners?this._listeners instanceof fne?(this._deliveryQueue??=new Tkt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=k9e(()=>{s?.(),this._removeListener(o)});return n instanceof G6?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Zco<=r.length){let s=0;for(let c=0;c<r.length;c++)r[c]?r[s++]=r[c]:o&&s<this._deliveryQueue.end&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=s}}_deliver(e,r){if(!e)return;let n=this._options?.onListenerError||zre;if(!n){e.value(r);return}try{e.value(r)}catch(o){n(o)}}_deliverQueue(e){let r=e.current._listeners;for(;e.i<e.end;)this._deliver(r[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof fne)this._deliver(this._listeners,e);else{let r=this._deliveryQueue;r.enqueue(this,e,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}};var Tkt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var oKr=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),tlo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof Skt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:CEe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:oKr})})(tlo||={});var Skt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?oKr:(this._emitter||(this._emitter=new Z1),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function nlo(t){return t}a(nlo,"identity");var OUe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=nlo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};f();f();var sF=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};f();function Ikt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Ikt,"escapeRegExpCharacters");function uKr(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(uKr,"ltrim");function BUe(t){return t.split(/\r\n|\r|\n/)}a(BUe,"splitLines");function xkt(t,e){return t<e?-1:t>e?1:0}a(xkt,"compare");function LUe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r<n&&o<s;r++,o++){let u=t.charCodeAt(r),d=e.charCodeAt(o);if(u<d)return-1;if(u>d)return 1}let c=n-r,l=s-o;return c<l?-1:c>l?1:0}a(LUe,"compareSubstring");function wkt(t,e){return bEe(t,e,0,t.length,0,e.length)}a(wkt,"compareIgnoreCase");function bEe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r<n&&o<s;r++,o++){let u=t.charCodeAt(r),d=e.charCodeAt(o);if(u===d)continue;if(u>=128||d>=128)return LUe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);sKr(u)&&(u-=32),sKr(d)&&(d-=32);let p=u-d;if(p!==0)return p}let c=n-r,l=s-o;return c<l?-1:c>l?1:0}a(bEe,"compareSubstringIgnoreCase");function sKr(t){return t>=97&&t<=122}a(sKr,"isLowerAsciiLetter");function dKr(t,e){let r=e.length;return e.length>t.length?!1:bEe(t,e,0,r)===0}a(dKr,"startsWithIgnoreCase");function pne(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n<r;n++)if(t.charCodeAt(n)!==e.charCodeAt(n))return n;return r}a(pne,"commonPrefixLength");function TEe(t,e){let r=Math.min(t.length,e.length),n,o=t.length-1,s=e.length-1;for(n=0;n<r;n++)if(t.charCodeAt(o-n)!==e.charCodeAt(s-n))return n;return r}a(TEe,"commonSuffixLength");var L9l=String.fromCharCode(65279);function ilo(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(ilo,"startsWithUTF8BOM");function fKr(t){return ilo(t)?t.substr(1):t}a(fKr,"stripUTF8BOM");var aKr=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=olo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(e<r[3*o])o=2*o;else if(e>r[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function olo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(olo,"getGraphemeBreakRawData");var cKr=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new sF(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new OUe({getCacheKey:JSON.stringify},e=>{function r(p){let h=new Map;for(let m=0;m<p.length;m+=2)h.set(p[m],p[m+1]);return h}a(r,"arrayToMap");function n(p,h){let m=new Map(p);for(let[g,A]of h)m.set(g,A);return m}a(n,"mergeMaps");function o(p,h){if(!p)return h;let m=new Map;for(let[g,A]of p)h.has(g)&&m.set(g,A);return m}a(o,"intersectMaps");let s=this.ambiguousCharacterData.value,c=e.filter(p=>!p.startsWith("_")&&p in s);c.length===0&&(c=["_default"]);let l;for(let p of c){let h=r(s[p]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new sF(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(typeof n=="number"&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},lKr=class t{static{a(this,"InvisibleCharacters")}static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static{this._data=void 0}static getData(){return this._data||(this._data=new Set(t.getRawData())),this._data}static isInvisibleCharacter(e){return t.getData().has(e)}static containsInvisibleCharacter(e){for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(typeof n=="number"&&t.isInvisibleCharacter(n))return!0}return!1}static get codePoints(){return t.getData()}};f();f();f();f();var SEe={isBlocked:!1,reason:"VALID_FILE"},FUe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},pKr={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},qG={all:"all",repo:"repo"},aF=new be("contentExclusion");f();f();var UUe=class{static{a(this,"PolicyEvaluator")}};f();f();f();var hKr=new be("repository"),HG=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},rw=class{static{a(this,"GitConfigLoader")}},QUe=class extends rw{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};f();var mKr=require("os");var qUe=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return cL.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=cL.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?<host>[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,mKr.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var HUe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(rw).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new qUe(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var slo=100,Rkt=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?<tenant>[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?<org>[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},Em=class t{constructor(e){this.ctx=e;this.remoteResolver=new HUe;this.cache=new Vr(slo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=Bu(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new Rkt(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get($i),o=jo(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=jo(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=Bq(r,s[1]),l=jo(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=jo(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=jo(c,"commondir");c=Bq(c,(await e.readFileString(d)).trimEnd());let p=jo(c,"config");return await e.stat(p),p}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};f();var jG=a((t,e)=>{if(WP.Check(t,e))return e;let r=`Typebox schema validation failed:
|
|
2285
2285
|
${[...WP.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(`
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "git+https://github.com/github/copilot-language-server-release.git"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "1.474.
|
|
14
|
+
"version": "1.474.7",
|
|
15
15
|
"bin": {
|
|
16
16
|
"copilot-language-server": "../dist/language-server.js"
|
|
17
17
|
},
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"vscode-languageserver-protocol": "^3.17.5"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@github/copilot-language-server-win32-x64": "1.474.
|
|
43
|
-
"@github/copilot-language-server-win32-arm64": "1.474.
|
|
44
|
-
"@github/copilot-language-server-linux-x64": "1.474.
|
|
45
|
-
"@github/copilot-language-server-linux-arm64": "1.474.
|
|
46
|
-
"@github/copilot-language-server-darwin-x64": "1.474.
|
|
47
|
-
"@github/copilot-language-server-darwin-arm64": "1.474.
|
|
42
|
+
"@github/copilot-language-server-win32-x64": "1.474.7",
|
|
43
|
+
"@github/copilot-language-server-win32-arm64": "1.474.7",
|
|
44
|
+
"@github/copilot-language-server-linux-x64": "1.474.7",
|
|
45
|
+
"@github/copilot-language-server-linux-arm64": "1.474.7",
|
|
46
|
+
"@github/copilot-language-server-darwin-x64": "1.474.7",
|
|
47
|
+
"@github/copilot-language-server-darwin-arm64": "1.474.7"
|
|
48
48
|
},
|
|
49
49
|
"buildType": "prod",
|
|
50
|
-
"build": "
|
|
50
|
+
"build": "162"
|
|
51
51
|
}
|