@opensumi/cli-engine 3.9.1-next-1778742934.0 → 3.9.1-next-1778757454.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/browser.js +2 -2
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -33388,13 +33388,13 @@ ${(0,o.localize)("workspace.trust.dialog.message",`\u5F53\u524D IDE \u63D0\u4F9B
|
|
|
33388
33388
|
`)}))}}}t.TextMateTokenizer=_},54324:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextmateService=void 0,t.getEncodedLanguageId=b,t.getLegalThemeName=A;const n=e(85608),r=e(27107),o=e(25726),l=e(76003),_=e(41869),v=e(6858),p=e(43718),m=e(42933),s=e(52902),g=e(33096),a=e(89944),h=e(96068),d=e(14162),u=e(16781),E=e(96689),f=e(41977),c=e(58837);let y=!1;function b(I){return s.monaco.languages.getEncodedLanguageId(I)}function A(I){return I.toLowerCase().replace(/[^a-z0-9-]/g,"-")}class S{createOnigScanner(R){return new r.OnigScanner(R)}createOnigString(R){return new r.OnigString(R)}}function D(I){if(!Array.isArray(I))return!1;for(let R=0,M=I.length;R<M;R++)if(typeof I[R]!="string")return!1;return!0}function T(I){return D(I)&&I.length===2}let w=class extends _.WithEventBus{constructor(){super(...arguments),this.registeredGrammarDisposableCollection=new Map,this.injections=new Map,this.activatedLanguage=new Set,this.languageConfigLocation=new Map,this.languageConfiguration=new Map,this.initialized=!1,this.dynamicLanguages=[]}init(){this.initGrammarRegistry(),this.listenThemeChange(),this.listenPreferenceChange()}listenThemeChange(){this.eventBus.on(a.ThemeChangedEvent,R=>{const M=R.payload.theme.themeData;M!==this.editorTheme&&(this.editorTheme=M,this.setTheme(M))})}async registerLanguage(R,M){return this.registerLanguages([R],M)}reviveLanguageConfiguration(R,M){return{wordPattern:this.createRegex(M.wordPattern),autoClosingPairs:this.extractValidAutoClosingPairs(R,M),brackets:this.extractValidBrackets(R,M),comments:this.extractValidCommentRule(R,M),folding:this.convertFolding(M.folding),surroundingPairs:this.extractValidSurroundingPairs(R,M),indentationRules:this.convertIndentationRules(M.indentationRules),autoCloseBefore:M.autoCloseBefore,colorizedBracketPairs:this.extractValidColorizedBracketPairs(R,M),onEnterRules:this.extractValidOnEnterRules(R,M)}}get monacoLanguageService(){return u.StandaloneServices.get(d.ILanguageService)}isEmbeddedLanguageOnly(R){return!R.filenames&&!R.extensions&&!R.filenamePatterns&&!R.firstLine&&!R.mimetypes&&(!R.aliases||R.aliases.length===0)}async registerLanguages(R,M){const O=R.map(x=>({id:x.id,aliases:x.aliases,extensions:x.extensions,filenamePatterns:x.filenamePatterns,filenames:x.filenames,firstLine:x.firstLine,mimetypes:x.mimetypes}));if(this.dynamicLanguages.push(...O.filter(x=>!this.isEmbeddedLanguageOnly(x))),this.monacoLanguageService._registry._registerLanguages(O),R.forEach(async x=>{this.languageConfigLocation.set(x.id,M),this.addDispose(s.monaco.languages.onLanguage(x.id,async()=>{await this.loadLanguageConfiguration(x,M),this.activateLanguage(x.id)})),this.languageConfiguration.set(x.id,x)}),this.initialized){const x=this.editorDocumentModelService.getAllModels().map(k=>k.uri);for(const k of x){const F=this.editorDocumentModelService.getModelReference(p.URI.parse(k.codeUri.toString()));if(F&&F.instance){const L=F.instance.getMonacoModel().getLanguageId();if(this.languageConfiguration.has(L)){const N=this.languageConfigLocation.get(L);await this.loadLanguageConfiguration(this.languageConfiguration.get(L),N),this.activateLanguage(L)}}F?.dispose()}}}async registerGrammar(R,M){if(R.path){const O=R.path.replace(/^\.\//,"");R.location=M.resolve(O)}this.doRegisterGrammar(R)}unregisterGrammar(R){const M=this.registeredGrammarDisposableCollection.get(R.scopeName);M&&M.dispose()}doRegisterGrammar(R){const M=new p.Disposable;if(R.injectTo)for(const O of R.injectTo){let x=this.injections.get(O);x||(x=[],M.addDispose(p.Disposable.create(()=>{this.injections.delete(O)})),this.injections.set(O,x)),x.push(R.scopeName)}M.addDispose(p.Disposable.create(this.textmateRegistry.registerTextmateGrammarScope(R.scopeName,{async getGrammarDefinition(){return{format:/\.json$/.test(R.path)?"json":"plist",location:R.location,content:await R.resolvedConfiguration}},getInjections:O=>{const x=O.split(".");let k=[];for(let F=1;F<=x.length;F++){const L=x.slice(0,F).join(".");k=[...k,...this.injections.get(L)||[]]}return k}}))),R.language&&(M.addDispose(p.Disposable.create(this.textmateRegistry.mapLanguageIdToTextmateGrammar(R.language,R.scopeName))),M.addDispose(p.Disposable.create(this.textmateRegistry.registerGrammarConfiguration(R.language,()=>({embeddedLanguages:this.convertEmbeddedLanguages(R.embeddedLanguages),tokenTypes:this.convertTokenTypes(R.tokenTypes),balancedBracketSelectors:(0,h.asStringArray)(R.balancedBracketScopes,["*"]),unbalancedBracketSelectors:(0,h.asStringArray)(R.unbalancedBracketScopes,[])}))))),this.registeredGrammarDisposableCollection.set(R.scopeName,M)}async loadLanguageConfiguration(R,M){let O;if(typeof R.resolvedConfiguration=="object"){const x=await R.resolvedConfiguration;O=this.reviveLanguageConfiguration(R.id,x)}else if(R.configuration){const x=R.configuration.replace(/^\.\//,""),k=M.resolve(x),L=(await this.fileServiceClient.resolveContent(k.toString())).content;if(L){const N=this.safeParseJSON(L);N&&(O=this.reviveLanguageConfiguration(R.id,N))}}O&&s.monaco.languages.setLanguageConfiguration(R.id,O)}async activateLanguage(R){this.eventBus.fire(new _.ExtensionActivateEvent({topic:"onLanguage",data:R})),!this.activatedLanguage.has(R)&&(this.activatedLanguage.add(R),this.setTokensProviderByLanguageId(R))}async setTokensProviderByLanguageId(R){const M=this.textmateRegistry.getScope(R);if(!M||!this.textmateRegistry.getProvider(M))return;const x={lineLimit:this.preferenceService.getValid("editor.maxTokenizationLineLength",2e4)},k=this.textmateRegistry.getGrammarConfiguration(R)(),F=b(R);try{const L=await this.grammarRegistry.loadGrammarWithConfiguration(M,F,k),N=k.tokenizerOption?k.tokenizerOption:x,U=k.embeddedLanguages&&Object.keys(k.embeddedLanguages).length>0;if(L){const W=new c.TextMateTokenizer(L,N,U);this.addDispose(W.onDidEncounterLanguage(async j=>{const Q=this.monacoLanguageService._registry.languageIdCodec.decodeLanguageId(j),G=this.languageConfigLocation.get(Q);G&&this.languageConfiguration.has(Q)&&(await this.loadLanguageConfiguration(this.languageConfiguration.get(Q),G),this.activateLanguage(Q))})),s.monaco.languages.setTokensProvider(R,W)}}catch(L){this.logger.warn("No grammar for this language id",R,L)}}setTheme(R){this.generateEncodedTokenColors(R),s.monaco.editor.defineTheme(A(R.name),R),s.monaco.editor.setTheme(A(R.name))}generateEncodedTokenColors(R){this.grammarRegistry.setTheme(R),R.encodedTokensColors=this.grammarRegistry.getColorMap(),R.encodedTokensColors[0]=null}createRegex(R){if(typeof R=="string")return new RegExp(R,"");if((0,p.isObject)(R)){if(typeof R.pattern!="string"||typeof R.flags<"u"&&typeof R.flags!="string")return;try{return new RegExp(R.pattern,R.flags)}catch{return}}}safeParseJSON(R){let M;try{return M=(0,_.parseWithComments)(R),M}catch(O){this.logger.error(`Language configuration file parsing error, ${O.stack}`);return}}convertFolding(R){if(!R)return;const M={offSide:R.offSide};return R.markers&&(M.markers={end:R.markers.end,start:R.markers.start}),M}convertIndentationRules(R){if(!R)return;const M={decreaseIndentPattern:this.createRegex(R.decreaseIndentPattern),increaseIndentPattern:this.createRegex(R.increaseIndentPattern)};return R.indentNextLinePattern&&(M.indentNextLinePattern=this.createRegex(R.indentNextLinePattern)),R.unIndentedLinePattern&&(M.unIndentedLinePattern=this.createRegex(R.unIndentedLinePattern)),M}convertEmbeddedLanguages(R){if(typeof R>"u"||R===null)return;const M=Object.create(null),O=Object.keys(R),x=O.length;for(let k=0;k<x;k++){const F=O[k],L=R[F];M[F]=b(L)}return M}convertTokenTypes(R){if(typeof R>"u"||R===null)return;const M=Object.create(null),O=Object.keys(R),x=O.length;for(let k=0;k<x;k++){const F=O[k];switch(R[F]){case"string":M[F]=2;break;case"other":M[F]=0;break;case"comment":M[F]=1;break}}return M}extractValidSurroundingPairs(R,M){if(!M)return;const O=M.surroundingPairs;if(typeof O>"u")return;if(!Array.isArray(O)){this.logger.warn(`[${R}: language configuration: expected \`surroundingPairs\` to be an array.`);return}let x;for(let k=0,F=O.length;k<F;k++){const L=O[k];if(Array.isArray(L)){if(!T(L)){this.logger.warn(`[${R}: language configuration: expected \`surroundingPairs[${k}]\` to be an array of two strings or an object.`);continue}x=x||[],x.push({open:L[0],close:L[1]})}else{if(typeof L!="object"){this.logger.warn(`[${R}: language configuration: expected \`surroundingPairs[${k}]\` to be an array of two strings or an object.`);continue}if(typeof L.open!="string"){this.logger.warn(`[${R}: language configuration: expected \`surroundingPairs[${k}].open\` to be a string.`);continue}if(typeof L.close!="string"){this.logger.warn(`[${R}: language configuration: expected \`surroundingPairs[${k}].close\` to be a string.`);continue}x=x||[],x.push({open:L.open,close:L.close})}}return x}extractValidColorizedBracketPairs(R,M){const O=M.colorizedBracketPairs;if(typeof O>"u")return;if(!Array.isArray(O)){this.logger.warn(`[${R}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const x=[];for(let k=0,F=O.length;k<F;k++){const L=O[k];if(!T(L)){this.logger.warn(`[${R}]: language configuration: expected \`colorizedBracketPairs[${k}]\` to be an array of two strings.`);continue}x.push([L[0],L[1]])}return x}extractValidOnEnterRules(R,M){const O=M.onEnterRules;if(typeof O>"u")return;if(!Array.isArray(O)){this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let x;for(let k=0,F=O.length;k<F;k++){const L=O[k];if(!(0,p.isObject)(L)){this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules[${k}]\` to be an object.`);continue}if(!(0,p.isObject)(L.action)){this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules[${k}].action\` to be an object.`);continue}let N;if(L.action.indent==="none")N=g.IndentAction.None;else if(L.action.indent==="indent")N=g.IndentAction.Indent;else if(L.action.indent==="indentOutdent")N=g.IndentAction.IndentOutdent;else if(L.action.indent==="outdent")N=g.IndentAction.Outdent;else{this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules[${k}].action.indent\` to be 'none', 'indent', 'indentOutdent' or 'outdent'.`);continue}const U={indentAction:N};L.action.appendText&&(typeof L.action.appendText=="string"?U.appendText=L.action.appendText:this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules[${k}].action.appendText\` to be undefined or a string.`)),L.action.removeText&&(typeof L.action.removeText=="number"?U.removeText=L.action.removeText:this.logger.warn(`[${R}]: language configuration: expected \`onEnterRules[${k}].action.removeText\` to be undefined or a number.`));const W=this.createRegex(L.beforeText);if(!W)continue;const j={beforeText:W,action:U};if(L.afterText){const Q=this.createRegex(L.afterText);Q&&(j.afterText=Q)}if(L.previousLineText){const Q=this.createRegex(L.previousLineText);Q&&(j.previousLineText=Q)}x=x||[],x.push(j)}return x}extractValidBrackets(R,M){const O=M.brackets;if(typeof O>"u")return;if(!Array.isArray(O)){this.logger.warn(`[${R}]: language configuration: expected \`brackets\` to be an array.`);return}let x;for(let k=0,F=O.length;k<F;k++){const L=O[k];if(!T(L)){this.logger.warn(`[${R}]: language configuration: expected \`brackets[${k}]\` to be an array of two strings.`);continue}x=x||[],x.push(L)}return x}extractValidAutoClosingPairs(R,M){const O=M.autoClosingPairs;if(typeof O>"u")return;if(!Array.isArray(O)){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let x;for(let k=0,F=O.length;k<F;k++){const L=O[k];if(Array.isArray(L)){if(!T(L)){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs[${k}]\` to be an array of two strings or an object.`);continue}x=x||[],x.push({open:L[0],close:L[1]})}else{if(typeof L!="object"){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs[${k}]\` to be an array of two strings or an object.`);continue}if(typeof L.open!="string"){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs[${k}].open\` to be a string.`);continue}if(typeof L.close!="string"){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs[${k}].close\` to be a string.`);continue}if(typeof L.notIn<"u"&&!D(L.notIn)){this.logger.warn(`[${R}]: language configuration: expected \`autoClosingPairs[${k}].notIn\` to be a string array.`);continue}x=x||[],x.push({open:L.open,close:L.close,notIn:L.notIn})}}return x}extractValidCommentRule(R,M){const O=M.comments;if(typeof O>"u")return;if(typeof O!="object"){this.logger.warn(`[${R}]: language configuration: expected \`comments\` to be an object.`);return}let x;return typeof O.lineComment<"u"&&(typeof O.lineComment!="string"?this.logger.warn(`[${R}]: language configuration: expected \`comments.lineComment\` to be a string.`):(x=x||{},x.lineComment=O.lineComment)),typeof O.blockComment<"u"&&(T(O.blockComment)?(x=x||{},x.blockComment=O.blockComment):this.logger.warn(`[${R}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),x}async initGrammarRegistry(){this.grammarRegistry=new o.Registry({onigLib:this.getOnigLib(),loadGrammar:async R=>{const M=this.textmateRegistry.getProvider(R);if(M){const O=await M.getGrammarDefinition();if(!O.content){const F=(await this.fileServiceClient.resolveContent(O.location.toString())).content;O.content=O.format==="json"?this.safeParseJSON(F):F}let x;return typeof O.content=="string"?x=(0,o.parseRawGrammar)(O.content,O.format==="json"?"grammar.json":"grammar.plist"):x=O.content,x}},getInjections:R=>{const M=this.textmateRegistry.getProvider(R);return M&&M.getInjections?M.getInjections(R):[]}}),this.activateLanguages()}getLanguages(){return[...s.monaco.languages.getLanguages(),...this.dynamicLanguages]}activateLanguages(){for(const{id:R}of this.getLanguages())this.editorDocumentModelService.hasLanguage(R)&&this.activateLanguage(R)}async getOnigLib(){if(y)return new S;const R=await this.rendererRuntime.provideResourceUri(v.EKnownResources.OnigWasm),O=await(await fetch(R)).arrayBuffer();return await(0,r.loadWASM)(O),y=!0,new S}listenPreferenceChange(){this.preferenceService.onPreferenceChanged(R=>{if(R.preferenceName==="editor.maxTokenizationLineLength")for(const M of this.activatedLanguage)this.setTokensProviderByLanguageId(M)})}async testTokenize(R,M){const O=this.textmateRegistry.getScope(M);if(!O)return;const x=this.textmateRegistry.getGrammarConfiguration(M)(),k=b(M),F=await this.grammarRegistry.loadGrammarWithConfiguration(O,k,x);let L=o.INITIAL;const N=F.tokenizeLine(R,L),U=(0,_.getDebugLogger)("tokenize");U.log(`
|
|
33389
33389
|
Tokenizing line: ${R}`);for(let W=0;W<N.tokens.length;W++){const j=N.tokens[W];U.log(` - token from ${j.startIndex} to ${j.endIndex} (${R.substring(j.startIndex,j.endIndex)}) with scopes ${j.scopes.join(", ")}`)}L=N.ruleStack}dispose(){super.dispose(),this.monacoLanguageService._requestedRichLanguages?this.monacoLanguageService._requestedRichLanguages.clear():this.logger.warn("monaco language service not found _requestedRichLanguages"),this.monacoLanguageService._requestedBasicLanguages?this.monacoLanguageService._requestedBasicLanguages.clear():this.logger.warn("monaco language service not found _requestedBasicLanguages")}};t.TextmateService=w,n.__decorate([(0,l.Autowired)(),n.__metadata("design:type",f.TextmateRegistry)],w.prototype,"textmateRegistry",void 0),n.__decorate([(0,l.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],w.prototype,"fileServiceClient",void 0),n.__decorate([(0,l.Autowired)(_.PreferenceService),n.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),n.__decorate([(0,l.Autowired)(_.ILogger),n.__metadata("design:type",Object)],w.prototype,"logger",void 0),n.__decorate([(0,l.Autowired)(E.IEditorDocumentModelService),n.__metadata("design:type",Object)],w.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,l.Autowired)(v.RendererRuntime),n.__metadata("design:type",v.RendererRuntime)],w.prototype,"rendererRuntime",void 0),t.TextmateService=w=n.__decorate([(0,l.Injectable)()],w)},88412:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyContribution=t.executeProvideSubtypesCommand=t.executeProvideSupertypesCommand=t.executePrepareTypeHierarchyCommand=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(40191),_=e(28694),v=e(82196);t.executePrepareTypeHierarchyCommand={id:"_executePrepareTypeHierarchy"},t.executeProvideSupertypesCommand={id:"_executeProvideSupertypes"},t.executeProvideSubtypesCommand={id:"_executeProvideSubtypes"};const p=new l.RawContextKey("editorHasCallHierarchyProvider",!1);let m=class{registerCommands(g){g.registerCommand(t.executePrepareTypeHierarchyCommand,{execute:(a,h)=>this.typeHierarchyService.prepareTypeHierarchyProvider(a,h)}),g.registerCommand(t.executeProvideSupertypesCommand,{execute:a=>this.typeHierarchyService.provideSupertypes(a)}),g.registerCommand(t.executeProvideSubtypesCommand,{execute:a=>this.typeHierarchyService.provideSubtypes(a)})}registerEditorFeature(g){this.ctxHasProvider=p.bind(this.contextKeyService),g.registerEditorFeatureContribution({contribute:a=>{const h=a.monacoEditor;return o.Event.any(h.onDidChangeModel,h.onDidChangeModelLanguage,_.TypeHierarchyProviderRegistry.onDidChange)(()=>{h.hasModel()&&this.ctxHasProvider.set(_.TypeHierarchyProviderRegistry.has(h.getModel()))})}})}};t.TypeHierarchyContribution=m,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(_.ITypeHierarchyService),n.__metadata("design:type",Object)],m.prototype,"typeHierarchyService",void 0),t.TypeHierarchyContribution=m=n.__decorate([(0,o.Domain)(o.CommandContribution,v.BrowserEditorContribution)],m)},7795:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchyService=t.TypeHierarchyModel=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(28694),_=e(96689),{isNonEmptyArray:v}=o.arrays;class p{static async create(g,a,h){const[d]=l.TypeHierarchyProviderRegistry.ordered(g);if(!d)return;const u=await d.prepareTypeHierarchy(g,a,h);if(u)return new p(u.roots.reduce((E,f)=>E+f._sessionId,""),d,u.roots,new o.RefCountedDisposable(u))}constructor(g,a,h,d){this.id=g,this.provider=a,this.roots=h,this.ref=d,this.root=h[0]}dispose(){this.ref.release()}fork(g){const a=this;return new class extends p{constructor(){super(a.id,a.provider,[g],a.ref.acquire())}}}async provideSupertypes(g,a){try{const h=await this.provider.provideSupertypes(g,a);if(v(h))return h}catch(h){(0,o.onUnexpectedExternalError)(h)}return[]}async provideSubtypes(g,a){try{const h=await this.provider.provideSubtypes(g,a);if(v(h))return h}catch(h){(0,o.onUnexpectedExternalError)(h)}return[]}}t.TypeHierarchyModel=p;let m=class{constructor(){this.models=new Map}registerTypeHierarchyProvider(g,a){l.TypeHierarchyProviderRegistry.register(g,a)}async prepareTypeHierarchyProvider(g,a){let h=this.modelService.getModelReference(o.URI.parse(g.toString())),d=h?.instance.getMonacoModel();if(h?.dispose(),!d){const u=await this.modelService.createModelReference(o.URI.parse(g.toString()));d=u.instance.getMonacoModel(),h=u}try{const u=await p.create(d,a,o.CancellationToken.None);return u?(this.models.set(u.id,u),this.models.forEach((E,f,c)=>{c.size>10&&(E.dispose(),this.models.delete(f))}),[u.root]):[]}finally{h?.dispose()}}async provideSupertypes(g){const a=this.models.get(g._sessionId);if(a)return a.provideSupertypes(g,o.CancellationToken.None)}async provideSubtypes(g){const a=this.models.get(g._sessionId);if(a)return a.provideSubtypes(g,o.CancellationToken.None)}};t.TypeHierarchyService=m,n.__decorate([(0,r.Autowired)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],m.prototype,"modelService",void 0),t.TypeHierarchyService=m=n.__decorate([(0,r.Injectable)()],m)},39266:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserMultiDiffEditor=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(28423),v=e(72665),p=e(65034),m=e(104),s=e(19087),g=e(55113),a=e(64335),h=e(30526),d=e(96689),u=e(82196);let E=class extends l.WithEventBus{constructor(c,y,b){super(),this.multiDiffWidget=c,this.convertedOptions=y,this.editorCollectionService=b,this.multiDiffModelChangeEmitter=new l.Emitter,this.onMultiDiffModelChange=this.multiDiffModelChangeEmitter.event,this.viewStateMap=new Map,this.editorCollectionService.addMultiDiffEditors([this])}onDocModelContentChangedEvent(c){var y;this.currentUri&&(((y=this.multiDiffModel)===null||y===void 0?void 0:y.documents.value)==="loading"||!this.multiDiffModel.documents.value.some(b=>{var A;return((A=b.object.modified)===null||A===void 0?void 0:A.uri.toString())===c.payload.uri.codeUri.toString()})||this.eventBus.fire(new u.ResourceDecorationNeedChangeEvent({uri:this.currentUri,decoration:{dirty:!!c.payload.dirty,readOnly:!!c.payload.readonly}})))}saveViewState(c){if(!c)return;const y=c.toString(),b=this.multiDiffWidget.getViewState();b&&this.viewStateMap.set(y,b)}restoreViewState(c){if(!c)return;const y=c.toString(),b=this.viewStateMap.get(y);b&&this.multiDiffWidget.setViewState(b)}createAndRegisterEditorParts(c,y,b,A,S){const D=[];if(c){const T=this.injector.get(h.DiffEditorPart,[c.editor,()=>b,g.EditorType.MODIFIED_DIFF,S]);D.push(T)}if(y){const T=this.injector.get(h.DiffEditorPart,[y.editor,()=>A,g.EditorType.ORIGINAL_DIFF,S]);D.push(T)}this.editorCollectionService.addEditors(D)}async compareMultiple(c,y,b){var A,S;this.currentUri&&this.saveViewState(this.currentUri);const D=!((A=y.metadata.sources)===null||A===void 0)&&A.length?{resources:p.ValueWithChangeEvent.const(y.metadata.sources)}:await this.multiDiffSourceResolverService.resolve(y.uri),T=D?(0,_.observableFromValueWithChangeEvent)(this,D.resources):(0,_.constObservable)([]),w=(0,_.mapObservableArrayCached)(this,T,async(k,F)=>{var L,N;let U,W;const j=new l.DisposableStore;try{[U,W]=await Promise.all([k.originalUri?this.documentModelManager.createModelReference(k.originalUri):void 0,k.modifiedUri?this.documentModelManager.createModelReference(k.modifiedUri):void 0]),U&&j.add(U),W&&j.add(W)}catch(Z){this.messageService.error(Z.message),this.logger.error(Z);return}const Q=(L=k.modifiedUri)!==null&&L!==void 0?L:k.originalUri,G={multiDiffEditorItem:k,original:U?.instance.getMonacoModel(),modified:W?.instance.getMonacoModel(),originalInstance:U?.instance,modifiedInstance:W?.instance,contextKeys:k.contextKeys,options:{readOnly:(N=W||U)===null||N===void 0?void 0:N.instance.readonly,...b,...this.convertedOptions.diffOptions},onOptionsDidChange:Z=>this.preferenceService.onPreferenceChanged($=>{$.affects(Q.toString())&&($.preferenceName.startsWith("editor")||$.preferenceName.startsWith("diffEditor"))&&Z()})};return F.add(m.RefCounted.createOfNonDisposable(G,j,this))},k=>{var F,L;return JSON.stringify([(F=k.modifiedUri)===null||F===void 0?void 0:F.toString(),(L=k.originalUri)===null||L===void 0?void 0:L.toString()])}),I=(0,_.observableValue)("documents","loading"),R=(0,_.derived)(async k=>{const F=w.read(k),N=(await Promise.all(F)).filter(U=>U!==void 0);I.set(N,void 0)}),M=(0,_.recomputeInitiallyAndOnChange)(R);await R.get(),(S=this.multiDiffModel)===null||S===void 0||S.dispose(),this.multiDiffModel={dispose:()=>M.dispose(),documents:new _.ValueWithChangeEventFromObservable(I),contextKeys:D?.contextKeys};const O=this.multiDiffWidget.createViewModel(this.multiDiffModel);await O.waitForDiffs(),this.multiDiffWidget.setViewModel(O),this.multiDiffWidget.getActiveControl(),this.currentUri=y.uri,this.restoreViewState(y.uri);const x=I.get();for(const k of x){if((0,l.isString)(k))continue;const F=k.object.modified,L=k.object.original;if(!F&&!L)continue;let N=F?this.multiDiffWidget.tryGetCodeEditor(F.uri):void 0,U=L?this.multiDiffWidget.tryGetCodeEditor(L.uri):void 0;if(!N&&!U){const W=F||L;if(!W)continue;l.Event.once(W.onDidChangeAttached)(()=>{setTimeout(()=>{N=F?this.multiDiffWidget.tryGetCodeEditor(F.uri):void 0,U=L?this.multiDiffWidget.tryGetCodeEditor(L.uri):void 0,this.createAndRegisterEditorParts(N,U,k.object.modifiedInstance,k.object.originalInstance,I)},0)});continue}this.createAndRegisterEditorParts(N,U,k.object.modifiedInstance,k.object.originalInstance,I)}this.multiDiffModelChangeEmitter.fire(this.multiDiffModel)}getDiffEntry(c){return this.multiDiffWidget.findDocumentDiffItem(c.codeUri)}getCurrentDiffEntry(){var c;const y=this.multiDiffWidget.getActiveControl();if(!y)return;const b=(c=y.getOriginalEditor().getModel())===null||c===void 0?void 0:c.uri;if(b)return this.multiDiffWidget.findDocumentDiffItem(b)}reveal(c,y){this.multiDiffWidget.reveal(c,y)}collapseAll(){const c=this.multiDiffWidget.getViewState(),y={...c,docStates:Object.keys(c.docStates||{}).reduce((b,A)=>(b[A]={...c.docStates[A],collapsed:!0},b),{})};this.multiDiffWidget.setViewState(y)}expandAll(){const c=this.multiDiffWidget.getViewState(),y={...c,docStates:Object.keys(c.docStates||{}).reduce((b,A)=>(b[A]={...c.docStates[A],collapsed:!1},b),{})};this.multiDiffWidget.setViewState(y)}layout(c){this.multiDiffWidget.layout(c)}focus(){const c=this.multiDiffWidget.getActiveControl();c&&c.focus()}tryGetCodeEditor(c){return this.multiDiffWidget.tryGetCodeEditor(c.codeUri)}dispose(){super.dispose(),this.multiDiffWidget.dispose()}};t.BrowserMultiDiffEditor=E,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],E.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(d.IEditorDocumentModelService),n.__metadata("design:type",Object)],E.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(a.IMultiDiffSourceResolverService),n.__metadata("design:type",Object)],E.prototype,"multiDiffSourceResolverService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],E.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(d.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[d.EditorDocumentModelContentChangedEvent]),n.__metadata("design:returntype",void 0)],E.prototype,"onDocModelContentChangedEvent",null),t.BrowserMultiDiffEditor=E=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[s.MultiDiffEditorWidget,Object,Function])],E)},86997:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffResolver=void 0;const n=e(85608),r=e(76003),o=e(65034),l=e(64335);let _=class{constructor(){this.sourceValues=new Map}registerSources(p,m){const s=p.toString(),g=this.sourceValues.get(s);g?g.value=m:this.sourceValues.set(s,new o.ValueWithChangeEvent(m))}canHandleUri(p){return p.scheme===l.MULTI_DIFF_SCHEME}async resolveDiffSource(p){const m=this.sourceValues.get(p.toString());if(m)return{resources:m}}dispose(){this.sourceValues.clear()}};t.MultiDiffResolver=_,t.MultiDiffResolver=_=n.__decorate([(0,r.Injectable)()],_)},73691:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),_=e(14951),v=e(23418),p=e(64335);let m=class extends o.WithEventBus{handlesUri(g){const a=this.multiDiffSourceResolverService.getResolvers();for(const h of a)if(h.canHandleUri(g))return 10;return-1}async provideResource(g){var a;const{name:h,sources:d}=g.getParsedQuery(),u=d?JSON.parse(d):[],E=u.length>0?new o.URI(u[0].modifiedUri):void 0,f=E?this.labelService.getIcon(E):void 0;return{name:`Multi-Diff: ${h||u.length+" files"}`,icon:f||(0,o.getIcon)("diff"),uri:g,supportsRevive:(a=this.appConfig.enableDiffRevive)!==null&&a!==void 0?a:!1,metadata:{sources:u}}}async shouldCloseResource(g,a){return!0}};t.MultiDiffResourceProvider=m,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.LabelService)],m.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],m.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],m.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],m.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(p.IMultiDiffSourceResolverService),n.__metadata("design:type",Object)],m.prototype,"multiDiffSourceResolverService",void 0),t.MultiDiffResourceProvider=m=n.__decorate([(0,r.Injectable)()],m)},36168:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffEditorContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(23418),v=e(64335),p=e(82196),m=e(86997),s=e(73691);let g=class{registerMultiDiffSourceResolver(h){return h.registerResolver(this.multiDiffResolver)}registerResource(h){h.registerResourceProvider(this.multiDiffResourceProvider)}registerEditorComponent(h){h.registerEditorComponentResolver(d=>{const u=this.multiDiffSourceResolverService.getResolvers();for(const E of u)if(E.canHandleUri(o.URI.from({scheme:d,path:"empty"})))return 10;return-1},(d,u)=>{u.push({type:p.EditorOpenType.multiDiff})})}registerCommands(h){h.registerCommand(o.MULTI_DIFF_EDITOR_COMMANDS.COLLAPSE_FILES,{execute:()=>{var d;const u=this.workbenchEditorService.currentEditorGroup;((d=u.currentOpenType)===null||d===void 0?void 0:d.type)===p.EditorOpenType.multiDiff&&u.multiDiffEditor.collapseAll()}}),h.registerCommand(o.MULTI_DIFF_EDITOR_COMMANDS.EXPAND_FILES,{execute:()=>{var d;const u=this.workbenchEditorService.currentEditorGroup;((d=u.currentOpenType)===null||d===void 0?void 0:d.type)===p.EditorOpenType.multiDiff&&u.multiDiffEditor.expandAll()}})}registerMenus(h){h.registerMenuItems(l.MenuId.EditorTitle,[{command:{id:o.MULTI_DIFF_EDITOR_COMMANDS.COLLAPSE_FILES.id,label:(0,o.localize)("multiDiffEditor.action.collapseFiles")},iconClass:"codicon codicon-collapse-all",group:"navigation",when:"isInMultiDiffEditor"}]),h.registerMenuItems(l.MenuId.EditorTitle,[{command:{id:o.MULTI_DIFF_EDITOR_COMMANDS.EXPAND_FILES.id,label:(0,o.localize)("multiDiffEditor.action.expandFiles")},iconClass:"codicon codicon-expand-all",group:"navigation",when:"isInMultiDiffEditor"}])}};t.MultiDiffEditorContribution=g,n.__decorate([(0,r.Autowired)(v.IMultiDiffSourceResolverService),n.__metadata("design:type",Object)],g.prototype,"multiDiffSourceResolverService",void 0),n.__decorate([(0,r.Autowired)(m.MultiDiffResolver),n.__metadata("design:type",m.MultiDiffResolver)],g.prototype,"multiDiffResolver",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.MultiDiffResourceProvider)],g.prototype,"multiDiffResourceProvider",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],g.prototype,"workbenchEditorService",void 0),t.MultiDiffEditorContribution=g=n.__decorate([(0,o.Domain)(p.BrowserEditorContribution,p.MultiDiffSourceContribution,l.MenuContribution,o.CommandContribution)],g)},94558:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffSourceResolverService=void 0;const n=e(85608),r=e(76003),o=e(70392);let l=class{constructor(){this._resolvers=new Set}registerResolver(v){if(this._resolvers.has(v))throw new Error("Duplicate resolver");return this._resolvers.add(v),(0,o.toDisposable)(()=>this._resolvers.delete(v))}resolve(v){for(const p of this._resolvers)if(p.canHandleUri(v))return p.resolveDiffSource(v);return Promise.resolve(void 0)}getResolvers(){return Array.from(this._resolvers)}};t.MultiDiffSourceResolverService=l,t.MultiDiffSourceResolverService=l=n.__decorate([(0,r.Injectable)()],l)},93532:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationMenuModel=t.NavigationBarViewService=t.NavigationMenuContainer=t.NavigationMenu=t.NavigationItem=t.NavigationBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(76003),_=e(97267),v=e(41869),p=e(28423),m=e(26209),s=n.__importDefault(e(69418)),g=e(82196),a=e(50674),h=({editorGroup:c})=>{const y=(0,v.useInjectable)(g.IBreadCrumbService),b=(0,v.useDesignStyles)(s.default.navigation_container,"navigation_container"),A=(0,v.useDesignStyles)(s.default.navigation_icon,"navigation_icon");if((0,a.useUpdateOnGroupTabChange)(c),(0,v.useUpdateOnEvent)(y.onDidUpdateBreadCrumbResults,[],D=>{var T;const w=c.currentEditor&&c.currentEditor.currentDocumentModel?c.currentEditor:null,I=c.currentEditor&&c.currentEditor.currentDocumentModel?c.currentEditor.currentDocumentModel.uri:(T=c.currentResource)===null||T===void 0?void 0:T.uri;return!!I&&D.editor===w&&D.uri.isEqual(I)}),c.resources.length===0||!c.currentResource)return null;let S;return c.currentEditor&&c.currentEditor.currentDocumentModel?S=y.getBreadCrumbs(c.currentEditor.currentDocumentModel.uri,c.currentEditor):S=y.getBreadCrumbs(c.currentResource.uri,null),S?S.length===0?null:o.default.createElement("div",{className:(0,r.default)("kt-navigation-container",b),onContextMenu:D=>{D.preventDefault()}},S.map((D,T)=>o.default.createElement(o.default.Fragment,{key:T+"-crumb:"+D.name},T>0&&o.default.createElement(_.Icon,{icon:"right",size:"small",className:A}),o.default.createElement(t.NavigationItem,{part:D,editorGroup:c})))):null};t.NavigationBar=h,t.NavigationItem=(0,o.memo)(({part:c,editorGroup:y})=>{const b=(0,v.useInjectable)(E),A=(0,v.useInjectable)(m.BreadCrumbsMenuService),S=(0,o.useRef)(),D=(0,v.useDesignStyles)(s.default["navigation-part"],"navigation-part"),T=(0,o.useCallback)(async()=>{if(c.getSiblings&&S.current){const{left:w,top:I,height:R}=S.current.getBoundingClientRect(),M=await c.getSiblings();let O=w;window.innerWidth-O<210&&(O=window.innerWidth-200-5),b.showMenu(M.parts,O,I+R+5,M.currentIndex,c.uri,y)}},[S.current,c]);return o.default.createElement("span",{onClick:T,onContextMenu:w=>{!c.isSymbol&&c.uri&&A.show(w.nativeEvent.x,w.nativeEvent.y,y,c.uri),w.preventDefault()},className:D,ref:S},c.icon&&o.default.createElement("span",{className:c.icon}),o.default.createElement("span",null,c.name))});const d=({model:c})=>{let y=window.innerHeight-c.y-20,b=c.y;const A=c.parts.length*22;y<100&&y<A&&(y=100,b=window.innerHeight-20-y);const S=(0,o.useRef)(),D=(0,v.useDesignStyles)(s.default.navigation_menu,"navigation_menu"),T=(0,v.useDesignStyles)(s.default.navigation_menu_item,"navigation_menu_item"),w=(0,v.useInjectable)(E),I=(0,v.useAutorun)(c.subMenu),R=(0,o.useCallback)(()=>{v.fastdom.measure(()=>{try{if(S.current){const M=S.current.querySelector(`.${s.default.navigation_menu_item_current}`);M&&M.scrollIntoView({behavior:"auto",block:"center"})}}catch{}})},[S.current]);return o.default.createElement("div",{className:D,style:{left:c.x+"px",top:b+"px",maxHeight:y+"px",height:A+"px"}},o.default.createElement(_.Scrollbars,{className:s.default.navigation_menu_items,universal:!0,forwardedRef:M=>{S.current=M,R()}},c.parts.map((M,O)=>{let x;const k=M.getChildren?async()=>{if(x){const{left:L,top:N,width:U}=x.getBoundingClientRect();let W=L+U+5;window.innerWidth-W<210&&(W=L-U-5);const j=await M.getChildren();c.showSubMenu(j,W,N,c)}}:void 0,F=M.onClick?()=>{M.onClick(),w.dispose()}:void 0;return o.default.createElement("div",{onClick:F||k,ref:L=>x=L,className:(0,r.default)(T,{[s.default.navigation_menu_item_current]:O===c.initialIndex}),key:"menu-"+M.name},o.default.createElement("span",{className:M.icon||(0,v.getIcon)("smile")}),o.default.createElement("span",{className:s.default.navigation_menu_item_label},M.name),M.getChildren&&o.default.createElement("span",{className:s.default.navigation_right,onClick:F&&k?L=>{L.stopPropagation(),k()}:void 0},o.default.createElement(_.Icon,{icon:"right",size:"small"})))})),I&&o.default.createElement(t.NavigationMenu,{model:I}))};t.NavigationMenu=d;const u=()=>{const c=(0,o.useRef)(),y=(0,v.useInjectable)(E),b=(0,v.useAutorun)(y.current);return(0,o.useEffect)(()=>{if(c.current){const A=new v.Disposable;return A.addDispose(new v.DomListener(window,"mouseup",()=>{y.dispose()})),A.addDispose(new v.DomListener(c.current,"mouseup",S=>{S.stopPropagation()})),A.dispose.bind(A)}}),b?o.default.createElement("div",{tabIndex:1,ref:c},o.default.createElement(t.NavigationMenu,{model:b})):null};t.NavigationMenuContainer=u;let E=class{constructor(){this.current=(0,p.observableValue)(this,null)}showMenu(y,b,A,S,D,T){(0,p.transaction)(w=>{this.current.set(new f(y,b,A,S,D),w)})}dispose(){(0,p.transaction)(y=>{const b=this.current.get();b?.dispose(),this.current.set(null,y)})}};t.NavigationBarViewService=E,t.NavigationBarViewService=E=n.__decorate([(0,l.Injectable)()],E);class f{constructor(y,b,A,S=-1,D){this.parts=y,this.x=b,this.y=A,this.initialIndex=S,this.uri=D,this.subMenu=(0,p.observableValue)(this,null)}showSubMenu(y,b,A,S){(0,p.transaction)(D=>{this.subMenu.set(new f(y,b,A,-1,S),D)})}dispose(){(0,p.transaction)(y=>{const b=this.subMenu.get();b?.dispose(),this.subMenu.set(null,y)})}}t.NavigationMenuModel=f},71145:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotebookService=void 0;const n=e(85608),r=e(76003),o=e(41869);let l=class extends o.WithEventBus{constructor(){super(...arguments),this._onDidOpenNotebookDocument=new o.Emitter,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new o.Emitter,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidSaveNotebookDocument=new o.Emitter,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new o.Emitter,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}};t.NotebookService=l,t.NotebookService=l=n.__decorate([(0,r.Injectable)()],l)},34885:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorPreferenceContribution=void 0;const n=e(85608),r=e(41869),o=e(24328);let l=class{constructor(){this.schema=o.editorPreferenceSchema}};t.EditorPreferenceContribution=l,t.EditorPreferenceContribution=l=n.__decorate([(0,r.Domain)(r.PreferenceContribution)],l)},6043:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffEditorOptionsConverters=t.textModelUpdateOptionsConverters=t.editorOptionsConverters=void 0,t.isEditorOption=l,t.isDiffEditorOption=_,t.getConvertedMonacoOptions=s;const n=e(41869),{removeUndefined:r}=n.objects;t.editorOptionsConverters=new Map([["editor.ariaLabel",{monaco:"ariaLabel"}],["editor.rulers",{monaco:"rulers"}],["editor.wordSeparators",{monaco:"wordSeparators"}],["editor.selectionClipboard",{monaco:"selectionClipboard"}],["editor.lineNumbers",{monaco:"lineNumbers"}],["editor.renderFinalNewline",{monaco:"renderFinalNewline"}],["editor.selectOnLineNumbers",{monaco:"selectOnLineNumbers"}],["editor.lineNumbersMinChars",{monaco:"lineNumbersMinChars"}],["editor.glyphMargin",{monaco:"glyphMargin"}],["editor.lineDecorationsWidth",{monaco:"lineDecorationsWidth"}],["editor.revealHorizontalRightPadding",{monaco:"revealHorizontalRightPadding"}],["editor.roundedSelection",{monaco:"roundedSelection"}],["editor.extraEditorClassName",{monaco:"extraEditorClassName"}],["editor.readOnly",{monaco:"readOnly"}],["editor.scrollbar",{monaco:"scrollbar"}],["editor.minimap",{monaco:"minimap",convert:g=>({enabled:g})}],["editor.find",{monaco:"find"}],["editor.fixedOverflowWidgets",{monaco:"fixedOverflowWidgets"}],["editor.overviewRulerLanes",{monaco:"overviewRulerLanes"}],["editor.overviewRulerBorder",{monaco:"overviewRulerBorder"}],["editor.cursorBlinking",{monaco:"cursorBlinking"}],["editor.mouseWheelZoom",{monaco:"mouseWheelZoom"}],["editor.cursorSmoothCaretAnimation",{monaco:"cursorSmoothCaretAnimation"}],["editor.cursorStyle",{monaco:"cursorStyle"}],["editor.cursorWidth",{monaco:"cursorWidth"}],["editor.fontLigatures",{monaco:"fontLigatures"}],["editor.columnSelection",{monaco:"columnSelection"}],["editor.disableLayerHinting",{monaco:"disableLayerHinting"}],["editor.disableMonospaceOptimizations",{monaco:"disableMonospaceOptimizations"}],["editor.hideCursorInOverviewRuler",{monaco:"hideCursorInOverviewRuler"}],["editor.scrollBeyondLastLine",{monaco:"scrollBeyondLastLine"}],["editor.scrollBeyondLastColumn",{monaco:"scrollBeyondLastColumn"}],["editor.smoothScrolling",{monaco:"smoothScrolling"}],["editor.automaticLayout",{monaco:"automaticLayout"}],["editor.wordWrap",{monaco:"wordWrap"}],["editor.wordWrapColumn",{monaco:"wordWrapColumn"}],["editor.wordWrapMinified",{monaco:"wordWrapMinified"}],["editor.wrappingIndent",{monaco:"wrappingIndent"}],["editor.wordWrapBreakBeforeCharacters",{monaco:"wordWrapBreakBeforeCharacters"}],["editor.wordWrapBreakAfterCharacters",{monaco:"wordWrapBreakAfterCharacters"}],["editor.wordWrapBreakObtrusiveCharacters",{monaco:"wordWrapBreakObtrusiveCharacters"}],["editor.stopRenderingLineAfter",{monaco:"stopRenderingLineAfter"}],["editor.hover",{monaco:"hover"}],["editor.links",{monaco:"links"}],["editor.colorDecorators",{monaco:"colorDecorators"}],["editor.contextmenu",{monaco:"contextmenu"}],["editor.mouseWheelScrollSensitivity",{monaco:"mouseWheelScrollSensitivity"}],["editor.fastScrollSensitivity",{monaco:"fastScrollSensitivity"}],["editor.multiCursorModifier",{monaco:"multiCursorModifier"}],["editor.multiCursorMergeOverlapping",{monaco:"multiCursorMergeOverlapping"}],["editor.accessibilitySupport",{monaco:"accessibilitySupport"}],["editor.suggest",{monaco:"suggest"}],["editor.gotoLocation",{monaco:"gotoLocation"}],["editor.quickSuggestions",{monaco:"quickSuggestions"}],["editor.quickSuggestionsDelay",{monaco:"quickSuggestionsDelay"}],["editor.parameterHints",{monaco:"parameterHints"}],["editor.autoClosingBrackets",{monaco:"autoClosingBrackets"}],["editor.autoClosingQuotes",{monaco:"autoClosingQuotes"}],["editor.autoSurround",{monaco:"autoSurround"}],["editor.autoIndent",{monaco:"autoIndent"}],["editor.formatOnType",{monaco:"formatOnType"}],["editor.formatOnPaste",{monaco:"formatOnPaste"}],["editor.dragAndDrop",{monaco:"dragAndDrop"}],["editor.suggestOnTriggerCharacters",{monaco:"suggestOnTriggerCharacters"}],["editor.acceptSuggestionOnEnter",{monaco:"acceptSuggestionOnEnter"}],["editor.acceptSuggestionOnCommitCharacter",{monaco:"acceptSuggestionOnCommitCharacter"}],["editor.snippetSuggestions",{monaco:"snippetSuggestions"}],["editor.emptySelectionClipboard",{monaco:"emptySelectionClipboard"}],["editor.copyWithSyntaxHighlighting",{monaco:"copyWithSyntaxHighlighting"}],["editor.wordBasedSuggestions",{monaco:"wordBasedSuggestions"}],["editor.suggestSelection",{monaco:"suggestSelection"}],["editor.suggestFontSize",{monaco:"suggestFontSize"}],["editor.suggestLineHeight",{monaco:"suggestLineHeight"}],["editor.tabCompletion",{monaco:"tabCompletion"}],["editor.selectionHighlight",{monaco:"selectionHighlight"}],["editor.occurrencesHighlight",{monaco:"occurrencesHighlight"}],["editor.codeLens",{monaco:"codeLens"}],["editor.lightbulb",{monaco:"lightbulb"}],["editor.codeActionsOnSave",{monaco:"codeActionsOnSave"}],["editor.codeActionsOnSaveTimeout",{monaco:"codeActionsOnSaveTimeout"}],["editor.folding",{monaco:"folding"}],["editor.foldingStrategy",{monaco:"foldingStrategy"}],["editor.showFoldingControls",{monaco:"showFoldingControls"}],["editor.matchBrackets",{monaco:"matchBrackets"}],["editor.renderWhitespace",{monaco:"renderWhitespace"}],["editor.renderControlCharacters",{monaco:"renderControlCharacters"}],["editor.renderIndentGuides",{monaco:"guides.indentation"}],["editor.highlightActiveIndentGuide",{monaco:"guides.highlightActiveIndentation"}],["editor.guides",{monaco:"guides"}],["editor.renderLineHighlight",{monaco:"renderLineHighlight"}],["editor.useTabStops",{monaco:"useTabStops"}],["editor.fontFamily",{monaco:"fontFamily"}],["editor.fontWeight",{monaco:"fontWeight"}],["editor.fontSize",{monaco:"fontSize"}],["editor.lineHeight",{monaco:"lineHeight"}],["editor.letterSpacing",{monaco:"letterSpacing"}],["editor.showUnused",{monaco:"showUnused"}],["editor.rename.enablePreview",{monaco:"editor.rename.enablePreview"}],["editor.semanticHighlighting",{monaco:"semanticHighlighting"}],["editor.bracketPairColorization",{monaco:"bracketPairColorization"}],["editor.wrappingStrategy",{monaco:"wrappingStrategy"}],["editor.experimental.stickyScroll.enabled",{monaco:"experimental",convert:g=>({stickyScroll:{enabled:g}})}],["editor.forceReadOnly",{monaco:"readOnly",convert:g=>{if(g)return!0}}],["editor.unicodeHighlight",{monaco:"unicodeHighlight"}],["editor.inlineSuggest.showToolbar",{monaco:"inlineSuggest",convert:g=>{if(g)return{showToolbar:g}}}]]),t.textModelUpdateOptionsConverters=new Map([["editor.tabSize",{monaco:"tabSize"}],["editor.indentSize",{monaco:"indentSize"}],["editor.insertSpaces",{monaco:"insertSpaces"}],["editor.trimAutoWhitespace",{monaco:"trimAutoWhitespace"}]]),t.diffEditorOptionsConverters=new Map([["diffEditor.enableSplitViewResizing",{monaco:"enableSplitViewResizing"}],["diffEditor.renderSideBySide",{monaco:"renderSideBySide"}],["diffEditor.ignoreTrimWhitespace",{monaco:"ignoreTrimWhitespace"}],["diffEditor.renderIndicators",{monaco:"renderIndicators"}],["diffEditor.originalEditable",{monaco:"originalEditable"}],["diffEditor.minimap",{monaco:"minimap",convert:g=>({enabled:g})}],["diffEditor.experimental.stickyScroll.enabled",{monaco:"experimental",convert:g=>({stickyScroll:{enabled:g}})}],["diffEditor.hideUnchangedRegions.enabled",{monaco:"hideUnchangedRegions",convert:g=>({enabled:g})}],["diffEditor.hideUnchangedRegions.revealLineCount",{monaco:"hideUnchangedRegions",convert:g=>({revealLineCount:g})}],["diffEditor.hideUnchangedRegions.minimumLineCount",{monaco:"hideUnchangedRegions",convert:g=>({minimumLineCount:g})}],["diffEditor.hideUnchangedRegions.contextLineCount",{monaco:"hideUnchangedRegions",convert:g=>({contextLineCount:g})}],["diffEditor.experimental.showMoves",{monaco:"experimental",convert:g=>({showMoves:g})}],["diffEditor.experimental.showEmptyDecorations",{monaco:"experimental",convert:g=>({showEmptyDecorations:g})}]]);function o(g,a){if(a.has(g))return!0;{const h=a.keys();for(const d of h)if(g.startsWith(d))return!0}return!1}function l(g){return o(g,t.editorOptionsConverters)||o(g,t.textModelUpdateOptionsConverters)||o(g,t.diffEditorOptionsConverters)}function _(g){return o(g,t.diffEditorOptionsConverters)}const v=[...t.editorOptionsConverters.keys()],p=[...t.textModelUpdateOptionsConverters.keys()],m=[...t.diffEditorOptionsConverters.keys()];function s(g,a,h,d){const u=a?n.Uri.parse(a):void 0,E=(D,T)=>D.reduce((w,I)=>{const R=g.getValue(I,{resource:u,overrideIdentifier:h});if(R!==void 0){const M=T.get(I);if(!M)return w[I]=R,w;const O=M?M.monaco:I,x=M?.convert?M.convert(R):R;w[O]?Object.assign(w[O],x):w[O]=x}return w},{}),f=d?d.filter(D=>t.editorOptionsConverters.has(D)):[...v],c=d?d.filter(D=>t.textModelUpdateOptionsConverters.has(D)):[...p],y=d?d.filter(D=>t.diffEditorOptionsConverters.has(D)):[...m],b=r(E(f,t.editorOptionsConverters)),A=r(E(c,t.textModelUpdateOptionsConverters)),S=r(E(y,t.diffEditorOptionsConverters));return{editorOptions:b,modelOptions:A,diffOptions:S}}},24328:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorPreferences=t.editorPreferenceSchema=t.DIFF_EDITOR_DEFAULTS=t.EDITOR_DEFAULTS=t.EDITOR_INLINE_SUGGEST_DEFAULTS=t.EDITOR_SUGGEST_DEFAULTS=t.EDITOR_MODEL_DEFAULTS=t.EDITOR_FONT_DEFAULTS=t.USUAL_WORD_SEPARATORS=void 0;const n=e(41869),r=e(82196);t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";const o="Consolas, 'Courier New', monospace",l="Menlo, Monaco, 'Courier New', monospace",_="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'";t.EDITOR_FONT_DEFAULTS={fontFamily:n.isOSX?l:n.isLinux?_:o,fontWeight:"normal",fontSize:12,tabSize:2,renderWhitespace:!1,cursorStyle:"line",insertSpace:!0,wordWrap:"off",wordWrapColumn:80,lineHeight:0,letterSpacing:0},t.EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},t.EDITOR_SUGGEST_DEFAULTS={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,showMethods:!0,showFunctions:!0,showConstructors:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0,detailsVisible:!0,preview:!0,statusBar:{visible:!1}},t.EDITOR_INLINE_SUGGEST_DEFAULTS={enabled:!0,showToolbar:"onHover"},t.EDITOR_DEFAULTS={inDiffEditor:!1,wordSeparators:t.USUAL_WORD_SEPARATORS,lineNumbersMinChars:3,lineDecorationsWidth:10,readOnly:!1,columnSelection:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!0,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:1,wordWrapBreakBeforeCharacters:"([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B",wordWrapBreakAfterCharacters:" })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:"languageDefined",autoClosingQuotes:"languageDefined",autoSurround:"languageDefined",autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,copyWithSyntaxHighlighting:!0,useTabStops:!0,multiCursorModifier:"altKey",multiCursorMergeOverlapping:!0,accessibilitySupport:"off",showUnused:!0,wrappingStrategy:"simple",viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:(0,n.localize)("editorViewAccessibleLabel","Editor Content"),renderLineNumbers:0,renderCustomLineNumbers:null,renderFinalNewline:!0,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:1,mouseWheelZoom:!1,cursorSmoothCaretAnimation:!1,cursorStyle:1,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,scrollBeyondLastColumn:5,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderLineHighlight:"none",scrollbar:{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1,fastScrollSensitivity:5},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},guides:{indentation:!0,highlightActiveIndentGuide:!0,bracketPairs:!0},fixedOverflowWidgets:!0},contribInfo:{selectionClipboard:!0,hover:{enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0},links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:{enabled:!0,cycle:!1},formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,wordBasedSuggestions:!1,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,tabCompletion:"off",gotoLocation:{multiple:"peek"},selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,foldingStrategy:"auto",showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1,addExtraSpaceOnTop:!0},colorDecorators:!0,lightbulbEnabled:r.ShowLightbulbIconMode.On,codeActionsOnSave:{},codeActionsOnSaveTimeout:750}},t.DIFF_EDITOR_DEFAULTS={renderIndicators:!0,minimap:!1,renderSideBySide:!0,ignoreTrimWhitespace:!1,hideUnchangedRegions:{enabled:!0,revealLineCount:20,minimumLineCount:3,contextLineCount:3},experimental:{showMoves:!1,showEmptyDecorations:!0,collapseUnchangedRegions:!0,stickyScroll:{enable:!1}}};const v={"editor.ariaLabel":{type:"string",default:t.EDITOR_DEFAULTS.viewInfo.ariaLabel,description:"%editor.configuration.ariaLabel%"},"editor.extraEditorClassName":{type:"string",description:"%editor.configuration.extraEditorClassName%"},"editor.fixedOverflowWidgets":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.fixedOverflowWidgets,description:"%editor.configuration.fixedOverflowWidgets%"},"editor.revealHorizontalRightPadding":{type:"number",description:"%editor.configuration.revealHorizontalRightPadding%"},"editor.selectOnLineNumbers":{type:"boolean",description:"%editor.configuration.selectOnLineNumbers%"},"editor.wordWrapMinified":{type:"boolean",description:"%editor.configuration.wordWrapMinified%"},"editor.wordWrapBreakAfterCharacters":{type:"string",default:" })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63",description:"%editor.configuration.wordWrapBreakAfterCharacters%"},"editor.wrappingStrategy":{type:"string",enum:["advanced","simple"],default:"simple",description:"%editor.configuration.wrappingStrategy%"},"editor.wordWrapBreakBeforeCharacters":{type:"string",default:"([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B",description:"%editor.configuration.wordWrapBreakBeforeCharacters%"},"editor.lineNumbersMinChars":{type:"number",default:t.EDITOR_DEFAULTS.lineNumbersMinChars,description:"%editor.configuration.lineNumbersMinChars%"},"editor.lineDecorationsWidth":{type:"number",default:t.EDITOR_DEFAULTS.lineDecorationsWidth,description:"%editor.configuration.lineDecorationsWidth%"},"editor.fontFamily":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontFamily,description:"%editor.configuration.fontFamily%"},"editor.fontWeight":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontWeight,description:"%editor.configuration.fontWeight%"},"editor.fontSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.fontSize,description:(0,n.localize)("fontSize","Controls the font size in pixels.")},"editor.lineHeight":{type:"number",default:t.EDITOR_FONT_DEFAULTS.lineHeight,description:(0,n.localize)("lineHeight","Controls the line height. Use 0 to compute the line height from the font size.")},"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[(0,n.localize)("editor.configuration.suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),(0,n.localize)("editor.configuration.suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:"insert",description:"%editor.configuration.suggest.insertMode%"},"editor.suggest.filterGraceful":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.filterGraceful,description:"%editor.configuration.suggest.filterGraceful%"},"editor.suggest.localityBonus":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.localityBonus,description:"%editor.configuration.suggest.localityBonus%"},"editor.suggest.shareSuggestSelections":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.shareSuggestSelections,description:"%editor.configuration.suggest.shareSuggestSelections%"},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.snippetsPreventQuickSuggestions,description:"%editor.configuration.suggest.snippetsPreventQuickSuggestions%"},"editor.suggest.showIcons":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.showIcons,description:"%editor.configuration.suggest.showIcons%"},"editor.suggest.maxVisibleSuggestions":{type:"number",default:t.EDITOR_SUGGEST_DEFAULTS.maxVisibleSuggestions,minimum:1,maximum:15,description:"%editor.configuration.suggest.maxVisibleSuggestions%"},"editor.suggest.showMethods":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showMethods%"},"editor.suggest.showFunctions":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFunctions%"},"editor.suggest.showConstructors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showConstructors%"},"editor.suggest.showFields":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFields%"},"editor.suggest.showVariables":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showVariables%"},"editor.suggest.showClasses":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showClasss%"},"editor.suggest.showStructs":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showStructs%"},"editor.suggest.showInterfaces":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showInterfaces%"},"editor.suggest.showModules":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showModules%"},"editor.suggest.showProperties":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showPropertys%"},"editor.suggest.showEvents":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEvents%"},"editor.suggest.showOperators":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showOperators%"},"editor.suggest.showUnits":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showUnits%"},"editor.suggest.showValues":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showValues%"},"editor.suggest.showConstants":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showConstants%"},"editor.suggest.showEnums":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEnums%"},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showEnumMembers%"},"editor.suggest.showKeywords":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showKeywords%"},"editor.suggest.showWords":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showTexts%"},"editor.suggest.showColors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showColors%"},"editor.suggest.showFiles":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFiles%"},"editor.suggest.showReferences":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showReferences%"},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showCustomcolors%"},"editor.suggest.showFolders":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showFolders%"},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showTypeParameters%"},"editor.suggest.showSnippets":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showSnippets%"},"editor.suggest.showUsers":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showUsers%"},"editor.suggest.showIssues":{type:"boolean",default:!0,description:"%editor.configuration.suggest.showIssues%"},"editor.suggest.statusBar.visible":{type:"boolean",default:!1,description:"%editor.configuration.suggest.statusBar.visible%"},"editor.suggest.preview":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.preview,description:"%editor.configuration.suggest.preview%"},"editor.suggest.details.visible":{type:"boolean",default:t.EDITOR_SUGGEST_DEFAULTS.detailsVisible,description:"%editor.configuration.suggest.details.visible%"},"editor.inlineSuggest.enabled":{type:"boolean",default:t.EDITOR_INLINE_SUGGEST_DEFAULTS.enabled,description:"%editor.configuration.inlineSuggest.enabled%"},"editor.inlineSuggest.showToolbar":{type:"string",default:t.EDITOR_INLINE_SUGGEST_DEFAULTS.showToolbar,enum:["always","onHover","never"],enumDescriptions:[(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),(0,n.localize)("editor.configuration.inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:"%editor.configuration.inlineSuggest.showToolbar%"},"editor.experimental.stickyScroll.enabled":{type:"boolean",default:!0,description:"%editor.configuration.experimental.stickyScroll%"},"editor.customCodeActionMenu.showHeaders":{type:"boolean",default:!0,description:"%editor.configuration.customCodeActionMenu.showHeaders"},"editor.useCustomCodeActionMenu":{type:"boolean",default:!0,description:"%editor.configuration.useCustomCodeActionMenu%"},"editor.letterSpacing":{type:"number",default:t.EDITOR_FONT_DEFAULTS.letterSpacing,description:"%editor.configuration.letterSpacing%"},"editor.lineNumbers":{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[(0,n.localize)("editor.configuration.lineNumbers.off","Line numbers are not rendered."),(0,n.localize)("editor.configuration.lineNumbers.on","Line numbers are rendered as absolute number."),(0,n.localize)("editor.configuration.lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),(0,n.localize)("editor.configuration.lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:"%editor.configuration.lineNumbers%"},"editor.renderFinalNewline":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.renderFinalNewline,description:"%editor.configuration.renderFinalNewline%"},"editor.rulers":{type:"array",items:{type:"number"},default:t.EDITOR_DEFAULTS.viewInfo.rulers,description:"%editor.configuration.rulers%"},"editor.wordSeparators":{type:"string",default:t.EDITOR_DEFAULTS.wordSeparators,description:"%editor.configuration.wordSeparators%"},"editor.tabSize":{type:"number",default:t.EDITOR_MODEL_DEFAULTS.tabSize,minimum:1,markdownDescription:"%editor.configuration.tabSize%"},"editor.insertSpaces":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.insertSpaces,markdownDescription:"%editor.configuration.insertSpaces%"},"editor.detectIndentation":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.detectIndentation,markdownDescription:"%editor.configuration.detectIndentation%"},"editor.roundedSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.roundedSelection,description:"%editor.configuration.roundedSelection%"},"editor.scrollBeyondLastLine":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.scrollBeyondLastLine,description:"%editor.configuration.scrollBeyondLastLine%"},"editor.scrollBeyondLastColumn":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollBeyondLastColumn,description:"%editor.configuration.scrollBeyondLastColumn%"},"editor.smoothScrolling":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.smoothScrolling,description:"%editor.configuration.smoothScrolling%"},"editor.minimap.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.minimap.enabled,description:"%editor.configuration.minimap.enabled%"},"editor.minimap.side":{type:"string",enum:["left","right"],default:t.EDITOR_DEFAULTS.viewInfo.minimap.side,description:"%editor.configuration.minimap.side%"},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:t.EDITOR_DEFAULTS.viewInfo.minimap.showSlider,description:"%editor.configuration.minimap.showSlider%"},"editor.minimap.renderCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters,description:"%editor.configuration.minimap.renderCharacters%"},"editor.minimap.maxColumn":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,description:"%editor.configuration.minimap.maxColumn%"},"editor.hover.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.enabled,description:"%editor.configuration.hover.enabled%"},"editor.hover.delay":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.hover.delay,description:"%editor.configuration.hover.delay%"},"editor.hover.sticky":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.sticky,description:"%editor.configuration.hover.sticky%"},"editor.hover.hidingDelay":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.hover.hidingDelay,description:"%editor.configuration.hover.hidingDelay%"},"editor.hover.above":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.hover.above,description:"%editor.configuration.hover.above%"},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,description:"%editor.configuration.find.seedSearchStringFromSelection%"},"editor.find.autoFindInSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.autoFindInSelection,description:"%editor.configuration.find.autoFindInSelection%"},"editor.find.globalFindClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.find.globalFindClipboard,description:"%editor.configuration.find.globalFindClipboard%",included:n.isOSX},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:!0,description:"%editor.configuration.find.addExtraSpaceOnTop%"},"editor.wordWrap":{type:"string",enum:["off","on","wordWrapColumn","bounded"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.wordWrap.off","Lines will never wrap."),(0,n.localize)("editor.configuration.wordWrap.on","Lines will wrap at the viewport width."),(0,n.localize)("editor.configuration.wordWrap.wordWrapColumn","Lines will wrap at `#editor.wordWrapColumn#`."),(0,n.localize)("editor.configuration.wordWrap.bounded","Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],default:t.EDITOR_DEFAULTS.wordWrap,description:"%editor.configuration.wordWrap%"},"editor.wordWrapColumn":{type:"integer",default:t.EDITOR_DEFAULTS.wordWrapColumn,minimum:1,markdownDescription:"%editor.configuration.wordWrapColumn%"},"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[(0,n.localize)("editor.configuration.wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),(0,n.localize)("editor.configuration.wrappingIndent.same","Wrapped lines get the same indentation as the parent."),(0,n.localize)("editor.configuration.wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),(0,n.localize)("editor.configuration.wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],default:"same",description:"%editor.configuration.wrappingIndent%"},"editor.mouseWheelScrollSensitivity":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity,markdownDescription:"%editor.configuration.mouseWheelScrollSensitivity%"},"editor.fastScrollSensitivity":{type:"number",default:t.EDITOR_DEFAULTS.viewInfo.scrollbar.fastScrollSensitivity,markdownDescription:"%editor.configuration.fastScrollSensitivity%"},"editor.multiCursorModifier":{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),(0,n.localize)("editor.configuration.multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"alt",markdownDescription:(0,n.localize)("multiCursorModifier","The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")},"editor.multiCursorMergeOverlapping":{type:"boolean",default:t.EDITOR_DEFAULTS.multiCursorMergeOverlapping,description:"%editor.configuration.multiCursorMergeOverlapping%"},"editor.quickSuggestions":{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:!1,description:(0,n.localize)("editor.configuration.quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:!1,description:(0,n.localize)("editor.configuration.quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:!0,description:"%editor.configuration.quickSuggestions.other%"}}}],default:t.EDITOR_DEFAULTS.contribInfo.quickSuggestions,description:"%editor.configuration.quickSuggestions%"},"editor.quickSuggestionsDelay":{type:"integer",default:t.EDITOR_DEFAULTS.contribInfo.quickSuggestionsDelay,minimum:0,description:"%editor.configuration.quickSuggestionsDelay%"},"editor.parameterHints.enabled":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.parameterHints.enabled,description:"%editor.configuration.parameterHints.enabled%"},"editor.parameterHints.cycle":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.parameterHints.cycle,description:"%editor.configuration.parameterHints.cycle%"},"editor.autoClosingBrackets":{type:"string",enum:["always","languageDefined","beforeWhitespace","never"],enumDescriptions:["",(0,n.localize)("editor.configuration.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),(0,n.localize)("editor.configuration.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],default:t.EDITOR_DEFAULTS.autoClosingBrackets,description:"%editor.configuration.autoClosingBrackets%"},"editor.autoClosingQuotes":{type:"string",enum:["always","languageDefined","beforeWhitespace","never"],enumDescriptions:["",(0,n.localize)("editor.configuration.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),(0,n.localize)("editor.configuration.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],default:t.EDITOR_DEFAULTS.autoClosingQuotes,description:"%editor.configuration.autoClosingQuotes%"},"editor.autoSurround":{type:"string",enum:["languageDefined","brackets","quotes","never"],enumDescriptions:[(0,n.localize)("editor.configuration.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),(0,n.localize)("editor.configuration.autoSurround.brackets","Surround with brackets but not quotes."),(0,n.localize)("editor.configuration.autoSurround.quotes","Surround with quotes but not brackets."),""],default:t.EDITOR_DEFAULTS.autoSurround,description:"%editor.configuration.autoSurround%"},"editor.formatOnType":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.formatOnType,description:"%editor.configuration.formatOnType%"},"editor.formatOnPaste":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.formatOnPaste,description:"%editor.configuration.formatOnPaste%"},"editor.autoIndent":{type:"boolean",default:t.EDITOR_DEFAULTS.autoIndent,description:"%editor.configuration.autoIndent%"},"editor.suggestOnTriggerCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters,description:"%editor.configuration.suggestOnTriggerCharacters%"},"editor.acceptSuggestionOnEnter":{type:"string",enum:["on","smart","off"],default:t.EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnEnter,markdownEnumDescriptions:["",(0,n.localize)("editor.configuration.acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:(0,n.localize)("editor.configuration.acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")},"editor.acceptSuggestionOnCommitCharacter":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.acceptSuggestionOnCommitCharacter,markdownDescription:(0,n.localize)("editor.configuration.acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")},"editor.snippetSuggestions":{type:"string",enum:["top","bottom","inline","none"],enumDescriptions:[(0,n.localize)("editor.configuration.snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.inline","Show snippets suggestions with other suggestions."),(0,n.localize)("editor.configuration.snippetSuggestions.none","Do not show snippet suggestions.")],default:"inline",description:"%editor.configuration.snippetSuggestions%"},"editor.emptySelectionClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.emptySelectionClipboard,description:"%editor.configuration.emptySelectionClipboard%"},"editor.copyWithSyntaxHighlighting":{type:"boolean",default:t.EDITOR_DEFAULTS.copyWithSyntaxHighlighting,description:"%editor.configuration.copyWithSyntaxHighlighting%"},"editor.wordBasedSuggestions":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.wordBasedSuggestions,description:"%editor.configuration.wordBasedSuggestions%"},"editor.suggestSelection":{type:"string",enum:["first","recentlyUsed","recentlyUsedByPrefix"],markdownEnumDescriptions:[(0,n.localize)("editor.configuration.suggestSelection.first","Always select the first suggestion."),(0,n.localize)("editor.configuration.suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),(0,n.localize)("editor.configuration.suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:"%editor.configuration.suggestSelection%"},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:"%editor.configuration.suggestFontSize%"},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:"%editor.configuration.suggestLineHeight%"},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[(0,n.localize)("editor.configuration.tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),(0,n.localize)("editor.configuration.tabCompletion.off","Disable tab completions."),(0,n.localize)("editor.configuration.tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:"%editor.configuration.tabCompletion%"},"editor.suggest.filteredTypes":{type:"object",default:{keyword:!0,snippet:!0},markdownDescription:"%editor.configuration.suggest.filtered%",properties:{method:{type:"boolean",default:!0,markdownDescription:(0,n.localize)("editor.configuration.suggest.filtered.method","When set to `false` IntelliSense never shows `method` suggestions.")},function:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.function%"},constructor:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.constructor%"},field:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.field%"},variable:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.variable%"},class:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.class%"},struct:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.struct%"},interface:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.interface%"},module:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.module%"},property:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.property%"},event:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.event%"},operator:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.operator%"},unit:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.unit%"},value:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.value"},constant:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.constant%"},enum:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.enum%"},enumMember:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.enumMember%"},keyword:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.keyword%"},text:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.text%"},color:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.color%"},file:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.file%"},reference:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.reference%"},customcolor:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.customcolor%"},folder:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.folder%"},typeParameter:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.typeParameter%"},snippet:{type:"boolean",default:!0,markdownDescription:"%editor.configuration.suggest.filtered.snippet%"}}},"editor.gotoLocation.multiple":{description:"%editor.configuration.editor.gotoLocation.multiple%",type:"string",enum:["peek","gotoAndPeek","goto"],default:t.EDITOR_DEFAULTS.contribInfo.gotoLocation.multiple,enumDescriptions:[(0,n.localize)("editor.configuration.gotoLocation.multiple.peek","Show peek view of the results (default)"),(0,n.localize)("editor.configuration.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),(0,n.localize)("editor.configuration.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},"editor.selectionHighlight":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.selectionHighlight,description:"%editor.configuration.selectionHighlight%"},"editor.columnSelection":{type:"boolean",default:t.EDITOR_DEFAULTS.columnSelection,description:"%editor.configuration.columnSelection%"},"editor.occurrencesHighlight":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.occurrencesHighlight,description:"%editor.configuration.occurrencesHighlight%"},"editor.overviewRulerLanes":{type:"integer",default:3,description:"%editor.configuration.overviewRulerLanes%"},"editor.overviewRulerBorder":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.overviewRulerBorder,description:"%editor.configuration.overviewRulerBorder%"},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:"blink",description:"%editor.configuration.cursorBlinking%"},"editor.mouseWheelZoom":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.mouseWheelZoom,markdownDescription:"%editor.configuration.mouseWheelZoom%"},"editor.cursorSmoothCaretAnimation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.cursorSmoothCaretAnimation,description:"%editor.configuration.cursorSmoothCaretAnimation%"},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:t.EDITOR_FONT_DEFAULTS.cursorStyle,description:"%editor.configuration.cursorStyle%"},"editor.cursorWidth":{type:"integer",default:t.EDITOR_DEFAULTS.viewInfo.cursorWidth,markdownDescription:"%editor.configuration.cursorWidth%"},"editor.fontLigatures":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.fontLigatures,description:"%editor.configuration.fontLigatures%"},"editor.hideCursorInOverviewRuler":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.hideCursorInOverviewRuler,description:"%editor.configuration.hideCursorInOverviewRuler%"},"editor.renderWhitespace":{type:"string",enum:["none","boundary","selection","all"],enumDescriptions:["",(0,n.localize)("editor.configuration.renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),(0,n.localize)("editor.configuration.renderWhitespace.selection","Render whitespace characters only on selected text."),""],default:t.EDITOR_DEFAULTS.viewInfo.renderWhitespace,description:"%editor.configuration.renderWhitespace%"},"editor.rename.enablePreview":{type:"boolean",default:!0,description:"%editor.configuration.rename.enablePreview%"},"editor.renderControlCharacters":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.renderControlCharacters,description:"%editor.configuration.renderControlCharacters%"},"editor.guides.indentation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.indentation,description:"%editor.configuration.guides.indentation%"},"editor.guides.highlightActiveIndentation":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.highlightActiveIndentGuide,description:"%editor.configuration.guides.highlightActiveIndentation%"},"editor.guides.bracketPairs":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.guides.bracketPairs,description:"%editor.configuration.guides.bracketPairs%"},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",(0,n.localize)("editor.configuration.renderLineHighlight.all","Highlights both the gutter and the current line.")],default:t.EDITOR_DEFAULTS.viewInfo.renderLineHighlight,description:"%editor.configuration.renderLineHighlight%"},"editor.codeLens":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.codeLens,description:"%editor.configuration.codeLens%"},"editor.folding":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.folding,description:"%editor.configuration.folding%"},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:t.EDITOR_DEFAULTS.contribInfo.foldingStrategy,markdownDescription:"%editor.configuration.foldingStrategy%"},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:t.EDITOR_DEFAULTS.contribInfo.showFoldingControls,description:"%editor.configuration.showFoldingControls%"},"editor.matchBrackets":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.matchBrackets,description:"%editor.configuration.matchBrackets%"},"editor.glyphMargin":{type:"boolean",default:t.EDITOR_DEFAULTS.viewInfo.glyphMargin,description:"%editor.configuration.glyphMargin%"},"editor.useTabStops":{type:"boolean",default:t.EDITOR_DEFAULTS.useTabStops,description:"%editor.configuration.useTabStops%"},"editor.trimAutoWhitespace":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,description:"%editor.configuration.trimAutoWhitespace%"},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:"%editor.configuration.stablePeek%"},"editor.dragAndDrop":{type:"boolean",default:t.EDITOR_DEFAULTS.dragAndDrop,description:"%editor.configuration.dragAndDrop%"},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[(0,n.localize)("editor.configuration.accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),(0,n.localize)("editor.configuration.accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),(0,n.localize)("editor.configuration.accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:t.EDITOR_DEFAULTS.accessibilitySupport,description:(0,n.localize)("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:t.EDITOR_DEFAULTS.showUnused,description:"%editor.configuration.showUnused%"},"editor.comments.insertSpace":{type:"boolean",default:!0,description:"%editor.configuration.comments.insertSpace%"},"editor.comments.ignoreEmptyLines":{type:"boolean",default:!0,description:"%editor.configuration.comments.ignoreEmptyLines%"},"editor.links":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.links,description:"%editor.configuration.links%"},"editor.colorDecorators":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.colorDecorators,description:"%editor.configuration.colorDecorators%"},"editor.lightbulb.enabled":{type:"string",default:t.EDITOR_DEFAULTS.contribInfo.lightbulbEnabled,enum:[r.ShowLightbulbIconMode.Off,r.ShowLightbulbIconMode.OnCode,r.ShowLightbulbIconMode.On],enumDescriptions:[],description:"%editor.configuration.lightbulb.enabled%"},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:"%editor.configuration.maxTokenizationLineLength%"},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:"%editor.configuration.codeActionsOnSave.organizeImports%"},"source.fixAll":{type:"boolean",description:"%editor.configuration.codeActionsOnSave.fixAll%"}},additionalProperties:{type:"boolean"},default:t.EDITOR_DEFAULTS.contribInfo.codeActionsOnSave,description:"%editor.configuration.codeActionsOnSave%"},"editor.codeActionsOnSaveTimeout":{type:"number",default:t.EDITOR_DEFAULTS.contribInfo.codeActionsOnSaveTimeout,description:"%editor.configuration.codeActionsOnSaveTimeout%"},"editor.codeActionsOnSaveNotification":{type:"boolean",default:!0,description:"%editor.configuration.codeActionsOnSaveNotification%"},"editor.selectionClipboard":{type:"boolean",default:t.EDITOR_DEFAULTS.contribInfo.selectionClipboard,description:"%editor.configuration.selectionClipboard%",included:n.isLinux},"editor.largeFileOptimizations":{type:"boolean",default:t.EDITOR_MODEL_DEFAULTS.largeFileOptimizations,description:"%editor.configuration.largeFileOptimizations%"},"editor.defaultFormatter":{type:"string",description:"%editor.configuration.defaultFormatter%"},"editor.unicodeHighlight.ambiguousCharacters":{type:"boolean",default:!0,description:"%editor.configuration.unicodeHighlight.ambiguousCharacters%"},"editor.unicodeHighlight.allowedCharacters":{type:"object",default:{},description:"%editor.configuration.unicodeHighlight.allowedCharacters%"},"editor.unicodeHighlight.allowedLocales":{type:"object",default:{},description:"%editor.configuration.unicodeHighlight.allowedLocales%"},"diffEditor.renderIndicators":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.renderIndicators,description:"%editor.configuration.renderIndicators%"},"diffEditor.minimap":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.minimap},"diffEditor.experimental.stickyScroll.enabled":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.stickyScroll.enable}},p={"editor.tokenColorCustomizations":{type:"object",description:"%editor.configuration.tokenColorCustomizations%",default:{}},"editor.askIfDiff":{type:"boolean",default:!0,description:"%editor.configuration.askIfDiff%"},"editor.showActionWhenGroupEmpty":{type:"boolean",default:!1,description:"%editor.configuration.showActionWhenGroupEmpty%"},"editor.autoSave":{type:"string",enum:["off","afterDelay","editorFocusChange","windowLostFocus"],default:"off",description:"%editor.configuration.autoSave%"},"editor.autoSaveDelay":{type:"number",default:1e3,markdownDescription:"%editor.configuration.autoSaveDelay%"},"editor.preferredFormatter":{type:"object",default:{},description:"%editor.configuration.preferredFormatter%"},"editor.previewMode":{type:"boolean",default:!0,description:"%editor.configuration.previewMode%"},"editor.preventScrollAfterFocused":{type:"boolean",default:!1,description:"%editor.configuration.preventScrollAfterFocused%"},"editor.wrapTab":{type:"boolean",default:!1,description:"%editor.configuration.wrapTab%"},"editor.enablePreviewFromCodeNavigation":{type:"boolean",default:!1,markdownDescription:"%editor.configuration.enablePreviewFromCodeNavigation%"},"editor.minimap":{type:"boolean",default:!0},"editor.forceReadOnly":{type:"boolean",default:!1,description:"%editor.configuration.forceReadOnly%"},"editor.languageFeatureEnabledMaxSize":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.languageFeatureEnabledMaxSize%"},"editor.docExtHostSyncMaxSize":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.docExtHostSyncMaxSize%"},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],default:"all",description:"%editor.configuration.renderLineHighlight%"},"editor.fontFamily":{type:"string",default:t.EDITOR_FONT_DEFAULTS.fontFamily},"editor.fontSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.fontSize,minimum:6},"editor.tabSize":{type:"number",default:t.EDITOR_FONT_DEFAULTS.tabSize,minimum:1,description:"%editor.configuration.tabSize%"},"editor.formatOnPaste":{type:"boolean",default:!1},"editor.detectIndentation":{type:"boolean",default:!0},"editor.renderWhitespace":{type:"boolean",default:t.EDITOR_FONT_DEFAULTS.renderWhitespace},"editor.cursorStyle":{type:"string",enum:["line","block","block-outline","line-thin","underline","underline-thin"],default:t.EDITOR_FONT_DEFAULTS.cursorStyle},"editor.insertSpaces":{type:"boolean",default:t.EDITOR_FONT_DEFAULTS.insertSpace},"editor.wordWrap":{type:"string",enum:["off","on"],default:t.EDITOR_FONT_DEFAULTS.wordWrap},"editor.wordWrapColumn":{type:"number",default:t.EDITOR_FONT_DEFAULTS.wordWrapColumn,description:"%editor.configuration.wordWrapColumn%"},"editor.readonlyFiles":{type:"array",default:[],items:{type:"string"}},"editor.formatOnSave":{type:"boolean",default:!1,description:"%editor.configuration.formatOnSave%"},"editor.formatOnSaveTimeout":{type:"number",default:750,markdownDescription:"%editor.configuration.formatOnSaveTimeout%"},"editor.lineHeight":{type:"number",default:0,description:"%editor.lineHeight.description%"},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:"%editor.configuration.maxTokenizationLineLength%"},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[(0,n.localize)("editor.configuration.semanticHighlighting.true","Semantic highlighting enabled for all color themes."),(0,n.localize)("editor.configuration.semanticHighlighting.false","Semantic highlighting disabled for all color themes."),(0,n.localize)("editor.configuration.semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:!0,description:"%editor.configuration.semanticHighlighting.enabled%"},"editor.bracketPairColorization.enabled":{type:"boolean",default:!0,description:"%editor.configuration.bracketPairColorization.enabled%"},"editor.largeFile":{type:"number",default:4*1024*1024*1024,description:"%editor.configuration.largeFileSize%"},"editor.streamLargeFile":{type:"boolean",default:!0,description:"%editor.configuration.streamLargeFile%"},"editor.quickSuggestionsDelay":{type:"integer",default:100,description:"%editor.configuration.quickSuggestionsDelay%"},"editor.modelDisposeTime":{type:"integer",default:3e3},"workbench.editorAssociations":{type:"object",markdownDescription:"%editor.configuration.workbench.editorAssociations%",default:{},additionalProperties:{type:"string"}},"editor.experimental.stickyScroll.enabled":{type:"boolean",default:!1,description:"%editor.configuration.experimental.stickyScroll.enabled%"},"editor.mouseBackForwardToNavigate":{type:"boolean",default:!0,description:"%editor.configuration.mouseBackForwardToNavigate%"},"diffEditor.renderSideBySide":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.renderSideBySide,description:"%diffEditor.configuration.renderSideBySide%"},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.ignoreTrimWhitespace,description:"%diffEditor.configuration.ignoreTrimWhitespace%"},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.enabled,description:"Controls whether the diff editor shows unchanged regions."},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.revealLineCount,description:"Controls how many lines are used for unchanged regions.",minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.minimumLineCount,description:"Controls how many lines are used as a minimum for unchanged regions.",minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:t.DIFF_EDITOR_DEFAULTS.hideUnchangedRegions.contextLineCount,description:"Controls how many lines are used as context when comparing unchanged regions.",minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.showMoves,description:"Controls whether the diff editor should show detected code moves."},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.showEmptyDecorations,description:"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted."},"diffEditor.experimental.collapseUnchangedRegions":{type:"boolean",default:t.DIFF_EDITOR_DEFAULTS.experimental.collapseUnchangedRegions,description:"Controls whether the diff editor shows unchanged regions."}};t.editorPreferenceSchema={type:"object",properties:{...v,...p}},t.EditorPreferences=Symbol("EditorPreference")},90915:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEditorPreferenceProxy=o;const n=e(41869),r=e(24328);function o(l,_,v){return(0,n.createPreferenceProxy)(l,r.editorPreferenceSchema,{resourceUri:_,overrideIdentifier:v})}},53135:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GoToLineQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(74404),_=n.__importStar(e(20868)),v=e(55979),p=e(82196);class m extends v.AbstractGotoLineQuickAccessProvider{clearDecorations(a){super.clearDecorations(a)}preview(a,h){a.revealRangeInCenter(h,_.editor.ScrollType.Smooth),this.addDecorations(a,h)}goTo(a,h,d=!0){this.gotoLocation({editor:a},{range:h,preserveFocus:d,keyMods:{alt:!1,ctrlCmd:!1}})}}let s=class{constructor(){this.prefix=":",this.description=(0,o.localize)("quickopen.goToLine.desc"),this.quickAccess=new m}getFirstSelection(){const a=this.workbenchEditorService.currentEditor,h=a?.getSelections();return h?.[0]}getRange(a=1,h=1){return{startLineNumber:a,endLineNumber:a,startColumn:h,endColumn:h}}init(){var a;this.savedViewState=(0,o.withNullAsUndefined)((a=this.workbenchEditorService.currentEditor)===null||a===void 0?void 0:a.monacoEditor.saveViewState())}getModel(){var a,h,d,u,E;const f=this.workbenchEditorService.currentEditor,c=this.getFirstSelection();if(!c||!f)return{onType:(S,D)=>{D([new l.QuickOpenItem({label:(0,o.localize)("quickopen.goToLine.notValid"),run:()=>!1})])}};const y=(a=c.positionLineNumber)!==null&&a!==void 0?a:1,b=(h=c.positionColumn)!==null&&h!==void 0?h:1,A=(E=(u=(d=f.currentDocumentModel)===null||d===void 0?void 0:d.getMonacoModel())===null||u===void 0?void 0:u.getLineCount())!==null&&E!==void 0?E:1;return{onType:(S,D)=>{const T=S.split(/,|:|#|:|,/).map(R=>parseInt(R,10)).filter(R=>!isNaN(R)),w=T[0],I=T[1];if(w){let R=(0,o.formatLocalize)("quickopen.goToLine.lineInfo",w);I&&(R+=(0,o.formatLocalize)("quickopen.goToLine.colInfo",I));const M=this.getRange(w,I);D([new l.QuickOpenItem({label:R,run:O=>O===l.Mode.PREVIEW?(this.quickAccess.preview(f.monacoEditor,M),!1):(this.quickAccess.goTo(f.monacoEditor,M,!0),!0)})])}else this.quickAccess.clearDecorations(f.monacoEditor),D([new l.QuickOpenItem({label:(0,o.formatLocalize)("quickopen.goToLine.defaultMessage",y,b,A),run:()=>!1})])}}}getOptions(){return{}}onClose(a){const h=this.workbenchEditorService.currentEditor;h&&(h.monacoEditor.focus(),this.quickAccess.clearDecorations(h.monacoEditor),a&&this.savedViewState&&h.monacoEditor.restoreViewState(this.savedViewState))}};t.GoToLineQuickOpenHandler=s,n.__decorate([(0,r.Autowired)(l.PrefixQuickOpenService),n.__metadata("design:type",Object)],s.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],s.prototype,"workbenchEditorService",void 0),t.GoToLineQuickOpenHandler=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},50236:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolInformationQuickOpenItem=t.WorkspaceSymbolQuickOpenHandler=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(97821),v=e(51500),p=e(40540),m=e(23418);let s=class extends _.QuickOpenBaseAction{constructor(){super({id:"workspace-symbol:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,o.getIcon)("embed")})}async run(u){await u.openSide()}};s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s);let g=class{hasActions(){return!0}getActions(){return[this.workspaceSymbolOpenSideActionOpen]}};n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s)],g.prototype,"workspaceSymbolOpenSideActionOpen",void 0),g=n.__decorate([(0,r.Injectable)()],g);let a=class{constructor(){this.prefix="#",this.cancellationSource=new o.CancellationTokenSource}get description(){return(0,l.localize)("editor.workspaceSymbol.description")}getModel(){return{onType:(u,E)=>{if(u===""){E([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbol.search"),run:()=>!1})]);return}if(u==="#")return void E([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbolClass.search"),run:()=>!1})]);if(this.languageService.workspaceSymbolProviders.length===0){E([new o.QuickOpenItem({label:(0,l.localize)("editor.workspaceSymbol.notfound"),run:()=>!1})]);return}const f=u[0]==="#",c=[];this.cancellationSource.cancel();const y=new o.CancellationTokenSource;this.cancellationSource=y;const b={query:f?u.slice(1):u},A=this.reporterService.time(l.REPORT_NAME.QUICK_OPEN_MEASURE);Promise.all(this.languageService.workspaceSymbolProviders.map(async S=>{let D=await S.provideWorkspaceSymbols(b,y.token);if(f&&(D=D?.filter(T=>T.kind===p.SymbolKind.Class)),D&&D.length&&!y.token.isCancellationRequested){const T=await Promise.all(D.map(async w=>{const I=await this.workspaceService.asRelativePath(new o.URI(w.location.uri).parent);return new h(w,S,this.workbenchEditorService,y.token,I?.path||"")}));c.push(...T),E(c,this.workspaceSymbolActionProvider)}return D})).catch(S=>{this.logger.log(S)}).finally(()=>{y.token.isCancellationRequested||(c.length||E([]),A.timeEnd(f?"class":"symbol",{lookFor:u,stat:{symbol:c.length}}))})}}}getOptions(){return{fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:!1,getPlaceholderItem:(u,E)=>new o.QuickOpenItem({label:(0,l.localize)(E.startsWith("##")?"editor.workspaceSymbolClass.notfound":"editor.workspaceSymbol.notfound"),run:()=>!1})}}onClose(){this.cancellationSource.cancel()}onToggle(){this.cancellationSource.cancel()}};t.WorkspaceSymbolQuickOpenHandler=a,n.__decorate([(0,r.Autowired)(m.ILanguageService),n.__metadata("design:type",Object)],a.prototype,"languageService",void 0),n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],a.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(m.WorkbenchEditorService),n.__metadata("design:type",m.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",g)],a.prototype,"workspaceSymbolActionProvider",void 0),n.__decorate([(0,r.Autowired)(l.IReporterService),n.__metadata("design:type",Object)],a.prototype,"reporterService",void 0),t.WorkspaceSymbolQuickOpenHandler=a=n.__decorate([(0,r.Injectable)()],a);class h extends o.QuickOpenItem{constructor(u,E,f,c,y){super({}),this.symbol=u,this.provider=E,this.workbenchEditorService=f,this.token=c,this.relativePath=y}getLabel(){return this.symbol.name}getUri(){return new o.URI(this.symbol.location.uri)}getIconClass(){return(0,o.getSymbolIcon)(this.symbol.kind)}getDescription(){const u=this.symbol.containerName;return`${u?`${u} \xB7 `:""}${decodeURIComponent(this.relativePath)}`}fromRange(u){if(!u)return;const{start:E,end:f}=u;return{startLineNumber:E.line+1,startColumn:E.character+1,endLineNumber:f.line+1,endColumn:f.character+1}}open(u,E){this.workbenchEditorService.open(u,{range:this.fromRange(E)})}run(u){const E=this.getUri();return u===o.QuickOpenMode.OPEN&&this.provider.resolveWorkspaceSymbol(this.symbol,this.token).then(f=>{f?this.open(E,f.location.range):this.open(E,this.symbol.location.range)}),!0}openSide(){const u=this.getUri();return this.provider.resolveWorkspaceSymbol(this.symbol,this.token).then(E=>{this.workbenchEditorService.open(u,{preview:!1,split:m.EditorGroupSplitAction.Right,range:this.fromRange(E?E.location.range:this.symbol.location.range),focus:!0})})}}t.SymbolInformationQuickOpenItem=h},80200:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(23418),{addElement:v}=l.arrays;let p=class extends o.WithEventBus{constructor(){super(),this.providers=[],this.resources=new Map,this.gettingResources=new Map,this.resourceDecoration=new Map,this.cachedProvider=new l.LRUMap(500,200),this.onRegisterResourceProviderEmitter=new l.Emitter,this.onRegisterResourceProvider=this.onRegisterResourceProviderEmitter.event,this.onUnregisterResourceProviderEmitter=new l.Emitter,this.onUnregisterResourceProvider=this.onUnregisterResourceProviderEmitter.event}onResourceNeedUpdateEvent(a){const h=a.payload;if(this.resources.has(h.toString())){const d=this.resources.get(h.toString());this.doGetResource(h).then(u=>{d&&(Object.assign(d?.resource,u?.resource),d.provider=u?.provider),this.eventBus.fire(new _.ResourceDidUpdateEvent(h))})}}onResourceDecorationNeedChangeEvent(a){this.getResourceDecoration(a.payload.uri);let h=!1;const d=this.resourceDecoration.get(a.payload.uri.toString())||{};new Set([...Object.keys(d),...Object.keys(a.payload.decoration)]).forEach(u=>{d[u]!==a.payload.decoration[u]&&(h=!0)}),h&&(Object.assign(this.resourceDecoration.get(a.payload.uri.toString()),a.payload.decoration),this.eventBus.fire(new _.ResourceDecorationChangeEvent(a.payload)))}getSupportedSchemes(){return Array.from(this.providers.values()).map(a=>a.scheme).filter(Boolean)}async getResource(a){if(!this.resources.has(a.toString())){const h=await this.doGetResource(a);if(!h)return null;const d={resource:h.resource,provider:h.provider};this.resources.set(a.toString(),d)}return this.resources.get(a.toString()).resource}handlesUri(a){return!!this.calculateProvider(a)}async doGetResource(a){if(!this.gettingResources.has(a.toString())){const h=(async()=>{const d=this.calculateProvider(a);if(d){const u=await d.provideResource(a);return u.uri=a,{resource:u,provider:d}}else return this.logger.error("URI has no resource provider: "+a),null})();this.gettingResources.set(a.toString(),h),h.finally(()=>{this.gettingResources.delete(a.toString())})}return this.gettingResources.get(a.toString())}registerResourceProvider(a){this.onRegisterResourceProviderEmitter.fire(a);const h=new l.Disposable;return h.addDispose(v(this.providers,a)),h.addDispose({dispose:()=>{for(const d of this.resources.values())d.provider===a&&(d.provider=s,this.onUnregisterResourceProviderEmitter.fire(a));this.cachedProvider.clear()}}),this.cachedProvider.clear(),h}async shouldCloseResource(a,h){const d=this.getProvider(a.uri);return!d||!d.shouldCloseResource?!0:await d.shouldCloseResource(a,h)}async shouldCloseResourceWithoutConfirm(a){const h=this.getProvider(a.uri);return h&&h.shouldCloseResourceWithoutConfirm?await h.shouldCloseResourceWithoutConfirm(a):!1}async close(a,h){const d=this.getProvider(a.uri);return!d||!d.close?!0:await d.close(a,h)}calculateProvider(a){if(this.cachedProvider.has(a.toString()))return this.cachedProvider.get(a.toString());let h,d={weight:-1,index:-1};function u(E,f,c){d={weight:f,index:c},h=E}return this.providers.forEach((E,f)=>{let c=-1;E.handlesUri?c=E.handlesUri(a):E.scheme&&(c=E.scheme===a.scheme?10:-1),c>=0&&(c>d.weight||c===d.weight&&f>d.index)&&u(E,c,f)}),this.cachedProvider.set(a.toString(),h),h}getProvider(a){const h=this.resources.get(a.toString());if(h)return h.provider}getResourceDecoration(a){return this.resourceDecoration.has(a.toString())||this.resourceDecoration.set(a.toString(),{...m}),this.resourceDecoration.get(a.toString())}getResourceSubname(a,h){const d=this.getProvider(a.uri);return d&&d.provideResourceSubname?d.provideResourceSubname(a,h):null}disposeResource(a){const h=this.getProvider(a.uri);if(this.resources.delete(a.uri.toString()),this.resourceDecoration.delete(a.uri.toString()),!(!h||!h.onDisposeResource))return h.onDisposeResource(a)}};t.ResourceServiceImpl=p,n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,o.OnEvent)(_.ResourceNeedUpdateEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.ResourceNeedUpdateEvent]),n.__metadata("design:returntype",void 0)],p.prototype,"onResourceNeedUpdateEvent",null),n.__decorate([(0,o.OnEvent)(_.ResourceDecorationNeedChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.ResourceDecorationNeedChangeEvent]),n.__metadata("design:returntype",void 0)],p.prototype,"onResourceDecorationNeedChangeEvent",null),t.ResourceServiceImpl=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p);const m={dirty:!1,readOnly:!1},s={handlesUri:()=>-1,provideResource:g=>({uri:g,name:"",icon:""})}},52795:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorActions=t.Tabs=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(41869),_=e(25918),v=e(1149),p=e(63373),m=e(93899),s=e(48560),g=e(43718),a=e(23418),h=e(19352),d=n.__importDefault(e(62711)),u=e(78680),E=e(82196),f=e(50674),c=e(72570).UU,y=({group:A})=>{const S=(0,o.useRef)(),D=(0,o.useRef)(),T=(0,o.useRef)(),w=(0,o.useRef)(null),I=(0,o.useRef)(null),R=(0,s.useInjectable)(a.ResourceService),M=(0,s.useInjectable)(l.IEventBus),O=(0,o.useContext)(l.ConfigContext),x=(0,s.useInjectable)(a.WorkbenchEditorService),k=(0,s.useInjectable)(u.TabTitleMenuService),F=(0,s.useInjectable)(l.PreferenceService),L=(0,s.useInjectable)(m.IMenuRegistry),N=(0,s.useInjectable)(E.IEditorTabService),U=(0,s.useInjectable)(v.LayoutViewSizeConfig),W=(0,s.useInjectable)(l.ComponentRegistry),j=(0,l.useDesignStyles)(d.default.tab_right,"tab_right"),Q=(0,l.useDesignStyles)(d.default.close_tab,"close_tab"),G=(0,l.useDesignStyles)(d.default.kt_editor_close_icon,"kt_editor_close_icon"),Z=(0,l.useDesignStyles)(d.default.kt_editor_tabs_content,"kt_editor_tabs_content"),$=(0,l.useDesignStyles)(d.default.kt_editor_tabs_current_last,"kt_editor_tabs_current_last"),V=(0,l.useDesignStyles)(d.default.kt_editor_tab,"kt_editor_tab"),H=(0,l.useDesignStyles)(d.default.kt_editor_tab_current_prev,"kt_editor_tab_current_prev"),K=(0,l.useDesignStyles)(d.default.kt_editor_tab_current_next,"kt_editor_tab_current_next"),Y=(0,l.useDesignStyles)(d.default.kt_editor_tab_current,"kt_editor_tab_current"),X=(0,l.useDesignStyles)(d.default.kt_editor_tab_dirty,"kt_editor_tab_dirty"),re=(0,l.useDesignStyles)(d.default.kt_editor_tabs,"kt_editor_tabs"),oe=(0,l.useDesignStyles)(d.default.kt_editor_tabs_scroll_wrapper,"kt_editor_tabs_scroll_wrapper"),[he,me]=(0,o.useState)({}),[q,ye]=(0,o.useState)(!!F.get("editor.wrapTab")),[ge,te]=(0,o.useState)(new Map),[fe,Oe]=(0,o.useState)(),Me=(0,o.useMemo)(()=>(0,l.getSlotLocation)(c,O.layoutConfig),[]),Pe=o.default.useMemo(()=>{var Ae,We;const $e=(We=(Ae=W.getComponentRegistryInfo(a.TabbarRightExtraContentId))===null||Ae===void 0?void 0:Ae.views)===null||We===void 0?void 0:We[0];if($e)return $e},[]);(0,f.useUpdateOnGroupTabChange)(A),(0,s.useUpdateOnEventBusEvent)(a.ResourceDidUpdateEvent,[A.resources],Ae=>!!T&&A.resources.findIndex(We=>We.uri.isEqual(Ae))!==-1),(0,o.useEffect)(()=>{const Ae=new l.Disposable;return Ae.addDispose(A.onDidEditorGroupContentLoading(We=>{var $e;($e=A.resourceStatus.get(We))===null||$e===void 0||$e.finally(()=>{me(Object.assign({},he,{[We.uri.toString()]:!1}))}),me(Object.assign({},he,{[We.uri.toString()]:!0}))})),Ae.addDispose(A.onDidEditorGroupTabChanged(()=>{q||De()})),()=>{Ae.dispose()}},[A]);const Be=(0,o.useCallback)((Ae,We,$e)=>{if(Ae.dataTransfer.getData("uri")){const Ve=new l.URI(Ae.dataTransfer.getData("uri"));let mt;Ae.dataTransfer.getData("uri-source-group")&&(mt=x.getEditorGroup(Ae.dataTransfer.getData("uri-source-group"))),A.dropUri(Ve,E.DragOverPosition.CENTER,mt,$e)}Ae.dataTransfer.files.length>0&&M.fire(new E.EditorGroupFileDropEvent({group:A,tabIndex:We,files:Ae.dataTransfer.files}))},[A]),De=(0,o.useCallback)(()=>{l.fastdom.measure(()=>{try{if(S.current&&A.currentResource){const Ae=S.current.querySelector("."+d.default.kt_editor_tab+"[data-uri='"+A.currentResource.uri.toString()+"']");Ae&&Ae.scrollIntoView({block:"nearest",inline:"nearest"})}}catch{}})},[A,S.current]),_e=(0,o.useCallback)(()=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{l.fastdom.measure(()=>{var Ae;const We=(Ae=I.current)===null||Ae===void 0?void 0:Ae.offsetWidth;We!==fe&&Oe(We)})},200)},[I.current,w.current,fe]);(0,o.useEffect)(()=>{q||queueMicrotask(()=>{De()})},[q,S.current]),(0,o.useEffect)(()=>{if(!q){const Ae=new l.Disposable;return S.current&&Ae.addDispose(new l.DomListener(S.current,"mousewheel",b)),Ae.addDispose(M.onDirective(l.ResizeEvent.createDirective(Me),()=>{De()})),Ae.addDispose(M.onDirective(E.GridResizeEvent.createDirective(A.grid.uid),()=>{De()})),()=>{Ae.dispose()}}},[q]);const Ne=(0,o.useCallback)(()=>{l.fastdom.measureAtNextFrame(()=>{if(T.current&&q){const Ae=new Map;let We,$e;const Ve=Array.from(T.current.children);Ve.pop(),Ve.forEach(mt=>{mt.offsetTop!==We&&(We=mt.offsetTop,$e&&Ae.set(Ve.indexOf($e),!0)),$e=mt,Ae.set(Ve.indexOf(mt),!1)}),te(Ae)}})},[T.current,q]);(0,o.useEffect)(()=>{_e()},[I.current,q]),(0,o.useEffect)(Ne,[q,T.current,A,A.resources.length]),(0,o.useEffect)(()=>{const Ae=new l.DisposableCollection;return Ae.push(M.onDirective(l.ResizeEvent.createDirective(Me),()=>{Ne()})),Ae.push(F.onPreferenceChanged(We=>{We.preferenceName==="editor.wrapTab"&&ye(!!We.newValue)})),Ae.push(x.onDidCurrentEditorGroupChanged(()=>{_e()})),Ae.push(l.Event.debounce(l.Event.filter(L.onDidChangeMenu,We=>We===m.MenuId.EditorTitle),()=>{},200)(()=>{_e()})),()=>{Ae.dispose()}},[]),(0,o.useEffect)(()=>{const Ae=new l.DisposableCollection;return Ae.push(A.onDidEditorFocusChange(()=>{_e()})),()=>{Ae.dispose()}},[A]);const Te=(0,o.useCallback)(Ae=>{Ae.preventDefault(),Ae.stopPropagation(),D.current&&D.current.classList.add(d.default.kt_on_drag_over)},[D.current]),Ue=(0,o.useCallback)(Ae=>{D.current&&D.current.classList.remove(d.default.kt_on_drag_over)},[D.current]),pe=(0,o.useCallback)(Ae=>{D.current&&D.current.classList.remove(d.default.kt_on_drag_over),Be&&Be(Ae,-1)},[Be,D.current]),ie=(0,o.useCallback)(Ae=>{Ae.target===Ae.currentTarget&&x.createUntitledResource()},[x]),le=o.default.useCallback((Ae,We)=>{const $e=R.getResourceDecoration(Ae.uri),Ve=R.getResourceSubname(Ae,A.resources);return N.renderEditorTab(o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:he[Ae.uri.toString()]?"loading_indicator":(0,r.default)(Ae.icon)}," "),o.default.createElement("div",{tabIndex:0,role:"tab","aria-selected":We?"true":"false"},Ae.name),Ve?o.default.createElement("div",{className:d.default.subname},Ve):null,$e.readOnly?o.default.createElement("span",{className:(0,r.default)((0,l.getExternalIcon)("lock"),d.default.editor_readonly_icon)}):null,o.default.createElement("div",{className:j},o.default.createElement("div",{className:(0,r.default)({[d.default.kt_hidden]:!$e.dirty,[d.default.dirty]:!0})}),o.default.createElement("div",{className:Q,onMouseDown:mt=>{mt.stopPropagation(),A.close(Ae.uri)}},N.renderTabCloseComponent(o.default.createElement("div",{className:(0,r.default)((0,l.getIcon)("close"),G),tabIndex:0,role:"button","aria-label":(0,g.formatLocalize)("editor.closeTab.title",Ae.name)}))))),We)},[N]),Se=()=>{const Ae=A.resources.length===0,We=A.resources.findIndex($e=>A.currentResource===$e);return o.default.createElement("div",{draggable:!1,className:(0,r.default)({[Z]:!0,[d.default.kt_editor_tabs_content_empty]:Ae,[$]:We===A.resources.length-1}),ref:T,role:"tablist"},A.resources.map(($e,Ve)=>{let mt;const vt=R.getResourceDecoration($e.uri);return o.default.createElement("div",{draggable:!0,title:$e.title,className:(0,r.default)({[V]:!0,[d.default.last_in_row]:ge.get(Ve),[H]:We-1===Ve,[K]:We+1===Ve,[Y]:A.currentResource===$e,[d.default.kt_editor_tab_preview]:A.previewURI&&A.previewURI.isEqual($e.uri),[X]:vt.dirty}),style:q&&Ve===A.resources.length-1?{marginRight:fe,height:U.editorTabsHeight}:{height:U.editorTabsHeight},onContextMenu:xt=>{k.show(xt.nativeEvent.x,xt.nativeEvent.y,$e&&$e.uri,A),xt.preventDefault()},key:$e.uri.toString(),onMouseUp:xt=>{xt.nativeEvent.button===l.MouseEventButton.Middle&&(xt.preventDefault(),xt.stopPropagation(),A.close($e.uri))},onMouseDown:xt=>{xt.nativeEvent.button===l.MouseEventButton.Left&&A.open($e.uri,{focus:!0})},"data-uri":$e.uri.toString(),onDragOver:xt=>{xt.preventDefault(),xt.stopPropagation(),mt&&mt.classList.add(d.default.kt_on_drag_over)},onDragLeave:xt=>{mt&&mt.classList.remove(d.default.kt_on_drag_over)},onDrop:xt=>{mt&&mt.classList.remove(d.default.kt_on_drag_over),Be&&Be(xt,Ve,$e)},onDoubleClick:xt=>{A.pinPreviewed($e.uri)},ref:xt=>mt=xt,onDragStart:xt=>{xt.dataTransfer.setData("uri",$e.uri.toString()),xt.dataTransfer.setData("uri-source-group",A.name)}},le($e,A.currentResource===$e))}))};return o.default.createElement("div",{id:p.VIEW_CONTAINERS.EDITOR_TABS,className:re},o.default.createElement("div",{className:oe,ref:D,onDragOver:Te,onDragLeave:Ue,onDrop:pe,onDoubleClick:ie},q?o.default.createElement("div",{className:d.default.kt_editor_wrap_container},Se()):o.default.createElement(h.Scroll,{forwardedRef:Ae=>Ae?S.current=Ae:null,className:d.default.kt_editor_tabs_scroll},Se())),o.default.createElement(t.EditorActions,{className:(0,r.default)({[d.default.kt_editor_wrap_mode_action]:q}),ref:I,group:A}),(0,l.renderView)(Pe))};t.Tabs=y,t.EditorActions=(0,o.forwardRef)((A,S)=>{const D=(0,l.useDesignStyles)(d.default.editor_actions,"editor_actions"),{group:T,className:w}=A,I=(0,o.useCallback)(()=>{var W,j;return T.currentResource?[T.currentResource.uri,T,((W=T.currentOrPreviousFocusedEditor)===null||W===void 0?void 0:W.currentUri)||((j=T.currentEditor)===null||j===void 0?void 0:j.currentUri)]:void 0},[T]),R=(0,s.useInjectable)(E.IEditorActionRegistry),M=(0,s.useInjectable)(a.WorkbenchEditorService),O=(0,s.useInjectable)(v.LayoutViewSizeConfig),x=R.getMenu(T),[k,F]=(0,o.useState)(M.currentEditorGroup===T),[L,N]=(0,o.useState)(I()),U=x.getMergedMenuNodes().length===0;return(0,o.useEffect)(()=>{const W=new l.DisposableCollection;return W.push(M.onDidCurrentEditorGroupChanged(()=>{F(M.currentEditorGroup===T)})),W.push(M.onActiveResourceChange(()=>{N(I())})),W.push(T.onDidEditorGroupTabChanged(()=>{N(I())})),()=>{W.dispose()}},[T]),o.default.createElement("div",{ref:S,className:(0,r.default)(D,w,{[d.default.editor_actions_no_actions]:U}),style:{height:O.editorTabsHeight}},o.default.createElement(_.InlineMenuBar,{menus:x,context:L,regroup:(W,j)=>k?[W,j]:[[],j]}))});function b(A){(this.offsetWidth+this.scrollLeft+A.deltaX>this.scrollWidth||this.scrollLeft+A.deltaX<0)&&A.preventDefault()}},82196:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IEditorTabService=t.ResoucesOfActiveComponentChangedEvent=t.CodeEditorDidVisibleEvent=t.EditorComponentDisposeEvent=t.ResourceOpenTypeChangedEvent=t.IEditorFeatureRegistry=t.IBreadCrumbService=t.CompareResult=t.ICompareService=t.IEditorActionRegistry=t.EditorDecorationTypeRemovedEvent=t.EditorDecorationChangeEvent=t.EditorDecorationProviderRegistrationEvent=t.RegisterEditorSideComponentEvent=t.EditorGroupsResetSizeEvent=t.EditorGroupIndexChangedEvent=t.EditorConfigurationChangedEvent=t.EditorVisibleChangeEvent=t.EditorSelectionChangeEvent=t.IEditorDecorationCollectionService=t.EditorGroupFileDropEvent=t.EditorActiveResourceStateChangedEvent=t.EditorGroupChangeEvent=t.EditorGroupDisposeEvent=t.EditorGroupCloseEvent=t.EditorGroupOpenEvent=t.GridResizeEvent=t.MultiDiffSourceContribution=t.BrowserEditorContribution=t.EditorComponentRegistry=t.RegisterEditorComponentEvent=t.RegisterEditorComponentResolverEvent=t.EditorComponentRenderMode=void 0;const n=e(85608),r=e(41869);n.__exportStar(e(23418),t);var o;(function(O){O[O.ONE_PER_RESOURCE=1]="ONE_PER_RESOURCE",O[O.ONE_PER_GROUP=2]="ONE_PER_GROUP",O[O.ONE_PER_WORKBENCH=3]="ONE_PER_WORKBENCH"})(o||(t.EditorComponentRenderMode=o={}));class l extends r.BasicEvent{}t.RegisterEditorComponentResolverEvent=l;class _ extends r.BasicEvent{}t.RegisterEditorComponentEvent=_;class v{}t.EditorComponentRegistry=v,t.BrowserEditorContribution=Symbol("BrowserEditorContribution"),t.MultiDiffSourceContribution=Symbol("MultiDiffSourceContribution");class p extends r.BasicEvent{static createDirective(x){return`grid-resize-${x}`}}t.GridResizeEvent=p;class m extends r.BasicEvent{}t.EditorGroupOpenEvent=m;class s extends r.BasicEvent{}t.EditorGroupCloseEvent=s;class g extends r.BasicEvent{}t.EditorGroupDisposeEvent=g;class a extends r.BasicEvent{}t.EditorGroupChangeEvent=a;class h extends r.BasicEvent{}t.EditorActiveResourceStateChangedEvent=h;class d extends r.BasicEvent{}t.EditorGroupFileDropEvent=d,t.IEditorDecorationCollectionService=Symbol("IEditorDecorationCollectionService");class u extends r.BasicEvent{}t.EditorSelectionChangeEvent=u;class E extends r.BasicEvent{}t.EditorVisibleChangeEvent=E;class f extends r.BasicEvent{}t.EditorConfigurationChangedEvent=f;class c extends r.BasicEvent{}t.EditorGroupIndexChangedEvent=c;class y extends r.BasicEvent{}t.EditorGroupsResetSizeEvent=y;class b extends r.BasicEvent{}t.RegisterEditorSideComponentEvent=b;class A extends r.BasicEvent{}t.EditorDecorationProviderRegistrationEvent=A;class S extends r.BasicEvent{}t.EditorDecorationChangeEvent=S;class D extends r.BasicEvent{}t.EditorDecorationTypeRemovedEvent=D,t.IEditorActionRegistry=Symbol("IEditorActionRegistry"),t.ICompareService=Symbol("ICompareService");var T;(function(O){O.revert="revert",O.accept="accept",O.cancel="cancel"})(T||(t.CompareResult=T={})),t.IBreadCrumbService=Symbol("IBreadScrumbService"),t.IEditorFeatureRegistry=Symbol("IEditorFeatureRegistry");class w extends r.BasicEvent{}t.ResourceOpenTypeChangedEvent=w;class I extends r.BasicEvent{}t.EditorComponentDisposeEvent=I;class R extends r.BasicEvent{}t.CodeEditorDidVisibleEvent=R;class M extends r.BasicEvent{}t.ResoucesOfActiveComponentChangedEvent=M,t.IEditorTabService=Symbol("IEditorTabService")},17878:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.UntitledSchemeResourceProvider=t.UntitledSchemeDocumentProvider=t.UntitledDocumentIdCounter=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(72665),v=e(51500),p=e(23418),m=e(96689);let s=n=class{constructor(){this._id=1}async update(){this._id=await this.getLatestUnitiedIndex()}async getLatestUnitiedIndex(d){var u;await this.workspaceService.whenReady;const c=(d||((u=this.workspaceService.workspace)===null||u===void 0?void 0:u.children)||[]).filter(y=>l.URI.file(y.uri).displayName.startsWith(n.UNTITLED_FILE_NAME_PREFIX)).map(y=>{const b=l.URI.file(y.uri).displayName.match(new RegExp(`^${n.UNTITLED_FILE_NAME_PREFIX}(\\d+)`,"i"));return b?parseInt(b[1],10):-1}).filter(y=>y!==-1);return c.length>0?Math.max(...c)+1:1}get id(){return this._id++}};t.UntitledDocumentIdCounter=s,s.UNTITLED_FILE_NAME_PREFIX="Untitled-",r.__decorate([(0,o.Autowired)(v.IWorkspaceService),r.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),t.UntitledDocumentIdCounter=s=n=r.__decorate([(0,o.Injectable)()],s);let g=class{constructor(){this._onDidChangeContent=new l.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(d){return d===l.Schemes.untitled}async provideEncoding(d){return this.preferenceService.get("files.encoding",void 0,d.toString(),(0,l.getLanguageIdFromMonaco)(d))||"utf8"}async provideEOL(d){const u=await this.applicationService.getBackendOS(),E=this.preferenceService.get("files.eol","auto",d.toString(),(0,l.getLanguageIdFromMonaco)(d));return E!=="auto"?E:u===l.OperatingSystem.Windows?`\r
|
|
33390
33390
|
`:`
|
|
33391
|
-
`}async provideEditorDocumentModelContent(d,u){return""}isReadonly(d){return!1}isAlwaysDirty(d){return!0}disposeEvenDirty(d){return!0}closeAutoSave(d){return!0}async saveDocumentModel(d,u,E,f,c,y=!1){const{name:b}=d.getParsedQuery(),A=d.path.toString()!=="/"?l.path.dirname(d.path.toString()):this.appConfig.workspaceDir,S=await this.commandService.tryExecuteCommand("file.save",{showNameInput:!0,defaultFileName:b||d.displayName,defaultUri:l.URI.file(l.isWindows?A.replaceAll("\\","/"):A)});return S&&(await this.editorDocumentModelService.saveEditorDocumentModel(S,u,E,f,c,y),await this.workbenchEditorService.open(S,{preview:!1,focus:!0,replace:!0,forceClose:!0})),{state:l.SaveTaskResponseState.SUCCESS}}onDidDisposeModel(){}};t.UntitledSchemeDocumentProvider=g,r.__decorate([(0,o.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],g.prototype,"editorDocumentModelService",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",p.WorkbenchEditorService)],g.prototype,"workbenchEditorService",void 0),r.__decorate([(0,o.Autowired)(l.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(l.IApplicationService),r.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),r.__decorate([(0,o.Autowired)(s),r.__metadata("design:type",s)],g.prototype,"untitledIndex",void 0),r.__decorate([(0,o.Autowired)(l.PreferenceService),r.__metadata("design:type",Object)],g.prototype,"preferenceService",void 0),t.UntitledSchemeDocumentProvider=g=r.__decorate([(0,o.Injectable)()],g);let a=class extends l.WithEventBus{constructor(){super(...arguments),this.scheme=l.Schemes.untitled}provideResource(d){const{name:u}=d.getParsedQuery();return{name:u||d.displayName,uri:d,icon:"",metadata:null}}async shouldCloseResourceWithoutConfirm(d){const u=this.documentModelService.getModelDescription(d.uri,"close-resource-check");return!!(u&&u.dirty)}async close(d,u){const E=this.documentModelService.getModelReference(d.uri,"close-resource-check");if(!E)return!1;if(u===p.AskSaveResult.SAVE){const f=await E.instance.save();return E.dispose(),f}else return u===p.AskSaveResult.REVERT?(await E.instance.revert(),E.dispose(),!0):!u||u===p.AskSaveResult.CANCEL?(E.dispose(),!1):(E.dispose(),!0)}async shouldCloseResource(d){const u=this.documentModelService.getModelDescription(d.uri,"close-resource-check");if(!u||!u.dirty)return!0;const E={[(0,l.localize)("file.prompt.dontSave","Don't Save")]:p.AskSaveResult.REVERT,[(0,l.localize)("file.prompt.save","Save")]:p.AskSaveResult.SAVE,[(0,l.localize)("file.prompt.cancel","Cancel")]:p.AskSaveResult.CANCEL},f=await this.dialogService.open({message:(0,l.formatLocalize)("saveChangesMessage",d.name),type:l.MessageType.Info,buttons:Object.keys(E)});return await this.close(d,E[f])}};t.UntitledSchemeResourceProvider=a,r.__decorate([(0,o.Autowired)(_.IDialogService),r.__metadata("design:type",Object)],a.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],a.prototype,"documentModelService",void 0),t.UntitledSchemeResourceProvider=a=r.__decorate([(0,o.Injectable)()],a)},33835:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditor=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(23418),_=e(96689),v=p=>{const m=r.default.useRef(),s=(0,o.useInjectable)(l.EditorCollectionService),g=(0,o.useInjectable)(_.IEditorDocumentModelService),[a,h]=r.default.useState(void 0),[d,u]=r.default.useState(void 0),[E,f]=r.default.useState(void 0),[c,y]=r.default.useState(void 0);let b=!1;return r.default.useEffect(()=>{if(m.current){a&&a.dispose();const A=s.createCodeEditor(m.current,{automaticLayout:!0,...p.options});h(A),d&&A.open(d)}return()=>{b=!0,a&&a.dispose(),d&&d.dispose()}},[m.current]),p&&a&&p.editorRef&&p.editorRef(a),E&&c!==E&&(y(E),g.createModelReference(new o.URI(E),"editor-react-component").then(A=>{d&&d.dispose(),!b&&A.instance.uri.toString()===E?u(A):A.dispose()})),d&&a&&a.currentDocumentModel!==d.instance&&a.open(d),p.uri&&p.uri.toString()!==E&&f(p.uri.toString()),r.default.createElement("div",{ref:A=>A&&(m.current=A),...p})};t.CodeEditor=v},50674:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateOnGroupTabChange=r;const n=e(41869);function r(o){return(0,n.useUpdateOnEvent)(o.onDidEditorGroupTabChanged,[o])}},6670:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSuggestWidgetContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(76835);let v=class{contribute(m){const s=new o.DisposableCollection,g=m.monacoEditor.getContribution(_.SuggestController.ID);if(g&&g.widget&&g.widget.value){const a=g.widget.value;s.push(a.onDidSelect(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidSelect",data:h}))})),s.push(a.onDidHide(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidHide",data:h}))})),s.push(a.onDidShow(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidShow",data:h}))})),s.push(a.onDidFocus(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidFocus",data:h}))})),a&&a._setDetailsVisible&&a._setDetailsVisible(this.preferenceService.get("editor.suggest.details.visible",!0))}return s}};t.EditorSuggestWidgetContribution=v,n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],v.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],v.prototype,"preferenceService",void 0),t.EditorSuggestWidgetContribution=v=n.__decorate([(0,r.Injectable)()],v)},67903:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTopPaddingContribution=void 0;class e{contribute(r){return r.monacoEditor.onDidChangeModel(()=>{r.monacoEditor.changeViewZones(o=>{o.addZone({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:0})})})}}t.EditorTopPaddingContribution=e},51553:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorGroup=t.WorkbenchEditorServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),_=e(75524),v=e(43718),p=e(14951),m=n.__importStar(e(20868)),s=e(72665),g=e(50189),a=e(23418),h=e(96689),d=e(76759),u=e(47049),E=e(82196),f=e(17878),c=10,y=T=>!!(T.supportsRevive&&!T.deleted);let b=class extends v.WithEventBus{constructor(){super(),this.editorGroups=[],this._onDidEditorGroupsChanged=new v.Emitter,this.onDidEditorGroupsChanged=this._onDidEditorGroupsChanged.event,this._sortedEditorGroups=[],this._onActiveResourceChange=new v.Emitter,this.onActiveResourceChange=this._onActiveResourceChange.event,this._onActiveEditorUriChange=new v.Emitter,this.onActiveEditorUriChange=this._onActiveEditorUriChange.event,this._onCursorChange=new v.Emitter,this.onCursorChange=this._onCursorChange.event,this._onDidCurrentEditorGroupChanged=new v.Emitter,this.onDidCurrentEditorGroupChanged=this._onDidCurrentEditorGroupChanged.event,this._restoring=!0,this.contributionsReady=new v.Deferred,this.untitledCloseIndex=[],this.gridReady=!1,this._onDidGridReady=new v.Emitter,this.onDidGridReady=this._onDidGridReady.event,this.editorGroupIdGen=0,this.untitledIndex.update(),this.initialize()}setEditorContextKeyService(w){this.editorContextKeyService=w}setCurrentGroup(w){var I;if(w){if(this._currentEditorGroup===w)return;this._currentEditorGroup=w,this._onActiveResourceChange.fire(w.currentResource),this.eventBus.fire(new E.EditorActiveResourceStateChangedEvent({resource:w.currentResource,openType:w.currentOpenType,editorUri:(I=this.currentEditor)===null||I===void 0?void 0:I.currentUri})),this._onDidCurrentEditorGroupChanged.fire(this._currentEditorGroup)}}onEditorGroupChangeEvent(w){var I;w.payload.group===this.currentEditorGroup&&this.eventBus.fire(new E.EditorActiveResourceStateChangedEvent({resource:w.payload.newResource,openType:w.payload.newOpenType,editorUri:(I=this.currentEditor)===null||I===void 0?void 0:I.currentUri}))}getAllOpenedUris(){const w=[];for(const I of this.editorGroups)for(const R of I.resources)w.findIndex(O=>O.isEqual(R.uri))===-1&&w.push(R.uri);return w}async getAllOpenedDocuments(){const w=[];for(const I of this.editorGroups)for(const R of I.resources){if(R.uri.scheme!=="file")continue;if(w.findIndex(O=>O.uri.isEqual(R.uri))===-1){const O=await I.getDocumentModelRef(R.uri);O&&w.push(O.instance)}}return w}async save(w){if(this.editorGroups.length)try{for(const I of this.editorGroups){const R=I.resources.find(M=>M.uri.isEqual(w));R&&await I.saveResource(R)}return w}catch(I){throw new Error(`Save Failed: ${I.message}`)}}getDefaultSavePath(w){const I=w.path.toString()!=="/"?v.path.dirname(w.path.toString()):this.appConfig.workspaceDir;return v.isWindows?I.replace(/\\/g,"/"):I}async saveAs(w){var I,R;if(!(!this._currentEditorGroup||!((I=this._currentEditorGroup.currentResource)===null||I===void 0)&&I.deleted))try{const M=this.getDefaultSavePath(w);return await this.windowDialogService.showSaveDialog({saveLabel:"SaveAs File:",showNameInput:!0,defaultFileName:(R=this._currentEditorGroup.currentResource)===null||R===void 0?void 0:R.name,defaultUri:v.URI.file(M),saveAs:!0})}catch(M){throw new Error(`SaveAs Failed: ${M.message}`)}}async saveAll(w,I){for(const R of this.editorGroups)await R.saveAll(w,I)}hasDirty(){for(const w of this.editorGroups)if(w.hasDirty())return!0;return!1}calcDirtyCount(){const w=new Set;return this.editorGroups.reduce((I,R)=>I+R.calcDirtyCount(w),0)}createEditorGroup(){const w=this.injector.get(A,[this.generateRandomEditorGroupName(),this.editorGroupIdGen++]);this.editorGroups.push(w);const I=new v.Disposable(w.onDidEditorGroupBodyChanged(()=>{w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveResourceChange.fire(w.currentResource))}),w.onDidEditorFocusChange(()=>{var M;w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveEditorUriChange.fire((M=w.currentOrPreviousFocusedEditor)===null||M===void 0?void 0:M.currentUri))}));w.addDispose({dispose:()=>{I.dispose()}});const R=w.onDidEditorGroupTabChanged(()=>{this.saveOpenedResourceState()});return w.addDispose({dispose:()=>{R.dispose()}}),w.onCurrentEditorCursorChange(M=>{this._currentEditorGroup===w&&this._onCursorChange.fire(M)}),w}generateRandomEditorGroupName(){let w=(0,v.makeRandomHexString)(5);for(;this.editorGroups.findIndex(I=>I.name===w)!==-1;)w=(0,v.makeRandomHexString)(5);return w}initialize(){return this.initializing||(this.initializing=this.doInitialize()),this.initializing}async doInitialize(){this.openedResourceState=await this.initializeState(),await this.contributionsReady.promise,await this.restoreState(),this._currentEditorGroup=this.editorGroups[0]}async initializeState(){return await this.getStorage(v.STORAGE_NAMESPACE.WORKBENCH)}get currentEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentEditor}get currentCodeEditor(){return this.currentEditorGroup.currentCodeEditor}get currentEditorGroup(){return this._currentEditorGroup}get currentOrPreviousFocusedEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentOrPreviousFocusedEditor}async open(w,I){await this.initialize();let R=this.currentEditorGroup,M;if(I&&typeof I.groupIndex<"u"?M=I.groupIndex:I&&I.relativeGroupIndex&&(M=this.currentEditorGroup.index+I.relativeGroupIndex),typeof M=="number"&&M>=0){if(M>=this.editorGroups.length)return R.open(w,Object.assign({},I,{split:a.EditorGroupSplitAction.Right}));R=this.sortedEditorGroups[M]||this.currentEditorGroup}return R.open(w,I)}async openUris(w){await this.initialize(),await this.currentEditorGroup.openUris(w)}getEditorGroup(w){return this.editorGroups.find(I=>I.name===w)}get currentResource(){return this.currentEditorGroup?this.currentEditorGroup.currentResource:null}removeGroup(w){const I=this.editorGroups.findIndex(R=>R===w);if(I!==-1){if(this.editorGroups.length===1)return;this.editorGroups.splice(I,1),this.currentEditorGroup===w&&this.setCurrentGroup(this.editorGroups[0]);for(let R=I;R<this.editorGroups.length;R++)this.eventBus.fire(new E.EditorGroupIndexChangedEvent({group:this.editorGroups[R],index:R}))}}async saveOpenedResourceState(){if(this._restoring)return;const w=this.topGrid.serialize();await this.openedResourceState.set("grid",w)}prepareContextKeyService(){const w=R=>{let M=null;const O=this.documentModelManager.getModelDescription(R,"resourceContextKey");return O&&(M=O.languageId),M},I=new l.ResourceContextKey(this.editorContextKeyService,R=>{const M=w(R);return M||w(R)});this.onActiveResourceChange(R=>{this.currentEditor&&this.currentEditor.currentUri?I.set(this.currentEditor.currentUri):R?I.set(R.uri):I.reset()}),this.currentEditor&&this.currentEditor.currentUri?I.set(this.currentEditor.currentUri):this.currentResource?I.set(this.currentResource.uri):I.reset()}onDomCreated(w){this.editorContextKeyService&&this.editorContextKeyService.attachToDomNode(w)}notifyGroupChanged(){this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}async restoreState(){let w={editorGroup:{uris:[],previewIndex:-1}};this.appConfig.disableRestoreEditorGroupState||(w=this.openedResourceState.get("grid",w)),this.topGrid=new u.EditorGrid,this.addDispose(this.topGrid),this.addDispose(this.topGrid.onDidGridAndDesendantStateChange(()=>{this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}));const I=[],R=this.topGrid.deserialize(w,()=>this.createEditorGroup(),I).then(()=>{this.topGrid.children.length===0&&!this.topGrid.editorGroup&&this.topGrid.setEditorGroup(this.createEditorGroup()),this.gridReady=!0,this._onDidGridReady.fire(),this.notifyGroupChanged()});return Promise.all(I).then(()=>{this._restoring=!1;for(const M of this.contributions.getContributions())M.onDidRestoreState&&M.onDidRestoreState()}),R}async closeAll(w,I){for(const R of this.editorGroups.slice(0))w?await R.close(w,{force:I}):await R.closeAll()}async closeAllOnlyConfirmOnce(){const w=[];for(const L of this.editorGroups)for(const N of L.resources)w.push(N);const R=(await Promise.all(w.map(async L=>({shouldClose:await this.resourceService.shouldCloseResourceWithoutConfirm(L),resource:L})))).filter(L=>L.shouldClose);if(R.length===0)return!1;const M={[(0,v.localize)("file.prompt.dontSave","Don't Save")]:E.AskSaveResult.REVERT,[(0,v.localize)("file.prompt.save","Save")]:E.AskSaveResult.SAVE,[(0,v.localize)("file.prompt.cancel","Cancel")]:E.AskSaveResult.CANCEL};let x=R.slice(0,c).map(L=>L.resource.name).join("\u3001");R.length>c&&(R.length-c===1?x+=(0,v.localize)("file.prompt.more.one"):x+=(0,v.formatLocalize)("file.prompt.more.number",R.length-c));const k=await this.dialogService.open({message:(0,o.toMarkdown)((0,v.formatLocalize)("saveNFilesChangesMessage",R.length,x),this.openner),type:v.MessageType.Info,buttons:Object.keys(M)}),F=M[k];return F===E.AskSaveResult.SAVE?(await Promise.all(R.map(L=>{var N,U;return(U=(N=this.resourceService).close)===null||U===void 0?void 0:U.call(N,L.resource,E.AskSaveResult.SAVE)})),!1):F===E.AskSaveResult.REVERT?(await Promise.all(R.map(L=>{var N,U;return(U=(N=this.resourceService).close)===null||U===void 0?void 0:U.call(N,L.resource,E.AskSaveResult.REVERT)})),!1):!0}async close(w,I){return this.closeAll(w,I)}get sortedEditorGroups(){return this._sortedEditorGroups||(this._sortedEditorGroups=[],this.topGrid.sortEditorGroups(this._sortedEditorGroups)),this._sortedEditorGroups}handleOnCloseUntitledResource(w){if(w.payload.resource.uri.scheme===v.Schemes.untitled){const{index:I}=w.payload.resource.uri.getParsedQuery();this.untitledCloseIndex.push(parseInt(I,10)),this.untitledCloseIndex.sort((R,M)=>R-M)}}createUntitledURI(){const w=this.untitledCloseIndex.shift()||this.untitledIndex.id;return new v.URI().withScheme(v.Schemes.untitled).withQuery(`name=${f.UntitledDocumentIdCounter.UNTITLED_FILE_NAME_PREFIX}${w}&index=${w}`)}createUntitledResource(w={uri:this.createUntitledURI()}){return this.open(w.uri,{preview:!1,focus:!0,...w.resourceOpenOptions})}};t.WorkbenchEditorServiceImpl=b,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],b.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(a.ResourceService),n.__metadata("design:type",a.ResourceService)],b.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.StorageProvider),n.__metadata("design:type",Function)],b.prototype,"getStorage",void 0),n.__decorate([(0,r.Autowired)(s.IDialogService),n.__metadata("design:type",Object)],b.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],b.prototype,"openner",void 0),n.__decorate([(0,r.Autowired)(E.BrowserEditorContribution),n.__metadata("design:type",Object)],b.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(h.IEditorDocumentModelService),n.__metadata("design:type",Object)],b.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(f.UntitledDocumentIdCounter),n.__metadata("design:type",f.UntitledDocumentIdCounter)],b.prototype,"untitledIndex",void 0),n.__decorate([(0,r.Autowired)(s.IWindowDialogService),n.__metadata("design:type",Object)],b.prototype,"windowDialogService",void 0),n.__decorate([(0,v.OnEvent)(E.EditorGroupChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorGroupChangeEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"onEditorGroupChangeEvent",null),n.__decorate([(0,v.OnEvent)(E.EditorGroupCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorGroupCloseEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"handleOnCloseUntitledResource",null),t.WorkbenchEditorServiceImpl=b=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],b);let A=class extends v.WithEventBus{constructor(w,I){super(),this.name=w,this.groupId=I,this.openingPromise=new Map,this._onDidEditorFocusChange=this.registerDispose(new v.Emitter),this.onDidEditorFocusChange=this._onDidEditorFocusChange.event,this._onDidEditorGroupTabChanged=new v.Emitter,this.onDidEditorGroupTabChanged=this._onDidEditorGroupTabChanged.event,this._onDidEditorGroupTabOperation=new v.Emitter,this.onDidEditorGroupTabOperation=this._onDidEditorGroupTabOperation.event,this._onDidEditorGroupBodyChanged=new v.Emitter,this.onDidEditorGroupBodyChanged=this._onDidEditorGroupBodyChanged.event,this._onDidEditorGroupContentLoading=new v.Emitter,this.onDidEditorGroupContentLoading=this._onDidEditorGroupContentLoading.event,this.previewURI=null,this.resources=[],this.resourceStatus=new Map,this.cachedResourcesActiveOpenTypes=new Map,this.cachedResourcesOpenTypes=new Map,this.availableOpenTypes=[],this.activeComponents=new Map,this.activateComponentsProps=new Map,this.holdDocumentModelRefs=new Map,this.toDispose=[],this._prevDomHeight=0,this._prevDomWidth=0,this._onCurrentEditorCursorChange=new v.Emitter,this.onCurrentEditorCursorChange=this._onCurrentEditorCursorChange.event,this.resourceOpenHistory=[],this._domNode=null,this._diffEditorDomNode=null,this._diffEditorDomNodeAttached=!1,this._multiFileDiffEditorDomNode=null,this._multiFileDiffEditorDomNodeAttached=!1,this._mergeEditorDomNode=null,this._mergeEditorDomNodeAttached=!1,this.codeEditorReady=new v.ReadyEvent,this.diffEditorReady=new v.ReadyEvent,this.diffEditorDomReady=new v.ReadyEvent,this.multiDiffEditorDomReady=new v.ReadyEvent,this.mergeEditorReady=new v.ReadyEvent,this.mergeEditorDomReady=new v.ReadyEvent,this._restoringState=!1,this._multiDiffEditorDomNodeAttached=!1,this.eventBus.onDirective(o.ResizeEvent.createDirective((0,o.getSlotLocation)("@opensumi/ide-editor",this.config.layoutConfig)),()=>{this.doLayoutEditors()}),this.eventBus.on(E.GridResizeEvent,R=>{R.payload.gridId===this.grid.uid&&this.doLayoutEditors()}),this.eventBus.on(E.EditorComponentDisposeEvent,R=>{this.activeComponents.delete(R.payload),this.activateComponentsProps.delete(R.payload)}),this.listenToExplorerAutoRevealConfig()}listenToExplorerAutoRevealConfig(){this.explorerAutoRevealConfig=!!this.preferenceService.get("explorer.autoReveal"),this.disposables.push(this.preferenceService.onPreferenceChanged(w=>{w.preferenceName==="explorer.autoReveal"&&(this.explorerAutoRevealConfig=w.newValue)}))}attachDiffEditorDom(w){this._diffEditorDomNodeAttached||(this._diffEditorDomNode=w,this.diffEditorDomReady.ready(),this._diffEditorDomNodeAttached=!0)}attachMergeEditorDom(w){this._mergeEditorDomNodeAttached||(this._mergeEditorDomNode=w,this.mergeEditorDomReady.ready(),this._mergeEditorDomNodeAttached=!0)}attachToDom(w){this._domNode=w,w&&(this.contextKeyService.attachToDomNode(w),this.layoutEditors())}layoutEditors(){o.fastdom.measure(()=>{if(this._domNode){const w=this._domNode.offsetWidth,I=this._domNode.offsetHeight;(w!==this._prevDomWidth||I!==this._prevDomHeight)&&this.doLayoutEditors(),this._prevDomWidth=w,this._prevDomHeight=I}})}_layoutEditorWorker(){if(this.currentOpenType)switch(this.currentOpenType.type){case E.EditorOpenType.code:this.codeEditor&&this.codeEditor.layout();break;case E.EditorOpenType.diff:this.diffEditor&&this.diffEditor.layout();break;case E.EditorOpenType.multiDiff:this.multiDiffEditor&&this._multiDiffEditorDomNodeAttached&&this.multiDiffEditor.layout(new g.Dimension(this._multiDiffEditorDomNode.offsetWidth,this._multiDiffEditorDomNode.offsetHeight));break;default:break}}doLayoutEditors(){this._measure&&this._measure.dispose(),this._measure=o.fastdom.mutate(()=>{this._layoutEditorWorker()})}setContextKeys(){var w;if(!this._resourceContext){const I=R=>{let M=null;const O=this.documentModelManager.getModelDescription(R,"resourceContextKey");return O&&(M=O.languageId),M};this._resourceContext=new l.ResourceContextKey(this.contextKeyService,R=>I(R)),this._diffResourceContextKey=new l.ResourceContextKey(this.contextKeyService,R=>I(R),"diffResource"),this._editorLangIDContextKey=this.contextKeyService.createKey("editorLangId",""),this._isInDiffEditorContextKey=this.contextKeyService.createKey("isInDiffEditor",!1),this._isInMultiDiffEditorContextKey=this.contextKeyService.createKey("isInMultiDiffEditor",!1),this._activeEditorIsDirtyContextKey=this.contextKeyService.createKey("activeEditorIsDirty",!1),this._isInDiffRightEditorContextKey=this.contextKeyService.createKey("isInDiffRightEditor",!1),this._isInEditorComponentContextKey=this.contextKeyService.createKey("inEditorComponent",!1)}this.currentOrPreviousFocusedEditor&&this.currentOrPreviousFocusedEditor.currentUri?(this._resourceContext.set(this.currentOrPreviousFocusedEditor.currentUri),this.currentOrPreviousFocusedEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentOrPreviousFocusedEditor.currentDocumentModel.languageId)):this.currentEditor&&this.currentEditor.currentUri?(this._resourceContext.set(this.currentEditor.currentUri),this.currentEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentEditor.currentDocumentModel.languageId)):(this.currentResource?this._resourceContext.set(this.currentResource.uri):this._resourceContext.reset(),this._editorLangIDContextKey.reset()),this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty()),this._isInDiffEditorContextKey.set(this.isDiffEditorMode()),this._isInMultiDiffEditorContextKey.set(this.isMultiDiffEditorMode()),this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode()),this._isInEditorComponentContextKey.set(this.isComponentMode()),this.isDiffEditorMode()&&this._diffResourceContextKey.set((w=this.currentResource)===null||w===void 0?void 0:w.uri),this.updateContextKeyWhenDiffEditorChangesFocus()}updateContextKeyWhenDiffEditorChangesFocus(){if(this.updateContextKeyWhenEditorChangesFocusDisposer||!this.diffEditor)return;const w=()=>{this.currentFocusedEditor||(this.setContextKeys(),this._onDidEditorFocusChange.fire())};this.updateContextKeyWhenEditorChangesFocusDisposer=new v.Disposable(this.diffEditor.modifiedEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.modifiedEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.diffEditor.originalEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.originalEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onFocus(()=>{this.codeEditor.currentUri&&this.locateInFileTree(this.codeEditor.currentUri),this._currentOrPreviousFocusedEditor=this.codeEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onBlur(w),this.diffEditor.originalEditor.onBlur(w),this.diffEditor.modifiedEditor.onBlur(w)),this.addDispose(this.updateContextKeyWhenEditorChangesFocusDisposer)}get contextKeyService(){return this._contextKeyService||(this._contextKeyService=this.workbenchEditorService.editorContextKeyService.createScoped()),this._contextKeyService}get index(){return this.workbenchEditorService.sortedEditorGroups.indexOf(this)}onResourceDecorationChangeEvent(w){w.payload.decoration.dirty&&this.previewURI&&this.previewURI.isEqual(w.payload.uri)&&this.pinPreviewed(),this.resources.find(R=>R.uri.isEqual(w.payload.uri))&&this.notifyTabChanged()}resetOpenType(){this._currentOpenType=null}async oResourceOpenTypeChangedEvent(w){const I=w.payload;if(this.cachedResourcesOpenTypes.has(I.toString())&&this.cachedResourcesOpenTypes.delete(I.toString()),this.currentResource&&this.currentResource.uri.isEqual(I)){this.resetOpenType();const R=new v.Deferred;this.resourceStatus.set(this.currentResource,R.promise);const M=setTimeout(()=>{this.notifyTabLoading(this.currentResource)},60);this.notifyBodyChanged();try{await this.displayResourceComponent(this.currentResource,{})}finally{clearTimeout(M),R.resolve()}}}async onRegisterEditorComponentEvent(){if(this.currentResource){const w=this.currentResource,I=await this.editorComponentRegistry.resolveEditorComponent(w);this.currentResource===w&&(this.availableOpenTypes=I,this.cachedResourcesOpenTypes.set(w.uri.toString(),I))}}pinPreviewed(w){const I=this.previewURI;w===void 0?this.previewURI=null:this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),I!==this.previewURI&&this.notifyTabChanged()}notifyTabChanged(){this._restoringState||this._onDidEditorGroupTabChanged.fire()}notifyBodyChanged(){this._onDidEditorGroupBodyChanged.fire()}notifyTabLoading(w){this._onDidEditorGroupContentLoading.fire(w)}get currentEditor(){return this.currentOpenType?this.currentOpenType.type===E.EditorOpenType.code?this.codeEditor:this.currentOpenType.type===E.EditorOpenType.diff?this.diffEditor.modifiedEditor:null:null}get currentOrPreviousFocusedEditor(){return this._currentOrPreviousFocusedEditor||this.currentEditor}get currentFocusedEditor(){if(this.currentOpenType){if(this.currentOpenType.type===E.EditorOpenType.code){if(this.codeEditor.monacoEditor.hasWidgetFocus())return this.codeEditor}else if(this.currentOpenType.type===E.EditorOpenType.diff){if(this.diffEditor.modifiedEditor.monacoEditor.hasTextFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasTextFocus())return this.diffEditor.originalEditor;if(this.diffEditor.modifiedEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.originalEditor}}return null}get currentCodeEditor(){return this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code?this.codeEditor:null}createEditor(w){this.codeEditor=this.collectionService.createCodeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.addDispose(this.codeEditor.onRefOpen(()=>{this.doLayoutEditors()})),this.toDispose.push(this.codeEditor.onCursorPositionChanged(I=>{this._onCurrentEditorCursorChange.fire(I)})),this.toDispose.push(this.codeEditor.onSelectionsChanged(I=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:I.selections,source:I.source,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onVisibleRangesChanged(I=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:I,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:this.codeEditor.currentUri}))})),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.code,editorId:this.codeEditor.getId()})),this.toDispose.push(this.codeEditor.monacoEditor.onDidChangeModelContent(()=>{this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty())})),this.codeEditorReady.ready()}createMergeEditor(w){this.mergeEditor=this.collectionService.createMergeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),this.mergeEditorReady.ready()}createDiffEditor(w){this.diffEditor=this.collectionService.createDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.diffEditor.onRefOpen(()=>{this.doLayoutEditors()}),this.addDiffEditorEventListeners(this.diffEditor.originalEditor,"original"),this.addDiffEditorEventListeners(this.diffEditor.modifiedEditor,"modified"),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.diff,editorId:this.diffEditor.modifiedEditor.getId()})),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.diff,editorId:this.diffEditor.originalEditor.getId()})),this.diffEditorReady.ready()}addDiffEditorEventListeners(w,I){this.toDispose.push(w.onSelectionsChanged(R=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:R.selections,source:R.source,editorUri:v.URI.from(w.monacoEditor.getModel().uri),side:I}))})),this.toDispose.push(w.onVisibleRangesChanged(R=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:R,editorUri:w.currentUri}))})),this.toDispose.push(w.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:w.currentUri}))}))}async split(w,I,R){var M,O,x;const k=this.workbenchEditorService.createEditorGroup(),F=w===a.EditorGroupSplitAction.Left||w===a.EditorGroupSplitAction.Right?u.SplitDirection.Horizontal:u.SplitDirection.Vertical,L=w===a.EditorGroupSplitAction.Left||w===a.EditorGroupSplitAction.Top;if(this.grid.split(F,k,L),R&&!R.scrollTop&&(R.scrollTop=(M=this.currentEditor)===null||M===void 0?void 0:M.monacoEditor.getScrollTop()),R&&!R.scrollLeft&&(R.scrollLeft=(O=this.currentEditor)===null||O===void 0?void 0:O.monacoEditor.getScrollLeft()),R&&!R?.range){const N=(x=this.currentCodeEditor)===null||x===void 0?void 0:x.monacoEditor.getSelection();N&&(R.range=new m.Range(N.startLineNumber,N.startColumn,N.endLineNumber,N.endColumn))}return k.open(I,{...R,preview:!1,revealRangeInCenter:!1})}async open(w,I={}){if(w.scheme===v.Schemes.file&&this.recentFilesManager.setMostRecentlyOpenedFile(w.withoutFragment().toString()),I&&I.split)return this.split(I.split,w,Object.assign({},I,{split:void 0,preview:!1}));if(!this.openingPromise.has(w.toString())){const M=this.doOpen(w,I);this.openingPromise.set(w.toString(),M),M.then(()=>{this.openingPromise.delete(w.toString())},()=>{this.openingPromise.delete(w.toString())})}return this.preferenceService.get("editor.previewMode")&&((0,v.isUndefinedOrNull)(I.preview)?!0:I.preview)||this.openingPromise.get(w.toString()).then(()=>{this.pinPreviewed(w)}),this.openingPromise.get(w.toString())}async pin(w){return this.pinPreviewed(w)}getPreventScrollOption(w={}){var I;return(I=w.preventScroll)!==null&&I!==void 0?I:this.preferenceService.get("editor.preventScrollAfterFocused")}async doOpen(w,I={}){var R,M,O;if(!this.resourceService.handlesUri(w))return this.openerService.open(w),!1;let x;try{const k=this.preferenceService.get("editor.previewMode")&&((0,v.isUndefinedOrNull)(I.preview)?!0:I.preview);if(this.currentResource&&this.currentResource.uri.isEqual(w)&&(!I.forceOpenType||I.forceOpenType.type===((R=this.currentOpenType)===null||R===void 0?void 0:R.type))){if(I.focus&&this.currentEditor){const F=this.getPreventScrollOption(I);(M=this._domNode)===null||M===void 0||M.focus({preventScroll:F}),this.currentEditor.monacoEditor.focus()}return I.range&&this.currentEditor&&(this.currentEditor.monacoEditor.setSelection(I.range),setTimeout(()=>{var F;(F=this.currentEditor)===null||F===void 0||F.monacoEditor.revealRangeInCenter(I.range,0)},0)),this.locationInTree(I,w),this.notifyTabChanged(),{group:this,resource:this.currentResource}}else{const F=this._currentOpenType,L=this._currentResource;let N=null,U=this.resources.find(Q=>Q.uri.toString()===w.toString());if(!U){if(U=await this.resourceService.getResource(w),!U)throw new Error("This uri cannot be opened!: "+w);if(U.deleted){if(I.deletedPolicy==="fail")throw new Error("resource deleted "+w);if(I.deletedPolicy==="skip")return!1}I&&I.label&&(U.name=I.label),I&&(0,v.isDefined)(I.supportsRevive)&&(U.supportsRevive=I.supportsRevive);let Q=null;if(I&&I.index!==void 0&&I.index<this.resources.length)Q=this.resources[I.index],this.resources.splice(I.index,0,U),N={type:"open",resource:U,index:I.index};else if(this.currentResource){const G=this.resources.indexOf(this.currentResource);this.resources.splice(G+1,0,U),N={type:"open",resource:U,index:G+1},Q=this.currentResource}else this.resources.push(U),N={type:"open",resource:U,index:this.resources.length-1};k&&(this.previewURI&&await this.close(this.previewURI,{treatAsNotCurrent:!0,force:I.forceClose}),this.previewURI=U.uri),I.replace&&Q&&await this.close(Q.uri,{treatAsNotCurrent:!0,force:I.forceClose})}if(I.backend)return this.notifyTabChanged(),!1;if(L&&this.resourceOpenHistory[this.resourceOpenHistory.length-1]!==L.uri){this.resourceOpenHistory.push(L.uri);const Q=(O=this.currentCodeEditor)===null||O===void 0?void 0:O.getSelections();Q&&Q.length>0&&this.recentFilesManager.updateMostRecentlyOpenedFile(L.uri.toString(),{lineNumber:Q[0].selectionStartLineNumber,column:Q[0].selectionStartColumn})}this._currentOpenType=null,this._currentResource=U;const W=this.reporterService.time(v.REPORT_NAME.EDITOR_REACTIVE);x=new v.Deferred,this.resourceStatus.set(U,x.promise);const j=setTimeout(()=>{this.notifyTabLoading(U)},60);this.notifyTabChanged(),this.notifyBodyChanged();try{await this.displayResourceComponent(U,I)}finally{N&&this._onDidEditorGroupTabOperation.fire(N)}return this._currentOrPreviousFocusedEditor=this.currentEditor,clearTimeout(j),x.resolve(),W.timeEnd(U.uri.toString()),this._onDidEditorFocusChange.fire(),this.setContextKeys(),this.eventBus.fire(new E.EditorGroupOpenEvent({group:this,resource:U})),this.locationInTree(I,w),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:F,oldResource:L})),{group:this,resource:U}}}catch(k){return(0,v.getDebugLogger)().error(k),x&&x.reject(),(0,d.isEditorError)(k,d.EditorTabChangedError)||this.messageService.error((0,v.formatLocalize)("editor.failToOpen",w.displayName,k.message),[],!0),!1}}locationInTree(w,I){w?.backend||(w?.disableNavigate||this.locateInFileTree(I),w.disableNavigateOnOpendEditor||this.locateInOpenedEditor(I))}locateInFileTree(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.FILE_COMMANDS.LOCATION.id,w)}locateInOpenedEditor(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.OPEN_EDITORS_COMMANDS.LOCATION.id,w)}async openUris(w){for(const I of w)await this.open(I)}async getDocumentModelRef(w){const I=w.toString();return this.holdDocumentModelRefs.has(I)||this.holdDocumentModelRefs.set(I,await this.documentModelManager.createModelReference(w,"editor-group-"+this.name)),this.holdDocumentModelRefs.get(I)}disposeDocumentRef(w){if(w.scheme==="diff"){const I=w.getParsedQuery();this.doDisposeDocRef(new v.URI(I.original)),this.doDisposeDocRef(new v.URI(I.modified))}else w.scheme==="mergeEditor"?this.mergeEditor&&this.mergeEditor.dispose():this.doDisposeDocRef(w)}doDisposeDocRef(w){const I=w.toString();this.holdDocumentModelRefs.has(I)&&(this.holdDocumentModelRefs.get(I).dispose(),this.holdDocumentModelRefs.delete(I))}async openCodeEditor(w,I){this.resolveTabChanged(w,this.currentResource),await this.codeEditorReady.onceReady(async()=>{var R;const M=await this.getDocumentModelRef(w.uri);if(await this.codeEditor.open(M),I.range){const O=new m.Range(I.range.startLineNumber,I.range.startColumn,I.range.endLineNumber,I.range.endColumn);this.codeEditor.monacoEditor.setSelection(O),I.revealRangeInCenter&&setTimeout(()=>{this.codeEditor.monacoEditor.revealRangeInCenter(O,1)})}if(queueMicrotask(()=>{I.scrollTop&&this.codeEditor.monacoEditor.setScrollTop(I.scrollTop),I.scrollLeft&&this.codeEditor.monacoEditor.setScrollLeft(I.scrollLeft)}),I.focus){const O=this.getPreventScrollOption(I);(R=this._domNode)===null||R===void 0||R.focus({preventScroll:O});const x=this.eventBus.on(E.CodeEditorDidVisibleEvent,k=>{var F;if(k.payload.groupName===this.name&&k.payload.type===E.EditorOpenType.code){if(x.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.codeEditor&&(!((F=this.codeEditor.currentUri)===null||F===void 0)&&F.isEqual(w.uri)))try{this.codeEditor.focus()}catch{}}})}M.instance.dirty&&this.pinPreviewed(w.uri)})}async openDiffEditor(w,I){this.diffEditor||await this.diffEditorDomReady.onceReady(()=>{var x;const k=document.createElement("div");(x=this._diffEditorDomNode)===null||x===void 0||x.appendChild(k),this.createDiffEditor(k)});const R=w,[M,O]=await Promise.all([this.getDocumentModelRef(R.metadata.original),this.getDocumentModelRef(R.metadata.modified)]);await this.diffEditorReady.onceReady(async()=>{var x;if(!(!M||!O)&&(await this.diffEditor.compare(M,O,I,w.uri),I.focus)){const k=this.getPreventScrollOption(I);(x=this._domNode)===null||x===void 0||x.focus({preventScroll:k});const F=this.eventBus.on(E.CodeEditorDidVisibleEvent,L=>{if(L.payload.groupName===this.name&&L.payload.type===E.EditorOpenType.diff){if(F.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.diffEditor.modifiedEditor)try{this.diffEditor.focus()}catch{}}})}})}async openMergeEditor(w){const{metadata:I}=w;if(!I)return;this.mergeEditor||await this.mergeEditorDomReady.onceReady(()=>{var j;const Q=document.createElement("div");(j=this._mergeEditorDomNode)===null||j===void 0||j.appendChild(Q),this.createMergeEditor(Q)});const{ancestor:R,input1:M,input2:O,output:x}=I,k=_.MergeEditorInputData.from(M),F=_.MergeEditorInputData.from(O),[L,N,U,W]=await Promise.all([this.getDocumentModelRef(v.URI.parse(R)),this.getDocumentModelRef(k.uri),this.getDocumentModelRef(v.URI.parse(x)),this.getDocumentModelRef(F.uri)]);await this.mergeEditorReady.onceReady(async()=>{await this.mergeEditor.open({ancestor:{uri:v.URI.parse(I.ancestor),textModel:L.instance.getMonacoModel(),baseContent:L.instance.baseContent||""},input1:k.setTextModel(N.instance.getMonacoModel()),input2:F.setTextModel(W.instance.getMonacoModel()),output:{uri:v.URI.parse(I.output),textModel:U.instance.getMonacoModel()}})})}async openCustomEditor(w,I){const R=this.editorComponentRegistry.getEditorComponent(I),M=this.editorComponentRegistry.getEditorInitialProps(I);if(R){if(this.activateComponentsProps.set(R,M),R.renderMode===E.EditorComponentRenderMode.ONE_PER_RESOURCE){const O=this.activeComponents.get(R)||[];O.findIndex(k=>k.uri.toString()===w.uri.toString())===-1&&O.push(w),this.activeComponents.set(R,O)}else if(R.renderMode===E.EditorComponentRenderMode.ONE_PER_GROUP)this.activeComponents.set(R,[w]);else if(R.renderMode===E.EditorComponentRenderMode.ONE_PER_WORKBENCH){const O=[];this.workbenchEditorService.editorGroups.forEach(x=>{if(x===this)return;const k=x.resources.find(F=>F.uri.isEqual(w.uri));k&&O.push(x.close(k.uri))}),await Promise.all(O).catch((0,v.getDebugLogger)().error),this.activeComponents.set(R,[w])}}else throw new Error("Cannot find Editor Component with id: "+I);this._onCurrentEditorCursorChange.fire({position:null,selectionLength:0})}async displayResourceComponent(w,I){I.revealRangeInCenter===void 0&&(I.revealRangeInCenter=!0);const R=w,M=await this.resolveOpenType(w,I);if(M){const{activeOpenType:O,openTypes:x}=M;switch(this.availableOpenTypes=x,I.preserveFocus&&(I.focus=!1),O.type){case E.EditorOpenType.code:await this.openCodeEditor(w,I);break;case E.EditorOpenType.diff:await this.openDiffEditor(w,I);break;case E.EditorOpenType.multiDiff:await this.openMultiDiffEditor(w,I);break;case E.EditorOpenType.mergeEditor:await this.openMergeEditor(w);break;case E.EditorOpenType.component:await this.openCustomEditor(w,O.componentId);break;default:return}this.resolveTabChanged(R,this.currentResource),this._currentOpenType=O,this.notifyBodyChanged(),this.doLayoutEditors(),this.cachedResourcesActiveOpenTypes.set(w.uri.toString(),O)}}resolveTabChanged(w,I){if(w!==I)throw new d.EditorTabChangedError}getLastOpenType(w){return this.cachedResourcesActiveOpenTypes.get(w.uri.toString())}async resolveOpenType(w,I){const R=this.cachedResourcesOpenTypes.get(w.uri.toString())||await this.editorComponentRegistry.resolveEditorComponent(w),M=this.preferenceService.get("workbench.editorAssociations"),O=S(R,this.cachedResourcesActiveOpenTypes.get(w.uri.toString()),w,M,I.forceOpenType);return this.cachedResourcesOpenTypes.set(w.uri.toString(),R),{activeOpenType:O,openTypes:R}}async close(w,{treatAsNotCurrent:I,force:R}={}){const M=this.resources.findIndex(O=>O.uri.toString()===w.toString());if(M!==-1){const O=this.resources[M];if(!R&&!await this.shouldClose(O))return!1;if(this.resources.splice(M,1),this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:M}),this.eventBus.fire(new E.EditorGroupCloseEvent({group:this,resource:O})),this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),O===this.currentResource&&!I){let x;for(;this.resourceOpenHistory.length>0;)if(this.resources.findIndex(k=>k.uri===this.resourceOpenHistory[this.resourceOpenHistory.length-1])!==-1){x=this.resourceOpenHistory.pop();break}else this.resourceOpenHistory.pop();if(x)this.open(x);else{let k=M;for(;k>0&&!this.resources[k];)k--;this.resources[k]?this.open(this.resources[k].uri):this.backToEmpty()}}else this.notifyTabChanged();this.removeResouceFromActiveComponents(O),this.disposeDocumentRef(w)}return this.resources.length===0&&(this.grid.parent&&this.dispose(),this.availableOpenTypes=[]),!0}removeResouceFromActiveComponents(w){this.activeComponents.forEach((I,R)=>{const M=I.indexOf(w);M!==-1&&(I.splice(M,1),this.eventBus.fire(new E.ResoucesOfActiveComponentChangedEvent({component:R,resources:I})))})}async shouldClose(w){const I=this.workbenchEditorService.editorGroups.map(R=>R.resources);if(await this.resourceService.shouldCloseResource(w,I)){let R=0;for(const M of I)for(const O of M)if(O.uri.isEqual(w.uri)&&(R++,R>=2))break;return R<=1&&this.resourceService.disposeResource(w),!0}else return!1}backToEmpty(){const w=this._currentOpenType,I=this._currentResource;this._currentResource=null,this.resetOpenType(),this.notifyTabChanged(),this.notifyBodyChanged(),this._currentOrPreviousFocusedEditor=null,this._onDidEditorFocusChange.fire(),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:w,oldResource:I}))}async closeAll(){for(const I of this.resources)if(!await this.shouldClose(I))return!1;return this.resources.splice(0,this.resources.length).reverse().forEach((I,R)=>{this.clearResourceOnClose(I),this._onDidEditorGroupTabOperation.fire({type:"close",resource:I,index:R})}),this.activeComponents.clear(),this.workbenchEditorService.editorGroups.length>1&&this.dispose(),this.previewURI=null,this.backToEmpty(),!0}async closeSaved(){const w=this.resources.filter(I=>{const R=this.resourceService.getResourceDecoration(I.uri);if(!R||!R.dirty)return!0});for(const I of w)if(!await this.shouldClose(I))return;for(const I of w)await this.close(I.uri)}async closeToRight(w){const I=this.resources.findIndex(R=>R.uri.toString()===w.toString());if(I!==-1){const R=this.resources.slice(I+1);for(const M of R)if(!await this.shouldClose(M))return;this.resources.splice(I+1),R.reverse().forEach((M,O)=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:M,index:I+1+(R.length-1-O)})});for(const M of R)this.clearResourceOnClose(M);this.open(w)}}clearResourceOnClose(w){this.eventBus.fire(new E.EditorGroupCloseEvent({group:this,resource:w})),this.removeResouceFromActiveComponents(w)}async closeOthers(w){const I=this.resources.findIndex(R=>R.uri.toString()===w.toString());if(I!==-1){const R=this.resources.filter((O,x)=>x!==I);for(const O of R)if(!await this.shouldClose(O))return;const M=this.resources;this.resources=[this.resources[I]],R.reverse().forEach(O=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:M.indexOf(O)})});for(const O of R)this.clearResourceOnClose(O);await this.open(w)}}get currentResource(){return this._currentResource}get currentOpenType(){return this._currentOpenType}async changeOpenType(w){const I=this.availableOpenTypes.find(M=>M.type===w||M.componentId===w);if(!I||!this.currentResource||D(I,this.currentOpenType))return;const R=this.currentOpenType;await this.displayResourceComponent(this.currentResource,{forceOpenType:I}),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:R,oldResource:this.currentResource}))}async dropUri(w,I,R,M){if(I!==E.DragOverPosition.CENTER)await this.split((0,a.getSplitActionFromDragDrop)(I),w,{preview:!1,focus:!0});else if(!M)await this.open(w,{preview:!1,focus:!0});else{const O=this.resources.indexOf(M);if(O===-1)await this.open(w,{preview:!1,focus:!0});else{const x=this.resources.findIndex(k=>k.uri.toString()===w.toString());if(x===-1)await this.open(w,{index:O,preview:!1});else{const k=this.resources[x];x>O?(this.resources.splice(x,1),this.resources.splice(O,0,k),this._onDidEditorGroupTabOperation.fire({type:"move",resource:k,oldIndex:x,index:O}),await this.open(w,{preview:!1})):x<O&&(this.resources.splice(O+1,0,k),this.resources.splice(x,1),this._onDidEditorGroupTabOperation.fire({type:"move",resource:k,oldIndex:x,index:O}),await this.open(w,{preview:!1}))}}}R&&(R!==this?await R.close(w):I!==E.DragOverPosition.CENTER&&await this.close(w))}gainFocus(){this.workbenchEditorService.setCurrentGroup(this)}focus(){this.gainFocus(),this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.codeEditor.focus(),this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.diffEditor.focus()}dispose(){var w;(w=this.grid)===null||w===void 0||w.dispose(),this.workbenchEditorService.removeGroup(this),super.dispose(),this.codeEditor&&this.codeEditor.dispose(),this.diffEditor&&this.diffEditor.dispose(),this.multiDiffEditor&&this.multiDiffEditor.dispose(),this.toDispose.forEach(I=>I.dispose()),this.eventBus.fire(new E.EditorGroupDisposeEvent({group:this}))}getState(){const w=this.resources.filter(y).map(I=>I.uri.toString());return{uris:w,current:this.currentResource&&y(this.currentResource)?this.currentResource.uri.toString():void 0,previewIndex:this.previewURI?w.indexOf(this.previewURI.toString()):-1}}isCodeEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code}isDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff}isMultiDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.multiDiff}activeEditorIsDirty(){return this.hasDirty()&&this.workbenchEditorService.currentEditorGroup===this}isComponentMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.component}async restoreState(w){this._restoringState=!0,this.previewURI=w.uris[w.previewIndex]?new v.URI(w.uris[w.previewIndex]):null;for(const R of w.uris)await this.doOpen(new v.URI(R),{disableNavigate:!0,backend:!0,preview:!1,deletedPolicy:"skip"});let I;w.current?I=new v.URI(w.current):w.uris.length>0&&(I=new v.URI(w.uris[w.uris.length-1])),I&&(await this.open(I,{deletedPolicy:"skip"})||this.resources[0]&&await this.open(this.resources[0].uri)),this._restoringState=!1,this.notifyTabChanged()}async saveAll(w,I){for(const R of this.resources)!w&&R.uri.scheme===v.Schemes.untitled||await this.saveResource(R,I)}async saveResource(w,I=a.SaveReason.Manual){if(await this.saveByOpenType(w,I))return;const R=this.documentModelManager.getModelReference(w.uri);R&&(await R.instance.save(void 0,I),R.dispose())}async saveByOpenType(w,I){const R=this.cachedResourcesActiveOpenTypes.get(w.uri.toString());if(R&&R.saveResource)try{return await R.saveResource(w,I),!0}catch(M){this.logger.error(M)}return!1}async saveCurrent(w=a.SaveReason.Manual){const I=this.currentResource;if(I&&!await this.saveByOpenType(I,w)&&this.currentEditor)return this.currentEditor.save()}hasDirty(){for(const w of this.resources){const I=this.documentModelManager.getModelDescription(w.uri);if(I&&I.dirty)return!0}return!1}calcDirtyCount(w=new Set){let I=0;for(const R of this.resources){const M=this.documentModelManager.getModelDescription(R.uri,"calc-dirty-count");w.has(R.uri.toString())||(w.add(R.uri.toString()),M&&M.dirty&&(I+=1))}return I}componentUndo(){const w=this.currentOpenType;w?.undo&&w.undo(this.currentResource)}componentRedo(){const w=this.currentOpenType;w?.redo&&w.redo(this.currentResource)}toJSON(){return{name:this.name}}attachMultiDiffEditorDom(w){this._multiDiffEditorDomNodeAttached||(this._multiDiffEditorDomNode=w,this.multiDiffEditorDomReady.ready(),this._multiDiffEditorDomNodeAttached=!0)}createMultiDiffEditor(w){const I=this.collectionService.createMultiDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService});this.multiDiffEditor=I}async openMultiDiffEditor(w,I){this.multiDiffEditor||await this.multiDiffEditorDomReady.onceReady(()=>{var R;const M=document.createElement("div");(R=this._multiDiffEditorDomNode)===null||R===void 0||R.appendChild(M),this.createMultiDiffEditor(M)}),await this.multiDiffEditor.compareMultiple(this.multiDiffEditor,w,I)}};t.EditorGroup=A,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.EditorCollectionService)],A.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.ResourceService)],A.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.EditorComponentRegistry)],A.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(a.WorkbenchEditorService),n.__metadata("design:type",b)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(h.IEditorDocumentModelService),n.__metadata("design:type",Object)],A.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(v.CommandService),n.__metadata("design:type",Object)],A.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.RecentFilesManager),n.__metadata("design:type",o.RecentFilesManager)],A.prototype,"recentFilesManager",void 0),n.__decorate([(0,r.Autowired)(s.IMessageService),n.__metadata("design:type",Object)],A.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],A.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(v.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,v.OnEvent)(a.ResourceDecorationChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.ResourceDecorationChangeEvent]),n.__metadata("design:returntype",void 0)],A.prototype,"onResourceDecorationChangeEvent",null),n.__decorate([(0,v.OnEvent)(E.ResourceOpenTypeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.ResourceOpenTypeChangedEvent]),n.__metadata("design:returntype",Promise)],A.prototype,"oResourceOpenTypeChangedEvent",null),n.__decorate([(0,v.OnEvent)(E.RegisterEditorComponentEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",Promise)],A.prototype,"onRegisterEditorComponentEvent",null),t.EditorGroup=A=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Number])],A);function S(T,w,I,R,M){if(M)return T.find(O=>D(O,M))||T[0];if(w)return T.find(O=>D(O,w))||T[0];if(R){const O=T.find(x=>{const k=Object.keys(R).find(N=>(0,v.match)(N,I.uri.path.toString().toLowerCase())||(0,v.match)(N,I.uri.path.base.toLowerCase())),F=k&&R[k];if(!F)return!1;const L=`${v.CUSTOM_EDITOR_SCHEME}-${F}`;return x.componentId===L});if(O)return O}return T[0]}function D(T,w){return T.type===w.type&&(T.type!==E.EditorOpenType.component||T.componentId===w.componentId)}},94180:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarLeftExtraContentId=t.TabbarRightExtraContentId=void 0,t.TabbarRightExtraContentId="tabbar-right-extra-content",t.TabbarLeftExtraContentId="tabbar-left-extra-content"},93107:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDocPersistentCacheProvider=void 0,t.isDocContentCache=e,t.isDocChangesCache=n,t.parseCacheValueFrom=r,t.IDocPersistentCacheProvider=Symbol("IDocPersistentCacheProvider");function e(o){return o.hasOwnProperty("content")}function n(o){return o.hasOwnProperty("changeMatrix")}function r(o){const l=o.text,_=o.range.startLineNumber,v=o.range.startColumn,p=o.range.endLineNumber,m=o.range.endColumn;return[l,_,v,p,m]}},55113:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AUTO_SAVE_MODE=t.SaveReason=t.Direction=t.EditorGroupSplitAction=t.DragOverPosition=t.EditorOpenType=t.IEditorPriority=t.OverviewRulerLane=t.WorkbenchEditorService=t.DidApplyEditorDecorationFromProvider=t.DidChangeEditorGroupUriEvent=t.CollectionEditorsUpdateEvent=t.EditorCollectionService=t.EditorType=t.ShowLightbulbIconMode=void 0,t.getSimpleEditorOptions=b,t.isTextEditorViewState=A;const n=e(85608),r=e(76003),o=e(43718);var l=e(20868);Object.defineProperty(t,"ShowLightbulbIconMode",{enumerable:!0,get:function(){return l.ShowLightbulbIconMode}});var _;(function(S){S[S.CODE=0]="CODE",S[S.ORIGINAL_DIFF=1]="ORIGINAL_DIFF",S[S.MODIFIED_DIFF=2]="MODIFIED_DIFF",S.MERGE_EDITOR_DIFF="MERGE_EDITOR_DIFF"})(_||(t.EditorType=_={}));let v=class{};t.EditorCollectionService=v,t.EditorCollectionService=v=n.__decorate([(0,r.Injectable)()],v);class p extends o.BasicEvent{}t.CollectionEditorsUpdateEvent=p;class m extends o.BasicEvent{}t.DidChangeEditorGroupUriEvent=m;class s extends o.BasicEvent{}t.DidApplyEditorDecorationFromProvider=s;class g{}t.WorkbenchEditorService=g;var a;(function(S){S[S.Left=1]="Left",S[S.Center=2]="Center",S[S.Right=4]="Right",S[S.Full=7]="Full"})(a||(t.OverviewRulerLane=a={}));var h;(function(S){S.builtin="builtin",S.option="option",S.exclusive="exclusive",S.default="default"})(h||(t.IEditorPriority=h={}));var d;(function(S){S.code="code",S.diff="diff",S.mergeEditor="mergeEditor",S.component="component",S.multiDiff="multiDiff"})(d||(t.EditorOpenType=d={}));var u;(function(S){S.LEFT="left",S.RIGHT="right",S.TOP="top",S.BOTTOM="bottom",S.CENTER="center"})(u||(t.DragOverPosition=u={}));var E;(function(S){S[S.Top=1]="Top",S[S.Bottom=2]="Bottom",S[S.Left=3]="Left",S[S.Right=4]="Right"})(E||(t.EditorGroupSplitAction=E={}));var f;(function(S){S.UP="up",S.DOWN="down",S.LEFT="left",S.RIGHT="right"})(f||(t.Direction=f={}));var c;(function(S){S[S.Manual=1]="Manual",S[S.AfterDelay=2]="AfterDelay",S[S.FocusOut=3]="FocusOut"})(c||(t.SaveReason=c={}));var y;(function(S){S.OFF="off",S.AFTER_DELAY="afterDelay",S.EDITOR_FOCUS_CHANGE="editorFocusChange",S.WINDOWS_LOST_FOCUS="windowLostFocus"})(y||(t.AUTO_SAVE_MODE=y={}));function b(){return{fontSize:12,fontWeight:"normal",lineHeight:0,wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden"},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},guides:{highlightActiveIndentation:!1,indentation:!1,bracketPairs:!1}}}function A(S){const D=S;if(!D)return!1;const T=D;if(T.modified)return A(T.modified);const w=D;return!!(w.contributionsState&&w.viewState&&Array.isArray(w.cursorState))}},23418:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(94180),t),n.__exportStar(e(93107),t),n.__exportStar(e(55113),t),n.__exportStar(e(23950),t),n.__exportStar(e(27693),t),n.__exportStar(e(46225),t),n.__exportStar(e(4308),t),n.__exportStar(e(39467),t)},27693:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILanguageStatusService=void 0,t.ILanguageStatusService=Symbol("ILanguageStatusService")},23950:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticTag=t.DiagnosticSeverity=t.ILanguageService=void 0,t.asSeverity=l,t.asRelatedInformations=_,t.asRelatedInformation=v,t.asMonacoDiagnostics=p,t.asMonacoDiagnostic=m;const n=e(43718);t.ILanguageService=Symbol("ILanguageService");var r;(function(s){s[s.Error=1]="Error",s[s.Warning=2]="Warning",s[s.Information=3]="Information",s[s.Hint=4]="Hint"})(r||(t.DiagnosticSeverity=r={}));var o;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(o||(t.DiagnosticTag=o={}));function l(s){return s===1?n.MarkerSeverity.Error:s===2?n.MarkerSeverity.Warning:s===3?n.MarkerSeverity.Info:n.MarkerSeverity.Hint}function _(s){if(s)return s.map(g=>v(g))}function v(s){return{resource:n.Uri.parse(s.location.uri),startLineNumber:s.location.range.start.line+1,startColumn:s.location.range.start.character+1,endLineNumber:s.location.range.end.line+1,endColumn:s.location.range.end.character+1,message:s.message}}function p(s){if(s)return s.map(g=>m(g))}function m(s){return{code:typeof s.code=="number"?s.code.toString():typeof s.code=="object"?{value:s.code.value.toString(),target:s.code.target}:s.code,severity:l(s.severity),message:s.message,source:s.source,startLineNumber:s.range.start.line+1,startColumn:s.range.start.character+1,endLineNumber:s.range.end.line+1,endColumn:s.range.end.character+1,relatedInformation:_(s.relatedInformation),tags:s.tags}}},64335:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffEditorItem=t.IMultiDiffSourceResolverService=t.MULTI_DIFF_SCHEME=void 0,t.MULTI_DIFF_SCHEME="multi-diff-editor",t.IMultiDiffSourceResolverService=Symbol("IMultiDiffSourceResolverService");class e{constructor(r,o,l,_){if(this.originalUri=r,this.modifiedUri=o,this.goToFileUri=l,this.contextKeys=_,!r&&!o)throw new Error("Invalid arguments")}getKey(){var r,o;return JSON.stringify([(r=this.modifiedUri)===null||r===void 0?void 0:r.toString(),(o=this.originalUri)===null||o===void 0?void 0:o.toString()])}}t.MultiDiffEditorItem=e},46225:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notebookCellScheme=t.INotebookService=t.CellKind=t.NotebookCellsChangeType=void 0;var e;(function(r){r[r.ModelChange=1]="ModelChange",r[r.Move=2]="Move",r[r.ChangeCellLanguage=5]="ChangeCellLanguage",r[r.Initialize=6]="Initialize",r[r.ChangeCellMetadata=7]="ChangeCellMetadata",r[r.Output=8]="Output",r[r.OutputItem=9]="OutputItem",r[r.ChangeCellContent=10]="ChangeCellContent",r[r.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",r[r.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",r[r.ChangeCellMime=13]="ChangeCellMime",r[r.Unknown=100]="Unknown"})(e||(t.NotebookCellsChangeType=e={}));var n;(function(r){r[r.Markup=1]="Markup",r[r.Code=2]="Code"})(n||(t.CellKind=n={})),t.INotebookService=Symbol("INotebookService"),t.notebookCellScheme="vscode-notebook-cell"},4308:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AskSaveResult=t.DIFF_SCHEME=t.ResourceDecorationNeedChangeEvent=t.ResourceDecorationChangeEvent=t.ResourceRemoveEvent=t.ResourceDidUpdateEvent=t.ResourceNeedUpdateEvent=t.ResourceService=void 0,t.isDiffResource=m;const n=e(43718);class r{}t.ResourceService=r;class o extends n.BasicEvent{}t.ResourceNeedUpdateEvent=o;class l extends n.BasicEvent{}t.ResourceDidUpdateEvent=l;class _ extends n.BasicEvent{}t.ResourceRemoveEvent=_;class v extends n.BasicEvent{}t.ResourceDecorationChangeEvent=v;class p extends n.BasicEvent{}t.ResourceDecorationNeedChangeEvent=p,t.DIFF_SCHEME="diff";function m(g){return g.uri.scheme===t.DIFF_SCHEME}var s;(function(g){g[g.REVERT=1]="REVERT",g[g.SAVE=2]="SAVE",g[g.CANCEL=3]="CANCEL"})(s||(t.AskSaveResult=s={}))},39467:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSplitActionFromDragDrop=r;const n=e(55113);function r(o){return{[n.DragOverPosition.LEFT]:n.EditorGroupSplitAction.Left,[n.DragOverPosition.RIGHT]:n.EditorGroupSplitAction.Right,[n.DragOverPosition.BOTTOM]:n.EditorGroupSplitAction.Bottom,[n.DragOverPosition.TOP]:n.EditorGroupSplitAction.Top}[o]}},54414:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(23418),t)},32595:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerContribution=t.EXPLORER_CONTAINER_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144);Object.defineProperty(t,"EXPLORER_CONTAINER_ID",{enumerable:!0,get:function(){return l.EXPLORER_CONTAINER_ID}});const _=e(21634),v=e(68456),p=e(43718);let m=class{registerComponent(g){g.register("@opensumi/ide-explorer",[],{iconClass:(0,o.getIcon)("explorer"),title:(0,o.localize)("explorer.title"),priority:10,containerId:l.EXPLORER_CONTAINER_ID,activateKeyBinding:"ctrlcmd+shift+e"})}onStart(){this.extensionsSchemaService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:l.EXPLORER_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{..._.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("explorer.title"))}})}};t.ExplorerContribution=m,n.__decorate([(0,r.Autowired)(p.IExtensionsSchemaService),n.__metadata("design:type",Object)],m.prototype,"extensionsSchemaService",void 0),t.ExplorerContribution=m=n.__decorate([(0,o.Domain)(o.ClientAppContribution,v.ComponentContribution)],m)},59027:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32595);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[l.ExplorerContribution]}};t.ExplorerModule=_,t.ExplorerModule=_=n.__decorate([(0,r.Injectable)()],_)},18531:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressFileServerContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32242),_=e(90242);let v=class{registerStaticResolver(m){m.registerStaticResourceProvider({scheme:o.Schemes.file,resolveStaticResource:s=>{const g=new o.URI(this.appConfig.staticServicePath||_.EXPRESS_SERVER_PATH),[a,h]=s.codeUri.path.split("?");return g.resolve(`assets${decodeURIComponent(a)}`).withQuery(h)},roots:[this.appConfig.staticServicePath||_.EXPRESS_SERVER_PATH]})}};t.ExpressFileServerContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"appConfig",void 0),t.ExpressFileServerContribution=v=n.__decorate([(0,o.Domain)(l.StaticResourceContribution)],v)},98885:(P,t,e)=>{"use strict";var n;n={value:!0},t.Q=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(18531);let v=class extends l.BrowserModule{constructor(){super(...arguments),this.providers=[_.ExpressFileServerContribution]}};t.Q=v,t.Q=v=r.__decorate([(0,o.Injectable)()],v)},90242:(P,t,e)=>{"use strict";var n=e(39907);Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_MIME=t.EXPRESS_SERVER_PATH=t.EXPRESS_SERVER_PORT=void 0,t.EXPRESS_SERVER_PORT=8e3,t.EXPRESS_SERVER_PATH=n.env.STATIC_SERVER_PATH||`http://127.0.0.1:${t.EXPRESS_SERVER_PORT}/`,t.ALLOW_MIME={gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"image/svg+xml",ttf:"font/ttf",eot:"font/eot",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",js:"application/javascript",css:"text/css",mp4:"video/mp4",ogg:"video/ogg",webm:"video/webm"}},21082:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_SCHEME=t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=void 0;const n=e(30144);t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=n.EXTENSION_CONTAINER_ID,t.EXTENSION_SCHEME="extension"},6449:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionOverview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(68974),_=e(95422),v=e(43718),p=e(93374),m=e(29150),s=n.__importDefault(e(40769));var g;(function(d){d.details="Details",d.changelog="ChangeLog",d.deps="Dependencies"})(g||(g={}));const a=[g.details,g.changelog,g.deps],h=({resource:d})=>{var u,E,f,c,y,b,A,S,D,T,w,I,R,M,O,x,k,F,L,N,U,W,j,Q,G;const Z=(0,_.useInjectable)(m.VSXExtensionServiceToken),[$,V]=(0,r.useState)(!0),[H,K]=(0,r.useState)(((u=d.metadata)===null||u===void 0?void 0:u.state)===m.InstallState.INSTALLED?4:0),[Y,X]=(0,r.useState)(g.details),[re,oe]=(0,r.useState)({}),he=(0,r.useCallback)(te=>{const fe=a[te];fe&&X(fe)},[]),me=(0,r.useCallback)(async()=>{var te;const fe=await Z.getRemoteRawExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);if(fe){const Oe=["readme","changelog"].map(Be=>{var De,_e;const Ne=(De=fe.files)===null||De===void 0?void 0:De[Be];return Ne?fetch(Ne).then(Te=>Te.text()):(_e=fe[Be])!==null&&_e!==void 0?_e:""}),[Me,Pe]=await Promise.all(Oe);oe({readme:Me,changelog:Pe,downloadCount:fe.downloadCount})}V(!1)},[d]),q=(0,r.useCallback)(async()=>{var te;const fe=await Z.getLocalExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);fe&&(K(1),Z.install(fe).finally(()=>{K(4)}))},[d]),ye=(0,r.useCallback)(async()=>{var te;const fe=await Z.getLocalExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);fe&&(K(2),Z.uninstall(fe).finally(()=>{K(3)}))},[d]);(0,r.useEffect)(()=>{me()},[d]);const ge=(0,r.useMemo)(()=>{var te,fe,Oe;const Me=[];if(((te=d.metadata)===null||te===void 0?void 0:te.state)!==m.InstallState.NOT_INSTALLED)if(H!==3)Me.push(r.default.createElement(o.Button,{size:"small",key:"uninstall",onClick:ye,disabled:H===2},(0,v.localize)(H===2?"marketplace.extension.uninstalling":"marketplace.extension.uninstall")));else return Me.push(r.default.createElement(o.Button,{size:"small",key:"uninstalled",disabled:!0},(0,v.localize)("marketplace.extension.uninstalled"))),Me;return((fe=d.metadata)===null||fe===void 0?void 0:fe.state)===m.InstallState.NOT_INSTALLED?H===4?Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"install",onClick:q,disabled:H!==0},(0,v.localize)(H===1?"marketplace.extension.installing":"marketplace.extension.install"))):((Oe=d.metadata)===null||Oe===void 0?void 0:Oe.state)===m.InstallState.SHOULD_UPDATE?H===4?Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"update",onClick:q,disabled:H!==0},(0,v.localize)(H===1?"marketplace.extension.updating":"marketplace.extension.update"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))),Me},[d,H]);return r.default.createElement("div",{className:s.default.extension_overview_container},r.default.createElement(l.Progress,{loading:$}),r.default.createElement("div",{className:s.default.extension_overview_header},!((E=d.metadata)===null||E===void 0)&&E.iconUrl?r.default.createElement("img",{src:(f=d.metadata)===null||f===void 0?void 0:f.iconUrl,alt:(0,v.replaceLocalizePlaceholder)((c=d.metadata)===null||c===void 0?void 0:c.displayName,(y=d.metadata)===null||y===void 0?void 0:y.extensionId)}):r.default.createElement("div",{className:s.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:s.default.extension_detail},r.default.createElement("div",{className:s.default.extension_name},r.default.createElement("h1",null,r.default.createElement("a",{href:`${(b=d.metadata)===null||b===void 0?void 0:b.openVSXRegistry}/extension/${(A=d.metadata)===null||A===void 0?void 0:A.namespace.toLowerCase()}/${(S=d.metadata)===null||S===void 0?void 0:S.name.toLowerCase()}`,target:"_blank",rel:"noopener noreferrer"},(0,v.replaceLocalizePlaceholder)((D=d.metadata)===null||D===void 0?void 0:D.displayName,(T=d.metadata)===null||T===void 0?void 0:T.extensionId)||((w=d.metadata)===null||w===void 0?void 0:w.name))),r.default.createElement("span",{className:s.default.extension_id},((I=d.metadata)===null||I===void 0?void 0:I.namespace.toLowerCase())+"."+((R=d.metadata)===null||R===void 0?void 0:R.name.toLowerCase()))),r.default.createElement("div",{className:s.default.manifest},r.default.createElement("span",null,r.default.createElement("a",{href:(M=d.metadata)===null||M===void 0?void 0:M.namespaceUrl,target:"_blank",rel:"noopener noreferrer"},(O=d.metadata)===null||O===void 0?void 0:O.namespace)),r.default.createElement("span",null,r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),((x=d.metadata)===null||x===void 0?void 0:x.downloadCount)||re.downloadCount),((k=d.metadata)===null||k===void 0?void 0:k.averageRating)&&r.default.createElement("span",null,(F=d.metadata)===null||F===void 0?void 0:F.averageRating),((L=d.metadata)===null||L===void 0?void 0:L.repository)&&r.default.createElement("span",null,r.default.createElement("a",{href:(N=d.metadata)===null||N===void 0?void 0:N.repository,target:"blank"},"Repository")),((U=d.metadata)===null||U===void 0?void 0:U.license)&&r.default.createElement("span",null,r.default.createElement("a",{href:(W=d.metadata)===null||W===void 0?void 0:W.files.license,target:"blank"},"License")),r.default.createElement("span",null,"v",(j=d.metadata)===null||j===void 0?void 0:j.version)),r.default.createElement("div",{className:s.default.description},(0,v.replaceLocalizePlaceholder)((Q=d.metadata)===null||Q===void 0?void 0:Q.description,(G=d.metadata)===null||G===void 0?void 0:G.extensionId)),r.default.createElement("div",{className:s.default.buttons},ge))),r.default.createElement("div",{className:s.default.extension_overview_body},r.default.createElement(o.Tabs,{className:s.default.tabs,value:Y,onChange:he,tabs:[g.details,g.changelog]}),r.default.createElement("div",{className:s.default.extension_content},Y===g.details&&re.readme&&r.default.createElement(p.Markdown,{content:re.readme}),Y===g.changelog&&re.changelog&&r.default.createElement(p.Markdown,{content:re.changelog}))))};t.ExtensionOverview=h},87791:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=t.ExtensionViewType=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(43718),v=e(29150),p=n.__importDefault(e(90425));var m;(function(s){s[s.MARKETPLACE=0]="MARKETPLACE",s[s.INSTALLED=1]="INSTALLED"})(m||(t.ExtensionViewType=m={})),t.Extension=r.default.memo(({extension:s,onInstall:g,onClick:a,type:h,installedExtensions:d,openVSXRegistry:u})=>{const E=(0,l.useDesignStyles)(p.default.extension_item,"extension_item"),[f,c]=(0,r.useState)(),y=d?.find(I=>I.namespace===s.namespace&&I.name===s.name),b=!!(h===m.INSTALLED||y),A=b&&h===m.MARKETPLACE&&y?.version!==s.version,[S,D]=(0,r.useState)(b),T=(0,r.useCallback)(I=>{I.stopPropagation(),c(!0),g(s).then(()=>{c(!1),D(!0)})},[s]),w=(0,r.useCallback)(()=>{a(s,S?A?v.InstallState.SHOULD_UPDATE:v.InstallState.INSTALLED:v.InstallState.NOT_INSTALLED)},[s]);return r.default.createElement("div",{className:E,onClick:w},s.iconUrl?r.default.createElement("img",{className:p.default.icon,src:s.iconUrl,alt:(0,_.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)}):r.default.createElement("div",{className:p.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:p.default.extension_detail},r.default.createElement("div",{className:p.default.base_info},r.default.createElement("span",{className:p.default.display_name},(0,_.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)||s.name),r.default.createElement("span",{className:p.default.version},s.version),!S&&r.default.createElement("span",{className:p.default.download_count},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),s.downloadCount)),r.default.createElement("span",{className:p.default.description},(0,_.replaceLocalizePlaceholder)(s.description,`${s.publisher}.${s.name}`)),r.default.createElement("div",{className:p.default.footer},r.default.createElement("span",{className:p.default.namespace},s.namespace),h===m.MARKETPLACE&&(b?A?r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:f},(0,_.localize)(f?"marketplace.extension.updating":"marketplace.extension.update")):r.default.createElement("span",{className:p.default.state_text},(0,_.localize)("marketplace.extension.installed")):r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:f},(0,_.localize)(f?"marketplace.extension.installing":"marketplace.extension.install"))),h===m.INSTALLED&&r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:!0},(0,_.localize)("marketplace.extension.installed")))))})},38105:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenVsxExtensionManagerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29150),_=e(70274),v=e(67761);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.VSXExtensionContribution,{token:l.VSXExtensionServiceToken,useClass:v.VSXExtensionService}],this.backServices=[{servicePath:l.VSXExtensionServicePath}]}};t.OpenVsxExtensionManagerModule=p,t.OpenVsxExtensionManagerModule=p=n.__decorate([(0,r.Injectable)()],p)},70274:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(57517),v=e(63067),p=e(52416),m=e(29150),s=e(21082),g=e(6449),a=e(73689);let h=class{initialize(){}onDidRender(){const u=this.mainLayoutService.getTabbarHandler(s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID);u&&(u.isActivated()?this.vsxExtensionService.getOpenVSXRegistry().then(()=>{this.vsxExtensionService.search("")}):u.onActivate(async()=>{!this.vsxExtensionService.openVSXRegistry&&await this.vsxExtensionService.getOpenVSXRegistry(),this.vsxExtensionService.search("")}))}registerResource(u){u.registerResourceProvider({scheme:s.EXTENSION_SCHEME,provideResource:async E=>{const{extensionId:f,state:c}=E.getParsedQuery(),y=await this.vsxExtensionService.getLocalExtension(f),b=this.iconService.fromIcon("",y?.iconUrl,p.IconType.Background);return{uri:E,metadata:{...y,extensionId:f,state:c,openVSXRegistry:this.vsxExtensionService.openVSXRegistry},icon:b||(0,o.getIcon)("extension"),name:(0,l.replaceLocalizePlaceholder)(y?.displayName,f)||""}}})}registerEditorComponent(u){const E=`${s.EXTENSION_SCHEME}_detail`;u.registerEditorComponent({component:g.ExtensionOverview,uid:E,scheme:s.EXTENSION_SCHEME}),u.registerEditorComponentResolver(s.EXTENSION_SCHEME,(f,c,y)=>{y?.([{type:_.EditorOpenType.component,componentId:E}])})}registerComponent(u){u.register("@opensumi/ide-extension-manager",[],{iconClass:(0,o.getIcon)("extension"),title:(0,l.localize)("marketplace.extension.container"),priority:5,containerId:s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,component:a.VSXExtensionView,activateKeyBinding:"ctrlcmd+shift+x"})}};t.VSXExtensionContribution=h,n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],h.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(m.VSXExtensionServiceToken),n.__metadata("design:type",Object)],h.prototype,"vsxExtensionService",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],h.prototype,"iconService",void 0),t.VSXExtensionContribution=h=n.__decorate([(0,l.Domain)(o.ClientAppContribution,v.MainLayoutContribution,o.ComponentContribution,_.BrowserEditorContribution)],h)},67761:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),_=e(98453),v=e(71354),p=e(28423),m=e(52416),s=e(12456),g=e(29150);let a=class extends o.Disposable{get extensions(){return this.extensionsObservable.get()}get installedExtensions(){return this.installedExtensionsObservable.get()}get openVSXRegistry(){return this.openVSXRegistryObservable.get()}constructor(){super(),this.extensionsObservable=(0,p.observableValue)(this,[]),this.installedExtensionsObservable=(0,p.observableValue)(this,[]),this.openVSXRegistryObservable=(0,p.observableValue)(this,""),this.tasks=new Map,this.getInstalledExtensions(),this.disposables.push(this.extensionInstanceService.onDidChange(()=>{this.getInstalledExtensions(),this.search(this.searchValue)}))}updateStatusBar(){if(this.tasks.size===0){this.installStatus&&(this.installStatus.dispose(),this.installStatus=void 0);return}const d="sumi-upload-file-status";if(this.tasks.size===1){const u=(0,o.localize)("marketplace.extension.installing"),E={text:u,alignment:o.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.installStatus=this.statusBarService.addElement(d,E)}}async install(d){var u,E;const f=this.getExtensionId(d);if(this.tasks.has(f)||!d.downloadUrl)return;const c=this.backService.install({id:f,name:(u=d.name)!==null&&u!==void 0?u:"-",url:d.downloadUrl,version:(E=d.version)!==null&&E!==void 0?E:"-"});return this.tasks.set(f,c),this.updateStatusBar(),c.then(async y=>{if(this.tasks.delete(f),this.updateStatusBar(),await this.extensionManagementService.postChangedExtension(!1,y),this.themeService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}if(this.iconService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.ICON_THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}if(this.productIconService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.PRODUCT_ICON_THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}})}async uninstall(d){d&&d.path&&await this.extensionManagementService.postUninstallExtension(d.path)}async disable(d){d&&d.path&&this.extensionManagementService.postDisableExtension(d.path)}async enable(d){d&&d.path&&this.extensionManagementService.postEnableExtension(d.path)}getExtensionId(d){var u,E,f;return(u=d?.extensionId)!==null&&u!==void 0?u:((E=d?.namespace)===null||E===void 0?void 0:E.toLowerCase())+"."+((f=d?.name)===null||f===void 0?void 0:f.toLowerCase())}async getLocalExtension(d){return d?this.extensions.find(E=>this.getExtensionId(E)===d)||this.installedExtensions.find(E=>this.getExtensionId(E)===d):void 0}async getRemoteRawExtension(d){if(!d)return;const u={extensionId:d},E=await this.backService.getExtension(u);if(E&&E.extensions&&E.extensions.length>=1)return Object.assign({},E.extensions[0])}async getOpenVSXRegistry(){const d=await this.backService.getOpenVSXRegistry();(0,p.transaction)(u=>{this.openVSXRegistryObservable.set(d,u)})}async openExtensionEditor(d,u){this.workbenchEditorService.open(new o.URI(`extension://?extensionId=${d}&state=${u}`),{preview:!0})}async search(d){const u={query:d,size:50,sortBy:"downloadCount"};this.searchValue=d;const E=await this.backService.search(u);E.extensions&&(0,p.transaction)(f=>{this.extensionsObservable.set(E.extensions.filter(c=>!this.installedExtensions.find(y=>this.getExtensionId(y)===this.getExtensionId(c))).map(c=>({...c,publisher:c.namespace,iconUrl:c.files.icon,downloadUrl:c.files.download,readme:c.files.readme})),f)})}async searchInstalledExtensions(d){(0,p.transaction)(u=>{const E=this.installedExtensions;this.installedExtensionsObservable.set(E.sort((f,c)=>{const y=(0,o.fuzzyScore)(d,d.toLowerCase(),0,f.name,f.name.toLowerCase(),0,!0),b=(0,o.fuzzyScore)(d,d.toLowerCase(),0,c.name,c.name.toLowerCase(),0,!0);return y?b?b[0]-y[0]:-1:1}),u)})}getInstalledExtensions(){const d=this.extensionInstanceService.getExtensionInstances().map(u=>{const E=u.extensionId;return{namespace:E&&E.includes(".")?E.split(".")[0]:u.packageJSON.publisher,name:u.packageJSON.name,id:u.extensionId,version:u.packageJSON.version,displayName:u.packageJSON.displayName,description:u.packageJSON.description,publisher:u.packageJSON.publisher,iconUrl:u.packageJSON.icon&&u.extensionLocation.toString()+`/${u.packageJSON.icon}`,path:u.path,realpath:u.realPath}});(0,p.transaction)(u=>{this.installedExtensionsObservable.set(d,u)})}};t.VSXExtensionService=a,n.__decorate([(0,r.Autowired)(g.VSXExtensionServicePath),n.__metadata("design:type",Object)],a.prototype,"backService",void 0),n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],a.prototype,"extensionInstanceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.ExtensionManagementService)],a.prototype,"extensionManagementService",void 0),n.__decorate([(0,r.Autowired)(m.IThemeService),n.__metadata("design:type",Object)],a.prototype,"themeService",void 0),n.__decorate([(0,r.Autowired)(m.IIconService),n.__metadata("design:type",Object)],a.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(m.IProductIconService),n.__metadata("design:type",Object)],a.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],a.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IStatusBarService),n.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),n.__decorate([(0,o.pMemoize)(h=>h),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",Promise)],a.prototype,"search",null),t.VSXExtensionService=a=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],a)},73689:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(14041),_=e(97267),v=e(41869),p=e(68974),m=e(43718),s=e(5567),g=e(29150),a=e(21082),h=e(87791),d=n.__importDefault(e(68143)),u=[g.TabActiveKey.MARKETPLACE,g.TabActiveKey.INSTALLED],E=()=>{const[f,c]=(0,l.useState)(g.TabActiveKey.MARKETPLACE),[y,b]=(0,l.useState)(!1),A=(0,v.useInjectable)(g.VSXExtensionServiceToken),S=(0,v.useAutorun)(A.extensionsObservable),D=(0,v.useAutorun)(A.installedExtensionsObservable),T=(0,v.useAutorun)(A.openVSXRegistryObservable),w=(0,r.default)(O=>{b(!0);let x;f===g.TabActiveKey.MARKETPLACE?x=A.search(O):x=A.searchInstalledExtensions(O),typeof x=="object"&&x.then&&x.then(()=>{b(!1)})},500),I=(0,l.useCallback)(O=>A.install(O),[]),R=(0,l.useCallback)((O,x)=>{const k=A.getExtensionId(O);A.openExtensionEditor(k,x)},[]),M=(0,l.useCallback)(O=>{const x=u[O];x&&c(x)},[]);return o.createElement("div",{className:d.default.panel},o.createElement(_.Tabs,{mini:!0,className:d.default.tabs,value:u.indexOf(f),onChange:M,tabs:[(0,m.localize)("marketplace.panel.tab.marketplace"),(0,m.localize)("marketplace.tab.installed")]}),o.createElement("div",{style:{padding:"8px"}},o.createElement(s.AutoFocusedInput,{containerId:a.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,placeholder:(0,m.localize)("marketplace.panel.tab.placeholder.search"),value:"",onChange:O=>w(O.target.value)})),f===g.TabActiveKey.MARKETPLACE&&o.createElement("div",{className:d.default.extensions_view},o.createElement(p.Progress,{loading:y}),S.map((O,x)=>o.createElement(h.Extension,{key:`${x}:${O.namespace}-${O.name}`,onClick:R,onInstall:I,extension:O,type:h.ExtensionViewType.MARKETPLACE,installedExtensions:D,openVSXRegistry:T}))),f===g.TabActiveKey.INSTALLED&&o.createElement("div",{className:d.default.extensions_view},D.map((O,x)=>o.createElement(h.Extension,{key:`${x}:${O.namespace}-${O.name}`,onClick:R,onInstall:I,extension:O,type:h.ExtensionViewType.INSTALLED,openVSXRegistry:T}))))};t.VSXExtensionView=E},29150:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IOpenvsxMarketplaceService=t.VSXExtensionServicePath=t.VSXExtensionServiceToken=t.VSXExtension=t.InstallState=t.TabActiveKey=t.EnableScope=void 0;var e;(function(l){l.GLOBAL="GLOBAL",l.WORKSPACE="WORKSPACE"})(e||(t.EnableScope=e={}));var n;(function(l){l.MARKETPLACE="marketplace",l.INSTALLED="installed"})(n||(t.TabActiveKey=n={}));var r;(function(l){l.INSTALLED="INSTALLED",l.NOT_INSTALLED="NOT_INSTALLED",l.SHOULD_UPDATE="SHOULD_UPDATE"})(r||(t.InstallState=r={}));class o{}t.VSXExtension=o,o.KEYS=new Set(["version","iconUrl","publisher","name","displayName","description","averageRating","downloadCount","downloadUrl","readmeUrl","licenseUrl","repository","license","readme","preview","namespaceAccess","publishedBy"]),t.VSXExtensionServiceToken=Symbol("VSXExtensionSerivceToken"),t.VSXExtensionServicePath="VSXExtensionServicePath",t.IOpenvsxMarketplaceService=Symbol("IOpenvsxMarketplaceService")},53599:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageContribution=t.ExtensionStorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93584),_=e(7446),v=e(16132),p=e(10207),m=e(19227);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IExtensionStorageService,useClass:p.ExtensionStorageService},{token:l.IExtensionStoragePathServer,useClass:v.ExtensionStoragePathServer},{token:l.IExtensionStorageServer,useClass:_.ExtensionStorageServer},g]}};t.ExtensionStorageModule=s,t.ExtensionStorageModule=s=n.__decorate([(0,o.Domain)(m.name)],s);let g=class{onReconnect(){this.extensionStorageService.reConnectInit()}};t.ExtensionStorageContribution=g,n.__decorate([(0,r.Autowired)(l.IExtensionStorageService),n.__metadata("design:type",Object)],g.prototype,"extensionStorageService",void 0),t.ExtensionStorageContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],g),n.__exportStar(e(10207),t)},16132:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(96405),v=e(14951),p=e(73344),m=e(51500),{Path:s}=l.path;let g=class{constructor(){this.windowsDataFolders=[l.StoragePaths.WINDOWS_APP_DATA_DIR,l.StoragePaths.WINDOWS_ROAMING_DIR],this.deferredWorkspaceStoragePath=new l.Deferred,this.deferredStoragePath=new l.Deferred,this.storagePathInitialized=!1}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||m.DEFAULT_WORKSPACE_SUFFIX_NAME}async provideHostLogPath(){const h=await this.getLogsDirPath();if(!h)throw new Error("Unable to get parent log directory");const d=h,u=l.URI.file(d).toString();return await this.fileSystem.access(u)||await this.fileSystem.createFolder(u),new l.URI(h)}async provideHostStoragePath(h,d,u){const E=await this.getWorkspaceStorageDirPath(u);if(!E)throw new Error("Unable to get parent storage directory");await this.fileSystem.access(l.URI.file(E).toString())||await this.fileSystem.createFolder(l.URI.file(E).toString());const f=await this.buildWorkspaceId(h,d,u),c=new s(E).join(f).toString();await this.fileSystem.access(l.URI.file(c).toString())||await this.fileSystem.createFolder(l.URI.file(c).toString());const y=new l.URI(c);return this.storagePathInitialized||(this.deferredWorkspaceStoragePath.resolve(y.path.toString()),this.deferredStoragePath.resolve(E),this.storagePathInitialized=!0),this.cachedStoragePath=y}async getLastWorkspaceStoragePath(){var h;return this.storagePathInitialized?(h=this.cachedStoragePath)===null||h===void 0?void 0:h.path.toString():this.deferredWorkspaceStoragePath.promise}async getLastStoragePath(){return this.deferredStoragePath.promise}doHash(h){return this.hashCalculateService.calculate(h)}async buildWorkspaceId(h,d,u){const E=await this.getUserHomeDir(),f=b=>b.resolve(u||m.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${m.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(l.Schemes.file),c=b=>b.resolve(u||m.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${m.UNTITLED_WORKSPACE}`).withScheme(l.Schemes.file);if(!h){const b=c(new l.URI(E));return this.doHash(b.toString())}if(f(new l.URI(E)).toString()===h.uri){const b=d.map(A=>A.uri).sort().join(",");return this.doHash(b)}else{const b=new l.URI(h.uri);return this.doHash(b.toString())}}async getLogsDirPath(){const h=await this.loggerManager.getLogFolder();return new s(h).join(l.StoragePaths.EXTENSIONS_LOGS_DIR).toString()}async getWorkspaceStorageDirPath(h){const d=await this.getWorkspaceDataDirPath(h);return new s(d).join(l.StoragePaths.EXTENSIONS_WORKSPACE_STORAGE_DIR).toString()}async getWorkspaceDataDirPath(h){const d=await this.getUserHomeDir(),u=h;return new s(d).join(...l.isWindows?this.windowsDataFolders:[""],u).toString()}async getUserHomeDir(){const h=await this.fileSystem.getCurrentUserHome();if(!h)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(h.uri)}};t.ExtensionStoragePathServer=g,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.ILoggerManagerClient),n.__metadata("design:type",Object)],g.prototype,"loggerManager",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(_.IHashCalculateService),n.__metadata("design:type",Object)],g.prototype,"hashCalculateService",void 0),t.ExtensionStoragePathServer=g=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],g)},7446:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageServer=void 0;const r=e(85608),o=e(76003),l=e(43718),_=e(14951),v=e(93584),{Path:p}=l.path;let m=n=class{constructor(){this.deferredWorkspaceDataDirPath=new l.Deferred,this.storageThrottler=new l.Throttler,this.storageTasks={},this.storageExistPromises=new Map}async init(g,a,h){return this.storageDelayer=new l.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),await this.setupDirectories(g,a,h||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME)}async asAccess(g,a){if(a)return await this.fileSystem.access(g);if(!this.storageExistPromises.has(g)){const h=this.fileSystem.access(g);this.storageExistPromises.set(g,h)}return await this.storageExistPromises.get(g)}async setupDirectories(g,a,h){const d=await this.extensionStoragePathsServer.getWorkspaceDataDirPath(h),u=l.URI.file(d).toString();await this.fileSystem.access(u)||await this.fileSystem.createFolder(u),this.workspaceDataDirPath=d,this.globalDataPath=new p(this.workspaceDataDirPath).join(l.StoragePaths.EXTENSIONS_GLOBAL_STORAGE_DIR).toString();const E=l.URI.file(this.globalDataPath).toString();await this.fileSystem.access(E)||await this.fileSystem.createFolder(E),this.deferredWorkspaceDataDirPath.resolve(this.workspaceDataDirPath);const f=await this.extensionStoragePathsServer.provideHostLogPath(),c=await this.extensionStoragePathsServer.provideHostStoragePath(g,a,h);return{logUri:f.codeUri,storageUri:c.codeUri,globalStorageUri:l.Uri.file(this.globalDataPath)}}async resolveStorageTask(g){const a=Object.keys(g);for(const h of a){const d=await this.readFromFile(h);for(const{key:u,value:E}of g[h])E===void 0||(0,l.isEmptyObject)(E)?delete d[u]:d[u]=E;await this.writeToFile(h,d)}}doSet(){const g={...this.storageTasks};return this.storageTasks={},this.resolveStorageTask(g)}async set(g,a,h){const d=await this.getDataPath(h);if(!d)throw new Error("Cannot save data: no opened workspace");return this.storageTasks[d]||(this.storageTasks[d]=[]),this.storageTasks[d].push({key:g,value:a}),this.storageDelayer.trigger(()=>this.storageThrottler.queue(this.doSet.bind(this)))}async get(g,a){const h=await this.getDataPath(a);return h?(await this.readFromFile(h))[g]:{}}async getAll(g){const a=await this.getDataPath(g);return a?await this.readFromFile(a):{}}async getDataPath(g){if(this.workspaceDataDirPath===void 0&&await this.deferredWorkspaceDataDirPath.promise,g)return new p(this.globalDataPath).join("global-state.json").toString();{const a=await this.extensionStoragePathsServer.getLastWorkspaceStoragePath();return a?new p(a).join("workspace-state.json").toString():void 0}}async readFromFile(g){const a=l.URI.file(g);if(!await this.asAccess(a.toString(),!0))return{};try{const{content:d}=await this.fileSystem.readFile(a.toString());return JSON.parse(d.toString())}catch(d){return this.logger.error('Failed to parse data from "',a.toString(),'". Reason:',d),{}}}async writeToFile(g,a){const h=l.URI.file(g);await this.asAccess(h.parent.toString())||await this.fileSystem.createFolder(h.parent.toString());const u=JSON.stringify(a);let E=await this.fileSystem.getFileStat(h.toString());E||(E=await this.fileSystem.createFile(h.toString())),await this.fileSystem.setContent(E,u)}};t.ExtensionStorageServer=m,m.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(v.IExtensionStoragePathServer),r.__metadata("design:type",Object)],m.prototype,"extensionStoragePathsServer",void 0),r.__decorate([(0,o.Autowired)(_.IFileServiceClient),r.__metadata("design:type",Object)],m.prototype,"fileSystem",void 0),r.__decorate([(0,o.Autowired)(l.ILogger),r.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.ExtensionStorageServer=m=n=r.__decorate([(0,o.Injectable)()],m)},10207:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(51500),v=e(93584);let p=class{constructor(){this._init=this.init(),this.updateEnvState()}get whenReady(){return this._init}get extensionStoragePath(){return this._extensionStoragePath}async init(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,a=this.appConfig.extensionStorageDirName||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,a),this._extensionStoragePath}async updateEnvState(){await this.get(l.firstSessionDateStorageKey,!0)===void 0&&await this.set(l.firstSessionDateStorageKey,{date:new Date().toUTCString()},!0)}set(s,g,a){return this.extensionStorageServer.set(s,g,a)}get(s,g){return this.extensionStorageServer.get(s,g)}getAll(s=!1){return this.extensionStorageServer.getAll(s)}async reConnectInit(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,a=this.appConfig.extensionStorageDirName||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,a),this._extensionStoragePath}};t.ExtensionStorageService=p,n.__decorate([(0,r.Autowired)(v.IExtensionStorageServer),n.__metadata("design:type",Object)],p.prototype,"extensionStorageServer",void 0),n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),t.ExtensionStorageService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},93584:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(85853),t),n.__exportStar(e(56969),t),n.__exportStar(e(23618),t)},85853:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=t.IExtensionStoragePathServer=void 0,t.IExtensionStoragePathServer=Symbol("IExtensionStoragePathServer"),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=".sumi"},56969:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionStorageService=t.IExtensionStorageServer=void 0,t.IExtensionStorageServer=Symbol("ExtensionStorageServer"),t.IExtensionStorageService=Symbol("ExtensionStorageService")},23618:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50492:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(93584),t)},57962:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivationEventServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(80076)),o=e(76003),l=e(43718);let _=class{constructor(){this.eventListeners=new Map,this.collectTopicData=new l.MultiMap,this.wildCardTopics=new Set,this.activatedEventSet=new Set,this.wildCardTopics.add("workspaceContains")}getTopicsData(p){return this.collectTopicData.get(p)||[]}async fireEvent(p,m=""){this.activatedEventSet.add(JSON.stringify({topic:p,data:m}));let s;if(this.wildCardTopics.has(p)?s=this.eventListeners.get(p):this.eventListeners.has(p)?s=this.eventListeners.get(p):s=this.eventListeners.get(p+":"+m),s){const g=await Promise.allSettled(s.map(a=>this.tryRun(p,m,a)));for(const a of g)a.status==="rejected"&&this.logger.error(`fire event ${p}:${m} error: ${a.reason}`)}}addWildCardTopic(p){return this.wildCardTopics.add(p),{dispose:()=>{this.wildCardTopics.delete(p)}}}onEvent(p,m){const s=p.indexOf(":");let g,a;return s===-1?(g=p,a=""):(g=p.substr(0,s),a=p.substr(s+1)),this.addListener(g,{topic:g,data:a,execute:m})}addListener(p,m){if(this.collectTopicData.set(m.topic,m.data),this.wildCardTopics.has(p))return this.eventListeners.has(p)||this.eventListeners.set(p,[]),this.eventListeners.get(p).push(m),{dispose:()=>{const s=this.eventListeners.get(p).indexOf(m);s!==-1&&this.eventListeners.get(p).splice(s,1)}};{const s=p+":"+m.data;return this.eventListeners.has(s)||this.eventListeners.set(s,[]),this.eventListeners.get(s).push(m),{dispose:()=>{const g=this.eventListeners.get(s).indexOf(m);g!==-1&&this.eventListeners.get(s).splice(g,1)}}}}async tryRun(p,m,s){this.wildCardTopics.has(p)?(0,r.default)(s.data)(m)&&await s.execute():await s.execute()}};t.ActivationEventServiceImpl=_,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ActivationEventServiceImpl=_=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],_)},6066:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedExtensionService=t.AllowedExtensionsContribution=t.DEFAULT_ALLOWED_EXTENSION_IDS=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);t.DEFAULT_ALLOWED_EXTENSION_IDS=["vscode.theme-defaults","vscode.typescript-language-features"],t.AllowedExtensionsContribution=Symbol("AllowedExtensionsContribution");let _=class{getAllowedExtensionIds(){const p=new Set(t.DEFAULT_ALLOWED_EXTENSION_IDS),m=this.contributions.getContributions();for(const s of m)for(const g of s.getAllowedExtensionIds())p.add(g);return Array.from(p)}filterExtensions(p){if(!this.workspaceTrustService.isRestricted())return p;const m=new Set(this.getAllowedExtensionIds());return p.filter(s=>m.has(s.id))}async filterExtensionsAfterTrustDecided(p){return await this.workspaceTrustService.whenTrustDecided(),this.filterExtensions(p)}};t.AllowedExtensionService=_,n.__decorate([(0,r.Autowired)(o.WorkspaceTrustService),n.__metadata("design:type",o.WorkspaceTrustService)],_.prototype,"workspaceTrustService",void 0),n.__decorate([(0,r.Autowired)(t.AllowedExtensionsContribution),n.__metadata("design:type",Object)],_.prototype,"contributions",void 0),t.AllowedExtensionService=_=n.__decorate([(0,r.Injectable)()],_)},63056:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionNoExportsView=t.ExtensionLoadingView=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(68974),_=n.__importDefault(e(17267)),v=({style:m})=>r.default.createElement("div",{style:m||{},className:_.default.kt_extension_view},r.default.createElement(l.Progress,{loading:!0}));t.ExtensionLoadingView=v;const p=(m,s)=>r.default.createElement("div",{className:_.default.kt_extension_no_exports_view},(0,o.formatLocalize)("extension.no.view.found",m,s));t.ExtensionNoExportsView=p},56405:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PortalRoot=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),_=e(87420),v=e(25600),p=m=>{var s;const[g,a]=o.default.useState(null),h=(0,l.useInjectable)(v.AbstractViewExtProcessService),d=(0,l.useInjectable)(_.IThemeService);o.default.useEffect(()=>{const E=new l.DisposableCollection;return d.getCurrentTheme().then(f=>a(f.type)),E.push(d.onThemeChange(f=>{f.type&&f.type!==g&&a(f.type)})),E.dispose.bind(E)},[]);const u=m.original;return o.default.createElement(u,{...m.otherProps,className:(0,r.default)((s=m.otherProps)===null||s===void 0?void 0:s.className,(0,_.getThemeTypeSelector)(g)),getContainer:()=>h.getPortalShadowRoot(m.extensionId)})};t.PortalRoot=p},82443:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TREE_VIEW_NODE_HEIGHT=t.TreeViewNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25918),p=e(93899),m=e(95422),s=e(69589),g=e(42912),a=n.__importDefault(e(50790)),h=({item:d,onClick:u,onChange:E,onContextMenu:f,itemType:c,leftPadding:y=8,onTwistierClick:b,decorations:A,defaultLeftPadding:S=8,treeViewId:D,decorationService:T,draggable:w,onDragStart:I,onDragEnter:R,onDragLeave:M,onDragOver:O,onDrop:x})=>{const k=(0,m.useInjectable)(g.IIconService),F=(0,_.useDesignStyles)(a.default.expansion_toggle,"expansion_toggle"),L=(0,_.useDesignStyles)(a.default.tree_view_node,"tree_view_node"),[N,U]=(0,o.useState)(d.uri&&T.getDecoration(d.uri,!1));(0,o.useEffect)(()=>{const Be=T.onDidChangeDecorations(De=>{d.uri&&De.affectsResource(d.uri)&&U(T.getDecoration(d.uri,!1))});return()=>{Be.dispose()}},[]);const W=(0,m.useInjectable)(g.IThemeService),j=(0,o.useCallback)(Be=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&u(Be,d,c)},[d,c,u]),Q=(0,o.useCallback)(Be=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&(b?b(Be,d,c):u(Be,d,c))},[d,c,b,u]),G=(0,o.useCallback)(Be=>{Be.nativeEvent.which===0||!f||(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&f(Be,d,c)},[d,c,f]),Z=(0,o.useCallback)(Be=>{I&&I(Be,d)},[d,I]),$=(0,o.useCallback)(Be=>{R&&R(Be,d)},[d,R]),V=(0,o.useCallback)(Be=>{M&&M(Be,d)},[d,M]),H=(0,o.useCallback)(Be=>{O&&O(Be,d)},[d,O]),K=(0,o.useCallback)(Be=>{x&&x(Be,d)},[d,x]),Y=(0,o.useCallback)(Be=>{E(d),Be.stopPropagation()},[d,E]),X=c===l.TreeNodeType.CompositeTreeNode,re=X?`${S+(d.depth||0)*(y||0)}px`:`${S+(d.depth||0)*(y||0)+8}px`,oe={height:t.TREE_VIEW_NODE_HEIGHT,lineHeight:`${t.TREE_VIEW_NODE_HEIGHT}px`,paddingLeft:re},he=(Be,De)=>A&&A?.classlist.indexOf(a.default.mod_loading)>-1?o.default.createElement(l.Loading,null):o.default.createElement("div",{onClick:De,className:(0,r.default)(a.default.tree_view_node_segment,F,(0,_.getIcon)("arrow-right"),{[`${a.default.mod_collapsed}`]:!Be.expanded})}),me=Be=>o.default.createElement("div",{className:(0,r.default)(a.default.file_icon,Be.icon),style:{maxHeight:t.TREE_VIEW_NODE_HEIGHT}}),q=Be=>{var De;return Be.checkboxInfo===void 0?null:o.default.createElement(l.CheckBox,{"data-node-id":Be.treeItemId,readOnly:!0,onChange:_e=>Y(_e),checked:!!Be.checkboxInfo.checked,id:Be.treeItemId,role:(De=Be.checkboxInfo.accessibilityInformation)===null||De===void 0?void 0:De.role,title:Be.checkboxInfo.tooltip})},ye=Be=>{const De=()=>{if(Be.highlights){let _e=[],Ne=0;const Te=Be.highlights.sort((Ue,pe)=>Ue[0]-pe[0]);return _e=Te.map((Ue,pe)=>{const[ie,le]=Ue,Se=Be.displayName.slice(Ne,ie);Ne=le;const Ae=Be.displayName.slice(ie,le),We=[o.default.createElement("span",{key:`line_begin_${pe}_${Se}`},Se),o.default.createElement("span",{className:a.default.highlight,key:`line_hightlight_${pe}_${Ae}`},Ae)];if(pe===Te.length-1){const $e=Be.displayName.slice(le);We.push(o.default.createElement("span",{key:`line_end_${pe}_${$e}`},$e))}return We}),_e}else return Be.displayName};return o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment,a.default.tree_view_node_displayname,Be.strikethrough&&a.default.strikethrough)},De())},ge=()=>o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment,a.default.tree_view_node_tail)},te()),te=()=>{if(d.actions.length>0)return o.default.createElement("div",{className:a.default.tree_view_actions},o.default.createElement(v.TitleActionList,{className:a.default.inlineMenu,context:[{treeViewId:D,treeItemId:d.treeItemId}],nav:d.actions,menuId:p.MenuId.ViewItemContext}))},fe=Be=>{if(X)return he(Be,Q)},Oe=()=>d.tooltip||d.name,Me=Be=>o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment_grow,a.default.tree_view_node_description)},!Be.name&&!Be.description?"\u2014\u2014":Be.description),Pe=()=>{if(!N)return null;const Be=N.badge||"",De=N.color,_e=De&&W.getColor({id:De});return o.default.createElement("div",{className:a.default.tree_view_node_tail,style:{color:_e}},(0,s.transformLabelWithCodicon)(Be.slice(),{},k.fromString.bind(k)))};return o.default.createElement("div",{key:d.id,onClick:j,onContextMenu:G,onDragStart:Z,onDragOver:H,onDragEnter:$,onDragLeave:V,onDrop:K,title:Oe(),className:(0,r.default)(L,A?A.classlist:null),"data-id":d.id,style:oe,draggable:w},o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_content)},fe(d),q(d),me(d),o.default.createElement("div",{className:a.default.tree_view_node_overflow_wrap},ye(d),Me(d)),ge(),Pe()))};t.TreeViewNode=h,t.TREE_VIEW_NODE_HEIGHT=22},81302:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTabBarTreeView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(68974),v=e(41893),p=e(24429),m=e(72260),s=e(82443),g=n.__importDefault(e(17267)),a=({viewState:u,model:E,dataProvider:f,treeViewId:c})=>{const y=(0,l.useInjectable)(m.IMainLayoutService),b=(0,l.useInjectable)(v.IDecorationsService),A=(0,r.useMemo)(()=>y.getViewAccordionService(c),[]),S=(0,r.useMemo)(()=>{const Z=A?.getViewState(c);return Z?!Z.collapsed&&!Z.hidden:!1},[A]),{height:D}=u,{canSelectMany:T}=E.treeViewOptions||{},w=(0,r.useRef)(null),I=(0,r.useCallback)(Z=>{E.handleTreeHandler({...Z,getModel:()=>E.treeModel,hasDirectFocus:()=>w.current===document.activeElement})},[E]),R=(0,r.useCallback)((Z,$)=>{Z.stopPropagation();const{toggleDirectory:V}=E;V($)},[E]),M=(0,r.useCallback)(Z=>O(Z)?!1:Z.shiftKey,[]),O=(0,r.useCallback)(Z=>{const{metaKey:$,ctrlKey:V}=Z;return l.isOSX&&$||V},[]),x=(0,r.useCallback)((Z,$,V)=>{Z.stopPropagation();const{handleItemClick:H,handleItemToggleClick:K,handleItemRangeClick:Y}=E;if(!$)return;const X=M(event),re=O(event);T?X?Y($,V):re?K($,V):H($,V):H($,V)},[T,E]),k=(0,r.useCallback)(Z=>{const{handleCheckBoxChange:$}=E;Z&&$(Z)},[E]),F=(0,r.useCallback)((Z,$)=>{const{handleContextMenu:V}=E;V(Z,$)},[E]),L=Z=>{const{handleContextMenu:$}=E;$(Z)},N=(0,r.useCallback)(()=>{const{enactiveNodeDecoration:Z}=E;Z()},[E]),U=(0,r.useCallback)((Z,$)=>{const{handleDragStart:V}=E;V(Z,$)},[E]),W=(0,r.useCallback)((Z,$)=>{const{handleDragOver:V}=E;V(Z,$)},[E]),j=(0,r.useCallback)((Z,$)=>{const{handleDragEnter:V}=E;V(Z,$)},[E]),Q=(0,r.useCallback)((Z,$)=>{const{handleDrop:V}=E;V(Z,$)},[E]),G=(0,r.useCallback)((Z,$)=>{const{handleDragLeave:V}=E;V(Z,$)},[E]);return(0,r.useEffect)(()=>{var Z;const $=()=>{E.handleTreeBlur()};return(Z=w.current)===null||Z===void 0||Z.addEventListener("blur",$,!0),()=>{var V;(V=w.current)===null||V===void 0||V.removeEventListener("blur",$,!0)}},[w.current]),r.default.createElement("div",{className:g.default.kt_extension_view,tabIndex:-1,ref:w,onContextMenu:L,onClick:N,"data-tree-view-id":c},r.default.createElement(d,{height:D,isVisible:S,handleTreeReady:I,handleItemClicked:x,handleCheckBoxChange:k,handleTwistierClick:R,handleContextMenu:F,handleDragStart:U,handleDragOver:W,handleDragEnter:j,handleDragLeave:G,handleDrop:Q,draggable:E.draggable,treeViewId:c,model:E,dataProvider:f,decorationService:b}))};t.ExtensionTabBarTreeView=a;function h(u,E){return u.isVisible===E.isVisible&&u.model===E.model&&u.treeViewId===E.treeViewId&&u.height===E.height}const d=(0,r.memo)(({model:u,treeViewId:E,height:f,isVisible:c,dataProvider:y,handleTreeReady:b,handleItemClicked:A,handleCheckBoxChange:S,handleTwistierClick:D,handleContextMenu:T,handleDragStart:w,handleDragOver:I,handleDragEnter:R,handleDragLeave:M,handleDrop:O,draggable:x,decorationService:k})=>{const[F,L]=(0,r.useState)(!1),[N,U]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let j=!1;return(async()=>(await u.whenReady,u.treeModel&&c&&await u.treeModel.ensureReady,j||L(!0)))(),()=>{j=!0,u&&u.removeNodeDecoration()}},[u,c]),(0,r.useEffect)(()=>{const j=y.onDidChangeEmpty(()=>{y.isTreeEmpty!==N&&U(y.isTreeEmpty)});return()=>j.dispose()},[]);const W=(0,r.useCallback)(j=>r.default.createElement(s.TreeViewNode,{item:j.item,itemType:j.itemType,decorations:u.decorations.getDecorations(j.item),onClick:A,onChange:S,onTwistierClick:D,onContextMenu:T,onDragStart:w,onDragOver:I,onDragEnter:R,onDragLeave:M,onDrop:O,defaultLeftPadding:8,leftPadding:8,treeViewId:E,draggable:x,decorationService:k}),[u.treeModel]);if(F){if(N)return r.default.createElement(p.WelcomeView,{viewId:E});if(u.treeModel)return r.default.createElement(o.RecycleTree,{height:f,itemHeight:s.TREE_VIEW_NODE_HEIGHT,onReady:b,model:u.treeModel},W)}else return r.default.createElement(_.Progress,{loading:!0});return null},h);d.displayName="ExtensionsTreeView"},88341:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionWebviewView=t.WebviewViewShouldShowEvent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(99220);class _ extends o.BasicEvent{}t.WebviewViewShouldShowEvent=_;const v=({viewId:p})=>{const m=r.default.useRef(null),s=(0,o.useInjectable)(o.IEventBus),g=(0,o.useInjectable)(l.ExtensionService);return r.default.useEffect(()=>{const a=new o.CancellationTokenSource,h=new o.Disposable({dispose:()=>a.cancel()});return g.eagerExtensionsActivated.promise.then(()=>{a.token.isCancellationRequested||m.current&&s.fire(new _({viewType:p,container:m.current,title:"",cancellationToken:a.token,disposer:h}))}),()=>{h.dispose()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"webview-view-component",ref:m})};t.ExtensionWebviewView=v},17428:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(81302),t),n.__exportStar(e(63056),t)},21167:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsEditorView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(93374),p=e(52416),m=e(99220),s=e(17441),g=n.__importDefault(e(42076)),a=({resource:{uri:E}})=>{const f=(0,_.useInjectable)(s.WalkthroughsService),c=(0,_.useInjectable)(_.IContextKeyService),{query:y,authority:b}=E,[A,S]=(0,o.useState)(),[D,T]=(0,o.useState)();(0,o.useEffect)(()=>{A&&A.steps.length>0&&(D||T(A.steps[0].id))},[A,D]),(0,o.useEffect)(()=>{y&&S(f.getWalkthrough(y))},[y,A]);const w=(0,o.useCallback)(()=>{var I;return A&&((I=A.steps.find(R=>R.id===D))===null||I===void 0?void 0:I.media)},[D,A]);return o.default.createElement("div",{className:g.default.getting_started_container},o.default.createElement("div",{className:g.default.getting_started_detailsContent},o.default.createElement("div",{className:g.default.category_container},o.default.createElement("div",{className:g.default.category_icon},A&&A.icon.type==="image"&&o.default.createElement("img",{src:A.icon.path})),o.default.createElement("div",{className:g.default.category_description_container},o.default.createElement("h2",{className:g.default.category_title},A?.title),o.default.createElement("div",{className:g.default.category_description},A?.description))),o.default.createElement("div",{className:g.default.steps_container},o.default.createElement("div",{className:g.default.getting_started_detail_container},o.default.createElement("div",{className:g.default.step_list_container},A?A.steps.filter(I=>c.match(I.when)).map(I=>o.default.createElement(h,{key:I.id,step:I,isExpanded:I.id===D,onSelected:T})):null))),o.default.createElement("div",{className:g.default.getting_started_media},D&&o.default.createElement(d,{media:w(),extensionId:b,stepId:D}))))};t.WalkthroughsEditorView=a;const h=({step:E,isExpanded:f,onSelected:c})=>{const y=(0,_.useInjectable)(_.IOpenerService),b=(0,_.useInjectable)(s.WalkthroughsService),A=(0,_.useInjectable)(p.IIconService),[S,D]=(0,o.useState)(!1),{description:T}=E;(0,o.useEffect)(()=>{const O=b.onDidProgressStep(x=>{const{id:k,done:F}=x;k===E.id&&F&&D(F)});return()=>O.dispose()},[]);const w=(0,o.useCallback)(()=>{D(!S),b.progressByEvent(m.CompletionEventsType.stepSelected+":"+E.id)},[S,E.id]),I=(0,o.useCallback)(O=>{const{href:x}=O;y.open(x),/^http(s)?:\/\//.test(x)&&b.progressByEvent(m.CompletionEventsType.onLink+":"+x)},[]),R=(0,o.useCallback)(()=>{if(T.length===0)return null;const O=[];return T.map((x,k)=>{if(x.nodes.length===1&&typeof x.nodes[0]!="string"){const F=x.nodes[0];O.push(o.default.createElement("div",{key:k.toString()+O.length,title:F.title},o.default.createElement(l.Button,{onClick:()=>I(F)},(0,_.transformLabelWithCodicon)(F.label,{},A.fromString.bind(A)))))}else{const F=x.nodes.map((L,N)=>typeof L=="string"?L:o.default.createElement("a",{key:L.label+"#"+N,title:L.title,onClick:()=>I(L)},L.label));O.push(o.default.createElement("p",{key:k.toString()+O.length.toString()+F.length.toString()},F))}}),o.default.createElement("div",{className:g.default.step_description_container},o.default.createElement(o.default.Fragment,null,O))},[T]),M=(0,o.useCallback)(()=>(0,_.transformLabelWithCodicon)(E.title,{},A.fromString.bind(A)),[E.title]);return o.default.createElement("div",{className:(0,r.default)(g.default.getting_started_step,f&&g.default.expanded),onClick:()=>c(E.id)},o.default.createElement("div",{className:g.default.checkbox},o.default.createElement(l.CheckBox,{id:E.id,onChange:w,checked:S})),o.default.createElement("div",{className:g.default.step_container},o.default.createElement("h3",{className:g.default.step_title},M()),f&&R()))},d=({media:E,extensionId:f,stepId:c})=>{const y=(0,_.useInjectable)(p.IThemeService),b=(0,_.useInjectable)(s.WalkthroughsService),[A,S]=(0,o.useState)(""),[D,T]=(0,o.useState)(""),w=(0,o.useCallback)(async I=>E?.type==="image"?"":I?(await b.getFileContent(f,I)).toString():"",[E]);if((0,o.useEffect)(()=>{const I=b.getStepsByExtension(c);I&&(E&&E.type==="svg"&&I.media.svg&&w(I.media.svg).then(S),E&&E.type==="markdown"&&I.media.markdown&&w(I.media.markdown).then(T))},[E,c]),!E)return null;if(E.type==="image"){const I=y.getCurrentThemeSync().type,R=E.path[I].toString(!0).replace(/ /g,"%20");return o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{alt:E.altText,srcSet:R.toLowerCase().endsWith(".svg")?R:R+" 1.5x"}))}return E.type==="svg"?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:g.default.media_svg_container,dangerouslySetInnerHTML:{__html:A}})):E.type==="markdown"?o.default.createElement(o.default.Fragment,null,o.default.createElement(u,{content:D,media:E})):null},u=({content:E,media:f})=>{const c=(0,_.useInjectable)(_.IOpenerService);if(f.type!=="markdown")return null;const y=(0,o.useCallback)(()=>f.base.resolve("/").toString(),[f,E]);return o.default.createElement(v.Markdown,{content:E,options:{baseUrl:y()},onLinkClick:b=>c.open(b)})}},87444:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtCommandManagementImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{constructor(){super(...arguments),this.commandEnvRegistry=new Map,this.proxyCommandExecutorRegistry=new Map}dispose(){this.commandEnvRegistry.clear(),this.proxyCommandExecutorRegistry.clear()}registerProxyCommandExecutor(v,p){this.proxyCommandExecutorRegistry.set(v,p)}async executeExtensionCommand(v,p,m){const s=this.proxyCommandExecutorRegistry.get(v);if(!s)throw new Error('Proxy command executor "'+v+'" is not existed');return s.$executeExtensionCommand(p,...m)}registerExtensionCommandEnv(v,p="node"){return this.commandEnvRegistry.set(v,p),{dispose:()=>{this.commandEnvRegistry.delete(v)}}}getExtensionCommandEnv(v){return this.commandEnvRegistry.get(v)}};t.ExtCommandManagementImpl=l,t.ExtCommandManagementImpl=l=n.__decorate([(0,r.Injectable)()],l)},49413:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtInstanceManagementService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(99220),v=e(42734);let p=class extends o.Disposable{constructor(){super(),this.onDidChangeEmitter=new l.Emitter,this.extensionMap=new Map,this._whenReady=this.init()}async init(){this.workspaceStorage=await this.storageProvider(o.STORAGE_NAMESPACE.EXTENSIONS),this.globalStorage=await this.storageProvider(o.STORAGE_NAMESPACE.GLOBAL_EXTENSIONS)}get whenReady(){return this._whenReady}get onDidChange(){return this.onDidChangeEmitter.event}dispose(){this.disposeExtensionInstances()}getExtensionInstances(){return Array.from(this.extensionMap.values())}disposeExtensionInstances(){for(const s of this.extensionMap.values())s.dispose();this.extensionMap=new Map}disposeExtensionInstancesByPath(s){s.forEach(g=>{var a;(a=this.extensionMap.get(g))===null||a===void 0||a.dispose()})}resetExtensionInstances(){for(const s of this.extensionMap.values())s.reset()}getExtensionInstanceByPath(s){return this.extensionMap.get(s)}getExtensionInstanceByExtId(s){for(const g of this.extensionMap.values())if(g.id===s)return g}deleteExtensionInstanceByPath(s){this.extensionMap.delete(s),this.onDidChangeEmitter.fire()}addExtensionInstance(s){this.extensionMap.set(s.path,s),this.onDidChangeEmitter.fire()}async checkExtensionEnable(s){await this.whenReady;const g=this.globalStorage.get(s.extensionId,_.EXTENSION_ENABLE.ENABLE);return this.workspaceStorage.get(s.extensionId,g)===_.EXTENSION_ENABLE.ENABLE}async createExtensionInstance(s,g,a){const h=typeof s=="string"?await this.extensionNodeClient.getExtension(s,(0,l.getLanguageId)(),{}):s;if(h)return this.injector.get(v.Extension,[h,await this.checkExtensionEnable(h),g||(this.appConfig.extensionDir?h.realPath.startsWith(this.appConfig.extensionDir):!1),!!a])}checkIsBuiltin(s){const g=this.getExtensionCandidateByPath(s.realPath);return(this.appConfig.extensionDir?s.realPath.startsWith(this.appConfig.extensionDir):!1)||(g?g.isBuiltin:!1)}checkIsDevelopment(s){const g=this.getExtensionCandidateByPath(s.realPath);return!!g?.isDevelopment}getExtensionCandidateByPath(s){return this.appConfig.extensionCandidate&&this.appConfig.extensionCandidate.find(g=>g.path===s)}};t.ExtInstanceManagementService=p,n.__decorate([(0,r.Autowired)(o.StorageProvider),n.__metadata("design:type",Function)],p.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],p.prototype,"extensionNodeClient",void 0),t.ExtInstanceManagementService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},98453:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionManagementService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(14951),_=e(99220),v=e(82389),p=e(71354),m=e(35321);let s=class extends o.WithEventBus{async getExtensionProps(a,h){const d=await this.extensionNodeClient.getExtension(a,(0,o.getLanguageId)(),h);if(d){const u=this.getExtensionByPath(a);if(u)return{...u.toJSON(),extraMetadata:d.extraMetadata}}}getExtensionByPath(a){return this.extInstanceManagementService.getExtensionInstances().find(h=>a===h.path)}getExtensionByExtId(a){return this.extInstanceManagementService.getExtensionInstances().find(h=>a===h.id)}async postChangedExtension(a,h,d){const{upgrade:u,extensionPath:E,oldExtensionPath:f,isBuiltin:c}=typeof a=="boolean"?{upgrade:a,extensionPath:h,oldExtensionPath:d,isBuiltin:!1}:a,y=this.extInstanceManagementService.getExtensionInstanceByPath(E);if(y){this.logger.warn(`Extension ${y.id} already exists, skip activate`);return}const b=await this.extInstanceManagementService.createExtensionInstance(E,!!c);if(b)return u&&this.disableExtension(f),await this.enableExtension(b)}async postEnableExtension(a){const h=await this.extInstanceManagementService.getExtensionInstanceByPath(a);if(h)return await this.enableExtension(h)}async postDisableExtension(a){return this.disableExtension(a)}async postUninstallExtension(a){return this.uninstallExtension(a)}getAllExtensionJson(){return this.extInstanceManagementService.getExtensionInstances().map(a=>a.toJSON())}disableExtension(a){const h=this.extInstanceManagementService.getExtensionInstanceByPath(a);h&&(h.disable(),this.extInstanceManagementService.deleteExtensionInstanceByPath(a))}async enableExtension(a){this.extInstanceManagementService.addExtensionInstance(a),a.enable(),await a.initialize(),this.eventBus.fire(new p.ExtensionDidEnabledEvent(a.toJSON())),this.sumiContributesService.register(a.id,a.packageJSON.sumiContributes||{}),this.contributesService.register(a.id,a.contributes),this.sumiContributesService.initialize(),this.contributesService.initialize()}async removeExtension(a){try{return await this.fileService.delete(o.URI.file(a).toString()),!0}catch(h){return this.logger.error(h),!1}}async uninstallExtension(a){const h=this.extInstanceManagementService.getExtensionInstanceByPath(a);h&&(h.dispose(),this.extInstanceManagementService.deleteExtensionInstanceByPath(a)),await this.removeExtension(a),this.eventBus.fire(new p.ExtensionDidUninstalledEvent)}};t.ExtensionManagementService=s,n.__decorate([(0,r.Autowired)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),n.__decorate([(0,r.Autowired)(_.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],s.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(m.VSCodeContributesServiceToken),n.__metadata("design:type",m.VSCodeContributesService)],s.prototype,"contributesService",void 0),n.__decorate([(0,r.Autowired)(v.SumiContributionsServiceToken),n.__metadata("design:type",v.SumiContributionsService)],s.prototype,"sumiContributesService",void 0),n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),t.ExtensionManagementService=s=n.__decorate([(0,r.Injectable)()],s)},20670:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(18740),_=e(41869),v=e(99220),p=e(72464),m=e(46147),s=e(37846),g=e(28949),a=e(51072),h=e(17802);let d=class{constructor(){this._apiFactoryDisposables=new _.DisposableStore,this.ready=new _.Deferred,this._extHostUpdated=new _.Deferred,this.extensions=[]}disposeApiFactory(){this._apiFactoryDisposables.clear()}async disposeProcess(){this.disposeApiFactory(),await this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}async activate(){return await this.createExtProcess(),this.protocol&&(this.ready.resolve(),await this.createBrowserMainThreadAPI(),await(await this.getProxy()).$updateExtHostData(),this._extHostUpdated.resolve()),this.protocol}async activeExtension(E,f){!this.appConfig.noExtHost&&!f&&(await this._extHostUpdated.promise,await(await this.getProxy()).$activateExtension(E.id))}async updateExtensionData(E){if(this.extensions=E,this.protocol){const f=await this.getProxy();await f.$updateExtHostData(),f.$fireChangeEvent()}}getExtension(E){return this.extensions.find(f=>f.id===E)}async $activateExtension(E){const f=this.extensions.find(c=>c.path===E);f&&await f.activate()}async $getExtensions(){return this.extensions.map(E=>E.toJSON())}async getProxy(){return await this.ready.promise,this.protocol.getProxy(m.ExtHostAPIIdentifier.ExtHostExtensionService)}async createBrowserMainThreadAPI(){const E=(0,h.initSharedAPIProxy)(this.protocol,this.injector);this._apiFactoryDisposables.add(E),this._apiFactoryDisposables.add((0,_.toDisposable)((0,a.initNodeThreadAPIProxy)(this.protocol,this.injector,this))),this._apiFactoryDisposables.add((0,_.toDisposable)((0,g.createSumiAPIFactory)(this.protocol,this.injector))),this._apiFactoryDisposables.add(this.createExternalSumiAPIFactory()),await E.setup()}getSpawnOptions(){return{}}createExternalSumiAPIFactory(){const E=new _.Disposable,f=this.mainThreadExtenderContributionProvider.getContributions();for(const y of f)y.registerMainThreadExtender(this.mainThreadExtenderService);const c=this.mainThreadExtenderService.getMainThreadExtenders();for(const y of c){const b=this.injector.get(y.serviceClass,[this.protocol]);this.protocol.set(y.identifier,b),E.addDispose(b)}return E}async getActivatedExtensions(){return await(await this.getProxy()).$getActivatedExtensions()}get clientId(){return this.applicationService.clientId}async createExtProcess(){await this.extensionNodeClient.createProcess(this.clientId,{enableDebugExtensionHost:this.appConfig.enableDebugExtensionHost,inspectExtensionHost:this.appConfig.inspectExtensionHost,extensionConnectOption:this.appConfig.extensionConnectOption,extHostSpawnOptions:this.getSpawnOptions()}),await this.initExtProtocol()}async initExtProtocol(){var E,f;this.channel&&this.channel.dispose(),this.protocol&&((f=(E=this.protocol).dispose)===null||f===void 0||f.call(E)),this.channel=await this.channelHandler.openChannel(v.CONNECTION_HANDLE_BETWEEN_EXTENSION_AND_MAIN_THREAD),this.connection=this.channel.createConnection(),this.protocol=new o.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"node-ext-host",io:(0,o.createExtMessageIO)(s.knownProtocols)})}};t.NodeExtProcessService=d,n.__decorate([(0,r.Autowired)(_.AppConfig),n.__metadata("design:type",Object)],d.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],d.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(_.IApplicationService),n.__metadata("design:type",Object)],d.prototype,"applicationService",void 0),n.__decorate([(0,r.Autowired)(l.WSChannelHandler),n.__metadata("design:type",l.WSChannelHandler)],d.prototype,"channelHandler",void 0),n.__decorate([(0,r.Autowired)(p.IMainThreadExtenderService),n.__metadata("design:type",Object)],d.prototype,"mainThreadExtenderService",void 0),n.__decorate([(0,r.Autowired)(p.MainThreadExtenderContribution),n.__metadata("design:type",Object)],d.prototype,"mainThreadExtenderContributionProvider",void 0),t.NodeExtProcessService=d=n.__decorate([(0,r.Injectable)()],d)},90731:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewExtProcessService=void 0;const r=e(85608),o=e(76003),l=e(65973),_=e(8919),v=e(41869),p=e(40827),m=e(43718),s=e(61656),g=e(99220),a=e(25600),h=e(17428),d=e(54107),u=e(9438),E=e(8403),f=e(31738),{Path:c,posix:y}=v.path,b="load";let A=n=class extends m.Disposable{constructor(){super(...arguments),this.debugLogger=(0,m.getDebugLogger)(),this.extensions=[],this.activatedViewExtensionMap=new Map,this.portalShadowRootMap=new Map,this.shadowRootBodyMap=new Map}getExtension(D){return this.extensions.find(T=>T.id===D)}async initExtension(D){this.extensions=D}async getActivatedExtensions(){return[]}getProxy(){}async $activateExtension(D){}async $getExtensions(){return this.extensions.map(D=>D.toJSON())}async disposeProcess(){}activate(){const D=this.requireInterceptorContributionProvider.getContributions();for(const T of D)T.registerRequireInterceptor(this.requireInterceptorService);this.extendExtensionErrorStackTrace()}extendExtensionErrorStackTrace(){Error.stackTraceLimit=100,Error.prepareStackTrace=(D,T)=>{let w,I=`Error: ${D.message}`;for(const R of T)if(I+=`
|
|
33391
|
+
`}async provideEditorDocumentModelContent(d,u){return""}isReadonly(d){return!1}isAlwaysDirty(d){return!0}disposeEvenDirty(d){return!0}closeAutoSave(d){return!0}async saveDocumentModel(d,u,E,f,c,y=!1){const{name:b}=d.getParsedQuery(),A=d.path.toString()!=="/"?l.path.dirname(d.path.toString()):this.appConfig.workspaceDir,S=await this.commandService.tryExecuteCommand("file.save",{showNameInput:!0,defaultFileName:b||d.displayName,defaultUri:l.URI.file(l.isWindows?A.replaceAll("\\","/"):A)});return S&&(await this.editorDocumentModelService.saveEditorDocumentModel(S,u,E,f,c,y),await this.workbenchEditorService.open(S,{preview:!1,focus:!0,replace:!0,forceClose:!0})),{state:l.SaveTaskResponseState.SUCCESS}}onDidDisposeModel(){}};t.UntitledSchemeDocumentProvider=g,r.__decorate([(0,o.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],g.prototype,"editorDocumentModelService",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",p.WorkbenchEditorService)],g.prototype,"workbenchEditorService",void 0),r.__decorate([(0,o.Autowired)(l.CommandService),r.__metadata("design:type",Object)],g.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(l.IApplicationService),r.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),r.__decorate([(0,o.Autowired)(s),r.__metadata("design:type",s)],g.prototype,"untitledIndex",void 0),r.__decorate([(0,o.Autowired)(l.PreferenceService),r.__metadata("design:type",Object)],g.prototype,"preferenceService",void 0),t.UntitledSchemeDocumentProvider=g=r.__decorate([(0,o.Injectable)()],g);let a=class extends l.WithEventBus{constructor(){super(...arguments),this.scheme=l.Schemes.untitled}provideResource(d){const{name:u}=d.getParsedQuery();return{name:u||d.displayName,uri:d,icon:"",metadata:null}}async shouldCloseResourceWithoutConfirm(d){const u=this.documentModelService.getModelDescription(d.uri,"close-resource-check");return!!(u&&u.dirty)}async close(d,u){const E=this.documentModelService.getModelReference(d.uri,"close-resource-check");if(!E)return!1;if(u===p.AskSaveResult.SAVE){const f=await E.instance.save();return E.dispose(),f}else return u===p.AskSaveResult.REVERT?(await E.instance.revert(),E.dispose(),!0):!u||u===p.AskSaveResult.CANCEL?(E.dispose(),!1):(E.dispose(),!0)}async shouldCloseResource(d){const u=this.documentModelService.getModelDescription(d.uri,"close-resource-check");if(!u||!u.dirty)return!0;const E={[(0,l.localize)("file.prompt.dontSave","Don't Save")]:p.AskSaveResult.REVERT,[(0,l.localize)("file.prompt.save","Save")]:p.AskSaveResult.SAVE,[(0,l.localize)("file.prompt.cancel","Cancel")]:p.AskSaveResult.CANCEL},f=await this.dialogService.open({message:(0,l.formatLocalize)("saveChangesMessage",d.name),type:l.MessageType.Info,buttons:Object.keys(E)});return await this.close(d,E[f])}};t.UntitledSchemeResourceProvider=a,r.__decorate([(0,o.Autowired)(_.IDialogService),r.__metadata("design:type",Object)],a.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],a.prototype,"documentModelService",void 0),t.UntitledSchemeResourceProvider=a=r.__decorate([(0,o.Injectable)()],a)},33835:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeEditor=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(23418),_=e(96689),v=p=>{const m=r.default.useRef(),s=(0,o.useInjectable)(l.EditorCollectionService),g=(0,o.useInjectable)(_.IEditorDocumentModelService),[a,h]=r.default.useState(void 0),[d,u]=r.default.useState(void 0),[E,f]=r.default.useState(void 0),[c,y]=r.default.useState(void 0);let b=!1;return r.default.useEffect(()=>{if(m.current){a&&a.dispose();const A=s.createCodeEditor(m.current,{automaticLayout:!0,...p.options});h(A),d&&A.open(d)}return()=>{b=!0,a&&a.dispose(),d&&d.dispose()}},[m.current]),p&&a&&p.editorRef&&p.editorRef(a),E&&c!==E&&(y(E),g.createModelReference(new o.URI(E),"editor-react-component").then(A=>{d&&d.dispose(),!b&&A.instance.uri.toString()===E?u(A):A.dispose()})),d&&a&&a.currentDocumentModel!==d.instance&&a.open(d),p.uri&&p.uri.toString()!==E&&f(p.uri.toString()),r.default.createElement("div",{ref:A=>A&&(m.current=A),...p})};t.CodeEditor=v},50674:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateOnGroupTabChange=r;const n=e(41869);function r(o){return(0,n.useUpdateOnEvent)(o.onDidEditorGroupTabChanged,[o])}},6670:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSuggestWidgetContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(76835);let v=class{contribute(m){const s=new o.DisposableCollection,g=m.monacoEditor.getContribution(_.SuggestController.ID);if(g&&g.widget&&g.widget.value){const a=g.widget.value;s.push(a.onDidSelect(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidSelect",data:h}))})),s.push(a.onDidHide(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidHide",data:h}))})),s.push(a.onDidShow(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidShow",data:h}))})),s.push(a.onDidFocus(h=>{this.eventBus.fire(new o.SuggestEvent({eventType:"onDidFocus",data:h}))})),a&&a._setDetailsVisible&&a._setDetailsVisible(this.preferenceService.get("editor.suggest.details.visible",!0))}return s}};t.EditorSuggestWidgetContribution=v,n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],v.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],v.prototype,"preferenceService",void 0),t.EditorSuggestWidgetContribution=v=n.__decorate([(0,r.Injectable)()],v)},67903:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorTopPaddingContribution=void 0;class e{contribute(r){return r.monacoEditor.onDidChangeModel(()=>{r.monacoEditor.changeViewZones(o=>{o.addZone({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:0})})})}}t.EditorTopPaddingContribution=e},51553:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorGroup=t.WorkbenchEditorServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),_=e(75524),v=e(43718),p=e(14951),m=n.__importStar(e(20868)),s=e(72665),g=e(50189),a=e(23418),h=e(96689),d=e(76759),u=e(47049),E=e(82196),f=e(17878),c=10,y=T=>!!(T.supportsRevive&&!T.deleted);let b=class extends v.WithEventBus{constructor(){super(),this.editorGroups=[],this._onDidEditorGroupsChanged=new v.Emitter,this.onDidEditorGroupsChanged=this._onDidEditorGroupsChanged.event,this._sortedEditorGroups=[],this._onActiveResourceChange=new v.Emitter,this.onActiveResourceChange=this._onActiveResourceChange.event,this._onActiveEditorUriChange=new v.Emitter,this.onActiveEditorUriChange=this._onActiveEditorUriChange.event,this._onCursorChange=new v.Emitter,this.onCursorChange=this._onCursorChange.event,this._onDidCurrentEditorGroupChanged=new v.Emitter,this.onDidCurrentEditorGroupChanged=this._onDidCurrentEditorGroupChanged.event,this._restoring=!0,this.contributionsReady=new v.Deferred,this.untitledCloseIndex=[],this.gridReady=!1,this._onDidGridReady=new v.Emitter,this.onDidGridReady=this._onDidGridReady.event,this.editorGroupIdGen=0,this.untitledIndex.update(),this.initialize()}setEditorContextKeyService(w){this.editorContextKeyService=w}setCurrentGroup(w){var I;if(w){if(this._currentEditorGroup===w)return;this._currentEditorGroup=w,this._onActiveResourceChange.fire(w.currentResource),this.eventBus.fire(new E.EditorActiveResourceStateChangedEvent({resource:w.currentResource,openType:w.currentOpenType,editorUri:(I=this.currentEditor)===null||I===void 0?void 0:I.currentUri})),this._onDidCurrentEditorGroupChanged.fire(this._currentEditorGroup)}}onEditorGroupChangeEvent(w){var I;w.payload.group===this.currentEditorGroup&&this.eventBus.fire(new E.EditorActiveResourceStateChangedEvent({resource:w.payload.newResource,openType:w.payload.newOpenType,editorUri:(I=this.currentEditor)===null||I===void 0?void 0:I.currentUri}))}getAllOpenedUris(){const w=[];for(const I of this.editorGroups)for(const R of I.resources)w.findIndex(O=>O.isEqual(R.uri))===-1&&w.push(R.uri);return w}async getAllOpenedDocuments(){const w=[];for(const I of this.editorGroups)for(const R of I.resources){if(R.uri.scheme!=="file")continue;if(w.findIndex(O=>O.uri.isEqual(R.uri))===-1){const O=await I.getDocumentModelRef(R.uri);O&&w.push(O.instance)}}return w}async save(w){if(this.editorGroups.length)try{for(const I of this.editorGroups){const R=I.resources.find(M=>M.uri.isEqual(w));R&&await I.saveResource(R)}return w}catch(I){throw new Error(`Save Failed: ${I.message}`)}}getDefaultSavePath(w){const I=w.path.toString()!=="/"?v.path.dirname(w.path.toString()):this.appConfig.workspaceDir;return v.isWindows?I.replace(/\\/g,"/"):I}async saveAs(w){var I,R;if(!(!this._currentEditorGroup||!((I=this._currentEditorGroup.currentResource)===null||I===void 0)&&I.deleted))try{const M=this.getDefaultSavePath(w);return await this.windowDialogService.showSaveDialog({saveLabel:"SaveAs File:",showNameInput:!0,defaultFileName:(R=this._currentEditorGroup.currentResource)===null||R===void 0?void 0:R.name,defaultUri:v.URI.file(M),saveAs:!0})}catch(M){throw new Error(`SaveAs Failed: ${M.message}`)}}async saveAll(w,I){for(const R of this.editorGroups)await R.saveAll(w,I)}hasDirty(){for(const w of this.editorGroups)if(w.hasDirty())return!0;return!1}calcDirtyCount(){const w=new Set;return this.editorGroups.reduce((I,R)=>I+R.calcDirtyCount(w),0)}createEditorGroup(){const w=this.injector.get(A,[this.generateRandomEditorGroupName(),this.editorGroupIdGen++]);this.editorGroups.push(w);const I=new v.Disposable(w.onDidEditorGroupBodyChanged(()=>{w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveResourceChange.fire(w.currentResource))}),w.onDidEditorFocusChange(()=>{var M;w===this.currentEditorGroup&&(!w.currentOpenType&&w.currentResource||this._onActiveEditorUriChange.fire((M=w.currentOrPreviousFocusedEditor)===null||M===void 0?void 0:M.currentUri))}));w.addDispose({dispose:()=>{I.dispose()}});const R=w.onDidEditorGroupTabChanged(()=>{this.saveOpenedResourceState()});return w.addDispose({dispose:()=>{R.dispose()}}),w.onCurrentEditorCursorChange(M=>{this._currentEditorGroup===w&&this._onCursorChange.fire(M)}),w}generateRandomEditorGroupName(){let w=(0,v.makeRandomHexString)(5);for(;this.editorGroups.findIndex(I=>I.name===w)!==-1;)w=(0,v.makeRandomHexString)(5);return w}initialize(){return this.initializing||(this.initializing=this.doInitialize()),this.initializing}async doInitialize(){this.openedResourceState=await this.initializeState(),await this.contributionsReady.promise,await this.restoreState(),this._currentEditorGroup=this.editorGroups[0]}async initializeState(){return await this.getStorage(v.STORAGE_NAMESPACE.WORKBENCH)}get currentEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentEditor}get currentCodeEditor(){return this.currentEditorGroup.currentCodeEditor}get currentEditorGroup(){return this._currentEditorGroup}get currentOrPreviousFocusedEditor(){return this.currentEditorGroup&&this.currentEditorGroup.currentOrPreviousFocusedEditor}async open(w,I){await this.initialize();let R=this.currentEditorGroup,M;if(I&&typeof I.groupIndex<"u"?M=I.groupIndex:I&&I.relativeGroupIndex&&(M=this.currentEditorGroup.index+I.relativeGroupIndex),typeof M=="number"&&M>=0){if(M>=this.editorGroups.length)return R.open(w,Object.assign({},I,{split:a.EditorGroupSplitAction.Right}));R=this.sortedEditorGroups[M]||this.currentEditorGroup}return R.open(w,I)}async openUris(w){await this.initialize(),await this.currentEditorGroup.openUris(w)}getEditorGroup(w){return this.editorGroups.find(I=>I.name===w)}get currentResource(){return this.currentEditorGroup?this.currentEditorGroup.currentResource:null}removeGroup(w){const I=this.editorGroups.findIndex(R=>R===w);if(I!==-1){if(this.editorGroups.length===1)return;this.editorGroups.splice(I,1),this.currentEditorGroup===w&&this.setCurrentGroup(this.editorGroups[0]);for(let R=I;R<this.editorGroups.length;R++)this.eventBus.fire(new E.EditorGroupIndexChangedEvent({group:this.editorGroups[R],index:R}))}}async saveOpenedResourceState(){if(this._restoring)return;const w=this.topGrid.serialize();await this.openedResourceState.set("grid",w)}prepareContextKeyService(){const w=R=>{let M=null;const O=this.documentModelManager.getModelDescription(R,"resourceContextKey");return O&&(M=O.languageId),M},I=new l.ResourceContextKey(this.editorContextKeyService,R=>{const M=w(R);return M||w(R)});this.onActiveResourceChange(R=>{this.currentEditor&&this.currentEditor.currentUri?I.set(this.currentEditor.currentUri):R?I.set(R.uri):I.reset()}),this.currentEditor&&this.currentEditor.currentUri?I.set(this.currentEditor.currentUri):this.currentResource?I.set(this.currentResource.uri):I.reset()}onDomCreated(w){this.editorContextKeyService&&this.editorContextKeyService.attachToDomNode(w)}notifyGroupChanged(){this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}async restoreState(){let w={editorGroup:{uris:[],previewIndex:-1}};this.appConfig.disableRestoreEditorGroupState||(w=this.openedResourceState.get("grid",w)),this.topGrid=new u.EditorGrid,this.addDispose(this.topGrid),this.addDispose(this.topGrid.onDidGridAndDesendantStateChange(()=>{this._sortedEditorGroups=void 0,this._onDidEditorGroupsChanged.fire()}));const I=[],R=this.topGrid.deserialize(w,()=>this.createEditorGroup(),I).then(()=>{this.topGrid.children.length===0&&!this.topGrid.editorGroup&&this.topGrid.setEditorGroup(this.createEditorGroup()),this.gridReady=!0,this._onDidGridReady.fire(),this.notifyGroupChanged()});return Promise.all(I).then(()=>{this._restoring=!1;for(const M of this.contributions.getContributions())M.onDidRestoreState&&M.onDidRestoreState()}),R}async closeAll(w,I){for(const R of this.editorGroups.slice(0))w?await R.close(w,{force:I}):await R.closeAll()}async closeAllOnlyConfirmOnce(){const w=[];for(const L of this.editorGroups)for(const N of L.resources)w.push(N);const R=(await Promise.all(w.map(async L=>({shouldClose:await this.resourceService.shouldCloseResourceWithoutConfirm(L),resource:L})))).filter(L=>L.shouldClose);if(R.length===0)return!1;const M={[(0,v.localize)("file.prompt.dontSave","Don't Save")]:E.AskSaveResult.REVERT,[(0,v.localize)("file.prompt.save","Save")]:E.AskSaveResult.SAVE,[(0,v.localize)("file.prompt.cancel","Cancel")]:E.AskSaveResult.CANCEL};let x=R.slice(0,c).map(L=>L.resource.name).join("\u3001");R.length>c&&(R.length-c===1?x+=(0,v.localize)("file.prompt.more.one"):x+=(0,v.formatLocalize)("file.prompt.more.number",R.length-c));const k=await this.dialogService.open({message:(0,o.toMarkdown)((0,v.formatLocalize)("saveNFilesChangesMessage",R.length,x),this.openner),type:v.MessageType.Info,buttons:Object.keys(M)}),F=M[k];return F===E.AskSaveResult.SAVE?(await Promise.all(R.map(L=>{var N,U;return(U=(N=this.resourceService).close)===null||U===void 0?void 0:U.call(N,L.resource,E.AskSaveResult.SAVE)})),!1):F===E.AskSaveResult.REVERT?(await Promise.all(R.map(L=>{var N,U;return(U=(N=this.resourceService).close)===null||U===void 0?void 0:U.call(N,L.resource,E.AskSaveResult.REVERT)})),!1):!0}async close(w,I){return this.closeAll(w,I)}get sortedEditorGroups(){return this._sortedEditorGroups||(this._sortedEditorGroups=[],this.topGrid.sortEditorGroups(this._sortedEditorGroups)),this._sortedEditorGroups}handleOnCloseUntitledResource(w){if(w.payload.resource.uri.scheme===v.Schemes.untitled){const{index:I}=w.payload.resource.uri.getParsedQuery();this.untitledCloseIndex.push(parseInt(I,10)),this.untitledCloseIndex.sort((R,M)=>R-M)}}createUntitledURI(){const w=this.untitledCloseIndex.shift()||this.untitledIndex.id;return new v.URI().withScheme(v.Schemes.untitled).withQuery(`name=${f.UntitledDocumentIdCounter.UNTITLED_FILE_NAME_PREFIX}${w}&index=${w}`)}createUntitledResource(w={uri:this.createUntitledURI()}){return this.open(w.uri,{preview:!1,focus:!0,...w.resourceOpenOptions})}};t.WorkbenchEditorServiceImpl=b,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],b.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(a.ResourceService),n.__metadata("design:type",a.ResourceService)],b.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.StorageProvider),n.__metadata("design:type",Function)],b.prototype,"getStorage",void 0),n.__decorate([(0,r.Autowired)(s.IDialogService),n.__metadata("design:type",Object)],b.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],b.prototype,"openner",void 0),n.__decorate([(0,r.Autowired)(E.BrowserEditorContribution),n.__metadata("design:type",Object)],b.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(h.IEditorDocumentModelService),n.__metadata("design:type",Object)],b.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(f.UntitledDocumentIdCounter),n.__metadata("design:type",f.UntitledDocumentIdCounter)],b.prototype,"untitledIndex",void 0),n.__decorate([(0,r.Autowired)(s.IWindowDialogService),n.__metadata("design:type",Object)],b.prototype,"windowDialogService",void 0),n.__decorate([(0,v.OnEvent)(E.EditorGroupChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorGroupChangeEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"onEditorGroupChangeEvent",null),n.__decorate([(0,v.OnEvent)(E.EditorGroupCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.EditorGroupCloseEvent]),n.__metadata("design:returntype",void 0)],b.prototype,"handleOnCloseUntitledResource",null),t.WorkbenchEditorServiceImpl=b=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],b);let A=class extends v.WithEventBus{constructor(w,I){super(),this.name=w,this.groupId=I,this.openingPromise=new Map,this._onDidEditorFocusChange=this.registerDispose(new v.Emitter),this.onDidEditorFocusChange=this._onDidEditorFocusChange.event,this._onDidEditorGroupTabChanged=new v.Emitter,this.onDidEditorGroupTabChanged=this._onDidEditorGroupTabChanged.event,this._onDidEditorGroupTabOperation=new v.Emitter,this.onDidEditorGroupTabOperation=this._onDidEditorGroupTabOperation.event,this._onDidEditorGroupBodyChanged=new v.Emitter,this.onDidEditorGroupBodyChanged=this._onDidEditorGroupBodyChanged.event,this._onDidEditorGroupContentLoading=new v.Emitter,this.onDidEditorGroupContentLoading=this._onDidEditorGroupContentLoading.event,this.previewURI=null,this.resources=[],this.resourceStatus=new Map,this.cachedResourcesActiveOpenTypes=new Map,this.cachedResourcesOpenTypes=new Map,this.availableOpenTypes=[],this.activeComponents=new Map,this.activateComponentsProps=new Map,this.holdDocumentModelRefs=new Map,this.toDispose=[],this._prevDomHeight=0,this._prevDomWidth=0,this._onCurrentEditorCursorChange=new v.Emitter,this.onCurrentEditorCursorChange=this._onCurrentEditorCursorChange.event,this.resourceOpenHistory=[],this._domNode=null,this._diffEditorDomNode=null,this._diffEditorDomNodeAttached=!1,this._multiFileDiffEditorDomNode=null,this._multiFileDiffEditorDomNodeAttached=!1,this._mergeEditorDomNode=null,this._mergeEditorDomNodeAttached=!1,this.codeEditorReady=new v.ReadyEvent,this.diffEditorReady=new v.ReadyEvent,this.diffEditorDomReady=new v.ReadyEvent,this.multiDiffEditorDomReady=new v.ReadyEvent,this.mergeEditorReady=new v.ReadyEvent,this.mergeEditorDomReady=new v.ReadyEvent,this._restoringState=!1,this._multiDiffEditorDomNodeAttached=!1,this.eventBus.onDirective(o.ResizeEvent.createDirective((0,o.getSlotLocation)("@opensumi/ide-editor",this.config.layoutConfig)),()=>{this.doLayoutEditors()}),this.eventBus.on(E.GridResizeEvent,R=>{R.payload.gridId===this.grid.uid&&this.doLayoutEditors()}),this.eventBus.on(E.EditorComponentDisposeEvent,R=>{this.activeComponents.delete(R.payload),this.activateComponentsProps.delete(R.payload)}),this.listenToExplorerAutoRevealConfig()}listenToExplorerAutoRevealConfig(){this.explorerAutoRevealConfig=!!this.preferenceService.get("explorer.autoReveal"),this.disposables.push(this.preferenceService.onPreferenceChanged(w=>{w.preferenceName==="explorer.autoReveal"&&(this.explorerAutoRevealConfig=w.newValue)}))}attachDiffEditorDom(w){this._diffEditorDomNodeAttached||(this._diffEditorDomNode=w,this.diffEditorDomReady.ready(),this._diffEditorDomNodeAttached=!0)}attachMergeEditorDom(w){this._mergeEditorDomNodeAttached||(this._mergeEditorDomNode=w,this.mergeEditorDomReady.ready(),this._mergeEditorDomNodeAttached=!0)}attachToDom(w){this._domNode=w,w&&(this.contextKeyService.attachToDomNode(w),this.layoutEditors())}layoutEditors(){o.fastdom.measure(()=>{if(this._domNode){const w=this._domNode.offsetWidth,I=this._domNode.offsetHeight;(w!==this._prevDomWidth||I!==this._prevDomHeight)&&this.doLayoutEditors(),this._prevDomWidth=w,this._prevDomHeight=I}})}_layoutEditorWorker(){if(this.currentOpenType)switch(this.currentOpenType.type){case E.EditorOpenType.code:this.codeEditor&&this.codeEditor.layout();break;case E.EditorOpenType.diff:this.diffEditor&&this.diffEditor.layout();break;case E.EditorOpenType.multiDiff:this.multiDiffEditor&&this._multiDiffEditorDomNodeAttached&&this.multiDiffEditor.layout(new g.Dimension(this._multiDiffEditorDomNode.offsetWidth,this._multiDiffEditorDomNode.offsetHeight));break;default:break}}doLayoutEditors(){this._measure&&this._measure.dispose(),this._measure=o.fastdom.mutate(()=>{this._layoutEditorWorker()})}setContextKeys(){var w;if(!this._resourceContext){const I=R=>{let M=null;const O=this.documentModelManager.getModelDescription(R,"resourceContextKey");return O&&(M=O.languageId),M};this._resourceContext=new l.ResourceContextKey(this.contextKeyService,R=>I(R)),this._diffResourceContextKey=new l.ResourceContextKey(this.contextKeyService,R=>I(R),"diffResource"),this._editorLangIDContextKey=this.contextKeyService.createKey("editorLangId",""),this._isInDiffEditorContextKey=this.contextKeyService.createKey("isInDiffEditor",!1),this._isInMultiDiffEditorContextKey=this.contextKeyService.createKey("isInMultiDiffEditor",!1),this._activeEditorIsDirtyContextKey=this.contextKeyService.createKey("activeEditorIsDirty",!1),this._isInDiffRightEditorContextKey=this.contextKeyService.createKey("isInDiffRightEditor",!1),this._isInEditorComponentContextKey=this.contextKeyService.createKey("inEditorComponent",!1)}this.currentOrPreviousFocusedEditor&&this.currentOrPreviousFocusedEditor.currentUri?(this._resourceContext.set(this.currentOrPreviousFocusedEditor.currentUri),this.currentOrPreviousFocusedEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentOrPreviousFocusedEditor.currentDocumentModel.languageId)):this.currentEditor&&this.currentEditor.currentUri?(this._resourceContext.set(this.currentEditor.currentUri),this.currentEditor.currentDocumentModel&&this._editorLangIDContextKey.set(this.currentEditor.currentDocumentModel.languageId)):(this.currentResource?this._resourceContext.set(this.currentResource.uri):this._resourceContext.reset(),this._editorLangIDContextKey.reset()),this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty()),this._isInDiffEditorContextKey.set(this.isDiffEditorMode()),this._isInMultiDiffEditorContextKey.set(this.isMultiDiffEditorMode()),this._isInDiffRightEditorContextKey.set(this.isDiffEditorMode()),this._isInEditorComponentContextKey.set(this.isComponentMode()),this.isDiffEditorMode()&&this._diffResourceContextKey.set((w=this.currentResource)===null||w===void 0?void 0:w.uri),this.updateContextKeyWhenDiffEditorChangesFocus()}updateContextKeyWhenDiffEditorChangesFocus(){if(this.updateContextKeyWhenEditorChangesFocusDisposer||!this.diffEditor)return;const w=()=>{this.currentFocusedEditor||(this.setContextKeys(),this._onDidEditorFocusChange.fire())};this.updateContextKeyWhenEditorChangesFocusDisposer=new v.Disposable(this.diffEditor.modifiedEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.modifiedEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.diffEditor.originalEditor.onFocus(()=>{this._currentOrPreviousFocusedEditor=this.diffEditor.originalEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onFocus(()=>{this.codeEditor.currentUri&&this.locateInFileTree(this.codeEditor.currentUri),this._currentOrPreviousFocusedEditor=this.codeEditor,this.setContextKeys(),this._onDidEditorFocusChange.fire()}),this.codeEditor.onBlur(w),this.diffEditor.originalEditor.onBlur(w),this.diffEditor.modifiedEditor.onBlur(w)),this.addDispose(this.updateContextKeyWhenEditorChangesFocusDisposer)}get contextKeyService(){return this._contextKeyService||(this._contextKeyService=this.workbenchEditorService.editorContextKeyService.createScoped()),this._contextKeyService}get index(){return this.workbenchEditorService.sortedEditorGroups.indexOf(this)}onResourceDecorationChangeEvent(w){w.payload.decoration.dirty&&this.previewURI&&this.previewURI.isEqual(w.payload.uri)&&this.pinPreviewed(),this.resources.find(R=>R.uri.isEqual(w.payload.uri))&&this.notifyTabChanged()}resetOpenType(){this._currentOpenType=null}async oResourceOpenTypeChangedEvent(w){const I=w.payload;if(this.cachedResourcesOpenTypes.has(I.toString())&&this.cachedResourcesOpenTypes.delete(I.toString()),this.currentResource&&this.currentResource.uri.isEqual(I)){this.resetOpenType();const R=new v.Deferred;this.resourceStatus.set(this.currentResource,R.promise);const M=setTimeout(()=>{this.notifyTabLoading(this.currentResource)},60);this.notifyBodyChanged();try{await this.displayResourceComponent(this.currentResource,{})}finally{clearTimeout(M),R.resolve()}}}async onRegisterEditorComponentEvent(){if(this.currentResource){const w=this.currentResource,I=await this.editorComponentRegistry.resolveEditorComponent(w);this.currentResource===w&&(this.availableOpenTypes=I,this.cachedResourcesOpenTypes.set(w.uri.toString(),I))}}pinPreviewed(w){const I=this.previewURI;w===void 0?this.previewURI=null:this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),I!==this.previewURI&&this.notifyTabChanged()}notifyTabChanged(){this._restoringState||this._onDidEditorGroupTabChanged.fire()}notifyBodyChanged(){this._onDidEditorGroupBodyChanged.fire()}notifyTabLoading(w){this._onDidEditorGroupContentLoading.fire(w)}get currentEditor(){return this.currentOpenType?this.currentOpenType.type===E.EditorOpenType.code?this.codeEditor:this.currentOpenType.type===E.EditorOpenType.diff?this.diffEditor.modifiedEditor:null:null}get currentOrPreviousFocusedEditor(){return this._currentOrPreviousFocusedEditor||this.currentEditor}get currentFocusedEditor(){if(this.currentOpenType){if(this.currentOpenType.type===E.EditorOpenType.code){if(this.codeEditor.monacoEditor.hasWidgetFocus())return this.codeEditor}else if(this.currentOpenType.type===E.EditorOpenType.diff){if(this.diffEditor.modifiedEditor.monacoEditor.hasTextFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasTextFocus())return this.diffEditor.originalEditor;if(this.diffEditor.modifiedEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.modifiedEditor;if(this.diffEditor.originalEditor.monacoEditor.hasWidgetFocus())return this.diffEditor.originalEditor}}return null}get currentCodeEditor(){return this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code?this.codeEditor:null}createEditor(w){this.codeEditor=this.collectionService.createCodeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.addDispose(this.codeEditor.onRefOpen(()=>{this.doLayoutEditors()})),this.toDispose.push(this.codeEditor.onCursorPositionChanged(I=>{this._onCurrentEditorCursorChange.fire(I)})),this.toDispose.push(this.codeEditor.onSelectionsChanged(I=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:I.selections,source:I.source,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onVisibleRangesChanged(I=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:I,editorUri:this.codeEditor.currentUri}))})),this.toDispose.push(this.codeEditor.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.eventBus.fire(new E.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:this.codeEditor.currentUri}))})),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.code,editorId:this.codeEditor.getId()})),this.toDispose.push(this.codeEditor.monacoEditor.onDidChangeModelContent(()=>{this._activeEditorIsDirtyContextKey.set(this.activeEditorIsDirty())})),this.codeEditorReady.ready()}createMergeEditor(w){this.mergeEditor=this.collectionService.createMergeEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),this.mergeEditorReady.ready()}createDiffEditor(w){this.diffEditor=this.collectionService.createDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService}),setTimeout(()=>{this.doLayoutEditors()}),this.diffEditor.onRefOpen(()=>{this.doLayoutEditors()}),this.addDiffEditorEventListeners(this.diffEditor.originalEditor,"original"),this.addDiffEditorEventListeners(this.diffEditor.modifiedEditor,"modified"),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.diff,editorId:this.diffEditor.modifiedEditor.getId()})),this.eventBus.fire(new E.CodeEditorDidVisibleEvent({groupName:this.name,type:E.EditorOpenType.diff,editorId:this.diffEditor.originalEditor.getId()})),this.diffEditorReady.ready()}addDiffEditorEventListeners(w,I){this.toDispose.push(w.onSelectionsChanged(R=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorSelectionChangeEvent({group:this,resource:this.currentResource,selections:R.selections,source:R.source,editorUri:v.URI.from(w.monacoEditor.getModel().uri),side:I}))})),this.toDispose.push(w.onVisibleRangesChanged(R=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorVisibleChangeEvent({group:this,resource:this.currentResource,visibleRanges:R,editorUri:w.currentUri}))})),this.toDispose.push(w.onConfigurationChanged(()=>{this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.eventBus.fire(new E.EditorConfigurationChangedEvent({group:this,resource:this.currentResource,editorUri:w.currentUri}))}))}async split(w,I,R){var M,O,x;const k=this.workbenchEditorService.createEditorGroup(),F=w===a.EditorGroupSplitAction.Left||w===a.EditorGroupSplitAction.Right?u.SplitDirection.Horizontal:u.SplitDirection.Vertical,L=w===a.EditorGroupSplitAction.Left||w===a.EditorGroupSplitAction.Top;if(this.grid.split(F,k,L),R&&!R.scrollTop&&(R.scrollTop=(M=this.currentEditor)===null||M===void 0?void 0:M.monacoEditor.getScrollTop()),R&&!R.scrollLeft&&(R.scrollLeft=(O=this.currentEditor)===null||O===void 0?void 0:O.monacoEditor.getScrollLeft()),R&&!R?.range){const N=(x=this.currentCodeEditor)===null||x===void 0?void 0:x.monacoEditor.getSelection();N&&(R.range=new m.Range(N.startLineNumber,N.startColumn,N.endLineNumber,N.endColumn))}return k.open(I,{...R,preview:!1,revealRangeInCenter:!1})}async open(w,I={}){if(w.scheme===v.Schemes.file&&this.recentFilesManager.setMostRecentlyOpenedFile(w.withoutFragment().toString()),I&&I.split)return this.split(I.split,w,Object.assign({},I,{split:void 0,preview:!1}));if(!this.openingPromise.has(w.toString())){const M=this.doOpen(w,I);this.openingPromise.set(w.toString(),M),M.then(()=>{this.openingPromise.delete(w.toString())},()=>{this.openingPromise.delete(w.toString())})}return this.preferenceService.get("editor.previewMode")&&((0,v.isUndefinedOrNull)(I.preview)?!0:I.preview)||this.openingPromise.get(w.toString()).then(()=>{this.pinPreviewed(w)}),this.openingPromise.get(w.toString())}async pin(w){return this.pinPreviewed(w)}getPreventScrollOption(w={}){var I;return(I=w.preventScroll)!==null&&I!==void 0?I:this.preferenceService.get("editor.preventScrollAfterFocused")}async doOpen(w,I={}){var R,M,O;if(!this.resourceService.handlesUri(w))return this.openerService.open(w),!1;let x;try{const k=this.preferenceService.get("editor.previewMode")&&((0,v.isUndefinedOrNull)(I.preview)?!0:I.preview);if(this.currentResource&&this.currentResource.uri.isEqual(w)&&(!I.forceOpenType||I.forceOpenType.type===((R=this.currentOpenType)===null||R===void 0?void 0:R.type))){if(I.focus&&this.currentEditor){const F=this.getPreventScrollOption(I);(M=this._domNode)===null||M===void 0||M.focus({preventScroll:F}),this.currentEditor.monacoEditor.focus()}return I.range&&this.currentEditor&&(this.currentEditor.monacoEditor.setSelection(I.range),setTimeout(()=>{var F;(F=this.currentEditor)===null||F===void 0||F.monacoEditor.revealRangeInCenter(I.range,0)},0)),this.locationInTree(I,w),this.notifyTabChanged(),{group:this,resource:this.currentResource}}else{const F=this._currentOpenType,L=this._currentResource;let N=null,U=this.resources.find(Q=>Q.uri.toString()===w.toString());if(!U){if(U=await this.resourceService.getResource(w),!U)throw new Error("This uri cannot be opened!: "+w);if(U.deleted){if(I.deletedPolicy==="fail")throw new Error("resource deleted "+w);if(I.deletedPolicy==="skip")return!1}I&&I.label&&(U.name=I.label),I&&(0,v.isDefined)(I.supportsRevive)&&(U.supportsRevive=I.supportsRevive);let Q=null;if(I&&I.index!==void 0&&I.index<this.resources.length)Q=this.resources[I.index],this.resources.splice(I.index,0,U),N={type:"open",resource:U,index:I.index};else if(this.currentResource){const G=this.resources.indexOf(this.currentResource);this.resources.splice(G+1,0,U),N={type:"open",resource:U,index:G+1},Q=this.currentResource}else this.resources.push(U),N={type:"open",resource:U,index:this.resources.length-1};k&&(this.previewURI&&await this.close(this.previewURI,{treatAsNotCurrent:!0,force:I.forceClose}),this.previewURI=U.uri),I.replace&&Q&&await this.close(Q.uri,{treatAsNotCurrent:!0,force:I.forceClose})}if(I.backend)return this.notifyTabChanged(),!1;if(L&&this.resourceOpenHistory[this.resourceOpenHistory.length-1]!==L.uri){this.resourceOpenHistory.push(L.uri);const Q=(O=this.currentCodeEditor)===null||O===void 0?void 0:O.getSelections();Q&&Q.length>0&&this.recentFilesManager.updateMostRecentlyOpenedFile(L.uri.toString(),{lineNumber:Q[0].selectionStartLineNumber,column:Q[0].selectionStartColumn})}this._currentOpenType=null,this._currentResource=U;const W=this.reporterService.time(v.REPORT_NAME.EDITOR_REACTIVE);x=new v.Deferred,this.resourceStatus.set(U,x.promise);const j=setTimeout(()=>{this.notifyTabLoading(U)},60);this.notifyTabChanged(),this.notifyBodyChanged();try{await this.displayResourceComponent(U,I)}finally{N&&this._onDidEditorGroupTabOperation.fire(N)}return this._currentOrPreviousFocusedEditor=this.currentEditor,clearTimeout(j),x.resolve(),W.timeEnd(U.uri.toString()),this._onDidEditorFocusChange.fire(),this.setContextKeys(),this.eventBus.fire(new E.EditorGroupOpenEvent({group:this,resource:U})),this.locationInTree(I,w),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:F,oldResource:L})),{group:this,resource:U}}}catch(k){return(0,v.getDebugLogger)().error(k),x&&x.reject(),(0,d.isEditorError)(k,d.EditorTabChangedError)||this.messageService.error((0,v.formatLocalize)("editor.failToOpen",w.displayName,k.message),[],!0),!1}}locationInTree(w,I){w?.backend||(w?.disableNavigate||this.locateInFileTree(I),w.disableNavigateOnOpendEditor||this.locateInOpenedEditor(I))}locateInFileTree(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.FILE_COMMANDS.LOCATION.id,w)}locateInOpenedEditor(w){this.explorerAutoRevealConfig&&this.commands.tryExecuteCommand(o.OPEN_EDITORS_COMMANDS.LOCATION.id,w)}async openUris(w){for(const I of w)await this.open(I)}async getDocumentModelRef(w){const I=w.toString();return this.holdDocumentModelRefs.has(I)||this.holdDocumentModelRefs.set(I,await this.documentModelManager.createModelReference(w,"editor-group-"+this.name)),this.holdDocumentModelRefs.get(I)}disposeDocumentRef(w){if(w.scheme==="diff"){const I=w.getParsedQuery();this.doDisposeDocRef(new v.URI(I.original)),this.doDisposeDocRef(new v.URI(I.modified))}else w.scheme==="mergeEditor"?this.mergeEditor&&this.mergeEditor.dispose():this.doDisposeDocRef(w)}doDisposeDocRef(w){const I=w.toString();this.holdDocumentModelRefs.has(I)&&(this.holdDocumentModelRefs.get(I).dispose(),this.holdDocumentModelRefs.delete(I))}async openCodeEditor(w,I){this.resolveTabChanged(w,this.currentResource),await this.codeEditorReady.onceReady(async()=>{var R;const M=await this.getDocumentModelRef(w.uri);if(await this.codeEditor.open(M),I.range){const O=new m.Range(I.range.startLineNumber,I.range.startColumn,I.range.endLineNumber,I.range.endColumn);this.codeEditor.monacoEditor.setSelection(O),I.revealRangeInCenter&&setTimeout(()=>{this.codeEditor.monacoEditor.revealRangeInCenter(O,1)})}if(queueMicrotask(()=>{I.scrollTop&&this.codeEditor.monacoEditor.setScrollTop(I.scrollTop),I.scrollLeft&&this.codeEditor.monacoEditor.setScrollLeft(I.scrollLeft)}),I.focus){const O=this.getPreventScrollOption(I);(R=this._domNode)===null||R===void 0||R.focus({preventScroll:O});const x=this.eventBus.on(E.CodeEditorDidVisibleEvent,k=>{var F;if(k.payload.groupName===this.name&&k.payload.type===E.EditorOpenType.code){if(x.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.codeEditor&&(!((F=this.codeEditor.currentUri)===null||F===void 0)&&F.isEqual(w.uri)))try{this.codeEditor.focus()}catch{}}})}M.instance.dirty&&this.pinPreviewed(w.uri)})}async openDiffEditor(w,I){this.diffEditor||await this.diffEditorDomReady.onceReady(()=>{var x;const k=document.createElement("div");(x=this._diffEditorDomNode)===null||x===void 0||x.appendChild(k),this.createDiffEditor(k)});const R=w,[M,O]=await Promise.all([this.getDocumentModelRef(R.metadata.original),this.getDocumentModelRef(R.metadata.modified)]);await this.diffEditorReady.onceReady(async()=>{var x;if(!(!M||!O)&&(await this.diffEditor.compare(M,O,I,w.uri),I.focus)){const k=this.getPreventScrollOption(I);(x=this._domNode)===null||x===void 0||x.focus({preventScroll:k});const F=this.eventBus.on(E.CodeEditorDidVisibleEvent,L=>{if(L.payload.groupName===this.name&&L.payload.type===E.EditorOpenType.diff){if(F.dispose(),this.disposed||this!==this.workbenchEditorService.currentEditorGroup)return;if(this.currentEditor===this.diffEditor.modifiedEditor)try{this.diffEditor.focus()}catch{}}})}})}async openMergeEditor(w){const{metadata:I}=w;if(!I)return;this.mergeEditor||await this.mergeEditorDomReady.onceReady(()=>{var j;const Q=document.createElement("div");(j=this._mergeEditorDomNode)===null||j===void 0||j.appendChild(Q),this.createMergeEditor(Q)});const{ancestor:R,input1:M,input2:O,output:x}=I,k=_.MergeEditorInputData.from(M),F=_.MergeEditorInputData.from(O),[L,N,U,W]=await Promise.all([this.getDocumentModelRef(v.URI.parse(R)),this.getDocumentModelRef(k.uri),this.getDocumentModelRef(v.URI.parse(x)),this.getDocumentModelRef(F.uri)]);await this.mergeEditorReady.onceReady(async()=>{await this.mergeEditor.open({ancestor:{uri:v.URI.parse(I.ancestor),textModel:L.instance.getMonacoModel(),baseContent:L.instance.baseContent||""},input1:k.setTextModel(N.instance.getMonacoModel()),input2:F.setTextModel(W.instance.getMonacoModel()),output:{uri:v.URI.parse(I.output),textModel:U.instance.getMonacoModel()}})})}async openCustomEditor(w,I){const R=this.editorComponentRegistry.getEditorComponent(I),M=this.editorComponentRegistry.getEditorInitialProps(I);if(R){if(this.activateComponentsProps.set(R,M),R.renderMode===E.EditorComponentRenderMode.ONE_PER_RESOURCE){const O=this.activeComponents.get(R)||[];O.findIndex(k=>k.uri.toString()===w.uri.toString())===-1&&O.push(w),this.activeComponents.set(R,O)}else if(R.renderMode===E.EditorComponentRenderMode.ONE_PER_GROUP)this.activeComponents.set(R,[w]);else if(R.renderMode===E.EditorComponentRenderMode.ONE_PER_WORKBENCH){const O=[];this.workbenchEditorService.editorGroups.forEach(x=>{if(x===this)return;const k=x.resources.find(F=>F.uri.isEqual(w.uri));k&&O.push(x.close(k.uri))}),await Promise.all(O).catch((0,v.getDebugLogger)().error),this.activeComponents.set(R,[w])}}else throw new Error("Cannot find Editor Component with id: "+I);this._onCurrentEditorCursorChange.fire({position:null,selectionLength:0})}async displayResourceComponent(w,I){I.revealRangeInCenter===void 0&&(I.revealRangeInCenter=!0);const R=w,M=await this.resolveOpenType(w,I);if(M){const{activeOpenType:O,openTypes:x}=M;switch(this.availableOpenTypes=x,I.preserveFocus&&(I.focus=!1),O.type){case E.EditorOpenType.code:await this.openCodeEditor(w,I);break;case E.EditorOpenType.diff:await this.openDiffEditor(w,I);break;case E.EditorOpenType.multiDiff:await this.openMultiDiffEditor(w,I);break;case E.EditorOpenType.mergeEditor:await this.openMergeEditor(w);break;case E.EditorOpenType.component:await this.openCustomEditor(w,O.componentId);break;default:return}this.resolveTabChanged(R,this.currentResource),this._currentOpenType=O,this.notifyBodyChanged(),this.doLayoutEditors(),this.cachedResourcesActiveOpenTypes.set(w.uri.toString(),O)}}resolveTabChanged(w,I){if(w!==I)throw new d.EditorTabChangedError}getLastOpenType(w){return this.cachedResourcesActiveOpenTypes.get(w.uri.toString())}async resolveOpenType(w,I){const R=this.cachedResourcesOpenTypes.get(w.uri.toString())||await this.editorComponentRegistry.resolveEditorComponent(w),M=this.preferenceService.get("workbench.editorAssociations"),O=S(R,this.cachedResourcesActiveOpenTypes.get(w.uri.toString()),w,M,I.forceOpenType);return this.cachedResourcesOpenTypes.set(w.uri.toString(),R),{activeOpenType:O,openTypes:R}}async close(w,{treatAsNotCurrent:I,force:R}={}){const M=this.resources.findIndex(O=>O.uri.toString()===w.toString());if(M!==-1){const O=this.resources[M];if(!R&&!await this.shouldClose(O))return!1;if(this.resources.splice(M,1),this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:M}),this.eventBus.fire(new E.EditorGroupCloseEvent({group:this,resource:O})),this.previewURI&&this.previewURI.isEqual(w)&&(this.previewURI=null),O===this.currentResource&&!I){let x;for(;this.resourceOpenHistory.length>0;)if(this.resources.findIndex(k=>k.uri===this.resourceOpenHistory[this.resourceOpenHistory.length-1])!==-1){x=this.resourceOpenHistory.pop();break}else this.resourceOpenHistory.pop();if(x)this.open(x);else{let k=M;for(;k>0&&!this.resources[k];)k--;this.resources[k]?this.open(this.resources[k].uri):this.backToEmpty()}}else this.notifyTabChanged();this.removeResouceFromActiveComponents(O),this.disposeDocumentRef(w)}return this.resources.length===0&&(this.grid.parent&&this.dispose(),this.availableOpenTypes=[]),!0}removeResouceFromActiveComponents(w){this.activeComponents.forEach((I,R)=>{const M=I.indexOf(w);M!==-1&&(I.splice(M,1),this.eventBus.fire(new E.ResoucesOfActiveComponentChangedEvent({component:R,resources:I})))})}async shouldClose(w){const I=this.workbenchEditorService.editorGroups.map(R=>R.resources);if(await this.resourceService.shouldCloseResource(w,I)){let R=0;for(const M of I)for(const O of M)if(O.uri.isEqual(w.uri)&&(R++,R>=2))break;return R<=1&&this.resourceService.disposeResource(w),!0}else return!1}backToEmpty(){const w=this._currentOpenType,I=this._currentResource;this._currentResource=null,this.resetOpenType(),this.notifyTabChanged(),this.notifyBodyChanged(),this._currentOrPreviousFocusedEditor=null,this._onDidEditorFocusChange.fire(),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:w,oldResource:I}))}async closeAll(){for(const I of this.resources)if(!await this.shouldClose(I))return!1;return this.resources.splice(0,this.resources.length).reverse().forEach((I,R)=>{this.clearResourceOnClose(I),this._onDidEditorGroupTabOperation.fire({type:"close",resource:I,index:R})}),this.activeComponents.clear(),this.workbenchEditorService.editorGroups.length>1&&this.dispose(),this.previewURI=null,this.backToEmpty(),!0}async closeSaved(){const w=this.resources.filter(I=>{const R=this.resourceService.getResourceDecoration(I.uri);if(!R||!R.dirty)return!0});for(const I of w)if(!await this.shouldClose(I))return;for(const I of w)await this.close(I.uri)}async closeToRight(w){const I=this.resources.findIndex(R=>R.uri.toString()===w.toString());if(I!==-1){const R=this.resources.slice(I+1);for(const M of R)if(!await this.shouldClose(M))return;this.resources.splice(I+1),R.reverse().forEach((M,O)=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:M,index:I+1+(R.length-1-O)})});for(const M of R)this.clearResourceOnClose(M);this.open(w)}}clearResourceOnClose(w){this.eventBus.fire(new E.EditorGroupCloseEvent({group:this,resource:w})),this.removeResouceFromActiveComponents(w)}async closeOthers(w){const I=this.resources.findIndex(R=>R.uri.toString()===w.toString());if(I!==-1){const R=this.resources.filter((O,x)=>x!==I);for(const O of R)if(!await this.shouldClose(O))return;const M=this.resources;this.resources=[this.resources[I]],R.reverse().forEach(O=>{this._onDidEditorGroupTabOperation.fire({type:"close",resource:O,index:M.indexOf(O)})});for(const O of R)this.clearResourceOnClose(O);await this.open(w)}}get currentResource(){return this._currentResource}get currentOpenType(){return this._currentOpenType}async changeOpenType(w){const I=this.availableOpenTypes.find(M=>M.type===w||M.componentId===w);if(!I||!this.currentResource||D(I,this.currentOpenType))return;const R=this.currentOpenType;await this.displayResourceComponent(this.currentResource,{forceOpenType:I}),this.eventBus.fire(new E.EditorGroupChangeEvent({group:this,newOpenType:this.currentOpenType,newResource:this.currentResource,oldOpenType:R,oldResource:this.currentResource}))}async dropUri(w,I,R,M){if(I!==E.DragOverPosition.CENTER)await this.split((0,a.getSplitActionFromDragDrop)(I),w,{preview:!1,focus:!0});else if(!M)await this.open(w,{preview:!1,focus:!0});else{const O=this.resources.indexOf(M);if(O===-1)await this.open(w,{preview:!1,focus:!0});else{const x=this.resources.findIndex(k=>k.uri.toString()===w.toString());if(x===-1)await this.open(w,{index:O,preview:!1});else{const k=this.resources[x];x>O?(this.resources.splice(x,1),this.resources.splice(O,0,k),this._onDidEditorGroupTabOperation.fire({type:"move",resource:k,oldIndex:x,index:O}),await this.open(w,{preview:!1})):x<O&&(this.resources.splice(O+1,0,k),this.resources.splice(x,1),this._onDidEditorGroupTabOperation.fire({type:"move",resource:k,oldIndex:x,index:O}),await this.open(w,{preview:!1}))}}}R&&(R!==this?await R.close(w):I!==E.DragOverPosition.CENTER&&await this.close(w))}gainFocus(){this.workbenchEditorService.setCurrentGroup(this)}focus(){this.gainFocus(),this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code&&this.codeEditor.focus(),this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff&&this.diffEditor.focus()}dispose(){var w;(w=this.grid)===null||w===void 0||w.dispose(),this.workbenchEditorService.removeGroup(this),super.dispose(),this.codeEditor&&this.codeEditor.dispose(),this.diffEditor&&this.diffEditor.dispose(),this.multiDiffEditor&&this.multiDiffEditor.dispose(),this.toDispose.forEach(I=>I.dispose()),this.eventBus.fire(new E.EditorGroupDisposeEvent({group:this}))}getState(){const w=this.resources.filter(y).map(I=>I.uri.toString());return{uris:w,current:this.currentResource&&y(this.currentResource)?this.currentResource.uri.toString():void 0,previewIndex:this.previewURI?w.indexOf(this.previewURI.toString()):-1}}isCodeEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.code}isDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.diff}isMultiDiffEditorMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.multiDiff}activeEditorIsDirty(){return this.hasDirty()&&this.workbenchEditorService.currentEditorGroup===this}isComponentMode(){return!!this.currentOpenType&&this.currentOpenType.type===E.EditorOpenType.component}async restoreState(w){this._restoringState=!0,this.previewURI=w.uris[w.previewIndex]?new v.URI(w.uris[w.previewIndex]):null;for(const R of w.uris)await this.doOpen(new v.URI(R),{disableNavigate:!0,backend:!0,preview:!1,deletedPolicy:"skip"});let I;w.current?I=new v.URI(w.current):w.uris.length>0&&(I=new v.URI(w.uris[w.uris.length-1])),I&&(await this.open(I,{deletedPolicy:"skip"})||this.resources[0]&&await this.open(this.resources[0].uri)),this._restoringState=!1,this.notifyTabChanged()}async saveAll(w,I){for(const R of this.resources)!w&&R.uri.scheme===v.Schemes.untitled||await this.saveResource(R,I)}async saveResource(w,I=a.SaveReason.Manual){if(await this.saveByOpenType(w,I))return;const R=this.documentModelManager.getModelReference(w.uri);R&&(await R.instance.save(void 0,I),R.dispose())}async saveByOpenType(w,I){const R=this.cachedResourcesActiveOpenTypes.get(w.uri.toString());if(R&&R.saveResource)try{return await R.saveResource(w,I),!0}catch(M){this.logger.error(M)}return!1}async saveCurrent(w=a.SaveReason.Manual){const I=this.currentResource;if(I&&!await this.saveByOpenType(I,w)&&this.currentEditor)return this.currentEditor.save()}hasDirty(){for(const w of this.resources){const I=this.documentModelManager.getModelDescription(w.uri);if(I&&I.dirty)return!0}return!1}calcDirtyCount(w=new Set){let I=0;for(const R of this.resources){const M=this.documentModelManager.getModelDescription(R.uri,"calc-dirty-count");w.has(R.uri.toString())||(w.add(R.uri.toString()),M&&M.dirty&&(I+=1))}return I}componentUndo(){const w=this.currentOpenType;w?.undo&&w.undo(this.currentResource)}componentRedo(){const w=this.currentOpenType;w?.redo&&w.redo(this.currentResource)}toJSON(){return{name:this.name}}attachMultiDiffEditorDom(w){this._multiDiffEditorDomNodeAttached||(this._multiDiffEditorDomNode=w,this.multiDiffEditorDomReady.ready(),this._multiDiffEditorDomNodeAttached=!0)}createMultiDiffEditor(w){const I=this.collectionService.createMultiDiffEditor(w,{},{[o.ServiceNames.CONTEXT_KEY_SERVICE]:this.contextKeyService.contextKeyService});this.multiDiffEditor=I}async openMultiDiffEditor(w,I){this.multiDiffEditor||await this.multiDiffEditorDomReady.onceReady(()=>{var R;const M=document.createElement("div");(R=this._multiDiffEditorDomNode)===null||R===void 0||R.appendChild(M),this.createMultiDiffEditor(M)}),await this.multiDiffEditor.compareMultiple(this.multiDiffEditor,w,I)}};t.EditorGroup=A,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.EditorCollectionService)],A.prototype,"collectionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.ResourceService)],A.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.EditorComponentRegistry)],A.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(a.WorkbenchEditorService),n.__metadata("design:type",b)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(h.IEditorDocumentModelService),n.__metadata("design:type",Object)],A.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(v.CommandService),n.__metadata("design:type",Object)],A.prototype,"commands",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.RecentFilesManager),n.__metadata("design:type",o.RecentFilesManager)],A.prototype,"recentFilesManager",void 0),n.__decorate([(0,r.Autowired)(s.IMessageService),n.__metadata("design:type",Object)],A.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],A.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(v.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,v.OnEvent)(a.ResourceDecorationChangeEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[a.ResourceDecorationChangeEvent]),n.__metadata("design:returntype",void 0)],A.prototype,"onResourceDecorationChangeEvent",null),n.__decorate([(0,v.OnEvent)(E.ResourceOpenTypeChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[E.ResourceOpenTypeChangedEvent]),n.__metadata("design:returntype",Promise)],A.prototype,"oResourceOpenTypeChangedEvent",null),n.__decorate([(0,v.OnEvent)(E.RegisterEditorComponentEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",Promise)],A.prototype,"onRegisterEditorComponentEvent",null),t.EditorGroup=A=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String,Number])],A);function S(T,w,I,R,M){if(M)return T.find(O=>D(O,M))||T[0];if(w)return T.find(O=>D(O,w))||T[0];if(R){const O=T.find(x=>{const k=Object.keys(R).find(N=>(0,v.match)(N,I.uri.path.toString().toLowerCase())||(0,v.match)(N,I.uri.path.base.toLowerCase())),F=k&&R[k];if(!F)return!1;const L=`${v.CUSTOM_EDITOR_SCHEME}-${F}`;return x.componentId===L});if(O)return O}return T[0]}function D(T,w){return T.type===w.type&&(T.type!==E.EditorOpenType.component||T.componentId===w.componentId)}},94180:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarLeftExtraContentId=t.TabbarRightExtraContentId=void 0,t.TabbarRightExtraContentId="tabbar-right-extra-content",t.TabbarLeftExtraContentId="tabbar-left-extra-content"},93107:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IDocPersistentCacheProvider=void 0,t.isDocContentCache=e,t.isDocChangesCache=n,t.parseCacheValueFrom=r,t.IDocPersistentCacheProvider=Symbol("IDocPersistentCacheProvider");function e(o){return o.hasOwnProperty("content")}function n(o){return o.hasOwnProperty("changeMatrix")}function r(o){const l=o.text,_=o.range.startLineNumber,v=o.range.startColumn,p=o.range.endLineNumber,m=o.range.endColumn;return[l,_,v,p,m]}},55113:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AUTO_SAVE_MODE=t.SaveReason=t.Direction=t.EditorGroupSplitAction=t.DragOverPosition=t.EditorOpenType=t.IEditorPriority=t.OverviewRulerLane=t.WorkbenchEditorService=t.DidApplyEditorDecorationFromProvider=t.DidChangeEditorGroupUriEvent=t.CollectionEditorsUpdateEvent=t.EditorCollectionService=t.EditorType=t.ShowLightbulbIconMode=void 0,t.getSimpleEditorOptions=b,t.isTextEditorViewState=A;const n=e(85608),r=e(76003),o=e(43718);var l=e(20868);Object.defineProperty(t,"ShowLightbulbIconMode",{enumerable:!0,get:function(){return l.ShowLightbulbIconMode}});var _;(function(S){S[S.CODE=0]="CODE",S[S.ORIGINAL_DIFF=1]="ORIGINAL_DIFF",S[S.MODIFIED_DIFF=2]="MODIFIED_DIFF",S.MERGE_EDITOR_DIFF="MERGE_EDITOR_DIFF"})(_||(t.EditorType=_={}));let v=class{};t.EditorCollectionService=v,t.EditorCollectionService=v=n.__decorate([(0,r.Injectable)()],v);class p extends o.BasicEvent{}t.CollectionEditorsUpdateEvent=p;class m extends o.BasicEvent{}t.DidChangeEditorGroupUriEvent=m;class s extends o.BasicEvent{}t.DidApplyEditorDecorationFromProvider=s;class g{}t.WorkbenchEditorService=g;var a;(function(S){S[S.Left=1]="Left",S[S.Center=2]="Center",S[S.Right=4]="Right",S[S.Full=7]="Full"})(a||(t.OverviewRulerLane=a={}));var h;(function(S){S.builtin="builtin",S.option="option",S.exclusive="exclusive",S.default="default"})(h||(t.IEditorPriority=h={}));var d;(function(S){S.code="code",S.diff="diff",S.mergeEditor="mergeEditor",S.component="component",S.multiDiff="multiDiff"})(d||(t.EditorOpenType=d={}));var u;(function(S){S.LEFT="left",S.RIGHT="right",S.TOP="top",S.BOTTOM="bottom",S.CENTER="center"})(u||(t.DragOverPosition=u={}));var E;(function(S){S[S.Top=1]="Top",S[S.Bottom=2]="Bottom",S[S.Left=3]="Left",S[S.Right=4]="Right"})(E||(t.EditorGroupSplitAction=E={}));var f;(function(S){S.UP="up",S.DOWN="down",S.LEFT="left",S.RIGHT="right"})(f||(t.Direction=f={}));var c;(function(S){S[S.Manual=1]="Manual",S[S.AfterDelay=2]="AfterDelay",S[S.FocusOut=3]="FocusOut"})(c||(t.SaveReason=c={}));var y;(function(S){S.OFF="off",S.AFTER_DELAY="afterDelay",S.EDITOR_FOCUS_CHANGE="editorFocusChange",S.WINDOWS_LOST_FOCUS="windowLostFocus"})(y||(t.AUTO_SAVE_MODE=y={}));function b(){return{fontSize:12,fontWeight:"normal",lineHeight:0,wordWrap:"on",overviewRulerLanes:0,glyphMargin:!1,lineNumbers:"off",folding:!1,selectOnLineNumbers:!1,hideCursorInOverviewRuler:!0,selectionHighlight:!1,scrollbar:{horizontal:"hidden"},lineDecorationsWidth:0,overviewRulerBorder:!1,scrollBeyondLastLine:!1,renderLineHighlight:"none",fixedOverflowWidgets:!0,acceptSuggestionOnEnter:"smart",minimap:{enabled:!1},guides:{highlightActiveIndentation:!1,indentation:!1,bracketPairs:!1}}}function A(S){const D=S;if(!D)return!1;const T=D;if(T.modified)return A(T.modified);const w=D;return!!(w.contributionsState&&w.viewState&&Array.isArray(w.cursorState))}},23418:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(94180),t),n.__exportStar(e(93107),t),n.__exportStar(e(55113),t),n.__exportStar(e(23950),t),n.__exportStar(e(27693),t),n.__exportStar(e(46225),t),n.__exportStar(e(4308),t),n.__exportStar(e(39467),t)},27693:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ILanguageStatusService=void 0,t.ILanguageStatusService=Symbol("ILanguageStatusService")},23950:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticTag=t.DiagnosticSeverity=t.ILanguageService=void 0,t.asSeverity=l,t.asRelatedInformations=_,t.asRelatedInformation=v,t.asMonacoDiagnostics=p,t.asMonacoDiagnostic=m;const n=e(43718);t.ILanguageService=Symbol("ILanguageService");var r;(function(s){s[s.Error=1]="Error",s[s.Warning=2]="Warning",s[s.Information=3]="Information",s[s.Hint=4]="Hint"})(r||(t.DiagnosticSeverity=r={}));var o;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(o||(t.DiagnosticTag=o={}));function l(s){return s===1?n.MarkerSeverity.Error:s===2?n.MarkerSeverity.Warning:s===3?n.MarkerSeverity.Info:n.MarkerSeverity.Hint}function _(s){if(s)return s.map(g=>v(g))}function v(s){return{resource:n.Uri.parse(s.location.uri),startLineNumber:s.location.range.start.line+1,startColumn:s.location.range.start.character+1,endLineNumber:s.location.range.end.line+1,endColumn:s.location.range.end.character+1,message:s.message}}function p(s){if(s)return s.map(g=>m(g))}function m(s){return{code:typeof s.code=="number"?s.code.toString():typeof s.code=="object"?{value:s.code.value.toString(),target:s.code.target}:s.code,severity:l(s.severity),message:s.message,source:s.source,startLineNumber:s.range.start.line+1,startColumn:s.range.start.character+1,endLineNumber:s.range.end.line+1,endColumn:s.range.end.character+1,relatedInformation:_(s.relatedInformation),tags:s.tags}}},64335:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiDiffEditorItem=t.IMultiDiffSourceResolverService=t.MULTI_DIFF_SCHEME=void 0,t.MULTI_DIFF_SCHEME="multi-diff-editor",t.IMultiDiffSourceResolverService=Symbol("IMultiDiffSourceResolverService");class e{constructor(r,o,l,_){if(this.originalUri=r,this.modifiedUri=o,this.goToFileUri=l,this.contextKeys=_,!r&&!o)throw new Error("Invalid arguments")}getKey(){var r,o;return JSON.stringify([(r=this.modifiedUri)===null||r===void 0?void 0:r.toString(),(o=this.originalUri)===null||o===void 0?void 0:o.toString()])}}t.MultiDiffEditorItem=e},46225:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notebookCellScheme=t.INotebookService=t.CellKind=t.NotebookCellsChangeType=void 0;var e;(function(r){r[r.ModelChange=1]="ModelChange",r[r.Move=2]="Move",r[r.ChangeCellLanguage=5]="ChangeCellLanguage",r[r.Initialize=6]="Initialize",r[r.ChangeCellMetadata=7]="ChangeCellMetadata",r[r.Output=8]="Output",r[r.OutputItem=9]="OutputItem",r[r.ChangeCellContent=10]="ChangeCellContent",r[r.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",r[r.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",r[r.ChangeCellMime=13]="ChangeCellMime",r[r.Unknown=100]="Unknown"})(e||(t.NotebookCellsChangeType=e={}));var n;(function(r){r[r.Markup=1]="Markup",r[r.Code=2]="Code"})(n||(t.CellKind=n={})),t.INotebookService=Symbol("INotebookService"),t.notebookCellScheme="vscode-notebook-cell"},4308:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AskSaveResult=t.DIFF_SCHEME=t.ResourceDecorationNeedChangeEvent=t.ResourceDecorationChangeEvent=t.ResourceRemoveEvent=t.ResourceDidUpdateEvent=t.ResourceNeedUpdateEvent=t.ResourceService=void 0,t.isDiffResource=m;const n=e(43718);class r{}t.ResourceService=r;class o extends n.BasicEvent{}t.ResourceNeedUpdateEvent=o;class l extends n.BasicEvent{}t.ResourceDidUpdateEvent=l;class _ extends n.BasicEvent{}t.ResourceRemoveEvent=_;class v extends n.BasicEvent{}t.ResourceDecorationChangeEvent=v;class p extends n.BasicEvent{}t.ResourceDecorationNeedChangeEvent=p,t.DIFF_SCHEME="diff";function m(g){return g.uri.scheme===t.DIFF_SCHEME}var s;(function(g){g[g.REVERT=1]="REVERT",g[g.SAVE=2]="SAVE",g[g.CANCEL=3]="CANCEL"})(s||(t.AskSaveResult=s={}))},39467:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSplitActionFromDragDrop=r;const n=e(55113);function r(o){return{[n.DragOverPosition.LEFT]:n.EditorGroupSplitAction.Left,[n.DragOverPosition.RIGHT]:n.EditorGroupSplitAction.Right,[n.DragOverPosition.BOTTOM]:n.EditorGroupSplitAction.Bottom,[n.DragOverPosition.TOP]:n.EditorGroupSplitAction.Top}[o]}},54414:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(23418),t)},32595:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerContribution=t.EXPLORER_CONTAINER_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(30144);Object.defineProperty(t,"EXPLORER_CONTAINER_ID",{enumerable:!0,get:function(){return l.EXPLORER_CONTAINER_ID}});const _=e(21634),v=e(68456),p=e(43718);let m=class{registerComponent(g){g.register("@opensumi/ide-explorer",[],{iconClass:(0,o.getIcon)("explorer"),title:(0,o.localize)("explorer.title"),priority:10,containerId:l.EXPLORER_CONTAINER_ID,activateKeyBinding:"ctrlcmd+shift+e"})}onStart(){this.extensionsSchemaService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:l.EXPLORER_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{..._.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("explorer.title"))}})}};t.ExplorerContribution=m,n.__decorate([(0,r.Autowired)(p.IExtensionsSchemaService),n.__metadata("design:type",Object)],m.prototype,"extensionsSchemaService",void 0),t.ExplorerContribution=m=n.__decorate([(0,o.Domain)(o.ClientAppContribution,v.ComponentContribution)],m)},59027:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExplorerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32595);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[l.ExplorerContribution]}};t.ExplorerModule=_,t.ExplorerModule=_=n.__decorate([(0,r.Injectable)()],_)},18531:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressFileServerContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(32242),_=e(90242);let v=class{registerStaticResolver(m){m.registerStaticResourceProvider({scheme:o.Schemes.file,resolveStaticResource:s=>{const g=new o.URI(this.appConfig.staticServicePath||_.EXPRESS_SERVER_PATH),[a,h]=s.codeUri.path.split("?");return g.resolve(`assets${decodeURIComponent(a)}`).withQuery(h)},roots:[this.appConfig.staticServicePath||_.EXPRESS_SERVER_PATH]})}};t.ExpressFileServerContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"appConfig",void 0),t.ExpressFileServerContribution=v=n.__decorate([(0,o.Domain)(l.StaticResourceContribution)],v)},98885:(P,t,e)=>{"use strict";var n;n={value:!0},t.Q=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(18531);let v=class extends l.BrowserModule{constructor(){super(...arguments),this.providers=[_.ExpressFileServerContribution]}};t.Q=v,t.Q=v=r.__decorate([(0,o.Injectable)()],v)},90242:(P,t,e)=>{"use strict";var n=e(39907);Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_MIME=t.EXPRESS_SERVER_PATH=t.EXPRESS_SERVER_PORT=void 0,t.EXPRESS_SERVER_PORT=8e3,t.EXPRESS_SERVER_PATH=n.env.STATIC_SERVER_PATH||`http://127.0.0.1:${t.EXPRESS_SERVER_PORT}/`,t.ALLOW_MIME={gif:"image/gif",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"image/svg+xml",ttf:"font/ttf",eot:"font/eot",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",js:"application/javascript",css:"text/css",mp4:"video/mp4",ogg:"video/ogg",webm:"video/webm"}},21082:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_SCHEME=t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=void 0;const n=e(30144);t.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID=n.EXTENSION_CONTAINER_ID,t.EXTENSION_SCHEME="extension"},6449:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionOverview=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(68974),_=e(95422),v=e(43718),p=e(93374),m=e(29150),s=n.__importDefault(e(40769));var g;(function(d){d.details="Details",d.changelog="ChangeLog",d.deps="Dependencies"})(g||(g={}));const a=[g.details,g.changelog,g.deps],h=({resource:d})=>{var u,E,f,c,y,b,A,S,D,T,w,I,R,M,O,x,k,F,L,N,U,W,j,Q,G;const Z=(0,_.useInjectable)(m.VSXExtensionServiceToken),[$,V]=(0,r.useState)(!0),[H,K]=(0,r.useState)(((u=d.metadata)===null||u===void 0?void 0:u.state)===m.InstallState.INSTALLED?4:0),[Y,X]=(0,r.useState)(g.details),[re,oe]=(0,r.useState)({}),he=(0,r.useCallback)(te=>{const fe=a[te];fe&&X(fe)},[]),me=(0,r.useCallback)(async()=>{var te;const fe=await Z.getRemoteRawExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);if(fe){const Oe=["readme","changelog"].map(Be=>{var De,_e;const Ne=(De=fe.files)===null||De===void 0?void 0:De[Be];return Ne?fetch(Ne).then(Te=>Te.text()):(_e=fe[Be])!==null&&_e!==void 0?_e:""}),[Me,Pe]=await Promise.all(Oe);oe({readme:Me,changelog:Pe,downloadCount:fe.downloadCount})}V(!1)},[d]),q=(0,r.useCallback)(async()=>{var te;const fe=await Z.getLocalExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);fe&&(K(1),Z.install(fe).finally(()=>{K(4)}))},[d]),ye=(0,r.useCallback)(async()=>{var te;const fe=await Z.getLocalExtension((te=d.metadata)===null||te===void 0?void 0:te.extensionId);fe&&(K(2),Z.uninstall(fe).finally(()=>{K(3)}))},[d]);(0,r.useEffect)(()=>{me()},[d]);const ge=(0,r.useMemo)(()=>{var te,fe,Oe;const Me=[];if(((te=d.metadata)===null||te===void 0?void 0:te.state)!==m.InstallState.NOT_INSTALLED)if(H!==3)Me.push(r.default.createElement(o.Button,{size:"small",key:"uninstall",onClick:ye,disabled:H===2},(0,v.localize)(H===2?"marketplace.extension.uninstalling":"marketplace.extension.uninstall")));else return Me.push(r.default.createElement(o.Button,{size:"small",key:"uninstalled",disabled:!0},(0,v.localize)("marketplace.extension.uninstalled"))),Me;return((fe=d.metadata)===null||fe===void 0?void 0:fe.state)===m.InstallState.NOT_INSTALLED?H===4?Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"install",onClick:q,disabled:H!==0},(0,v.localize)(H===1?"marketplace.extension.installing":"marketplace.extension.install"))):((Oe=d.metadata)===null||Oe===void 0?void 0:Oe.state)===m.InstallState.SHOULD_UPDATE?H===4?Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"update",onClick:q,disabled:H!==0},(0,v.localize)(H===1?"marketplace.extension.updating":"marketplace.extension.update"))):Me.push(r.default.createElement(o.Button,{size:"small",key:"installed",disabled:!0},(0,v.localize)("marketplace.extension.installed"))),Me},[d,H]);return r.default.createElement("div",{className:s.default.extension_overview_container},r.default.createElement(l.Progress,{loading:$}),r.default.createElement("div",{className:s.default.extension_overview_header},!((E=d.metadata)===null||E===void 0)&&E.iconUrl?r.default.createElement("img",{src:(f=d.metadata)===null||f===void 0?void 0:f.iconUrl,alt:(0,v.replaceLocalizePlaceholder)((c=d.metadata)===null||c===void 0?void 0:c.displayName,(y=d.metadata)===null||y===void 0?void 0:y.extensionId)}):r.default.createElement("div",{className:s.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:s.default.extension_detail},r.default.createElement("div",{className:s.default.extension_name},r.default.createElement("h1",null,r.default.createElement("a",{href:`${(b=d.metadata)===null||b===void 0?void 0:b.openVSXRegistry}/extension/${(A=d.metadata)===null||A===void 0?void 0:A.namespace.toLowerCase()}/${(S=d.metadata)===null||S===void 0?void 0:S.name.toLowerCase()}`,target:"_blank",rel:"noopener noreferrer"},(0,v.replaceLocalizePlaceholder)((D=d.metadata)===null||D===void 0?void 0:D.displayName,(T=d.metadata)===null||T===void 0?void 0:T.extensionId)||((w=d.metadata)===null||w===void 0?void 0:w.name))),r.default.createElement("span",{className:s.default.extension_id},((I=d.metadata)===null||I===void 0?void 0:I.namespace.toLowerCase())+"."+((R=d.metadata)===null||R===void 0?void 0:R.name.toLowerCase()))),r.default.createElement("div",{className:s.default.manifest},r.default.createElement("span",null,r.default.createElement("a",{href:(M=d.metadata)===null||M===void 0?void 0:M.namespaceUrl,target:"_blank",rel:"noopener noreferrer"},(O=d.metadata)===null||O===void 0?void 0:O.namespace)),r.default.createElement("span",null,r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),((x=d.metadata)===null||x===void 0?void 0:x.downloadCount)||re.downloadCount),((k=d.metadata)===null||k===void 0?void 0:k.averageRating)&&r.default.createElement("span",null,(F=d.metadata)===null||F===void 0?void 0:F.averageRating),((L=d.metadata)===null||L===void 0?void 0:L.repository)&&r.default.createElement("span",null,r.default.createElement("a",{href:(N=d.metadata)===null||N===void 0?void 0:N.repository,target:"blank"},"Repository")),((U=d.metadata)===null||U===void 0?void 0:U.license)&&r.default.createElement("span",null,r.default.createElement("a",{href:(W=d.metadata)===null||W===void 0?void 0:W.files.license,target:"blank"},"License")),r.default.createElement("span",null,"v",(j=d.metadata)===null||j===void 0?void 0:j.version)),r.default.createElement("div",{className:s.default.description},(0,v.replaceLocalizePlaceholder)((Q=d.metadata)===null||Q===void 0?void 0:Q.description,(G=d.metadata)===null||G===void 0?void 0:G.extensionId)),r.default.createElement("div",{className:s.default.buttons},ge))),r.default.createElement("div",{className:s.default.extension_overview_body},r.default.createElement(o.Tabs,{className:s.default.tabs,value:Y,onChange:he,tabs:[g.details,g.changelog]}),r.default.createElement("div",{className:s.default.extension_content},Y===g.details&&re.readme&&r.default.createElement(p.Markdown,{content:re.readme}),Y===g.changelog&&re.changelog&&r.default.createElement(p.Markdown,{content:re.changelog}))))};t.ExtensionOverview=h},87791:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=t.ExtensionViewType=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(43718),v=e(29150),p=n.__importDefault(e(90425));var m;(function(s){s[s.MARKETPLACE=0]="MARKETPLACE",s[s.INSTALLED=1]="INSTALLED"})(m||(t.ExtensionViewType=m={})),t.Extension=r.default.memo(({extension:s,onInstall:g,onClick:a,type:h,installedExtensions:d,openVSXRegistry:u})=>{const E=(0,l.useDesignStyles)(p.default.extension_item,"extension_item"),[f,c]=(0,r.useState)(),y=d?.find(I=>I.namespace===s.namespace&&I.name===s.name),b=!!(h===m.INSTALLED||y),A=b&&h===m.MARKETPLACE&&y?.version!==s.version,[S,D]=(0,r.useState)(b),T=(0,r.useCallback)(I=>{I.stopPropagation(),c(!0),g(s).then(()=>{c(!1),D(!0)})},[s]),w=(0,r.useCallback)(()=>{a(s,S?A?v.InstallState.SHOULD_UPDATE:v.InstallState.INSTALLED:v.InstallState.NOT_INSTALLED)},[s]);return r.default.createElement("div",{className:E,onClick:w},s.iconUrl?r.default.createElement("img",{className:p.default.icon,src:s.iconUrl,alt:(0,_.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)}):r.default.createElement("div",{className:p.default.default_icon},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("extension")})),r.default.createElement("div",{className:p.default.extension_detail},r.default.createElement("div",{className:p.default.base_info},r.default.createElement("span",{className:p.default.display_name},(0,_.replaceLocalizePlaceholder)(s.displayName,`${s.publisher}.${s.name}`)||s.name),r.default.createElement("span",{className:p.default.version},s.version),!S&&r.default.createElement("span",{className:p.default.download_count},r.default.createElement(o.Icon,{iconClass:(0,o.getIcon)("download")}),s.downloadCount)),r.default.createElement("span",{className:p.default.description},(0,_.replaceLocalizePlaceholder)(s.description,`${s.publisher}.${s.name}`)),r.default.createElement("div",{className:p.default.footer},r.default.createElement("span",{className:p.default.namespace},s.namespace),h===m.MARKETPLACE&&(b?A?r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:f},(0,_.localize)(f?"marketplace.extension.updating":"marketplace.extension.update")):r.default.createElement("span",{className:p.default.state_text},(0,_.localize)("marketplace.extension.installed")):r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:f},(0,_.localize)(f?"marketplace.extension.installing":"marketplace.extension.install"))),h===m.INSTALLED&&r.default.createElement(o.Button,{type:"primary",size:"small",onClick:T,disabled:!0},(0,_.localize)("marketplace.extension.installed")))))})},38105:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpenVsxExtensionManagerModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29150),_=e(70274),v=e(67761);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.VSXExtensionContribution,{token:l.VSXExtensionServiceToken,useClass:v.VSXExtensionService}],this.backServices=[{servicePath:l.VSXExtensionServicePath}]}};t.OpenVsxExtensionManagerModule=p,t.OpenVsxExtensionManagerModule=p=n.__decorate([(0,r.Injectable)()],p)},70274:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(57517),v=e(63067),p=e(52416),m=e(29150),s=e(21082),g=e(6449),a=e(73689);let h=class{initialize(){}onDidRender(){const u=this.mainLayoutService.getTabbarHandler(s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID);u&&(u.isActivated()?this.vsxExtensionService.getOpenVSXRegistry().then(()=>{this.vsxExtensionService.search("")}):u.onActivate(async()=>{!this.vsxExtensionService.openVSXRegistry&&await this.vsxExtensionService.getOpenVSXRegistry(),this.vsxExtensionService.search("")}))}registerResource(u){u.registerResourceProvider({scheme:s.EXTENSION_SCHEME,provideResource:async E=>{const{extensionId:f,state:c}=E.getParsedQuery(),y=await this.vsxExtensionService.getLocalExtension(f),b=this.iconService.fromIcon("",y?.iconUrl,p.IconType.Background);return{uri:E,metadata:{...y,extensionId:f,state:c,openVSXRegistry:this.vsxExtensionService.openVSXRegistry},icon:b||(0,o.getIcon)("extension"),name:(0,l.replaceLocalizePlaceholder)(y?.displayName,f)||""}}})}registerEditorComponent(u){const E=`${s.EXTENSION_SCHEME}_detail`;u.registerEditorComponent({component:g.ExtensionOverview,uid:E,scheme:s.EXTENSION_SCHEME}),u.registerEditorComponentResolver(s.EXTENSION_SCHEME,(f,c,y)=>{y?.([{type:_.EditorOpenType.component,componentId:E}])})}registerComponent(u){u.register("@opensumi/ide-extension-manager",[],{iconClass:(0,o.getIcon)("extension"),title:(0,l.localize)("marketplace.extension.container"),priority:5,containerId:s.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,component:a.VSXExtensionView,activateKeyBinding:"ctrlcmd+shift+x"})}};t.VSXExtensionContribution=h,n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],h.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(m.VSXExtensionServiceToken),n.__metadata("design:type",Object)],h.prototype,"vsxExtensionService",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],h.prototype,"iconService",void 0),t.VSXExtensionContribution=h=n.__decorate([(0,l.Domain)(o.ClientAppContribution,v.MainLayoutContribution,o.ComponentContribution,_.BrowserEditorContribution)],h)},67761:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57517),_=e(98453),v=e(71354),p=e(28423),m=e(52416),s=e(12456),g=e(29150);let a=class extends o.Disposable{get extensions(){return this.extensionsObservable.get()}get installedExtensions(){return this.installedExtensionsObservable.get()}get openVSXRegistry(){return this.openVSXRegistryObservable.get()}constructor(){super(),this.extensionsObservable=(0,p.observableValue)(this,[]),this.installedExtensionsObservable=(0,p.observableValue)(this,[]),this.openVSXRegistryObservable=(0,p.observableValue)(this,""),this.tasks=new Map,this.getInstalledExtensions(),this.disposables.push(this.extensionInstanceService.onDidChange(()=>{this.getInstalledExtensions(),this.search(this.searchValue)}))}updateStatusBar(){if(this.tasks.size===0){this.installStatus&&(this.installStatus.dispose(),this.installStatus=void 0);return}const d="sumi-upload-file-status";if(this.tasks.size===1){const u=(0,o.localize)("marketplace.extension.installing"),E={text:u,alignment:o.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.installStatus=this.statusBarService.addElement(d,E)}}async install(d){var u,E;const f=this.getExtensionId(d);if(this.tasks.has(f)||!d.downloadUrl)return;const c=this.backService.install({id:f,name:(u=d.name)!==null&&u!==void 0?u:"-",url:d.downloadUrl,version:(E=d.version)!==null&&E!==void 0?E:"-"});return this.tasks.set(f,c),this.updateStatusBar(),c.then(async y=>{if(this.tasks.delete(f),this.updateStatusBar(),await this.extensionManagementService.postChangedExtension(!1,y),this.themeService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}if(this.iconService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.ICON_THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}if(this.productIconService.getAvailableThemeInfos().some(D=>D.extensionId===d.originId)){this.commandService.executeCommand(s.PRODUCT_ICON_THEME_TOGGLE_COMMAND.id,{extensionId:d.originId});return}})}async uninstall(d){d&&d.path&&await this.extensionManagementService.postUninstallExtension(d.path)}async disable(d){d&&d.path&&this.extensionManagementService.postDisableExtension(d.path)}async enable(d){d&&d.path&&this.extensionManagementService.postEnableExtension(d.path)}getExtensionId(d){var u,E,f;return(u=d?.extensionId)!==null&&u!==void 0?u:((E=d?.namespace)===null||E===void 0?void 0:E.toLowerCase())+"."+((f=d?.name)===null||f===void 0?void 0:f.toLowerCase())}async getLocalExtension(d){return d?this.extensions.find(E=>this.getExtensionId(E)===d)||this.installedExtensions.find(E=>this.getExtensionId(E)===d):void 0}async getRemoteRawExtension(d){if(!d)return;const u={extensionId:d},E=await this.backService.getExtension(u);if(E&&E.extensions&&E.extensions.length>=1)return Object.assign({},E.extensions[0])}async getOpenVSXRegistry(){const d=await this.backService.getOpenVSXRegistry();(0,p.transaction)(u=>{this.openVSXRegistryObservable.set(d,u)})}async openExtensionEditor(d,u){this.workbenchEditorService.open(new o.URI(`extension://?extensionId=${d}&state=${u}`),{preview:!0})}async search(d){const u={query:d,size:50,sortBy:"downloadCount"};this.searchValue=d;const E=await this.backService.search(u);E.extensions&&(0,p.transaction)(f=>{this.extensionsObservable.set(E.extensions.filter(c=>!this.installedExtensions.find(y=>this.getExtensionId(y)===this.getExtensionId(c))).map(c=>({...c,publisher:c.namespace,iconUrl:c.files.icon,downloadUrl:c.files.download,readme:c.files.readme})),f)})}async searchInstalledExtensions(d){(0,p.transaction)(u=>{const E=this.installedExtensions;this.installedExtensionsObservable.set(E.sort((f,c)=>{const y=(0,o.fuzzyScore)(d,d.toLowerCase(),0,f.name,f.name.toLowerCase(),0,!0),b=(0,o.fuzzyScore)(d,d.toLowerCase(),0,c.name,c.name.toLowerCase(),0,!0);return y?b?b[0]-y[0]:-1:1}),u)})}getInstalledExtensions(){const d=this.extensionInstanceService.getExtensionInstances().map(u=>{const E=u.extensionId;return{namespace:E&&E.includes(".")?E.split(".")[0]:u.packageJSON.publisher,name:u.packageJSON.name,id:u.extensionId,version:u.packageJSON.version,displayName:u.packageJSON.displayName,description:u.packageJSON.description,publisher:u.packageJSON.publisher,iconUrl:u.packageJSON.icon&&u.extensionLocation.toString()+`/${u.packageJSON.icon}`,path:u.path,realpath:u.realPath}});(0,p.transaction)(u=>{this.installedExtensionsObservable.set(d,u)})}};t.VSXExtensionService=a,n.__decorate([(0,r.Autowired)(g.VSXExtensionServicePath),n.__metadata("design:type",Object)],a.prototype,"backService",void 0),n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],a.prototype,"extensionInstanceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.ExtensionManagementService)],a.prototype,"extensionManagementService",void 0),n.__decorate([(0,r.Autowired)(m.IThemeService),n.__metadata("design:type",Object)],a.prototype,"themeService",void 0),n.__decorate([(0,r.Autowired)(m.IIconService),n.__metadata("design:type",Object)],a.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(m.IProductIconService),n.__metadata("design:type",Object)],a.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],a.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IStatusBarService),n.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),n.__decorate([(0,o.pMemoize)(h=>h),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",Promise)],a.prototype,"search",null),t.VSXExtensionService=a=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],a)},73689:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSXExtensionView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importStar(e(14041)),l=e(14041),_=e(97267),v=e(41869),p=e(68974),m=e(43718),s=e(5567),g=e(29150),a=e(21082),h=e(87791),d=n.__importDefault(e(68143)),u=[g.TabActiveKey.MARKETPLACE,g.TabActiveKey.INSTALLED],E=()=>{const[f,c]=(0,l.useState)(g.TabActiveKey.MARKETPLACE),[y,b]=(0,l.useState)(!1),A=(0,v.useInjectable)(g.VSXExtensionServiceToken),S=(0,v.useAutorun)(A.extensionsObservable),D=(0,v.useAutorun)(A.installedExtensionsObservable),T=(0,v.useAutorun)(A.openVSXRegistryObservable),w=(0,r.default)(O=>{b(!0);let x;f===g.TabActiveKey.MARKETPLACE?x=A.search(O):x=A.searchInstalledExtensions(O),typeof x=="object"&&x.then&&x.then(()=>{b(!1)})},500),I=(0,l.useCallback)(O=>A.install(O),[]),R=(0,l.useCallback)((O,x)=>{const k=A.getExtensionId(O);A.openExtensionEditor(k,x)},[]),M=(0,l.useCallback)(O=>{const x=u[O];x&&c(x)},[]);return o.createElement("div",{className:d.default.panel},o.createElement(_.Tabs,{mini:!0,className:d.default.tabs,value:u.indexOf(f),onChange:M,tabs:[(0,m.localize)("marketplace.panel.tab.marketplace"),(0,m.localize)("marketplace.tab.installed")]}),o.createElement("div",{style:{padding:"8px"}},o.createElement(s.AutoFocusedInput,{containerId:a.OPEN_VSX_EXTENSION_MANAGER_CONTAINER_ID,placeholder:(0,m.localize)("marketplace.panel.tab.placeholder.search"),value:"",onChange:O=>w(O.target.value)})),f===g.TabActiveKey.MARKETPLACE&&o.createElement("div",{className:d.default.extensions_view},o.createElement(p.Progress,{loading:y}),S.map((O,x)=>o.createElement(h.Extension,{key:`${x}:${O.namespace}-${O.name}`,onClick:R,onInstall:I,extension:O,type:h.ExtensionViewType.MARKETPLACE,installedExtensions:D,openVSXRegistry:T}))),f===g.TabActiveKey.INSTALLED&&o.createElement("div",{className:d.default.extensions_view},D.map((O,x)=>o.createElement(h.Extension,{key:`${x}:${O.namespace}-${O.name}`,onClick:R,onInstall:I,extension:O,type:h.ExtensionViewType.INSTALLED,openVSXRegistry:T}))))};t.VSXExtensionView=E},29150:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IOpenvsxMarketplaceService=t.VSXExtensionServicePath=t.VSXExtensionServiceToken=t.VSXExtension=t.InstallState=t.TabActiveKey=t.EnableScope=void 0;var e;(function(l){l.GLOBAL="GLOBAL",l.WORKSPACE="WORKSPACE"})(e||(t.EnableScope=e={}));var n;(function(l){l.MARKETPLACE="marketplace",l.INSTALLED="installed"})(n||(t.TabActiveKey=n={}));var r;(function(l){l.INSTALLED="INSTALLED",l.NOT_INSTALLED="NOT_INSTALLED",l.SHOULD_UPDATE="SHOULD_UPDATE"})(r||(t.InstallState=r={}));class o{}t.VSXExtension=o,o.KEYS=new Set(["version","iconUrl","publisher","name","displayName","description","averageRating","downloadCount","downloadUrl","readmeUrl","licenseUrl","repository","license","readme","preview","namespaceAccess","publishedBy"]),t.VSXExtensionServiceToken=Symbol("VSXExtensionSerivceToken"),t.VSXExtensionServicePath="VSXExtensionServicePath",t.IOpenvsxMarketplaceService=Symbol("IOpenvsxMarketplaceService")},53599:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageContribution=t.ExtensionStorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93584),_=e(7446),v=e(16132),p=e(10207),m=e(19227);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IExtensionStorageService,useClass:p.ExtensionStorageService},{token:l.IExtensionStoragePathServer,useClass:v.ExtensionStoragePathServer},{token:l.IExtensionStorageServer,useClass:_.ExtensionStorageServer},g]}};t.ExtensionStorageModule=s,t.ExtensionStorageModule=s=n.__decorate([(0,o.Domain)(m.name)],s);let g=class{onReconnect(){this.extensionStorageService.reConnectInit()}};t.ExtensionStorageContribution=g,n.__decorate([(0,r.Autowired)(l.IExtensionStorageService),n.__metadata("design:type",Object)],g.prototype,"extensionStorageService",void 0),t.ExtensionStorageContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],g),n.__exportStar(e(10207),t)},16132:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(96405),v=e(14951),p=e(73344),m=e(51500),{Path:s}=l.path;let g=class{constructor(){this.windowsDataFolders=[l.StoragePaths.WINDOWS_APP_DATA_DIR,l.StoragePaths.WINDOWS_ROAMING_DIR],this.deferredWorkspaceStoragePath=new l.Deferred,this.deferredStoragePath=new l.Deferred,this.storagePathInitialized=!1}get workspaceSuffixName(){return this.appConfig.workspaceSuffixName||m.DEFAULT_WORKSPACE_SUFFIX_NAME}async provideHostLogPath(){const h=await this.getLogsDirPath();if(!h)throw new Error("Unable to get parent log directory");const d=h,u=l.URI.file(d).toString();return await this.fileSystem.access(u)||await this.fileSystem.createFolder(u),new l.URI(h)}async provideHostStoragePath(h,d,u){const E=await this.getWorkspaceStorageDirPath(u);if(!E)throw new Error("Unable to get parent storage directory");await this.fileSystem.access(l.URI.file(E).toString())||await this.fileSystem.createFolder(l.URI.file(E).toString());const f=await this.buildWorkspaceId(h,d,u),c=new s(E).join(f).toString();await this.fileSystem.access(l.URI.file(c).toString())||await this.fileSystem.createFolder(l.URI.file(c).toString());const y=new l.URI(c);return this.storagePathInitialized||(this.deferredWorkspaceStoragePath.resolve(y.path.toString()),this.deferredStoragePath.resolve(E),this.storagePathInitialized=!0),this.cachedStoragePath=y}async getLastWorkspaceStoragePath(){var h;return this.storagePathInitialized?(h=this.cachedStoragePath)===null||h===void 0?void 0:h.path.toString():this.deferredWorkspaceStoragePath.promise}async getLastStoragePath(){return this.deferredStoragePath.promise}doHash(h){return this.hashCalculateService.calculate(h)}async buildWorkspaceId(h,d,u){const E=await this.getUserHomeDir(),f=b=>b.resolve(u||m.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${m.UNTITLED_WORKSPACE}.${this.workspaceSuffixName}`).withScheme(l.Schemes.file),c=b=>b.resolve(u||m.WORKSPACE_USER_STORAGE_FOLDER_NAME).resolve(`${m.UNTITLED_WORKSPACE}`).withScheme(l.Schemes.file);if(!h){const b=c(new l.URI(E));return this.doHash(b.toString())}if(f(new l.URI(E)).toString()===h.uri){const b=d.map(A=>A.uri).sort().join(",");return this.doHash(b)}else{const b=new l.URI(h.uri);return this.doHash(b.toString())}}async getLogsDirPath(){const h=await this.loggerManager.getLogFolder();return new s(h).join(l.StoragePaths.EXTENSIONS_LOGS_DIR).toString()}async getWorkspaceStorageDirPath(h){const d=await this.getWorkspaceDataDirPath(h);return new s(d).join(l.StoragePaths.EXTENSIONS_WORKSPACE_STORAGE_DIR).toString()}async getWorkspaceDataDirPath(h){const d=await this.getUserHomeDir(),u=h;return new s(d).join(...l.isWindows?this.windowsDataFolders:[""],u).toString()}async getUserHomeDir(){const h=await this.fileSystem.getCurrentUserHome();if(!h)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(h.uri)}};t.ExtensionStoragePathServer=g,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.ILoggerManagerClient),n.__metadata("design:type",Object)],g.prototype,"loggerManager",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(_.IHashCalculateService),n.__metadata("design:type",Object)],g.prototype,"hashCalculateService",void 0),t.ExtensionStoragePathServer=g=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],g)},7446:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageServer=void 0;const r=e(85608),o=e(76003),l=e(43718),_=e(14951),v=e(93584),{Path:p}=l.path;let m=n=class{constructor(){this.deferredWorkspaceDataDirPath=new l.Deferred,this.storageThrottler=new l.Throttler,this.storageTasks={},this.storageExistPromises=new Map}async init(g,a,h){return this.storageDelayer=new l.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),await this.setupDirectories(g,a,h||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME)}async asAccess(g,a){if(a)return await this.fileSystem.access(g);if(!this.storageExistPromises.has(g)){const h=this.fileSystem.access(g);this.storageExistPromises.set(g,h)}return await this.storageExistPromises.get(g)}async setupDirectories(g,a,h){const d=await this.extensionStoragePathsServer.getWorkspaceDataDirPath(h),u=l.URI.file(d).toString();await this.fileSystem.access(u)||await this.fileSystem.createFolder(u),this.workspaceDataDirPath=d,this.globalDataPath=new p(this.workspaceDataDirPath).join(l.StoragePaths.EXTENSIONS_GLOBAL_STORAGE_DIR).toString();const E=l.URI.file(this.globalDataPath).toString();await this.fileSystem.access(E)||await this.fileSystem.createFolder(E),this.deferredWorkspaceDataDirPath.resolve(this.workspaceDataDirPath);const f=await this.extensionStoragePathsServer.provideHostLogPath(),c=await this.extensionStoragePathsServer.provideHostStoragePath(g,a,h);return{logUri:f.codeUri,storageUri:c.codeUri,globalStorageUri:l.Uri.file(this.globalDataPath)}}async resolveStorageTask(g){const a=Object.keys(g);for(const h of a){const d=await this.readFromFile(h);for(const{key:u,value:E}of g[h])E===void 0||(0,l.isEmptyObject)(E)?delete d[u]:d[u]=E;await this.writeToFile(h,d)}}doSet(){const g={...this.storageTasks};return this.storageTasks={},this.resolveStorageTask(g)}async set(g,a,h){const d=await this.getDataPath(h);if(!d)throw new Error("Cannot save data: no opened workspace");return this.storageTasks[d]||(this.storageTasks[d]=[]),this.storageTasks[d].push({key:g,value:a}),this.storageDelayer.trigger(()=>this.storageThrottler.queue(this.doSet.bind(this)))}async get(g,a){const h=await this.getDataPath(a);return h?(await this.readFromFile(h))[g]:{}}async getAll(g){const a=await this.getDataPath(g);return a?await this.readFromFile(a):{}}async getDataPath(g){if(this.workspaceDataDirPath===void 0&&await this.deferredWorkspaceDataDirPath.promise,g)return new p(this.globalDataPath).join("global-state.json").toString();{const a=await this.extensionStoragePathsServer.getLastWorkspaceStoragePath();return a?new p(a).join("workspace-state.json").toString():void 0}}async readFromFile(g){const a=l.URI.file(g);if(!await this.asAccess(a.toString(),!0))return{};try{const{content:d}=await this.fileSystem.readFile(a.toString());return JSON.parse(d.toString())}catch(d){return this.logger.error('Failed to parse data from "',a.toString(),'". Reason:',d),{}}}async writeToFile(g,a){const h=l.URI.file(g);await this.asAccess(h.parent.toString())||await this.fileSystem.createFolder(h.parent.toString());const u=JSON.stringify(a);let E=await this.fileSystem.getFileStat(h.toString());E||(E=await this.fileSystem.createFile(h.toString())),await this.fileSystem.setContent(E,u)}};t.ExtensionStorageServer=m,m.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(v.IExtensionStoragePathServer),r.__metadata("design:type",Object)],m.prototype,"extensionStoragePathsServer",void 0),r.__decorate([(0,o.Autowired)(_.IFileServiceClient),r.__metadata("design:type",Object)],m.prototype,"fileSystem",void 0),r.__decorate([(0,o.Autowired)(l.ILogger),r.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.ExtensionStorageServer=m=n=r.__decorate([(0,o.Injectable)()],m)},10207:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionStorageService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(51500),v=e(93584);let p=class{constructor(){this._init=this.init(),this.updateEnvState()}get whenReady(){return this._init}get extensionStoragePath(){return this._extensionStoragePath}async init(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,a=this.appConfig.extensionStorageDirName||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,a),this._extensionStoragePath}async updateEnvState(){await this.get(l.firstSessionDateStorageKey,!0)===void 0&&await this.set(l.firstSessionDateStorageKey,{date:new Date().toUTCString()},!0)}set(s,g,a){return this.extensionStorageServer.set(s,g,a)}get(s,g){return this.extensionStorageServer.get(s,g)}getAll(s=!1){return this.extensionStorageServer.getAll(s)}async reConnectInit(){const s=await this.workspaceService.roots,g=this.workspaceService.workspace,a=this.appConfig.extensionStorageDirName||v.DEFAULT_EXTENSION_STORAGE_DIR_NAME;return this._extensionStoragePath=await this.extensionStorageServer.init(g,s,a),this._extensionStoragePath}};t.ExtensionStorageService=p,n.__decorate([(0,r.Autowired)(v.IExtensionStorageServer),n.__metadata("design:type",Object)],p.prototype,"extensionStorageServer",void 0),n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),t.ExtensionStorageService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},93584:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(85853),t),n.__exportStar(e(56969),t),n.__exportStar(e(23618),t)},85853:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=t.IExtensionStoragePathServer=void 0,t.IExtensionStoragePathServer=Symbol("IExtensionStoragePathServer"),t.DEFAULT_EXTENSION_STORAGE_DIR_NAME=".sumi"},56969:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IExtensionStorageService=t.IExtensionStorageServer=void 0,t.IExtensionStorageServer=Symbol("ExtensionStorageServer"),t.IExtensionStorageService=Symbol("ExtensionStorageService")},23618:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50492:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(93584),t)},57962:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivationEventServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(80076)),o=e(76003),l=e(43718);let _=class{constructor(){this.eventListeners=new Map,this.collectTopicData=new l.MultiMap,this.wildCardTopics=new Set,this.activatedEventSet=new Set,this.wildCardTopics.add("workspaceContains")}getTopicsData(p){return this.collectTopicData.get(p)||[]}async fireEvent(p,m=""){this.activatedEventSet.add(JSON.stringify({topic:p,data:m}));let s;if(this.wildCardTopics.has(p)?s=this.eventListeners.get(p):this.eventListeners.has(p)?s=this.eventListeners.get(p):s=this.eventListeners.get(p+":"+m),s){const g=await Promise.allSettled(s.map(a=>this.tryRun(p,m,a)));for(const a of g)a.status==="rejected"&&this.logger.error(`fire event ${p}:${m} error: ${a.reason}`)}}addWildCardTopic(p){return this.wildCardTopics.add(p),{dispose:()=>{this.wildCardTopics.delete(p)}}}onEvent(p,m){const s=p.indexOf(":");let g,a;return s===-1?(g=p,a=""):(g=p.substr(0,s),a=p.substr(s+1)),this.addListener(g,{topic:g,data:a,execute:m})}addListener(p,m){if(this.collectTopicData.set(m.topic,m.data),this.wildCardTopics.has(p))return this.eventListeners.has(p)||this.eventListeners.set(p,[]),this.eventListeners.get(p).push(m),{dispose:()=>{const s=this.eventListeners.get(p).indexOf(m);s!==-1&&this.eventListeners.get(p).splice(s,1)}};{const s=p+":"+m.data;return this.eventListeners.has(s)||this.eventListeners.set(s,[]),this.eventListeners.get(s).push(m),{dispose:()=>{const g=this.eventListeners.get(s).indexOf(m);g!==-1&&this.eventListeners.get(s).splice(g,1)}}}}async tryRun(p,m,s){this.wildCardTopics.has(p)?(0,r.default)(s.data)(m)&&await s.execute():await s.execute()}};t.ActivationEventServiceImpl=_,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ActivationEventServiceImpl=_=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],_)},6066:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedExtensionService=t.AllowedExtensionsContribution=t.DEFAULT_ALLOWED_EXTENSION_IDS=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);t.DEFAULT_ALLOWED_EXTENSION_IDS=["vscode.theme-defaults","vscode.typescript-language-features"],t.AllowedExtensionsContribution=Symbol("AllowedExtensionsContribution");let _=class{getAllowedExtensionIds(){const p=new Set(t.DEFAULT_ALLOWED_EXTENSION_IDS),m=this.contributions.getContributions();for(const s of m)for(const g of s.getAllowedExtensionIds())p.add(g);return Array.from(p)}filterExtensions(p){if(!this.workspaceTrustService.isRestricted())return p;const m=new Set(this.getAllowedExtensionIds());return p.filter(s=>m.has(s.id))}waitTrustDecided(){return this.workspaceTrustService.whenTrustDecided()}};t.AllowedExtensionService=_,n.__decorate([(0,r.Autowired)(o.WorkspaceTrustService),n.__metadata("design:type",o.WorkspaceTrustService)],_.prototype,"workspaceTrustService",void 0),n.__decorate([(0,r.Autowired)(t.AllowedExtensionsContribution),n.__metadata("design:type",Object)],_.prototype,"contributions",void 0),t.AllowedExtensionService=_=n.__decorate([(0,r.Injectable)()],_)},63056:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionNoExportsView=t.ExtensionLoadingView=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(68974),_=n.__importDefault(e(17267)),v=({style:m})=>r.default.createElement("div",{style:m||{},className:_.default.kt_extension_view},r.default.createElement(l.Progress,{loading:!0}));t.ExtensionLoadingView=v;const p=(m,s)=>r.default.createElement("div",{className:_.default.kt_extension_no_exports_view},(0,o.formatLocalize)("extension.no.view.found",m,s));t.ExtensionNoExportsView=p},56405:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PortalRoot=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),_=e(87420),v=e(25600),p=m=>{var s;const[g,a]=o.default.useState(null),h=(0,l.useInjectable)(v.AbstractViewExtProcessService),d=(0,l.useInjectable)(_.IThemeService);o.default.useEffect(()=>{const E=new l.DisposableCollection;return d.getCurrentTheme().then(f=>a(f.type)),E.push(d.onThemeChange(f=>{f.type&&f.type!==g&&a(f.type)})),E.dispose.bind(E)},[]);const u=m.original;return o.default.createElement(u,{...m.otherProps,className:(0,r.default)((s=m.otherProps)===null||s===void 0?void 0:s.className,(0,_.getThemeTypeSelector)(g)),getContainer:()=>h.getPortalShadowRoot(m.extensionId)})};t.PortalRoot=p},82443:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TREE_VIEW_NODE_HEIGHT=t.TreeViewNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(25918),p=e(93899),m=e(95422),s=e(69589),g=e(42912),a=n.__importDefault(e(50790)),h=({item:d,onClick:u,onChange:E,onContextMenu:f,itemType:c,leftPadding:y=8,onTwistierClick:b,decorations:A,defaultLeftPadding:S=8,treeViewId:D,decorationService:T,draggable:w,onDragStart:I,onDragEnter:R,onDragLeave:M,onDragOver:O,onDrop:x})=>{const k=(0,m.useInjectable)(g.IIconService),F=(0,_.useDesignStyles)(a.default.expansion_toggle,"expansion_toggle"),L=(0,_.useDesignStyles)(a.default.tree_view_node,"tree_view_node"),[N,U]=(0,o.useState)(d.uri&&T.getDecoration(d.uri,!1));(0,o.useEffect)(()=>{const Be=T.onDidChangeDecorations(De=>{d.uri&&De.affectsResource(d.uri)&&U(T.getDecoration(d.uri,!1))});return()=>{Be.dispose()}},[]);const W=(0,m.useInjectable)(g.IThemeService),j=(0,o.useCallback)(Be=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&u(Be,d,c)},[d,c,u]),Q=(0,o.useCallback)(Be=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&(b?b(Be,d,c):u(Be,d,c))},[d,c,b,u]),G=(0,o.useCallback)(Be=>{Be.nativeEvent.which===0||!f||(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&f(Be,d,c)},[d,c,f]),Z=(0,o.useCallback)(Be=>{I&&I(Be,d)},[d,I]),$=(0,o.useCallback)(Be=>{R&&R(Be,d)},[d,R]),V=(0,o.useCallback)(Be=>{M&&M(Be,d)},[d,M]),H=(0,o.useCallback)(Be=>{O&&O(Be,d)},[d,O]),K=(0,o.useCallback)(Be=>{x&&x(Be,d)},[d,x]),Y=(0,o.useCallback)(Be=>{E(d),Be.stopPropagation()},[d,E]),X=c===l.TreeNodeType.CompositeTreeNode,re=X?`${S+(d.depth||0)*(y||0)}px`:`${S+(d.depth||0)*(y||0)+8}px`,oe={height:t.TREE_VIEW_NODE_HEIGHT,lineHeight:`${t.TREE_VIEW_NODE_HEIGHT}px`,paddingLeft:re},he=(Be,De)=>A&&A?.classlist.indexOf(a.default.mod_loading)>-1?o.default.createElement(l.Loading,null):o.default.createElement("div",{onClick:De,className:(0,r.default)(a.default.tree_view_node_segment,F,(0,_.getIcon)("arrow-right"),{[`${a.default.mod_collapsed}`]:!Be.expanded})}),me=Be=>o.default.createElement("div",{className:(0,r.default)(a.default.file_icon,Be.icon),style:{maxHeight:t.TREE_VIEW_NODE_HEIGHT}}),q=Be=>{var De;return Be.checkboxInfo===void 0?null:o.default.createElement(l.CheckBox,{"data-node-id":Be.treeItemId,readOnly:!0,onChange:_e=>Y(_e),checked:!!Be.checkboxInfo.checked,id:Be.treeItemId,role:(De=Be.checkboxInfo.accessibilityInformation)===null||De===void 0?void 0:De.role,title:Be.checkboxInfo.tooltip})},ye=Be=>{const De=()=>{if(Be.highlights){let _e=[],Ne=0;const Te=Be.highlights.sort((Ue,pe)=>Ue[0]-pe[0]);return _e=Te.map((Ue,pe)=>{const[ie,le]=Ue,Se=Be.displayName.slice(Ne,ie);Ne=le;const Ae=Be.displayName.slice(ie,le),We=[o.default.createElement("span",{key:`line_begin_${pe}_${Se}`},Se),o.default.createElement("span",{className:a.default.highlight,key:`line_hightlight_${pe}_${Ae}`},Ae)];if(pe===Te.length-1){const $e=Be.displayName.slice(le);We.push(o.default.createElement("span",{key:`line_end_${pe}_${$e}`},$e))}return We}),_e}else return Be.displayName};return o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment,a.default.tree_view_node_displayname,Be.strikethrough&&a.default.strikethrough)},De())},ge=()=>o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment,a.default.tree_view_node_tail)},te()),te=()=>{if(d.actions.length>0)return o.default.createElement("div",{className:a.default.tree_view_actions},o.default.createElement(v.TitleActionList,{className:a.default.inlineMenu,context:[{treeViewId:D,treeItemId:d.treeItemId}],nav:d.actions,menuId:p.MenuId.ViewItemContext}))},fe=Be=>{if(X)return he(Be,Q)},Oe=()=>d.tooltip||d.name,Me=Be=>o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_segment_grow,a.default.tree_view_node_description)},!Be.name&&!Be.description?"\u2014\u2014":Be.description),Pe=()=>{if(!N)return null;const Be=N.badge||"",De=N.color,_e=De&&W.getColor({id:De});return o.default.createElement("div",{className:a.default.tree_view_node_tail,style:{color:_e}},(0,s.transformLabelWithCodicon)(Be.slice(),{},k.fromString.bind(k)))};return o.default.createElement("div",{key:d.id,onClick:j,onContextMenu:G,onDragStart:Z,onDragOver:H,onDragEnter:$,onDragLeave:V,onDrop:K,title:Oe(),className:(0,r.default)(L,A?A.classlist:null),"data-id":d.id,style:oe,draggable:w},o.default.createElement("div",{className:(0,r.default)(a.default.tree_view_node_content)},fe(d),q(d),me(d),o.default.createElement("div",{className:a.default.tree_view_node_overflow_wrap},ye(d),Me(d)),ge(),Pe()))};t.TreeViewNode=h,t.TREE_VIEW_NODE_HEIGHT=22},81302:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTabBarTreeView=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(68974),v=e(41893),p=e(24429),m=e(72260),s=e(82443),g=n.__importDefault(e(17267)),a=({viewState:u,model:E,dataProvider:f,treeViewId:c})=>{const y=(0,l.useInjectable)(m.IMainLayoutService),b=(0,l.useInjectable)(v.IDecorationsService),A=(0,r.useMemo)(()=>y.getViewAccordionService(c),[]),S=(0,r.useMemo)(()=>{const Z=A?.getViewState(c);return Z?!Z.collapsed&&!Z.hidden:!1},[A]),{height:D}=u,{canSelectMany:T}=E.treeViewOptions||{},w=(0,r.useRef)(null),I=(0,r.useCallback)(Z=>{E.handleTreeHandler({...Z,getModel:()=>E.treeModel,hasDirectFocus:()=>w.current===document.activeElement})},[E]),R=(0,r.useCallback)((Z,$)=>{Z.stopPropagation();const{toggleDirectory:V}=E;V($)},[E]),M=(0,r.useCallback)(Z=>O(Z)?!1:Z.shiftKey,[]),O=(0,r.useCallback)(Z=>{const{metaKey:$,ctrlKey:V}=Z;return l.isOSX&&$||V},[]),x=(0,r.useCallback)((Z,$,V)=>{Z.stopPropagation();const{handleItemClick:H,handleItemToggleClick:K,handleItemRangeClick:Y}=E;if(!$)return;const X=M(event),re=O(event);T?X?Y($,V):re?K($,V):H($,V):H($,V)},[T,E]),k=(0,r.useCallback)(Z=>{const{handleCheckBoxChange:$}=E;Z&&$(Z)},[E]),F=(0,r.useCallback)((Z,$)=>{const{handleContextMenu:V}=E;V(Z,$)},[E]),L=Z=>{const{handleContextMenu:$}=E;$(Z)},N=(0,r.useCallback)(()=>{const{enactiveNodeDecoration:Z}=E;Z()},[E]),U=(0,r.useCallback)((Z,$)=>{const{handleDragStart:V}=E;V(Z,$)},[E]),W=(0,r.useCallback)((Z,$)=>{const{handleDragOver:V}=E;V(Z,$)},[E]),j=(0,r.useCallback)((Z,$)=>{const{handleDragEnter:V}=E;V(Z,$)},[E]),Q=(0,r.useCallback)((Z,$)=>{const{handleDrop:V}=E;V(Z,$)},[E]),G=(0,r.useCallback)((Z,$)=>{const{handleDragLeave:V}=E;V(Z,$)},[E]);return(0,r.useEffect)(()=>{var Z;const $=()=>{E.handleTreeBlur()};return(Z=w.current)===null||Z===void 0||Z.addEventListener("blur",$,!0),()=>{var V;(V=w.current)===null||V===void 0||V.removeEventListener("blur",$,!0)}},[w.current]),r.default.createElement("div",{className:g.default.kt_extension_view,tabIndex:-1,ref:w,onContextMenu:L,onClick:N,"data-tree-view-id":c},r.default.createElement(d,{height:D,isVisible:S,handleTreeReady:I,handleItemClicked:x,handleCheckBoxChange:k,handleTwistierClick:R,handleContextMenu:F,handleDragStart:U,handleDragOver:W,handleDragEnter:j,handleDragLeave:G,handleDrop:Q,draggable:E.draggable,treeViewId:c,model:E,dataProvider:f,decorationService:b}))};t.ExtensionTabBarTreeView=a;function h(u,E){return u.isVisible===E.isVisible&&u.model===E.model&&u.treeViewId===E.treeViewId&&u.height===E.height}const d=(0,r.memo)(({model:u,treeViewId:E,height:f,isVisible:c,dataProvider:y,handleTreeReady:b,handleItemClicked:A,handleCheckBoxChange:S,handleTwistierClick:D,handleContextMenu:T,handleDragStart:w,handleDragOver:I,handleDragEnter:R,handleDragLeave:M,handleDrop:O,draggable:x,decorationService:k})=>{const[F,L]=(0,r.useState)(!1),[N,U]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let j=!1;return(async()=>(await u.whenReady,u.treeModel&&c&&await u.treeModel.ensureReady,j||L(!0)))(),()=>{j=!0,u&&u.removeNodeDecoration()}},[u,c]),(0,r.useEffect)(()=>{const j=y.onDidChangeEmpty(()=>{y.isTreeEmpty!==N&&U(y.isTreeEmpty)});return()=>j.dispose()},[]);const W=(0,r.useCallback)(j=>r.default.createElement(s.TreeViewNode,{item:j.item,itemType:j.itemType,decorations:u.decorations.getDecorations(j.item),onClick:A,onChange:S,onTwistierClick:D,onContextMenu:T,onDragStart:w,onDragOver:I,onDragEnter:R,onDragLeave:M,onDrop:O,defaultLeftPadding:8,leftPadding:8,treeViewId:E,draggable:x,decorationService:k}),[u.treeModel]);if(F){if(N)return r.default.createElement(p.WelcomeView,{viewId:E});if(u.treeModel)return r.default.createElement(o.RecycleTree,{height:f,itemHeight:s.TREE_VIEW_NODE_HEIGHT,onReady:b,model:u.treeModel},W)}else return r.default.createElement(_.Progress,{loading:!0});return null},h);d.displayName="ExtensionsTreeView"},88341:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionWebviewView=t.WebviewViewShouldShowEvent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(41869),l=e(99220);class _ extends o.BasicEvent{}t.WebviewViewShouldShowEvent=_;const v=({viewId:p})=>{const m=r.default.useRef(null),s=(0,o.useInjectable)(o.IEventBus),g=(0,o.useInjectable)(l.ExtensionService);return r.default.useEffect(()=>{const a=new o.CancellationTokenSource,h=new o.Disposable({dispose:()=>a.cancel()});return g.eagerExtensionsActivated.promise.then(()=>{a.token.isCancellationRequested||m.current&&s.fire(new _({viewType:p,container:m.current,title:"",cancellationToken:a.token,disposer:h}))}),()=>{h.dispose()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"webview-view-component",ref:m})};t.ExtensionWebviewView=v},17428:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(81302),t),n.__exportStar(e(63056),t)},21167:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsEditorView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),_=e(41869),v=e(93374),p=e(52416),m=e(99220),s=e(17441),g=n.__importDefault(e(42076)),a=({resource:{uri:E}})=>{const f=(0,_.useInjectable)(s.WalkthroughsService),c=(0,_.useInjectable)(_.IContextKeyService),{query:y,authority:b}=E,[A,S]=(0,o.useState)(),[D,T]=(0,o.useState)();(0,o.useEffect)(()=>{A&&A.steps.length>0&&(D||T(A.steps[0].id))},[A,D]),(0,o.useEffect)(()=>{y&&S(f.getWalkthrough(y))},[y,A]);const w=(0,o.useCallback)(()=>{var I;return A&&((I=A.steps.find(R=>R.id===D))===null||I===void 0?void 0:I.media)},[D,A]);return o.default.createElement("div",{className:g.default.getting_started_container},o.default.createElement("div",{className:g.default.getting_started_detailsContent},o.default.createElement("div",{className:g.default.category_container},o.default.createElement("div",{className:g.default.category_icon},A&&A.icon.type==="image"&&o.default.createElement("img",{src:A.icon.path})),o.default.createElement("div",{className:g.default.category_description_container},o.default.createElement("h2",{className:g.default.category_title},A?.title),o.default.createElement("div",{className:g.default.category_description},A?.description))),o.default.createElement("div",{className:g.default.steps_container},o.default.createElement("div",{className:g.default.getting_started_detail_container},o.default.createElement("div",{className:g.default.step_list_container},A?A.steps.filter(I=>c.match(I.when)).map(I=>o.default.createElement(h,{key:I.id,step:I,isExpanded:I.id===D,onSelected:T})):null))),o.default.createElement("div",{className:g.default.getting_started_media},D&&o.default.createElement(d,{media:w(),extensionId:b,stepId:D}))))};t.WalkthroughsEditorView=a;const h=({step:E,isExpanded:f,onSelected:c})=>{const y=(0,_.useInjectable)(_.IOpenerService),b=(0,_.useInjectable)(s.WalkthroughsService),A=(0,_.useInjectable)(p.IIconService),[S,D]=(0,o.useState)(!1),{description:T}=E;(0,o.useEffect)(()=>{const O=b.onDidProgressStep(x=>{const{id:k,done:F}=x;k===E.id&&F&&D(F)});return()=>O.dispose()},[]);const w=(0,o.useCallback)(()=>{D(!S),b.progressByEvent(m.CompletionEventsType.stepSelected+":"+E.id)},[S,E.id]),I=(0,o.useCallback)(O=>{const{href:x}=O;y.open(x),/^http(s)?:\/\//.test(x)&&b.progressByEvent(m.CompletionEventsType.onLink+":"+x)},[]),R=(0,o.useCallback)(()=>{if(T.length===0)return null;const O=[];return T.map((x,k)=>{if(x.nodes.length===1&&typeof x.nodes[0]!="string"){const F=x.nodes[0];O.push(o.default.createElement("div",{key:k.toString()+O.length,title:F.title},o.default.createElement(l.Button,{onClick:()=>I(F)},(0,_.transformLabelWithCodicon)(F.label,{},A.fromString.bind(A)))))}else{const F=x.nodes.map((L,N)=>typeof L=="string"?L:o.default.createElement("a",{key:L.label+"#"+N,title:L.title,onClick:()=>I(L)},L.label));O.push(o.default.createElement("p",{key:k.toString()+O.length.toString()+F.length.toString()},F))}}),o.default.createElement("div",{className:g.default.step_description_container},o.default.createElement(o.default.Fragment,null,O))},[T]),M=(0,o.useCallback)(()=>(0,_.transformLabelWithCodicon)(E.title,{},A.fromString.bind(A)),[E.title]);return o.default.createElement("div",{className:(0,r.default)(g.default.getting_started_step,f&&g.default.expanded),onClick:()=>c(E.id)},o.default.createElement("div",{className:g.default.checkbox},o.default.createElement(l.CheckBox,{id:E.id,onChange:w,checked:S})),o.default.createElement("div",{className:g.default.step_container},o.default.createElement("h3",{className:g.default.step_title},M()),f&&R()))},d=({media:E,extensionId:f,stepId:c})=>{const y=(0,_.useInjectable)(p.IThemeService),b=(0,_.useInjectable)(s.WalkthroughsService),[A,S]=(0,o.useState)(""),[D,T]=(0,o.useState)(""),w=(0,o.useCallback)(async I=>E?.type==="image"?"":I?(await b.getFileContent(f,I)).toString():"",[E]);if((0,o.useEffect)(()=>{const I=b.getStepsByExtension(c);I&&(E&&E.type==="svg"&&I.media.svg&&w(I.media.svg).then(S),E&&E.type==="markdown"&&I.media.markdown&&w(I.media.markdown).then(T))},[E,c]),!E)return null;if(E.type==="image"){const I=y.getCurrentThemeSync().type,R=E.path[I].toString(!0).replace(/ /g,"%20");return o.default.createElement(o.default.Fragment,null,o.default.createElement("img",{alt:E.altText,srcSet:R.toLowerCase().endsWith(".svg")?R:R+" 1.5x"}))}return E.type==="svg"?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:g.default.media_svg_container,dangerouslySetInnerHTML:{__html:A}})):E.type==="markdown"?o.default.createElement(o.default.Fragment,null,o.default.createElement(u,{content:D,media:E})):null},u=({content:E,media:f})=>{const c=(0,_.useInjectable)(_.IOpenerService);if(f.type!=="markdown")return null;const y=(0,o.useCallback)(()=>f.base.resolve("/").toString(),[f,E]);return o.default.createElement(v.Markdown,{content:E,options:{baseUrl:y()},onLinkClick:b=>c.open(b)})}},87444:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtCommandManagementImpl=void 0;const n=e(85608),r=e(76003),o=e(43718);let l=class extends o.Disposable{constructor(){super(...arguments),this.commandEnvRegistry=new Map,this.proxyCommandExecutorRegistry=new Map}dispose(){this.commandEnvRegistry.clear(),this.proxyCommandExecutorRegistry.clear()}registerProxyCommandExecutor(v,p){this.proxyCommandExecutorRegistry.set(v,p)}async executeExtensionCommand(v,p,m){const s=this.proxyCommandExecutorRegistry.get(v);if(!s)throw new Error('Proxy command executor "'+v+'" is not existed');return s.$executeExtensionCommand(p,...m)}registerExtensionCommandEnv(v,p="node"){return this.commandEnvRegistry.set(v,p),{dispose:()=>{this.commandEnvRegistry.delete(v)}}}getExtensionCommandEnv(v){return this.commandEnvRegistry.get(v)}};t.ExtCommandManagementImpl=l,t.ExtCommandManagementImpl=l=n.__decorate([(0,r.Injectable)()],l)},49413:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtInstanceManagementService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(99220),v=e(42734);let p=class extends o.Disposable{constructor(){super(),this.onDidChangeEmitter=new l.Emitter,this.extensionMap=new Map,this._whenReady=this.init()}async init(){this.workspaceStorage=await this.storageProvider(o.STORAGE_NAMESPACE.EXTENSIONS),this.globalStorage=await this.storageProvider(o.STORAGE_NAMESPACE.GLOBAL_EXTENSIONS)}get whenReady(){return this._whenReady}get onDidChange(){return this.onDidChangeEmitter.event}dispose(){this.disposeExtensionInstances()}getExtensionInstances(){return Array.from(this.extensionMap.values())}disposeExtensionInstances(){for(const s of this.extensionMap.values())s.dispose();this.extensionMap=new Map}disposeExtensionInstancesByPath(s){s.forEach(g=>{var a;(a=this.extensionMap.get(g))===null||a===void 0||a.dispose()})}resetExtensionInstances(){for(const s of this.extensionMap.values())s.reset()}getExtensionInstanceByPath(s){return this.extensionMap.get(s)}getExtensionInstanceByExtId(s){for(const g of this.extensionMap.values())if(g.id===s)return g}deleteExtensionInstanceByPath(s){this.extensionMap.delete(s),this.onDidChangeEmitter.fire()}addExtensionInstance(s){this.extensionMap.set(s.path,s),this.onDidChangeEmitter.fire()}async checkExtensionEnable(s){await this.whenReady;const g=this.globalStorage.get(s.extensionId,_.EXTENSION_ENABLE.ENABLE);return this.workspaceStorage.get(s.extensionId,g)===_.EXTENSION_ENABLE.ENABLE}async createExtensionInstance(s,g,a){const h=typeof s=="string"?await this.extensionNodeClient.getExtension(s,(0,l.getLanguageId)(),{}):s;if(h)return this.injector.get(v.Extension,[h,await this.checkExtensionEnable(h),g||(this.appConfig.extensionDir?h.realPath.startsWith(this.appConfig.extensionDir):!1),!!a])}checkIsBuiltin(s){const g=this.getExtensionCandidateByPath(s.realPath);return(this.appConfig.extensionDir?s.realPath.startsWith(this.appConfig.extensionDir):!1)||(g?g.isBuiltin:!1)}checkIsDevelopment(s){const g=this.getExtensionCandidateByPath(s.realPath);return!!g?.isDevelopment}getExtensionCandidateByPath(s){return this.appConfig.extensionCandidate&&this.appConfig.extensionCandidate.find(g=>g.path===s)}};t.ExtInstanceManagementService=p,n.__decorate([(0,r.Autowired)(o.StorageProvider),n.__metadata("design:type",Function)],p.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],p.prototype,"extensionNodeClient",void 0),t.ExtInstanceManagementService=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},98453:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionManagementService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(14951),_=e(99220),v=e(82389),p=e(71354),m=e(35321);let s=class extends o.WithEventBus{async getExtensionProps(a,h){const d=await this.extensionNodeClient.getExtension(a,(0,o.getLanguageId)(),h);if(d){const u=this.getExtensionByPath(a);if(u)return{...u.toJSON(),extraMetadata:d.extraMetadata}}}getExtensionByPath(a){return this.extInstanceManagementService.getExtensionInstances().find(h=>a===h.path)}getExtensionByExtId(a){return this.extInstanceManagementService.getExtensionInstances().find(h=>a===h.id)}async postChangedExtension(a,h,d){const{upgrade:u,extensionPath:E,oldExtensionPath:f,isBuiltin:c}=typeof a=="boolean"?{upgrade:a,extensionPath:h,oldExtensionPath:d,isBuiltin:!1}:a,y=this.extInstanceManagementService.getExtensionInstanceByPath(E);if(y){this.logger.warn(`Extension ${y.id} already exists, skip activate`);return}const b=await this.extInstanceManagementService.createExtensionInstance(E,!!c);if(b)return u&&this.disableExtension(f),await this.enableExtension(b)}async postEnableExtension(a){const h=await this.extInstanceManagementService.getExtensionInstanceByPath(a);if(h)return await this.enableExtension(h)}async postDisableExtension(a){return this.disableExtension(a)}async postUninstallExtension(a){return this.uninstallExtension(a)}getAllExtensionJson(){return this.extInstanceManagementService.getExtensionInstances().map(a=>a.toJSON())}disableExtension(a){const h=this.extInstanceManagementService.getExtensionInstanceByPath(a);h&&(h.disable(),this.extInstanceManagementService.deleteExtensionInstanceByPath(a))}async enableExtension(a){this.extInstanceManagementService.addExtensionInstance(a),a.enable(),await a.initialize(),this.eventBus.fire(new p.ExtensionDidEnabledEvent(a.toJSON())),this.sumiContributesService.register(a.id,a.packageJSON.sumiContributes||{}),this.contributesService.register(a.id,a.contributes),this.sumiContributesService.initialize(),this.contributesService.initialize()}async removeExtension(a){try{return await this.fileService.delete(o.URI.file(a).toString()),!0}catch(h){return this.logger.error(h),!1}}async uninstallExtension(a){const h=this.extInstanceManagementService.getExtensionInstanceByPath(a);h&&(h.dispose(),this.extInstanceManagementService.deleteExtensionInstanceByPath(a)),await this.removeExtension(a),this.eventBus.fire(new p.ExtensionDidUninstalledEvent)}};t.ExtensionManagementService=s,n.__decorate([(0,r.Autowired)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),n.__decorate([(0,r.Autowired)(_.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],s.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(m.VSCodeContributesServiceToken),n.__metadata("design:type",m.VSCodeContributesService)],s.prototype,"contributesService",void 0),n.__decorate([(0,r.Autowired)(v.SumiContributionsServiceToken),n.__metadata("design:type",v.SumiContributionsService)],s.prototype,"sumiContributesService",void 0),n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),t.ExtensionManagementService=s=n.__decorate([(0,r.Injectable)()],s)},20670:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(18740),_=e(41869),v=e(99220),p=e(72464),m=e(46147),s=e(37846),g=e(28949),a=e(51072),h=e(17802);let d=class{constructor(){this._apiFactoryDisposables=new _.DisposableStore,this.ready=new _.Deferred,this._extHostUpdated=new _.Deferred,this.extensions=[]}disposeApiFactory(){this._apiFactoryDisposables.clear()}async disposeProcess(){this.disposeApiFactory(),await this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}async activate(){return await this.createExtProcess(),this.protocol&&(this.ready.resolve(),await this.createBrowserMainThreadAPI(),await(await this.getProxy()).$updateExtHostData(),this._extHostUpdated.resolve()),this.protocol}async activeExtension(E,f){!this.appConfig.noExtHost&&!f&&(await this._extHostUpdated.promise,await(await this.getProxy()).$activateExtension(E.id))}async updateExtensionData(E){if(this.extensions=E,this.protocol){const f=await this.getProxy();await f.$updateExtHostData(),f.$fireChangeEvent()}}getExtension(E){return this.extensions.find(f=>f.id===E)}async $activateExtension(E){const f=this.extensions.find(c=>c.path===E);f&&await f.activate()}async $getExtensions(){return this.extensions.map(E=>E.toJSON())}async getProxy(){return await this.ready.promise,this.protocol.getProxy(m.ExtHostAPIIdentifier.ExtHostExtensionService)}async createBrowserMainThreadAPI(){const E=(0,h.initSharedAPIProxy)(this.protocol,this.injector);this._apiFactoryDisposables.add(E),this._apiFactoryDisposables.add((0,_.toDisposable)((0,a.initNodeThreadAPIProxy)(this.protocol,this.injector,this))),this._apiFactoryDisposables.add((0,_.toDisposable)((0,g.createSumiAPIFactory)(this.protocol,this.injector))),this._apiFactoryDisposables.add(this.createExternalSumiAPIFactory()),await E.setup()}getSpawnOptions(){return{}}createExternalSumiAPIFactory(){const E=new _.Disposable,f=this.mainThreadExtenderContributionProvider.getContributions();for(const y of f)y.registerMainThreadExtender(this.mainThreadExtenderService);const c=this.mainThreadExtenderService.getMainThreadExtenders();for(const y of c){const b=this.injector.get(y.serviceClass,[this.protocol]);this.protocol.set(y.identifier,b),E.addDispose(b)}return E}async getActivatedExtensions(){return await(await this.getProxy()).$getActivatedExtensions()}get clientId(){return this.applicationService.clientId}async createExtProcess(){await this.extensionNodeClient.createProcess(this.clientId,{enableDebugExtensionHost:this.appConfig.enableDebugExtensionHost,inspectExtensionHost:this.appConfig.inspectExtensionHost,extensionConnectOption:this.appConfig.extensionConnectOption,extHostSpawnOptions:this.getSpawnOptions()}),await this.initExtProtocol()}async initExtProtocol(){var E,f;this.channel&&this.channel.dispose(),this.protocol&&((f=(E=this.protocol).dispose)===null||f===void 0||f.call(E)),this.channel=await this.channelHandler.openChannel(v.CONNECTION_HANDLE_BETWEEN_EXTENSION_AND_MAIN_THREAD),this.connection=this.channel.createConnection(),this.protocol=new o.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"node-ext-host",io:(0,o.createExtMessageIO)(s.knownProtocols)})}};t.NodeExtProcessService=d,n.__decorate([(0,r.Autowired)(_.AppConfig),n.__metadata("design:type",Object)],d.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],d.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(_.IApplicationService),n.__metadata("design:type",Object)],d.prototype,"applicationService",void 0),n.__decorate([(0,r.Autowired)(l.WSChannelHandler),n.__metadata("design:type",l.WSChannelHandler)],d.prototype,"channelHandler",void 0),n.__decorate([(0,r.Autowired)(p.IMainThreadExtenderService),n.__metadata("design:type",Object)],d.prototype,"mainThreadExtenderService",void 0),n.__decorate([(0,r.Autowired)(p.MainThreadExtenderContribution),n.__metadata("design:type",Object)],d.prototype,"mainThreadExtenderContributionProvider",void 0),t.NodeExtProcessService=d=n.__decorate([(0,r.Injectable)()],d)},90731:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewExtProcessService=void 0;const r=e(85608),o=e(76003),l=e(65973),_=e(8919),v=e(41869),p=e(40827),m=e(43718),s=e(61656),g=e(99220),a=e(25600),h=e(17428),d=e(54107),u=e(9438),E=e(8403),f=e(31738),{Path:c,posix:y}=v.path,b="load";let A=n=class extends m.Disposable{constructor(){super(...arguments),this.debugLogger=(0,m.getDebugLogger)(),this.extensions=[],this.activatedViewExtensionMap=new Map,this.portalShadowRootMap=new Map,this.shadowRootBodyMap=new Map}getExtension(D){return this.extensions.find(T=>T.id===D)}async initExtension(D){this.extensions=D}async getActivatedExtensions(){return[]}getProxy(){}async $activateExtension(D){}async $getExtensions(){return this.extensions.map(D=>D.toJSON())}async disposeProcess(){}activate(){const D=this.requireInterceptorContributionProvider.getContributions();for(const T of D)T.registerRequireInterceptor(this.requireInterceptorService);this.extendExtensionErrorStackTrace()}extendExtensionErrorStackTrace(){Error.stackTraceLimit=100,Error.prepareStackTrace=(D,T)=>{let w,I=`Error: ${D.message}`;for(const R of T)if(I+=`
|
|
33392
33392
|
at ${R.toString()}`,!w&&R.isEval()){const M=R.getEvalOrigin(),O=this.getExtension.apply(this,[M]);if(O){w=O;const x=R.getColumnNumber(),k=R.getLineNumber();I=`
|
|
33393
33393
|
at ${w.name} (${w.workerScriptPath}:${k}:${x})`+I}}if(w){const R=`${w&&w.name} - ${D.name||"Error"}: ${D.message||""}${I}`;return this.debugLogger.log("get error",R),this.reportRuntimeError(D,w,R),R}return D.stack}}reportRuntimeError(D,T,w){var I;D&&D.message&&this.reporterService.point(m.REPORT_NAME.RUNTIME_ERROR_EXTENSION,T.id,{stackTraceMessage:w,error:D.message,version:(I=T.packageJSON)===null||I===void 0?void 0:I.version})}getRegisterViewKind(D){return n.tabBarLocation.includes(D)?"replace":"add"}async activeExtension(D,T){var w;const{extendConfig:I,packageJSON:R,contributes:M}=D;if(!((w=I?.browser)===null||w===void 0)&&w.main){(0,l.warning)(!1,"[Deprecated warning]: kaitian.js is deprecated, please use `package.json#sumiContributes` instead"),await this.activateExtensionByDeprecatedExtendConfig(D);return}R.sumiContributes&&M?.browserMain&&await this.activeExtensionContributes(D)}async activeExtensionContributes(D){var T;const{contributes:w}=D,I=new v.URI(D.extensionLocation.with({path:y.join(D.extensionLocation.path,w.browserMain)})),{moduleExports:R,proxiedHead:M}=await this.getExtensionModuleExports(I.toString(),D);if(w.browserViews){const{browserViews:x}=w;this.appConfig.useExperimentalShadowDom&&this.registerPortalShadowRoot(D.id);const k=Object.keys(x).reduce((F,L)=>(F[L]={type:this.getRegisterViewKind(L),view:x[L].view.map(({id:N,titleComponentId:U,title:W,...j})=>({...j,title:(0,m.replaceLocalizePlaceholder)(W,D.id),id:N,component:this.getModuleExportsComponent(R,D,N,M),titleComponent:U&&this.getModuleExportsComponent(R,D,U,M)}))},F),{});this.registerBrowserComponent(k,D)}if(w.toolbar&&(!((T=w.toolbar)===null||T===void 0)&&T.actions)){for(const x of w.toolbar.actions)if(x.type==="button"&&x.popoverComponent){const k=R[x.popoverComponent];if(!k){this.logger.error(`Can not find CustomPopover from extension ${D.id}, id: ${x.popoverComponent}`);continue}if(this.appConfig.useExperimentalShadowDom){const F=L=>(0,E.getShadowRoot)(k,D,L,x.popoverComponent,M,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet);this.toolbarPopoverRegistry.registerComponent(`${D.id}:${x.popoverComponent}`,F)}else this.toolbarPopoverRegistry.registerComponent(`${D.id}:${x.popoverComponent}`,k)}}const O=x=>{if(w.scm&&w.scm.additional){const{input:k}=w.scm.additional;if(!k)return;const{addonBefore:F,addonAfter:L}=k,N=(U,W)=>{U.forEach(j=>{const Q=R[j];if(Q||this.logger.error(`Can not find ${W} from extension ${D.id}, id: ${Q}`),this.appConfig.useExperimentalShadowDom){const G=Z=>(0,E.getShadowRoot)(Q,D,Z,U,M,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet);x.input.appendProps({[W]:G})}else x.input.appendProps({[W]:Q})})};F&&N(F,"addonBefore"),L&&N(L,"addonAfter")}};this.addDispose(this.scmService.onDidAddRepository(x=>{O(x)})),this.scmService.repositories.forEach(x=>{O(x)})}async activateExtensionByDeprecatedExtendConfig(D){const{extendConfig:T}=D;this.logger.verbose(`register view by Deprecated config ${D.id}`);const w=await this.staticResourceService.resolveStaticResource(v.URI.file(new c(D.path).join(T.browser.main).toString()));try{const I=D;if(this.appConfig.useExperimentalShadowDom){this.registerPortalShadowRoot(D.id);const{moduleExports:R,proxiedHead:M}=await this.loadBrowserModuleUseInterceptor(w.toString(),D,!0);this.registerBrowserComponent(this.normalizeDeprecatedViewsConfig(R,D,M),I)}else{const{moduleExports:R}=await this.loadBrowserModule(w.toString(),D,!0);this.registerBrowserComponent(this.normalizeDeprecatedViewsConfig(R,D),I)}}catch(I){I.errorCode===b?this.logger.error(`[Extension-Host] failed to load ${D.name} - browser module, path:
|
|
33394
33394
|
|
|
33395
33395
|
${I.moduleId}`):this.logger.error(I)}}async getExtensionModuleExports(D,T){if(this.appConfig.useExperimentalShadowDom)return await this.loadBrowserModuleUseInterceptor(D,T,!1);const{moduleExports:w}=await this.loadBrowserModule(D,T,!1);return{moduleExports:w}}registerBrowserComponent(D,T){this.activatedViewExtensionMap.set(T.path,T),D.default&&(D=D.default);const w=D;T.addDispose(this.injector.get(f.SumiBrowserContributionRunner,[T,w]).run({getExtensionExtendService:this.getExtensionExtendService.bind(this)}))}getExtensionExtendService(D,T){const w=this.createExtensionExtendProtocol(D,T);return this.logger.log(`bind extend service for ${D.id}:${T}`),{extendProtocol:w,extendService:w.getProxy(g.MOCK_EXTENSION_EXTEND_PROXY_IDENTIFIER)}}createExtensionExtendProtocol(D,T){const{id:w}=D;return new Proxy(Object.create(null),{get:(R,M)=>{if(typeof M=="symbol")return R[M];if(M==="getProxy")return()=>{let O,x;return this.nodeExtensionService.protocol&&(O=this.createExtendProxy(this.nodeExtensionService.protocol,w)),this.workerExtensionService.protocol&&(x=this.createExtendProxy(this.workerExtensionService.protocol,w)),{node:O,worker:x}};if(M==="set"){const O={serviceId:`${g.EXTENSION_EXTEND_SERVICE_PREFIX}:${w}:${T}`};return x=>{const k={};for(const F in x)x.hasOwnProperty(F)&&(k[`$${F}`]=x[F]);if(this.logger.log("componentProxyIdentifier",O,"service",k),this.workerExtensionService.protocol&&this.workerExtensionService.protocol.set(O,k),this.nodeExtensionService.protocol)return this.nodeExtensionService.protocol.set(O,k)}}}})}createExtendProxy(D,T){const w=D.getProxy(new _.ProxyIdentifier(`${g.EXTENSION_EXTEND_SERVICE_PREFIX}:${T}`));return this.dollarProxy(w)}dollarProxy(D){return new Proxy(D,{get:(T,w)=>typeof w=="symbol"?T[w]:T[`$${w}`]})}getModuleExportsComponent(D,T,w,I){return D[w]?this.appConfig.useExperimentalShadowDom?R=>(0,E.getShadowRoot)(D[w],T,R,w,I,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet):D[w]:()=>(0,h.ExtensionNoExportsView)(T.id,w)}registerPortalShadowRoot(D){if(!this.portalShadowRootMap.has(D)){const T=document.createElement("div");T.setAttribute("id",`portal-shadow-root-${D}`),document.body.appendChild(T);const w=T.attachShadow({mode:"open"});(0,u.retargetEvents)(w),this.portalShadowRootMap.set(D,w)}}getPortalShadowRoot(D){return this.portalShadowRootMap.get(D)}getShadowRootBody(D){return this.shadowRootBodyMap.get(D)}doFetch(D){const T={};return this.appConfig.extensionFetchCredentials&&(T.credentials=this.appConfig.extensionFetchCredentials),fetch(D,T)}getSumiAMDLoader(D,T){const w={};return{_module:{exports:w},_exports:w,_require:M=>{const O=this.requireInterceptorService.getRequireInterceptor(M);return O?.load({injector:this.injector,extension:D,rpcProtocol:T})}}}async loadBrowserModule(D,T,w){const I=this.reporterService.time(m.REPORT_NAME.LOAD_EXTENSION_MAIN),R=await this.doFetch(decodeURIComponent(D));I.timeEnd(T.id);const{_module:M,_exports:O,_require:x}=this.getSumiAMDLoader(T,this.nodeExtensionService.protocol);return new Function("module","exports","require",await R.text()+`
|
|
33396
33396
|
//# sourceURL=${T.id}`)(M,O,x),{moduleExports:w?M.exports.default:M.exports}}normalizeDeprecatedViewsConfig(D,T,w){if(this.appConfig.useExperimentalShadowDom)return Object.keys(D).filter(I=>D[I]&&Array.isArray(D[I].component)).reduce((I,R)=>(I[R]={view:D[R].component.map(({panel:M,id:O,...x})=>({...x,id:O,component:k=>(0,E.getShadowRoot)(M,T,k,O,w,this.appConfig.componentCDNType,this.appConfig.extensionBrowserStyleSheet)}))},I),{});{const I=D.default?D.default:D;return Object.keys(I).filter(R=>I[R]&&Array.isArray(I[R].component)).reduce((R,M)=>(R[M]={view:I[M].component.map(({panel:O,...x})=>({...x,component:O}))},R),{})}}async loadBrowserModuleUseInterceptor(D,T,w){const I=this.reporterService.time(m.REPORT_NAME.LOAD_EXTENSION_MAIN),R=await this.doFetch(decodeURIComponent(D));I.timeEnd(T.id);const{_module:M,_exports:O,_require:x}=this.getSumiAMDLoader(T,this.nodeExtensionService.protocol),k=[],F=document.createElement("head"),L=(0,d.createProxiedDocument)(F),N=(0,d.createProxiedWindow)(L,F);return new Function("module","exports","require","styles","document","window",await R.text()+`
|
|
33397
|
-
//# sourceURL=${T.id}`)(M,O,x,k,L,N),{moduleExports:w?M.exports.default:M.exports,proxiedHead:F}}};t.ViewExtProcessService=A,A.tabBarLocation=["left","right"],r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],A.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.ILogger),r.__metadata("design:type",Object)],A.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(v.AppConfig),r.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(v.IToolbarPopoverRegistry),r.__metadata("design:type",Object)],A.prototype,"toolbarPopoverRegistry",void 0),r.__decorate([(0,o.Autowired)(a.AbstractWorkerExtProcessService),r.__metadata("design:type",a.AbstractWorkerExtProcessService)],A.prototype,"workerExtensionService",void 0),r.__decorate([(0,o.Autowired)(a.AbstractNodeExtProcessService),r.__metadata("design:type",a.AbstractNodeExtProcessService)],A.prototype,"nodeExtensionService",void 0),r.__decorate([(0,o.Autowired)(),r.__metadata("design:type",p.StaticResourceService)],A.prototype,"staticResourceService",void 0),r.__decorate([(0,o.Autowired)(g.RequireInterceptorContribution),r.__metadata("design:type",Object)],A.prototype,"requireInterceptorContributionProvider",void 0),r.__decorate([(0,o.Autowired)(g.IRequireInterceptorService),r.__metadata("design:type",Object)],A.prototype,"requireInterceptorService",void 0),r.__decorate([(0,o.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),r.__decorate([(0,o.Autowired)(s.SCMService),r.__metadata("design:type",s.SCMService)],A.prototype,"scmService",void 0),t.ViewExtProcessService=A=n=r.__decorate([(0,o.Injectable)()],A)},98736:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(84605),l=e(8919),_=e(92917),v=e(41869),p=e(43718),m=e(99220),s=e(37846),g=e(30824),a=e(28949),h=e(51072),d=e(17802),u=e(65055),{posix:E}=p.path;let f=class extends p.Disposable{constructor(){super(...arguments),this.ready=new v.Deferred,this._extHostUpdated=new v.Deferred,this.extensions=[],this.apiFactoryDisposable=new p.DisposableStore}disposeApiFactory(){var y,b;this.apiFactoryDisposable.clear(),this.protocol&&((b=(y=this.protocol).dispose)===null||b===void 0||b.call(y)),this.connection&&this.connection.dispose()}disposeProcess(){this.disposeApiFactory()}async activate(y){if(this.protocol=await this.createExtProcess(y),this.protocol){this.ready.resolve(),this.logger.log("[Worker Host] init worker thread api proxy");const b=(0,d.initSharedAPIProxy)(this.protocol,this.injector);this.apiFactoryDisposable.add(b),this.apiFactoryDisposable.add((0,p.toDisposable)((0,h.initWorkerThreadAPIProxy)(this.protocol,this.injector,this))),this.apiFactoryDisposable.add((0,p.toDisposable)((0,a.createSumiAPIFactory)(this.protocol,this.injector))),await b.setup(),await this.getProxy().$updateExtHostData(),this._extHostUpdated.resolve()}return this.protocol}async activeExtension(y,b){var A,S;const{extendConfig:D,packageJSON:T,id:w}=y;if(!((A=D?.worker)===null||A===void 0)&&A.main){(0,o.warning)(!1,`[Deprecated warning]: ${w}: kaitian.js is deprecated, please use \`package.json#sumiContributes\` instead`),await this.doActivateExtension(y);return}(T.sumiContributes&&(!((S=y.contributes)===null||S===void 0)&&S.workerMain)||b&&T.browser)&&await this.doActivateExtension(y)}async doActivateExtension(y){this.appConfig.extWorkerHost&&(await this._extHostUpdated.promise,await this.getProxy().$activateExtension(y.id))}async updateExtensionData(y){this.extensions=y,this.protocol&&this.getProxy().$updateExtHostData()}getExtension(y){return this.extensions.find(b=>b.id===y)}async $activateExtension(y){const b=this.extensions.find(A=>A.workerScriptPath===y);b&&await b.activate()}async $getExtensions(){return this.extensions.map(y=>y.contributes&&y.contributes.workerMain?this.getWorkerExtensionProps(y,y.contributes.workerMain):y.packageJSON.browser?this.getWorkerExtensionProps(y,y.packageJSON.browser):y.extendConfig&&y.extendConfig.worker&&y.extendConfig.worker.main?this.getWorkerExtensionProps(y,y.extendConfig.worker.main):y.toJSON())}async $getStaticServicePath(){return this.appConfig.staticServicePath||`http://${window.location.hostname}:8000`}async createExtProcess(y){const b=(0,g.getWorkerBootstrapUrl)(this.appConfig.extWorkerHost,"ExtensionWorkerHost",y);return await this.initWorkerProtocol(b)}async initWorkerProtocol(y){return this.logger.log("[Worker Host] init web worker extension host"),new Promise((b,A)=>{const S=new v.Deferred;if(this.appConfig.useIframeWrapWorkerHost){const{iframe:D,extHostUuid:T}=(0,u.startInsideIframe)(y),w=I=>{if(I.source===D.contentWindow&&I.data.kaitianWebWorkerExtHostId===T&&I.data.data instanceof MessagePort){S.resolve(I.data.data);return}};window.addEventListener("message",w),this.apiFactoryDisposable.add({dispose:()=>{window.removeEventListener("message",w),D.remove()}}),S.promise.then(I=>{b(this.createProtocol(I))})}else try{const D=new Worker(y,{name:"KaitianWorkerExtensionHost"});D.onmessage=T=>{T.data instanceof MessagePort&&S.resolve(T.data)},D.onerror=T=>{A(T)},this.apiFactoryDisposable.add({dispose:()=>{D.terminate(),D.onmessage=null,D.onerror=null}}),S.promise.then(T=>{b(this.createProtocol(T))})}catch(D){A(D)}})}createProtocol(y){this.connection=new _.MessagePortConnection(y);const b=new l.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"worker-ext-host",io:(0,l.createExtMessageIO)(s.knownProtocols)});return this.logger.log("[Worker Host] web worker extension host ready"),b}getActivatedExtensions(){return this.getProxy().$getActivatedExtensions()}getProxy(){return this.protocol.getProxy(m.WorkerHostAPIIdentifier.ExtWorkerHostExtensionService)}getWorkerExtensionProps(y,b){let A=b;A.endsWith(".js")||(A+=".js");const S=new v.URI(y.extensionLocation.with({path:E.join(y.extensionLocation.path,A)})).toString();return Object.assign({},y.toJSON(),{workerScriptPath:S})}getSpawnOptions(){return{}}dispose(){super.dispose(),this.disposeApiFactory()}};t.WorkerExtProcessService=f,n.__decorate([(0,r.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),t.WorkerExtProcessService=f=n.__decorate([(0,r.Injectable)()],f)},62040:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionCommandContribution=t.ExtensionClientAppContribution=t.getClientId=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29220),_=e(54414),v=e(55113),p=e(72665),m=e(65046),s=e(99220),g=e(53043),a=e(71354),h=n.__importStar(e(72980)),d=e(17441),u=c=>c.get(o.IApplicationService).clientId;t.getClientId=u;let E=class{initialize(){this.extensionService.activate().then(()=>{const y=this.webviewService.registerWebviewReviver({handles:()=>0,revive:async b=>new Promise(A=>{this.eventBus.on(a.ExtensionApiReadyEvent,()=>{y.dispose(),A(this.webviewService.tryReviveWebviewComponent(b))})})})})}async onStart(){(0,o.runWhenIdle)(()=>{this.extensionService.runExtensionContributes()}),this.preferenceSettingsService.registerSettingGroup({id:"extension",title:(0,o.localize)("settings.group.extension"),iconClass:(0,o.getIcon)("extension")})}onDisposeSideEffects(){this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}onReconnect(){this.extensionService.restartExtProcess(s.ERestartPolicy.WhenExit)}get clientId(){return(0,t.getClientId)(this.injector)}};t.ExtensionClientAppContribution=E,n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],E.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],E.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],E.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],E.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],E.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(m.IWebviewService),n.__metadata("design:type",Object)],E.prototype,"webviewService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionService),n.__metadata("design:type",s.ExtensionService)],E.prototype,"extensionService",void 0),t.ExtensionClientAppContribution=E=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],E);let f=class{registerCommands(y){y.registerCommand({id:"ext.restart",label:"%extension.host.restart%"},{execute:async()=>{this.logger.log("start restart ext host process"),await this.extensionService.restartExtProcess(),this.logger.log("end restart ext host process")}}),y.registerCommand(h.GET_EXTENSION,{execute:async b=>{const A=this.extensionInstanceManageService.getExtensionInstanceByExtId(b);return A&&A.toJSON()}}),this.registerVSCBuiltinCommands(y)}registerVSCBuiltinCommands(y){y.registerCommand(h.SET_CONTEXT,{execute:(b,A)=>{this.contextKeyService.createKey(String(b),A)}}),y.registerCommand(h.RELOAD_WINDOW_COMMAND,{execute:()=>{this.clientApp.fireOnReload()}}),y.registerCommand(s.EMIT_EXT_HOST_EVENT,{execute:async(b,...A)=>{await this.activationEventService.fireEvent("onEvent:"+b);const S=await this.eventBus.fireAndAwait(new a.ExtHostEvent({eventName:b,eventArgs:A})),D=[];return S.forEach(T=>{T.err?D.push(T):D.push(...T.result||[])}),D}}),y.registerCommand(h.SHOW_RUN_TIME_EXTENSION,{execute:async()=>{const b=await this.extensionService.getActivatedExtensions();this.quickOpenService.open({onType:(A,S)=>S(this.asQuickOpenItems(b))},{placeholder:"\u8FD0\u884C\u4E2D\u7684\u63D2\u4EF6",fuzzyMatchLabel:{enableSeparateSubstringMatching:!0}})}}),y.registerCommand(h.START_EXTENSION_HOST_PROFILER,{execute:async()=>{this.cpuProfileStatus||(this.cpuProfileStatus=this.statusBar.addElement("ExtensionHostProfile",{tooltip:(0,o.formatLocalize)("extension.profiling.clickStop","Click to stop profiling."),text:`$(sync~spin) ${(0,o.formatLocalize)("extension.profilingExtensionHost","Profiling Extension Host")}`,alignment:l.StatusBarAlignment.RIGHT,command:h.STOP_EXTENSION_HOST_PROFILER.id})),await this.extensionProfiler.$startProfile(this.clientId)},isPermitted:()=>!1}),y.registerCommand(h.STOP_EXTENSION_HOST_PROFILER,{execute:async()=>{const b=await this.extensionProfiler.$stopProfile(this.clientId);if(this.cpuProfileStatus&&(this.cpuProfileStatus.dispose(),this.cpuProfileStatus=null),b){const A=await this.dialogService.showSaveDialog({saveLabel:(0,o.formatLocalize)("extension.profile.save","Save Extension Host Profile"),showNameInput:!0,defaultFileName:`CPU-${new Date().toISOString().replace(/[\-:]/g,"")}.cpuprofile`});A?.codeUri&&await this.extensionProfiler.$saveLastProfile(A?.codeUri.fsPath)}},isPermitted:()=>!1}),y.registerCommand(h.COPY_FILE_PATH,{execute:async b=>{await this.commandService.executeCommand(o.FILE_COMMANDS.COPY_PATH.id,o.URI.from(b))}}),y.registerCommand(h.COPY_RELATIVE_FILE_PATH,{execute:async b=>{await this.commandService.executeCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,o.URI.from(b))}}),y.registerCommand(h.OPEN,{execute:(b,A,S)=>{const D=o.URI.from(b);return this.doOpenWith(D,A,S,void 0)}}),y.registerCommand(h.OPEN_WITH,{execute:(b,A,S)=>{const D=o.URI.from(b),T=A==="default"?void 0:{type:v.EditorOpenType.component,componentId:`${o.CUSTOM_EDITOR_SCHEME}-${A}`};return this.doOpenWith(D,S,void 0,T)}}),y.registerCommand(h.DIFF,{execute:(b,A,S,D)=>{const T={...(0,g.viewColumnToResourceOpenOptions)(D?.viewColumn),revealFirstDiff:!0,...D};return this.commandService.executeCommand(o.EDITOR_COMMANDS.COMPARE.id,{original:o.URI.from(b),modified:o.URI.from(A),name:S},T)}}),y.registerCommand({id:h.WALKTHROUGHS_COMMAND_GET_STARTED.id,category:(0,o.localize)("walkthroughs.welcome"),label:(0,o.localize)("walkthroughs.get.started")},{execute:async b=>{const A=this.walkthroughsService.getWalkthroughs();if(b)this.walkthroughsService.openWalkthroughEditor(b);else{const S=await this.quickPickService.show(A.map(D=>({label:D.title,value:D.id,description:D.source,detail:D.description})));S&&this.walkthroughsService.openWalkthroughEditor(S)}}}),[h.LAYOUT_COMMAND_MAXIMIZE_EDITOR,h.WORKBENCH_CLOSE_ACTIVE_EDITOR,h.REVERT_AND_CLOSE_ACTIVE_EDITOR,h.SPLIT_EDITOR_RIGHT,h.SPLIT_EDITOR_DOWN,h.EDITOR_NAVIGATE_BACK,h.EDITOR_NAVIGATE_FORWARD,h.EDITOR_SAVE_ALL,h.CLOSE_ALL_EDITORS,h.PREVIOUS_EDITOR,h.PREVIOUS_EDITOR_IN_GROUP,h.NEXT_EDITOR,h.NEXT_EDITOR_IN_GROUP,h.EVEN_EDITOR_WIDTH,h.CLOSE_OTHER_GROUPS,h.CLOSE_UNMODIFIED_EDITORS,h.LAST_EDITOR_IN_GROUP,h.OPEN_EDITOR_AT_INDEX,h.CLOSE_OTHER_EDITORS,h.NEW_UNTITLED_FILE,h.FILE_SAVE,h.SPLIT_EDITOR,h.SPLIT_EDITOR_ORTHOGONAL,h.NAVIGATE_LEFT,h.NAVIGATE_RIGHT,h.NAVIGATE_UP,h.NAVIGATE_DOWN,h.NAVIGATE_NEXT,h.REVERT_FILES,h.WORKBENCH_FOCUS_FILES_EXPLORER,h.WORKBENCH_FOCUS_ACTIVE_EDITOR_GROUP,h.API_OPEN_EDITOR_COMMAND_ID,h.API_OPEN_DIFF_EDITOR_COMMAND_ID,h.API_OPEN_WITH_EDITOR_COMMAND_ID,h.DEBUG_START,h.DEBUG_ADD,h.DEBUG_COMMAND_STEP_INTO,h.DEBUG_COMMAND_STEP_OVER,h.DEBUG_COMMAND_STEP_OUT,h.DEBUG_COMMAND_CONTINUE,h.DEBUG_COMMAND_RUN,h.DEBUG_COMMAND_START,h.DEBUG_COMMAND_PAUSE,h.DEBUG_COMMAND_RESTART,h.DEBUG_COMMAND_STOP,h.EDITOR_SHOW_ALL_SYMBOLS,h.SEARCH_COMMAND_OPEN_SEARCH,h.REVEAL_IN_EXPLORER,h.OPEN_FOLDER,h.SIDEBAR_TOGGLE_VISIBILITY,h.CLEAR_TERMINAL,h.TERMINAL_COMMAND_FOCUS,h.TERMINAL_COMMAND_TOGGLE_VISIBILITY,h.NEW_WORKBENCH_VIEW_TERMINAL,h.FILE_COMMAND_RENAME_FILE,h.MARKER_COMMAND_SHOW_ERRORS_WARNINGS,h.MARKER_COMMAND_TOGGLE_SHOW_ERRORS_WARNINGS,h.RELOAD_WINDOW,h.SETTINGS_COMMAND_OPEN_SETTINGS,h.SETTINGS_COMMAND_OPEN_GLOBAL_SETTINGS,h.SETTINGS_COMMAND_OPEN_SETTINGS_JSON,h.SETTINGS_COMMAND_OPEN_GLOBAL_OPEN_KEYMAPS,h.THEME_COMMAND_QUICK_SELECT,h.OPEN_MERGEEDITOR].forEach(b=>{y.registerCommand(b)})}doOpenWith(y,b,A,S){const[D,T]=b??[],w={};if(typeof D=="number"&&(w.groupIndex=D),T){if(w.focus=w.preserveFocus=T.preserveFocus,T.selection&&(0,g.isLikelyVscodeRange)(T.selection)&&(T.selection=(0,g.fromRange)(T.selection)),Array.isArray(T.selection)&&T.selection.length===2){const[I,R]=T.selection;w.range={startLineNumber:I.line+1,startColumn:I.character+1,endLineNumber:R.line+1,endColumn:R.character+1}}else w.range=T.selection;w.preview=T.preview}return S&&(w.forceOpenType=S),A&&(w.label=A),this.workbenchEditorService.open(y,w)}asQuickOpenItems(y){const b=y.node?y.node.map((S,D)=>this.toQuickOpenItem(S,"Node.js",D===0)):[],A=y.worker?y.worker.map((S,D)=>this.toQuickOpenItem(S,"Web Worker",D===0)):[];return[...b,...A]}toQuickOpenItem(y,b,A){const S=this.extensionInstanceManageService.getExtensionInstanceByExtId(y.id);return new o.QuickOpenItem({groupLabel:A?b:void 0,showBorder:!!A,label:(0,o.replaceLocalizePlaceholder)(y.displayName,y.id),description:(0,o.replaceLocalizePlaceholder)(y.description,y.id),detail:S?.realPath})}get clientId(){return(0,t.getClientId)(this.injector)}};t.ExtensionCommandContribution=f,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],f.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(a.IActivationEventService),n.__metadata("design:type",a.IActivationEventService)],f.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],f.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.QuickPickService),n.__metadata("design:type",Object)],f.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionHostProfilerServicePath),n.__metadata("design:type",Object)],f.prototype,"extensionProfiler",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],f.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(p.IWindowDialogService),n.__metadata("design:type",Object)],f.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],f.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],f.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(m.IWebviewService),n.__metadata("design:type",Object)],f.prototype,"webviewService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionService),n.__metadata("design:type",s.ExtensionService)],f.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(a.AbstractExtInstanceManagementService),n.__metadata("design:type",a.AbstractExtInstanceManagementService)],f.prototype,"extensionInstanceManageService",void 0),n.__decorate([(0,r.Autowired)(d.WalkthroughsService),n.__metadata("design:type",d.WalkthroughsService)],f.prototype,"walkthroughsService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),t.ExtensionCommandContribution=f=n.__decorate([(0,o.Domain)(o.CommandContribution)],f)},42734:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(40827),_=e(69734),v=e(99220),p=e(9663),m=e(71354),s=Symbol.for("metaDataSymbol");let g=class extends o.WithEventBus{constructor(h,d,u,E){super(),this.extensionData=h,this.isUseEnable=d,this.isBuiltin=u,this.isDevelopment=E,this.extraMetadata={},this._activated=!1,this.logger=(0,o.getDebugLogger)(),this.pkgLocalizedField=new Map,this._enabled=d,this.packageJSON=this.extensionData.packageJSON,this.defaultPkgNlsJSON=this.extensionData.defaultPkgNlsJSON,this.packageNlsJSON=this.extensionData.packageNlsJSON,this.id=this.extensionData.id,this.extensionId=this.extensionData.extensionId,this.name=this.packageJSON.name,this.extraMetadata=this.extensionData.extraMetadata,this.path=this.extensionData.path,this.uri=this.extensionData.uri,this.realPath=this.extensionData.realPath,this.extendConfig=this.extensionData.extendConfig||{},this.enableProposedApi=!!this.extensionData.packageJSON.enableProposedApi,this.extensionLocation=this.staticResourceService.resolveStaticResource(o.URI.from(this.uri)).codeUri,this.initialize()}localize(h){if(!this.pkgLocalizedField.get(h)){const d=(0,o.replaceNlsField)(this.packageJSON[h],this.id);return this.pkgLocalizedField.set(h,d),d||this.packageJSON[h]}return this.pkgLocalizedField.get(h)}get activated(){return this._activated}get enabled(){return this._enabled}set enabled(h){this._enabled=h}get icon(){return this.packageJSON.icon&&this.uri&&this.extensionLocation.toString()+`/${this.packageJSON.icon}`}async getDefaultIcon(){return await this.extensionNodeClient.getOpenVSXRegistry()+"/default-icon.png"}disable(){this._enabled&&(this.extMetadataService.dispose(),this._enabled=!1,super.dispose())}enable(){this._enabled||(this._enabled=!0)}initialize(){this._enabled&&(this.addDispose(this.extMetadataService),this.packageNlsJSON&&(0,o.registerLocalizationBundle)({...(0,o.getCurrentLanguageInfo)(),contents:this.packageNlsJSON},this.id),this.defaultPkgNlsJSON&&(0,o.registerLocalizationBundle)({languageId:"default",languageName:_.LOCALE_TYPES.EN_US,localizedLanguageName:"English",contents:this.defaultPkgNlsJSON},this.id),this.extMetadataService.initialize(this))}async activate(h=new Set){var d;const u=((d=this.packageJSON)===null||d===void 0?void 0:d.extensionDependencies)||[];h.add(this.extensionId);for(const f of u){const c=typeof f=="string"?f:Object.keys(f)[0];if(h.has(c))continue;const y=this.extensionInstanceManageService.getExtensionInstanceByExtId(c);y&&await y.activate(h)}if(this._activated)return;const E=await this.eventBus.fireAndAwait(new m.ExtensionWillActivateEvent(this));return E.length>0&&E[0].result?(this._activated=!0,Promise.resolve()):this._activating?this._activating.promise:(this._activating=new o.Deferred,this.extensionService.activeExtension(this).then(()=>{var f;this._activated=!0,this.eventBus.fire(new m.ExtensionDidActivatedEvent(this.toJSON())),(f=this._activating)===null||f===void 0||f.resolve()}).catch(f=>{var c;this.logger.error(f),this._activated=!1,(c=this._activating)===null||c===void 0||c.reject(f)}),this._activating.promise)}get contributes(){return this.packageJSON.contributes}reset(){this._activated=!1,this._activating=void 0}get displayName(){return this.localize("displayName")}toJSON(){return{id:this.id,extensionId:this.extensionId,name:this.name,displayName:this.displayName,activated:this.activated,enabled:this.enabled,packageJSON:this.packageJSON,defaultPkgNlsJSON:this.defaultPkgNlsJSON,packageNlsJSON:this.packageNlsJSON,path:this.path,realPath:this.realPath,isUseEnable:this.isUseEnable,extendConfig:this.extendConfig,enableProposedApi:this.enableProposedApi,extraMetadata:this.extraMetadata,isBuiltin:this.isBuiltin,isDevelopment:this.isDevelopment,extensionLocation:this.extensionLocation}}};t.Extension=g,n.__decorate([(0,r.Autowired)(p.ExtensionMetadataService),n.__metadata("design:type",p.ExtensionMetadataService)],g.prototype,"extMetadataService",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionService),n.__metadata("design:type",v.ExtensionService)],g.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.StaticResourceService)],g.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],g.prototype,"extensionInstanceManageService",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],g.prototype,"extensionNodeClient",void 0),t.Extension=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(s)),n.__param(1,(0,r.Optional)(Symbol())),n.__param(2,(0,r.Optional)(Symbol())),n.__param(3,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object,Boolean,Boolean,Boolean])],g)},87543:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionServiceImpl=void 0;const r=e(85608),o=r.__importDefault(e(12784)),l=e(76003),_=e(18740),v=e(76271),p=e(41869),m=e(68969),s=e(43718),g=e(66482),a=e(50492),h=e(84660),d=e(14951),u=e(72665),E=e(51500),f=e(99220),c=e(25600),y=e(46147),b=e(57962),A=e(6066),S=e(82389),D=e(71354),T=e(35321);let w=n=class extends s.WithEventBus{constructor(){super(),this.ready=new Map,this.isExtProcessRestarting=!1,this.isProgressShowing=!1,this.eagerExtensionsActivated=new p.Deferred,this.extensionScanDir=new Set,this.extensionCandidatePath=new Set,this.restartProgress=async(R=f.ERestartPolicy.Always)=>{const M=async x=>{this.disposeAllOverlayWindow(),x.onCancellationRequested(()=>{this.logger.log("[ext-restart]: ext process restart canceled"),this.isExtProcessRestarting=!1,this.isExtProcessWaitingForRestart=void 0,this.isProgressShowing=!1});try{await this.startExtProcess(!1)}catch(k){this.logger.error(`[ext-restart]: ext-host restart failure, error: ${k}`)}this.isExtProcessRestarting=!1,this.isExtProcessWaitingForRestart=void 0,this.isProgressShowing=!1,this.disposeAllOverlayWindow()};await this.channelHandler.awaitChannelReady(v.RPCServiceChannelPath);const O=this.isExtProcessWaitingForRestart||R;switch(this.logger.log("[ext-restart]: restart ext process, restart policy:",O),O){case f.ERestartPolicy.WhenExit:if(await this.getExtProcessPID()){this.logger.log("[ext-restart]: ext process is still running, skip");break}case f.ERestartPolicy.Always:if(this.isProgressShowing){this.logger.log("[ext-restart]: progress is already showing, skip");return}this.isProgressShowing=!0,await this.progressService.withProgress({location:s.ProgressLocation.Notification,title:(0,s.localize)("extension.exthostRestarting.content"),buttons:[{id:"extension.reload",label:(0,s.localize)("preference.general.language.change.refresh.now"),primary:!0,run:async()=>{this.clientApp.fireOnReload()},dispose:()=>{}}]},async()=>{this.extProcessRestartPromise=(0,s.createCancelablePromise)(M),await this.extProcessRestartPromise});break}this.isExtProcessRestarting=!1},this.restartDebounced=(0,o.default)(async()=>{await this.restartProgress()},500),this.addDispose(this.fileServiceClient.onWillActivateFileSystemProvider(async()=>(this.extensionMetaDataArr||await this.initExtensionMetaData(),this.activationEventService.getTopicsData("onFileSystem"))))}async getActivatedExtensions(){const R={};return this.nodeExtensionService.protocol&&(R.node=await this.nodeExtensionService.getActivatedExtensions()),this.workerExtensionService.protocol&&(R.worker=await this.workerExtensionService.getActivatedExtensions()),R}async onActivateExtension(R){await this.activationEventService.fireEvent(R.payload.topic,R.payload.data)}async onExtensionEnabled(R){const M=R.payload;await this.updateExtHostData(),await this.fireActivationEventsIfNeed(M.packageJSON.activationEvents)}async onExtensionUninstalled(){await this.updateExtHostData()}async activate(){await this.initExtensionMetaData(),this.extensionMetaDataArr=await this.allowedExtensionService.filterExtensionsAfterTrustDecided(this.extensionMetaDataArr),await this.initExtensionInstanceData(),await this.runEagerExtensionsContributes(),await this.setupExtensionNLSConfig(),this.doActivate();const R=()=>{this.logger.log("[ext-restart]: page visibility change, current:",document.visibilityState,"is waiting:",this.isExtProcessWaitingForRestart,"is restarting:",this.isExtProcessRestarting),document.visibilityState==="visible"&&this.isExtProcessWaitingForRestart&&!this.isExtProcessRestarting&&this.extProcessRestartHandler(this.isExtProcessWaitingForRestart)};document.addEventListener("visibilitychange",R,!1),this.addDispose(p.Disposable.create(()=>{document.removeEventListener("visibilitychange",R)}))}async setupExtensionNLSConfig(){const R=await this.extensionStoragePathServer.getLastStoragePath()||"",M=this.preferenceService.get(s.GeneralSettingsId.Language)||(0,s.getLanguageId)();await this.extensionNodeClient.setupNLSConfig(M,R)}async initExtensionMetaData(){const{extensionDir:R,extensionCandidate:M}=this.appConfig;R&&this.extensionScanDir.add(R),M&&M.forEach(O=>{this.extensionCandidatePath.add(O.path)}),await this.getExtensionsMetaData(Array.from(this.extensionScanDir),Array.from(this.extensionCandidatePath))}async initExtensionInstanceData(){for(const M of this.extensionMetaDataArr){const O=this.extensionInstanceManageService.checkIsBuiltin(M),x=this.extensionInstanceManageService.checkIsDevelopment(M),k=await this.extensionInstanceManageService.createExtensionInstance(M,O,x);k&&this.extensionInstanceManageService.addExtensionInstance(k),k?.contributes&&k.enabled&&(this.contributesService.register(k.id,k.contributes),this.sumiContributesService.register(k.id,k.packageJSON.sumiContributes||{}))}this.eventBus.fire(new D.ExtensionsInitializedEvent(this.extensionInstanceManageService.getExtensionInstances())),this.eventBus.fire(new g.DebugConfigurationsReadyEvent(void 0));const R=this.extensionInstanceManageService.getExtensionInstances();this.nodeExtensionService.updateExtensionData(R),this.workerExtensionService.updateExtensionData(R),this.viewExtensionService.initExtension(R)}async doActivate(){await this.workspaceService.whenReady,await this.extensionStorageService.whenReady,await this.viewExtensionService.activate(),await this.startExtProcess(!0);try{await this.eventBus.fireAndAwait(new D.ExtensionBeforeActivateEvent),await this.activationEventService.fireEvent("*")}catch(R){this.logger.error(`[Extension Activate Error],
|
|
33397
|
+
//# sourceURL=${T.id}`)(M,O,x,k,L,N),{moduleExports:w?M.exports.default:M.exports,proxiedHead:F}}};t.ViewExtProcessService=A,A.tabBarLocation=["left","right"],r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],A.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(m.ILogger),r.__metadata("design:type",Object)],A.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(v.AppConfig),r.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(v.IToolbarPopoverRegistry),r.__metadata("design:type",Object)],A.prototype,"toolbarPopoverRegistry",void 0),r.__decorate([(0,o.Autowired)(a.AbstractWorkerExtProcessService),r.__metadata("design:type",a.AbstractWorkerExtProcessService)],A.prototype,"workerExtensionService",void 0),r.__decorate([(0,o.Autowired)(a.AbstractNodeExtProcessService),r.__metadata("design:type",a.AbstractNodeExtProcessService)],A.prototype,"nodeExtensionService",void 0),r.__decorate([(0,o.Autowired)(),r.__metadata("design:type",p.StaticResourceService)],A.prototype,"staticResourceService",void 0),r.__decorate([(0,o.Autowired)(g.RequireInterceptorContribution),r.__metadata("design:type",Object)],A.prototype,"requireInterceptorContributionProvider",void 0),r.__decorate([(0,o.Autowired)(g.IRequireInterceptorService),r.__metadata("design:type",Object)],A.prototype,"requireInterceptorService",void 0),r.__decorate([(0,o.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),r.__decorate([(0,o.Autowired)(s.SCMService),r.__metadata("design:type",s.SCMService)],A.prototype,"scmService",void 0),t.ViewExtProcessService=A=n=r.__decorate([(0,o.Injectable)()],A)},98736:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(84605),l=e(8919),_=e(92917),v=e(41869),p=e(43718),m=e(99220),s=e(37846),g=e(30824),a=e(28949),h=e(51072),d=e(17802),u=e(65055),{posix:E}=p.path;let f=class extends p.Disposable{constructor(){super(...arguments),this.ready=new v.Deferred,this._extHostUpdated=new v.Deferred,this.extensions=[],this.apiFactoryDisposable=new p.DisposableStore}disposeApiFactory(){var y,b;this.apiFactoryDisposable.clear(),this.protocol&&((b=(y=this.protocol).dispose)===null||b===void 0||b.call(y)),this.connection&&this.connection.dispose()}disposeProcess(){this.disposeApiFactory()}async activate(y){if(this.protocol=await this.createExtProcess(y),this.protocol){this.ready.resolve(),this.logger.log("[Worker Host] init worker thread api proxy");const b=(0,d.initSharedAPIProxy)(this.protocol,this.injector);this.apiFactoryDisposable.add(b),this.apiFactoryDisposable.add((0,p.toDisposable)((0,h.initWorkerThreadAPIProxy)(this.protocol,this.injector,this))),this.apiFactoryDisposable.add((0,p.toDisposable)((0,a.createSumiAPIFactory)(this.protocol,this.injector))),await b.setup(),await this.getProxy().$updateExtHostData(),this._extHostUpdated.resolve()}return this.protocol}async activeExtension(y,b){var A,S;const{extendConfig:D,packageJSON:T,id:w}=y;if(!((A=D?.worker)===null||A===void 0)&&A.main){(0,o.warning)(!1,`[Deprecated warning]: ${w}: kaitian.js is deprecated, please use \`package.json#sumiContributes\` instead`),await this.doActivateExtension(y);return}(T.sumiContributes&&(!((S=y.contributes)===null||S===void 0)&&S.workerMain)||b&&T.browser)&&await this.doActivateExtension(y)}async doActivateExtension(y){this.appConfig.extWorkerHost&&(await this._extHostUpdated.promise,await this.getProxy().$activateExtension(y.id))}async updateExtensionData(y){this.extensions=y,this.protocol&&this.getProxy().$updateExtHostData()}getExtension(y){return this.extensions.find(b=>b.id===y)}async $activateExtension(y){const b=this.extensions.find(A=>A.workerScriptPath===y);b&&await b.activate()}async $getExtensions(){return this.extensions.map(y=>y.contributes&&y.contributes.workerMain?this.getWorkerExtensionProps(y,y.contributes.workerMain):y.packageJSON.browser?this.getWorkerExtensionProps(y,y.packageJSON.browser):y.extendConfig&&y.extendConfig.worker&&y.extendConfig.worker.main?this.getWorkerExtensionProps(y,y.extendConfig.worker.main):y.toJSON())}async $getStaticServicePath(){return this.appConfig.staticServicePath||`http://${window.location.hostname}:8000`}async createExtProcess(y){const b=(0,g.getWorkerBootstrapUrl)(this.appConfig.extWorkerHost,"ExtensionWorkerHost",y);return await this.initWorkerProtocol(b)}async initWorkerProtocol(y){return this.logger.log("[Worker Host] init web worker extension host"),new Promise((b,A)=>{const S=new v.Deferred;if(this.appConfig.useIframeWrapWorkerHost){const{iframe:D,extHostUuid:T}=(0,u.startInsideIframe)(y),w=I=>{if(I.source===D.contentWindow&&I.data.kaitianWebWorkerExtHostId===T&&I.data.data instanceof MessagePort){S.resolve(I.data.data);return}};window.addEventListener("message",w),this.apiFactoryDisposable.add({dispose:()=>{window.removeEventListener("message",w),D.remove()}}),S.promise.then(I=>{b(this.createProtocol(I))})}else try{const D=new Worker(y,{name:"KaitianWorkerExtensionHost"});D.onmessage=T=>{T.data instanceof MessagePort&&S.resolve(T.data)},D.onerror=T=>{A(T)},this.apiFactoryDisposable.add({dispose:()=>{D.terminate(),D.onmessage=null,D.onerror=null}}),S.promise.then(T=>{b(this.createProtocol(T))})}catch(D){A(D)}})}createProtocol(y){this.connection=new _.MessagePortConnection(y);const b=new l.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"worker-ext-host",io:(0,l.createExtMessageIO)(s.knownProtocols)});return this.logger.log("[Worker Host] web worker extension host ready"),b}getActivatedExtensions(){return this.getProxy().$getActivatedExtensions()}getProxy(){return this.protocol.getProxy(m.WorkerHostAPIIdentifier.ExtWorkerHostExtensionService)}getWorkerExtensionProps(y,b){let A=b;A.endsWith(".js")||(A+=".js");const S=new v.URI(y.extensionLocation.with({path:E.join(y.extensionLocation.path,A)})).toString();return Object.assign({},y.toJSON(),{workerScriptPath:S})}getSpawnOptions(){return{}}dispose(){super.dispose(),this.disposeApiFactory()}};t.WorkerExtProcessService=f,n.__decorate([(0,r.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),t.WorkerExtProcessService=f=n.__decorate([(0,r.Injectable)()],f)},62040:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionCommandContribution=t.ExtensionClientAppContribution=t.getClientId=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(29220),_=e(54414),v=e(55113),p=e(72665),m=e(65046),s=e(99220),g=e(53043),a=e(71354),h=n.__importStar(e(72980)),d=e(17441),u=c=>c.get(o.IApplicationService).clientId;t.getClientId=u;let E=class{initialize(){this.extensionService.activate().then(()=>{const y=this.webviewService.registerWebviewReviver({handles:()=>0,revive:async b=>new Promise(A=>{this.eventBus.on(a.ExtensionApiReadyEvent,()=>{y.dispose(),A(this.webviewService.tryReviveWebviewComponent(b))})})})})}async onStart(){(0,o.runWhenIdle)(()=>{this.extensionService.runExtensionContributes()}),this.preferenceSettingsService.registerSettingGroup({id:"extension",title:(0,o.localize)("settings.group.extension"),iconClass:(0,o.getIcon)("extension")})}onDisposeSideEffects(){this.extensionNodeClient.disposeClientExtProcess(this.clientId,!1)}onReconnect(){this.extensionService.restartExtProcess(s.ERestartPolicy.WhenExit)}get clientId(){return(0,t.getClientId)(this.injector)}};t.ExtensionClientAppContribution=E,n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],E.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],E.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],E.prototype,"extensionNodeClient",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],E.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],E.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],E.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(m.IWebviewService),n.__metadata("design:type",Object)],E.prototype,"webviewService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionService),n.__metadata("design:type",s.ExtensionService)],E.prototype,"extensionService",void 0),t.ExtensionClientAppContribution=E=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],E);let f=class{registerCommands(y){y.registerCommand({id:"ext.restart",label:"%extension.host.restart%"},{execute:async()=>{this.logger.log("start restart ext host process"),await this.extensionService.restartExtProcess(),this.logger.log("end restart ext host process")}}),y.registerCommand(h.GET_EXTENSION,{execute:async b=>{const A=this.extensionInstanceManageService.getExtensionInstanceByExtId(b);return A&&A.toJSON()}}),this.registerVSCBuiltinCommands(y)}registerVSCBuiltinCommands(y){y.registerCommand(h.SET_CONTEXT,{execute:(b,A)=>{this.contextKeyService.createKey(String(b),A)}}),y.registerCommand(h.RELOAD_WINDOW_COMMAND,{execute:()=>{this.clientApp.fireOnReload()}}),y.registerCommand(s.EMIT_EXT_HOST_EVENT,{execute:async(b,...A)=>{await this.activationEventService.fireEvent("onEvent:"+b);const S=await this.eventBus.fireAndAwait(new a.ExtHostEvent({eventName:b,eventArgs:A})),D=[];return S.forEach(T=>{T.err?D.push(T):D.push(...T.result||[])}),D}}),y.registerCommand(h.SHOW_RUN_TIME_EXTENSION,{execute:async()=>{const b=await this.extensionService.getActivatedExtensions();this.quickOpenService.open({onType:(A,S)=>S(this.asQuickOpenItems(b))},{placeholder:"\u8FD0\u884C\u4E2D\u7684\u63D2\u4EF6",fuzzyMatchLabel:{enableSeparateSubstringMatching:!0}})}}),y.registerCommand(h.START_EXTENSION_HOST_PROFILER,{execute:async()=>{this.cpuProfileStatus||(this.cpuProfileStatus=this.statusBar.addElement("ExtensionHostProfile",{tooltip:(0,o.formatLocalize)("extension.profiling.clickStop","Click to stop profiling."),text:`$(sync~spin) ${(0,o.formatLocalize)("extension.profilingExtensionHost","Profiling Extension Host")}`,alignment:l.StatusBarAlignment.RIGHT,command:h.STOP_EXTENSION_HOST_PROFILER.id})),await this.extensionProfiler.$startProfile(this.clientId)},isPermitted:()=>!1}),y.registerCommand(h.STOP_EXTENSION_HOST_PROFILER,{execute:async()=>{const b=await this.extensionProfiler.$stopProfile(this.clientId);if(this.cpuProfileStatus&&(this.cpuProfileStatus.dispose(),this.cpuProfileStatus=null),b){const A=await this.dialogService.showSaveDialog({saveLabel:(0,o.formatLocalize)("extension.profile.save","Save Extension Host Profile"),showNameInput:!0,defaultFileName:`CPU-${new Date().toISOString().replace(/[\-:]/g,"")}.cpuprofile`});A?.codeUri&&await this.extensionProfiler.$saveLastProfile(A?.codeUri.fsPath)}},isPermitted:()=>!1}),y.registerCommand(h.COPY_FILE_PATH,{execute:async b=>{await this.commandService.executeCommand(o.FILE_COMMANDS.COPY_PATH.id,o.URI.from(b))}}),y.registerCommand(h.COPY_RELATIVE_FILE_PATH,{execute:async b=>{await this.commandService.executeCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,o.URI.from(b))}}),y.registerCommand(h.OPEN,{execute:(b,A,S)=>{const D=o.URI.from(b);return this.doOpenWith(D,A,S,void 0)}}),y.registerCommand(h.OPEN_WITH,{execute:(b,A,S)=>{const D=o.URI.from(b),T=A==="default"?void 0:{type:v.EditorOpenType.component,componentId:`${o.CUSTOM_EDITOR_SCHEME}-${A}`};return this.doOpenWith(D,S,void 0,T)}}),y.registerCommand(h.DIFF,{execute:(b,A,S,D)=>{const T={...(0,g.viewColumnToResourceOpenOptions)(D?.viewColumn),revealFirstDiff:!0,...D};return this.commandService.executeCommand(o.EDITOR_COMMANDS.COMPARE.id,{original:o.URI.from(b),modified:o.URI.from(A),name:S},T)}}),y.registerCommand({id:h.WALKTHROUGHS_COMMAND_GET_STARTED.id,category:(0,o.localize)("walkthroughs.welcome"),label:(0,o.localize)("walkthroughs.get.started")},{execute:async b=>{const A=this.walkthroughsService.getWalkthroughs();if(b)this.walkthroughsService.openWalkthroughEditor(b);else{const S=await this.quickPickService.show(A.map(D=>({label:D.title,value:D.id,description:D.source,detail:D.description})));S&&this.walkthroughsService.openWalkthroughEditor(S)}}}),[h.LAYOUT_COMMAND_MAXIMIZE_EDITOR,h.WORKBENCH_CLOSE_ACTIVE_EDITOR,h.REVERT_AND_CLOSE_ACTIVE_EDITOR,h.SPLIT_EDITOR_RIGHT,h.SPLIT_EDITOR_DOWN,h.EDITOR_NAVIGATE_BACK,h.EDITOR_NAVIGATE_FORWARD,h.EDITOR_SAVE_ALL,h.CLOSE_ALL_EDITORS,h.PREVIOUS_EDITOR,h.PREVIOUS_EDITOR_IN_GROUP,h.NEXT_EDITOR,h.NEXT_EDITOR_IN_GROUP,h.EVEN_EDITOR_WIDTH,h.CLOSE_OTHER_GROUPS,h.CLOSE_UNMODIFIED_EDITORS,h.LAST_EDITOR_IN_GROUP,h.OPEN_EDITOR_AT_INDEX,h.CLOSE_OTHER_EDITORS,h.NEW_UNTITLED_FILE,h.FILE_SAVE,h.SPLIT_EDITOR,h.SPLIT_EDITOR_ORTHOGONAL,h.NAVIGATE_LEFT,h.NAVIGATE_RIGHT,h.NAVIGATE_UP,h.NAVIGATE_DOWN,h.NAVIGATE_NEXT,h.REVERT_FILES,h.WORKBENCH_FOCUS_FILES_EXPLORER,h.WORKBENCH_FOCUS_ACTIVE_EDITOR_GROUP,h.API_OPEN_EDITOR_COMMAND_ID,h.API_OPEN_DIFF_EDITOR_COMMAND_ID,h.API_OPEN_WITH_EDITOR_COMMAND_ID,h.DEBUG_START,h.DEBUG_ADD,h.DEBUG_COMMAND_STEP_INTO,h.DEBUG_COMMAND_STEP_OVER,h.DEBUG_COMMAND_STEP_OUT,h.DEBUG_COMMAND_CONTINUE,h.DEBUG_COMMAND_RUN,h.DEBUG_COMMAND_START,h.DEBUG_COMMAND_PAUSE,h.DEBUG_COMMAND_RESTART,h.DEBUG_COMMAND_STOP,h.EDITOR_SHOW_ALL_SYMBOLS,h.SEARCH_COMMAND_OPEN_SEARCH,h.REVEAL_IN_EXPLORER,h.OPEN_FOLDER,h.SIDEBAR_TOGGLE_VISIBILITY,h.CLEAR_TERMINAL,h.TERMINAL_COMMAND_FOCUS,h.TERMINAL_COMMAND_TOGGLE_VISIBILITY,h.NEW_WORKBENCH_VIEW_TERMINAL,h.FILE_COMMAND_RENAME_FILE,h.MARKER_COMMAND_SHOW_ERRORS_WARNINGS,h.MARKER_COMMAND_TOGGLE_SHOW_ERRORS_WARNINGS,h.RELOAD_WINDOW,h.SETTINGS_COMMAND_OPEN_SETTINGS,h.SETTINGS_COMMAND_OPEN_GLOBAL_SETTINGS,h.SETTINGS_COMMAND_OPEN_SETTINGS_JSON,h.SETTINGS_COMMAND_OPEN_GLOBAL_OPEN_KEYMAPS,h.THEME_COMMAND_QUICK_SELECT,h.OPEN_MERGEEDITOR].forEach(b=>{y.registerCommand(b)})}doOpenWith(y,b,A,S){const[D,T]=b??[],w={};if(typeof D=="number"&&(w.groupIndex=D),T){if(w.focus=w.preserveFocus=T.preserveFocus,T.selection&&(0,g.isLikelyVscodeRange)(T.selection)&&(T.selection=(0,g.fromRange)(T.selection)),Array.isArray(T.selection)&&T.selection.length===2){const[I,R]=T.selection;w.range={startLineNumber:I.line+1,startColumn:I.character+1,endLineNumber:R.line+1,endColumn:R.character+1}}else w.range=T.selection;w.preview=T.preview}return S&&(w.forceOpenType=S),A&&(w.label=A),this.workbenchEditorService.open(y,w)}asQuickOpenItems(y){const b=y.node?y.node.map((S,D)=>this.toQuickOpenItem(S,"Node.js",D===0)):[],A=y.worker?y.worker.map((S,D)=>this.toQuickOpenItem(S,"Web Worker",D===0)):[];return[...b,...A]}toQuickOpenItem(y,b,A){const S=this.extensionInstanceManageService.getExtensionInstanceByExtId(y.id);return new o.QuickOpenItem({groupLabel:A?b:void 0,showBorder:!!A,label:(0,o.replaceLocalizePlaceholder)(y.displayName,y.id),description:(0,o.replaceLocalizePlaceholder)(y.description,y.id),detail:S?.realPath})}get clientId(){return(0,t.getClientId)(this.injector)}};t.ExtensionCommandContribution=f,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],f.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(a.IActivationEventService),n.__metadata("design:type",a.IActivationEventService)],f.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],f.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(o.QuickPickService),n.__metadata("design:type",Object)],f.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionHostProfilerServicePath),n.__metadata("design:type",Object)],f.prototype,"extensionProfiler",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],f.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(p.IWindowDialogService),n.__metadata("design:type",Object)],f.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],f.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],f.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],f.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(m.IWebviewService),n.__metadata("design:type",Object)],f.prototype,"webviewService",void 0),n.__decorate([(0,r.Autowired)(s.ExtensionService),n.__metadata("design:type",s.ExtensionService)],f.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(a.AbstractExtInstanceManagementService),n.__metadata("design:type",a.AbstractExtInstanceManagementService)],f.prototype,"extensionInstanceManageService",void 0),n.__decorate([(0,r.Autowired)(d.WalkthroughsService),n.__metadata("design:type",d.WalkthroughsService)],f.prototype,"walkthroughsService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],f.prototype,"logger",void 0),t.ExtensionCommandContribution=f=n.__decorate([(0,o.Domain)(o.CommandContribution)],f)},42734:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(40827),_=e(69734),v=e(99220),p=e(9663),m=e(71354),s=Symbol.for("metaDataSymbol");let g=class extends o.WithEventBus{constructor(h,d,u,E){super(),this.extensionData=h,this.isUseEnable=d,this.isBuiltin=u,this.isDevelopment=E,this.extraMetadata={},this._activated=!1,this.logger=(0,o.getDebugLogger)(),this.pkgLocalizedField=new Map,this._enabled=d,this.packageJSON=this.extensionData.packageJSON,this.defaultPkgNlsJSON=this.extensionData.defaultPkgNlsJSON,this.packageNlsJSON=this.extensionData.packageNlsJSON,this.id=this.extensionData.id,this.extensionId=this.extensionData.extensionId,this.name=this.packageJSON.name,this.extraMetadata=this.extensionData.extraMetadata,this.path=this.extensionData.path,this.uri=this.extensionData.uri,this.realPath=this.extensionData.realPath,this.extendConfig=this.extensionData.extendConfig||{},this.enableProposedApi=!!this.extensionData.packageJSON.enableProposedApi,this.extensionLocation=this.staticResourceService.resolveStaticResource(o.URI.from(this.uri)).codeUri,this.initialize()}localize(h){if(!this.pkgLocalizedField.get(h)){const d=(0,o.replaceNlsField)(this.packageJSON[h],this.id);return this.pkgLocalizedField.set(h,d),d||this.packageJSON[h]}return this.pkgLocalizedField.get(h)}get activated(){return this._activated}get enabled(){return this._enabled}set enabled(h){this._enabled=h}get icon(){return this.packageJSON.icon&&this.uri&&this.extensionLocation.toString()+`/${this.packageJSON.icon}`}async getDefaultIcon(){return await this.extensionNodeClient.getOpenVSXRegistry()+"/default-icon.png"}disable(){this._enabled&&(this.extMetadataService.dispose(),this._enabled=!1,super.dispose())}enable(){this._enabled||(this._enabled=!0)}initialize(){this._enabled&&(this.addDispose(this.extMetadataService),this.packageNlsJSON&&(0,o.registerLocalizationBundle)({...(0,o.getCurrentLanguageInfo)(),contents:this.packageNlsJSON},this.id),this.defaultPkgNlsJSON&&(0,o.registerLocalizationBundle)({languageId:"default",languageName:_.LOCALE_TYPES.EN_US,localizedLanguageName:"English",contents:this.defaultPkgNlsJSON},this.id),this.extMetadataService.initialize(this))}async activate(h=new Set){var d;const u=((d=this.packageJSON)===null||d===void 0?void 0:d.extensionDependencies)||[];h.add(this.extensionId);for(const f of u){const c=typeof f=="string"?f:Object.keys(f)[0];if(h.has(c))continue;const y=this.extensionInstanceManageService.getExtensionInstanceByExtId(c);y&&await y.activate(h)}if(this._activated)return;const E=await this.eventBus.fireAndAwait(new m.ExtensionWillActivateEvent(this));return E.length>0&&E[0].result?(this._activated=!0,Promise.resolve()):this._activating?this._activating.promise:(this._activating=new o.Deferred,this.extensionService.activeExtension(this).then(()=>{var f;this._activated=!0,this.eventBus.fire(new m.ExtensionDidActivatedEvent(this.toJSON())),(f=this._activating)===null||f===void 0||f.resolve()}).catch(f=>{var c;this.logger.error(f),this._activated=!1,(c=this._activating)===null||c===void 0||c.reject(f)}),this._activating.promise)}get contributes(){return this.packageJSON.contributes}reset(){this._activated=!1,this._activating=void 0}get displayName(){return this.localize("displayName")}toJSON(){return{id:this.id,extensionId:this.extensionId,name:this.name,displayName:this.displayName,activated:this.activated,enabled:this.enabled,packageJSON:this.packageJSON,defaultPkgNlsJSON:this.defaultPkgNlsJSON,packageNlsJSON:this.packageNlsJSON,path:this.path,realPath:this.realPath,isUseEnable:this.isUseEnable,extendConfig:this.extendConfig,enableProposedApi:this.enableProposedApi,extraMetadata:this.extraMetadata,isBuiltin:this.isBuiltin,isDevelopment:this.isDevelopment,extensionLocation:this.extensionLocation}}};t.Extension=g,n.__decorate([(0,r.Autowired)(p.ExtensionMetadataService),n.__metadata("design:type",p.ExtensionMetadataService)],g.prototype,"extMetadataService",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionService),n.__metadata("design:type",v.ExtensionService)],g.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.StaticResourceService)],g.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],g.prototype,"extensionInstanceManageService",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],g.prototype,"extensionNodeClient",void 0),t.Extension=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(s)),n.__param(1,(0,r.Optional)(Symbol())),n.__param(2,(0,r.Optional)(Symbol())),n.__param(3,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object,Boolean,Boolean,Boolean])],g)},87543:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionServiceImpl=void 0;const r=e(85608),o=r.__importDefault(e(12784)),l=e(76003),_=e(18740),v=e(76271),p=e(41869),m=e(68969),s=e(43718),g=e(66482),a=e(50492),h=e(84660),d=e(14951),u=e(72665),E=e(51500),f=e(99220),c=e(25600),y=e(46147),b=e(57962),A=e(6066),S=e(82389),D=e(71354),T=e(35321);let w=n=class extends s.WithEventBus{constructor(){super(),this.ready=new Map,this.isExtProcessRestarting=!1,this.isProgressShowing=!1,this.eagerExtensionsActivated=new p.Deferred,this.extensionScanDir=new Set,this.extensionCandidatePath=new Set,this.restartProgress=async(R=f.ERestartPolicy.Always)=>{const M=async x=>{this.disposeAllOverlayWindow(),x.onCancellationRequested(()=>{this.logger.log("[ext-restart]: ext process restart canceled"),this.isExtProcessRestarting=!1,this.isExtProcessWaitingForRestart=void 0,this.isProgressShowing=!1});try{await this.startExtProcess(!1)}catch(k){this.logger.error(`[ext-restart]: ext-host restart failure, error: ${k}`)}this.isExtProcessRestarting=!1,this.isExtProcessWaitingForRestart=void 0,this.isProgressShowing=!1,this.disposeAllOverlayWindow()};await this.channelHandler.awaitChannelReady(v.RPCServiceChannelPath);const O=this.isExtProcessWaitingForRestart||R;switch(this.logger.log("[ext-restart]: restart ext process, restart policy:",O),O){case f.ERestartPolicy.WhenExit:if(await this.getExtProcessPID()){this.logger.log("[ext-restart]: ext process is still running, skip");break}case f.ERestartPolicy.Always:if(this.isProgressShowing){this.logger.log("[ext-restart]: progress is already showing, skip");return}this.isProgressShowing=!0,await this.progressService.withProgress({location:s.ProgressLocation.Notification,title:(0,s.localize)("extension.exthostRestarting.content"),buttons:[{id:"extension.reload",label:(0,s.localize)("preference.general.language.change.refresh.now"),primary:!0,run:async()=>{this.clientApp.fireOnReload()},dispose:()=>{}}]},async()=>{this.extProcessRestartPromise=(0,s.createCancelablePromise)(M),await this.extProcessRestartPromise});break}this.isExtProcessRestarting=!1},this.restartDebounced=(0,o.default)(async()=>{await this.restartProgress()},500),this.addDispose(this.fileServiceClient.onWillActivateFileSystemProvider(async()=>(this.extensionMetaDataArr||await this.initExtensionMetaData(),this.activationEventService.getTopicsData("onFileSystem"))))}async getActivatedExtensions(){const R={};return this.nodeExtensionService.protocol&&(R.node=await this.nodeExtensionService.getActivatedExtensions()),this.workerExtensionService.protocol&&(R.worker=await this.workerExtensionService.getActivatedExtensions()),R}async onActivateExtension(R){await this.activationEventService.fireEvent(R.payload.topic,R.payload.data)}async onExtensionEnabled(R){const M=R.payload;await this.updateExtHostData(),await this.fireActivationEventsIfNeed(M.packageJSON.activationEvents)}async onExtensionUninstalled(){await this.updateExtHostData()}async activate(){await this.initExtensionMetaData();const R=new Set(this.allowedExtensionService.getAllowedExtensionIds()),M=this.extensionMetaDataArr.filter(k=>R.has(k.id)),O=this.extensionMetaDataArr.filter(k=>!R.has(k.id));if(await this.initExtensionInstanceData(M),await this.runEagerExtensionsContributes(),O.length>0){await this.allowedExtensionService.waitTrustDecided();const k=this.allowedExtensionService.filterExtensions(O);k.length>0&&await this.initExtensionInstanceData(k),await this.runEagerExtensionsContributes()}this.extensionMetaDataArr=this.allowedExtensionService.filterExtensions(this.extensionMetaDataArr),await this.setupExtensionNLSConfig(),this.doActivate();const x=()=>{this.logger.log("[ext-restart]: page visibility change, current:",document.visibilityState,"is waiting:",this.isExtProcessWaitingForRestart,"is restarting:",this.isExtProcessRestarting),document.visibilityState==="visible"&&this.isExtProcessWaitingForRestart&&!this.isExtProcessRestarting&&this.extProcessRestartHandler(this.isExtProcessWaitingForRestart)};document.addEventListener("visibilitychange",x,!1),this.addDispose(p.Disposable.create(()=>{document.removeEventListener("visibilitychange",x)}))}async setupExtensionNLSConfig(){const R=await this.extensionStoragePathServer.getLastStoragePath()||"",M=this.preferenceService.get(s.GeneralSettingsId.Language)||(0,s.getLanguageId)();await this.extensionNodeClient.setupNLSConfig(M,R)}async initExtensionMetaData(){const{extensionDir:R,extensionCandidate:M}=this.appConfig;R&&this.extensionScanDir.add(R),M&&M.forEach(O=>{this.extensionCandidatePath.add(O.path)}),await this.getExtensionsMetaData(Array.from(this.extensionScanDir),Array.from(this.extensionCandidatePath))}async initExtensionInstanceData(R){const M=R??this.extensionMetaDataArr;for(const x of M){const k=this.extensionInstanceManageService.checkIsBuiltin(x),F=this.extensionInstanceManageService.checkIsDevelopment(x),L=await this.extensionInstanceManageService.createExtensionInstance(x,k,F);L&&this.extensionInstanceManageService.addExtensionInstance(L),L?.contributes&&L.enabled&&(this.contributesService.register(L.id,L.contributes),this.sumiContributesService.register(L.id,L.packageJSON.sumiContributes||{}))}this.eventBus.fire(new D.ExtensionsInitializedEvent(this.extensionInstanceManageService.getExtensionInstances())),this.eventBus.fire(new g.DebugConfigurationsReadyEvent(void 0));const O=this.extensionInstanceManageService.getExtensionInstances();this.nodeExtensionService.updateExtensionData(O),this.workerExtensionService.updateExtensionData(O),this.viewExtensionService.initExtension(O)}async doActivate(){await this.workspaceService.whenReady,await this.extensionStorageService.whenReady,await this.viewExtensionService.activate(),await this.startExtProcess(!0);try{await this.eventBus.fireAndAwait(new D.ExtensionBeforeActivateEvent),await this.activationEventService.fireEvent("*")}catch(R){this.logger.error(`[Extension Activate Error],
|
|
33398
33398
|
${R.message||R}`)}finally{this.eagerExtensionsActivated.resolve(),this.activationEventService.fireEvent("onStartupFinished"),this.eventBus.fire(new D.ExtensionApiReadyEvent)}}async restartExtProcess(R=f.ERestartPolicy.Always){document.visibilityState==="visible"?this.extProcessRestartHandler(R):(this.logger.log("[ext-restart]: page is not visible, waiting for restart, policy:",R),this.isExtProcessWaitingForRestart=R)}disposeAllOverlayWindow(){var R,M;this.pCrashMessageModel&&((M=(R=this.pCrashMessageModel).cancel)===null||M===void 0||M.call(R),this.pCrashMessageModel=void 0)}async extProcessRestartHandler(R=f.ERestartPolicy.Always){if(this.isExtProcessRestarting&&R!==f.ERestartPolicy.Always){this.logger.log("[ext-restart]: ext process is restarting, skip");return}this.isExtProcessRestarting=!0,this.isExtProcessWaitingForRestart?this.restartDebounced():this.restartProgress(R)}async getExtProcessPID(){return await Promise.race([this.extensionNodeClient.pid().catch(async R=>(this.logger.error(`[ext-restart]: get ext process pid error, ${R}`),await(0,s.sleep)(200),null)),(0,s.sleep)(1e3).then(()=>null)])}async startExtProcess(R){if(R||(this.resetExtensionInstances(),this.disposeSumiViewExtension(),await this.disposeExtProcess()),await Promise.all([this.startNodeExtHost(R),this.startWorkerExtHost(R)]),!R&&(await this.rerunSumiViewExtensionContributes(),this.activationEventService.activatedEventSet.size)){const M=Array.from(this.activationEventService.activatedEventSet);this.activationEventService.activatedEventSet.clear(),await Promise.allSettled(M.map(O=>{const{topic:x,data:k}=JSON.parse(O);return this.logger.verbose("fireEvent","event.topic",x,"event.data",k),this.activationEventService.fireEvent(x,k)}))}}async startNodeExtHost(R){if(this.appConfig.noExtHost)return;const M=await this.nodeExtensionService.activate();this.extensionCommandManager.registerProxyCommandExecutor("node",M.get(y.MainThreadAPIIdentifier.MainThreadCommands)),R&&this.ready.set("node",this.nodeExtensionService.ready)}async startWorkerExtHost(R){if(this.appConfig.extWorkerHost)try{const M=await this.workerExtensionService.activate(this.appConfig.ignoreWorkerHostCors);this.extensionCommandManager.registerProxyCommandExecutor("worker",M.get(y.MainThreadAPIIdentifier.MainThreadCommands)),R&&this.ready.set("worker",this.workerExtensionService.ready)}catch(M){this.logger.error(`Worker host activate fail,
|
|
33399
33399
|
${M.message}`)}}async updateExtHostData(){const R=this.extensionInstanceManageService.getExtensionInstances();this.appConfig.noExtHost||await this.nodeExtensionService.updateExtensionData(R),this.appConfig.extWorkerHost&&await this.workerExtensionService.updateExtensionData(R)}async fireActivationEventsIfNeed(R){if(!Array.isArray(R)||!R.length)return;const M=["*","onStartupFinished"],O=R.filter(k=>k!=="*"),x=Array.from(this.activationEventService.activatedEventSet).map(k=>JSON.parse(k)).filter(({topic:k,data:F})=>O.find(L=>L===`${k}:${F}`));for(const k of M)R.includes(k)&&(this.logger.verbose(`Fire activation event ${k}`),this.activationEventService.fireEvent(k));for(const k of x){const{topic:F,data:L}=k;this.logger.verbose(`Fire activation event ${F}:${L}`),this.activationEventService.fireEvent(F,L)}await this.activateByWorkspaceContains(R)}async activateByWorkspaceContains(R){if(!Array.isArray(R)||!R.length)return;const M=[],O=[];for(const k of R)if(/^workspaceContains:/.test(k)){const F=k.substr(18);F.indexOf("*")>=0||F.indexOf("?")>=0?O.push(F):M.push(F)}const x=[];M.length&&x.push(this.workspaceService.containsSome(M)),O.length&&x.push((async()=>{try{return(await this.fileSearchService.find("",{rootUris:this.workspaceService.tryGetRoots().map(F=>new s.URI(F.uri).codeUri.fsPath),includePatterns:O,limit:1})).length>0}catch(k){return this.logger.error(k),!1}})()),x.length&&await Promise.all(x).then(k=>k.some(F=>F))&&this.activationEventService.fireEvent("workspaceContains",[...M,...O][0])}async getExtensionsMetaData(R,M){if(!this.extensionMetaDataArr){const O=await this.extensionNodeClient.getAllExtensions(R,M,(0,s.getLanguageId)(),n.extraMetadata);this.extensionMetaDataArr=O}return this.logger.log("extensions count:",this.extensionMetaDataArr.length),this.extensionMetaDataArr}async runEagerExtensionsContributes(){await Promise.all([this.contributesService.initialize(),this.sumiContributesService.initialize()]),this.commandRegistry.beforeExecuteCommand(async(R,M)=>(await this.activationEventService.fireEvent("onCommand",R),M)),this.eventBus.fire(new s.ExtensionDidContributes)}async runExtensionContributes(){const R=Array.from(this.extensionInstanceManageService.getExtensionInstances());Promise.all(R.map(M=>this.activateByWorkspaceContains(M.packageJSON.activationEvents))).catch(M=>this.logger.error(M))}whetherWebExtension({packageJSON:R}){const{browser:M,main:O}=R||{},x=!!this.appConfig.noExtHost;if(M&&!O)return!0;if(M&&O)return x;if(!M&&O)return!1;if(typeof R.contributes<"u"){for(const k of["debuggers","terminal","typescriptServerPlugins"])if(R.contributes.hasOwnProperty(k))return!1}return x}async activeExtension(R){const M=this.whetherWebExtension(R);M&&!this.appConfig.extWorkerHost&&this.logger.error("[extension.service]: has no ext worker host"),await Promise.all([this.nodeExtensionService.activeExtension(R,M),this.workerExtensionService.activeExtension(R,M)]),await this.viewExtensionService.activeExtension(R,this.nodeExtensionService.protocol),this.eventBus.fire(new s.ExtensionActivatedEvent({topic:"onExtensionActivated",data:{id:R.id}}))}resetExtensionInstances(){this.extensionInstanceManageService.resetExtensionInstances(),this.nodeExtensionService.disposeApiFactory(),this.workerExtensionService.disposeApiFactory()}disposeSumiViewExtension(){const R=Array.from(this.viewExtensionService.activatedViewExtensionMap.keys());this.extensionInstanceManageService.disposeExtensionInstancesByPath(R)}async rerunSumiViewExtensionContributes(){const{activatedViewExtensionMap:R}=this.viewExtensionService,M=Array.from(R.keys());await Promise.all(M.map(O=>{const x=this.extensionInstanceManageService.getExtensionInstanceByPath(O);x&&(x.initialize(),this.sumiContributesService.register(x.id,x.packageJSON.sumiContributes||{}))})),R.clear(),await Promise.all([this.contributesService.initialize(),this.sumiContributesService.initialize()])}async disposeExtProcess(){await this.nodeExtensionService.disposeProcess(),await this.workerExtensionService.disposeProcess()}async disposeExtensions(){this.extensionInstanceManageService.disposeExtensionInstances()}async executeExtensionCommand(R,M){var O;const x=this.extensionCommandManager.getExtensionCommandEnv(R);if(!x)throw new Error('No Command with id "'+R+'" is declared by extensions');return await((O=this.ready.get(x))===null||O===void 0?void 0:O.promise),this.extensionCommandManager.executeExtensionCommand(x,R,M)}get invalidReloadStrategy(){return this.corePreferences["application.invalidExthostReload"]}async $restartExtProcess(){this.logger.log("[ext-restart]: receive the command from the node side to restart the process"),await this.restartExtProcess(f.ERestartPolicy.Always)}async $processNotExist(){return this.logger.log("[ext-restart]: receive the command from the node side that the process does not exist"),this.$restartExtProcess(),"ok"}async showReloadWindow(){const R=(0,s.localize)("extension.invalidExthostReload.confirm.ok"),M=[R],O=this.invalidReloadStrategy==="ifRequired";O&&M.unshift((0,s.localize)("extension.invalidExthostReload.confirm.cancel")),await this.dialogService.info((0,s.localize)("extension.invalidExthostReload.confirm.content"),M,!!O)===R&&this.clientApp.fireOnReload()}async $processCrashRestart(){var R,M;this.pCrashMessageModel&&((M=(R=this.pCrashMessageModel).cancel)===null||M===void 0||M.call(R));const O=(0,s.localize)("common.yes"),x=[O],k=this.invalidReloadStrategy==="ifRequired";k&&x.unshift((0,s.localize)("common.no")),this.pCrashMessageModel=this.messageService.info((0,s.localize)("extension.crashedExthostReload.confirm"),x,!!k);const F=await this.pCrashMessageModel;this.pCrashMessageModel=void 0,F===O&&await this.restartExtProcess(f.ERestartPolicy.Always)}};t.ExtensionServiceImpl=w,w.extraMetadata={[f.LANGUAGE_BUNDLE_FIELD]:"./package.nls.json"},r.__decorate([(0,l.Autowired)(f.ExtensionNodeServiceServerPath),r.__metadata("design:type",Object)],w.prototype,"extensionNodeClient",void 0),r.__decorate([(0,l.Autowired)(p.AppConfig),r.__metadata("design:type",Object)],w.prototype,"appConfig",void 0),r.__decorate([(0,l.Autowired)(p.CommandRegistry),r.__metadata("design:type",Object)],w.prototype,"commandRegistry",void 0),r.__decorate([(0,l.Autowired)(D.IActivationEventService),r.__metadata("design:type",b.ActivationEventServiceImpl)],w.prototype,"activationEventService",void 0),r.__decorate([(0,l.Autowired)(E.IWorkspaceService),r.__metadata("design:type",Object)],w.prototype,"workspaceService",void 0),r.__decorate([(0,l.Autowired)(a.IExtensionStorageService),r.__metadata("design:type",Object)],w.prototype,"extensionStorageService",void 0),r.__decorate([(0,l.Autowired)(m.IProgressService),r.__metadata("design:type",Object)],w.prototype,"progressService",void 0),r.__decorate([(0,l.Autowired)(u.IDialogService),r.__metadata("design:type",Object)],w.prototype,"dialogService",void 0),r.__decorate([(0,l.Autowired)(p.IClientApp),r.__metadata("design:type",Object)],w.prototype,"clientApp",void 0),r.__decorate([(0,l.Autowired)(p.ILogger),r.__metadata("design:type",Object)],w.prototype,"logger",void 0),r.__decorate([(0,l.Autowired)(u.IMessageService),r.__metadata("design:type",Object)],w.prototype,"messageService",void 0),r.__decorate([(0,l.Autowired)(p.CorePreferences),r.__metadata("design:type",Object)],w.prototype,"corePreferences",void 0),r.__decorate([(0,l.Autowired)(c.AbstractWorkerExtProcessService),r.__metadata("design:type",c.AbstractWorkerExtProcessService)],w.prototype,"workerExtensionService",void 0),r.__decorate([(0,l.Autowired)(c.AbstractNodeExtProcessService),r.__metadata("design:type",c.AbstractNodeExtProcessService)],w.prototype,"nodeExtensionService",void 0),r.__decorate([(0,l.Autowired)(c.AbstractViewExtProcessService),r.__metadata("design:type",c.AbstractViewExtProcessService)],w.prototype,"viewExtensionService",void 0),r.__decorate([(0,l.Autowired)(f.IExtCommandManagement),r.__metadata("design:type",f.IExtCommandManagement)],w.prototype,"extensionCommandManager",void 0),r.__decorate([(0,l.Autowired)(D.AbstractExtInstanceManagementService),r.__metadata("design:type",D.AbstractExtInstanceManagementService)],w.prototype,"extensionInstanceManageService",void 0),r.__decorate([(0,l.Autowired)(h.FileSearchServicePath),r.__metadata("design:type",Object)],w.prototype,"fileSearchService",void 0),r.__decorate([(0,l.Autowired)(T.VSCodeContributesServiceToken),r.__metadata("design:type",T.VSCodeContributesService)],w.prototype,"contributesService",void 0),r.__decorate([(0,l.Autowired)(S.SumiContributionsServiceToken),r.__metadata("design:type",S.SumiContributionsService)],w.prototype,"sumiContributesService",void 0),r.__decorate([(0,l.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],w.prototype,"preferenceService",void 0),r.__decorate([(0,l.Autowired)(a.IExtensionStoragePathServer),r.__metadata("design:type",Object)],w.prototype,"extensionStoragePathServer",void 0),r.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),r.__metadata("design:type",l.Injector)],w.prototype,"injector",void 0),r.__decorate([(0,l.Autowired)(d.IFileServiceClient),r.__metadata("design:type",Object)],w.prototype,"fileServiceClient",void 0),r.__decorate([(0,l.Autowired)(A.AllowedExtensionService),r.__metadata("design:type",A.AllowedExtensionService)],w.prototype,"allowedExtensionService",void 0),r.__decorate([(0,l.Autowired)(_.WSChannelHandler),r.__metadata("design:type",_.WSChannelHandler)],w.prototype,"channelHandler",void 0),r.__decorate([(0,s.OnEvent)(p.ExtensionActivateEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[p.ExtensionActivateEvent]),r.__metadata("design:returntype",Promise)],w.prototype,"onActivateExtension",null),r.__decorate([(0,s.OnEvent)(D.ExtensionDidEnabledEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[D.ExtensionDidEnabledEvent]),r.__metadata("design:returntype",Promise)],w.prototype,"onExtensionEnabled",null),r.__decorate([(0,s.OnEvent)(D.ExtensionDidUninstalledEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",Promise)],w.prototype,"onExtensionUninstalled",null),t.ExtensionServiceImpl=w=n=r.__decorate([(0,l.Injectable)(),r.__metadata("design:paramtypes",[])],w)},40731:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_ALLOWED_EXTENSION_IDS=t.AllowedExtensionsContribution=t.AllowedExtensionService=t.ExtensionModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(97186),_=e(64582),v=e(84660),p=e(99220),m=e(25600),s=e(72464),g=e(57962),a=e(6066),h=e(87444),d=e(49413),u=e(98453),E=e(20670),f=e(90731),c=e(98736),y=e(62040),b=e(87543),A=e(70108),S=e(82389),D=e(71354),T=e(77385),w=e(35321);let I=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=[p.RequireInterceptorContribution,s.MainThreadExtenderContribution,a.AllowedExtensionsContribution],this.providers=[{token:a.AllowedExtensionService,useClass:a.AllowedExtensionService},{token:p.ExtensionService,useClass:b.ExtensionServiceImpl},{token:_.IDebugServer,useClass:T.ExtensionDebugService,override:!0},{token:l.DebugSessionContributionRegistry,useClass:T.ExtensionDebugSessionContributionRegistry,override:!0},{token:D.IActivationEventService,useClass:g.ActivationEventServiceImpl},{token:p.IExtCommandManagement,useClass:h.ExtCommandManagementImpl},{token:D.AbstractExtInstanceManagementService,useClass:d.ExtInstanceManagementService},{token:p.AbstractExtensionManagementService,useClass:u.ExtensionManagementService},{token:m.AbstractNodeExtProcessService,useClass:E.NodeExtProcessService},{token:m.AbstractWorkerExtProcessService,useClass:c.WorkerExtProcessService},{token:m.AbstractViewExtProcessService,useClass:f.ViewExtProcessService},{token:p.IRequireInterceptorService,useClass:p.RequireInterceptorService},{token:w.VSCodeContributesServiceToken,useClass:w.VSCodeContributesService},{token:S.SumiContributionsServiceToken,useClass:S.SumiContributionsService},{token:s.IMainThreadExtenderService,useClass:s.MainThreadExtenderService},y.ExtensionCommandContribution,y.ExtensionClientAppContribution,A.BrowserRequireInterceptorContribution],this.backServices=[{servicePath:p.ExtensionNodeServiceServerPath,clientToken:p.ExtensionService},{servicePath:v.FileSearchServicePath},{servicePath:p.ExtensionHostProfilerServicePath}]}};t.ExtensionModule=I,t.ExtensionModule=I=n.__decorate([(0,r.Injectable)()],I);var R=e(6066);Object.defineProperty(t,"AllowedExtensionService",{enumerable:!0,get:function(){return R.AllowedExtensionService}}),Object.defineProperty(t,"AllowedExtensionsContribution",{enumerable:!0,get:function(){return R.AllowedExtensionsContribution}}),Object.defineProperty(t,"DEFAULT_ALLOWED_EXTENSION_IDS",{enumerable:!0,get:function(){return R.DEFAULT_ALLOWED_EXTENSION_IDS}})},30824:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWorkerBootstrapUrl=void 0;var n=e(41869);Object.defineProperty(t,"getWorkerBootstrapUrl",{enumerable:!0,get:function(){return n.getWorkerBootstrapUrl}})},9663:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionMetadataService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(71354);let _=class extends o.Disposable{initialize(p){this.eventBus.fire(new o.ExtensionEnabledEvent(p.toJSON())),this.addDispose(this.registerActivationEvent(p))}registerActivationEvent(p){const{activationEvents:m=[]}=p.packageJSON,s=new o.Disposable;return m.forEach(g=>{g==="onUri"&&(g=`onUri:${p.id}`),s.addDispose(this.activationService.onEvent(g,async()=>{await p.activate()}))}),s}};t.ExtensionMetadataService=_,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],_.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.IActivationEventService)],_.prototype,"activationService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),t.ExtensionMetadataService=_=n.__decorate([(0,r.Injectable)({multiple:!0})],_)},54107:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProxiedDocument=r,t.createProxiedWindow=o;function e(){}function n(l,_){return typeof l[_]=="function"&&/^[a-z]/.test(_)?l[_].bind&&l[_].bind(l):l[_]}function r(l){return new Proxy(document,{get:(_,v)=>{switch(v){case"write":case"writeln":return e;case"querySelector":return p=>p==="head"?l:n(_,v)(p);default:return n(_,v)}}})}function o(l,_){return new Proxy(window,{get:(v,p)=>{switch(p){case"document":return l||r(_);default:return n(v,p)}}})}},70108:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRequireInterceptorContribution=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),l=n.__importDefault(e(25873)),_=e(41869),v=e(89953),p=e(57996),m={...o.default,...l.default};let s=class{registerRequireInterceptor(a){a.registerRequireInterceptor({moduleName:"React",load:()=>r.default}),a.registerRequireInterceptor({moduleName:"ReactDOM",load:()=>m}),a.registerRequireInterceptor({moduleName:"ReactDOMClient",load:()=>l.default}),a.registerRequireInterceptor({moduleName:"kaitian-browser",load:h=>(0,p.createBrowserApi)(h.injector,h.extension,h.rpcProtocol)}),a.registerRequireInterceptor({moduleName:"sumi-browser",load:h=>(0,p.createBrowserApi)(h.injector,h.extension,h.rpcProtocol)})}};t.BrowserRequireInterceptorContribution=s,t.BrowserRequireInterceptorContribution=s=n.__decorate([(0,_.Domain)(v.RequireInterceptorContribution)],s)},9438:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retargetEvents=o;const e=["onAbort","onAnimationCancel","onAnimationEnd","onAnimationIteration","onAuxClick","onBlur","onChange","onClick","onClose","onContextMenu","onDoubleClick","onError","onFocus","onGotPointerCapture","onInput","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadEnd","onLoadStart","onLostPointerCapture","onMouseDown","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerCancel","onPointerDown","onPointerEnter","onPointerLeave","onPointerMove","onPointerOut","onPointerOver","onPointerUp","onReset","onResize","onScroll","onSelect","onSelectionChange","onSelectStart","onSubmit","onTouchCancel","onTouchMove","onTouchStart","onTouchEnd","onTransitionCancel","onTransitionEnd","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onFocusOut"],n={onDoubleClick:"dblclick"},r={onInput:"onChange",onFocusOut:"onBlur",onSelectionChange:"onSelect"};function o(a){const h=[];return e.forEach(d=>{const u=s(d);function E(f){f.nativeEvent=f;const c=f.path||f.composedPath&&f.composedPath()||g(f.target);for(const y of c){let b=null;const A=_(y),S=l(y);if(S?b=S:b=p(A),A&&b&&m(f,d,b),A&&b&&r[d]&&m(f,r[d],b),f.cancelBubble||y===a)break}}a.addEventListener(u,E,!1),h.push(()=>{a.removeEventListener(u,E,!1)})}),()=>{h.forEach(d=>{d()})}}function l(a){return v(a,"__reactEventHandlers")}function _(a){return v(a,"_reactInternal")}function v(a,h){for(const d in a)if(a.hasOwnProperty(d)&&d.indexOf(h)!==-1)return a[d]}function p(a){if(a){if(a.memoizedProps)return a.memoizedProps;if(a._currentElement&&a._currentElement.props)return a._currentElement.props}}function m(a,h,d){a.persist=()=>{a.isPersistent=()=>!0},d[h]&&d[h](a)}function s(a){return n[a]?n[a]:a.replace(/^on/,"").toLowerCase()}function g(a){const h=[];for(;a;){if(h.push(a),a.tagName==="HTML")return h.push(document),h.push(window),h;a=a.parentElement}}},8403:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRoot=y;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=n.__importDefault(e(43144)),_=e(97267),v=e(41869),p=e(43718),m=e(52416),s=e(25600),g=e(26351),a=({root:b,children:A})=>l.default.createPortal(A,b);function h(b){return b.cloneNode(!0)}function d(b,A){const S=new MutationObserver(D=>{for(const T of D)if(T.type==="childList"){if(T.addedNodes.length>0)for(const w of Array.from(T.addedNodes))A.appendChild(w.cloneNode(!0));if(T.removedNodes.length>0)for(const w of Array.from(T.removedNodes))A.contains(w)&&A.removeChild(w)}});return S.observe(b,{childList:!0,subtree:!0}),{dispose:()=>{S.disconnect()}}}const u="@opensumi/ide-components";function E(b,A,S="alipay"){return(0,v.getCDNHref)(u,b,A,S)}function f(b){const A=document.createElement("link");return A.setAttribute("href",b),A.setAttribute("rel","stylesheet"),A}const c=({id:b,extensionId:A,children:S,proxiedHead:D,cdnType:T,styleSheet:w})=>{const I=(0,o.useRef)(null),[R,M]=o.default.useState(null),O=(0,v.useInjectable)(s.AbstractViewExtProcessService),x=(0,v.useInjectable)(m.IThemeService),k=(0,v.useInjectable)(m.IIconService),F=(0,v.useInjectable)(m.IProductIconService),[L,N]=(0,o.useState)(null);return(0,o.useEffect)(()=>{var U,W;const j=new v.DisposableCollection;if(I.current){const Q=I.current.attachShadow({mode:"open"});if(D){w?(D.appendChild(f(w.componentUri)),D.appendChild(f(w.iconfontUri))):(D.appendChild(f(E("dist/index.css",g.version,T))),D.appendChild(f(E("lib/icon/iconfont/iconfont.css",g.version,T))));const G=h(D);j.push(d(D,G));const Z=document.createElement("style");Z.id="icon-style",Z.innerHTML=(U=k.currentTheme)===null||U===void 0?void 0:U.styleSheetContent,G.appendChild(Z);const $=document.createElement("style");$.id=m.PRODUCT_ICON_STYLE_ID,$.innerHTML=((W=F.currentTheme)===null||W===void 0?void 0:W.styleSheetContent)||"",G.appendChild($),j.pushAll([k.onThemeChange(H=>{Z.innerHTML=H.styleSheetContent})]),Q.appendChild(G);const V=O.getPortalShadowRoot(A);V&&V.appendChild(D)}return R||M(Q),x.getCurrentTheme().then(G=>N(G.type)),j.push(x.onThemeChange(G=>{G.type&&G.type!==L&&N(G.type)})),j.dispose.bind(j)}},[]),o.default.createElement("div",{id:b,style:{width:"100%",height:"100%"},ref:I},R&&o.default.createElement(a,{root:R},o.default.createElement("div",{className:(0,r.default)((0,m.getThemeTypeSelector)(L),"shadow-context-wrapper","show-file-icons"),style:{width:"100%",height:"100%"}},S)))};function y(b,A,S,D,T,w,I){const R=b,{getIcon:M}=o.default.useContext(_.IconContext),O=(0,v.useInjectable)(v.LabelService),x=(0,o.useCallback)((k,F)=>O.getIcon(p.URI.parse(k),F),[]);return o.default.createElement(_.ComponentContextProvider,{value:{getIcon:M,localize:p.localize,getResourceIcon:x}},o.default.createElement(c,{id:`${A.id}-${D}`,extensionId:A.id,proxiedHead:T,cdnType:w,styleSheet:I},o.default.createElement(R,{...S})))}},31381:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KaitianBrowserCommand=void 0,t.createBrowserCommandsApiFactory=m;const n=e(85608),r=e(76003),o=e(8919),l=e(43718),_=e(21880),v=e(46147);let p=class{constructor(g){this.rpcProtocol=g,this.rpcProtocol&&(this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostCommands))}async executeCommand(g,a,...h){const d={id:a.id,extensionId:a.extensionId,isBuiltin:a.isBuiltin},u=this.commandRegistry.getCommand(g);if(this.proxy&&u)return this.proxy.$executeCommandWithExtensionInfo(g,d,...h);if(!this.commandRegistry.isPermittedCommand(g,d,...h))throw new Error(`Extension ${d.id} has not permit to execute ${g}`);try{return await this.monacoCommandService.executeCommand(g,...h)}catch(f){throw this.logger.error(f),f}}};t.KaitianBrowserCommand=p,n.__decorate([(0,r.Autowired)(_.ICommandServiceToken),n.__metadata("design:type",Object)],p.prototype,"monacoCommandService",void 0),n.__decorate([(0,r.Autowired)(l.CommandRegistry),n.__metadata("design:type",Object)],p.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.KaitianBrowserCommand=p=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],p);function m(s,g,a){const h=s.get(p,[a]);return{executeCommand(d,...u){return h.executeCommand(d,g,...u)}}}},25367:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBrowserComponents=v;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=n.__importStar(e(81878)),_=e(56405);function v(p,m){return p.get(o.AppConfig).useExperimentalShadowDom?new Proxy(l,{get(g,a){if(a==="Dialog"||a==="Overlay"){const h=l[a];return d=>r.default.createElement(_.PortalRoot,{otherProps:d,extensionId:m.id,original:h})}return g[a]}}):l}},73566:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(97558);let _=class extends l.AbstractSumiBrowserContributionRunner{run(p){const m=new o.Disposable;if(!this.injector.creatorMap.has(o.ChatAgentViewServiceToken))return this.logger.warn("Not found ChatAgentViewServiceToken"),m;const{chat:s}=this.contribution;return!s||!Array.isArray(s.view)||s.view.forEach(g=>{if(!g.id||!g.component)return;const{extendProtocol:a,extendService:h}=p.getExtensionExtendService(this.extension,g.id),d=`${this.extension.id}:${g.id}`;m.addDispose(this.chatAgentViewService.registerChatComponent({id:d,component:g.component,initialProps:{kaitianExtendService:h,kaitianExtendSet:a,sumiExtendService:h,sumiExtendSet:a}}))}),m}};t.ChatBrowserContributionRunner=_,n.__decorate([(0,r.Autowired)(o.ChatAgentViewServiceToken),n.__metadata("design:type",Object)],_.prototype,"chatAgentViewService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],_.prototype,"injector",void 0),t.ChatBrowserContributionRunner=_=n.__decorate([(0,r.Injectable)({multiple:!0})],_)},23561:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(54414),_=e(57517),v=e(63067),p=e(52416),m=e(97558);let s=class extends m.AbstractSumiBrowserContributionRunner{run(a){const h=new o.Disposable;return this.contribution.editor&&this.contribution.editor.view.forEach(d=>{h.addDispose(this.registerEditorComponent(d,a))}),h}registerEditorComponent(a,h){const d=new o.Disposable,{extendProtocol:u,extendService:E}=h.getExtensionExtendService(this.extension,a.id),f=a.scheme||o.Schemes.file;return d.addDispose(this.editorComponentRegistry.registerEditorComponent({uid:a.id,scheme:f,component:a.component,renderMode:a.renderMode},{kaitianExtendService:E,kaitianExtendSet:u,sumiExtendService:E,sumiExtendSet:u})),f===o.Schemes.file?d.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(f,(c,y)=>{let b=!1;if(a.fileExt&&a.fileExt.indexOf(c.uri.path.ext)>-1){if(!a.shouldPreview)return;a.shouldPreview(c.uri.path)&&(b=!0)}a.handles&&a.handles(c.uri.codeUri)&&(b=!0),b&&y.push({type:_.EditorOpenType.component,componentId:a.id,title:a.title||"\u9884\u89C8",weight:a.priority||10})})):d.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(f,(c,y)=>{a.handles&&!a.handles(c.uri.codeUri)||y.push({type:_.EditorOpenType.component,componentId:a.id,title:a.title||a.id,weight:a.priority||10})})),this.resourceService.registerResourceProvider({scheme:f,provideResource:c=>({uri:c,name:a.tabTitle||a.id,icon:a.tabIconPath?this.iconService.fromIcon(this.extension.path,a.tabIconPath,p.IconType.Background):""})}),d}};t.EditorBrowserContributionRunner=s,n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(l.ResourceService),n.__metadata("design:type",l.ResourceService)],s.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(_.EditorComponentRegistry),n.__metadata("design:type",_.EditorComponentRegistry)],s.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),t.EditorBrowserContributionRunner=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},85406:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSideBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(54414),_=e(57517),v=e(51553),p=e(97558);let m=class extends p.AbstractSumiBrowserContributionRunner{run(g){const a=new o.Disposable,h=this.contribution.editorSide;return h&&h.view.forEach(d=>{a.addDispose(this.registerEditorSideComponent(d,g))}),a}registerEditorSideComponent(g,a){const h=new o.Disposable,{extendProtocol:d,extendService:u}=a.getExtensionExtendService(this.extension,g.id);return h.addDispose(this.editorComponentRegistry.registerEditorSideWidget({id:g.id,side:g.side,component:g.component,initialProps:{kaitianExtendService:u,kaitianExtendSet:d,sumiExtendService:u,sumiExtendSet:d},displaysOnResource:()=>this.editorService.editorContextKeyService.match(g?.when)})),h}};t.EditorSideBrowserContributionRunner=m,n.__decorate([(0,r.Autowired)(_.EditorComponentRegistry),n.__metadata("design:type",_.EditorComponentRegistry)],m.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(l.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorServiceImpl)],m.prototype,"editorService",void 0),t.EditorSideBrowserContributionRunner=m=n.__decorate([(0,r.Injectable)({multiple:!0})],m)},31738:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumiBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(97558),_=e(73566),v=e(23561),p=e(85406),m=e(53728),s=e(15765);let g=class extends l.AbstractSumiBrowserContributionRunner{run(h){const d=new o.Disposable;return d.addDispose(this.injector.get(m.TabbarBrowserContributionRunner,[this.extension,this.contribution]).run(h)),d.addDispose(this.injector.get(v.EditorBrowserContributionRunner,[this.extension,this.contribution]).run(h)),d.addDispose(this.injector.get(p.EditorSideBrowserContributionRunner,[this.extension,this.contribution]).run(h)),d.addDispose(this.injector.get(s.ToolBarBrowserContributionRunner,[this.extension,this.contribution]).run(h)),d.addDispose(this.injector.get(_.ChatBrowserContributionRunner,[this.extension,this.contribution]).run(h)),d}};t.SumiBrowserContributionRunner=g,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],g.prototype,"injector",void 0),t.SumiBrowserContributionRunner=g=n.__decorate([(0,r.Injectable)({multiple:!0})],g)},53728:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(63067),v=e(52416),p=e(97558),m=["left","right","bottom","editor","toolBar"];let s=class extends p.AbstractSumiBrowserContributionRunner{run(a){const h=new l.Disposable;return this.contribution.left&&this.contribution.left.view.forEach(d=>{var u;h.addDispose(this.registerTabBar(d,a,(u=this.contribution.left)===null||u===void 0?void 0:u.type,"left"))}),this.contribution.right&&this.contribution.right.view.forEach(d=>{var u;h.addDispose(this.registerTabBar(d,a,(u=this.contribution.right)===null||u===void 0?void 0:u.type,"right"))}),this.contribution.bottom&&this.contribution.bottom.view.forEach(d=>{var u;h.addDispose(this.registerTabBar(d,a,(u=this.contribution.bottom)===null||u===void 0?void 0:u.type,"bottom"))}),Object.keys(this.contribution).forEach(d=>{var u;m.indexOf(d)===-1&&((u=this.contribution[d])===null||u===void 0?void 0:u.view).forEach(E=>{h.addDispose(this.registerTabBar(E,a,"replace"))})}),h}registerTabBar(a,h,d="add",u){const{extendProtocol:E,extendService:f}=h.getExtensionExtendService(this.extension,a.id),c=`${this.extension.id}:${a.id}`,y={kaitianExtendService:f,kaitianExtendSet:E,sumiExtendService:f,sumiExtendSet:E};return this.layoutService.viewReady.promise.then(()=>{var b;if(d==="add"){const{component:A,titleComponent:S}=a;this.layoutService.collectTabbarComponent([{id:c}],{...a,iconClass:a.icon?(0,o.getIcon)(a.icon):a.iconPath?this.iconService.fromIcon(this.extension.path,a.iconPath):"",containerId:c,component:A,titleComponent:S,titleProps:y,initialProps:y,fromExtension:!0},u)}else this.layoutService.replaceViewComponent(a,y),a.titleComponent&&((b=this.layoutService.getTabbarHandler(c))===null||b===void 0||b.setTitleComponent(a.titleComponent,y))}),{dispose:()=>{const b=this.layoutService.getTabbarHandler(c);b&&b.dispose()}}}};t.TabbarBrowserContributionRunner=s,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),t.TabbarBrowserContributionRunner=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},15765:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolBarBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(63067),_=e(52416),v=e(47289),p=e(97558);let m=class extends p.AbstractSumiBrowserContributionRunner{run(g){const a=new o.Disposable;return this.injector.creatorMap.has(v.IToolBarViewService)?(this.contribution.toolBar&&this.contribution.toolBar.view.forEach(h=>{const{extendProtocol:d,extendService:u}=g.getExtensionExtendService(this.extension,h.id),E=this.toolBarViewService.registerToolBarElement({type:"component",component:h.component,position:h.position||this.contribution.toolBar.position||v.ToolBarPosition.LEFT,initialProps:{kaitianExtendService:u,kaitianExtendSet:d,sumiExtendService:u,sumiExtendSet:d},description:h.description,order:h.order,weight:h.weight});E&&a.addDispose(E)}),a):(this.logger.warn("\u6CA1\u6709\u627E\u5230 toolbarViewService"),a)}};t.ToolBarBrowserContributionRunner=m,n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],m.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(v.IToolBarViewService),n.__metadata("design:type",v.IToolBarViewService)],m.prototype,"toolBarViewService",void 0),n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],m.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0),t.ToolBarBrowserContributionRunner=m=n.__decorate([(0,r.Injectable)({multiple:!0})],m)},57996:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBrowserApi=g;const n=e(41869),r=e(81878),o=e(57517),l=e(52416),_=e(16762),v=e(65046),p=e(31381),m=e(25367),{format:s}=n.strings;function g(a,h,d){const u=(0,p.createBrowserCommandsApiFactory)(a,h,d),E=(0,m.createBrowserComponents)(a,h),f=a.get(n.IReporterService);return{...E,commands:u,ResizeHandleHorizontal:r.ResizeHandleHorizontal,ResizeHandleVertical:r.ResizeHandleVertical,PlainWebview:v.PlainWebview,URI:n.URI,localize:(c,y)=>(0,n.localize)(c,y,h.id),formatLocalize:(c,...y)=>s((0,n.localize)(c,void 0,h.id),...y),getIcon:n.getIcon,getThemeColors:()=>{const y=a.get(l.IThemeService).getCurrentThemeSync();return(0,l.getColorRegistry)().getColors().reduce((A,S)=>{const D=y.getColor(S.id);return D&&(A[S.id.replace(".","-")]=D.toString()),A},{})},ToolBarPosition:_.ToolBarPosition,EditorComponentRenderMode:o.EditorComponentRenderMode,reporter:f}}},97558:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSumiBrowserContributionRunner=void 0;class e{constructor(r,o){this.extension=r,this.contribution=o}}t.AbstractSumiBrowserContributionRunner=e},56543:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){}};t.BrowserMainContributionPoint=_,_.schema={type:"string",defaultSnippets:[{body:"./out/browser/index.js"}],description:(0,o.localize)("sumiContributes.browserMain")},t.BrowserMainContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("browserMain"),(0,l.LifeCycle)(4)],_)},88770:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserViewContributionPoint=void 0;const r=e(85608),o=e(76003),l=e(41869),_=e(21634),v=e(43718),p=e(63067),m=e(52416),s=e(99220),g=e(17428),a=e(71354),h=["left","right","bottom","editor","toolBar","editorSide","chat"];let d=n=class extends s.VSCodeContributePoint{constructor(){super(...arguments),this.disposableCollection=new v.DisposableCollection}contribute(){return new Promise(E=>{this.mainLayoutService.viewReady.promise.then(()=>{var f;for(const c of this.contributesMap){const{extensionId:y,contributes:b}=c,A=this.extensionManageService.getExtensionInstanceByExtId(y);if(!A)continue;const S=Object.keys(b).filter(D=>!n.unsupportLocation.includes(D));for(let D of S){const T=b[D].view.map(w=>({...w,component:g.ExtensionLoadingView}));if(!h.includes(D))if(!this.mainLayoutService.getTabbarHandler(D))D="left";else{for(const w of T){w.titleComponentId&&(0,v.getDebugLogger)().warn(`custom title component '${w.titleComponentId}' is not allowed for built-in container ${D}!`);const{title:I,id:R,priority:M,component:O,when:x,weight:k}=w,F=((f=this.mainLayoutService.getTabbarHandler(D))===null||f===void 0?void 0:f.containerId)||D,L=this.mainLayoutService.collectViewComponent({id:R,priority:M,component:O,name:I,when:x,weight:k},F,{},{fromExtension:!0});this.disposableCollection.push({dispose:()=>{this.mainLayoutService.getTabbarHandler(L).disposeView(R)}})}continue}for(const w of T){const{title:I,icon:R,iconPath:M,id:O,priority:x,component:k,expanded:F,noResize:L,when:N,weight:U,hideTab:W}=w,j=`${y}:${O}`,Q=this.mainLayoutService.collectTabbarComponent([{id:O,priority:x,component:k,when:N,weight:U}],{iconClass:M?this.iconService.fromIcon(A.path,M):(0,l.getIcon)(R),title:I&&this.getLocalizeFromNlsJSON(I,y),priority:x,expanded:F,containerId:j,noResize:L,fromExtension:!0,hideTab:W},D);this.disposableCollection.push({dispose:()=>{this.mainLayoutService.getTabbarHandler(Q).dispose()}})}}}E()})})}};t.BrowserViewContributionPoint=d,d.schema=_.browserViews.schema,d.unsupportLocation=["bottom","editor","toolBar","chat"],r.__decorate([(0,o.Autowired)(p.IMainLayoutService),r.__metadata("design:type",Object)],d.prototype,"mainLayoutService",void 0),r.__decorate([(0,o.Autowired)(m.IIconService),r.__metadata("design:type",Object)],d.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(a.AbstractExtInstanceManagementService),r.__metadata("design:type",a.AbstractExtInstanceManagementService)],d.prototype,"extensionManageService",void 0),t.BrowserViewContributionPoint=d=n=r.__decorate([(0,o.Injectable)(),(0,s.Contributes)("browserViews"),(0,s.LifeCycle)(3)],d)},82389:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumiContributionsService=t.SumiContributionsServiceToken=void 0;const n=e(85608),r=e(76003),o=e(99220),l=e(56543),_=e(88770),v=e(35307),p=e(92097),m=e(75591),s=e(68360),g=e(52750),a=e(8678),h=e(43066),d=e(29337);t.SumiContributionsServiceToken=Symbol("SumiContributionsService");let u=class extends o.ExtensionContributesService{constructor(){super(...arguments),this.ContributionPoints=[_.BrowserViewContributionPoint,l.BrowserMainContributionPoint,m.NodeMainContributionPoint,d.WorkerMainContributionPoint,h.ViewsProxiesContributionPoint,p.MenubarsContributionPoint,g.SubmenusContributionPoint,a.ToolbarContributionPoint,v.MenuExtendContributionPoint,s.SCMContributionPoint]}};t.SumiContributionsService=u,t.SumiContributionsService=u=n.__decorate([(0,r.Injectable)()],u)},35307:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenuExtendContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(93899),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){for(const p of this.contributesMap){const{extensionId:m,contributes:s}=p;for(const g of Object.keys(s)){const a=s[g];this.addDispose(this.menuRegistry.registerMenuExtendInfo(g,a.map(h=>{var d;return{...h,extraDesc:this.getLocalizeFromNlsJSON((d=h?.extraDesc)!==null&&d!==void 0?d:"",m)}})))}}}};t.MenuExtendContributionPoint=_,n.__decorate([(0,r.Autowired)(o.IMenuRegistry),n.__metadata("design:type",o.IMenuRegistry)],_.prototype,"menuRegistry",void 0),t.MenuExtendContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("menu-extend"),(0,l.LifeCycle)(3)],_)},92097:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenubarsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(93899),_=e(43718),v=e(52416),p=e(99220),m=e(71354);let s=class extends p.VSCodeContributePoint{contribute(){for(const a of this.contributesMap){const{extensionId:h,contributes:d}=a,u=this.extensionManageService.getExtensionInstanceByExtId(h);if(u)for(const E of d){const f=u.icon?this.iconService.fromIcon("",u.icon,v.IconType.Background):(0,o.getIcon)("default-menu-icon");this.addDispose(this.menuRegistry.registerMenubarItem(E.id,{label:this.getLocalizeFromNlsJSON(E.title,h),order:E.order,nativeRole:E.nativeRole,iconClass:f}))}}}};t.MenubarsContributionPoint=s,s.schema={description:(0,_.localize)("sumiContributes.menubars"),type:"array",items:{type:"object",required:["id","title"],defaultSnippets:[{body:{id:"${1}",title:"${2}"}}],properties:{id:{type:"string",description:(0,_.localize)("sumiContributes.menubars.id")},title:{type:"string",description:(0,_.localize)("sumiContributes.menubars.title")},order:{type:"number",description:(0,_.localize)("sumiContributes.menubars.order")},nativeRole:{type:"string",description:(0,_.localize)("sumiContributes.menubars.order")}}}},n.__decorate([(0,r.Autowired)(l.IMenuRegistry),n.__metadata("design:type",l.IMenuRegistry)],s.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],s.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),t.MenubarsContributionPoint=s=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("menubars"),(0,p.LifeCycle)(3)],s)},75591:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){}};t.NodeMainContributionPoint=_,_.schema={type:"string",defaultSnippets:[{body:"./out/node/index.js"}],description:(0,o.localize)("sumiContributes.nodeMain")},t.NodeMainContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("nodeMain"),(0,l.LifeCycle)(4)],_)},68360:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCMContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(61656),_=e(99220);let v=class extends _.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{contributes:s}=m;if(s.additional){const{additional:g}=s;if(!g.input)return;const{input:a}=g;if(a.addonAfter||a.addonBefore)return;this.scmService.appendInputProps(a)}}}};t.SCMContributionPoint=v,v.schema={description:(0,o.localize)("sumiContributes.SCM"),type:"object",defaultSnippets:[{body:{additional:{input:{}}}}],properties:{additional:{type:"object",description:(0,o.localize)("sumiContributes.SCM.additional"),properties:{input:{type:"object",description:(0,o.localize)("sumiContributes.SCM.additional.input")}}}}},n.__decorate([(0,r.Autowired)(l.SCMService),n.__metadata("design:type",l.SCMService)],v.prototype,"scmService",void 0),t.SCMContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("scm"),(0,_.LifeCycle)(3)],v)},52750:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubmenusContributionPoint=void 0,t.isValidSubmenu=g;const n=e(85608),r=e(76003),o=e(57559),l=e(93899),_=e(43718),v=e(52416),p=e(99220),m=e(71354),s=e(35166);function g(h,d){if(!Array.isArray(h))return d.error((0,_.formatLocalize)("requirearray")),!1;for(const u of h){if(typeof u.id!="string")return d.error((0,_.formatLocalize)("requirestring","id")),!1;if(u.title&&typeof u.title!="string")return d.error((0,_.formatLocalize)("optstring","title")),!1;if(u.when&&typeof u.when!="string")return d.error((0,_.formatLocalize)("optstring","when")),!1;if(u.group&&typeof u.group!="string")return d.error((0,_.formatLocalize)("optstring","group")),!1}return!0}let a=class extends p.VSCodeContributePoint{contribute(){const d=console;for(const u of this.contributesMap){const{extensionId:E,contributes:f}=u,c=this.extensionManageService.getExtensionInstanceByExtId(E);if(c)for(const y of Object.keys(f)){const b=f[y];if(!g(b,console))return;const A=(0,s.parseMenuId)(y);if((0,_.isUndefined)(A)){d.warn((0,_.formatLocalize)("menuId.invalid","`{0}` is not a valid submenu identifier",y));return}for(const S of b){const[D,T]=(0,s.parseMenuGroup)(S.group);this.addDispose(this.menuRegistry.registerMenuItem(A,{submenu:S.id,label:S.title&&this.getLocalizeFromNlsJSON(S.title,E),iconClass:this.iconService.fromIcon(c.path,S.icon,v.IconType.Background),when:S.when,group:D,order:T,nativeRole:S.nativeRole}))}}}}};t.SubmenusContributionPoint=a,a.schema=o.menus.subMenusSchema,n.__decorate([(0,r.Autowired)(l.IMenuRegistry),n.__metadata("design:type",l.IMenuRegistry)],a.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],a.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],a.prototype,"extensionManageService",void 0),t.SubmenusContributionPoint=a=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("submenus"),(0,p.LifeCycle)(3)],a)},8678:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(9905),_=e(99220),v=e(71354),p=e(96710);let m=class extends _.VSCodeContributePoint{toLocalized(g,a,h){return a.reduce((d,u)=>(d[u]&&(d[u]=this.getLocalizeFromNlsJSON(d[u],h)),d),g)}contribute(){for(const g of this.contributesMap){const{extensionId:a,contributes:h}=g,d=this.extensionManageService.getExtensionInstanceByExtId(a);if(d){if(h.groups)for(const u of h.groups)this.addDispose(this.toolbarRegistry.registerToolbarActionGroup({id:u.id,preferredLocation:u.preferredLocation,weight:u.weight}));if(h.actions)for(const u of h.actions)switch(u.type){case"button":this.addDispose(this.kaitianExtToolbarService.registerToolbarButton(a,d.path,this.toLocalized(u,["title"],a)));break;case"select":this.addDispose(this.kaitianExtToolbarService.registerToolbarSelect(a,d.path,this.toLocalized(u,["description"],a)));break;case"dropdownButton":this.addDispose(this.kaitianExtToolbarService.registerToolbarDropdownButton(a,d.path,this.toLocalized(u,["description"],a)));break}}}}};t.ToolbarContributionPoint=m,m.schema=l.toolbar.schema,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.KaitianExtensionToolbarService)],m.prototype,"kaitianExtToolbarService",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarRegistry),n.__metadata("design:type",Object)],m.prototype,"toolbarRegistry",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.ToolbarContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("toolbar"),(0,_.LifeCycle)(3)],m)},43066:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsProxiesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){}};t.ViewsProxiesContributionPoint=_,_.schema={type:"array",markdownDescription:(0,o.localize)("sumiContributes.viewsProxies"),defaultSnippets:[{body:["${1}"]}],items:{type:"string"}},t.ViewsProxiesContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("viewsProxies"),(0,l.LifeCycle)(3)],_)},29337:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){}};t.WorkerMainContributionPoint=_,_.schema={type:"string",defaultSnippets:[{body:"./out/worker/index.js"}],description:(0,o.localize)("sumiContributes.workerMain")},t.WorkerMainContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("workerMain"),(0,l.LifeCycle)(4)],_)},28949:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSumiAPIFactory=g;const n=e(43718),r=e(95507),o=e(41062),l=e(59860),_=e(29127),v=e(13877),p=e(25740),m=e(96710),s=e(43837);function g(a,h){const d=new n.Disposable,u=h.get(v.MainThreadLifeCycle,[h]),E=h.get(p.MainThreadTheme,[a,h]);d.addDispose(E);const f=h.get(_.MainThreadLayout,[a]);d.addDispose(f);const c=h.get(l.MainThreadCommon,[a,h]);d.addDispose(c);const y=h.get(m.MainThreadToolbar);d.addDispose(y);const b=h.get(s.MainThreadIDEWindow,[a]);d.addDispose(b);const A=h.get(o.MainThreadChatAgents,[a,h]);return d.addDispose(A),a.set(r.MainThreadSumiAPIIdentifier.MainThreadLifecycle,u),a.set(r.MainThreadSumiAPIIdentifier.MainThreadTheme,E),a.set(r.MainThreadSumiAPIIdentifier.MainThreadLayout,f),a.set(r.MainThreadSumiAPIIdentifier.MainThreadCommon,c),a.set(r.MainThreadSumiAPIIdentifier.MainThreadToolbar,y),a.set(r.MainThreadSumiAPIIdentifier.MainThreadIDEWindow,b),a.set(r.MainThreadSumiAPIIdentifier.MainThreadChatAgents,A),()=>{d.dispose()}}},41062:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadChatAgents=void 0;const r=e(85608),o=e(76003),l=e(59347),_=e(77633),v=e(40111),p=e(19413),m=e(8919),s=e(43718),g=e(93062),a=e(95507);let h=class{get chatAgentService(){try{return this.injector.get(p.IChatAgentService)}catch{return null}}get inlineChatFeatureRegistry(){try{return this.injector.get(s.InlineChatFeatureRegistryToken)}catch{return null}}get chatInternalService(){try{return this.injector.get(l.ChatInternalService)}catch{return null}}constructor(u,E){this.injector=E,n.set(this,void 0),this.agents=new Map,this.pendingProgress=new Map,this.responsePartHandlePool=0,this.activeResponsePartPromises=new Map,r.__classPrivateFieldSet(this,n,u.getProxy(a.ExtHostSumiAPIIdentifier.ExtHostChatAgents),"f")}$registerInlineChatProvider(u,E,f){if(!this.inlineChatFeatureRegistry||!this.chatInternalService)return;const c=this.inlineChatFeatureRegistry.registerInteractiveInput({handleStrategy:()=>_.ERunStrategy.PREVIEW},{providePreviewStrategy:async(y,b,A,S)=>{var D;const T=new v.InlineChatController({enableCodeblockRender:!!f.enableCodeblockRender}),w=this.chatInternalService.createRequest(A,E),I=new g.SumiReadableStream;T.mountReadable(I);const R=O=>{if(S.isCancellationRequested){I.abort();return}I.emitData(O)};this.pendingProgress.set(w.requestId,R);const M={sessionId:(D=this.chatInternalService)===null||D===void 0?void 0:D.sessionModel.sessionId,requestId:w.requestId,message:w.message.prompt,command:w.message.command};return r.__classPrivateFieldGet(this,n,"f").$invokeAgent(u,M,{history:[]},S).then(O=>{if(!O){I.end();return}S.isCancellationRequested?I.abort():(O.errorDetails&&w.response.setErrorDetails(O.errorDetails),I.end())}).finally(()=>{this.pendingProgress.delete(w.requestId)}),T}});this.agents.set(u,{name:E,dispose:c.dispose})}$registerAgent(u,E,f){if(!this.chatAgentService)return;const c=this.chatAgentService.registerAgent({id:E,metadata:f,invoke:async(y,b,A,S)=>{var D;this.pendingProgress.set(y.requestId,b);try{return(D=await r.__classPrivateFieldGet(this,n,"f").$invokeAgent(u,y,{history:A.map(T=>({role:s.CoreMessgaeRoleMap[T.role],content:T.content.toString()}))},S))!==null&&D!==void 0?D:{}}finally{this.pendingProgress.delete(y.requestId)}},provideSlashCommands:async y=>{var b;return!((b=this.agents.get(u))===null||b===void 0)&&b.hasSlashCommands?r.__classPrivateFieldGet(this,n,"f").$provideSlashCommands(u,y):[]},provideFollowups:async(y,b)=>{var A;return!((A=this.agents.get(u))===null||A===void 0)&&A.hasFollowups?r.__classPrivateFieldGet(this,n,"f").$provideFollowups(u,y,b):[]},provideSampleQuestions:async y=>{var b;return!((b=this.agents.get(u))===null||b===void 0)&&b.hasSampleQuestions?r.__classPrivateFieldGet(this,n,"f").$provideSampleQuestions(u,y):[]},provideChatWelcomeMessage:async y=>{var b;if(!((b=this.agents.get(u))===null||b===void 0)&&b.hasChatWelcomMessage)return r.__classPrivateFieldGet(this,n,"f").$provideChatWelcomeMessage(u,y)}});this.agents.set(u,{name:E,dispose:c.dispose,hasSlashCommands:f.hasSlashCommands,hasFollowups:f.hasFollowups})}$updateAgent(u,E){if(!this.chatAgentService)return;const f=this.agents.get(u);if(!f)throw new Error(`No agent with handle ${u} registered`);f.hasSlashCommands=E.hasSlashCommands,f.hasFollowups=E.hasFollowups,f.hasSampleQuestions=E.hasSampleQuestions,f.hasChatWelcomMessage=E.hasChatWelcomMessage,f.isDefault=E.isDefault,this.chatAgentService.updateAgent(f.name,E)}async $handleProgressChunk(u,E,f){var c,y;if(E.kind==="asyncContent"){const b=++this.responsePartHandlePool,A=`${u}_${b}`,S=new s.Deferred;return this.activeResponsePartPromises.set(A,S),(c=this.pendingProgress.get(u))===null||c===void 0||c({...E,resolvedContent:S.promise}),b}else if(typeof f=="number"){const b=`${u}_${f}`,A=this.activeResponsePartPromises.get(b);return A&&(E.kind==="content"?A.resolve(E.content):E.kind==="treeData"&&A.resolve(E),this.activeResponsePartPromises.delete(b)),f}(y=this.pendingProgress.get(u))===null||y===void 0||y(E)}$unregisterAgent(u){var E;(E=this.agents.get(u))===null||E===void 0||E.dispose(),this.agents.delete(u)}$populateChatInput(u,E){if(!this.chatAgentService)return;const f=this.agents.get(u);if(!f)throw new Error(`No agent with handle ${u} registered`);this.chatAgentService.populateChatInput(f.name,{command:E.command,message:E.prompt})}$sendMessage(u){this.chatAgentService&&this.chatAgentService.sendMessage(u)}dispose(){this.agents.forEach(u=>{u.dispose()}),this.agents.clear()}};t.MainThreadChatAgents=h,n=new WeakMap,t.MainThreadChatAgents=h=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,o.Injector])],h)},59860:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommon=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(95507),p=e(71354);let m=class extends l.WithEventBus{constructor(g,a){super(),this.rpcProtocol=g,this.injector=a,this.subscribedEvent=new Set,this._proxy=this.rpcProtocol.getProxy(v.ExtHostSumiAPIIdentifier.ExtHostCommon)}onExtHostEvent(g){if(this.subscribedEvent.has(g.payload.eventName))return this._proxy.$acceptEvent(g.payload.eventName,g.payload.eventArgs)}async $subscribeEvent(g){this.subscribedEvent.add(g),this.addDispose(_.Disposable.create(()=>{this.$unSubscribeEvent(g)}))}async $unSubscribeEvent(g){this.subscribedEvent.delete(g)}};t.MainThreadCommon=m,n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],m.prototype,"themeService",void 0),n.__decorate([(0,l.OnEvent)(p.ExtHostEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[p.ExtHostEvent]),n.__metadata("design:returntype",void 0)],m.prototype,"onExtHostEvent",null),t.MainThreadCommon=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,r.Injector])],m)},29127:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLayout=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(63067),v=e(52416),p=e(95507);let m=class extends l.Disposable{constructor(g){super(),this.handlerMap=new Map,this.proxy=g.getProxy(p.ExtHostSumiAPIIdentifier.ExtHostLayout)}$setTitle(g,a){var h;(h=this.getHandler(g))===null||h===void 0||h.updateTitle(a)}$setIcon(g,a){var h;const d=this.iconService.fromIcon("",a,v.IconType.Background,v.IconShape.Square);(h=this.getHandler(g))===null||h===void 0||h.setIconClass(d)}$setSize(g,a){var h;(h=this.getHandler(g))===null||h===void 0||h.setSize(a)}$activate(g){var a;(a=this.getHandler(g))===null||a===void 0||a.activate()}$deactivate(g){var a;(a=this.getHandler(g))===null||a===void 0||a.deactivate()}$setBadge(g,a){var h;(h=this.getHandler(g))===null||h===void 0||h.setBadge(a)}async $setVisible(g,a){var h,d,u,E;a?(h=this.getHandler(g))===null||h===void 0||h.show():(!((d=this.getHandler(g))===null||d===void 0)&&d.isActivated()&&((u=this.getHandler(g))===null||u===void 0||u.deactivate()),(E=this.getHandler(g))===null||E===void 0||E.hide())}async $connectTabbar(g){if(!this.handlerMap.has(g)){const a=this.layoutService.getTabbarHandler(g);if(a)this.bindHandleEvents(a);else{const h=this.eventBus.on(_.TabBarRegistrationEvent,d=>{if(d.payload.tabBarId===g){const u=this.layoutService.getTabbarHandler(g);u&&this.bindHandleEvents(u),h.dispose()}});this.addDispose(h)}}}async $isAttached(g){return!!this.layoutService.getTabbarHandler(g)}bindHandleEvents(g){this.handlerMap.set(g.containerId,g),g.onActivate(()=>{this.proxy.$acceptMessage(g.containerId,"activate")}),g.onInActivate(()=>{this.proxy.$acceptMessage(g.containerId,"deactivate")})}getHandler(g){const a=this.layoutService.getTabbarHandler(g);return a||this.logger.warn(`Could not find a handler with \`${g}\``),a}};t.MainThreadLayout=m,n.__decorate([(0,r.Autowired)(_.IMainLayoutService),n.__metadata("design:type",Object)],m.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],m.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],m.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.MainThreadLayout=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],m)},13877:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLifeCycle=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(37406),_=e(39156);let v=class{constructor(m){this.injector=m}$setExtensionCandidate(m){this.appConfig.isElectronRenderer?this.injector.get(l.IElectronMainLifeCycleService).setExtensionCandidate(m,o.electronEnv.currentWindowId):(0,_.throwNonElectronError)("MainThreadLifeCycle.$setExtensionCandidate")}$setExtensionDir(m){this.appConfig.isElectronRenderer?this.injector.get(l.IElectronMainLifeCycleService).setExtensionDir(m,o.electronEnv.currentWindowId):(0,_.throwNonElectronError)("MainThreadLifeCycle.$setExtensionDir")}};t.MainThreadLifeCycle=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"appConfig",void 0),t.MainThreadLifeCycle=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[r.Injector])],v)},25740:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTheme=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(52416),v=e(95507);let p=class extends l.Disposable{constructor(s,g){super(),this.rpcProtocol=s,this.injector=g,this._proxy=this.rpcProtocol.getProxy(v.ExtHostSumiAPIIdentifier.ExtHostTheme),this.addDispose(this.themeService.onThemeChange(()=>{this._proxy.$notifyThemeChanged()}))}async $getThemeColors(){const s=this.themeService.getCurrentThemeSync();return(0,_.getColorRegistry)().getColors().reduce((a,h)=>{const d=s.getColor(h.id);return d&&(a[h.id.replace(".","-")]=d.toString()),a},{})}};t.MainThreadTheme=p,n.__decorate([(0,r.Autowired)(_.IThemeService),n.__metadata("design:type",Object)],p.prototype,"themeService",void 0),t.MainThreadTheme=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,r.Injector])],p)},96710:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadToolbar=t.KaitianExtensionToolbarService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(52416),_=e(99220),v=e(90888),p=e(17428);let m=class{constructor(){this.btnDelegates=new Map,this.selectDelegates=new Map,this.dropdownButtonDelegates=new Map,this.connected=new Set,this.commandRegistry.registerCommand({id:v.BUTTON_SET_STATE_ID},{execute:(a,h,d)=>{this.btnDelegates.has(a)&&this.btnDelegates.get(a).setState(h,d)}}),this.commandRegistry.registerCommand({id:v.BUTTON_SET_CONTEXT_ID},{execute:(a,h)=>{if(this.btnDelegates.has(a)){const d=this.btnDelegates.get(a);d&&d.setContext(h)}}}),this.commandRegistry.registerCommand({id:v.BUTTON_CONNECT_HANDLE_ID},{execute:a=>{this.connected.has(a)||(this.doConnectToolbarButtonHandle(a),this.connected.add(a))}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_STATE_ID},{execute:(a,h)=>{this.selectDelegates.has(a)&&this.selectDelegates.get(a).setState(h)}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_OPTIONS},{execute:(a,h,d)=>{this.selectDelegates.has(a)&&(d.forEach(u=>{u.iconPath&&(u.iconClass=this.iconService.fromIcon(h,u.iconPath,u.iconMaskMode?l.IconType.Mask:l.IconType.Background))}),this.selectDelegates.get(a).setOptions(d))}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_SELECT_ID},{execute:(a,h)=>{this.selectDelegates.has(a)&&this.selectDelegates.get(a).setSelect(h)}}),this.commandRegistry.registerCommand({id:v.SELECT_CONNECT_HANDLE_ID},{execute:a=>{if(this.connected.has(a)||(this.doConnectToolbarSelectHandle(a),this.connected.add(a)),this.selectDelegates.get(a))return this.selectDelegates.get(a).getValue()}}),this.commandRegistry.registerCommand({id:v.SHOW_POPOVER_ID},{execute:(a,h)=>{this.btnDelegates.has(a)&&this.btnDelegates.get(a).showPopOver(h)}}),this.commandRegistry.registerCommand({id:v.HIDE_POPOVER_ID},{execute:a=>{this.btnDelegates.has(a)&&this.btnDelegates.get(a).hidePopOver()}})}getPopoverComponent(a,h){const d=()=>{var u,E,f,c;return(0,p.ExtensionLoadingView)({style:{minHeight:!((u=h.popoverStyle)===null||u===void 0)&&u.minHeight?Number((E=h.popoverStyle)===null||E===void 0?void 0:E.minHeight):200,minWidth:!((f=h.popoverStyle)===null||f===void 0)&&f.minWidth?Number((c=h.popoverStyle)===null||c===void 0?void 0:c.minWidth):300}})};return this.toolbarPopover.getComponent(a)||d}registerToolbarButton(a,h,d){const u=a+"."+d.id,E={};return d.states&&Object.keys(d.states).forEach(f=>{const c=d.states[f];E[f]={...c},c.iconPath&&(E[f].iconClass=this.iconService.fromIcon(h,c.iconPath,c.iconMaskMode?l.IconType.Mask:l.IconType.Background))}),this.toolbarRegistry.registerToolbarAction({id:u,preferredPosition:d.preferredPosition,strictPosition:d.strictPosition,description:d.description||d.title||u,weight:d.weight,when:d.when,component:(0,o.createToolbarActionBtn)({id:u,popoverId:`${a}:${d.popoverComponent}`,title:d.title,styles:E,defaultState:d.defaultState,iconClass:this.iconService.fromIcon(h,d.iconPath,d.iconMaskMode?l.IconType.Mask:l.IconType.Background),popoverComponent:d.popoverComponent?this.getPopoverComponent(`${a}:${d.popoverComponent}`,d):void 0,popoverStyle:d.popoverStyle||{noContainerStyle:!1},delegate:f=>{f&&(this.btnDelegates.set(u,f),d.command&&f.onClick(async()=>{f.showPopOver(),await this.eventBus.fireAndAwait(new o.ExtensionActivateEvent({topic:"onAction",data:d.id})),this.commandService.executeCommand(d.command)}),this.connected.has(u)&&this.doConnectToolbarButtonHandle(u))}})})}doConnectToolbarButtonHandle(a){const h=this.btnDelegates.get(a);h&&(h.onClick(()=>this.commandService.executeCommand(_.EMIT_EXT_HOST_EVENT.id,v.BUTTON_CLICK_ID,a)),h.onChangeState(d=>this.commandService.executeCommand(_.EMIT_EXT_HOST_EVENT.id,v.BUTTON_STATE_CHANGE_ID,a,d)))}registerToolbarSelect(a,h,d){const u=a+"."+d.id,E=d.options||[];return E.forEach(f=>{f.iconPath&&(f.iconClass=this.iconService.fromIcon(h,f.iconPath,f.iconMaskMode?l.IconType.Mask:l.IconType.Background))}),this.toolbarRegistry.registerToolbarAction({id:u,preferredPosition:d.preferredPosition,strictPosition:d.strictPosition,description:d.description,component:(0,o.createToolbarActionSelect)({styles:d.states,options:E,defaultState:d.defaultState,defaultValue:d.defaultValue,equals:d.optionEqualityKey?(f,c)=>{const y=d.optionEqualityKey;return!f||!c?f===c:f[y]===c[y]}:void 0,delegate:f=>{f&&(this.selectDelegates.set(u,f),d.command&&f.onSelect(c=>{this.commandService.executeCommand(d.command,c)}),this.connected.has(u)&&this.doConnectToolbarSelectHandle(u))}})})}doConnectToolbarSelectHandle(a){const h=this.selectDelegates.get(a);h&&(h.onSelect(d=>this.commandService.executeCommand(_.EMIT_EXT_HOST_EVENT.id,v.SELECT_ON_SELECT_ID,a,d)),h.onChangeState(d=>this.commandService.executeCommand(_.EMIT_EXT_HOST_EVENT.id,v.SELECT_STATE_CHANGE_ID,a,d)))}registerToolbarDropdownButton(a,h,d){const u=a+"."+d.id,E=d.options||[];return this.toolbarRegistry.registerToolbarAction({id:u,preferredPosition:d.preferredPosition,strictPosition:d.strictPosition,description:d.description,component:(0,o.createToolbarActionDropdownButton)({options:E,trigger:d.trigger,delegate:f=>{f&&(this.dropdownButtonDelegates.set(u,f),d.command&&f.onSelect(c=>{this.commandService.executeCommand(d.command,c)}),this.connected.has(u)&&this.doConnectToolbarDropdownButtonHandle(u))}})})}doConnectToolbarDropdownButtonHandle(a){const h=this.selectDelegates.get(a);h&&h.onSelect(d=>this.commandService.executeCommand(_.EMIT_EXT_HOST_EVENT.id,v.DROPDOWN_BUTTON_ON_SELECT_ID,a,d))}};t.KaitianExtensionToolbarService=m,n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],m.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarPopoverRegistry),n.__metadata("design:type",Object)],m.prototype,"toolbarPopover",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarRegistry),n.__metadata("design:type",Object)],m.prototype,"toolbarRegistry",void 0),n.__decorate([(0,r.Autowired)(l.IIconService),n.__metadata("design:type",Object)],m.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],m.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),t.KaitianExtensionToolbarService=m=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],m);let s=class extends o.Disposable{$registerToolbarButtonAction(a,h,d){return this.addDispose(this.toolbarService.registerToolbarButton(a,h,d)),Promise.resolve()}$registerToolbarSelectAction(a,h,d){return this.addDispose(this.toolbarService.registerToolbarSelect(a,h,d)),Promise.resolve()}$registerDropdownButtonAction(a,h,d){return this.addDispose(this.toolbarService.registerToolbarDropdownButton(a,h,d)),Promise.resolve()}};t.MainThreadToolbar=s,n.__decorate([(0,r.Autowired)(m),n.__metadata("design:type",m)],s.prototype,"toolbarService",void 0),t.MainThreadToolbar=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},43837:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadIDEWindow=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(65046),v=e(95507);let p=class extends l.Disposable{constructor(s){super(),this.rpcProtocol=s,this._plainWebviewWindowMap=new Map,this._proxy=this.rpcProtocol.getProxy(v.ExtHostSumiAPIIdentifier.ExtHostIDEWindow),window.onbeforeunload=()=>{this.dispose()}}async $createWebviewWindow(s,g,a){let h;return this._plainWebviewWindowMap.has(s)?h=this._plainWebviewWindowMap.get(s):(h=this.webviewService.createWebviewWindow(g,a),h&&(this.disposables.push(h.onMessage(d=>{this._proxy.$postMessage(s,d)})),this.disposables.push(h.onClosed(d=>{this._proxy.$dispatchClosed(s),this.$destroy(s)})),this.disposables.push(h),this._plainWebviewWindowMap.set(s,h))),await h.ready,{windowId:h.windowId,webContentsId:h.webContentsId}}async $show(s){if(this._plainWebviewWindowMap.has(s)){const g=this._plainWebviewWindowMap.get(s);g?.show()}}async $hide(s){if(this._plainWebviewWindowMap.has(s)){const g=this._plainWebviewWindowMap.get(s);g?.hide()}}async $setSize(s,g){if(this._plainWebviewWindowMap.has(s)){const a=this._plainWebviewWindowMap.get(s);a?.setSize(g)}}async $postMessage(s,g){if(this._plainWebviewWindowMap.has(s)){const a=this._plainWebviewWindowMap.get(s);a?.postMessage(g)}}async $setAlwaysOnTop(s,g){if(this._plainWebviewWindowMap.has(s)){const a=this._plainWebviewWindowMap.get(s);a?.setAlwaysOnTop(g)}}async $loadURL(s,g){if(this._plainWebviewWindowMap.has(s)){const a=this._plainWebviewWindowMap.get(s);a?.loadURL(g)}}async $destroy(s){if(this._plainWebviewWindowMap.has(s)){const g=this._plainWebviewWindowMap.get(s);g?.dispose(),this._plainWebviewWindowMap.delete(s)}}};t.MainThreadIDEWindow=p,n.__decorate([(0,r.Autowired)(_.IWebviewService),n.__metadata("design:type",Object)],p.prototype,"webviewService",void 0),t.MainThreadIDEWindow=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],p)},71354:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDidEnabledEvent=t.ExtensionDidUninstalledEvent=t.ExtensionsInitializedEvent=t.ExtensionDidActivatedEvent=t.ExtensionWillContributeEvent=t.ExtensionWillActivateEvent=t.ExtensionBeforeActivateEvent=t.ExtensionApiReadyEvent=t.AbstractExtInstanceManagementService=t.IActivationEventService=t.ExtHostEvent=void 0;const n=e(85608),r=e(76003),o=e(43718);class l extends o.BasicEvent{}t.ExtHostEvent=l;let _=class{};t.IActivationEventService=_,t.IActivationEventService=_=n.__decorate([(0,r.Injectable)()],_);class v{}t.AbstractExtInstanceManagementService=v;class p extends o.BasicEvent{}t.ExtensionApiReadyEvent=p;class m extends o.BasicEvent{}t.ExtensionBeforeActivateEvent=m;class s extends o.BasicEvent{}t.ExtensionWillActivateEvent=s;class g extends o.BasicEvent{}t.ExtensionWillContributeEvent=g;class a extends o.BasicEvent{}t.ExtensionDidActivatedEvent=a;class h extends o.BasicEvent{}t.ExtensionsInitializedEvent=h;class d extends o.BasicEvent{}t.ExtensionDidUninstalledEvent=d;class u extends o.BasicEvent{}t.ExtensionDidEnabledEvent=u},21259:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugAdapterContribution=void 0;class e{constructor(r,o,l){this.description=r,this.extDebug=o,this.activationEventService=l}get type(){return this.description.type}get label(){return this.description.label}get languages(){return this.extDebug.$getSupportedLanguages(this.type)}async getSchemaAttributes(){return await this.extDebug.$getSchemaAttributes(this.type)}async getConfigurationSnippets(){return await this.extDebug.$getConfigurationSnippets(this.type)}async provideDebugConfigurations(r,o,l){return await this.extDebug.$provideDebugConfigurations(this.type,r,o,l)}async getDebugConfigurationProvidersCount(r){return await this.extDebug.$getDebugConfigurationProvidersCount(this.type,r)}async resolveDebugConfiguration(r,o){return await this.extDebug.$resolveDebugConfigurations(r,o)}async resolveDebugConfigurationWithSubstitutedVariables(r,o){return await this.extDebug.$resolveDebugConfigurationWithSubstitutedVariables(r,o)}async createDebugSession(r){const{configuration:o}=r;return await this.activationEventService.fireEvent("onDebugAdapterProtocolTracker",o.type),await this.extDebug.$createDebugSession({...r,parentSession:void 0,parent:r.parentSession?r.parentSession.id:void 0})}async terminateDebugSession(r){await this.extDebug.$terminateDebugSession(r)}}t.ExtensionDebugAdapterContribution=e},90384:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(66482),_=e(37499),v=e(51500),p=e(51328),m=e(71354);let s=class{constructor(){this.contributors=new Map,this.toDispose=new o.DisposableCollection,this.sessionId2contrib=new Map,this.activationEvents=new Set,this.init()}init(){this.debugSessionManager.onWillStartDebugSession(a=>this.ensureDebugActivation(a)),this.debugSessionManager.onWillResolveDebugConfiguration(a=>this.ensureDebugActivation(a,"onDebugResolve",a.debugType)),this.debugConfigurationManager.onWillProvideDebugConfiguration(a=>this.ensureDebugActivation(a,"onDebugInitialConfigurations")),this.toDispose.pushAll([o.Disposable.create(()=>{for(const a of this.sessionId2contrib.keys())this.sessionId2contrib.get(a).terminateDebugSession(a);this.sessionId2contrib.clear()})])}registerDebugAdapterContribution(a){const{type:h}=a;return this.contributors.has(h)?(this.logger.warn(`Debugger with type '${h}' already registered.`),o.Disposable.NULL):(this.contributors.set(h,a),o.Disposable.create(()=>this.unregisterDebugAdapterContribution(h)))}unregisterDebugAdapterContribution(a){this.contributors.delete(a)}ensureDebugActivation(a,h,d){typeof a.waitUntil=="function"&&a.waitUntil(this.activateByDebug(h,d))}async activateByDebug(a,h){const d=[this.activationEventService.fireEvent("onDebug")];a&&(d.push(this.activationEventService.fireEvent(a)),h&&d.push(this.activationEventService.fireEvent(a,h))),await Promise.all(d)}async debugTypes(){return Array.from(this.contributors.keys())}async provideDebugConfigurations(a,h,d){const u=this.contributors.get(a);return u?u.provideDebugConfigurations&&u.provideDebugConfigurations(h,void 0,d)||[]:[]}async getDynamicConfigurationsSupportTypes(){const a=new Set;this.extInstanceManagementService.getExtensionInstances().forEach(h=>{var d,u;const E=h.packageJSON,f="onDebugDynamicConfigurations";if(!E.activationEvents)return;const c=[];let y=!1;for(const b of E.activationEvents)b===f?y=!0:b.startsWith(`${f}:`)&&c.push(b.slice(f.length+1));if(c.length)c.forEach(b=>a.add(b));else if(y){const b=(u=(d=E.contributes)===null||d===void 0?void 0:d.debuggers)===null||u===void 0?void 0:u[0].type;b&&a.add(b)}});for(const[h,d]of this.contributors)await d.getDebugConfigurationProvidersCount(p.DebugConfigurationProviderTriggerKind.Dynamic)>0&&a.add(h);return Array.from(a)}async resolveDebugConfiguration(a,h){const d=this.contributors.get(a.type);if(d)try{return await d.resolveDebugConfiguration(a,h)}catch(u){this.logger.error(u)}}async resolveDebugConfigurationWithSubstitutedVariables(a,h){const d=this.contributors.get(a.type);if(d)try{return await d.resolveDebugConfigurationWithSubstitutedVariables(a,h)}catch(u){this.logger.error(u)}}async getDebuggersForLanguage(a){const h=[];for(const d of this.contributors.values()){const u=await d.languages;if(u&&u.indexOf(a)!==-1){const{type:E}=d;h.push({type:E,label:await d.label||E})}}return h}async getSchemaAttributes(a){const h=this.contributors.get(a);return h?h.getSchemaAttributes&&h.getSchemaAttributes()||[]:[]}async getConfigurationSnippets(){let a=[];for(const h of this.contributors.values())h.getConfigurationSnippets&&(a=a.concat(await h.getConfigurationSnippets()));return a}async createDebugSession(a){const{configuration:h}=a,d=this.contributors.get(h.type);if(d){const u=await d.createDebugSession(a);return this.sessionId2contrib.set(u,d),u}}async terminateDebugSession(a){const h=this.sessionId2contrib.get(a);if(h)return this.sessionId2contrib.delete(a),h.terminateDebugSession(a)}dispose(){this.toDispose.dispose()}};t.ExtensionDebugService=s,n.__decorate([(0,r.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",Object)],s.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(_.DebugConfigurationManager),n.__metadata("design:type",_.DebugConfigurationManager)],s.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(m.IActivationEventService),n.__metadata("design:type",m.IActivationEventService)],s.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),t.ExtensionDebugService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},40576:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugSessionContributionRegistry=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(97186);let _=class{constructor(){this.contribs=new Map,this.debug=(0,o.getDebugLogger)(),this.init()}init(){for(const p of this.contributions.getContributions())this.contribs.set(p.debugType,p)}get(p){return this.contribs.get(p)}registerDebugSessionContribution(p){const{debugType:m}=p;return this.contribs.has(m)?(this.debug.warn(`Debug session contribution already registered for ${m}`),o.Disposable.NULL):(this.contribs.set(m,p),o.Disposable.create(()=>this.unregisterDebugSessionContribution(m)))}unregisterDebugSessionContribution(p){this.contribs.delete(p)}};t.ExtensionDebugSessionContributionRegistry=_,n.__decorate([(0,r.Autowired)(l.DebugSessionContribution),n.__metadata("design:type",Object)],_.prototype,"contributions",void 0),t.ExtensionDebugSessionContributionRegistry=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},76452:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugSessionFactory=t.ExtensionDebugSession=void 0;const n=e(43718),r=e(29539),o=e(3520),l=e(51328);class _ extends r.DebugSession{constructor(m,s,g,a,h,d,u,E,f,c,y,b){super(m,s,g,a,h,d,u,E,f,c,y),this.id=m,this.options=s,this.connection=g,this.terminalService=a,this.editorService=h,this.breakpointManager=d,this.modelManager=u,this.labelService=E,this.messageService=f,this.fileSystem=c,this.sessionManager=y,this.terminalOptionsExt=b}async doRunInTerminal(m){m.name||(m.name=(0,n.localize)("debug.terminal.title","Debug Process")),m.iconPath||(m.iconPath=new l.ThemeIcon("debug"));const s={...m,...this.terminalOptionsExt};return super.doRunInTerminal(s)}}t.ExtensionDebugSession=_;class v{constructor(m,s,g,a,h,d,u,E,f,c,y,b,A,S){this.editorManager=m,this.breakpoints=s,this.modelManager=g,this.terminalService=a,this.labelService=h,this.messageService=d,this.debugPreferences=u,this.connectionFactory=E,this.fileSystem=f,this.terminalOptionsExt=c,this.debugPreference=y,this.outputService=b,this.injector=A,this.sessionManager=S}get(m,s){const g=this.injector.get(o.DebugSessionConnection,[m,this.connectionFactory,this.getTraceOutputChannel()]);return new _(m,s,g,this.terminalService,this.editorManager,this.breakpoints,this.modelManager,this.labelService,this.messageService,this.fileSystem,this.sessionManager,this.terminalOptionsExt)}getTraceOutputChannel(){if(this.debugPreferences["debug.trace"])return this.outputService.getChannel("Debug adapters")}}t.ExtensionDebugSessionFactory=v},77385:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(76452),t),n.__exportStar(e(40576),t),n.__exportStar(e(90384),t),n.__exportStar(e(21259),t)},51072:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initNodeThreadAPIProxy=g,t.initWorkerThreadAPIProxy=a;const n=e(46147),r=e(57484),o=e(10273),l=e(24060),_=e(69696),v=e(53191),p=e(4321),m=e(43812),s=e(38408);function g(h,d,u){h.set(n.MainThreadAPIIdentifier.MainThreadExtensionService,u);const E=d.get(p.MainThreadTreeView,[h,"node"]),f=d.get(s.MainThreadWindowState,[h]),c=d.get(m.MainThreadWindow,[h]),y=d.get(r.MainThreadConnection,[h]),b=d.get(o.MainThreadDebug,[h,y]),A=d.get(_.MainThreadTerminal,[h]),S=d.get(l.MainThreadTasks,[h]),D=d.get(v.MainThreadTestsImpl,[h]);return h.set(n.MainThreadAPIIdentifier.MainThreadTreeView,E),h.set(n.MainThreadAPIIdentifier.MainThreadWindowState,f),h.set(n.MainThreadAPIIdentifier.MainThreadWindow,c),h.set(n.MainThreadAPIIdentifier.MainThreadConnection,y),h.set(n.MainThreadAPIIdentifier.MainThreadDebug,b),h.set(n.MainThreadAPIIdentifier.MainThreadTerminal,A),h.set(n.MainThreadAPIIdentifier.MainThreadTasks,S),h.set(n.MainThreadAPIIdentifier.MainThreadTests,D),()=>{E.dispose(),f.dispose(),c.dispose(),y.dispose(),b.dispose(),A.dispose(),S.dispose(),D.dispose()}}function a(h,d,u){h.set(n.MainThreadAPIIdentifier.MainThreadExtensionService,u);const E=d.get(p.MainThreadTreeView,[h,"worker"]);return h.set(n.MainThreadAPIIdentifier.MainThreadTreeView,E),()=>{E.dispose()}}},2717:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadProgress=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(68969),_=e(43718),v=e(46147);let p=class{constructor(s){this.rpcProtocol=s,this.progress=new Map,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostProgress)}$startProgress(s,g,a){const h=this.createTask(s);g.location===_.ProgressLocation.Notification&&a&&(g={...g,location:_.ProgressLocation.Notification}),this.progressService.withProgress(g,h,()=>this.proxy.$acceptProgressCanceled(s))}$progressReport(s,g){const a=this.progress.get(s);a&&a.progress.report(g)}$progressEnd(s){const g=this.progress.get(s);g&&(g.resolve(),this.progress.delete(s))}dispose(){this.progress.forEach(s=>s.resolve()),this.progress.clear()}createTask(s){return g=>new Promise(a=>{this.progress.set(s,{resolve:a,progress:g})})}};t.MainThreadProgress=p,n.__decorate([(0,r.Autowired)(l.IProgressService),n.__metadata("design:type",Object)],p.prototype,"progressService",void 0),t.MainThreadProgress=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],p)},17802:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initSharedAPIProxy=F;const n=e(71742),r=e(46147),o=e(2717),l=e(62783),_=e(61528),v=e(14678),p=e(33530),m=e(23105),s=e(78690),g=e(84680),a=e(85589),h=e(11646),d=e(22869),u=e(14382),E=e(13335),f=e(89626),c=e(977),y=e(43404),b=e(48721),A=e(62909),S=e(39261),D=e(87781),T=e(79813),w=e(33111),I=e(62876),R=e(93633),M=e(49731),O=e(31968),x=e(73082),k=e(13643);function F(L,N){const U=N.get(f.MainThreadLanguages,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadLanguages,U);const W=N.get(v.MainThreadCommands,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadCommands,W);const j=N.get(g.MainThreadExtensionDocumentData,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadDocuments,j);const Q=N.get(a.MainThreadEditorService,[L,j]);L.set(r.MainThreadAPIIdentifier.MainThreadEditors,Q);const G=N.get(A.MainThreadExtensionNotebook,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadNotebook,G);const Z=N.get(R.MainThreadStatusBar,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadStatusBar,Z);const $=N.get(b.MainThreadMessage,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadMessages,$);const V=N.get(M.MainThreadStorage,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadStorage,V);const H=N.get(k.MainThreadWorkspace,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadWorkspace,H);const K=N.get(T.MainThreadQuickOpen,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadQuickOpen,K);const Y=N.get(D.MainThreadPreference,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadPreference,Y);const X=N.get(d.MainThreadEnv,[L,V]);L.set(r.MainThreadAPIIdentifier.MainThreadEnv,X);const re=N.get(y.MainThreadExtensionLog);L.set(n.MainThreadExtensionLogIdentifier,re);const oe=N.get(o.MainThreadProgress,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadProgress,oe);const he=N.get(S.MainThreadOutput);L.set(r.MainThreadAPIIdentifier.MainThreadOutput,he);const me=N.get(u.MainThreadFileSystem,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadFileSystem,me);const q=N.get(E.MainThreadFileSystemEvent,[L]),ye=N.get(l.MainThreadWebview,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadWebview,ye);const ge=N.get(l.MainThreadWebviewView,[L,ye]);L.set(r.MainThreadAPIIdentifier.MainThreadWebviewView,ge);const te=N.get(x.MainThreadUrls,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadUrls,te);const fe=N.get(p.MainThreadComments,[L,W]);L.set(r.MainThreadAPIIdentifier.MainThreadComments,fe);const Oe=N.get(_.MainThreadAuthentication,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadAuthentication,Oe);const Me=N.get(c.MainThreadLocalization,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadLocalization,Me);const Pe=N.get(h.MainThreadEditorTabsService,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadEditorTabs,Pe);const Be=N.get(w.MainThreadSCM,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadSCM,Be);const De=N.get(I.MainThreadSecret,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadSecret,De);const _e=N.get(s.MainThreadDecorations,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadDecorations,_e);const Ne=N.get(O.MainThreadTheming,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadTheming,Ne);const Te=N.get(m.MainThreadCustomEditor,[L,ye]);return L.set(r.MainThreadAPIIdentifier.MainThreadCustomEditor,Te),{setup:async()=>{await ye.init()},dispose:()=>{U.dispose(),W.dispose(),Z.dispose(),j.dispose(),G.dispose(),Q.dispose(),$.dispose(),V.dispose(),H.dispose(),K.dispose(),Y.dispose(),X.dispose(),oe.dispose(),he.dispose(),me.dispose(),q.dispose(),ye.dispose(),ge.dispose(),te.dispose(),Oe.dispose(),fe.dispose(),Pe.dispose(),Be.dispose(),De.dispose(),_e.dispose(),Ne.dispose(),Te.dispose()}}}},62783:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWebviewView=t.MainThreadWebview=void 0;const n=e(85608),r=n.__importDefault(e(97331)),o=e(76003),l=e(8919),_=e(41869),v=e(74654),p=e(19805),m=e(40827),s=e(43718),g=e(54414),a=e(57517),h=e(63067),d=e(52416),u=e(65046),E=e(46147),f=e(53043),c=e(88341),y=e(71354),{addMapElement:b}=_.arrays;let A=class extends _.Disposable{constructor(I){super(),this.rpcProtocol=I,this.webviewPanels=new Map,this.webviews=new Map,this.plainWebviews=new Map,this.webviewPanelStates=new Map,this._hasSerializer=new Set,this.statePersister=new Map,this.proxy=this.rpcProtocol.getProxy(E.ExtHostAPIIdentifier.ExtHostWebview),this.sumiProxy=this.rpcProtocol.getProxy(E.ExtHostAPIIdentifier.SumiExtHostWebview),this.initEvents(),this.extWebviewStorage=this.getStorage(new _.URI("extension-webview-panels").withScheme(_.STORAGE_SCHEMA.SCOPE)),this.webviewService.registerWebviewReviver({revive:R=>this.reviveWebview(R),handles:async R=>(await this.extWebviewStorage).get(R)?10:-1})}async init(){await this.proxy.$init()}isSupportedLink(I,R,M){if(p.HttpOpener.standardSupportedLinkSchemes.has(I.scheme))return!0;if(R.enableCommandUris&&I.scheme===_.Schemes.command){const{id:O,args:x}=v.CommandOpener.parseURI(I);if(!this.commandRegistry.isPermittedCommand(O,M,...x))throw new Error(`Extension ${M.id} has not permit to execute ${O}`);return!0}return!1}initEvents(){this.addDispose(this.editorService.onActiveResourceChange(()=>{this.onChange()})),this.addDispose(this.eventBus.on(a.EditorGroupChangeEvent,()=>{this.onChange()}))}isActive(I,R,M){return I.resourceState.uri.isEqual(R?.uri)&&I.resourceState.openTypeId===M?.componentId}onChange(){const I=this.editorService.currentResource,R=this.editorService.currentEditorGroup.currentOpenType,M=this.editorService.editorGroups.map(O=>({resource:O.currentResource,openType:O.currentOpenType,index:O.index+1}));this.webviewPanelStates.forEach((O,x)=>{if(!this.hasWebviewPanel(x))return;let k=!1;const F=this.getWebviewPanel(x);if(O.active?(!I||!this.isActive(F,I,R))&&(O.active=!1,k=!0):I&&this.isActive(F,I,R)&&(O.active=!0,k=!0),O.visible){const L=M.find(N=>N.resource&&this.isActive(F,N.resource,N.openType));L?L.index!==O.position&&(O.position=L.index,k=!0):(O.visible=!1,O.position=-1,k=!0)}else{const L=M.find(N=>N.resource&&this.isActive(F,N.resource,N.openType));L&&(O.visible=!0,O.position=L.index,k=!0)}k&&(this.proxy.$onDidChangeWebviewPanelViewState(x,O),O.position!==this.getWebviewPanel(x).viewColumn&&(this.getWebviewPanel(x).viewColumn=O.position,this._persistWebviewPanelMeta(x)))})}$createWebviewPanel(I,R,M,O={},x={},k){this.doCreateWebviewPanel(I,R,M,O,x,k)}pipeBrowserHostedWebviewPanel(I,R,M,O,x){const k=I.id,F=new S(k,M,R,{},{},x,I);this.onCreateWebviewPanel(F),this.proxy.$pipeBrowserHostedWebviewPanel(k,M)}async reviveWebview(I){var R;const M=(await this.extWebviewStorage).get(I);if(!M)throw new Error("No revival info for webview "+I);const{viewType:O,webviewOptions:x,extensionInfo:k,title:F}=M;await this.activation.fireEvent("onWebviewPanel",O);const L=await this.getPersistedWebviewState(O,I),N=this.webviewService.createEditorWebviewComponent({allowScripts:x.enableScripts,allowForms:(R=x.enableForms)!==null&&R!==void 0?R:x.enableScripts,longLive:x.retainContextWhenHidden},I,{extWebview:O}),U=N.group?N.group.index+1:M.viewColumn;await this.doCreateWebviewPanel(I,O,F,{viewColumn:U},x,k,L),await this.proxy.$deserializeWebviewPanel(I,O,F,await this.getPersistedWebviewState(O,I),U,x)}onCreateWebviewPanel(I){this.webviewPanels.set(I.id,I);const R=I.webview,M=I.id;I.editorWebview&&I.addDispose(I.editorWebview),I.addDispose(this.connectWebview(I.id,I.webview)),I.addDispose(R.onRemove(()=>{R.dispose(),this.proxy.$onDidDisposeWebviewPanel(M)})),this.webviewPanelStates.set(I.id,{active:!1,visible:!1,position:-1}),this.addDispose({dispose:()=>{this.webviewPanels.has(M)&&this.getWebviewPanel(M).dispose()}}),R.onDidClickLink(O=>{this.isSupportedLink(O,I.options,I.extensionInfo)&&this.openerService.open(O)}),this.addDispose(R.onDidUpdateState(O=>{this._hasSerializer.has(I.viewType)&&this.persistWebviewState(I.viewType,M,O)})),this._persistWebviewPanelMeta(M)}async doCreateWebviewPanel(I,R,M,O={},x={},k,F){var L;const N=this.webviewService.createEditorWebviewComponent({allowScripts:x.enableScripts,allowForms:(L=x.enableForms)!==null&&L!==void 0?L:x.enableScripts,longLive:x.retainContextWhenHidden},I,{extWebview:R}),U=new S(I,R,{uri:N.webviewUri,openTypeId:N.componentId},O,x,k,N.webview,N);N.title=M,this.onCreateWebviewPanel(U),N.supportsRevive=this._hasSerializer.has(U.viewType);const W=(0,f.viewColumnToResourceOpenOptions)(O.viewColumn);N.open(W),F&&(U.webview.state=F)}getWebviewPanel(I){if(!this.webviewPanels.has(I))throw new Error(`No Webview with id: ${I} was found in the browser process.`);return this.webviewPanels.get(I)}hasWebviewPanel(I){return this.webviewPanels.has(I)}$disposeWebview(I){this.getWebviewPanel(I).dispose(),this.webviewPanels.delete(I),this._persistWebviewPanelMeta(I)}$reveal(I,R={}){var M;const O=this.getWebviewPanel(I),x=Object.assign({},O.showOptions,R).viewColumn;(M=O.editorWebview)===null||M===void 0||M.open((0,f.viewColumnToResourceOpenOptions)(x))}$setTitle(I,R){const M=this.getWebviewPanel(I);M.editorWebview&&(M.editorWebview.title=R,M.title=R,this._persistWebviewPanelMeta(I))}$setIconPath(I,R){const M=this.getWebviewPanel(I);M.editorWebview&&(R?M.editorWebview.icon=this.iconService.fromIcon("",R,d.IconType.Background)+" background-tab-icon":M.editorWebview.icon="")}connectWebview(I,R){this.webviews.set(I,R);const M=new _.Disposable;return M.addDispose(R.onMessage(O=>{this.proxy.$onMessage(I,O)})),M.addDispose(b(this.webviews,I,R)),R.onDispose(()=>{M.dispose()}),M}getWebview(I){return this.webviews.get(I)}$setHtml(I,R){var M;(M=this.getWebview(I))===null||M===void 0||M.setContent(R)}$setOptions(I,R){var M;(M=this.getWebview(I))===null||M===void 0||M.updateOptions({allowScripts:R.enableScripts,allowForms:R.enableForms})}async $postMessage(I,R){var M;try{return await((M=this.getWebview(I))===null||M===void 0?void 0:M.postMessage(R)),!0}catch{return!1}}$registerSerializer(I){this._hasSerializer.add(I),this.webviewPanels.forEach(R=>{R.viewType===I&&R.editorWebview&&(R.editorWebview.supportsRevive=!0)})}$unregisterSerializer(I){this._hasSerializer.add(I)}_persistWebviewPanelMeta(I){return this.extWebviewStorage.then(R=>{this.webviewPanels.has(I)?R.set(I,this.getWebviewPanel(I).toJSON()):R.delete(I)})}async persistWebviewState(I,R,M){this.statePersister.has(I)||this.statePersister.set(I,this.getStorage(new _.URI("extension-webview/"+I).withScheme(_.STORAGE_SCHEMA.SCOPE)).then(O=>{const x=(0,r.default)(k=>O.set(R,k),500);return async k=>{await x(k)}})),(await this.statePersister.get(I))(M)}async getPersistedWebviewState(I,R){return(await this.getStorage(new _.URI("extension-webview/"+I).withScheme(_.STORAGE_SCHEMA.SCOPE))).get(R)}$connectPlainWebview(I){if(!this.plainWebviews.has(I)){const R=this.webviewService.getEditorPlainWebviewComponent(I)||this.webviewService.getOrCreatePlainWebviewComponent(I);R&&(this.plainWebviews.set(I,R),R.webview.onMessage(M=>{this.sumiProxy.$acceptMessage(I,M)}),R.webview.onDispose(()=>{this.plainWebviews.delete(I)}))}}async $postMessageToPlainWebview(I,R){if(this.plainWebviews.has(I))try{return await this.plainWebviews.get(I).webview.postMessage(R),!0}catch(M){return this.logger.error(M),!1}return!1}async $createPlainWebview(I,R,M){const O=this.webviewService.createEditorPlainWebviewComponent({},I);O.title=R,M&&(O.icon=this.iconService.fromIcon("",M)||""),this.$connectPlainWebview(I)}async $plainWebviewLoadUrl(I,R){if(!this.plainWebviews.has(I))throw new Error("No Plain Webview With id "+I);await this.plainWebviews.get(I).webview.loadURL(R)}async $setPlainWebviewPartition(I,R){if(!this.plainWebviews.has(I))throw new Error("No Plain Webview With id "+I);this.plainWebviews.get(I).webview.setPartition(R??I)}async $disposePlainWebview(I){var R;this.plainWebviews.has(I)&&((R=this.plainWebviews.get(I))===null||R===void 0||R.dispose())}async $revealPlainWebview(I,R){if(!this.plainWebviews.has(I))throw new Error("No Plain Webview With id "+I);const M=this.plainWebviews.get(I);if(!M.open)throw new Error("not able to open plain webview id:"+I);await M.open({groupIndex:R})}async $getWebviewResourceRoots(){return Array.from(this.staticResourceService.resourceRoots)}};t.MainThreadWebview=A,n.__decorate([(0,o.Autowired)(u.IWebviewService),n.__metadata("design:type",Object)],A.prototype,"webviewService",void 0),n.__decorate([(0,o.Autowired)(y.IActivationEventService),n.__metadata("design:type",y.IActivationEventService)],A.prototype,"activation",void 0),n.__decorate([(0,o.Autowired)(_.StorageProvider),n.__metadata("design:type",Function)],A.prototype,"getStorage",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",g.WorkbenchEditorService)],A.prototype,"editorService",void 0),n.__decorate([(0,o.Autowired)(d.IIconService),n.__metadata("design:type",Object)],A.prototype,"iconService",void 0),n.__decorate([(0,o.Autowired)(_.IEventBus),n.__metadata("design:type",Object)],A.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(_.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(m.StaticResourceService),n.__metadata("design:type",m.StaticResourceService)],A.prototype,"staticResourceService",void 0),n.__decorate([(0,o.Autowired)(_.IOpenerService),n.__metadata("design:type",Object)],A.prototype,"openerService",void 0),n.__decorate([(0,o.Autowired)(_.CommandRegistry),n.__metadata("design:type",Object)],A.prototype,"commandRegistry",void 0),t.MainThreadWebview=A=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__param(0,(0,o.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],A);class S extends _.Disposable{constructor(I,R,M,O,x,k,F,L){super(),this.id=I,this.viewType=R,this.resourceState=M,this.showOptions=O,this.options=x,this.extensionInfo=k,this.webview=F,this.editorWebview=L}toJSON(){return{id:this.id,viewType:this.viewType,viewColumn:this.viewColumn,extensionInfo:this.extensionInfo,webviewOptions:this.options,title:this.title}}}class D extends _.Disposable{constructor(I,R,M,O){super(),this.id=I,this.viewType=R,this.extension=M,this.webview=O}}let T=class extends s.WithEventBus{constructor(I,R){super(),this.mainThreadWebview=R,this._webviewViews=new Map,this._resolvers=new Map,this.proxy=I.getProxy(E.ExtHostAPIIdentifier.ExtHostWebviewView)}$registerWebviewViewProvider(I,R,M={}){this._resolvers.set(R,{extension:I,options:M}),this.eventBus.fire(new E.WebviewViewResolverRegistrationEvent({viewType:R,options:M}))}$unregisterWebviewViewProvider(I){this._resolvers.delete(I),this.eventBus.fire(new E.WebviewViewResolverRegistrationRemovalEvent({viewType:I}))}$setWebviewViewTitle(I,R){var M;const O=this._webviewViews.get(I);O&&((M=this.mainLayout.getTabbarHandler(O.viewType))===null||M===void 0||M.updateViewTitle(O.viewType,R||""))}$setWebviewViewDescription(I,R){const M=this._webviewViews.get(I)}onWebviewViewShouldShow(I){const R=I.payload.viewType;this._resolvers.has(R)?I.payload.disposer.addDispose(this.resolveWebviewView(I.payload.container,R,I.payload.title,I.payload.cancellationToken)):this.addDispose(this.eventBus.on(E.WebviewViewResolverRegistrationEvent,M=>{M.payload.viewType===R&&this._resolvers.has(R)&&I.payload.disposer.addDispose(this.resolveWebviewView(I.payload.container,R,I.payload.title,I.payload.cancellationToken))}))}resolveWebviewView(I,R,M,O){var x;const k=new _.Disposable,F=this.webviewService.createWebview(),L=(x=this._resolvers.get(R))===null||x===void 0?void 0:x.options,N=this._resolvers.get(R).extension,U=F.id,W=new D(U,R,N,F);W.addDispose(this.mainThreadWebview.connectWebview(U,F)),W.addDispose(b(this._webviewViews,U,W)),W.addDispose(F);const j=()=>{const Z=this.mainLayout.isViewVisible(R);this.proxy.$onDidChangeWebviewViewVisibility(U,Z),L?.retainContextWhenHidden||(Z?(F.appendTo(I),W.addDispose(this.mainThreadWebview.connectWebview(U,F))):F.remove())};k.addDispose(this.eventBus.on(h.ViewCollapseChangedEvent,Z=>{Z.payload.viewId===R&&j()}));const Q=this.mainLayout.getTabbarHandler(R);Q&&(k.addDispose(Q?.onActivate(()=>{j()})),k.addDispose(Q?.onInActivate(()=>{j()}))),this.proxy.$resolveWebviewView(U,R,M,F.state,O);const G=this.mainLayout.isViewVisible(R);return this.proxy.$onDidChangeWebviewViewVisibility(U,G),(L?.retainContextWhenHidden||G)&&F.appendTo(I),k.addDispose(W),{dispose:()=>W.dispose()}}$setBadge(I,R){const M=this._webviewViews.get(I);if(M){M.badge=R;const O=this.mainLayout.getTabbarHandler(M.viewType);O&&(O.setBadge(R||""),O.accordionService.updateViewBadge(M.viewType,R||""))}}$show(I,R){const M=this._webviewViews.get(I);M&&this.mainLayout.revealView(M.viewType)}};t.MainThreadWebviewView=T,n.__decorate([(0,o.Autowired)(h.IMainLayoutService),n.__metadata("design:type",Object)],T.prototype,"mainLayout",void 0),n.__decorate([(0,o.Autowired)(u.IWebviewService),n.__metadata("design:type",Object)],T.prototype,"webviewService",void 0),n.__decorate([(0,s.OnEvent)(c.WebviewViewShouldShowEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[c.WebviewViewShouldShowEvent]),n.__metadata("design:returntype",void 0)],T.prototype,"onWebviewViewShouldShow",null),t.MainThreadWebviewView=T=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,A])],T)},61528:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadAuthentication=t.MainThreadAuthenticationProvider=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(72665),p=e(46147),m=e(71354);let s=class extends l.Disposable{constructor(h,d,u,E){super(),this._proxy=h,this.id=d,this.label=u,this.supportsMultipleAccounts=E,this._accounts=new Map,this._sessions=new Map}async initialize(){return this.registerCommandsAndContextMenuItems()}async manageTrustedExtensions(h){const d=await this.authenticationService.getAllowedExtensions(this.id,h);if(!d.length){this.dialogService.info((0,l.localize)("authentication.noTrustedExtensions"));return}const u=await this.authenticationService.getAccountUsages(this.id,h),E=d.map(c=>{const y=u.find(b=>c.id===b.extensionId);return{label:c.name,description:y?(0,l.localize)("authentication.accountLastUsedDate"):(0,l.localize)("authentication.notUsed"),value:c}}),f=await this.quickPickService.show(E,{title:(0,l.localize)("authentication.manageTrustedExtensions"),placeholder:(0,l.localize)("authentication.manageExtensions")});f&&await this.authenticationService.setAllowedExtensions(this.id,h,[f])}async signOut(h){const d=await this.authenticationService.getAccountUsages(this.id,h),u=this._accounts.get(h),E=d.length?(0,l.formatLocalize)("authentication.signOutMessage",h,d.map(c=>c.extensionName).join(`
|
|
33400
33400
|
`)):(0,l.formatLocalize)("authentication.signOutMessageSimple",h);await this.dialogService.info(E,[(0,l.localize)("ButtonCancel"),(0,l.localize)("ButtonOK")])===(0,l.localize)("ButtonOK")&&(u?.forEach(c=>this.logout(c)),await this.authenticationService.removeAccountUsage(this.id,h),await this.authenticationService.removeAllowedExtensions(this.id,h))}async getSessions(h,d){return this._proxy.$getSessions(this.id,h,{account:d})}hasSessions(){return!!this._sessions.size}async updateSessionItems(h){const{added:d,removed:u}=h,f=(await this._proxy.$getSessions(this.id)).filter(c=>d.some(y=>y.id===c.id));u.forEach(c=>{const y=this._sessions.get(c.id);if(y){this._sessions.delete(c.id);const b=this._accounts.get(y)||[],A=b.indexOf(c.id);b.splice(A),b.length||this._accounts.delete(y)}}),f.forEach(c=>this.registerSession(c))}async registerCommandsAndContextMenuItems(){try{(await this._proxy.$getSessions(this.id)).forEach(d=>this.registerSession(d))}catch(h){this.logger.error(h)}}registerSession(h){this._sessions.set(h.id,h.account.label);const d=this._accounts.get(h.account.label);if(d){this._accounts.set(h.account.label,d.concat(h.id));return}else this._accounts.set(h.account.label,[h.id])}login(h,d){return this._proxy.$login(this.id,h,d)}async logout(h){await this._proxy.$logout(this.id,h),this.messageService.info((0,l.localize)("authentication.signedOut"))}};t.MainThreadAuthenticationProvider=s,n.__decorate([(0,r.Autowired)(_.IAuthenticationService),n.__metadata("design:type",Object)],s.prototype,"authenticationService",void 0),n.__decorate([(0,r.Autowired)(l.QuickPickService),n.__metadata("design:type",Object)],s.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],s.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],s.prototype,"logger",void 0),t.MainThreadAuthenticationProvider=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,String,String,Boolean])],s);let g=class extends l.Disposable{constructor(h){super(),this._proxy=h.getProxy(p.ExtHostAPIIdentifier.ExtHostAuthentication),this.addDispose(this.authenticationService.onDidChangeSessions(d=>{this._proxy.$onDidChangeAuthenticationSessions(d.providerId,d.label,d.event)})),this.addDispose(this.authenticationService.onDidRegisterAuthenticationProvider(d=>{this._proxy.$onDidChangeAuthenticationProviders([d],[])})),this.addDispose(this.authenticationService.onDidUnregisterAuthenticationProvider(d=>{this._proxy.$onDidChangeAuthenticationProviders([],[d])}))}$getProviderIds(){return Promise.resolve(this.authenticationService.getProviderIds())}async $registerAuthenticationProvider(h,d,u){const E=this.injector.get(s,[this._proxy,h,d,u]);await E.initialize(),this.authenticationService.registerAuthenticationProvider(h,E),this.addDispose(l.Disposable.create(()=>{this.$unregisterAuthenticationProvider(h)}))}$unregisterAuthenticationProvider(h){this.authenticationService.unregisterAuthenticationProvider(h)}$ensureProvider(h){return this.activationService.fireEvent("onAuthenticationRequest",h)}$sendDidChangeSessions(h,d){this.authenticationService.sessionsUpdate(h,d)}$getSessions(h){return this.authenticationService.getSessions(h)}$login(h,d,u){return this.authenticationService.login(h,d,u)}$logout(h,d){return this.authenticationService.logout(h,d)}$getAccounts(h){return this.authenticationService.getSessions(h).then(d=>d.map(u=>u.account))}async doGetSession(h,d,u,E,f){const c=await this.authenticationService.getSessions(h,d,!0),y=this.authenticationService.supportsMultipleAccounts(h);if(f.forceNewSession&&!c.length)throw new Error("No existing sessions found.");if(f.forceNewSession&&f.createIfNone)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone");if(f.forceNewSession&&f.silent)throw new Error("Invalid combination of options. Please remove one of the following: forceNewSession, silent");if(f.createIfNone&&f.silent)throw new Error("Invalid combination of options. Please remove one of the following: createIfNone, silent");if(!f.forceNewSession&&c.length){if(y)if(f.clearSessionPreference)await this.authenticationService.removeExtensionSessionId(E,h);else{const A=await this.authenticationService.getExtensionSessionId(E,h);if(A){const S=c.find(D=>D.id===A);if(S&&await this.authenticationService.isAccessAllowed(h,S.account.label,u))return S}}else if(await this.authenticationService.isAccessAllowed(h,c[0].account.label,u))return c[0]}if(f.createIfNone||f.forceNewSession){const A=this.authenticationService.getLabel(h),S=typeof f.forceNewSession=="object"?f.forceNewSession.detail:void 0;if(!await this.loginPrompt(A,E,!!f.forceNewSession,S))throw new Error("User did not consent to login.");const T=c?.length&&!f.forceNewSession&&y?await this.selectSession(h,A,u,E,c,d,f,!!f.clearSessionPreference):await this.authenticationService.login(h,d,f);return await this.authenticationService.updatedAllowedExtension(h,T.account.label,u,E,!0),await this.authenticationService.setExtensionSessionId(E,h,T.id),T}const b=c.find(A=>this.authenticationService.isAccessAllowed(h,A.account.label,u));return!f.silent&&!b&&await this.authenticationService.requestNewSession(h,d,f,u,E),b}async $getSession(h,d,u,E,f){const c=await this.doGetSession(h,d,u,E,f);return c&&await this.authenticationService.addAccountUsage(h,c.account.label,u,E),c}async selectSession(h,d,u,E,f,c,y,b){if(!f.length)throw new Error("No potential sessions found");if(b)await this.authenticationService.removeExtensionSessionId(E,h);else{const I=await this.authenticationService.getExtensionSessionId(E,h);if(I){const R=f.find(M=>M.id===I);if(R&&await this.$getSessionsPrompt(h,R.account.label,d,u,E))return R}}const A=f.map(I=>({label:I.account.label,value:I}));A.push({label:(0,l.localize)("authentication.useOtherAccount"),value:void 0});const S=await this.quickPickService.show(A,{title:(0,l.formatLocalize)("authentication.selectAccount",E,d),placeholder:(0,l.formatLocalize)("authentication.getSessionPlaceholder",E),ignoreFocusOut:!0}),D=S??await this.authenticationService.login(h,c,y),T=D.account.label,w=await this.authenticationService.getAllowedExtensions(h,T);return w.find(I=>I.id===u)||(w.push({id:u,name:E}),await this.authenticationService.setAllowedExtensions(h,T,w)),await this.authenticationService.setExtensionSessionId(E,h,D.id),D}async $getSessionsPrompt(h,d,u,E,f){const c=await this.authenticationService.getAllowedExtensions(h,d);if(c.find(S=>S.id===E))return await this.authenticationService.addAccountUsage(h,d,E,f),!0;const A=await this.dialogService.info((0,l.formatLocalize)("authentication.confirmAuthenticationAccess",f,u,d),[(0,l.localize)("ButtonCancel"),(0,l.localize)("ButtonAllow")])===(0,l.localize)("ButtonAllow");return A&&(this.authenticationService.addAccountUsage(h,d,E,f),c.push({id:E,name:f}),await this.authenticationService.setAllowedExtensions(h,d,c)),A}async loginPrompt(h,d,u,E){return await this.dialogService.info(u?(0,l.formatLocalize)("authentication.confirmReLogin",d,h):(0,l.formatLocalize)("authentication.confirmLogin",d,h),[(0,l.localize)("ButtonCancel"),(0,l.localize)("ButtonAllow")])===(0,l.localize)("ButtonAllow")}async $setTrustedExtensionAndAccountPreference(h,d,u,E,f){const c=await this.authenticationService.getAllowedExtensions(h,d);c.find(y=>y.id===u)||(c.push({id:u,name:E}),await this.authenticationService.setAllowedExtensions(h,d,c)),await this.authenticationService.setExtensionSessionId(E,h,f),await this.authenticationService.addAccountUsage(h,d,u,E)}};t.MainThreadAuthentication=g,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.IAuthenticationService),n.__metadata("design:type",Object)],g.prototype,"authenticationService",void 0),n.__decorate([(0,r.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],g.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],g.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(l.QuickPickService),n.__metadata("design:type",Object)],g.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(m.IActivationEventService),n.__metadata("design:type",m.IActivationEventService)],g.prototype,"activationService",void 0),t.MainThreadAuthentication=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],g)},14678:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommands=void 0;const r=e(85608),o=e(76003),l=e(8919),_=e(41869),v=e(43718),p=e(21880),m=e(46147),{isNonEmptyArray:s}=v.arrays;let g=class{constructor(h){this.rpcProtocol=h,n.set(this,void 0),this.commands=new Map,this.argumentProcessors=[],this.disposable=new v.Disposable,r.__classPrivateFieldSet(this,n,this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostCommands),"f"),r.__classPrivateFieldGet(this,n,"f").$registerBuiltInCommands(),r.__classPrivateFieldGet(this,n,"f").$registerCommandConverter(),this.registerUriArgProcessor()}registerUriArgProcessor(){this.disposable.addDispose(this.registerArgumentProcessor({processArgument:h=>h instanceof v.URI?h.codeUri:s(h)?h.map(d=>d instanceof v.URI?d.codeUri:d):h}))}dispose(){this.commands.forEach(h=>{h.dispose()}),this.commands.clear(),this.disposable.dispose()}registerArgumentProcessor(h){return this.argumentProcessors.push(h),v.Disposable.create(()=>{const d=this.argumentProcessors.indexOf(h);d>=0&&this.argumentProcessors.splice(d,1)})}$registerCommand(h){const d=r.__classPrivateFieldGet(this,n,"f"),u=(...y)=>(y=y.map(b=>this.argumentProcessors.reduce((A,S)=>S.processArgument(A),b)),d.$executeContributedCommand(h,...y)),E=new v.Disposable,f={execute:u,dispose:()=>E.dispose()};this.commandRegistry.getCommand(h)?E.addDispose(this.commandRegistry.registerHandler(h,{execute:u})):E.addDispose(this.commandRegistry.registerCommand({id:h},{execute:u})),this.commands.set(h,f)}$unregisterCommand(h){const d=this.commands.get(h);d&&(d.dispose(),this.commands.delete(h))}$getCommands(){return Promise.resolve(this.commandRegistry.getCommands().map(h=>h.id))}$executeExtensionCommand(h,...d){return this.commands.has(h)?this.commands.get(h).execute(...d):(d=d.map(u=>this.argumentProcessors.reduce((E,f)=>f.processArgument(E),u)),r.__classPrivateFieldGet(this,n,"f").$executeContributedCommand(h,...d))}$executeCommandWithExtensionInfo(h,d,...u){if(!this.commandRegistry.isPermittedCommand(h,d,...u))throw new Error(`Extension ${d.id} has not permit to execute ${h}`);return this.$executeCommand(h,...u)}async $executeCommand(h,...d){try{return await this.monacoCommandService.executeCommand(h,...d)}catch(u){throw this.logger.error(u),u}}};t.MainThreadCommands=g,n=new WeakMap,r.__decorate([(0,o.Autowired)(_.CommandRegistry),r.__metadata("design:type",Object)],g.prototype,"commandRegistry",void 0),r.__decorate([(0,o.Autowired)(p.ICommandServiceToken),r.__metadata("design:type",Object)],g.prototype,"monacoCommandService",void 0),r.__decorate([(0,o.Autowired)(_.ILogger),r.__metadata("design:type",Object)],g.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(_.IContextKeyService),r.__metadata("design:type",Object)],g.prototype,"contextKeyService",void 0),t.MainThreadCommands=g=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)(l.IRPCProtocol)),r.__metadata("design:paramtypes",[Object])],g)},33530:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommentController=t.MainThreadCommentThread=t.MainThreadComments=void 0;const n=e(85608),r=e(76003),o=e(86077),l=e(8919),_=e(93899),v=e(43718),p=e(20868),m=e(28423),s=e(46147),g=e(53043),a=e(53886);let h=class{constructor(f,c){this.rpcProtocol=f,this.mainThreadCommands=c,this._providers=new Map,this._commentControllers=new Map,this.disposable=new v.Disposable,this.proxy=this.rpcProtocol.getProxy(s.ExtHostAPIIdentifier.ExtHostComments),this.disposable.addDispose(this.registerCommentThreadTemplateHander()),this.disposable.addDispose(this.registerArgumentProcessor())}registerCommentThreadTemplateHander(){return this.commentsService.onThreadsCreated(async f=>{if((0,v.isUndefined)(f.data)){const c=this.commentsService.getProviderIdsByLine(f.range.startLineNumber)[0];if(c){const y=this._providers.get(c);if((0,v.isUndefined)(y))return;const b=this._commentControllers.get(y);if(!b)throw new Error("unknown controller");b.createCommentThreadTemplate(f.uri.codeUri,f.range)}}})}registerArgumentProcessor(){return this.mainThreadCommands.registerArgumentProcessor({processArgument:f=>{if(!f||!f.menuId||!f.thread||(0,v.isUndefined)(f.thread.data))return f;switch(f.menuId){case _.MenuId.CommentsCommentThreadTitle:return{$mid:7,commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle};case _.MenuId.CommentsCommentThreadContext:return{$mid:8,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},text:f.text};case _.MenuId.CommentsCommentTitle:return{$mid:9,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},commentUniqueId:+f.comment.id};case _.MenuId.CommentsCommentContext:return{$mid:10,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},commentUniqueId:+f.comment.id,text:f.body};default:return f}}})}$updateCommentThread(f,c,y,b,A){const S=this._commentControllers.get(f);if(S)return S.updateCommentThread(c,y,b,A)}$registerCommentController(f,c,y){this.commentsService.registerCommentPanel(),this._providers.set(c,f);const b=this.injector.get(u,[this.proxy,f,c,y,{}]);this._commentControllers.set(f,b),this.commentsService.forceUpdateDecoration(),this.disposable.addDispose(v.Disposable.create(()=>{this.$unregisterCommentController(f)}))}$updateCommentControllerFeatures(f,c){const y=this._commentControllers.get(f);y&&y.updateFeatures(c)}$unregisterCommentController(f){const c=this._commentControllers.get(f);c&&(c.dispose(),this._providers.delete(c.id)),this._commentControllers.delete(f)}$createCommentThread(f,c,y,b,A,S){const D=this._commentControllers.get(f);if(D)return D.createCommentThread(S,c,y,b,A)}$deleteCommentThread(f,c){const y=this._commentControllers.get(f);if(y)return y.deleteCommentThread(c)}dispose(){this.disposable.dispose(),this._commentControllers.clear()}};t.MainThreadComments=h,n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],h.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],h.prototype,"injector",void 0),t.MainThreadComments=h=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],h);let d=class extends v.Disposable{get input(){return this._input}set input(f){this._input=f,this._onDidChangeInput.fire(f)}get onDidChangeInput(){return this._onDidChangeInput.event}get label(){var f;return(f=this._thread.label)===null||f===void 0?void 0:f.get()}set label(f){(0,m.transaction)(c=>{var y;(y=this._thread.label)===null||y===void 0||y.set(f,c)}),this._onDidChangeLabel.fire(f)}get contextValue(){return this._thread.contextValue}set contextValue(f){this._thread.contextValue=f}convertToIThreadComment(f){var c;return{id:f.uniqueIdInThread.toString(),mode:f.mode,body:typeof f.body=="string"?f.body:g.MarkdownString.from(f.body),label:f.label,contextValue:f.contextValue,author:{name:f.userName,iconPath:new v.URI(v.URI.revive(f.userIconPath))},reactions:(c=f.commentReactions)===null||c===void 0?void 0:c.map(y=>this.convertToCommentReaction(y)),timestamp:f.timestamp}}convertToCommentReaction(f){const{label:c,iconPath:y,count:b,hasReacted:A}=f;return{label:c,iconPath:new v.URI(v.URI.revive(y)),count:b??0,authorHasReacted:!!A}}convertToCoreReaction(f){const{label:c,iconPath:y,count:b,authorHasReacted:A}=f;return{label:c,iconPath:v.URI.revive(y),count:b??0,hasReacted:A}}convertToCoreComment(f){var c;return{uniqueIdInThread:+f.id,contextValue:f.contextValue,mode:f.mode,label:typeof f.label=="string"?f.label:"",body:f.body,userName:f.author.name,commentReactions:(c=f.reactions)===null||c===void 0?void 0:c.map(y=>this.convertToCoreReaction(y)),timestamp:f.timestamp}}get comments(){return this._thread.comments.get().map(f=>this.convertToCoreComment(f))}set comments(f){f?this._thread.updateComments(f.map(c=>this.convertToIThreadComment(c))):this._thread.updateComments([]),this._onDidChangeComments.fire(f)}get onDidChangeComments(){return this._onDidChangeComments.event}set range(f){this._thread.range=f,this._onDidChangeRange.fire(this._thread.range)}get range(){return this._thread.range}get onDidChangeCanReply(){return this._onDidChangeCanReply.event}set canReply(f){this._thread.setReadOnly(!f),this._onDidChangeCanReply.fire(f)}get canReply(){return!this._thread.readOnly.get()}get collapsibleState(){return this._thread.isCollapsed.get()?a.CommentThreadCollapsibleState.Collapsed:a.CommentThreadCollapsibleState.Expanded}set collapsibleState(f){(0,m.transaction)(c=>{this._thread.isCollapsed.set(f===a.CommentThreadCollapsibleState.Collapsed,c)}),this._onDidChangeCollasibleState.fire(this._collapsibleState)}get isDisposed(){return this._isDisposed}constructor(f,c,y,b,A,S,D){super(),this.commentThreadHandle=f,this.controllerHandle=c,this.extensionId=y,this.threadId=b,this.resource=A,this._onDidChangeInput=new v.Emitter,this._onDidChangeLabel=new v.Emitter,this.onDidChangeLabel=this._onDidChangeLabel.event,this._onDidChangeComments=new v.Emitter,this._onDidChangeCanReply=new v.Emitter,this._onDidChangeRange=new v.Emitter,this.onDidChangeRange=this._onDidChangeRange.event,this._onDidChangeCollasibleState=new v.Emitter,this.onDidChangeCollasibleState=this._onDidChangeCollasibleState.event;const T=this.commentsService.commentsThreads.filter(R=>R.uri.toString()===A&&R.range.startLineNumber===S.startLineNumber),[w]=T.slice(-1),I={commentControlHandle:c,commentThreadHandle:f};w&&!w.data?(w.data=I,this._thread=w):this._thread=this.commentsService.createThread(new v.URI(A),(0,p.positionToRange)(S.startLineNumber),{data:I,readOnly:!D}),this.disposables.push(this.onDidChangeComments(()=>{this.commentsService.fireThreadCommentChange(this._thread)}),this._onDidChangeCollasibleState,this._onDidChangeComments,this._onDidChangeInput,this._onDidChangeLabel,this._onDidChangeRange),this._isDisposed=!1}isDocumentCommentThread(){throw new Error("Method not implemented.")}batchUpdate(f){const c=y=>Object.prototype.hasOwnProperty.call(f,y);c("range")&&(this.range=f.range),c("label")&&(this.label=f.label),c("contextValue")&&(this.contextValue=f.contextValue),c("comments")&&(this.comments=f.comments),c("collapseState")&&(this.collapsibleState=f.collapseState),c("canReply")&&(this.canReply=f.canReply)}dispose(){this._isDisposed=!0,this._thread.dispose(),super.dispose()}toJSON(){return{$mid:7,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}};t.MainThreadCommentThread=d,n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],d.prototype,"commentsService",void 0),t.MainThreadCommentThread=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Number,Number,String,String,String,Object,Boolean])],d);let u=class extends v.WithEventBus{get handle(){return this._handle}get id(){return this._id}get contextValue(){return this._id}get proxy(){return this._proxy}get label(){return this._label}get reactions(){return this._reactions}set reactions(f){this._reactions=f}get features(){return this._features}constructor(f,c,y,b,A){super(),this._proxy=f,this._handle=c,this._id=y,this._label=b,this._features=A,this._threads=new Map,this.addDispose(this.commentsService.registerCommentRangeProvider(y,{getCommentingRanges:S=>this.getCommentingRanges(S.uri,v.CancellationToken.None)}))}updateFeatures(f){var c;this._features={...this._features,...f},this.commentsFeatureRegistry.registerProviderFeature(this._id,{placeholder:(c=this._features.options)===null||c===void 0?void 0:c.placeHolder})}createCommentThread(f,c,y,b,A){const S=v.URI.from(b),D=this.injector.get(d,[c,this.handle,f,y,S.toString(),A,!0]);return this._threads.set(c,D),this.addDispose({dispose:()=>{this._threads.delete(c),D.dispose()}}),D}updateCommentThread(f,c,y,b){this.getKnownThread(f).batchUpdate(b)}deleteCommentThread(f){const c=this.getKnownThread(f);this._threads.delete(f),c.dispose()}deleteCommentThreadMain(f){this._threads.forEach(c=>{c.threadId===f&&this._proxy.$deleteCommentThread(this._handle,c.commentThreadHandle)})}getKnownThread(f){const c=this._threads.get(f);if(!c)throw new Error("unknown thread");return c}async getCommentingRanges(f,c){return await this._proxy.$provideCommentingRanges(this.handle,f.codeUri,c)||[]}handleCommentReaction(f){var c;const{thread:y,comment:b,reaction:A}=f.payload,S=(c=y.data)===null||c===void 0?void 0:c.commentThreadHandle,D=this.getKnownThread(S),T=D.convertToCoreComment(b),w=D.convertToCoreReaction(A);this.toggleReaction(y.uri,D,T,w)}async toggleReaction(f,c,y,b){return this._proxy.$toggleReaction(this._handle,c.commentThreadHandle,f.codeUri,y,b)}createCommentThreadTemplate(f,c){this._proxy.$createCommentThreadTemplate(this.handle,f,c)}async updateCommentThreadTemplate(f,c){await this._proxy.$updateCommentThreadTemplate(this.handle,f,c)}toJSON(){return{$mid:6,handle:this.handle}}};t.MainThreadCommentController=u,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],u.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],u.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],u.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,v.OnEvent)(o.CommentReactionClick),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[o.CommentReactionClick]),n.__metadata("design:returntype",void 0)],u.prototype,"handleCommentReaction",null),t.MainThreadCommentController=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Number,String,String,Object])],u)},57484:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadConnection=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(46147);let p=class{constructor(s){this.rpcProtocol=s,this.connections=new Map,this.connectionsReady=new Map,this.toDispose=new _.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostConnection)}dispose(){this.connections.forEach(s=>{s.dispose()}),this.connections.clear(),this.toDispose.dispose()}async $sendMessage(s,g){const a=this.connectionsReady.get(s);a&&await a.promise,this.connections.has(s)?this.connections.get(s).readMessage(g):this.logger.warn(`Do not found connection ${s}`)}async $createConnection(s){this.logger.log(`create connection ${s}`),await this.doEnsureConnection(s)}async $deleteConnection(s){this.logger.log(`delete connection ${s}`),this.connections.delete(s)}async ensureConnection(s){const g=await this.doEnsureConnection(s);return await this.proxy.$createConnection(s),g}async doEnsureConnection(s){let g=this.connections.get(s);if(!g){const a=new l.Deferred;this.connectionsReady.set(s,a),g=await this.doCreateConnection(s),a.resolve(),this.connections.set(s,g),this.connectionsReady.delete(s)}return g}async doCreateConnection(s){const g=new v.ExtensionConnection(s,this.proxy,()=>{this.connections.delete(s),this.proxy.$deleteConnection(s)});return this.toDispose.push(_.Disposable.create(()=>g.fireClose())),g}};t.MainThreadConnection=p,n.__decorate([(0,r.Autowired)(_.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.MainThreadConnection=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],p)},23105:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCustomEditor=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(43718),_=e(57517),v=e(65046),p=e(46147),m=e(35912),s=e(62783);let g=class extends l.WithEventBus{constructor(h,d){super(),this.webview=d,this.customEditors=new Map,this.proxy=h.getProxy(p.ExtHostAPIIdentifier.ExtHostCustomEditor)}$acceptCustomDocumentDirty(h,d){this.eventBus.fire(new _.ResourceDecorationNeedChangeEvent({uri:l.URI.from(h),decoration:{dirty:d}}))}async onShouldSave(h){const{viewType:d,uri:u,cancellationToken:E}=h.payload,f=this.customEditors.get(d);if(f){if(f.type===p.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(u);if(c)try{await c.instance.save()}finally{c.dispose()}}else if(f.type===p.CustomEditorType.FullEditor)return this.proxy.$saveCustomDocument(d,u.codeUri,E)}}async onShouldRevert(h){const{viewType:d,uri:u,cancellationToken:E}=h.payload,f=this.customEditors.get(d);if(f){if(f.type===p.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(u);if(c)try{await c.instance.revert()}finally{c.dispose()}}else if(f.type===p.CustomEditorType.FullEditor)return this.proxy.$revertCustomDocument(d,u.codeUri,E)}}async onShouldEdit(h){const{viewType:d,uri:u,type:E}=h.payload,f=this.customEditors.get(d);if(f)if(f.type===p.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(u);if(c)try{E==="undo"?await c.instance.getMonacoModel().undo():await c.instance.getMonacoModel().redo()}finally{c.dispose()}}else f.type===p.CustomEditorType.FullEditor&&(E==="undo"?await this.proxy.$undo(d,u.codeUri):await this.proxy.$redo(d,u.codeUri))}async onCustomEditorShouldDisplayEvent(h){const d=this.customEditors.get(h.payload.viewType);if(d){const{viewType:u,uri:E,openTypeId:f,webviewPanelId:c,cancellationToken:y}=h.payload;if(d.type===p.CustomEditorType.TextEditor){const b=await this.editorDocumentModelService.createModelReference(E);if(!b)throw new Error(`failed to open document ${E} for custom editor`);if(y.isCancellationRequested){b.dispose();return}const A=this.webviewService.getWebview(c);if(!A)throw b.dispose(),new Error(`failed to find webview ${c}`);this.eventBus.on(m.CustomEditorShouldHideEvent,S=>{E.isEqual(S.payload.uri)&&b.dispose()}),this.webview.pipeBrowserHostedWebviewPanel(A,{uri:E,openTypeId:f},u,d.options.webviewOptions||{},d.extensionInfo),this.proxy.$resolveCustomTextEditor(u,E.codeUri,c,y)}else{const b=this.webviewService.getWebview(c);if(!b)throw new Error(`failed to find webview ${c}`);this.webview.pipeBrowserHostedWebviewPanel(b,{uri:E,openTypeId:f},u,d.options.webviewOptions||{},d.extensionInfo),this.proxy.$resolveCustomTextEditor(u,E.codeUri,c,y)}}}$registerCustomEditor(h,d,u={},E){this.customEditors.set(h,{type:d,options:u,extensionInfo:E}),this.eventBus.fire(new m.CustomEditorOptionChangeEvent({viewType:h,options:u}))}$unregisterCustomEditor(h){this.customEditors.delete(h)}};t.MainThreadCustomEditor=g,n.__decorate([(0,r.Autowired)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],g.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,r.Autowired)(v.IWebviewService),n.__metadata("design:type",Object)],g.prototype,"webviewService",void 0),n.__decorate([(0,l.OnEvent)(m.CustomEditorShouldSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldSave",null),n.__decorate([(0,l.OnEvent)(m.CustomEditorShouldRevertEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldRevert",null),n.__decorate([(0,l.OnEvent)(m.CustomEditorShouldEditEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.CustomEditorShouldEditEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldEdit",null),n.__decorate([(0,l.OnEvent)(m.CustomEditorShouldDisplayEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.CustomEditorShouldDisplayEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onCustomEditorShouldDisplayEvent",null),t.MainThreadCustomEditor=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,s.MainThreadWebview])],g)},10273:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDebug=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(26542),v=e(66482),p=e(99797),m=e(37499),s=e(31141),g=e(97186),a=e(38029),h=e(15153),d=e(70159),u=e(26296),E=e(54414),f=e(14951),c=e(83145),y=e(72665),b=e(6487),A=e(46147),S=e(71354),D=e(77385),T=e(21259),w=e(90384);let I=class{constructor(M,O){this.rpcProtocol=M,this.mainThreadConnection=O,this.toDispose=new Map,this.listenerDispose=new l.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(A.ExtHostAPIIdentifier.ExtHostDebug),this.listen(),this.registerDebugContributions()}dispose(){this.toDispose.forEach(M=>{M.dispose()}),this.toDispose.clear(),this.listenerDispose.dispose()}listen(){this.listenerDispose.pushAll([this.breakpointManager.onDidChangeBreakpoints(({added:M,removed:O,changed:x})=>{const k=this.breakpointManager.getBreakpoints();this.proxy.$breakpointsDidChange(this.toCustomApiBreakpoints(k),this.toCustomApiBreakpoints(M),this.toCustomApiBreakpoints(O),this.toCustomApiBreakpoints(x))}),this.sessionManager.onDidStartDebugSession(M=>{this.proxy.$sessionDidStart(M.id)}),this.sessionManager.onDidDestroyDebugSession(M=>{this.proxy.$sessionDidDestroy(M.id)}),this.sessionManager.onDidChangeActiveDebugSession(M=>{this.proxy.$sessionDidChange(M.current&&M.current.id)}),this.sessionManager.onDidReceiveDebugSessionCustomEvent(M=>{this.proxy.$onSessionCustomEvent(M.session.id,M.event,M.body)}),this.debugService.onDidDebugContributionPointChange(({path:M,contributions:O,removed:x})=>{x?(this.proxy.$unregisterDebuggerContributions(O),O.forEach(k=>{this.$unregisterDebuggerContribution({type:k.type,label:k.label||k.type}),this.logger.log(`Debugger contribution has been unregistered: ${k.type}`)})):(this.proxy.$registerDebuggerContributions(M,O),O.forEach(k=>{this.$registerDebuggerContribution({type:k.type,label:k.label||k.type}),this.logger.log(`Debugger contribution has been registered: ${k.type}`)}))})])}registerDebugContributions(){const M=this.debugService.debugContributionPoints;for(const[O,x]of M)this.proxy.$registerDebuggerContributions(O,x),x.forEach(k=>{this.$registerDebuggerContribution({type:k.type,label:k.label||k.type}),this.logger.log(`Debugger contribution has been registered: ${k.type}`)})}async $appendToDebugConsole(M){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.append(M)}async $appendLineToDebugConsole(M){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.appendLine(M)}async $unregisterDebuggerContribution(M){const O=this.toDispose.get(M.type);O?.dispose()}async $registerDebuggerContribution(M){const O=new l.DisposableCollection,x=await this.proxy.$getTerminalCreationOptions(M.type);this.toDispose.set(M.type,O);const k=new D.ExtensionDebugSessionFactory(this.editorService,this.breakpointManager,this.modelManager,this.terminalService,this.labelService,this.messageService,this.debugPreferences,async F=>await this.mainThreadConnection.ensureConnection(F),this.fileService,x,this.debugPreferences,this.outputService,this.injector,this.sessionManager);O.pushAll([this.adapterContributionRegister.registerDebugAdapterContribution(new T.ExtensionDebugAdapterContribution(M,this.proxy,this.activationEventService)),this.sessionContributionRegistry.registerDebugSessionContribution({debugType:M.type,debugSessionFactory:()=>k})])}async $addBreakpoints(M){const O=new Map;M.forEach(x=>O.set(x.id,x)),this.breakpointManager.findMarkers({dataFilter:x=>(O.has(x.id)&&O.delete(x.id),!1)});for(const x of O.values())if(x.location){const k=x.location;this.breakpointManager.addBreakpoint(p.DebugBreakpoint.create(l.Uri.revive(k.uri),{line:x.location.range.startLineNumber+1,column:1,condition:x.condition,hitCondition:x.hitCondition,logMessage:x.logMessage},!0))}}async $removeBreakpoints(M){const O=new Set;M.forEach(x=>O.add(x.id));for(const x of this.breakpointManager.findMarkers({dataFilter:k=>O.has(k.id)})){const k=this.modelManager.resolve(new l.URI(x.data.uri));k&&k[0].breakpoint&&this.breakpointManager.delBreakpoint(k[0].breakpoint)}}async $customRequest(M,O,x){const k=this.sessionManager.getSession(M);if(k)return k.sendCustomRequest(O,x);throw new Error(`Debug session '${M}' not found`)}$getDebugProtocolBreakpoint(M,O){const x=this.sessionManager.getSession(M);return x?Promise.resolve(x.getDebugProtocolBreakpoint(O)):Promise.reject(new Error("debug session not found"))}async $startDebugging(M,O,x){let k,F=0;if(typeof O=="string")for(const U of this.debugConfigurationManager.all){if(U.configuration.name===O){k=U.configuration;break}F++}else k=O;if(!k)throw new Error(`No configuration ${O}`);const L={noDebug:!1,parentSession:this.sessionManager.getSession(x.parentSessionID),repl:x.repl,compact:x.compact,lifecycleManagedByParent:x.lifecycleManagedByParent};return!!await this.sessionManager.start({configuration:k,workspaceFolderUri:M&&l.Uri.revive(M.uri).toString(),index:F,...L})}$stopDebugging(M){if(M){const O=this.sessionManager.getSession(M);if(O)return this.sessionManager.stopSession(O)}else return this.sessionManager.stopSession(void 0);throw new Error(`Debug session '${M}' not found`)}toCustomApiBreakpoints(M){return M.map(O=>({id:O.id,enabled:O.enabled,condition:O.raw.condition,hitCondition:O.raw.hitCondition,logMessage:O.raw.logMessage,location:{uri:l.Uri.parse(O.uri),range:{startLineNumber:O.raw.line-1,startColumn:(O.raw.column||1)-1,endLineNumber:O.raw.line-1,endColumn:(O.raw.column||1)-1}}}))}};t.MainThreadDebug=I,n.__decorate([(0,r.Autowired)(u.IDebugSessionManager),n.__metadata("design:type",a.DebugSessionManager)],I.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(_.LabelService),n.__metadata("design:type",_.LabelService)],I.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(p.BreakpointManager),n.__metadata("design:type",p.BreakpointManager)],I.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(v.IDebugModelManager),n.__metadata("design:type",Object)],I.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],I.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(s.DebugPreferences),n.__metadata("design:type",Object)],I.prototype,"debugPreferences",void 0),n.__decorate([(0,r.Autowired)(E.WorkbenchEditorService),n.__metadata("design:type",E.WorkbenchEditorService)],I.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(y.IMessageService),n.__metadata("design:type",Object)],I.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(f.IFileServiceClient),n.__metadata("design:type",Object)],I.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(d.IDebugServer),n.__metadata("design:type",w.ExtensionDebugService)],I.prototype,"adapterContributionRegister",void 0),n.__decorate([(0,r.Autowired)(S.IActivationEventService),n.__metadata("design:type",S.IActivationEventService)],I.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(g.DebugSessionContributionRegistry),n.__metadata("design:type",D.ExtensionDebugSessionContributionRegistry)],I.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],I.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(b.ITerminalApiService),n.__metadata("design:type",Object)],I.prototype,"terminalService",void 0),n.__decorate([(0,r.Autowired)(v.IDebugConsoleModelService),n.__metadata("design:type",h.DebugConsoleModelService)],I.prototype,"debugConsoleModelService",void 0),n.__decorate([(0,r.Autowired)(c.OutputService),n.__metadata("design:type",c.OutputService)],I.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(d.IDebugService),n.__metadata("design:type",Object)],I.prototype,"debugService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],I.prototype,"injector",void 0),t.MainThreadDebug=I=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__param(1,(0,r.Optional)(A.IInterProcessConnectionService)),n.__metadata("design:paramtypes",[Object,Object])],I)},78690:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDecorations=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(43718),_=e(41893),v=e(46147);class p{constructor(g){this._proxy=g,this._idPool=0,this._requests=Object.create(null),this._resolver=Object.create(null)}enqueue(g,a,h){const d=++this._idPool,u=new Promise(E=>{this._requests[d]={id:d,handle:g,uri:a},this._resolver[d]=E,this._processQueue()});return h.onCancellationRequested(()=>{delete this._requests[d],delete this._resolver[d]}),u}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const g=this._requests,a=this._resolver;this._proxy.$provideFileDecorations(Object.values(g),l.CancellationToken.None).then(h=>{for(const d in a)a[d](h[d])}),this._requests=[],this._resolver=[],this._timer=void 0},0))}}let m=class{constructor(g){this.rpcProtocol=g,this._provider=new Map,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostDecorations),this._requestQueue=new p(this.proxy)}dispose(){this._provider.forEach(g=>(0,l.dispose)(g)),this._provider.clear()}$registerDecorationProvider(g,a){const h=new l.Emitter,d=this.decorationsService.registerDecorationsProvider({label:a,onDidChange:h.event,provideDecorations:(u,E)=>this._requestQueue.enqueue(g,u,E).then(f=>{if(!f)return;const[c,y,b,A]=f;return{weight:10,bubble:c||!1,color:A?.id,tooltip:y,letter:b}})});this._provider.set(g,[h,d])}$onDidChange(g,a){const h=this._provider.get(g);if(h){const[d]=h;d.fire(a&&a.map(u=>l.Uri.revive(u)))}}$unregisterDecorationProvider(g){const a=this._provider.get(g);a&&((0,l.dispose)(a),this._provider.delete(g))}};t.MainThreadDecorations=m,n.__decorate([(0,r.Autowired)(_.IDecorationsService),n.__metadata("design:type",_.IDecorationsService)],m.prototype,"decorationsService",void 0),t.MainThreadDecorations=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],m)},84680:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionDocumentData=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(26542),v=e(43718),p=e(54414),m=e(57517),s=e(17878),g=e(14951),a=e(46147),h=1e3*60*3,d=1e3*20,u=1024*1024*80;let E=class{constructor(b){this.proxy=b,this.onDidChangeContentEmitter=new v.Emitter,this.onDidChangeContent=this.onDidChangeContentEmitter.event,this.schemes=new Set}registerScheme(b){this.schemes.add(b)}unregisterScheme(b){this.schemes.delete(b)}handlesScheme(b){return this.schemes.has(b)}provideEditorDocumentModelContent(b,A){return this.proxy.$provideTextDocumentContent(b.toString(),A)}isReadonly(b){return!0}};E=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],E);let f=class extends v.WithEventBus{isDocSyncEnabled(b){var A;const S=b.toString();if(!this.docSyncEnabled.has(S)){const D=this.docManager.getModelReference(new v.URI(S),"mainthread doc size");D&&(this.docSyncEnabled.set(S,D.instance.getMonacoModel().getValueLength()<this.preference.getValid("editor.docExtHostSyncMaxSize",4*1024*1024*1024)),D.dispose())}return(A=this.docSyncEnabled.get(S))!==null&&A!==void 0?A:!1}isDocIgnored(b){return b.codeUri.scheme===v.Schemes.walkThroughSnippet}constructor(b){super(),this.rpcProtocol=b,this.editorDisposers=new Map,this.extHoldDocuments=new c,this.docSyncEnabled=new v.LRUMap(200,100),this.proxy=this.rpcProtocol.getProxy(a.ExtHostAPIIdentifier.ExtHostDocuments),this.provider=this.injector.get(E,[this.proxy]),this.contentRegistry.registerEditorDocumentModelContentProvider(this.provider),this.docManager.getAllModels().map(A=>{this.isDocSyncEnabled(A.uri)&&this.proxy.$fireModelOpenedEvent({uri:A.uri.toString(),lines:A.getText().split(A.eol),eol:A.eol,dirty:A.dirty,languageId:A.languageId,versionId:A.getMonacoModel().getVersionId()})})}onEditorDocumentModelContentChangeEvent(b){!this.isDocSyncEnabled(b.payload.uri)||this.isDocIgnored(b.payload.uri)||this.proxy.$fireModelChangedEvent({changes:b.payload.changes,uri:b.payload.uri.toString(),eol:b.payload.eol,dirty:b.payload.dirty,versionId:b.payload.versionId,isRedoing:b.payload.isRedoing,isUndoing:b.payload.isUndoing})}async onEditorDocumentModelWillSaveEvent(b){!this.isDocSyncEnabled(b.payload.uri)||this.isDocIgnored(b.payload.uri)||await this.proxy.$fireModelWillSaveEvent({uri:b.payload.uri.toString(),reason:b.payload.reason,dirty:b.payload.dirty})}onEditorDocumentModelOptionChangedEvent(b){!this.isDocSyncEnabled(b.payload.uri)||this.isDocIgnored(b.payload.uri)||this.proxy.$fireModelOptionsChangedEvent({encoding:b.payload.encoding,uri:b.payload.uri.toString(),languageId:b.payload.languageId,dirty:b.payload.dirty})}onEditorDocumentModelContentCreationEvent(b){!this.isDocSyncEnabled(b.payload.uri)||this.isDocIgnored(b.payload.uri)||this.proxy.$fireModelOpenedEvent({uri:b.payload.uri.toString(),lines:b.payload.content.split(b.payload.eol),eol:b.payload.eol,dirty:!1,languageId:b.payload.languageId,versionId:b.payload.versionId})}onEditorDocumentModelRemovedEvent(b){!this.isDocSyncEnabled(b.payload)||this.isDocIgnored(b.payload)||this.proxy.$fireModelRemovedEvent({uri:b.payload.toString()})}onEditorDocumentModelSavingEvent(b){!this.isDocSyncEnabled(b.payload)||this.isDocIgnored(b.payload)||this.proxy.$fireModelSavedEvent({uri:b.payload.toString()})}async $tryCreateDocument(b){b||(b={});const{language:A,content:S}=b,D=await this.docManager.createModelReference(new v.URI(`${v.Schemes.untitled}://temp/Untitled-`+this.tempDocIdCount.id),"ext-create-document");return A&&(D.instance.languageId=A),(0,v.isUndefinedOrNull)(S)||D.instance.updateContent(S),D.instance.uri.toString()}async $tryOpenDocument(b){const A=await this.docManager.createModelReference(new v.URI(b),"ext-open-document");this.extHoldDocuments.add(A)}async $trySaveDocument(b){const A=await this.docManager.getModelReference(new v.URI(b),"ext-saving-document");if(A)try{return A.instance.save(!0)}finally{A.dispose()}return!1}async $fireTextDocumentChangedEvent(b){this.provider.onDidChangeContentEmitter.fire(new v.URI(b))}$unregisterDocumentProviderWithScheme(b){this.editorDisposers.has(b)&&(this.editorDisposers.get(b).dispose(),this.editorDisposers.delete(b))}$registerDocumentProviderWithScheme(b){this.$unregisterDocumentProviderWithScheme(b);const A=new v.Disposable;A.addDispose(this.resourceService.registerResourceProvider({scheme:b,provideResource:async S=>Promise.all([this.labelService.getName(S),this.labelService.getIcon(S)]).then(([D,T])=>({name:D,icon:T,uri:S,metadata:null}))})),A.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(b,(S,D)=>{this.fileServiceClient.handlesScheme(b)||D.push({type:m.EditorOpenType.code,readonly:!0})})),A.addDispose({dispose:()=>{this.provider.unregisterScheme(b)}}),this.provider.registerScheme(b),this.editorDisposers.set(b,A)}dispose(){super.dispose();for(const b of this.editorDisposers.values())b.dispose();this.editorDisposers.clear()}};t.MainThreadExtensionDocumentData=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.UntitledDocumentIdCounter)],f.prototype,"tempDocIdCount",void 0),n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"docManager",void 0),n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],f.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.ResourceService)],f.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.EditorComponentRegistry)],f.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.LabelService)],f.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],f.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],f.prototype,"fileServiceClient",void 0),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelContentChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentChangeEvent",null),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelWillSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelWillSaveEvent]),n.__metadata("design:returntype",Promise)],f.prototype,"onEditorDocumentModelWillSaveEvent",null),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelOptionChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelOptionChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelOptionChangedEvent",null),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelCreationEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelCreationEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentCreationEvent",null),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelRemovalEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelRemovalEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelRemovedEvent",null),n.__decorate([(0,v.OnEvent)(m.EditorDocumentModelSavedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.EditorDocumentModelSavedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelSavingEvent",null),t.MainThreadExtensionDocumentData=f=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],f);class c{constructor(){this.maxLength=u,this.maxAge=h,this.minAge=d,this.refs=[],this.length=0}add(b){const A=b.instance.getText().length;this.length+=A;let S=null;const D={ref:b,dispose:()=>{const T=this.refs.indexOf(D);T!==0&&(this.length-=A,b.dispose(),clearTimeout(S),this.refs.splice(T,1))},createTimeStamp:new Date().getTime()};S=setTimeout(()=>{D.dispose()},this.maxAge),this.refs.push(D),this.clean()}clean(){for(;this.length>this.maxLength&&this.refs.length>1&&!(this.refs[0].createTimeStamp+this.minAge>new Date().getTime());)this.disposeFirst()}disposeFirst(){const b=this.refs.shift();b&&b.dispose()}}},11646:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorTabsService=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(75524),_=e(43718),v=e(54414),p=e(51553),m=e(46147);let s=class extends _.Disposable{constructor(u){super(),this.rpcProtocol=u,this.prevEditorGroups=new Set,this.groupDataStore=new Map,this.tabStore=new a,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostEditorTabs),this.addDispose(this.workbenchEditorService.onDidEditorGroupsChanged(()=>{this.updateGroups()})),this.addDispose(this.workbenchEditorService.onActiveResourceChange(()=>{this.updateGroups()})),this.workbenchEditorService.contributionsReady.promise.then(()=>{this.updateGroups()})}$initializeState(){this.updateGroups()}$moveTab(u,E,f,c){const y=this.findEditorTabData(u);if(y){const{group:b,resource:A}=y;let S=b;(0,_.isUndefined)(f)||(S=this.workbenchEditorService.sortedEditorGroups[f]),S?S.dropUri(A.uri,v.DragOverPosition.CENTER,b,S.resources[E]):b.dropUri(A.uri,v.DragOverPosition.RIGHT)}}async $closeTab(u,E){return(await Promise.all(u.map(async c=>{const y=this.findEditorTabData(c);if(y)return await y.group.close(y.resource.uri)}))).filter(c=>!!c).length>0}async $closeGroup(u,E){return(await Promise.all(u.map(async c=>{var y;const b=(y=this.groupDataStore.get(c))===null||y===void 0?void 0:y.editorGroup;if(b)try{return await b.closeAll()}catch{return!1}}))).filter(c=>!!c).length>0}findEditorTabData(u){return this.tabStore.all.get(u)}getOrCreateGroupData(u){if(!this.groupDataStore.has(u.groupId)){const E=new h(u,this.workbenchEditorService,this.tabStore,this.proxy);E.addDispose({dispose:()=>{this.groupDataStore.get(u.groupId)===E&&this.groupDataStore.delete(u.groupId)}}),this.groupDataStore.set(u.groupId,E)}return this.groupDataStore.get(u.groupId)}updateGroups(){const u=(0,_.diffSets)(this.prevEditorGroups,new Set(this.workbenchEditorService.editorGroups));u.added.length>0||u.removed.length>0?this.proxy.$acceptEditorTabModel(this.workbenchEditorService.editorGroups.map(E=>{const f=this.getOrCreateGroupData(E);return{...f.dto,tabs:f.tabs.map(c=>c.dto)}})):this.workbenchEditorService.editorGroups.forEach(E=>{this.getOrCreateGroupData(E).tryCheckUpdate()}),this.prevEditorGroups=new Set(this.workbenchEditorService.editorGroups)}};t.MainThreadEditorTabsService=s,n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorServiceImpl)],s.prototype,"workbenchEditorService",void 0),t.MainThreadEditorTabsService=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],s);class g{constructor(u,E){this.group=u,this.resource=E,this.tryUpdate()}updateResource(u){this.resource=u}tryUpdate(){const u=g.from(this.group,this.resource);return this._dto&&JSON.stringify(this._dto)!==JSON.stringify(u)?(this._dto=u,!0):(this._dto=u,!1)}get dto(){return this._dto}static getTabId(u,E){return`${u.groupId}~${E.uri.toString()}`}get index(){return this.group.resources.indexOf(this.resource)}static from(u,E){var f,c,y,b,A,S;const D=g.getTabId(u,E),T=u.getLastOpenType(E);let w={kind:0};if(T){if(T.type==="code")w={kind:1,uri:E.uri.codeUri};else if(T.type==="diff"){const{metadata:I}=E;I&&(w={kind:2,original:I.original.codeUri,modified:I.modified.codeUri})}else if(T.type==="mergeEditor"){const{metadata:I}=E;if(I){const{ancestor:R,input1:M,input2:O,output:x}=I,k=l.MergeEditorInputData.from(M),F=l.MergeEditorInputData.from(O);w={kind:3,base:_.Uri.parse(R),input1:k.uri.codeUri,input2:F.uri.codeUri,result:_.Uri.parse(x)}}}else if(T.type==="component"){const I=u.editorComponentRegistry.getEditorComponent(T.componentId);!((f=I?.metadata)===null||f===void 0)&&f.extWebview?w={kind:7,viewType:(c=I?.metadata)===null||c===void 0?void 0:c.extWebview}:!((y=I?.metadata)===null||y===void 0)&&y.customEditor&&(w={kind:6,viewType:(b=I?.metadata)===null||b===void 0?void 0:b.customEditor,uri:E.uri.codeUri})}}return{id:D,label:E.name,input:w,isActive:u.currentResource===E,isPinned:!1,isPreview:!!(!((A=u.previewURI)===null||A===void 0)&&A.isEqual(E.uri)),isDirty:!!(!((S=u.resourceService.getResourceDecoration(E.uri))===null||S===void 0)&&S.dirty)}}}class a{constructor(){this.all=new Map,this.mapByUri=new Map}getOrCreateData(u,E){const f=g.getTabId(u,E);if(this.all.has(f))this.all.get(f).updateResource(E);else{const c=new g(u,E),y=E.uri.toString();this.mapByUri.has(y)||this.mapByUri.set(y,new Map),this.mapByUri.get(y).set(f,c),this.all.set(f,c)}return this.all.get(f)}removeData(u){var E,f;const c=this.all.get(u);if(c){this.all.delete(u);const y=c.resource.uri.toString();(E=this.mapByUri.get(y))===null||E===void 0||E.delete(u),((f=this.mapByUri.get(y))===null||f===void 0?void 0:f.size)===0&&this.mapByUri.delete(y)}}getByResourceUri(u){var E;return Array.from(((E=this.mapByUri.get(u.toString()))===null||E===void 0?void 0:E.values())||[])}}class h extends _.Disposable{constructor(u,E,f,c){super(),this.editorGroup=u,this.editorService=E,this.store=f,this.proxy=c,this.tabs=[],this._data=void 0,this.editorGroup.addDispose(this),this.init()}init(){this.tabs=this.editorGroup.resources.map(u=>this.store.getOrCreateData(this.editorGroup,u)),this.addDispose(this.editorGroup.onDidEditorGroupTabOperation(u=>{const E={open:0,close:1,move:3}[u.type],f=this.store.getOrCreateData(this.editorGroup,u.resource);f.tryUpdate(),this.proxy.$acceptTabOperation({kind:E,groupId:this.editorGroup.groupId,tabDto:f.dto,index:u.index,oldIndex:u.oldIndex})})),this.addDispose(this.editorGroup.onDidEditorGroupBodyChanged(()=>{this.onTabsMayUpdated()})),this.addDispose(this.editorGroup.onDidEditorGroupTabChanged(()=>{this.onTabsMayUpdated()}))}onTabsMayUpdated(){this.tabs=this.editorGroup.resources.map((u,E)=>{const f=this.store.getOrCreateData(this.editorGroup,u);return f.tryUpdate()&&this.proxy.$acceptTabOperation({kind:2,tabDto:f.dto,index:E,groupId:this.editorGroup.groupId}),f})}tryCheckUpdate(){const u=this._data,E={groupId:this.editorGroup.groupId,isActive:this.editorService.currentEditorGroup===this.editorGroup,viewColumn:this.editorGroup.index};this._data=E,u&&(u.viewColumn!==E.viewColumn?this.proxy.$acceptTabGroupUpdate({...this.dto,tabs:[]}):!u.isActive&&E.isActive&&this.proxy.$acceptTabGroupUpdate({...this.dto,tabs:[]}))}get dto(){return this._data||(this._data={groupId:this.editorGroup.groupId,isActive:this.editorService.currentEditorGroup===this.editorGroup,viewColumn:this.editorGroup.index}),this._data}}},85589:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorService=void 0,t.cursorStyleToString=R;const n=e(85608),r=n.__importDefault(e(82451)),o=e(76003),l=e(8919),_=e(40827),v=e(43718),p=e(54414),m=e(57517),s=e(71624),g=e(51553),a=n.__importStar(e(20868)),h=e(87822),d=e(16781),u=e(46147),E=e(53043),f=e(84680);let c=class extends v.WithEventBus{constructor(O,x){super(),this.rpcProtocol=O,this.documents=x,this.propertiesChangeCache=new Map,this.proxy=this.rpcProtocol.getProxy(u.ExtHostAPIIdentifier.ExtHostEditors),this.$getInitialState().then(k=>{this.proxy.$acceptChange(k)})}async $getInitialState(){this.startEvents();const O=this.editorService.editorGroups.map(k=>{if(k.currentOpenType&&S(k.currentOpenType)){const F=k.currentEditor;return!F.currentDocumentModel||!this.documents.isDocSyncEnabled(F.currentDocumentModel.uri)?void 0:{id:y(k,k.currentResource.uri),uri:F.currentDocumentModel.uri.toString(),selections:F.getSelections()||[],options:A(F.monacoEditor),viewColumn:T(k),visibleRanges:F.monacoEditor.getVisibleRanges()}}}).filter(k=>!!k),x=this.editorService.currentResource&&O.find(k=>k.uri===this.editorService.currentResource.uri.toString());return{created:O,actived:x&&this.documents.isDocSyncEnabled(x.uri)&&x.id}}async $closeEditor(O){if(this.getEditor(O)){const k=this.getGroup(O);k.close(k.currentResource.uri)}}async $revealRange(O,x,k){const F=this.getEditor(O);if(F)switch(k){case u.TextEditorRevealType.InCenter:return F.monacoEditor.revealRangeInCenter(x);case u.TextEditorRevealType.AtTop:return F.monacoEditor.revealRangeAtTop(x);case u.TextEditorRevealType.InCenterIfOutsideViewport:return F.monacoEditor.revealRangeInCenterIfOutsideViewport(x);default:return F.monacoEditor.revealRange(x)}}async $createTextEditorDecorationType(O,x){this.resolveIconPaths(x),this.resolveIconPaths(x.dark),this.resolveIconPaths(x.light),this.decorationService.createTextEditorDecorationType(x,O)}resolveIconPaths(O){if(!O)return O;if(O.gutterIconPath){let x;typeof O.gutterIconPath=="string"?x=v.URI.file(O.gutterIconPath):x=v.URI.from(O.gutterIconPath),O.gutterIconPath=this.staticResourceService.resolveStaticResource(x).toString()}}async $deleteTextEditorDecorationType(O){const x=this.decorationService.getTextEditorDecorationType(O);x&&x.dispose()}async $applyDecoration(O,x,k){const F=this.getEditor(O);F&&F.applyDecoration(x,k)}async $insertSnippet(O,x,k=[],F={undoStopAfter:!0,undoStopBefore:!0}){const L=this.getEditor(O);L&&L.insertSnippet(x,k,F)}async $updateOptions(O,x){const k=this.getEditor(O);k&&await this.setConfiguration(k.monacoEditor,x)}getEditor(O){var x,k;const F=this.getGroup(O);if(!F)return;const L=F.currentResource;if(L&&F.currentOpenType&&S(F.currentOpenType)){if(O===y(F,L.uri))return F.currentEditor;if(((x=F.currentOpenType)===null||x===void 0?void 0:x.type)===m.EditorOpenType.diff&&O===y(F,L.metadata.original,"original"))return F.diffEditor.originalEditor;if(((k=F.currentOpenType)===null||k===void 0?void 0:k.type)===m.EditorOpenType.diff&&O===y(F,L.metadata.modified,"modified"))return F.diffEditor.modifiedEditor}}getGroup(O){const x=b(O);return this.editorService.getEditorGroup(x)}triggerPropertiesChange(){const O=[];this.propertiesChangeCache.forEach(x=>{O.push(x)}),this.propertiesChangeCache.clear(),this.proxy.$acceptPropertiesChanges(O)}batchPropertiesChanges(O){const{id:x}=O;let k=this.propertiesChangeCache.get(x);k||(k={}),k=(0,r.default)(k,O),this.propertiesChangeCache.set(x,k),this.triggerPropertiesChange()}startEvents(){this.addDispose([this.eventBus.on(m.EditorGroupChangeEvent,O=>{const x=O.payload;if(!w(x.newResource,x.oldResource)||!I(x.newOpenType,x.oldOpenType)){const k={};if(x.newOpenType&&(x.newOpenType.type===m.EditorOpenType.code||x.newOpenType.type===m.EditorOpenType.diff)){const F=x.group.currentEditor;if(F.currentDocumentModel){if(this.documents.isDocSyncEnabled(F.currentDocumentModel.uri))if(k.created=[],x.newOpenType.type===m.EditorOpenType.diff){const L=x.group.diffEditor.originalEditor,N=x.group.diffEditor.modifiedEditor,U=y(x.group,x.newResource.metadata.original,"original");k.created.push({id:U,uri:L.currentUri.toString(),selections:L.getSelections()||[],options:A(L.monacoEditor),viewColumn:T(x.group),visibleRanges:L.monacoEditor.getVisibleRanges()});const W=y(x.group,x.newResource.metadata.modified,"modified");k.created.push({id:W,uri:N.currentUri.toString(),selections:N.getSelections()||[],options:A(N.monacoEditor),viewColumn:T(x.group),visibleRanges:N.monacoEditor.getVisibleRanges()})}else k.created.push({id:y(x.group,x.newResource.uri),uri:F.currentDocumentModel.uri.toString(),selections:F.getSelections()||[],options:A(F.monacoEditor),viewColumn:T(x.group),visibleRanges:F.monacoEditor.getVisibleRanges()})}w(x.newResource,x.oldResource)&&!I(x.newOpenType,x.oldOpenType)&&x.newResource===this.editorService.currentResource&&(k.actived=y(x.group,x.newResource.uri))}x.oldOpenType&&(x.oldOpenType.type===m.EditorOpenType.code||x.oldOpenType.type===m.EditorOpenType.diff)&&(k.removed=[],x.oldOpenType.type===m.EditorOpenType.diff?(k.removed.push(y(x.group,x.oldResource.metadata.original,"original")),k.removed.push(y(x.group,x.oldResource.metadata.modified,"modified"))):k.removed=[y(x.group,x.oldResource.uri)]),this.proxy.$acceptChange(k)}}),this.editorService.onActiveEditorUriChange(O=>{O&&this.editorService.currentEditorGroup&&S(this.editorService.currentEditorGroup.currentOpenType)?this.acceptCurrentEditor(O):this.proxy.$acceptChange({actived:"-1"})}),this.eventBus.on(m.EditorConfigurationChangedEvent,O=>{const x=y(O.payload.group,O.payload.resource.uri);O.payload.group.currentEditor&&O.payload.group.currentEditor.monacoEditor.getModel()&&this.batchPropertiesChanges({id:x,options:A(O.payload.group.currentEditor.monacoEditor)})}),this.eventBus.on(m.EditorSelectionChangeEvent,O=>{const x=y(O.payload.group,O.payload.editorUri,O.payload.side);this.batchPropertiesChanges({id:x,selections:{selections:O.payload.selections,source:O.payload.source}}),this.acceptCurrentEditor(O.payload.editorUri)}),this.eventBus.on(m.EditorVisibleChangeEvent,O=>{const x=y(O.payload.group,O.payload.resource.uri);this.batchPropertiesChanges({id:x,visibleRanges:O.payload.visibleRanges})}),this.eventBus.on(m.EditorGroupIndexChangedEvent,O=>{if(D(O.payload.group)){const x=y(O.payload.group,O.payload.group.currentResource.uri);this.batchPropertiesChanges({id:x,viewColumn:T(O.payload.group)})}})])}acceptCurrentEditor(O){var x,k,F,L,N;let U;const W=((x=this.editorService.currentEditorGroup.currentOpenType)===null||x===void 0?void 0:x.type)===m.EditorOpenType.diff&&((k=this.editorService.currentEditorGroup.diffEditor.originalEditor.currentUri)===null||k===void 0?void 0:k.isEqual(O)),j=((F=this.editorService.currentEditorGroup.currentOpenType)===null||F===void 0?void 0:F.type)===m.EditorOpenType.diff&&((L=this.editorService.currentEditorGroup.diffEditor.modifiedEditor.currentUri)===null||L===void 0?void 0:L.isEqual(O));W&&(U="original"),j&&(U="modified"),U?this.proxy.$acceptChange({actived:y(this.editorService.currentEditorGroup,O,U)}):this.proxy.$acceptChange({actived:y(this.editorService.currentEditorGroup,(N=this.editorService.currentEditorGroup.currentResource)===null||N===void 0?void 0:N.uri)})}async $applyEdits(O,x,k,F){const L=this.getEditor(O);if(L&&L.currentDocumentModel){const N=L.currentDocumentModel.getMonacoModel();if(N&&N.getVersionId()===x){typeof F.setEndOfLine<"u"&&N.pushEOL(F.setEndOfLine);const U=k.map(W=>({range:a.Range.lift(W.range),text:W.text,forceMoveMarkers:W.forceMoveMarkers}));return F.undoStopBefore&&L.monacoEditor.pushUndoStop(),L.monacoEditor.executeEdits("MainThreadTextEditor",U),F.undoStopAfter&&L.monacoEditor.pushUndoStop(),!0}else return!1}else return!1}async $openResource(O,x){x.forceOpenType={type:m.EditorOpenType.code},x.focus=!0,x={...x,...(0,E.viewColumnToResourceOpenOptions)(x.viewColumn)};const k=await this.editorService.open(new v.URI(O),x);if(k)return y(k.group,k.resource.uri);throw new Error("Editor Open uri "+O.toString()+" Failed")}$setSelections(O,x){return this.getEditor(O)?(this.getEditor(O).setSelections(x),Promise.resolve()):Promise.reject(`No Such TextEditor: ${O}`)}setConfiguration(O,x){if(O.getModel()&&this._setIndentConfiguration(O.getModel(),x),!!O){if(x.cursorStyle){const k=R(x.cursorStyle);O.updateOptions({cursorStyle:k})}if(typeof x.lineNumbers<"u"){let k;switch(x.lineNumbers){case 1:k="on";break;case 2:k="relative";break;case 3:k="interval";break;default:k="off"}O.updateOptions({lineNumbers:k})}}}$getDiffInformation(O){const x=this.getEditor(O);if(!x)return Promise.reject(new Error("No such TextEditor"));const k=x.monacoEditor;if(!k)return Promise.reject(new Error("No such CodeEditor"));const F=k.getId(),L=this.codeEditorService.listDiffEditors(),[N]=L.filter(W=>W.originalEditor.getId()===F||W.modifiedEditor.getId()===F);if(N){const W=N.monacoDiffEditor.getLineChanges();return W?Promise.resolve(W.map(j=>{var Q;return[j.originalStartLineNumber,j.originalEndLineNumber,j.modifiedStartLineNumber,j.modifiedEndLineNumber,(Q=j.charChanges)===null||Q===void 0?void 0:Q.map(G=>[G.originalStartLineNumber,G.originalStartColumn,G.originalEndLineNumber,G.originalEndColumn,G.modifiedStartLineNumber,G.modifiedStartColumn,G.modifiedEndLineNumber,G.modifiedEndColumn])]})):Promise.resolve([])}const U=k.getContribution("editor.contrib.dirtydiff");return U?Promise.resolve(U.getChanges()):Promise.resolve([])}_setIndentConfiguration(O,x){const k=d.StandaloneServices.get(h.IModelService).getCreationOptions(O.getLanguageId(),O.uri,O.isForSimpleWidget);if(x.tabSize==="auto"||x.insertSpaces==="auto"){let L=k.insertSpaces,N=k.tabSize;x.insertSpaces!=="auto"&&typeof x.insertSpaces<"u"&&(L=x.insertSpaces),x.tabSize!=="auto"&&typeof x.tabSize<"u"&&(N=x.tabSize),O.detectIndentation(L,N);return}const F={};typeof x.insertSpaces<"u"&&(F.insertSpaces=x.insertSpaces),typeof x.tabSize<"u"&&(F.tabSize=x.tabSize),typeof x.indentSize<"u"&&(x.indentSize==="tabSize"?F.indentSize=F.tabSize||k.tabSize:F.indentSize=x.indentSize),O.updateOptions(F)}};t.MainThreadEditorService=c,n.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",g.WorkbenchEditorServiceImpl)],c.prototype,"editorService",void 0),n.__decorate([(0,o.Autowired)(m.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],c.prototype,"decorationService",void 0),n.__decorate([(0,o.Autowired)(p.EditorCollectionService),n.__metadata("design:type",s.EditorCollectionServiceImpl)],c.prototype,"codeEditorService",void 0),n.__decorate([(0,o.Autowired)(_.StaticResourceService),n.__metadata("design:type",_.StaticResourceService)],c.prototype,"staticResourceService",void 0),t.MainThreadEditorService=c=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__param(0,(0,o.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object,f.MainThreadExtensionDocumentData])],c);function y(M,O,x){return M.name+"."+(x?`${x}.`:"")+O.toString()}function b(M){return M.substr(0,M.indexOf("."))}function A(M){const O=M.getModel().getOptions();return{tabSize:O.tabSize,indentSize:O.indentSize,insertSpaces:O.insertSpaces,cursorStyle:M.getOption(a.editor.EditorOption.cursorStyle),lineNumbers:M.getOption(a.editor.EditorOption.lineNumbers).renderType}}function S(M){return M?M.type===m.EditorOpenType.code||M.type===m.EditorOpenType.diff:!1}function D(M){return M.currentOpenType&&S(M.currentOpenType)}function T(M){return M.index+1}function w(M,O){return!!(!M&&!O||M&&O&&M.uri.isEqual(O.uri))}function I(M,O){return!!(!M&&!O||M&&O&&M.type===O.type&&M.componentId===O.componentId)}function R(M){if(M===u.TextEditorCursorStyle.Line)return"line";if(M===u.TextEditorCursorStyle.Block)return"block";if(M===u.TextEditorCursorStyle.Underline)return"underline";if(M===u.TextEditorCursorStyle.LineThin)return"line-thin";if(M===u.TextEditorCursorStyle.BlockOutline)return"block-outline";if(M===u.TextEditorCursorStyle.UnderlineThin)return"underline-thin";throw new Error("cursorStyleToString: Unknown cursorStyle")}},22869:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEnv=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(19805),v=e(43718),p=e(83507),m=e(46147),s=e(51328),g=e(49731);let a=class{isSupportedLink(d){return _.HttpOpener.standardSupportedLinkSchemes.has(d.scheme)||d.scheme===this.appConfig.uriScheme}constructor(d,u){this.rpcProtocol=d,this.storage=u,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostEnv),this.eventDispose=this.loggerManger.onDidChangeLogLevel(E=>{this.proxy.$fireChangeLogLevel(E)}),this.setLogLevel(),this.setEnvValues()}async setEnvValues(){const{appName:d,uriScheme:u,appHost:E,appRoot:f,customVSCodeEngineVersion:c}=this.appConfig,y=await this.storage.$getValue(!0,v.firstSessionDateStorageKey);this.proxy.$setEnvValues({customVSCodeEngineVersion:c,appName:d,uriScheme:u,appHost:E,appRoot:f,language:(0,v.getCodeLanguage)(),uiKind:this.appConfig.isElectronRenderer?s.UIKind.Desktop:s.UIKind.Web,firstSessionDate:y?.date})}dispose(){this.eventDispose.dispose()}async setLogLevel(){const d=await this.loggerManger.getGlobalLogLevel();await this.proxy.$setLogLevel(d)}async $clipboardReadText(){try{return await this.clipboardService.readText()}catch{return""}}$clipboardWriteText(d){return new Promise(async u=>{try{await this.clipboardService.writeText(d)}catch{}u()})}async $openExternal(d){return this.isSupportedLink(v.URI.from(d))?await this.openerService.open(d.toString(!0)):!1}getWindowId(){return this.applicationService.windowId}async $asExternalUri(d){const{uriScheme:u}=this.appConfig,E=v.URI.from(d);if(E.scheme===u){const c=this.getWindowId();let y=E.query;return y?y+=`&windowId=${c}`:y=`windowId=${c}`,E.withQuery(y).codeUri}return this.externalUriService.resolveExternalUri(E).codeUri}};t.MainThreadEnv=a,n.__decorate([(0,r.Autowired)(p.ILoggerManagerClient),n.__metadata("design:type",Object)],a.prototype,"loggerManger",void 0),n.__decorate([(0,r.Autowired)(l.IOpenerService),n.__metadata("design:type",Object)],a.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(l.IClipboardService),n.__metadata("design:type",Object)],a.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(l.IExternalUriService),n.__metadata("design:type",Object)],a.prototype,"externalUriService",void 0),n.__decorate([(0,r.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],a.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.IApplicationService),n.__metadata("design:type",Object)],a.prototype,"applicationService",void 0),t.MainThreadEnv=a=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object,g.MainThreadStorage])],a)},13335:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystemEvent=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(68969),v=e(43718),p=e(14951),m=e(52902),s=e(72665),g=e(26199),a=e(46147);let h=class extends v.Disposable{constructor(u){super(),this.rpcProtocol=u,this._proxy=this.rpcProtocol.getProxy(a.ExtHostAPIIdentifier.ExtHostFileSystemEvent),this._dispatchFileEventListener(),this._participateFileOperation(),this._initShowPreview()}_dispatchFileEventListener(){const u={created:[],changed:[],deleted:[]};this.addDispose(this.fileService.onFilesChanged(E=>{let f=!1;for(const c of E)switch(c.type){case p.FileChangeType.ADDED:u.created.push(v.Uri.parse(c.uri)),f=!0;break;case p.FileChangeType.UPDATED:u.changed.push(v.Uri.parse(c.uri)),f=!0;break;case p.FileChangeType.DELETED:u.deleted.push(v.Uri.parse(c.uri)),f=!0;break}f&&(this._proxy.$onFileEvent(u),u.created=[],u.changed=[],u.deleted=[])}))}_participateFileOperation(){this.addDispose(this.workspaceFileService.registerFileOperationParticipant({participate:this.fileOperationParticipant.bind(this)})),this.addDispose(this.workspaceFileService.onDidRunWorkspaceFileOperation(u=>this._proxy.$onDidRunFileOperation(u.operation,u.files)))}_initShowPreview(){this._showPreview=this.preferenceService.get("workbench.refactoringChanges.showPreviewStrategy"),this.addDispose(this.preferenceService.onPreferenceChanged(u=>{u.preferenceName==="workbench.refactoringChanges.showPreviewStrategy"&&(this._showPreview=u.newValue)}))}async fileOperationParticipant(...u){const[E,f,c,y,b]=u,A=new v.CancellationTokenSource(b),S=setTimeout(()=>A.cancel(),y),D=await this.progressService.withProgress({location:v.ProgressLocation.Notification,title:this.getProgressLabel(f),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const R=this._proxy.$onWillRunFileOperation(f,E,y,b);return(0,v.raceCancellation)(R,A.token)},()=>{A.cancel()}).finally(()=>{A.dispose(),clearTimeout(S)});if(!D)return;let T=this._showPreview;const w=D.edit.edits.some(R=>{var M;return(M=R.metadata)===null||M===void 0?void 0:M.needsConfirmation});if(T==="askMe"){let R;if(D.extensionNames.length===1?f===0?R=(0,v.formatLocalize)("refactoring-changes.ask.1.create",D.extensionNames[0]):f===3?R=(0,v.formatLocalize)("refactoring-changes.ask.1.copy",D.extensionNames[0]):f===2?R=(0,v.formatLocalize)("refactoring-changes.ask.1.move",D.extensionNames[0]):R=(0,v.formatLocalize)("refactoring-changes.ask.1.delete",D.extensionNames[0]):f===0?R=(0,v.formatLocalize)("refactoring-changes.ask.N.create",D.extensionNames.length):f===3?R=(0,v.formatLocalize)("refactoring-changes.ask.N.copy",D.extensionNames.length):f===2?R=(0,v.formatLocalize)("refactoring-changes.ask.N.move",D.extensionNames.length):R=(0,v.formatLocalize)("refactoring-changes.ask.N.delete",D.extensionNames.length),w){const M=[(0,v.localize)("refactoring-changes.msg.showPreview"),(0,v.localize)("refactoring-changes.msg.skipChanges")],O=await this.dialogService.open({message:R,type:v.MessageType.Info,buttons:M});if(T="show",O===M[1])return}else{const M=[(0,v.localize)("refactoring-changes.msg.showPreview"),(0,v.localize)("refactoring-changes.msg.skipChanges"),(0,v.localize)("component.modal.okText")],O=await this.dialogService.open({message:R,type:v.MessageType.Info,buttons:M});if(O===M[1])return;T=O===M[0]?"show":"hide"}}this.logger.log("[onWill-handler] applying additional workspace edit from extensions",D.extensionNames);const I=D?.edit;I&&await this.bulkEditService.apply(m.ResourceEdit.convert(I),{showPreview:T==="show"})}getProgressLabel(u){switch(u){case 0:return(0,v.localize)("fileOperation.create","Running 'File Create' participants...");case 1:return(0,v.localize)("fileOperation.delete","Running 'File Delete' participants...");case 3:return(0,v.localize)("fileOperation.copy","Running 'File Copy' participants...");case 2:return(0,v.localize)("fileOperation.move","Running 'File Move' participants...")}}};t.MainThreadFileSystemEvent=h,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],h.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(g.IWorkspaceFileService),n.__metadata("design:type",Object)],h.prototype,"workspaceFileService",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(_.IProgressService),n.__metadata("design:type",Object)],h.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(v.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(s.IDialogService),n.__metadata("design:type",Object)],h.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(g.IBulkEditServiceShape),n.__metadata("design:type",Object)],h.prototype,"bulkEditService",void 0),t.MainThreadFileSystemEvent=h=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],h)},14382:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystem=void 0;const r=e(85608),o=e(76003),l=e(8919),_=e(41869),v=e(43163),p=e(42933),m=e(46147),s=e(53043),g=e(34687);let a=n=class{constructor(u){this.rpcProtocol=u,this.disposable=new _.Disposable,this._fileProvider=new Map,this._proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostFileSystem);const E=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostFileSystemInfo);for(const f of this._fileService.listCapabilities())E.$acceptProviderInfos(f.scheme,f.capabilities);this.disposable.addDispose(this._fileService.onDidChangeFileSystemProviderRegistrations(f=>{var c,y;return E.$acceptProviderInfos(f.scheme,(y=(c=f.provider)===null||c===void 0?void 0:c.capabilities)!==null&&y!==void 0?y:null)})),this.disposable.addDispose(this._fileService.onDidChangeFileSystemProviderCapabilities(f=>E.$acceptProviderInfos(f.scheme,f.provider.capabilities)))}dispose(){this.disposable.dispose(),this._fileProvider.forEach(u=>u.dispose()),this._fileProvider.clear()}$registerFileSystemProvider(u,E,f){this.disposable.addDispose(this.schemeRegistry.registerFileSystemProvider({scheme:E})),this._fileProvider.set(u,new h(this._fileService,E,f,u,this._proxy))}$unregisterProvider(u){(0,_.dispose)(this._fileProvider.get(u)),this._fileProvider.delete(u)}$onFileSystemChange(u,E){const f=this._fileProvider.get(u);if(!f)throw new Error("Unknown file provider");f.$onFileSystemChange(E)}$stat(u){return this._fileService.getFileStat(_.URI.revive(u).toString()).then(E=>(0,s.toFileStat)(E)).catch(n._handleError)}$readdir(u){return this._fileService.getFileStat(_.URI.revive(u).toString()).then(E=>{if(!E)throw new Error("file stat undefined");if(!E.isDirectory){const f=new Error(E.uri);throw f.name=g.FileSystemProviderErrorCode.FileNotADirectory,f}return E.children?E.children.map(f=>[new _.URI(f.uri).displayName,n._asFileType(f)]):[]}).catch(n._handleError)}static _asFileType(u){let E=0;return u.type&&u.type===p.FileType.File?E+=p.FileType.File:u.isDirectory&&(E+=p.FileType.Directory),u.isSymbolicLink&&(E+=p.FileType.SymbolicLink),E}$readFile(u){return this._fileService.readFile(_.URI.revive(u).toString()).then(E=>E.content.buffer).catch(n._handleError)}async $writeFile(u,E){try{const f=_.URI.revive(u),c=await this._fileService.getFileStat(f.toString(),!1);c?await this._fileService.setContent(c,E):(await(0,v.ensureDir)(new _.URI(f).path.dir.toString(),{mkdir:y=>this.$mkdir(_.URI.file(y).codeUri),access:y=>this._fileService.access(_.URI.file(y).codeUri.toString())}),await this._fileService.createFile(f.toString(),{content:_.BinaryBuffer.wrap(E).toString()}))}catch(f){return n._handleError(f)}}$rename(u,E,f){return this._fileService.move(_.URI.revive(u).toString(),_.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$copy(u,E,f){return this._fileService.copy(_.URI.revive(u).toString(),_.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$mkdir(u){return this._fileService.createFolder(_.URI.revive(u).toString()).then(()=>{}).catch(n._handleError)}$delete(u,E){return this._fileService.delete(_.URI.revive(u).toString(),{moveToTrash:E.useTrash}).catch(n._handleError)}static _handleError(u){if(u instanceof p.FileOperationError)switch(u.fileOperationResult){case 1:u.name=g.FileSystemProviderErrorCode.FileNotFound;break;case 0:u.name=g.FileSystemProviderErrorCode.FileIsADirectory;break;case 6:u.name=g.FileSystemProviderErrorCode.NoPermissions;break;case 4:u.name=g.FileSystemProviderErrorCode.FileExists;break}throw u}};t.MainThreadFileSystem=a,r.__decorate([(0,o.Autowired)(p.IFileServiceClient),r.__metadata("design:type",Object)],a.prototype,"_fileService",void 0),r.__decorate([(0,o.Autowired)(p.IBrowserFileSystemRegistry),r.__metadata("design:type",Object)],a.prototype,"schemeRegistry",void 0),t.MainThreadFileSystem=a=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object])],a);class h{get readonly(){return!!(this.capabilities&2048)}constructor(u,E,f,c,y){this._handle=c,this._proxy=y,this._onDidChange=new _.Emitter,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=_.Event.None,this.capabilities=f,this._registration=u.registerProvider(E,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(u,E){const f=Math.random();return this._proxy.$watch(this._handle,f,u,E),f}unwatch(u){this._proxy.$unwatch(this._handle,u)}$onFileSystemChange(u){this._onDidChange.fire(u.map(h._createFileChange))}static _createFileChange(u){return{uri:u.uri,type:u.type}}async stat(u){return await this.doGetStat(u)}async readFile(u){return await this._proxy.$readFile(this._handle,u)}writeFile(u,E,f){return this._proxy.$writeFile(this._handle,u,E,f)}delete(u,E){return this._proxy.$delete(this._handle,u,E)}createDirectory(u){return this._proxy.$mkdir(this._handle,u)}readDirectory(u){return this._proxy.$readdir(this._handle,u)}rename(u,E,f){return this._proxy.$rename(this._handle,u,E,f)}copy(u,E,f){return this._proxy.$copy(this._handle,u,E,f)}async doGetStat(u,E=1){var f;const c=await this._proxy.$stat(this._handle,u),y=(0,s.fromFileStat)(c,u);return y.isDirectory&&(y.children=await this.doGetChildren(u,E)),y.readonly=!!(((f=c.permissions)!==null&&f!==void 0?f:0)&g.FilePermission.Readonly)||!!(this.capabilities&2048),y}async doGetChildren(u,E){if(E<=0)return[];const f=await this.readDirectory(u);return await Promise.all(f.map(y=>new _.URI(u).resolve(y[0])).map(y=>this.doGetStat(y.codeUri,E-1)))}}},89626:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLanguages=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(16885),p=e(54414),m=e(57517),s=n.__importStar(e(20868)),g=e(55218),a=e(62660),h=e(28694),d=e(52902),u=e(79865),E=e(44781),f=n.__importStar(e(40540)),c=e(14162),y=e(16781),b=e(46147),A=e(53043),S=e(51328),D=e(52403),T=e(43710),w=e(97673),{extname:I}=_.path;let R=class{_reviveCodeActionDto(O){return O&&O.forEach(x=>this.reviveWorkspaceEditDto(x.edit)),O}constructor(O){this.rpcProtocol=O,this.disposables=new Map,this.languageFeatureEnabled=new _.LRUMap(200,100),this._status=new Map,this.proxy=this.rpcProtocol.getProxy(b.ExtHostAPIIdentifier.ExtHostLanguages)}dispose(){this.disposables.forEach(O=>{O.dispose()}),this.disposables.clear()}$unregister(O){const x=this.disposables.get(O);x&&(this.disposables.delete(O),x.dispose())}$getLanguages(){return this.textmateService.getLanguages().map(O=>O.id)}async $changeLanguage(O,x){const k=y.StandaloneServices.get(c.ILanguageService).getLanguageIdByLanguageName(x);if(!k||k!==x)return Promise.reject(new Error(`Unknown language id: ${x}`));const F=new _.URI(_.URI.revive(O)),L=await this.documentModelManager.createModelReference(F);try{L.instance.languageId=x}finally{L.dispose()}}isLanguageFeatureEnabled(O){if(O.uri.scheme===_.Schemes.inMemory)return!1;const x=O.uri.toString();return this.languageFeatureEnabled.has(x)||this.languageFeatureEnabled.set(x,O.getValueLength()<(this.preference.get("editor.languageFeatureEnabledMaxSize")||4*1024*1024*1024)),this.languageFeatureEnabled.get(x)}getUniqueLanguages(){const O=[],x=this.textmateService.getLanguages().map(k=>k.id);for(const k of x)O.indexOf(k)===-1&&O.push(k);return O}$registerHoverProvider(O,x){const k=(0,A.fromLanguageSelector)(x),F=this.createHoverProvider(O,k);this.disposables.set(O,u.languageFeaturesService.hoverProvider.register(x,F))}createHoverProvider(O,x){return{provideHover:(k,F,L)=>{if(!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_HOVER);return this.proxy.$provideHoverWithDuration(O,k.uri,F,L).then(({result:U,_dur:W})=>(U&&N.timeEnd(I(k.uri.fsPath),{extDuration:W}),U))}}}isDeflatedSuggestDto(O){return O[b.ISuggestDataDtoField.label]||O[b.ISuggestDataDtoField.kind]||O[b.ISuggestDataDtoField.kindModifier]||O[b.ISuggestDataDtoField.detail]||O[b.ISuggestDataDtoField.documentation]||O[b.ISuggestDataDtoField.sortText]||O[b.ISuggestDataDtoField.filterText]||O[b.ISuggestDataDtoField.preselect]||O[b.ISuggestDataDtoField.range]||O[b.ISuggestDataDtoField.insertTextRules]||O[b.ISuggestDataDtoField.commitCharacters]||O[b.ISuggestDataDtoField.insertText]||O[b.ISuggestDataDtoField.command]}inflateLabel(O){if(typeof O=="object")return O;const x=O.split("~|");return Array.isArray(x)&&x.length>1?{label:x[0],description:x[1],detail:x[2]}:O}inflateSuggestDto(O,x){var k,F;if(!this.isDeflatedSuggestDto(x))return x;const L=this.inflateLabel(x[b.ISuggestDataDtoField.label]),N=x[b.ISuggestDataDtoField.range];let U=O;return N&&(Array.isArray(N)?U=E.Range.lift({startLineNumber:N[0],startColumn:N[1],endLineNumber:N[2],endColumn:N[3]}):U=N),{label:L,kind:(k=x[b.ISuggestDataDtoField.kind])!==null&&k!==void 0?k:f.CompletionItemKind.Property,tags:x[b.ISuggestDataDtoField.kindModifier],detail:x[b.ISuggestDataDtoField.detail],documentation:x[b.ISuggestDataDtoField.documentation],sortText:x[b.ISuggestDataDtoField.sortText],filterText:x[b.ISuggestDataDtoField.filterText],preselect:x[b.ISuggestDataDtoField.preselect],insertText:(F=x[b.ISuggestDataDtoField.insertText])!==null&&F!==void 0?F:typeof L=="string"?L:L.label,range:U,insertTextRules:x[b.ISuggestDataDtoField.insertTextRules],commitCharacters:x[b.ISuggestDataDtoField.commitCharacters],additionalTextEdits:x[b.ISuggestDataDtoField.additionalTextEdits],command:x[b.ISuggestDataDtoField.command],_id:x.x}}$registerCompletionSupport(O,x,k,F){this.disposables.set(O,d.monaco.languages.registerCompletionItemProvider((0,A.fromLanguageSelector)(x),{_debugDisplayName:`ext-${O}`,triggerCharacters:k,provideCompletionItems:async(L,N,U,W)=>{if(!this.isLanguageFeatureEnabled(L))return;const j=this.reporter.time(_.REPORT_NAME.PROVIDE_COMPLETION_ITEMS),Q=await this.proxy.$provideCompletionItems(O,L.uri,N,U,W);return Q?(Q[b.ISuggestResultDtoField.completions].length&&j.timeEnd(I(L.uri.fsPath),{extDuration:Q.d}),{suggestions:Q[b.ISuggestResultDtoField.completions].map(Z=>this.inflateSuggestDto(Q[b.ISuggestResultDtoField.defaultRanges],Z)),duration:Q[b.ISuggestResultDtoField.duration],incomplete:Q[b.ISuggestResultDtoField.isIncomplete]||!1,dispose:()=>{Q.x&&setTimeout(()=>{this.proxy.$releaseCompletionItems(O,Q.x)},0)}}):void 0},resolveCompletionItem:F?async(L,N)=>(this.reporter.point(_.REPORT_NAME.RESOLVE_COMPLETION_ITEM),this.proxy.$resolveCompletionItem(O,L._id,N).then(U=>{if(!U)return L;const W=this.inflateSuggestDto(L.range,U);return(0,T.mixin)(L,W,!0)})):void 0}))}$registerInlineCompletionsSupport(O,x,k,F,L){const N={provideInlineCompletions:async(U,W,j,Q)=>this.proxy.$provideInlineCompletions(O,U.uri,W,j,Q),handleItemDidShow:async(U,W,j)=>{k&&await this.proxy.$handleInlineCompletionDidShow(O,U.pid,W.idx,j)},handlePartialAccept:async(U,W,j)=>{k&&await this.proxy.$handleInlineCompletionPartialAccept(O,U.pid,W.idx,j)},freeInlineCompletions:U=>{this.proxy.$freeInlineCompletionsList(O,U.pid)},groupId:F,yieldsToGroupIds:L,toString(){return`InlineCompletionsProvider(${F})`}};this.disposables.set(O,d.monaco.languages.registerInlineCompletionsProvider((0,A.fromLanguageSelector)(x),N))}$registerInlineEditProvider(O,x,k,F){const L={displayName:F,provideInlineEdit:async(N,U,W)=>this.proxy.$provideInlineEdit(O,N.uri,U,W),freeInlineEdit:N=>{this.proxy.$freeInlineEdit(O,N.pid)}};this.disposables.set(O,d.monaco.languages.registerInlineEditProvider((0,A.fromLanguageSelector)(x),L))}matchLanguage(O,x){return Array.isArray(O)?O.some(k=>this.matchLanguage(k,x)):(0,D.isDocumentFilter)(O)?!O.language&&(O.pattern||O.scheme)?!0:O?.language===x:O===x}matchModel(O,x){return Array.isArray(O)?O.some(k=>this.matchModel(k,x)):(0,D.isDocumentFilter)(O)?!(O.language&&O.language!==x.languageId||O.scheme&&O.scheme!==x.uri.scheme||O.pattern&&!(0,b.testGlob)(O.pattern,x.uri.path)):O===x.languageId}$registerDefinitionProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createDefinitionProvider(O,k);this.disposables.set(O,d.monaco.languages.registerDefinitionProvider(k,F))}$registerDeclarationProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=new _.DisposableCollection;for(const L of this.getUniqueLanguages())this.matchLanguage(k,L);this.disposables.set(O,F)}createDefinitionProvider(O,x){return{provideDefinition:async(k,F,L)=>{if(!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_DEFINITION),{result:U,_dur:W}=await this.proxy.$provideDefinitionWithDuration(O,k.uri,F,L);if(U)if(N.timeEnd(I(k.uri.fsPath),{extDuration:W}),Array.isArray(U)){const j=[];for(const Q of U)j.push({...Q,uri:s.Uri.revive(Q.uri)});return j}else return{uri:s.Uri.revive(U.uri),range:U.range}}}}$registerTypeDefinitionProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createTypeDefinitionProvider(O,k);this.disposables.set(O,d.monaco.languages.registerTypeDefinitionProvider(k,F))}createTypeDefinitionProvider(O,x){return{provideTypeDefinition:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_TYPE_DEFINITION);return this.proxy.$provideTypeDefinition(O,k.uri,F,L).then(U=>{if(U)if(N.timeEnd(I(k.uri.fsPath)),Array.isArray(U)){const W=[];for(const j of U)W.push({...j,uri:s.Uri.revive(j.uri)});return W}else return{uri:s.Uri.revive(U.uri),range:U.range}})}}}$registerFoldingRangeProvider(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createFoldingRangeProvider(O,F);if(typeof k=="number"){const N=new _.Emitter;this.disposables.set(k,N),L.onDidChange=N.event}this.disposables.set(O,d.monaco.languages.registerFoldingRangeProvider(F,L))}$emitFoldingRangeEvent(O,x){const k=this.disposables.get(O);k instanceof _.Emitter&&k.fire(x)}createFoldingRangeProvider(O,x){return{provideFoldingRanges:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_FOLDING_RANGES);return this.proxy.$provideFoldingRange(O,k.uri,F,L).then(U=>(U&&N.timeEnd(I(k.uri.fsPath)),U))}}}$registerDocumentColorProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createColorProvider(O,k);this.disposables.set(O,d.monaco.languages.registerColorProvider(k,F))}createColorProvider(O,x){return{provideDocumentColors:(k,F)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const L=this.reporter.time(_.REPORT_NAME.PROVIDE_DOCUMENT_COLORS);return this.proxy.$provideDocumentColors(O,k.uri,F).then(N=>(L.timeEnd(I(k.uri.fsPath)),N.map(U=>{const[W,j,Q,G]=U.color;return{color:{red:W,green:j,blue:Q,alpha:G},range:U.range}})))},provideColorPresentations:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_COLOR_PRESENTATIONS);return this.proxy.$provideColorPresentations(O,k.uri,{color:[F.color.red,F.color.green,F.color.blue,F.color.alpha],range:F.range},L).then(U=>(U&&N.timeEnd(I(k.uri.fsPath)),U))}}}$registerDocumentHighlightProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createDocumentHighlightProvider(O,k);this.disposables.set(O,d.monaco.languages.registerDocumentHighlightProvider(k,F))}createDocumentHighlightProvider(O,x){return{provideDocumentHighlights:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_DOCUMENT_HIGHLIGHTS);return this.proxy.$provideDocumentHighlights(O,k.uri,F,L).then(U=>{if(U&&Array.isArray(U)){N.timeEnd(I(k.uri.fsPath));const W=[];for(const j of U)W.push({...j,kind:j.kind!==void 0?j.kind:s.languages.DocumentHighlightKind.Text});return W}})}}}$registerDocumentFormattingProvider(O,x,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentFormattingEditProvider(O,x,F);this.disposables.set(O,d.monaco.languages.registerDocumentFormattingEditProvider(F,L))}createDocumentFormattingEditProvider(O,x,k){return{displayName:x.displayName,extensionId:x.id,provideDocumentFormattingEdits:async(F,L)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_DOCUMENT_FORMATTING_EDITS);return this.proxy.$provideDocumentFormattingEdits(O,F.uri,L).then(U=>{if(N.timeEnd(I(F.uri.fsPath)),!!U)return U})}}}$registerRangeFormattingProvider(O,x,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentRangeFormattingEditProvider(O,x,F);this.disposables.set(O,d.monaco.languages.registerDocumentRangeFormattingEditProvider(F,L))}createDocumentRangeFormattingEditProvider(O,x,k){return{displayName:x.displayName,extensionId:x.id,provideDocumentRangeFormattingEdits:async(F,L,N)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const U=this.reporter.time(_.REPORT_NAME.PROVIDE_DOCUMENT_RANGE_FORMATTING_EDITS);return this.proxy.$provideDocumentRangeFormattingEdits(O,F.uri,L,N).then(W=>{if(U.timeEnd(I(F.uri.fsPath)),!!W)return W})}}}$registerOnTypeFormattingProvider(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createOnTypeFormattingProvider(O,F,k);this.disposables.set(O,d.monaco.languages.registerOnTypeFormattingEditProvider(F,L))}createOnTypeFormattingProvider(O,x,k){return{autoFormatTriggerCharacters:k,provideOnTypeFormattingEdits:async(F,L,N,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(_.REPORT_NAME.PROVIDE_ON_TYPE_FORMATTING_EDITS);return this.proxy.$provideOnTypeFormattingEditsWithDuration(O,F.uri,L,N,U).then(({result:j,_dur:Q})=>(j&&W.timeEnd(I(F.uri.fsPath),{extDuration:Q}),j))}}}$registerCodeLensSupport(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createCodeLensProvider(O,F);if(typeof k=="number"){const N=new _.Emitter;this.disposables.set(k,N),L.onDidChange=N.event}this.disposables.set(O,d.monaco.languages.registerCodeLensProvider(F,L))}createCodeLensProvider(O,x){return{provideCodeLenses:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(_.REPORT_NAME.PROVIDE_CODE_LENSES);return this.proxy.$provideCodeLenses(O,k.uri,F).then(N=>(N&&L.timeEnd(I(k.uri.fsPath)),{lenses:N?.lenses||[],dispose:()=>N?.cacheId&&this.proxy.$releaseCodeLens(O,N.cacheId)}))},resolveCodeLens:async(k,F,L)=>{if(this.isLanguageFeatureEnabled(k))return this.reporter.point(_.REPORT_NAME.RESOLVE_CODE_LENS),this.proxy.$resolveCodeLens(O,F,L).then(N=>N)}}}$emitCodeLensEvent(O,x){const k=this.disposables.get(O);k instanceof _.Emitter&&k.fire(x)}$clearDiagnostics(O){this.markerManager.clearMarkers(O)}$changeDiagnostics(O,x){for(const[k,F]of x)this.markerManager.updateMarkers(O,k,F)}$registerImplementationProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createImplementationProvider(O,k);this.disposables.set(O,d.monaco.languages.registerImplementationProvider(k,F))}$registerDocumentLinkProvider(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createLinkProvider(O,k);this.disposables.set(O,d.monaco.languages.registerLinkProvider(F,L))}createImplementationProvider(O,x){return{provideImplementation:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_IMPLEMENTATION);return this.proxy.$provideImplementationWithDuration(O,k.uri,F).then(({result:U,_dur:W})=>{if(U)if(N.timeEnd(I(k.uri.fsPath),{extDuration:W}),Array.isArray(U)){const j=[];for(const Q of U)j.push({...Q,uri:s.Uri.revive(Q.uri)});return j}else return{uri:s.Uri.revive(U.uri),range:U.range}})}}}$registerQuickFixProvider(O,x,k,F,L){const N=(0,A.fromLanguageSelector)(x);if(!N)return;const U=this.createQuickFixProvider(O,N,k,F,L);this.disposables.set(O,u.languageFeaturesService.codeActionProvider.register(N,U))}createQuickFixProvider(O,x,k,F,L){const N={provideCodeActions:async(U,W,j,Q)=>{if(!this.isLanguageFeatureEnabled(U)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(U)))return;const G=this.reporter.time(_.REPORT_NAME.PROVIDE_CODE_ACTIONS),Z=await this.proxy.$provideCodeActions(O,U.uri,W,j,Q).then($=>(G.timeEnd(I(U.uri.fsPath)),$));if(Z)return{actions:this._reviveCodeActionDto(Z.actions),dispose:()=>{typeof Z.cacheId=="number"&&this.proxy.$releaseCodeActions(O,Z.cacheId)}}},documentation:k.documentation,providedCodeActionKinds:k.providedKinds,displayName:F};return L&&(N.resolveCodeAction=async(U,W)=>{const j=await this.proxy.$resolveCodeAction(O,U.cacheId,W);return U.edit=this.reviveWorkspaceEditDto(j),U}),N}createLinkProvider(O,x){const k={provideLinks:(F,L)=>{if(!this.isLanguageFeatureEnabled(F))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_LINKS);return this.proxy.$provideDocumentLinks(O,F.uri,L).then(U=>U?(N.timeEnd(I(F.uri.fsPath)),{links:U.links.map(j=>this.reviveLink(j)),dispose:()=>{U.id&&this.proxy.$releaseDocumentLinks(O,U.id)}}):void 0)}};return x&&(k.resolveLink=(F,L)=>{const N=F;return N.cacheId?this.proxy.$resolveDocumentLink(O,N.cacheId,L).then(U=>{if(U)return this.reviveLink(U)}):F}),k}reviveLink(O){return O.url&&typeof O.url!="string"&&(O.url=_.URI.revive(O.url)),O}$setLanguageConfiguration(O,x,k){const F={comments:k.comments,brackets:k.brackets,wordPattern:(0,T.reviveRegExp)(k.wordPattern),indentationRules:(0,T.reviveIndentationRule)(k.indentationRules),onEnterRules:(0,T.reviveOnEnterRules)(k.onEnterRules),autoClosingPairs:k.autoClosingPairs};this.disposables.set(O,d.monaco.languages.setLanguageConfiguration(x,F))}$registerReferenceProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createReferenceProvider(O,k);this.disposables.set(O,d.monaco.languages.registerReferenceProvider(k,F))}createReferenceProvider(O,x){return{provideReferences:(k,F,L,N)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(_.REPORT_NAME.PROVIDE_REFERENCES);return this.proxy.$provideReferencesWithDuration(O,k.uri,F,L,N).then(({result:W,_dur:j})=>{if(W&&Array.isArray(W)){U.timeEnd(I(k.uri.fsPath),{extDuration:j});const Q=[];for(const G of W)Q.push({...G,uri:s.Uri.revive(G.uri)});return Q}})}}}$registerWorkspaceSymbolProvider(O){const x=this.createWorkspaceSymbolProvider(O);this.disposables.set(O,this.languageService.registerWorkspaceSymbolProvider(x))}createWorkspaceSymbolProvider(O){return{provideWorkspaceSymbols:(x,k)=>this.proxy.$provideWorkspaceSymbols(O,x.query,k),resolveWorkspaceSymbol:(x,k)=>this.proxy.$resolveWorkspaceSymbol(O,x,k)}}$registerOutlineSupport(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createDocumentSymbolProvider(O,k);this.disposables.set(O,d.monaco.languages.registerDocumentSymbolProvider(k,F))}createDocumentSymbolProvider(O,x){return{provideDocumentSymbols:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(_.REPORT_NAME.PROVIDE_DOCUMENT_SYMBOLS);return this.proxy.$provideDocumentSymbols(O,k.uri,F).then(N=>(N&&L.timeEnd(I(k.uri.fsPath)),N))}}}$registerSignatureHelpProvider(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createSignatureHelpProvider(O,F,k);this.disposables.set(O,d.monaco.languages.registerSignatureHelpProvider(F,L))}createSignatureHelpProvider(O,x,k){return{signatureHelpTriggerCharacters:k.triggerCharacters,signatureHelpRetriggerCharacters:k.retriggerCharacters,provideSignatureHelp:(F,L,N,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(_.REPORT_NAME.PROVIDE_SIGNATURE_HELP);return this.proxy.$provideSignatureHelp(O,F.uri,L,U,N).then(j=>{if(j)return W.timeEnd(I(F.uri.fsPath)),{value:j,dispose:()=>j.id&&this.proxy.$releaseSignatureHelp(O,j.id)}})}}}$registerRenameProvider(O,x,k){const F=(0,A.fromLanguageSelector)(x);if(!F)return;const L=this.createRenameProvider(O,F,k);this.disposables.set(O,d.monaco.languages.registerRenameProvider(F,L))}createRenameProvider(O,x,k){return{provideRenameEdits:(F,L,N,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(_.REPORT_NAME.PROVIDE_RENAME_EDITS);return this.proxy.$provideRenameEdits(O,F.uri,L,N,U).then(j=>(j&&W.timeEnd(I(F.uri.fsPath)),this.reviveWorkspaceEditDto(j)))},resolveRenameLocation:k?(F,L,N)=>{if(this.isLanguageFeatureEnabled(F)&&this.matchModel(x,b.MonacoModelIdentifier.fromModel(F)))return this.proxy.$resolveRenameLocation(O,F.uri,L,N).then(U=>U)}:void 0}}createNewSymbolNamesProvider(O,x){return{provideNewSymbolNames:(k,F,L,N)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(_.REPORT_NAME.PROVIDE_NEW_SYMBOL_NAMES);return this.proxy.$provideNewSymbolNames(O,k.uri,F,L,N).then(W=>(W&&U.timeEnd(I(k.uri.fsPath)),W))}}}$registerNewSymbolNamesProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createNewSymbolNamesProvider(O,k);this.disposables.set(O,d.monaco.languages.registerNewSymbolNameProvider(k,F))}reviveWorkspaceEditDto(O){if(O&&O.edits)for(const x of O.edits)typeof x.resource=="object"?x.resource=s.Uri.revive(x.resource):(x.newResource=s.Uri.revive(x.newResource),x.oldResource=s.Uri.revive(x.oldResource));return O}$registerSelectionRangeProvider(O,x){const k=(0,A.fromLanguageSelector)(x);if(!k)return;const F=this.createSelectionProvider(O,k);this.disposables.set(O,d.monaco.languages.registerSelectionRangeProvider(k,F))}createSelectionProvider(O,x){return{provideSelectionRanges:(k,F,L)=>{if(!this.matchModel(x,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const N=this.reporter.time(_.REPORT_NAME.PROVIDE_SELECTION_RANGES);return this.proxy.$provideSelectionRanges(O,k.uri,F,L).then(U=>(N.timeEnd(I(k.uri.fsPath)),U))}}}$registerCallHierarchyProvider(O,x){const k=(0,A.fromLanguageSelector)(x),F=this.createCallHierarchyProvider(O,k);this.callHierarchyService.registerCallHierarchyProvider(x,F)}reviveCallHierarchyItemDto(O){return O&&(O.uri=_.URI.revive(O.uri)),O}createCallHierarchyProvider(O,x){return{prepareCallHierarchy:async(k,F,L)=>{const N=await this.proxy.$prepareCallHierarchy(O,k.uri,F,L);if(N)return{dispose:()=>{for(const U of N)this.proxy.$releaseCallHierarchy(O,U._sessionId)},roots:N.map(this.reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyOutgoingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(N=>{N.to=this.reviveCallHierarchyItemDto(N.to)}),L)},provideIncomingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyIncomingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(N=>{N.from=this.reviveCallHierarchyItemDto(N.from)}),L)}}}$registerTypeHierarchyProvider(O,x){const k=(0,A.fromLanguageSelector)(x),F=this.createTypeHierarchyProvider(O,k);this.typeHierarchyService.registerTypeHierarchyProvider(x,F)}createTypeHierarchyProvider(O,x){return{prepareTypeHierarchy:async(k,F,L)=>{const N=await this.proxy.$prepareTypeHierarchy(O,k.uri,F,L);if(N)return{dispose:()=>{for(const U of N)this.proxy.$releaseTypeHierarchy(O,U._sessionId)},roots:N.map(this.reviveTypeHierarchyItemDto)}},provideSupertypes:async(k,F)=>{const L=await this.proxy.$provideTypeHierarchySupertypes(O,k._sessionId,k._itemId,F);return L&&L.map(this.reviveTypeHierarchyItemDto)},provideSubtypes:async(k,F)=>{const L=await this.proxy.$provideTypeHierarchySubtypes(O,k._sessionId,k._itemId,F);return L&&L.map(this.reviveTypeHierarchyItemDto)}}}reviveTypeHierarchyItemDto(O){return O&&(O.uri=_.URI.revive(O.uri)),O}$registerDocumentSemanticTokensProvider(O,x,k){const F=new w.DocumentSemanticTokensProvider(this.proxy,O,k);this.disposables.set(O,u.languageFeaturesService.documentSemanticTokensProvider.register((0,A.fromLanguageSelector)(x),F))}$registerDocumentRangeSemanticTokensProvider(O,x,k){const F=new w.DocumentRangeSemanticTokensProviderImpl(this.proxy,O,k);this.disposables.set(O,u.languageFeaturesService.documentRangeSemanticTokensProvider.register((0,A.fromLanguageSelector)(x),F))}$registerEvaluatableExpressionProvider(O,x){const k={provideEvaluatableExpression:(F,L,N)=>this.proxy.$provideEvaluatableExpression(O,F.uri,L,N)};this.disposables.set(O,this.evaluatableExpressionService.registerEvaluatableExpressionProvider(x,k))}$registerInlineValuesProvider(O,x,k){const F={provideInlineValues:(L,N,U,W)=>this.proxy.$provideInlineValues(O,L.uri,N,U,W)};if(typeof k=="number"){const L=new _.Emitter;this.disposables.set(k,L),F.onDidChangeInlineValues=L.event}this.disposables.set(O,u.languageFeaturesService.inlineValuesProvider.register(x,F))}$emitInlineValuesEvent(O,x){const k=this.disposables.get(O);k instanceof _.Emitter&&k.fire(x)}$registerLinkedEditingRangeProvider(O,x){const k=(0,A.fromLanguageSelector)(x);u.languageFeaturesService.linkedEditingRangeProvider.register(k,{provideLinkedEditingRanges:async(F,L,N)=>{const U=await this.proxy.$provideLinkedEditingRanges(O,F.uri,L,N);if(U)return{ranges:U.ranges,wordPattern:U.wordPattern?(0,T.reviveRegExp)(U.wordPattern):void 0}}})}$registerInlayHintsProvider(O,x,k,F){const L={provideInlayHints:async(N,U,W)=>{const j=await this.proxy.$provideInlayHints(O,N.uri,U,W);if(j)return{hints:(0,_.revive)(j?.hints),dispose:()=>{j.cacheId&&this.proxy.$releaseInlayHints(O,j.cacheId)}}}};if(k&&(L.resolveInlayHint=async(N,U)=>{const W=N;if(!W.cacheId)return N;const j=await this.proxy.$resolveInlayHint(O,W.cacheId,U);if(U.isCancellationRequested)throw new S.CancellationError;return j?{...N,tooltip:j.tooltip,label:(0,_.revive)(j.label)}:N}),typeof F=="number"){const N=new _.Emitter;this.disposables.set(F,N),L.onDidChangeInlayHints=N.event}this.disposables.set(O,u.languageFeaturesService.inlayHintsProvider.register(x,L))}$emitInlayHintsEvent(O,x){const k=this.disposables.get(O);k instanceof _.Emitter&&k.fire(x)}$setLanguageStatus(O,x){var k;(k=this._status.get(O))===null||k===void 0||k.dispose(),this._status.set(O,this.languageStatusService.addStatus(x))}$removeLanguageStatus(O){var x;(x=this._status.get(O))===null||x===void 0||x.dispose()}};t.MainThreadLanguages=R,n.__decorate([(0,r.Autowired)(_.MarkerManager),n.__metadata("design:type",_.MarkerManager)],R.prototype,"markerManager",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],R.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(l.IReporterService),n.__metadata("design:type",Object)],R.prototype,"reporter",void 0),n.__decorate([(0,r.Autowired)(p.ILanguageService),n.__metadata("design:type",Object)],R.prototype,"languageService",void 0),n.__decorate([(0,r.Autowired)(g.ICallHierarchyService),n.__metadata("design:type",Object)],R.prototype,"callHierarchyService",void 0),n.__decorate([(0,r.Autowired)(h.ITypeHierarchyService),n.__metadata("design:type",Object)],R.prototype,"typeHierarchyService",void 0),n.__decorate([(0,r.Autowired)(v.IEvaluatableExpressionService),n.__metadata("design:type",Object)],R.prototype,"evaluatableExpressionService",void 0),n.__decorate([(0,r.Autowired)(m.IEditorDocumentModelService),n.__metadata("design:type",Object)],R.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(m.ILanguageStatusService),n.__metadata("design:type",Object)],R.prototype,"languageStatusService",void 0),n.__decorate([(0,r.Autowired)(a.ITextmateTokenizer),n.__metadata("design:type",Object)],R.prototype,"textmateService",void 0),t.MainThreadLanguages=R=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],R)},977:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLocalization=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(14951),v=e(99220),p=e(46147),m=e(51328);let s=class{constructor(a){this.rpcProtocol=a,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostLocalization),this.currentLanguage=this.preferenceService.get("general.language","en").toLocaleLowerCase(),this.proxy.$setCurrentLanguage(this.currentLanguage)}async $fetchBuiltInBundleUri(a,h){try{const d=await this.extensionNodeClient.getLanguagePack(h||this.currentLanguage);return d&&d.translations[a]?m.Uri.file(d.translations[a]):void 0}catch{return}}async $fetchBundleContents(a){return(await this.fileService.readFile(m.Uri.revive(a).fsPath.toString())).content.toString()}};t.MainThreadLocalization=s,n.__decorate([(0,r.Autowired)(_.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],s.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],s.prototype,"extensionNodeClient",void 0),t.MainThreadLocalization=s=n.__decorate([n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],s)},43404:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionLog=void 0,t.createExtensionLogFactory=v;const n=e(85608),r=e(76003),o=e(43718),l=e(71742);let _=class{$getLevel(){return this.logger.getLevel()}$setLevel(m){return this.logger.setLevel(m)}async $verbose(...m){return this.logger.verbose(...m)}async $debug(...m){return this.logger.debug(...m)}async $log(...m){return this.logger.log(...m)}async $warn(...m){return this.logger.warn(...m)}async $error(...m){return this.logger.error(...m)}async $critical(...m){return this.logger.critical(...m)}$dispose(){return this.logger.dispose()}};t.MainThreadExtensionLog=_,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.MainThreadExtensionLog=_=n.__decorate([(0,r.Injectable)()],_);function v(p,m){p.set(l.MainThreadExtensionLogIdentifier,m.get(_))}},48721:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadMessage=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(72665),_=e(46147);let v=class{constructor(m){this.rpcProtocol=m,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostMessage)}dispose(){}async $showMessage(m,s,g,a,h){const d=g.modal?await this.dialogService.open({message:s,type:m,buttons:a,options:g}):await this.messageService.open({message:s,type:m,buttons:a,closable:!0,from:h});return d?a.indexOf(d):void 0}};t.MainThreadMessage=v,n.__decorate([(0,r.Autowired)(l.IDialogService),n.__metadata("design:type",Object)],v.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(l.IMessageService),n.__metadata("design:type",Object)],v.prototype,"messageService",void 0),t.MainThreadMessage=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],v)},62909:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionNotebook=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(43718),_=e(54414),v=e(46147);let p=class extends l.WithEventBus{constructor(s){super(),this.rpcProtocol=s,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostNotebook),this.docProxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostDocuments),this.listen()}listen(){this.addDispose(this.notebookService.onDidOpenNotebookDocument(s=>{this.proxy.$acceptDocumentAndEditorsDelta({addedDocuments:[s]})})),this.addDispose(this.notebookService.onDidCloseNotebookDocument(s=>{this.proxy.$acceptDocumentAndEditorsDelta({removedDocuments:[s]})})),this.addDispose(this.notebookService.onDidChangeNotebookDocument(s=>{this.proxy.$acceptModelChanged(s.uri,s.event,s.isDirty,s.metadata)})),this.addDispose(this.notebookService.onDidSaveNotebookDocument(s=>{this.proxy.$acceptModelSaved(s)}))}async $tryCreateNotebook(s){return(await this.notebookService.createNotebook(s.content)).uri}async $tryOpenNotebook(s){return(await this.notebookService.openNotebook(s)).uri}async $trySaveNotebook(s){return await this.notebookService.saveNotebook(s)}};t.MainThreadExtensionNotebook=p,n.__decorate([(0,r.Autowired)(_.INotebookService),n.__metadata("design:type",Object)],p.prototype,"notebookService",void 0),t.MainThreadExtensionNotebook=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],p)},39261:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadOutput=void 0;const n=e(85608),r=e(76003),o=e(63067),l=e(83145);let _=class{constructor(){this.channels=new Map}dispose(){this.channels.forEach(p=>{this.outputService.deleteChannel(p.name)}),this.channels.clear()}$replace(p,m){const s=this.getChannel(p);return s&&(s.clear(),s.append(m)),Promise.resolve()}$append(p,m){const s=this.getChannel(p);return s&&s.append(m),Promise.resolve()}$appendLine(p,m){const s=this.getChannel(p);return s&&s.appendLine(m),Promise.resolve()}$clear(p){const m=this.getChannel(p);return m&&m.clear(),Promise.resolve()}$dispose(p){return this.outputService.deleteChannel(p),this.channels.has(p)&&this.channels.delete(p),Promise.resolve()}async $reveal(p,m){const s=this.getChannel(p);s&&(s.setVisibility(!0),this.outputService.updateSelectedChannel(s))}$close(p){const m=this.getChannel(p);return m&&m.setVisibility(!1),Promise.resolve()}getChannel(p){let m;return this.channels.has(p)?m=this.channels.get(p):(m=this.outputService.getChannel(p),this.channels.set(p,m)),m}async $setLanguageId(p,m){const s=this.getChannel(p);s&&await s.setLanguageId(m)}};t.MainThreadOutput=_,n.__decorate([(0,r.Autowired)(l.OutputService),n.__metadata("design:type",l.OutputService)],_.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(o.IMainLayoutService),n.__metadata("design:type",Object)],_.prototype,"layoutService",void 0),t.MainThreadOutput=_=n.__decorate([(0,r.Injectable)({multiple:!0})],_)},87781:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadPreference=void 0,t.getPreferences=p;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(51500),v=e(46147);function p(s,g){const a=g.map(h=>h.uri.toString());return l.PreferenceScope.getScopes().reduce((h,d)=>{h[d]={};const u=s(d);if(d===l.PreferenceScope.Folder)for(const E of a){const f=u.getPreferences(E);h[d][E]=f}else{h[d]=u.getPreferences();const E=u.getLanguagePreferences();E&&Object.keys(E).forEach(f=>{h[d][`[${f}]`]=E[f]})}return h},{})}let m=class{constructor(g){this.rpcProtocol=g,this.toDispose=new l.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostPreference),this.toDispose.push(this.preferenceService.onPreferencesChanged(a=>{const h=this.workspaceService.tryGetRoots(),d=p(this.preferenceProviderProvider,h),u=[];for(const E of Object.keys(a)){const{newValue:f}=a[E];u.push({preferenceName:E,newValue:f})}this.proxy.$acceptConfigurationChanged(d,u)})),this.initializeConfiguration(),this.toDispose.push(this.preferenceSchemaProvider.onDidPreferenceSchemaChanged(()=>{this.initializeConfiguration()}))}dispose(){this.toDispose.dispose()}async initializeConfiguration(){const g=this.workspaceService.tryGetRoots(),a=p(this.preferenceProviderProvider,g);this.proxy.$initializeConfiguration(a)}async $updateConfigurationOption(g,a,h,d){const u=this.parseConfigurationTarget(g);await this.preferenceService.set(a,h,u,d)}async $removeConfigurationOption(g,a,h){const d=this.parseConfigurationTarget(g);await this.preferenceService.set(a,void 0,d,h)}parseConfigurationTarget(g){if(typeof g=="boolean")return g?l.PreferenceScope.User:l.PreferenceScope.Workspace;switch(g){case v.ConfigurationTarget.Global:return l.PreferenceScope.User;case v.ConfigurationTarget.Workspace:return l.PreferenceScope.Workspace;case v.ConfigurationTarget.WorkspaceFolder:return l.PreferenceScope.Folder;default:return}}};t.MainThreadPreference=m,n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceProviderProvider),n.__metadata("design:type",Function)],m.prototype,"preferenceProviderProvider",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceSchemaProvider),n.__metadata("design:type",l.PreferenceSchemaProvider)],m.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],m.prototype,"workspaceService",void 0),t.MainThreadPreference=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},79813:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadQuickOpen=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(8919),_=e(41869),v=e(74404),p=e(97821),m=e(78245),s=e(50426),g=e(44854),a=e(46147);let h=class extends _.Disposable{constructor(u){super(),this.rpcProtocol=u,this.createdInputBox=new Map,this.proxy=this.rpcProtocol.getProxy(a.ExtHostAPIIdentifier.ExtHostQuickOpen),this.addDispose([this.quickTitleBarService.onDidTriggerButton(E=>{this.proxy.$onDidTriggerButton(E.handler)}),this.quickOpenItemService.onDidTriggerItemButton(({item:E,button:f})=>{f.handle!==void 0&&this.proxy.$onDidTriggerItemButton(E.handle,f.handle)})])}$showQuickPick(u,E,f){return this.quickPickService.show(E,{...f,onSelect:(c,y)=>{this.proxy.$onItemSelected(E[y].value)},onChangeValue:c=>{this.proxy.$onDidChangeValue(u,c)}})}$hideQuickPick(){this.quickPickService.hide()}severityToValidateType(u){switch(u){case a.Severity.Info:return o.VALIDATE_TYPE.INFO;case a.Severity.Warning:return o.VALIDATE_TYPE.WARNING;case a.Severity.Error:return o.VALIDATE_TYPE.ERROR;case a.Severity.Ignore:return o.VALIDATE_TYPE.IGNORE;default:return o.VALIDATE_TYPE.ERROR}}$showQuickInput(u,E){return E&&(u.validateInput=async f=>{const c=await this.proxy.$validateInput(f);return c&&(typeof c=="string"?c:{message:c.message,type:this.severityToValidateType(c.severity)})}),this.quickInputService.open(u)}$createOrUpdateInputBox(u,E){const f={...E,validationType:this.severityToValidateType(E?.severity)};if(this.createdInputBox.has(u)){const c=this.createdInputBox.get(u);c?.updateOptions(f)}else{const c=this.injector.get(g.InputBoxImpl,[f]);c.open(),c.onDidChangeValue(y=>{this.proxy.$onCreatedInputBoxDidChangeValue(u,y)}),c.onDidAccept(()=>{this.proxy.$onCreatedInputBoxDidAccept(u)}),c.onDidHide(()=>{this.proxy.$onCreatedInputBoxDidHide(u)}),c.onDidTriggerButton(y=>{this.proxy.$onCreatedInputBoxDidTriggerButton(u,y)}),this.createdInputBox.set(u,c)}}$updateQuickPick(u){this.quickPickService.updateOptions(u)}$hideInputBox(u){if(this.createdInputBox.has(u)){const E=this.createdInputBox.get(u);E?.hide()}}$disposeInputBox(u){if(this.createdInputBox.has(u)){const E=this.createdInputBox.get(u);E?.dispose(),this.createdInputBox.delete(u)}}$hideQuickInput(){this.quickInputService.hide()}};t.MainThreadQuickOpen=h,n.__decorate([(0,r.Autowired)(p.QuickPickService),n.__metadata("design:type",Object)],h.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(v.IQuickInputService),n.__metadata("design:type",Object)],h.prototype,"quickInputService",void 0),n.__decorate([(0,r.Autowired)(s.QuickTitleBar),n.__metadata("design:type",s.QuickTitleBar)],h.prototype,"quickTitleBarService",void 0),n.__decorate([(0,r.Autowired)(m.QuickOpenItemService),n.__metadata("design:type",m.QuickOpenItemService)],h.prototype,"quickOpenItemService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],h.prototype,"injector",void 0),t.MainThreadQuickOpen=h=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(l.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],h)},33111:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSCM=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(64964),p=e(46147);class m{get hideWhenEmpty(){return!!this.features.hideWhenEmpty}constructor(f,c,y,b,A,S){this.sourceControlHandle=f,this.handle=c,this.provider=y,this.features=b,this.label=A,this.id=S,this.elements=[],this._onDidSplice=new _.Emitter,this.onDidSplice=this._onDidSplice.event,this._onDidChange=new _.Emitter,this.onDidChange=this._onDidChange.event}toJSON(){return{$mid:4,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(f,c,y){if(c===0){const b=[];for(const A of y)this.elements.some(D=>D.sourceUri.toString()===A.sourceUri.toString()&&D.resourceGroup.id===A.resourceGroup.id)||b.push(A);b.length>0&&(this.elements.splice(f,c,...b),this._onDidSplice.fire({start:f,deleteCount:c,toInsert:b}))}else this.elements.splice(f,c,...y),this._onDidSplice.fire({start:f,deleteCount:c,toInsert:y})}$updateGroup(f){this.features=Object.assign(this.features,f),this._onDidChange.fire()}$updateGroupLabel(f){this.label=f,this._onDidChange.fire()}}class s{constructor(f,c,y,b,A,S,D,T,w){this.proxy=f,this.sourceControlHandle=c,this.groupHandle=y,this.handle=b,this.sourceUri=A,this.resourceGroup=S,this.decorations=D,this.contextValue=T,this.command=w}open(f){return this.proxy.$executeResourceCommand(this.sourceControlHandle,this.groupHandle,this.handle,f)}toJSON(){return{$mid:3,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}function g(E){if(E.icon){if(_.Uri.isUri(E.icon))return _.Uri.revive(E.icon);{const f=E.icon;return{light:_.Uri.revive(f.light),dark:_.Uri.revive(f.dark)}}}else return}class a{get actionButton(){return this._actionButton}set actionButton(f){this._actionButton=f,this._onDidChangeActionButton.fire()}get currentHistoryItemGroup(){return this._currentHistoryItemGroup}set currentHistoryItemGroup(f){this._currentHistoryItemGroup=f,this._onDidChangeCurrentHistoryItemGroup.fire()}constructor(f,c){this.proxy=f,this.handle=c,this._onDidChangeActionButton=new _.Emitter,this.onDidChangeActionButton=this._onDidChangeActionButton.event,this._onDidChangeCurrentHistoryItemGroup=new _.Emitter,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupBase(f){return this.proxy.$resolveHistoryItemGroupBase(this.handle,f,_.CancellationToken.None)}async resolveHistoryItemGroupCommonAncestor(f,c){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,f,c,_.CancellationToken.None)}async provideHistoryItems(f,c){const y=await this.proxy.$provideHistoryItems(this.handle,f,c,_.CancellationToken.None);return y?.map(b=>({...b,icon:g(b)}))}async provideHistoryItemChanges(f){const c=await this.proxy.$provideHistoryItemChanges(this.handle,f,_.CancellationToken.None);return c?.map(y=>({uri:_.Uri.revive(y.uri),originalUri:y.originalUri&&_.Uri.revive(y.originalUri),modifiedUri:y.modifiedUri&&_.Uri.revive(y.modifiedUri),renameUri:y.renameUri&&_.Uri.revive(y.renameUri)}))}}class h{get id(){return this._id}get handle(){return this._handle}get label(){return this._label}get rootUri(){return this._rootUri}get contextValue(){return this._contextValue}get commitTemplate(){return this.features.commitTemplate}get acceptInputCommand(){return this.features.acceptInputCommand}get statusBarCommands(){return this.features.statusBarCommands}get count(){return this.features.count}get actionButton(){return this.features.actionButton}get historyProvider(){return this._historyProvider}get onDidChangeStatusBarCommands(){return this._onDidChangeStatusBarCommands.event}constructor(f,c,y,b,A){this.proxy=f,this._handle=c,this._contextValue=y,this._label=b,this._rootUri=A,this._id=`scm${h.ID_HANDLE++}`,this.groups=new _.Sequence,this._groupsByHandle=Object.create(null),this._onDidChangeResources=new _.Emitter,this.onDidChangeResources=this._onDidChangeResources.event,this.features={},this._onDidChangeCommitTemplate=new _.Emitter,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new _.Emitter,this._onDidChangeHistoryProvider=new _.Emitter,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new _.Emitter,this.onDidChange=this._onDidChange.event}$updateSourceControl(f){this.features=Object.assign(this.features,f),this._onDidChange.fire(),typeof f.commitTemplate<"u"&&this._onDidChangeCommitTemplate.fire(this.commitTemplate),typeof f.statusBarCommands<"u"&&this._onDidChangeStatusBarCommands.fire(this.statusBarCommands),f.hasHistoryProvider&&!this._historyProvider?(this._historyProvider=new a(this.proxy,this.handle),this._onDidChangeHistoryProvider.fire()):f.hasHistoryProvider===!1&&this._historyProvider&&(this._historyProvider=void 0,this._onDidChangeHistoryProvider.fire())}$registerGroup(f,c,y){const b=new m(this.handle,f,this,{},y,c);this._groupsByHandle[f]=b,this.groups.splice(this.groups.elements.length,0,[b])}$updateGroup(f,c){const y=this._groupsByHandle[f];y&&y.$updateGroup(c)}$updateGroupLabel(f,c){const y=this._groupsByHandle[f];y&&y.$updateGroupLabel(c)}$spliceGroupResourceStates(f){for(const[c,y]of f){const b=this._groupsByHandle[c];if(!b){this.logger.warn(`SCM group ${c} not found in provider ${this.label}`);continue}y.reverse();for(const[A,S,D]of y){const T=D.map(w=>{const[I,R,M,O,x,k,F,L]=w,N=M[0],U=M[1]||N,W={icon:N?_.Uri.parse(N):void 0,iconDark:U?_.Uri.parse(U):void 0,tooltip:O,strikeThrough:x,faded:k};return new s(this.proxy,this.handle,c,I,_.Uri.revive(R),b,W,F||void 0,L)});b.splice(A,S,T)}}this._onDidChangeResources.fire()}$unregisterGroup(f){const c=this._groupsByHandle[f];c&&(delete this._groupsByHandle[f],this.groups.splice(this.groups.elements.indexOf(c),1),this._onDidChangeResources.fire())}$onDidChangeHistoryProviderActionButton(f){this._historyProvider&&(this._historyProvider.actionButton=f??void 0)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(f){this._historyProvider&&(this._historyProvider.currentHistoryItemGroup=f??void 0)}async getOriginalResource(f){if(!this.features.hasQuickDiffProvider)return null;const c=await this.proxy.$provideOriginalResource(this.handle,f,_.CancellationToken.None);return c&&_.Uri.revive(c)}toJSON(){return{$mid:5,handle:this.handle}}dispose(){}}h.ID_HANDLE=0,n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0);let d=class extends _.Disposable{constructor(f){super(),this.rpcProtocol=f,this._repositories=new Map,this._inputDisposables=new Map,this._proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostSCM),_.Event.debounce(this.scmService.onDidChangeSelectedRepositories,(c,y)=>y,100)(this.onDidChangeSelectedRepositories,this,this.disposables)}dispose(){this._repositories.forEach(f=>f.dispose()),this._repositories.clear(),this._inputDisposables.forEach(f=>f.dispose()),this._inputDisposables.clear(),super.dispose()}$registerSourceControl(f,c,y,b){const A=new h(this._proxy,f,c,y,b&&_.Uri.revive(b)),S=this.scmService.registerSCMProvider(A);this._repositories.set(f,S);const D=S.input.onDidChange(T=>this._proxy.$onInputBoxValueChange(f,T));this._inputDisposables.set(f,D),this.addDispose(_.Disposable.create(()=>{this.$unregisterSourceControl(f)}))}$updateSourceControl(f,c){const y=this._repositories.get(f);if(!y)return;y.provider.$updateSourceControl(c)}$unregisterSourceControl(f){const c=this._repositories.get(f);c&&(this._inputDisposables.get(f).dispose(),this._inputDisposables.delete(f),c.dispose(),this._repositories.delete(f))}$registerGroup(f,c,y,b){const A=this._repositories.get(f);if(!A)return;const S=A.provider;S.$registerGroup(c,y,b),this.addDispose(_.Disposable.create(()=>{S.$unregisterGroup(c)}))}$updateGroup(f,c,y){const b=this._repositories.get(f);if(!b)return;b.provider.$updateGroup(c,y)}$updateGroupLabel(f,c,y){const b=this._repositories.get(f);if(!b)return;b.provider.$updateGroupLabel(c,y)}$spliceResourceStates(f,c){const y=this._repositories.get(f);if(!y)return;y.provider.$spliceGroupResourceStates(c)}$unregisterGroup(f,c){const y=this._repositories.get(f);if(!y)return;y.provider.$unregisterGroup(c)}$setInputBoxValue(f,c){const y=this._repositories.get(f);y&&(y.input.value=c)}$setInputBoxPlaceholder(f,c){const y=this._repositories.get(f);y&&(y.input.placeholder=c)}$setInputBoxEnablement(f,c){const y=this._repositories.get(f);y&&(y.input.enabled=c)}$setInputBoxVisibility(f,c){const y=this._repositories.get(f);y&&(y.input.visible=c)}$setValidationProviderIsEnabled(f,c){const y=this._repositories.get(f);y&&(c?y.input.validateInput=async(b,A)=>{const S=await this._proxy.$validateInput(f,b,A);return S&&{message:S[0],type:S[1]}}:y.input.validateInput=async()=>{})}$onDidChangeHistoryProviderActionButton(f,c){const y=this._repositories.get(f);if(!y)return;y.provider.$onDidChangeHistoryProviderActionButton(c)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(f,c){const y=this._repositories.get(f);if(!y)return;y.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(c)}$setInputBoxActionButton(f,c){const y=this._repositories.get(f);y&&(y.input.actionButton=c?{...c,icon:u(c)}:void 0)}onDidChangeSelectedRepositories(f){const c=f.filter(y=>y.provider instanceof h).map(y=>y.provider.handle);this._proxy.$setSelectedSourceControls(c)}};t.MainThreadSCM=d,n.__decorate([(0,r.Autowired)(v.SCMService),n.__metadata("design:type",v.SCMService)],d.prototype,"scmService",void 0),t.MainThreadSCM=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],d);function u(E){if(E.icon){if(_.Uri.isUri(E.icon))return _.Uri.revive(E.icon);{const f=E.icon;return{light:_.Uri.revive(f.light),dark:_.Uri.revive(f.dark)}}}else return}},62876:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSecret=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(26542),v=e(46147);let p=class extends l.Disposable{constructor(s){super(),this._proxy=s.getProxy(v.ExtHostAPIIdentifier.ExtHostSecret),this.addDispose(this.credentialsService.onDidChangePassword(g=>{const a=g.service.substring(this.appConfig.uriScheme.length);this._proxy.$onDidChangePassword({extensionId:a,key:g.account})}))}getFullKey(s){return`${this.appConfig.uriScheme}${s}`}async $getPassword(s,g){const a=this.getFullKey(s),h=await this.credentialsService.getPassword(a,g),d=h&&await this.cryptoService.decrypt(h);if(d)try{const u=JSON.parse(d);if(u.extensionId===s)return u.content}catch{throw new Error("Cannot get password")}}async $setPassword(s,g,a){const h=this.getFullKey(s),d=JSON.stringify({extensionId:s,content:a}),u=await this.cryptoService.encrypt(d);return this.credentialsService.setPassword(h,g,u)}async $deletePassword(s,g){try{const a=this.getFullKey(s);await this.credentialsService.deletePassword(a,g)}catch{throw new Error("Cannot delete password")}}};t.MainThreadSecret=p,n.__decorate([(0,r.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],p.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(l.ICredentialsService),n.__metadata("design:type",Object)],p.prototype,"credentialsService",void 0),n.__decorate([(0,r.Autowired)(_.ICryptoService),n.__metadata("design:type",Object)],p.prototype,"cryptoService",void 0),t.MainThreadSecret=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],p)},93633:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStatusBar=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(26542),v=e(71298),p=e(46147),m=n.__importStar(e(51328));let s=class{constructor(a){this.rpcProtocol=a,this.disposable=new l.Disposable,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostStatusBar)}dispose(){this.disposable.dispose()}$setStatusBarMessage(a){this.disposable.addDispose(this.statusBar.addElement("ext_default_statusbar_text",{text:a,alignment:_.StatusBarAlignment.LEFT}))}$dispose(a){a?this.statusBar.removeElement(a):this.statusBar.removeElement("ext_default_statusbar_text")}$createStatusBarItem(a,h,d,u){this.disposable.addDispose(this.statusBar.addElement(a,{id:h,alignment:d,priority:u}))}async $setMessage(a,h,d,u,E,f,c,y,b,A,S,D){const T=A?.label||(0,v.getCodiconAriaLabel)(u),w={id:h,name:d,text:u||"",priority:E,alignment:f===m.StatusBarAlignment.Left?_.StatusBarAlignment.LEFT:_.StatusBarAlignment.RIGHT,color:c,backgroundColor:y,tooltip:b,command:S,arguments:D,role:A?.role,ariaLabel:T};this.disposable.addDispose(this.statusBar.addElement(a,w))}};t.MainThreadStatusBar=s,n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(_.IStatusBarService),n.__metadata("design:type",Object)],s.prototype,"statusBar",void 0),t.MainThreadStatusBar=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],s)},49731:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStorage=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(50492),_=e(46147);let v=class{constructor(m){this.rpcProtocol=m,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostStorage),this.init()}dispose(){}async init(){await this.extensionStorageService.whenReady,this.proxy.$acceptStoragePath(this.extensionStorageService.extensionStoragePath)}$setValue(m,s,g){try{this.extensionStorageService.set(s,g,m)}catch(a){return Promise.reject(a)}return Promise.resolve(void 0)}$getValue(m,s){try{return Promise.resolve(this.extensionStorageService.get(s,m))}catch(g){return Promise.reject(g)}}};t.MainThreadStorage=v,n.__decorate([(0,r.Autowired)(l.IExtensionStorageService),n.__metadata("design:type",Object)],v.prototype,"extensionStorageService",void 0),t.MainThreadStorage=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],v)},24060:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTasks=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(43718),_=e(93950),v=e(1041),p=e(51500),m=e(46147),s=e(54741);var g;(function(R){function M(O){const x=O;return x&&(0,l.isString)(x.id)&&!!x.workspaceFolder}R.is=M})(g||(g={}));var a;(function(R){function M(O){return{id:O.id,task:w.from(O.task)}}R.from=M})(a||(a={}));var h;(function(R){function M(O,x){return{id:O.id,processId:x}}R.from=M})(h||(h={}));var d;(function(R){function M(O,x){return{id:O.id,exitCode:x}}R.from=M})(d||(d={}));var u;(function(R){function M(x){const k=Object.assign(Object.create(null),x);return delete k._key,k}R.from=M;function O(x,k,F){let L=F.createTaskIdentifier(x,console);return L===void 0&&k&&(L={_key:(0,l.uuid)(),type:"$executeOnly"}),L}R.to=O})(u||(u={}));var E;(function(R){function M(x){if(x!=null)return Object.assign(Object.create(null),x)}R.from=M;function O(x){return x==null?v.PresentationOptions.defaults:Object.assign(Object.create(null),v.PresentationOptions.defaults,x)}R.to=O})(E||(E={}));var f;(function(R){function M(x){if(x!=null)return Object.assign(Object.create(null),x)}R.from=M;function O(x){return x==null?v.RunOptions.defaults:Object.assign(Object.create(null),v.RunOptions.defaults,x)}R.to=O})(f||(f={}));var c;(function(R){function M(x){if(x!=null)return{cwd:x.cwd,env:x.env}}R.from=M;function O(x){return x==null?v.CommandOptions.defaults:{cwd:x.cwd||v.CommandOptions.defaults.cwd,env:x.env}}R.to=O})(c||(c={}));var y;(function(R){function M(k){const F=k;return F&&!!F.process}R.is=M;function O(k){const F=(0,l.isString)(k.name)?k.name:k.name.value,L=k.args?k.args.map(U=>(0,l.isString)(U)?U:U.value):[],N={process:F,args:L};return k.options&&(N.options=c.from(k.options)),N}R.from=O;function x(k){const F={runtime:v.RuntimeType.Process,name:k.process,args:k.args,presentation:void 0};return F.options=c.to(k.options),F}R.to=x})(y||(y={}));var b;(function(R){function M(x){if(x==null)return;const k={cwd:x.cwd||v.CommandOptions.defaults.cwd,env:x.env};return x.shell&&(k.executable=x.shell.executable,k.shellArgs=x.shell.args,k.shellQuoting=x.shell.quoting),k}R.from=M;function O(x){if(x==null)return;const k={cwd:x.cwd,env:x.env};return x.executable&&(k.shell={executable:x.executable},x.shellArgs&&(k.shell.args=x.shellArgs),x.shellQuoting&&(k.shell.quoting=x.shellQuoting)),k}R.to=O})(b||(b={}));var A;(function(R){function M(k){const F=k;return F&&(!!F.commandLine||!!F.command)}R.is=M;function O(k){const F={};return k.name&&(0,l.isString)(k.name)&&(k.args===void 0||k.args===null||k.args.length===0)?F.commandLine=k.name:(F.command=k.name,F.args=k.args),k.options&&(F.options=b.from(k.options)),F}R.from=O;function x(k){const F={runtime:v.RuntimeType.Shell,name:k.commandLine?k.commandLine:k.command,args:k.args,presentation:void 0};return k.options&&(F.options=b.to(k.options)),F}R.to=x})(A||(A={}));var S;(function(R){function M(k){const F=k;return F&&F.customExecution==="customExecution"}R.is=M;function O(){return{customExecution:"customExecution"}}R.from=O;function x(){return{runtime:v.RuntimeType.CustomExecution,presentation:void 0}}R.to=x})(S||(S={}));var D;(function(R){function M(k){const F=k;return F&&F.customExecution==="customExecution2"}R.is=M;function O(){return{customExecution:"customExecution2"}}R.from=O;function x(){return{runtime:v.RuntimeType.CustomExecution2,presentation:void 0}}R.to=x})(D||(D={}));var T;(function(R){function M(x){const k={label:x.label};return x.kind===v.TaskSourceKind.Extension?(k.extensionId=x.extension,x.workspaceFolder?k.scope=x.workspaceFolder.uri:k.scope=x.scope):x.kind===v.TaskSourceKind.Workspace&&(k.extensionId="$core",k.scope=x.config.workspaceFolder.uri),k}R.from=M;function O(x,k){let F,L;const N=k.tryGetRoots().map(W=>l.Uri.parse(W.uri));return x.scope===void 0||typeof x.scope=="number"&&x.scope!==1?k.tryGetRoots().map(W=>l.Uri.file(W.uri)).length===0?(F=1,L=void 0):(F=3,L={name:"workspace",uri:N[0],index:0}):typeof x.scope=="number"?F=x.scope:(F=3,L=(0,l.withNullAsUndefined)({uri:k.tryGetRoots().map(W=>l.Uri.parse(W.uri))[0],name:k.getWorkspaceName(k.tryGetRoots().map(W=>l.URI.file(W.uri))[0]),index:0})),{kind:v.TaskSourceKind.Extension,label:x.label,extension:x.extensionId,scope:F,workspaceFolder:L}}R.to=O})(T||(T={}));var w;(function(R){function M(x){if(x==null||!v.CustomTask.is(x)&&!v.ContributedTask.is(x)&&!v.ConfiguringTask.is(x))return;const k={_id:x._id,name:x.configurationProperties.name,definition:u.from(x.getDefinition()),source:T.from(x._source),execution:void 0,presentationOptions:!v.ConfiguringTask.is(x)&&x.command?E.from(x.command.presentation):void 0,isBackground:x.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:v.ContributedTask.is(x)?x.hasDefinedMatchers:!1,runOptions:f.from(x.runOptions)};if(x.configurationProperties.group&&(k.group=x.configurationProperties.group),!v.ConfiguringTask.is(x)&&x.command&&(x.command.runtime===v.RuntimeType.Process?k.execution=y.from(x.command):x.command.runtime===v.RuntimeType.Shell&&(k.execution=A.from(x.command))),x.configurationProperties.problemMatchers)for(const F of x.configurationProperties.problemMatchers)(0,l.isString)(F)&&k.problemMatchers.push(F);return k}R.from=M;function O(x,k,F,L){if(!x||typeof x.name!="string")return;let N;if(x.execution&&(A.is(x.execution)?N=A.to(x.execution):y.is(x.execution)?N=y.to(x.execution):S.is(x.execution)&&(N=S.to())),!N)return;N.presentation=E.to(x.presentationOptions);const U=T.to(x.source,k),W=(0,l.formatLocalize)("task.label",U.label,x.name),j=u.to(x.definition,F,L),Q=`${x.source.extensionId}.${j._key}`;return new v.ContributedTask(Q,U,W,j.type,j,N,x.hasDefinedMatchers,f.to(x.runOptions),{name:x.name,identifier:W,group:x.group,isBackground:!!x.isBackground,problemMatchers:x.problemMatchers.slice()})}R.to=O})(w||(w={}));let I=class extends l.Disposable{constructor(M){super(),this.rpcProtocol=M,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostTasks),this.providers=new Map,this.context={createTaskIdentifier:(O,x)=>this.taskDefinitionRegistry.createTaskIdentifier(O,x)},this.addDispose(this.taskService.onDidStateChange(O=>{const x=O.__task;O.kind==="start"?(this.logger.verbose(`task ${x._label||x._id} start`,O.terminalId),this.proxy.$onDidStartTask(a.from(x.getTaskExecution()),O.terminalId)):O.kind==="processStarted"?(this.logger.verbose(`task ${x._label||x._id} process start`,O.processId),this.proxy.$onDidStartTaskProcess(h.from(x.getTaskExecution(),O.processId))):O.kind==="processEnded"?(this.logger.verbose(`task ${x._label||x._id} process end`,O.exitCode),this.proxy.$onDidEndTaskProcess(d.from(x.getTaskExecution(),O.exitCode))):O.kind==="end"&&(this.logger.verbose(`task ${x._label||x._id} end`),this.proxy.$onDidEndTask(a.from(x.getTaskExecution())))}))}dispose(){super.dispose(),this.providers.forEach(M=>M.disposable.dispose()),this.providers.clear()}$registerTaskProvider(M,O){this.logger.verbose(`register task provider ${O}, handler ${M}`);const x={provideTasks:F=>(this.logger.verbose(`${O} provideTask`),Promise.resolve(this.proxy.$provideTask(M,F)).then(L=>{const N=[];for(const U of L.tasks){const W=w.to(U,this.workspaceService,!0,this.context);W?N.push(W):this.logger.error(`Task System: can not convert task: ${JSON.stringify(U.definition,void 0,0)}. Task will be dropped`)}return{tasks:N,extension:L.extension,type:O}})),resolveTask:F=>(this.logger.verbose(`${O} resolveTask`),Promise.resolve(this.proxy.$resolveTask(M,F)).then(L=>{if(L)return w.to(L,this.workspaceService,!0,this.context)}))},k=this.taskService.registerTaskProvider(x,O);return this.providers.set(M,{disposable:k,provider:x}),Promise.resolve()}$unregisterTaskProvider(M){throw new Error("Method not implemented.")}$fetchTasks(M){return this.taskService.tasks(s.TaskFilterDTO.to(M)).then(O=>{const x=[];for(const k of O){const F=w.from(k);F&&x.push(F)}return x})}$executeTask(M){return new Promise((O,x)=>{if(g.is(M)){const k=this.workspaceService.getWorkspaceRootUri(l.URI.from(M.workspaceFolder));k?this.taskService.getTask(k.codeUri,M.id,!0).then(F=>{this.taskService.run(F).then(()=>{});const L={id:M.id,task:w.from(F)};O(L)},F=>{x(new Error("Task not found"))}):x(new Error("No workspace folder"))}else{const k=w.to(M,this.workspaceService,!0,this.context);this.taskService.run(k).then(()=>{});const F={id:k._id,task:w.from(k)};O(F)}})}$createTaskId(M){return new Promise((O,x)=>{const k=w.to(M,this.workspaceService,!0,this.context);k?O(k._id):x(new Error("Task could not be created from DTO"))})}async $terminateTask(M){await this.taskService.terminateTask(M)}};t.MainThreadTasks=I,n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],I.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(_.ITaskService),n.__metadata("design:type",Object)],I.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],I.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(l.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],I.prototype,"taskDefinitionRegistry",void 0),t.MainThreadTasks=I=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],I)},69696:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTerminal=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(6487),v=e(94620),p=e(85504),m=e(46147),s=e(71354);let g=class{constructor(d){this.rpcProtocol=d,this.shortId2LongIdMap=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this.disposable=new l.Disposable,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostTerminal),this.initData(),this.bindEvent()}dispose(){this.disposable.dispose()}bindEvent(){this.disposable.addDispose(this.terminalApi.onDidChangeActiveTerminal(d=>{this.proxy.$onDidChangeActiveTerminal(d)})),this.disposable.addDispose(this.terminalApi.onDidCloseTerminal(d=>{this.proxy.$onDidCloseTerminal(d)})),this.disposable.addDispose(this.terminalApi.onDidTerminalTitleChange(d=>{this.proxy.$onDidTerminalTitleChange(d.id,d.name)})),this.disposable.addDispose(this.terminalApi.onDidOpenTerminal(d=>{const u=this.controller.clients.get(d.id);u&&u.addDispose(u.xterm.raw.onData(()=>{this.proxy.$acceptTerminalInteraction(d.id)})),this.proxy.$onDidOpenTerminal(d)})),this.disposable.addDispose(this.controller.onInstanceRequestStartExtensionTerminal(d=>this._onRequestStartExtensionTerminal(d))),this.disposable.addDispose(this.profileService.onDidChangeAvailableProfiles(()=>{this._updateDefaultProfile()})),this.disposable.addDispose(this.profileService.onTerminalProfileResolved(async d=>{await this.activationEventService.fireEvent(`onTerminalProfile:${d}`)})),this.disposable.addDispose(this.profileService.onDidChangeDefaultShell(d=>{this.proxy.$setShell(d)}))}initData(){const d=this.terminalApi.terminals,u=[];d.forEach(E=>{u.push({id:E.id,name:E.name,isActive:E.isActive})}),this.proxy.$setTerminals(u),this._updateDefaultProfile()}transform(d,u){const E=this.shortId2LongIdMap.get(d);return u(E||d)}$sendText(d,u,E){return this.transform(d,f=>(this.proxy.$acceptTerminalInteraction(f),this.terminalApi.sendText(f,u,E)))}$show(d,u){return this.transform(d,E=>this.terminalApi.showTerm(E,u))}$hide(d){return this.transform(d,u=>this.terminalApi.hideTerm(u))}$dispose(d){return this.transform(d,u=>this.terminalApi.removeTerm(u))}$getProcessId(d){return this.transform(d,u=>this.terminalApi.getProcessId(u))}async $createTerminal(d,u){await this.controller.ready.promise;const E=await this.terminalApi.createTerminal(d,u);if(!E){this.logger.error(`Create Terminal ${u} fail.`);return}this.shortId2LongIdMap.set(u,E.id)}_onRequestStartExtensionTerminal(d){const u=d.proxy;this._terminalProcessProxies.set(u.terminalId,u);const E=d.cols&&d.rows?{columns:d.cols,rows:d.rows}:void 0;this.proxy.$startExtensionTerminal(u.terminalId,E).then(d.callback),u.onInput(f=>this.proxy.$acceptProcessInput(u.terminalId,f)),u.onShutdown(f=>this.proxy.$acceptProcessShutdown(u.terminalId,f)),u.onRequestCwd(()=>this.proxy.$acceptProcessRequestCwd(u.terminalId)),u.onRequestInitialCwd(()=>this.proxy.$acceptProcessRequestInitialCwd(u.terminalId))}_getTerminalProcess(d){return this.transform(d,u=>{const E=this._terminalProcessProxies.get(u);if(!E)throw new Error(`Unknown terminal: ${u}`);return E})}$sendProcessTitle(d,u){return this.transform(d,E=>{const f=this.terminalGroupViewService.getWidget(E);f&&(f.rename(u),this.proxy.$acceptTerminalTitleChange(E,u))})}$sendProcessData(d,u){this._getTerminalProcess(d).emitData(u)}$sendProcessReady(d,u,E){this._getTerminalProcess(d).emitReady(u,E)}$sendProcessExit(d,u){this._getTerminalProcess(d).emitExit(u),this._terminalProcessProxies.delete(d)}$sendOverrideDimensions(d,u){this._getTerminalProcess(d).emitOverrideDimensions(u)}$sendProcessInitialCwd(d,u){this._getTerminalProcess(d).emitInitialCwd(u)}$sendProcessCwd(d,u){this._getTerminalProcess(d).emitCwd(u)}$startLinkProvider(){var d;(d=this._linkProvider)===null||d===void 0||d.dispose(),this._linkProvider=this.controller.registerLinkProvider(new a(this.proxy))}$stopLinkProvider(){var d;(d=this._linkProvider)===null||d===void 0||d.dispose(),this._linkProvider=void 0}$registerProfileProvider(d,u){this._profileProviders.set(d,this.profileService.registerTerminalProfileProvider(u,d,{createContributedTerminalProfile:async E=>{this.proxy.$createContributedProfileTerminal(d,E)}}))}$unregisterProfileProvider(d){var u;(u=this._profileProviders.get(d))===null||u===void 0||u.dispose(),this._profileProviders.delete(d)}async _updateDefaultProfile(){const d=await this.profileInternalSerivce.resolveDefaultProfile();d&&this.proxy.$acceptDefaultProfile(d)}$setEnvironmentVariableCollection(d,u,E){if(E){const f={persistent:u,map:(0,v.deserializeEnvironmentVariableCollection)(E)};this.environmentVariableService.set(d,f)}else this.environmentVariableService.delete(d)}};t.MainThreadTerminal=g,n.__decorate([(0,r.Autowired)(v.EnvironmentVariableServiceToken),n.__metadata("design:type",Object)],g.prototype,"environmentVariableService",void 0),n.__decorate([(0,r.Autowired)(_.ITerminalApiService),n.__metadata("design:type",Object)],g.prototype,"terminalApi",void 0),n.__decorate([(0,r.Autowired)(_.ITerminalController),n.__metadata("design:type",Object)],g.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalProfileService),n.__metadata("design:type",Object)],g.prototype,"profileService",void 0),n.__decorate([(0,r.Autowired)(_.ITerminalProfileInternalService),n.__metadata("design:type",Object)],g.prototype,"profileInternalSerivce",void 0),n.__decorate([(0,r.Autowired)(_.ITerminalGroupViewService),n.__metadata("design:type",Object)],g.prototype,"terminalGroupViewService",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],g.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(s.IActivationEventService),n.__metadata("design:type",s.IActivationEventService)],g.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],g.prototype,"logger",void 0),t.MainThreadTerminal=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],g);class a{constructor(d){this._proxy=d}async provideLinks(d,u){const E=this._proxy;return(await E.$provideLinks(d.id,u)).map(c=>({id:c.id,startIndex:c.startIndex,length:c.length,label:c.label,activate:()=>E.$activateLink(d.id,c.id)}))}}},53191:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTestsImpl=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(43718),v=e(48465),p=e(30005),m=e(20215),s=e(48385),g=e(44781),a=e(46147),h=u=>{var E,f;for(const c of u)if(c[0]===0||c[0]===1){const y=c[1];!((E=y.item)===null||E===void 0)&&E.uri&&(y.item.uri=_.URI.revive(y.item.uri)),!((f=y.item)===null||f===void 0)&&f.range&&(y.item.range=g.Range.lift(y.item.range))}};let d=class extends _.Disposable{constructor(E){super(),this.testProviderRegistrations=new Map,this.proxy=E.getProxy(a.ExtHostAPIIdentifier.ExtHostTests)}$registerTestController(E,f,c){const y=new _.DisposableStore,b=y.add(new p.ObservableValue(c)),A={id:E,label:f,canRefresh:b,configureRunProfile:S=>this.proxy.$configureRunProfile(E,S),refreshTests:S=>this.proxy.$refreshTests(E,S),runTests:(S,D)=>this.proxy.$runControllerTests(S,D),expandTest:(S,D)=>this.proxy.$expandTest(S,isFinite(D)?D:-1)};y.add(_.Disposable.create(()=>this.testProfiles.removeProfile(E))),y.add(this.testService.registerTestController(E,A)),this.testProviderRegistrations.set(E,{instance:A,label:f,canRefresh:b,disposable:y})}$updateController(E,f){const c=this.testProviderRegistrations.get(E);c&&(f.label!==void 0&&(c.label=f.label),f.canRefresh!==void 0&&(c.canRefresh.value=f.canRefresh))}$unregisterTestController(E){this.logger.warn("test: unregisterTestController>>",E)}$subscribeToDiffs(){this.logger.warn("test: subscribeToDiffs>>")}$unsubscribeFromDiffs(){this.logger.warn("test: unsubscribeFromDiffs>>")}$publishDiff(E,f){h(f),this.testService.publishDiff(E,f)}$publishTestRunProfile(E){const f=this.testProviderRegistrations.get(E.controllerId);f&&this.testProfiles.addProfile(f.instance,E)}$updateTestRunConfig(E,f,c){this.logger.warn("Method not implemented.")}$removeTestProfile(E,f){this.testProfiles.removeProfile(E,f)}async $runTests(E,f){return(await this.testService.runResolvedTests(E,f)).id}$addTestsToRun(E,f,c){for(const y of c)y.uri=_.URI.revive(y.uri),y.range&&(y.range=g.Range.lift(y.range));this.withTestResult(f,y=>y.addTestChainToRun(E,c))}$updateTestStateInRun(E,f,c,y,b){this.withTestResult(E,A=>A.updateState(c,f,y,b))}$appendTestMessagesInRun(E,f,c,y){const b=this.resultService.getResult(E);if(b&&b instanceof s.TestResultImpl)for(const A of y)A.location&&(A.location.uri=_.URI.revive(A.location.uri),A.location.range=g.Range.lift(A.location.range)),b.appendMessage(c,f,A)}$appendOutputToRun(E,f,c,y,b){const A=y&&{uri:_.URI.revive(y.uri),range:g.Range.lift(y.range)};this.withTestResult(E,S=>S.appendOutput(c,f,A,b))}$startedTestRunTask(E,f){this.withTestResult(E,c=>c.addTask(f))}$finishedTestRunTask(E,f){this.withTestResult(E,c=>c.markTaskComplete(f))}$startedExtensionTestRun(E){this.resultService.createTestResult(E)}$finishedExtensionTestRun(E){this.withTestResult(E,f=>f.markComplete())}$markTestRetired(E){this.logger.warn("Method not implemented.")}withTestResult(E,f){const c=this.resultService.getResult(E);return c&&c instanceof s.TestResultImpl?f(c):void 0}};t.MainThreadTestsImpl=d,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",l.Logger)],d.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.TestServiceToken),n.__metadata("design:type",Object)],d.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(m.TestProfileServiceToken),n.__metadata("design:type",Object)],d.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(s.TestResultServiceToken),n.__metadata("design:type",Object)],d.prototype,"resultService",void 0),t.MainThreadTestsImpl=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],d)},31968:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTheming=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(52416),_=e(46147);let v=class{constructor(m){this.rpcProtocol=m,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostTheming),this._themeChangeListener=this._themeService.onThemeChange(s=>{this.proxy.$onColorThemeChange(s.type)}),this.proxy.$onColorThemeChange(this._themeService.getCurrentThemeSync().type)}dispose(){this._themeChangeListener.dispose()}};t.MainThreadTheming=v,n.__decorate([(0,r.Autowired)(l.IThemeService),n.__metadata("design:type",Object)],v.prototype,"_themeService",void 0),t.MainThreadTheming=v=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],v)},4321:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TreeViewDragAndDropController=t.TreeViewDataProvider=t.MainThreadTreeView=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(8919),v=e(41869),p=e(93899),m=e(68969),s=e(14951),g=e(63067),a=e(52416),h=e(46147),d=e(53043),u=e(98475),E=e(2108),f=e(51328),c=e(17428),y=e(74228),b=e(72217);let A=n=class extends v.WithEventBus{constructor(w,I){super(),this.rpcProtocol=w,this.extensionHostType=I,this.treeModels=new Map,this.dndControllers=new Map,this.disposableCollection=new Map,this.disposable=new v.DisposableStore,this.proxy=this.rpcProtocol.getProxy(h.ExtHostAPIIdentifier.ExtHostTreeView),this.disposable.add((0,v.toDisposable)(()=>this.treeModels.clear())),this.disposable.add((0,v.toDisposable)(()=>this.dndControllers.clear())),this._registerInternalCommands(),this.fileServiceClient.getCurrentUserHome().then(R=>{R&&(this.userhome=new v.URI(R.uri))}),this.addDispose(this.eventBus.on(g.ViewCollapseChangedEvent,R=>{if(R.payload.viewId&&this.treeModels.has(R.payload.viewId)&&!R.payload.collapsed){const M=this.treeModels.get(R.payload.viewId);M&&this.progressService.withProgress({location:R.payload.viewId},()=>M.refresh())}}))}dispose(){this.disposable.dispose(),this.disposableCollection.forEach(w=>{w.dispose()}),this.disposableCollection.clear()}createTreeModel(w,I,R,M){return y.ExtensionTreeViewModel.createModel(this.injector,I,R,w,M||{})}async $registerTreeDataProvider(w,I){if(this.treeModels.has(w))return;const R=new v.DisposableStore,M=new S(w,this.proxy,this.iconService,this.themeService,this.labelService,this.contextKeyService,this.menuService,this.userhome),O=new D(w,I.dropMimeTypes,I.dragMimeTypes,I.hasHandleDrag,this.proxy),x=this.createTreeModel(w,M,O,I);this.treeModels.set(w,x),this.dndControllers.set(w,O),R.add((0,v.toDisposable)(()=>this.treeModels.delete(w))),this.mainLayoutService.replaceViewComponent({id:w,component:c.ExtensionTabBarTreeView},{model:x,dataProvider:M,treeViewId:w}),I?.showCollapseAll&&R.add(this.menuRegistry.registerMenuItem(p.MenuId.ViewTitle,{command:{id:this.extensionHostType==="worker"?n.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID_WORKER:n.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID,label:(0,v.localize)("treeview.command.action.collapse")},extraTailArgs:[w],iconClass:(0,v.getIcon)("collapse-all"),when:`view == ${w}`,group:"navigation",order:1e4})),R.add(x.onDidSelectedNodeChange(F=>{M.setSelection(w,F)})),R.add(x.onDidChangeExpansionState(F=>{const{treeItemId:L,expanded:N}=F;M.setExpanded(w,L,N)}));const k=this.mainLayoutService.getTabbarHandler(w);k&&(R.add(k.onActivate(()=>{M.setVisible(w,!0)})),R.add(k.onInActivate(()=>{M.setVisible(w,!1)})),R.add(R.add((0,v.toDisposable)(()=>k.disposeView(w))))),this.disposableCollection.set(w,R)}async $unregisterTreeDataProvider(w){const I=this.disposableCollection.get(w);I&&I.dispose()}async $resolveDropFileData(w,I,R){const M=this.dndControllers.get(w);if(!M)throw new Error("Unknown tree");return M.resolveDropFileData(I,R)}async $refresh(w,I){const R=this.treeModels.get(w);R&&await R.refresh(I)}async $setTitle(w,I){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewTitle(w,I)}async $setDescription(w,I){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewDescription(w,I)}async $setBadge(w,I){const R=this.mainLayoutService.getTabbarHandler(w);R&&(R.setBadge(I||""),R.accordionService.updateViewBadge(w,I||""))}async $setMessage(w,I){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewMessage(w,I)}async $reveal(w,I,R){this.mainLayoutService.revealView(w);const M=this.treeModels.get(w);M&&I&&M.reveal(I,R)}_registerInternalCommands(){this.disposable.add(this.commandRegistry.registerCommand({id:this.extensionHostType==="worker"?n.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID_WORKER:n.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID},{execute:w=>{const I=this.treeModels.get(w);I&&I.collapseAll()}}))}};t.MainThreadTreeView=A,A.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID="TREE_VIEW_COLLAPSE_ALL",A.TREE_VIEW_COLLAPSE_ALL_COMMAND_ID_WORKER="TREE_VIEW_COLLAPSE_ALL_WORKER",r.__decorate([(0,o.Autowired)(g.IMainLayoutService),r.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),r.__decorate([(0,o.Autowired)(a.IIconService),r.__metadata("design:type",Object)],A.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(p.IMenuRegistry),r.__metadata("design:type",p.IMenuRegistry)],A.prototype,"menuRegistry",void 0),r.__decorate([(0,o.Autowired)(v.CommandRegistry),r.__metadata("design:type",Object)],A.prototype,"commandRegistry",void 0),r.__decorate([(0,o.Autowired)(a.IThemeService),r.__metadata("design:type",Object)],A.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(m.IProgressService),r.__metadata("design:type",Object)],A.prototype,"progressService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],A.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(v.IContextKeyService),r.__metadata("design:type",Object)],A.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(p.AbstractMenuService),r.__metadata("design:type",p.AbstractMenuService)],A.prototype,"menuService",void 0),r.__decorate([(0,o.Autowired)(s.IFileServiceClient),r.__metadata("design:type",Object)],A.prototype,"fileServiceClient",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],A.prototype,"injector",void 0),t.MainThreadTreeView=A=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)(_.IRPCProtocol)),r.__metadata("design:paramtypes",[Object,String])],A);class S extends l.Tree{constructor(w,I,R,M,O,x,k,F){super(),this.treeViewId=w,this.proxy=I,this.iconService=R,this.themeService=M,this.labelService=O,this.contextKeyService=x,this.menuService=k,this.userhome=F,this.cachedMenu=new Map,this.onTreeDataChangedEmitter=new v.Emitter,this.onRevealChangedEmitter=new v.Emitter,this.isEmpty=!0,this._onDidChangeEmpty=new v.Emitter,this.onDidChangeEmpty=this._onDidChangeEmpty.event,this.treeItemId2TreeNode=new Map}get isTreeEmpty(){return this.isEmpty}get onTreeDataChanged(){return this.onTreeDataChangedEmitter.event}get onRevealChanged(){return this.onRevealChangedEmitter.event}get root(){return this._root}getTreeNodeIdByTreeItemId(w){var I;return(I=this.treeItemId2TreeNode.get(w))===null||I===void 0?void 0:I.id}getReadableDescription(w){if(w.resourceUri){if(this.userhome){const I=v.URI.from(w.resourceUri);if(this.userhome.isEqualOrParent(I))return decodeURIComponent(w.resourceUri.path.toString().replace(this.userhome.codeUri.fsPath,"~"))}return w.resourceUri.path.toString()}return w.description}getLabelAndDescription(w){if(w.label)return{label:w.label,description:w.description};if(w.resourceUri){let I=w.resourceUri.path.toString();I=decodeURIComponent(I),I.indexOf("/")>=0&&(I=I.substring(I.lastIndexOf("/")+1));const R=this.getReadableDescription(w);return{label:I,description:R}}return{label:w.label,description:w.description}}async createFoldNode(w,I){var R;const M=f.TreeItemCollapsibleState.Expanded===w.collapsibleState,O=await this.toIconClass(w),x=this.getInlineMenuNodes(w.contextValue||""),{label:k,description:F}=this.getLabelAndDescription(w);return new b.ExtensionCompositeTreeNode(this,I,k,F,O,typeof w.tooltip=="string"?w.tooltip:(R=w.tooltip)===null||R===void 0?void 0:R.value,w.command,w.contextValue||"",w.id,x,w.checkboxInfo,w.accessibilityInformation,M,w.resourceUri)}async createNormalNode(w,I){var R;const M=await this.toIconClass(w),O=this.getInlineMenuNodes(w.contextValue||""),{label:x,description:k}=this.getLabelAndDescription(w);return new b.ExtensionTreeNode(this,I,x,k,M,typeof w.tooltip=="string"?w.tooltip:(R=w.tooltip)===null||R===void 0?void 0:R.value,w.command,w.contextValue||"",w.id,O,w.checkboxInfo,w.accessibilityInformation,w.resourceUri)}isBase64Icon(w){const I=/^data:image\//;return w?(0,v.isString)(w)?I.test(w):I.test(w.dark):!1}async toIconClass(w){if(w.iconUrl||w.icon)return this.iconService.fromIcon("",w.iconUrl||w.icon,this.isBase64Icon(w.iconUrl||w.icon)?a.IconType.Base64:a.IconType.Background,void 0,!0);if(w.themeIcon){let I=(0,v.getExternalIcon)(w.themeIcon.id);w.resourceUri&&(w.themeIcon.id==="file"?I=this.labelService.getIcon(v.URI.from(w.resourceUri)):w.themeIcon.id==="folder"&&(I=this.labelService.getIcon(v.URI.from(w.resourceUri),{isDirectory:!0})));const R=this.themeService.getColorClassNameByColorToken(w.themeIcon.color);return`${I} ${R??""}`}else return""}getInlineMenuNodes(w){if(this.cachedMenu.has(w))return this.cachedMenu.get(w);const I=this.contextKeyService.createScoped();I.createKey("view",this.treeViewId),I.createKey("viewItem",w);const R=this.menuService.createMenu(p.MenuId.ViewItemContext,I),M=(0,p.generateCtxMenu)({menus:R,separator:"inline"});return R.dispose(),I.dispose(),this.cachedMenu.set(w,M[0]),M[0]}async createTreeNode(w,I){return!(0,v.isUndefined)(w.collapsibleState)&&w.collapsibleState!==f.TreeItemCollapsibleState.None?await this.createFoldNode(w,I):await this.createNormalNode(w,I)}async resolveChildren(w){let I=[];if(w){let R;if(b.ExtensionTreeRoot.is(w)?R=await this.proxy.$getChildren(this.treeViewId):R=await this.proxy.$getChildren(this.treeViewId,w.treeItemId),R&&Array.isArray(R))for(const M of R){const O=await this.createTreeNode(M,w);this.treeItemId2TreeNode.set(M.id,O),I.push(O)}if(b.ExtensionTreeRoot.is(w)){const M=this.isEmpty;this.isEmpty=!R||R.length===0,M!==this.isEmpty&&this._onDidChangeEmpty.fire()}}else I=[new b.ExtensionTreeRoot(this,this.treeViewId)];return I}async resolveTreeItem(w,I){const R=new v.CancellationTokenSource().token;return this.proxy.$resolveTreeItem(w,I,R)}sortComparator(w,I){return w?I?0:-1:1}async refresh(w){await this.onTreeDataChangedEmitter.fire(w)}async reveal(w){await this.onRevealChangedEmitter.fire(w)}async setSelection(w,I){this.proxy.$setSelection(w,I)}async setExpanded(w,I,R){this.proxy.$setExpanded(w,I,R)}async setVisible(w,I){this.proxy.$setVisible(w,I)}dispose(){super.dispose(),this.treeItemId2TreeNode.clear()}markAsChecked(w,I,R){var M;function O(F,L){var N,U;((N=F.parent)===null||N===void 0?void 0:N.checkboxInfo)!==void 0&&F.parent.checkboxInfo.checked!==I&&(!I||!(!((U=F.parent.children)===null||U===void 0)&&U.some(W=>{var j;return W!==F&&((j=W.checkboxInfo)===null||j===void 0?void 0:j.checked)===!1})))&&(L.push(F.parent),O(F.parent,L))}function x(F,L){var N;l.CompositeTreeNode.is(F)&&((N=F.children)===null||N===void 0||N.forEach(U=>{U.checkboxInfo!==void 0&&U.checkboxInfo.checked!==I&&L.push(U),x(U,L)}))}const k=[w];R||(O(w,k),x(w,k)),k.forEach(F=>F.checkboxInfo.checked=I),(M=this.proxy)===null||M===void 0||M.$checkStateChanged(this.treeViewId,[{treeItemId:w.treeItemId,checked:I}])}}t.TreeViewDataProvider=S;class D extends v.Disposable{constructor(w,I=[],R=[],M,O){super(),this.treeViewId=w,this.dropMimeTypes=I,this.dragMimeTypes=R,this.hasHandleDrag=M,this._proxy=O,this.dataTransfersCache=new E.DataTransferCache}async handleDrop(w,I,R,M,O,x){const k=this.dataTransfersCache.add(w);try{return await this._proxy.$handleDrop(this.treeViewId,k.id,await d.DataTransfer.toDataTransferDTO(w),I?.treeItemId,R,M,O,x)}finally{k.dispose()}}async handleDrag(w,I,R){if(!this.hasHandleDrag)return;const M=await this._proxy.$handleDrag(this.treeViewId,w,I,R);if(!M)return;const O=new u.VSDataTransfer;return M.items.forEach(([x,k])=>{O.replace(x,(0,u.createStringDataTransferItem)(k.asString))}),O}resolveDropFileData(w,I){return this.dataTransfersCache.resolveDropFileData(w,I)}}t.TreeViewDragAndDropController=D},73082:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadUrls=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(46147),v=e(71354);class p{constructor(a,h,d){this.proxy=a,this.handle=h,this.extensionId=d}async handleURL(a){return this.extensionId!==a.authority?!1:(await this.proxy.$handleExternalUri(this.handle,a.codeUri),!0)}}let m=class{constructor(){this.extensionUrlHandlers=new Map}async open(a){let h=!1;const d=a.authority,u=this.extensionUrlHandlers.get(d);if(u)try{h=await u.handleURL(a)}catch(E){this.logger.error(E)}return await this.activationEventService.fireEvent("onUri",d),h}handleScheme(a){return a===this.config.uriScheme}registerExtensionHandler(a,h,d){const u=new p(d,a,h);return this.extensionUrlHandlers.set(h,u),{dispose:()=>{this.extensionUrlHandlers.delete(h)}}}dispose(){this.extensionUrlHandlers.clear()}};n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],m.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.IActivationEventService)],m.prototype,"activationEventService",void 0),m=n.__decorate([(0,r.Injectable)()],m);let s=class{constructor(a){this.handlers=new Map,this.proxy=a.getProxy(_.ExtHostAPIIdentifier.ExtHostUrls),this.openerService.registerOpener(this.extensionOpener)}async $registerUriHandler(a,h){this.handlers.set(a,this.extensionOpener.registerExtensionHandler(a,h,this.proxy))}async $unregisterUriHandler(a){const h=this.handlers.get(a);h&&(h.dispose(),this.handlers.delete(a))}dispose(){this.handlers.clear(),this.extensionOpener.dispose()}};t.MainThreadUrls=s,n.__decorate([(0,r.Autowired)(l.IOpenerService),n.__metadata("design:type",Object)],s.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(m),n.__metadata("design:type",m)],s.prototype,"extensionOpener",void 0),t.MainThreadUrls=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],s)},38408:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindowState=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(46147),v=e(38894);let p=class{constructor(s){this.rpcProtocol=s,this.toDispose=new l.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostWindowState),this.blurHandler=()=>{this.proxy.$onDidChangeWindowFocus(!1)},this.focusHandler=()=>{this.proxy.$onDidChangeWindowFocus(!0)},window.addEventListener("blur",this.blurHandler),window.addEventListener("focus",this.focusHandler);const g=new v.WindowActivityTimer(window);this.toDispose.push(g.onDidChangeActiveState(a=>this.onActiveStateChanged(a))),this.toDispose.push(g)}onActiveStateChanged(s){this.proxy.$onDidChangeWindowActive(s)}dispose(){window.removeEventListener("blur",this.blurHandler),window.removeEventListener("focus",this.focusHandler),this.toDispose.dispose()}};t.MainThreadWindowState=p,t.MainThreadWindowState=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],p)},43812:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindow=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(72665),v=e(46147);let p=class{constructor(s){this.rpcProtocol=s,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostWindow)}getDefaultDialogOptions(s){return{...s,defaultUri:s.defaultUri?l.URI.from(s.defaultUri):void 0}}async $showOpenDialog(s,g={}){const a=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showOpenDialog(a);this.proxy.$onOpenDialogResult(s,h&&h.map(d=>d.codeUri))}async $showSaveDialog(s,g={}){const a=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showSaveDialog(a);this.proxy.$onSaveDialogResult(s,h&&h.codeUri)}dispose(){}};t.MainThreadWindow=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.IDialogService),n.__metadata("design:type",Object)],p.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(_.IWindowDialogService),n.__metadata("design:type",Object)],p.prototype,"windowDialogService",void 0),t.MainThreadWindow=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],p)},13643:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWorkspace=void 0;const n=e(85608),r=e(76003),o=e(8919),l=e(41869),_=e(54414),v=e(50492),p=e(84660),m=e(52902),s=e(51500),g=e(26199),a=e(46147);let h=class extends l.WithEventBus{constructor(u){super(),this.rpcProtocol=u,this.proxy=this.rpcProtocol.getProxy(a.ExtHostAPIIdentifier.ExtHostWorkspace),this.processWorkspaceFoldersChanged(this.workspaceService.tryGetRoots()),this.addDispose(this.workspaceChangeEvent=this.workspaceService.onWorkspaceChanged(E=>{this.processWorkspaceFoldersChanged(E)})),this.storageProxy=u.getProxy(a.ExtHostAPIIdentifier.ExtHostStorage)}async $startFileSearch(u,E,f,c,y){const b={rootUris:E.cwd?[E.cwd]:this.workspaceService.tryGetRoots().map(S=>S.uri),excludePatterns:f?[f]:void 0,limit:c,includePatterns:[u]};return await this.fileSearchService.find("",b,y)}isAnyRootChanged(u){return!this.roots||this.roots.length!==u.length?!0:this.roots.some((E,f)=>E.uri!==u[f].uri)}processWorkspaceFoldersChanged(u){this.isAnyRootChanged(u)!==!1&&(this.roots=u,this.proxy.$onWorkspaceFoldersChanged({roots:u}),this.extensionStorageService.getAll(!1).then(E=>{this.storageProxy.$updateWorkspaceStorageData(E)}))}dispose(){super.dispose(),this.workspaceChangeEvent.dispose()}async $updateWorkspaceFolders(u,E,f,...c){await this.workspaceService.spliceRoots(u,E,f,...c.map(y=>new l.URI(y)))}async $tryApplyWorkspaceEdit(u,E){try{const f=m.ResourceEdit.convert(u),{success:c}=await this.bulkEditService.apply(f,{respectAutoSaveConfig:E?.isRefactoring});return c}catch{return!1}}async $save(u){if(u)try{const E=l.URI.file(u.path.toString());return await this.editorService.save(E)}catch(E){this.logger.error(`Save Failed: ${E.message}`);return}}async $saveAs(u){if(u)try{return await this.editorService.saveAs(u)}catch(E){this.logger.error(`SaveAs Failed: ${E.message}`);return}}async $saveAll(){try{return await this.editorService.saveAll(),!0}catch(u){return this.logger.error(u),!1}}onRenameFile(u){this.proxy.$didRenameFile(u.payload.oldUri.codeUri,u.payload.newUri.codeUri)}};t.MainThreadWorkspace=h,n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],h.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],h.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(p.FileSearchServicePath),n.__metadata("design:type",Object)],h.prototype,"fileSearchService",void 0),n.__decorate([(0,r.Autowired)(v.IExtensionStorageService),n.__metadata("design:type",Object)],h.prototype,"extensionStorageService",void 0),n.__decorate([(0,r.Autowired)(g.IBulkEditServiceShape),n.__metadata("design:type",Object)],h.prototype,"bulkEditService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(g.WorkspaceEditDidRenameFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[g.WorkspaceEditDidRenameFileEvent]),n.__metadata("design:returntype",void 0)],h.prototype,"onRenameFile",null),t.MainThreadWorkspace=h=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],h)},97673:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRangeSemanticTokensProviderImpl=t.DocumentSemanticTokensProvider=void 0;const n=e(70858);function r(_){if(_ instanceof Uint8Array)return _;if(Array.isArray(_))return Uint8Array.from(_);const v=[];for(const p in _)Object.prototype.hasOwnProperty.call(_,p)&&v.push(Number(_[p]));return Uint8Array.from(v)}class o{constructor(v,p,m){this.proxy=v,this.handleId=p,this.legend=m}getLegend(){return this.legend}async provideDocumentSemanticTokens(v,p,m){const s=p?parseInt(p,10):0,g=await this.proxy.$provideDocumentSemanticTokens(this.handleId,v.uri,s,m);if(!g||m.isCancellationRequested)return null;const a=(0,n.decodeSemanticTokensDto)(r(g));return a.type==="full"?{resultId:String(a.id),data:a.data}:{resultId:String(a.id),edits:a.deltas}}releaseDocumentSemanticTokens(v){v&&this.proxy.$releaseDocumentSemanticTokens(this.handleId,parseInt(v,10))}}t.DocumentSemanticTokensProvider=o;class l{constructor(v,p,m){this.proxy=v,this.handleId=p,this.legend=m}getLegend(){return this.legend}async provideDocumentRangeSemanticTokens(v,p,m){const s=await this.proxy.$provideDocumentRangeSemanticTokens(this.handleId,v.uri,p,m);if(!s||m.isCancellationRequested)return null;const g=(0,n.decodeSemanticTokensDto)(r(s));if(g.type==="full")return{resultId:String(g.id),data:g.data};throw new Error("Unexpected")}}t.DocumentRangeSemanticTokensProviderImpl=l},74501:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTreeModel=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(72217);let p=n=class extends l.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new _.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.ExtensionTreeModel=p,p.DEFAULT_FLUSH_DELAY=100,t.ExtensionTreeModel=p=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExtensionTreeRoot])],p)},74228:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTreeViewModel=t.ITreeViewsService=t.ITreeViewDragAndDropController=t.ITreeViewBaseOptions=t.ITreeViewId=t.IExtensionTreeViewModel=void 0;const r=e(85608),o=e(76003),l=e(97267),_=e(41869),v=e(93899),p=e(43718),m=e(46147),s=e(98475),g=e(4321),a=r.__importDefault(e(50790)),h=e(74501),d=e(72217);t.IExtensionTreeViewModel=Symbol("IExtensionTreeViewModel"),t.ITreeViewId=Symbol("ITreeViewId"),t.ITreeViewBaseOptions=Symbol("TreeViewBaseOptions"),t.ITreeViewDragAndDropController=Symbol("ITreeViewDragAndDropController"),t.ITreeViewsService=Symbol("ITreeViewsService");const u=Symbol("ITreeViewDataProvider");let E=n=class{static createContainer(c,y,b,A,S){return c.createChild([{token:u,useValue:y},{token:t.ITreeViewDragAndDropController,useValue:b},{token:t.IExtensionTreeViewModel,useClass:n},{token:t.ITreeViewId,useValue:A},{token:t.ITreeViewBaseOptions,useValue:S},{token:t.ITreeViewsService,useValue:new m.TreeviewsService}])}static createModel(c,y,b,A,S){return n.createContainer(c,y,b,A,S).get(t.IExtensionTreeViewModel)}constructor(){this.selectedDecoration=new l.Decoration(a.default.mod_selected),this.focusedDecoration=new l.Decoration(a.default.mod_focused),this.contextMenuDecoration=new l.Decoration(a.default.mod_actived),this.loadingDecoration=new l.Decoration(a.default.mod_loading),this.draggingDecoration=new l.Decoration(a.default.mod_dragging),this.draggedOverDecoration=new l.Decoration(a.default.mod_dragover),this.beingDraggedNodes=[],this._selectedNodes=[],this.disposableCollection=new _.DisposableCollection,this.onDidFocusedNodeChangeEmitter=new _.Emitter,this.onDidSelectedNodeChangeEmitter=new _.Emitter,this.onDidChangeExpansionStateEmitter=new _.Emitter,this._isMultiSelected=!1,this.revealDelayer=new _.ThrottledDelayer(n.DEFAULT_REVEAL_DELAY),this.toCancelNodeExpansion=new _.DisposableCollection,this.dragOverTrigger=new _.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.treeItemsTransfer=s.LocalSelectionTransfer.getInstance(),this.treeHandlerReadyDeffer=new _.Deferred,this.clearNodeSelectedDecoration=()=>{this._selectedNodes.forEach(c=>{this.selectedDecoration.removeTarget(c)}),this._selectedNodes=[],this.onDidSelectedNodeChangeEmitter.fire([])},this.activeNodeDecoration=c=>{if(c!==this.treeModel.root&&(this.contextMenuNode&&(this.contextMenuDecoration.removeTarget(this.contextMenuNode),this._contextMenuNode=void 0),c)){if(this.selectedNodes.length>0)for(const y of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(y);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(c),this.focusedDecoration.addTarget(c),this._focusedNode=c,this._selectedNodes=[c],this.onDidFocusedNodeChangeEmitter.fire(c.treeItemId),this.onDidSelectedNodeChangeEmitter.fire([c.treeItemId]),this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(c,y=!1,b=!1)=>{if(c!==this.treeModel.root){if(this.focusedNode!==c&&(y?(this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this._contextMenuNode=c):this.focusedNode&&(this._contextMenuNode=void 0,this.focusedDecoration.removeTarget(this.focusedNode)),c)){if(b){for(const A of this._selectedNodes)this.selectedDecoration.removeTarget(A);this._selectedNodes=[]}this._selectedNodes.indexOf(c)<0&&(this.selectedDecoration.addTarget(c),this._selectedNodes.push(c),this.onDidSelectedNodeChangeEmitter.fire(this._selectedNodes.map(A=>A.treeItemId))),this.focusedDecoration.addTarget(c),this._focusedNode=c,this.onDidFocusedNodeChangeEmitter.fire(c.treeItemId)}this.treeModel.dispatchChange()}},this.activeNodeActivedDecoration=c=>{this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this._focusedNode=void 0),this.contextMenuDecoration.addTarget(c),this._contextMenuNode=c,this.treeModel.dispatchChange()},this.selectNodeDecoration=(c,y=!0)=>{c!==this.treeModel.root&&(this.contextMenuNode&&(this.contextMenuDecoration.removeTarget(this.contextMenuNode),this._contextMenuNode=void 0),c&&(this.selectedNodes.length>0&&this.selectedNodes.forEach(b=>{this.selectedDecoration.removeTarget(b)}),this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(c),this._selectedNodes=[c],this.onDidSelectedNodeChangeEmitter.fire([c.treeItemId]),y&&this.treeModel.dispatchChange()))},this.activeNodeSelectedDecoration=c=>{this._selectedNodes.indexOf(c)>-1||(this._selectedNodes.push(c),this.selectedDecoration.addTarget(c),this.onDidSelectedNodeChangeEmitter.fire(this._selectedNodes.map(y=>y.treeItemId)),this.treeModel.dispatchChange())},this.activeNodeDecorationByRange=(c,y)=>{for(this.clearNodeSelectedDecoration(),this._contextMenuNode=void 0;c<=y;c++){const b=this.treeModel.root.getTreeNodeAtIndex(c);b&&(this._selectedNodes.push(b),this.selectedDecoration.addTarget(b))}this.onDidSelectedNodeChangeEmitter.fire(this._selectedNodes.map(b=>b.treeItemId)),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{var c;this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.onDidFocusedNodeChangeEmitter.fire(),this._focusedNode=void 0),this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),(c=this.treeModel)===null||c===void 0||c.dispatchChange()},this.toggleDirectory=async c=>{var y,b;await this.treeHandlerReadyDeffer.promise,c.expanded?await((y=this.extensionTreeHandle)===null||y===void 0?void 0:y.collapseNode(c)):await((b=this.extensionTreeHandle)===null||b===void 0?void 0:b.expandNode(c))},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTreeFocus=()=>{},this.handleDragStart=(c,y)=>{c.stopPropagation();const b=w=>{this.handleDragEnd(w,y)};c.currentTarget.addEventListener("dragend",b,!1);let A=this.selectedNodes,S=!1;for(const w of A)w&&w.id===y.id&&(S=!0);S||(A=[y]);const D=[],T={id:this.treeViewId,itemHandles:[]};if(A.forEach(w=>{T.itemHandles.push(w.treeItemId),w.uri&&D.push(p.URI.revive(w.uri))}),this.addResourceInfoToTransfer(c,D),this.addExtensionProvidedTransferTypes(c,T.itemHandles),c.dataTransfer.setData(this.treeMimeType,JSON.stringify(T)),A.forEach(w=>{this.draggingDecoration.addTarget(w,l.TargetMatchMode.Self)}),c.dataTransfer){const w=this.getDragLabel(A)||"",I=document.createElement("div");I.className=a.default.tree_view_drag_image,I.textContent=w,document.body.appendChild(I),c.dataTransfer.setDragImage(I,-10,-10),setTimeout(()=>document.body.removeChild(I),0)}},this.handleDragEnter=(c,y)=>{c.stopPropagation(),c.preventDefault()},this.handleDrop=async(c,y)=>{c.preventDefault(),c.stopPropagation(),c.dataTransfer.dropEffect="copy",y&&this.draggingDecoration.removeTarget(y),this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(I=>{this.draggingDecoration.removeTarget(I)}),this.beingDraggedNodes=[],this.potentialParent=null,this.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose();const b=this.treeViewDragAndDropController;if(!c.dataTransfer||!b)return;const A=(0,s.toVSDataTransfer)(c.dataTransfer);let S,D;this.treeItemsTransfer.hasData(s.DraggedTreeItemsIdentifier.prototype)&&(D=this.treeItemsTransfer.getData(s.DraggedTreeItemsIdentifier.prototype)[0].identifier);const T=new s.VSDataTransfer;for(const[I,R]of A.entries())if((I===this.treeMimeType||b.dropMimeTypes.includes(I)||R.asFile()&&b.dropMimeTypes.includes(s.DataTransfers.FILES.toLowerCase()))&&(T.append(I,R),I===this.treeMimeType))try{S=JSON.parse(await R.asString())}catch{}const w=await this.treeViewsDragAndDropService.removeDragOperationTransfer(D);if(w)for(const[I,R]of w.entries())T.append(I,R);return b.handleDrop(T,y,p.CancellationToken.None,D,S?.id,S?.itemHandles)},this.handleDragOver=(c,y)=>{if(c.preventDefault(),c.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(y)>=0)return;this.draggedOverNode=y;const b=d.ExtensionCompositeTreeNode.is(y)&&y.expanded?y:y.parent;(this.potentialParent!==b||!this.draggedOverDecoration.hasTarget(b))&&(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=b,this.draggedOverDecoration.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren),this.treeModel.dispatchChange()),this.potentialParent!==y&&d.ExtensionCompositeTreeNode.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren))),this.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(p.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDragLeave=(c,y)=>{c.preventDefault(),c.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDecoration.removeTarget(this.potentialParent),this.treeModel.dispatchChange())},this.handleDragEnd=(c,y)=>{var b,A;((b=c.dataTransfer)===null||b===void 0?void 0:b.dropEffect)==="none"&&((A=this.dragCancellationToken)===null||A===void 0||A.cancel()),this.draggingDecoration.removeTarget(y),this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.draggingDecoration.removeTarget(S)}),this.beingDraggedNodes=[],this.potentialParent=null,this.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.handleItemRangeClick=(c,y)=>{if(!this.focusedNode)this.handleItemClick(c,y);else if(this.focusedNode&&this.focusedNode!==c){this._isMultiSelected=!0;const b=this.treeModel.root.getIndexAtTreeNode(c),A=this.treeModel.root.getIndexAtTreeNode(this.focusedNode);A>b?this.activeNodeDecorationByRange(b,A):A<b&&this.activeNodeDecorationByRange(A,b)}},this.handleItemToggleClick=(c,y)=>{this._isMultiSelected=!0,!(y!==l.TreeNodeType.CompositeTreeNode&&y!==l.TreeNodeType.TreeNode)&&(this.selectedNodes.indexOf(c)>-1?this.focusedNode===c?this.enactiveNodeDecoration():this.activeNodeFocusedDecoration(c):this.activeNodeSelectedDecoration(c))},this.handleItemClick=async(c,y)=>{this._isMultiSelected=!1,(y===l.TreeNodeType.CompositeTreeNode||y===l.TreeNodeType.TreeNode)&&this.activeNodeDecoration(c),c.resolved||await c.resolveTreeItem(),c.command?this.commandService.executeCommand(c.command.id,...c.command.arguments||[]):(this.clickTimes++,y===l.TreeNodeType.CompositeTreeNode&&this.preferenceService.get("workbench.list.openMode")==="singleClick"&&this.toggleDirectory(c),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&y!==l.TreeNodeType.TreeNode&&this.preferenceService.get("workbench.list.openMode")==="doubleClick"&&this.toggleDirectory(c),this.clickTimes=0},200))},this.handleContextMenu=(c,y)=>{c.stopPropagation(),c.preventDefault();const{x:b,y:A}=c.nativeEvent;y?this.activeNodeActivedDecoration(y):this.enactiveNodeDecoration();let S,D;y?(D=y,this._isMultiSelected?this.selectedNodes.indexOf(D)>=0?S=this._isMultiSelected?this.selectedNodes:[D]:S=this._isMultiSelected?this.selectedNodes.concat([D]):[D]:S=[D]):(S=[this.treeModel.root],D=this.treeModel.root);const T=this.getCtxMenuNodes(D.contextValue);this.injector.get(v.ICtxMenuRenderer).show({anchor:{x:b,y:A},menuNodes:T,args:[{treeViewId:this.treeViewId,treeItemId:D.treeItemId},S.map(I=>({treeViewId:this.treeViewId,treeItemId:I.treeItemId}))]})},this.handleCheckBoxChange=async c=>{c&&this.treeViewDataProvider.markAsChecked(c,!c.checkboxInfo.checked,this.treeViewOptions.manageCheckboxStateManually)},this._whenReady=this.initTreeModel(),this.treeMimeType=`application/vnd.code.tree.${this.treeViewId.toLowerCase()}`}get draggable(){return this.treeViewDragAndDropController.hasHandleDrag}get onDidFocusedNodeChange(){return this.onDidFocusedNodeChangeEmitter.event}get onDidChangeExpansionState(){return this.onDidChangeExpansionStateEmitter.event}get onDidSelectedNodeChange(){return this.onDidSelectedNodeChangeEmitter.event}get extensionTreeHandle(){return this._extensionTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}get contextMenuNode(){return this._contextMenuNode}async initTreeModel(){const c=(await this.treeViewDataProvider.resolveChildren())[0];this._treeModel=this.injector.get(h.ExtensionTreeModel,[c]),this.initDecorations(c),this.disposableCollection.push(this.treeViewDataProvider),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,y=>{this.loadingDecoration.addTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,y=>{this.loadingDecoration.removeTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidChangeExpansionState,(y,b)=>{this.onDidChangeExpansionStateEmitter.fire({treeItemId:y.treeItemId,expanded:b})})),this.disposableCollection.push(this.treeViewDataProvider.onTreeDataChanged(y=>{this.refresh(y)})),this.disposableCollection.push(this.treeViewDataProvider.onRevealChanged(y=>{this.reveal(y)})),this.disposableCollection.push(this.treeViewDataProvider.onRevealChanged(y=>{this.reveal(y)}))}async updateTreeModel(){const c=await this.treeViewDataProvider.resolveChildren()[0];this._treeModel=this.injector.get(h.ExtensionTreeModel,[c])}initDecorations(c){this._decorations=new l.DecorationsManager(c),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.loadingDecoration),this._decorations.addDecoration(this.draggedOverDecoration),this._decorations.addDecoration(this.draggingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration),this.decorations.removeDecoration(this.contextMenuDecoration),this.decorations.removeDecoration(this.loadingDecoration),this.decorations.removeDecoration(this.draggedOverDecoration),this.decorations.removeDecoration(this.draggingDecoration))}handleTreeHandler(c){this._extensionTreeHandle=c,this.treeHandlerReadyDeffer.resolve()}getDragURI(c){return this.treeViewDragAndDropController.handleDrag?c.uri?p.Uri.revive(c.uri).toString():c.treeItemId:null}getDragLabel(c){if(!this.treeViewDragAndDropController.handleDrag)return;if(c.length>1)return String(c.length);const y=c[0];return y.displayName?y.displayName:y.uri?this.labelService.getName(p.URI.from(y.uri)):void 0}handleDragAndLog(c,y,b,A){return c.handleDrag(y,b,A).then(S=>{if(S){const D=[];for(const T of S.entries())T[0]!==this.treeMimeType&&c.dragMimeTypes.findIndex(w=>w===T[0])<0&&D.push(T[0]);D.length&&this.logger.warn(`Drag and drop controller for tree ${this.treeViewId} adds the following data transfer types but does not declare them in dragMimeTypes: ${D.join(", ")}`)}return S})}addExtensionProvidedTransferTypes(c,y){var b;if(!c.dataTransfer||!this.treeViewDragAndDropController)return;const A=(0,p.uuid)();this.dragCancellationToken=new p.CancellationTokenSource,this.treeViewsDragAndDropService.addDragOperationTransfer(A,this.handleDragAndLog(this.treeViewDragAndDropController,y,A,this.dragCancellationToken.token)),this.treeItemsTransfer.setData([new s.DraggedTreeItemsIdentifier(A)],s.DraggedTreeItemsIdentifier.prototype),this.treeViewDragAndDropController.dragMimeTypes.find(S=>S===p.Mimes.uriList)&&((b=c.dataTransfer)===null||b===void 0||b.setData(s.DataTransfers.RESOURCES,"")),this.treeViewDragAndDropController.dragMimeTypes.forEach(S=>{var D;(D=c.dataTransfer)===null||D===void 0||D.setData(S,"")})}addResourceInfoToTransfer(c,y){if(y.length&&c.dataTransfer){const b=y.filter(A=>A.scheme===p.Schemes.file).map(A=>A.fsPath);b.length&&c.dataTransfer.setData(s.CodeDataTransfers.FILES,JSON.stringify(b))}}getCtxMenuNodes(c){return this.getMenuNodes(c)[1]}getMenuNodes(c){const y=this.contextKeyService.createScoped();y.createKey("view",this.treeViewId),y.createKey("viewItem",c);const b=this.menuService.createMenu(v.MenuId.ViewItemContext,y),A=(0,v.generateCtxMenu)({menus:b,separator:"inline"});return b.dispose(),y.dispose(),A}getInlineMenuNodes(c){return this.getMenuNodes(c)[0]}collapseAll(){this.treeModel.root.collapsedAll()}async refreshById(c){const y=this.treeViewDataProvider.getTreeNodeIdByTreeItemId(c);if(!y)return;const b=this.treeModel.root.getTreeNodeById(y);b&&(d.ExtensionCompositeTreeNode.is(b)?await b.refresh():b.parent&&await b.parent.refresh())}async refresh(c){var y;await this.whenReady,c?await this.refreshById(c.id):await((y=this.treeModel.root)===null||y===void 0?void 0:y.refresh())}async reveal(c,y={}){return await this.whenReady,this.revealDelayer.isTriggered()||this.revealDelayer.cancel(),this.revealDelayer.trigger(async()=>{var b;await this.treeHandlerReadyDeffer.promise,this.treeModel.root.branchSize===0&&await this.refresh();const A=this.treeViewDataProvider.getTreeNodeIdByTreeItemId(c);if(!A)return;const S=this.treeModel.root.getTreeNodeById(A);if(!S)return;const D=(0,p.isUndefinedOrNull)(y.select)?!1:y.select,T=(0,p.isUndefinedOrNull)(y.focus)?!1:y.focus;let w=Math.min((0,p.isNumber)(y.expand)?y.expand:y.expand===!0?1:0,3),I=await((b=this.extensionTreeHandle)===null||b===void 0?void 0:b.ensureVisible(S.path));for(I&&(D&&this.selectNodeDecoration(I),T&&this.activeNodeFocusedDecoration(I,!1,!0));d.ExtensionCompositeTreeNode.is(I)&&w>0;w--)await this.extensionTreeHandle.expandNode(I),I=I?.children?I?.children[0]:void 0})}};t.ExtensionTreeViewModel=E,E.DEFAULT_REVEAL_DELAY=500,E.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],E.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(u),r.__metadata("design:type",g.TreeViewDataProvider)],E.prototype,"treeViewDataProvider",void 0),r.__decorate([(0,o.Autowired)(t.ITreeViewDragAndDropController),r.__metadata("design:type",g.TreeViewDragAndDropController)],E.prototype,"treeViewDragAndDropController",void 0),r.__decorate([(0,o.Autowired)(_.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(t.ITreeViewId),r.__metadata("design:type",String)],E.prototype,"treeViewId",void 0),r.__decorate([(0,o.Autowired)(t.ITreeViewBaseOptions),r.__metadata("design:type",Object)],E.prototype,"treeViewOptions",void 0),r.__decorate([(0,o.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],E.prototype,"menuService",void 0),r.__decorate([(0,o.Autowired)(_.IContextKeyService),r.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(_.CommandService),r.__metadata("design:type",Object)],E.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(_.LabelService),r.__metadata("design:type",_.LabelService)],E.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],E.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(t.ITreeViewsService),r.__metadata("design:type",Object)],E.prototype,"treeViewsDragAndDropService",void 0),t.ExtensionTreeViewModel=E=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],E)},72217:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTreeNode=t.ExtensionCompositeTreeNode=t.ExtensionTreeRoot=void 0;const n=e(97267),r=e(43718);class o extends n.CompositeTreeNode{static is(p){return!!p&&"children"in p&&!p.parent}constructor(p,m=""){super(p,void 0),this.treeViewId=m}get treeItemId(){return`TreeViewRoot_${this.treeViewId}`}get name(){return`TreeViewRoot_${this.id}`}get expanded(){return!0}get displayName(){return this._displayName}dispose(){super.dispose()}}t.ExtensionTreeRoot=o;class l extends n.CompositeTreeNode{constructor(p,m,s,g="",a="",h="",d,u="",E="",f,c,y,b,A){super(p,m,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=a,this.contextValue=u,this.treeItemId=E,this.actions=f,this._checkboxInfo=c,this._accessibilityInformation=y,this._resolved=!1,this.isExpanded=b||!1,this.sourceUri=A,this._command=d,this._tooltip=h,(0,r.isString)(s)?this._displayName=s:(0,r.isObject)(s)&&(this._displayName=s.label,this._hightlights=s.highlights,this._strikethrough=s.strikethrough)}get resolved(){return this._resolved}get command(){return this._command}get tooltip(){return this._tooltip}get displayName(){return this._displayName}get checkboxInfo(){return this._checkboxInfo}get accessibilityInformation(){var p,m;return{role:((p=this._accessibilityInformation)===null||p===void 0?void 0:p.role)||"treeitem",label:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.label)||this.displayName}}get strikethrough(){return this._strikethrough}get uri(){return this.sourceUri&&r.Uri.from(this.sourceUri)}get highlights(){return this._hightlights}async resolveTreeItem(){var p;const m=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);m&&(this._tooltip=typeof m.tooltip=="string"?m.tooltip:(p=m.tooltip)===null||p===void 0?void 0:p.value,this._command=m.command),this._resolved=!0}dispose(){super.dispose()}}t.ExtensionCompositeTreeNode=l;class _ extends n.TreeNode{constructor(p,m,s,g="",a="",h,d,u="",E="",f,c,y,b){super(p,m,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=a,this._tooltip=h,this._command=d,this.contextValue=u,this.treeItemId=E,this.actions=f,this._checkboxInfo=c,this._accessibilityInformation=y,this.sourceUri=b,this._resolved=!1,(0,r.isString)(s)?this._displayName=s:(0,r.isObject)(s)&&(this._displayName=s.label,this._hightlights=s.highlights,this._strikethrough=s.strikethrough)}get resolved(){return this._resolved}get command(){return this._command}get uri(){return this.sourceUri&&r.Uri.from(this.sourceUri)}get tooltip(){return this._tooltip}get displayName(){return this._displayName}get checkboxInfo(){return this._checkboxInfo}get accessibilityInformation(){var p,m;return{role:((p=this._accessibilityInformation)===null||p===void 0?void 0:p.role)||"treeitem",label:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.label)||this.displayName}}get strikethrough(){return this._strikethrough}get highlights(){return this._hightlights}async resolveTreeItem(){var p;const m=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);m&&(this._tooltip=typeof m.tooltip=="string"?m.tooltip:(p=m.tooltip)===null||p===void 0?void 0:p.value,this._command=m.command),this._resolved=!0}}t.ExtensionTreeNode=_},38894:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowActivityTimer=void 0;const n=e(41869),r=30,o=1e3;class l extends n.Disposable{constructor(v,p=30,m=1e3){super(),this.window=v,this.activityCount=0,this.maxInactivityCount=r,this.inactivityCheckInterval=o,this.isActive=!0,this.activeStateChangedEmitter=new n.Emitter,this.resetInactivityTimer=()=>{this.activityCount=0,this.setActiveState(!0),this.inactivityCheckTimer||this.startInactivityCheck()},this.checkInactivity=()=>{this.activityCount++,this.activityCount>=this.maxInactivityCount&&(this.setActiveState(!1),this.stopInactivityCheck())},this.maxInactivityCount=p,this.inactivityCheckInterval=m,this.setupActivityListeners()}get onDidChangeActiveState(){return this.activeStateChangedEmitter.event}setActiveState(v){this.isActive!==v&&(this.isActive=v,this.activeStateChangedEmitter.fire(v))}setupActivityListeners(){this.window.addEventListener("mousedown",this.resetInactivityTimer,{passive:!0,capture:!0}),this.window.addEventListener("keydown",this.resetInactivityTimer,{passive:!0,capture:!0}),this.window.addEventListener("touchstart",this.resetInactivityTimer,{passive:!0,capture:!0})}startInactivityCheck(){this.stopInactivityCheck(),this.inactivityCheckTimer=setInterval(()=>{this.checkInactivity()},this.inactivityCheckInterval)}stopInactivityCheck(){this.inactivityCheckTimer&&(clearInterval(this.inactivityCheckTimer),this.inactivityCheckTimer=void 0)}dispose(){this.stopInactivityCheck(),this.activeStateChangedEmitter.dispose(),super.dispose(),this.window.removeEventListener("mousedown",this.resetInactivityTimer,{passive:!0,capture:!0}),this.window.removeEventListener("keydown",this.resetInactivityTimer,{passive:!0,capture:!0}),this.window.removeEventListener("touchstart",this.resetInactivityTimer,{passive:!0,capture:!0})}}t.WindowActivityTimer=l},72980:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SETTINGS_COMMAND_OPEN_SETTINGS_JSON=t.SETTINGS_COMMAND_OPEN_GLOBAL_SETTINGS=t.SETTINGS_COMMAND_OPEN_SETTINGS=t.COPY_RELATIVE_FILE_PATH=t.COPY_FILE_PATH=t.CLEAR_TERMINAL=t.STOP_EXTENSION_HOST_PROFILER=t.START_EXTENSION_HOST_PROFILER=t.SHOW_RUN_TIME_EXTENSION=t.RELOAD_WINDOW=t.RELOAD_WINDOW_COMMAND=t.API_OPEN_WITH_EDITOR_COMMAND_ID=t.API_OPEN_DIFF_EDITOR_COMMAND_ID=t.OPEN_WITH=t.DIFF=t.OPEN_FOLDER=t.API_OPEN_EDITOR_COMMAND_ID=t.OPEN=t.WORKBENCH_FOCUS_ACTIVE_EDITOR_GROUP=t.FILE_COMMAND_RENAME_FILE=t.WORKBENCH_FOCUS_FILES_EXPLORER=t.NEW_WORKBENCH_VIEW_TERMINAL=t.TERMINAL_COMMAND_TOGGLE_VISIBILITY=t.TERMINAL_COMMAND_FOCUS=t.REVERT_FILES=t.OPEN_EDITOR_AT_INDEX=t.CLOSE_UNMODIFIED_EDITORS=t.CLOSE_OTHER_GROUPS=t.EVEN_EDITOR_WIDTH=t.LAST_EDITOR_IN_GROUP=t.NEXT_EDITOR_IN_GROUP=t.PREVIOUS_EDITOR_IN_GROUP=t.PREVIOUS_EDITOR=t.NEXT_EDITOR=t.NAVIGATE_NEXT=t.NAVIGATE_DOWN=t.NAVIGATE_RIGHT=t.NAVIGATE_UP=t.NAVIGATE_LEFT=t.SPLIT_EDITOR_ORTHOGONAL=t.SPLIT_EDITOR=t.FILE_SAVE=t.CLOSE_OTHER_EDITORS=t.CLOSE_ALL_EDITORS=t.NEW_UNTITLED_FILE=t.SPLIT_EDITOR_DOWN=t.SPLIT_EDITOR_RIGHT=t.REVERT_AND_CLOSE_ACTIVE_EDITOR=t.WORKBENCH_CLOSE_ACTIVE_EDITOR=t.SET_CONTEXT=void 0,t.DEBUG_ADD=t.DEBUG_START=t.OPEN_MERGEEDITOR=t.WALKTHROUGHS_COMMAND_GET_STARTED=t.LAYOUT_COMMAND_MAXIMIZE_EDITOR=t.THEME_COMMAND_QUICK_SELECT=t.SEARCH_COMMAND_OPEN_SEARCH=t.SIDEBAR_TOGGLE_VISIBILITY=t.MARKER_COMMAND_TOGGLE_SHOW_ERRORS_WARNINGS=t.MARKER_COMMAND_SHOW_ERRORS_WARNINGS=t.GET_EXTENSION=t.REVEAL_IN_EXPLORER=t.EDITOR_SHOW_ALL_SYMBOLS=t.DEBUG_COMMAND_STOP=t.DEBUG_COMMAND_RESTART=t.DEBUG_COMMAND_PAUSE=t.DEBUG_COMMAND_START=t.DEBUG_COMMAND_RUN=t.DEBUG_COMMAND_CONTINUE=t.DEBUG_COMMAND_STEP_OUT=t.DEBUG_COMMAND_STEP_OVER=t.DEBUG_COMMAND_STEP_INTO=t.EDITOR_SAVE_ALL=t.EDITOR_NAVIGATE_FORWARD=t.EDITOR_NAVIGATE_BACK=t.SETTINGS_COMMAND_OPEN_GLOBAL_OPEN_KEYMAPS=void 0;const n=e(41869),r=e(66482),o=e(12456);t.SET_CONTEXT={id:"setContext"},t.WORKBENCH_CLOSE_ACTIVE_EDITOR={id:"workbench.action.closeActiveEditor",delegate:n.EDITOR_COMMANDS.CLOSE.id},t.REVERT_AND_CLOSE_ACTIVE_EDITOR={id:"workbench.action.revertAndCloseActiveEditor",delegate:n.EDITOR_COMMANDS.REVERT_AND_CLOSE.id},t.SPLIT_EDITOR_RIGHT={id:"workbench.action.splitEditorRight",delegate:n.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id},t.SPLIT_EDITOR_DOWN={id:"workbench.action.splitEditorDown",delegate:n.EDITOR_COMMANDS.SPLIT_TO_BOTTOM.id},t.NEW_UNTITLED_FILE={id:"workbench.action.files.newUntitledFile",delegate:n.EDITOR_COMMANDS.NEW_UNTITLED_FILE.id},t.CLOSE_ALL_EDITORS={id:"workbench.action.closeAllEditors",delegate:n.EDITOR_COMMANDS.CLOSE_ALL_IN_GROUP.id},t.CLOSE_OTHER_EDITORS={id:"workbench.action.closeOtherEditors",delegate:n.EDITOR_COMMANDS.CLOSE_OTHER_IN_GROUP.id},t.FILE_SAVE={id:"workbench.action.files.save",delegate:n.EDITOR_COMMANDS.SAVE_CURRENT.id},t.SPLIT_EDITOR={id:"workbench.action.splitEditor",delegate:n.EDITOR_COMMANDS.SPLIT_TO_RIGHT.id},t.SPLIT_EDITOR_ORTHOGONAL={id:"workbench.action.splitEditorOrthogonal",delegate:n.EDITOR_COMMANDS.SPLIT_TO_BOTTOM.id},t.NAVIGATE_LEFT={id:"workbench.action.navigateLeft",delegate:n.EDITOR_COMMANDS.NAVIGATE_LEFT.id},t.NAVIGATE_UP={id:"workbench.action.navigateUp",delegate:n.EDITOR_COMMANDS.NAVIGATE_UP.id},t.NAVIGATE_RIGHT={id:"workbench.action.navigateRight",delegate:n.EDITOR_COMMANDS.NAVIGATE_RIGHT.id},t.NAVIGATE_DOWN={id:"workbench.action.navigateDown",delegate:n.EDITOR_COMMANDS.NAVIGATE_DOWN.id},t.NAVIGATE_NEXT={id:"workbench.action.navigateEditorGroups",delegate:n.EDITOR_COMMANDS.NAVIGATE_NEXT.id},t.NEXT_EDITOR={id:"workbench.action.nextEditor",delegate:n.EDITOR_COMMANDS.NEXT.id},t.PREVIOUS_EDITOR={id:"workbench.action.previousEditor",delegate:n.EDITOR_COMMANDS.PREVIOUS.id},t.PREVIOUS_EDITOR_IN_GROUP={id:"workbench.action.previousEditorInGroup",delegate:n.EDITOR_COMMANDS.PREVIOUS_IN_GROUP.id},t.NEXT_EDITOR_IN_GROUP={id:"workbench.action.nextEditorInGroup",delegate:n.EDITOR_COMMANDS.NEXT_IN_GROUP.id},t.LAST_EDITOR_IN_GROUP={id:"workbench.action.lastEditorInGroup",delegate:n.EDITOR_COMMANDS.LAST_IN_GROUP.id},t.EVEN_EDITOR_WIDTH={id:"workbench.action.eventEditorWidths",delegate:n.EDITOR_COMMANDS.EVEN_EDITOR_GROUPS.id},t.CLOSE_OTHER_GROUPS={id:"workbench.action.closeEditorsInOtherGroups",delegate:n.EDITOR_COMMANDS.CLOSE_OTHER_GROUPS.id},t.CLOSE_UNMODIFIED_EDITORS={id:"workbench.action.closeUnmodifiedEditors",delegate:n.EDITOR_COMMANDS.CLOSE_SAVED.id},t.OPEN_EDITOR_AT_INDEX={id:"workbench.action.openEditorAtIndex",delegate:n.EDITOR_COMMANDS.OPEN_EDITOR_AT_INDEX.id},t.REVERT_FILES={id:"workbench.action.files.revert",delegate:n.EDITOR_COMMANDS.REVERT_DOCUMENT.id},t.TERMINAL_COMMAND_FOCUS={id:"workbench.action.terminal.focus",delegate:"workbench.view.terminal"},t.TERMINAL_COMMAND_TOGGLE_VISIBILITY={id:"workbench.action.terminal.toggleTerminal",delegate:"container.toggle.terminal"},t.NEW_WORKBENCH_VIEW_TERMINAL={id:"workbench.action.terminal.new",delegate:n.TERMINAL_COMMANDS.ADD.id},t.WORKBENCH_FOCUS_FILES_EXPLORER={id:"workbench.files.action.focusFilesExplorer",delegate:n.FILE_COMMANDS.FOCUS_FILES.id},t.FILE_COMMAND_RENAME_FILE={id:"renameFile",delegate:n.FILE_COMMANDS.RENAME_FILE.id},t.WORKBENCH_FOCUS_ACTIVE_EDITOR_GROUP={id:"workbench.action.focusActiveEditorGroup",delegate:n.EDITOR_COMMANDS.FOCUS_ACTIVE_EDITOR_GROUP.id},t.OPEN={id:"vscode.open"},t.API_OPEN_EDITOR_COMMAND_ID={id:n.EDITOR_COMMANDS.API_OPEN_EDITOR_COMMAND_ID,delegate:t.OPEN.id},t.OPEN_FOLDER={id:"vscode.openFolder",delegate:n.FILE_COMMANDS.VSCODE_OPEN_FOLDER.id},t.DIFF={id:"vscode.diff"},t.OPEN_WITH={id:"vscode.openWith"},t.API_OPEN_DIFF_EDITOR_COMMAND_ID={id:n.EDITOR_COMMANDS.API_OPEN_DIFF_EDITOR_COMMAND_ID,delegate:t.DIFF.id},t.API_OPEN_WITH_EDITOR_COMMAND_ID={id:n.EDITOR_COMMANDS.API_OPEN_WITH_EDITOR_COMMAND_ID,delegate:t.OPEN_WITH.id},t.RELOAD_WINDOW_COMMAND={id:"reload_window"},t.RELOAD_WINDOW={id:"workbench.action.reloadWindow",delegate:t.RELOAD_WINDOW_COMMAND.id},t.SHOW_RUN_TIME_EXTENSION={id:"workbench.action.showRuntimeExtensions",label:"Show Running Extensions"},t.START_EXTENSION_HOST_PROFILER={id:"workbench.action.extensionHostProfiler.start",label:"Start Extension Host Profile"},t.STOP_EXTENSION_HOST_PROFILER={id:"workbench.action.extensionHostProfiler.stop",label:"Stop Extension Host Profile"},t.CLEAR_TERMINAL={id:"workbench.action.terminal.clear",delegate:n.TERMINAL_COMMANDS.CLEAR_CONTENT.id},t.COPY_FILE_PATH={id:"copyFilePath",label:n.FILE_COMMANDS.COPY_PATH.label},t.COPY_RELATIVE_FILE_PATH={id:"copyRelativeFilePath",label:n.FILE_COMMANDS.COPY_RELATIVE_PATH.label},t.SETTINGS_COMMAND_OPEN_SETTINGS={id:"workbench.action.openSettings",delegate:"core.openpreference"},t.SETTINGS_COMMAND_OPEN_GLOBAL_SETTINGS={id:"workbench.action.openGlobalSettings",delegate:n.COMMON_COMMANDS.OPEN_PREFERENCES.id},t.SETTINGS_COMMAND_OPEN_SETTINGS_JSON={id:"workbench.action.openSettingsJson",delegate:"preference.open.source"},t.SETTINGS_COMMAND_OPEN_GLOBAL_OPEN_KEYMAPS={id:"workbench.action.openGlobalKeybindings",delegate:n.COMMON_COMMANDS.OPEN_KEYMAPS.id},t.EDITOR_NAVIGATE_BACK={id:"workbench.action.navigateBack",delegate:n.EDITOR_COMMANDS.GO_BACK.id},t.EDITOR_NAVIGATE_FORWARD={id:"workbench.action.navigateForward",delegate:n.EDITOR_COMMANDS.GO_FORWARD.id},t.EDITOR_SAVE_ALL={id:"workbench.action.files.saveAll",delegate:n.EDITOR_COMMANDS.SAVE_ALL.id},t.DEBUG_COMMAND_STEP_INTO={id:"workbench.action.debug.stepInto",delegate:r.DEBUG_COMMANDS.NEXT.id},t.DEBUG_COMMAND_STEP_OVER={id:"workbench.action.debug.stepOver",delegate:r.DEBUG_COMMANDS.OVER.id},t.DEBUG_COMMAND_STEP_OUT={id:"workbench.action.debug.stepOut",delegate:r.DEBUG_COMMANDS.PREV.id},t.DEBUG_COMMAND_CONTINUE={id:"workbench.action.debug.continue",delegate:r.DEBUG_COMMANDS.CONTINUE.id},t.DEBUG_COMMAND_RUN={id:"workbench.action.debug.run",delegate:r.DEBUG_COMMANDS.START.id},t.DEBUG_COMMAND_START={id:"workbench.action.debug.start",delegate:r.DEBUG_COMMANDS.START.id},t.DEBUG_COMMAND_PAUSE={id:"workbench.action.debug.pause",delegate:r.DEBUG_COMMANDS.PAUSE.id},t.DEBUG_COMMAND_RESTART={id:"workbench.action.debug.restart",delegate:r.DEBUG_COMMANDS.RESTART.id},t.DEBUG_COMMAND_STOP={id:"workbench.action.debug.stop",delegate:r.DEBUG_COMMANDS.STOP.id},t.EDITOR_SHOW_ALL_SYMBOLS={id:"workbench.action.showAllSymbols",delegate:n.EDITOR_COMMANDS.SEARCH_WORKSPACE_SYMBOL.id},t.REVEAL_IN_EXPLORER={id:"revealInExplorer",delegate:n.FILE_COMMANDS.REVEAL_IN_EXPLORER.id},t.GET_EXTENSION={id:"extension.getDescription"},t.MARKER_COMMAND_SHOW_ERRORS_WARNINGS={id:"workbench.action.showErrorsWarnings",delegate:n.MARKER_COMMANDS.SHOW_ERRORS_WARNINGS.id},t.MARKER_COMMAND_TOGGLE_SHOW_ERRORS_WARNINGS={id:"workbench.actions.view.problems",delegate:n.MARKER_COMMANDS.TOGGLE_SHOW_ERRORS_WARNINGS.id},t.SIDEBAR_TOGGLE_VISIBILITY={id:"workbench.action.toggleSidebarVisibility",delegate:n.LAYOUT_COMMANDS.TOGGLE_SIDEBAR_VISIBILITY.id},t.SEARCH_COMMAND_OPEN_SEARCH={id:"workbench.action.findInFiles",delegate:n.SEARCH_COMMANDS.OPEN_SEARCH.id},t.THEME_COMMAND_QUICK_SELECT={id:"workbench.action.selectTheme",delegate:o.THEME_TOGGLE_COMMAND.id},t.LAYOUT_COMMAND_MAXIMIZE_EDITOR={id:"workbench.action.maximizeEditor",delegate:n.LAYOUT_COMMANDS.MAXIMIZE_EDITOR.id},t.WALKTHROUGHS_COMMAND_GET_STARTED={id:"walkthroughs.get.started"},t.OPEN_MERGEEDITOR={id:"_open.mergeEditor",delegate:n.EDITOR_COMMANDS.OPEN_MERGEEDITOR.id,label:"Open Merge Editor"},t.DEBUG_START={id:"workbench.action.debug.selectandstart",delegate:"debug.start"},t.DEBUG_ADD={id:"debug.addConfiguration",delegate:"debug.showAllAutomaticDebugConfigurations"}},3098:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(77666),_=e(99220);let v=class extends _.VSCodeContributePoint{contribute(){const m=this;for(const s of this.contributesMap){const{extensionId:g,contributes:a}=s,h=[];for(const d of a){const{title:u,description:E}=d;switch(d.type){case"action":h.push({title:u,description:E,iconClass:(0,o.getIcon)(d.icon),click:()=>{d.command&&m.commandService.executeCommand(d.command)},type:d.type});break;case"enum":h.push({type:d.type,title:u,description:E,select:f=>{d.command&&m.commandService.executeCommand(d.command,f)},enum:d.enum,defaultValue:d.defaultValue});break}}this.addDispose(this.toolbarActionService.registryActionGroup(g,h))}}dispose(){super.dispose()}};t.ActionsContributionPoint=v,n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],v.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.IToolbarActionService),n.__metadata("design:type",Object)],v.prototype,"toolbarActionService",void 0),t.ActionsContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("actions"),(0,_.LifeCycle)(3)],v)},57541:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(37499),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){for(const p of this.contributesMap){const{contributes:m}=p;m.forEach(s=>{this.debugConfigurationManager.addSupportBreakpoints(s.language)})}}unregister(p){p.forEach(m=>{this.debugConfigurationManager.removeSupportBreakpoints(m.language)})}dispose(){for(const p of this.contributesMap){const{contributes:m}=p;this.unregister(m)}}};t.BreakpointsContributionPoint=_,n.__decorate([(0,r.Autowired)(o.DebugConfigurationManager),n.__metadata("design:type",o.DebugConfigurationManager)],_.prototype,"debugConfigurationManager",void 0),t.BreakpointsContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("breakpoints"),(0,l.LifeCycle)(3)],_)},37614:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(52416),_=e(99220),v="^\\w+[.\\w+]*$";let p=class extends _.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{contributes:g}=s;for(const a of g)a&&a.description&&(a.description=(0,o.replaceLocalizePlaceholder)(a.description)),this.themeService.registerColor(a)}}};t.ColorsContributionPoint=p,p.schema={description:(0,o.localize)("contributes.color","Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:(0,o.localize)("contributes.color.id","The identifier of the themable color"),pattern:v,patternErrorMessage:(0,o.localize)("contributes.color.id.format","Identifiers should be in the form aa[.bb]*")},description:{type:"string",description:(0,o.localize)("contributes.color.description","The description of the themable color")},defaults:{type:"object",properties:{light:{description:(0,o.localize)("contributes.defaults.light","The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[{type:"string",format:"color-hex"}]},dark:{description:(0,o.localize)("contributes.defaults.dark","The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default."),type:"string",anyOf:[{type:"string",format:"color-hex"}]},highContrast:{description:(0,o.localize)("contributes.defaults.highContrast","The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes."),type:"string",anyOf:[{type:"string",format:"color-hex"}]},highContrastLight:{description:(0,o.localize)("contributes.defaults.highContrastLight","The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes."),type:"string",anyOf:[{type:"string",format:"color-hex"}]}}}}}},n.__decorate([(0,r.Autowired)(l.IThemeService),n.__metadata("design:type",Object)],p.prototype,"themeService",void 0),t.ColorsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("colors"),(0,_.LifeCycle)(4)],p)},8079:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(52416),_=e(99220),v=e(71354);let p=class extends _.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:a}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&a.forEach(d=>{this.addDispose(this.commandRegistry.registerCommand({category:this.getLocalizeFromNlsJSON(d.category,g),label:this.getLocalizeFromNlsJSON(d.title,g),shortLabel:d.shortTitle?this.getLocalizeFromNlsJSON(d.shortTitle,g):void 0,categoryLocalized:this.createLocalizedStr(d.category,g),labelLocalized:this.createLocalizedStr(d.title,g),shortLabelLocalized:d.shortTitle?this.createLocalizedStr(d.shortTitle,g):void 0,id:d.command,iconClass:typeof d.icon=="string"&&this.iconService.fromString(d.icon)||this.iconService.fromIcon(h.path,d.icon,l.IconType.Background),enablement:d.enablement},{execute:(...u)=>this.extensionService.executeExtensionCommand(d.command,u)})),this.config.noExtHost?this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(d.command,"worker")):this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(d.command,"node"))})}}};t.CommandsContributionPoint=p,n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],p.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ExtensionService),n.__metadata("design:type",_.ExtensionService)],p.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(_.IExtCommandManagement),n.__metadata("design:type",_.IExtCommandManagement)],p.prototype,"extensionCommandManager",void 0),n.__decorate([(0,r.Autowired)(l.IIconService),n.__metadata("design:type",Object)],p.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],p.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],p.prototype,"extensionManageService",void 0),t.CommandsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("commands"),(0,_.LifeCycle)(3)],p)},6143:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(99220),v=e(71354),p=e(25588);let m=class extends _.VSCodeContributePoint{async contribute(){if(this.localizationsContributionPoint.hasUncontributedPoint())try{await this.localizationsContributionPoint.whenContributed}catch(g){this.logger.error("Failed to wait contribute localizations.",g)}for(const g of this.contributesMap){const{extensionId:a,contributes:h}=g,d=this.extensionManageService.getExtensionInstanceByExtId(a);if(!d)continue;let u=h;Array.isArray(u)||(u=[u]);const E=[];for(const f of u)if(f&&f.properties){const c={};for(const y of Object.keys(f.properties)){const b=f.properties[y];c[y]=b,b.description&&(c[y].description=this.getLocalizeFromNlsJSON(b.description,a)),b.enumDescriptions&&(c[y].enumDescriptions=b.enumDescriptions.map(A=>this.getLocalizeFromNlsJSON(A,a))),b.markdownDescription&&(c[y].markdownDescription=this.getLocalizeFromNlsJSON(b.markdownDescription,a))}f.properties=c,f.title=this.getLocalizeFromNlsJSON(f.title,a)||f.title,this.updateConfigurationSchema(f),E.push({title:f.title,extensionId:a,preferences:Object.keys(f.properties).map(y=>({id:y}))})}if(E.length===1){const f=E[0];this.addDispose(this.preferenceSettingsService.registerSettingSection("extension",f))}else E.length>1&&this.addDispose(this.preferenceSettingsService.registerSettingSection("extension",{title:this.getLocalizeFromNlsJSON(d.packageJSON.displayName,a)||d.packageJSON.displayName,subSections:E}))}}updateConfigurationSchema(g){this.validateConfigurationSchema(g),this.addDispose(this.preferenceSchemaProvider.setSchema(g))}validateConfigurationSchema(g){for(const a in g.properties){const h=g.properties[a];if(h.type==="string[]"&&(h.type="array"),h.type!=="object")continue;typeof h.default>"u"&&this.validateDefaultValue(h);const d=h.properties;if(d)for(const u in d)typeof d[u]!="object"&&delete d[u]}}validateDefaultValue(g){g.default={};const a=g.properties;if(a)for(const h in a)a[h].default&&(g.default[h]=a[h].default,delete a[h].default)}};t.ConfigurationContributionPoint=m,n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],m.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],m.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(p.LocalizationsContributionPoint),n.__metadata("design:type",p.LocalizationsContributionPoint)],m.prototype,"localizationsContributionPoint",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.ConfigurationContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("configuration"),(0,_.LifeCycle)(2)],m)},4653:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationDefaultsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(99220);let _=class extends l.VSCodeContributePoint{contribute(){for(const p of this.contributesMap){const{contributes:m}=p;m&&this.updateDefaultOverridesSchema(m)}}updateDefaultOverridesSchema(p){for(const m in p){const s=p[m];if(o.OVERRIDE_PROPERTY_PATTERN.test(m)){const g=m.match(o.OVERRIDE_PROPERTY_PATTERN)[1];Object.keys(s).forEach(a=>{this.defaultPreferenceProvider.setPreference(a,s[a],void 0,g)})}}}};t.ConfigurationDefaultsContributionPoint=_,n.__decorate([(0,r.Autowired)(o.PreferenceProvider,{tag:o.PreferenceScope.Default}),n.__metadata("design:type",o.PreferenceProvider)],_.prototype,"defaultPreferenceProvider",void 0),t.ConfigurationDefaultsContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("configurationDefaults"),(0,l.LifeCycle)(3)],_)},21086:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomEditorContributionPoint=void 0,t.createCustomEditorComponent=d;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(41869),_=e(43718),v=e(57517),p=e(65046),m=e(50234),s=e(99220),g=e(35912),a=e(71354);let h=class extends s.VSCodeContributePoint{constructor(){super(...arguments),this.options=new Map}contribute(){for(const E of this.contributesMap){const{extensionId:f,contributes:c}=E;c.forEach(y=>{this.registerSingleCustomEditor(y,f)}),this.addDispose(this.eventBus.on(g.CustomEditorOptionChangeEvent,y=>{this.options.has(y.payload.viewType)&&this.options.set(y.payload.viewType,y.payload.options)}))}}getOptions(E){return this.options.get(E)||{}}registerSingleCustomEditor(E,f){try{const c=E.viewType;this.options.set(E.viewType,{});const y=`${_.CUSTOM_EDITOR_SCHEME}-${E.viewType}`,b=d(E.viewType,y,()=>this.getOptions(E.viewType)),A=E.selector.map(D=>D.filenamePattern).filter(D=>typeof D=="string");if(A.length===0)return;const S=E.priority||v.IEditorPriority.default;this.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(()=>10,(D,T)=>{for(const w of A)((0,_.match)(w,D.uri.path.toString().toLowerCase())||(0,_.match)(w,D.uri.path.base.toLowerCase()))&&T.push({componentId:y,type:v.EditorOpenType.component,title:E.displayName?this.getLocalizeFromNlsJSON(E.displayName,f):E.viewType,weight:S===v.IEditorPriority.default?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,priority:S,saveResource:I=>this.eventBus.fireAndAwait(new g.CustomEditorShouldSaveEvent({uri:I.uri,viewType:c,cancellationToken:new _.CancellationTokenSource().token})),revertResource:I=>this.eventBus.fireAndAwait(new g.CustomEditorShouldRevertEvent({uri:I.uri,viewType:c,cancellationToken:new _.CancellationTokenSource().token})),undo:I=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:I.uri,viewType:c,type:"undo"})),redo:I=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:I.uri,viewType:c,type:"redo"}))})})),this.addDispose(this.editorComponentRegistry.registerEditorComponent({uid:y,component:b,metadata:{customEditor:c}}))}catch(c){this.logger.error(c)}}};t.CustomEditorContributionPoint=h,n.__decorate([(0,o.Autowired)(v.EditorComponentRegistry),n.__metadata("design:type",v.EditorComponentRegistry)],h.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,o.Autowired)(_.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(l.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),t.CustomEditorContributionPoint=h=n.__decorate([(0,o.Injectable)(),(0,s.Contributes)("customEditors"),(0,s.LifeCycle)(2)],h);function d(u,E,f){return({resource:c})=>{const y=(0,l.useInjectable)(a.IActivationEventService),b=(0,l.useInjectable)(p.IWebviewService),A=(0,l.useInjectable)(l.IEventBus),S=(0,l.useInjectable)(s.ExtensionService);let D=null;return r.default.useEffect(()=>{const T=new _.CancellationTokenSource,w=new _.Disposable;return Promise.all([y.fireEvent("onCustomEditor",u),S.eagerExtensionsActivated.promise]).then(()=>{if(T.token.isCancellationRequested)return;const I=b.createWebview(f().webviewOptions);if(I&&D){const R=new m.WebviewMounter(I,D,document.getElementById("workbench-editor"),document.getElementById("workbench-editor"));I.onRemove(()=>{R.dispose()}),w.addDispose({dispose:()=>{I.remove(),I.dispose(),A.fire(new g.CustomEditorShouldHideEvent({uri:c.uri,viewType:u}))}}),A.fire(new g.CustomEditorShouldDisplayEvent({uri:c.uri,viewType:u,webviewPanelId:I.id,cancellationToken:T.token,openTypeId:E}))}}),()=>{w.dispose(),T.cancel()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"editor-webview-webview-component",ref:T=>D=T})}}},61361:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggersContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),_=e(66482),v=e(37499),p=e(69946),m=e(99220),s=e(71354),{deepClone:g}=l.objects,a={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,l.localize)("preference.debug.internalConsoleOptions")};let h=class extends m.VSCodeContributePoint{contribute(){for(const u of this.contributesMap){const{extensionId:E,contributes:f}=u,c=this.extensionManageService.getExtensionInstanceByExtId(E);c&&this.debugService.registerDebugContributionPoints(c.path,this.resolveDebuggers(f,c))}this.debugSchemaManager.update()}resolveDebuggers(u,E){return u.map(f=>{const c=this.doResolveDebuggers(f,E);return this.debugConfigurationManager.registerDebugger(c),c})}doResolveDebuggers(u,E){const f={type:u.type,label:u.label?(0,o.replaceLocalizePlaceholder)(u.label,E.id):"",languages:u.languages,enableBreakpointsFor:u.enableBreakpointsFor,variables:u.variables,adapterExecutableCommand:u.adapterExecutableCommand,configurationSnippets:(u.configurationSnippets||[]).map(c=>(c.label&&(c.label=(0,o.replaceLocalizePlaceholder)(c.label,E.id)),c.description&&(c.description=(0,o.replaceLocalizePlaceholder)(c.description,E.id)),c.markdownDescription&&(c.markdownDescription=(0,o.replaceLocalizePlaceholder)(c.markdownDescription,E.id)),c)),win:u.win,winx86:u.winx86,windows:u.windows,osx:u.osx,linux:u.linux,program:u.program,args:u.args,runtime:u.runtime,runtimeArgs:u.runtimeArgs};return f.configurationAttributes=u.configurationAttributes&&this.resolveSchemaAttributes(u.type,u.configurationAttributes,E),f}resolveSchemaAttributes(u,E,f){const c={},y=b=>{Object.keys(b).forEach(A=>{b[A].properties&&y(b[A].properties),typeof b[A]=="object"&&(b[A].description=(0,o.replaceLocalizePlaceholder)(b[A].description,f.id),b[A].markdownDescription=(0,o.replaceLocalizePlaceholder)(b[A].markdownDescription,f.id))})};return Object.keys(E).map(b=>{const A=g(E[b]),S=["name","type","request"];A.required=A.required&&A.required.length?S.concat(A.required):S,A.additionalProperties=!1,A.type="object",A.properties||(A.properties={});const D=A.properties;D.type={enum:[u],description:(0,l.localize)("debug.launch.configurations.debugType"),pattern:"^(?!node2)",errorMessage:(0,l.localize)("debug.launch.configurations.debugTypeNotRecognised"),patternErrorMessage:(0,l.localize)("debug.launch.configurations.node2NotSupported")},D.name={type:"string",description:(0,l.localize)("debug.launch.configurations.debugName"),default:"Launch"},D.request={enum:[b],description:(0,l.localize)("debug.launch.configurations.debugRequest")},D.debugServer={type:"number",description:(0,l.localize)("debug.launch.configurations.debugServer"),default:4711},D.preLaunchTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,l.localize)("debug.launch.configurations.debugPrelaunchTask")},D.postDebugTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,l.localize)("debug.launch.configurations.debugPostDebugTask")},D.internalConsoleOptions=a;const T=Object.assign({},D);return D.windows={type:"object",description:(0,l.localize)("debug.launch.configurations.debugWindowsConfiguration"),properties:T},D.osx={type:"object",description:(0,l.localize)("debug.launch.configurations.debugOSXConfiguration"),properties:T},D.linux={type:"object",description:(0,l.localize)("debug.launch.configurations.debugLinuxConfiguration"),properties:T},Object.keys(A.properties).forEach(w=>{A.properties[w].pattern=A.properties[w].pattern||"^(?!.*\\$\\{(env|config|command)\\.)",A.properties[w].patternErrorMessage=A.properties[w].patternErrorMessage||(0,l.localize)("deprecatedVariables","'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.")}),y(A.properties),A})}dispose(){for(const u of this.contributesMap){const{extensionId:E}=u,f=this.extensionManageService.getExtensionInstanceByExtId(E);f&&this.debugService.unregisterDebugContributionPoints(f.path)}}};t.DebuggersContributionPoint=h,h.schema={description:(0,l.localize)("vscode.extension.contributes.debuggers","Contributes debug adapters."),type:"array",defaultSnippets:[{body:[{type:""}]}],items:{additionalProperties:!1,type:"object",defaultSnippets:[{body:{type:"",program:"",runtime:""}}],properties:{type:{description:(0,l.localize)("vscode.extension.contributes.debuggers.type","Unique identifier for this debug adapter."),type:"string"},label:{description:(0,l.localize)("vscode.extension.contributes.debuggers.label","Display name for this debug adapter."),type:"string"},program:{description:(0,l.localize)("vscode.extension.contributes.debuggers.program","Path to the debug adapter program. Path is either absolute or relative to the extension folder."),type:"string"},args:{description:(0,l.localize)("vscode.extension.contributes.debuggers.args","Optional arguments to pass to the adapter."),type:"array"},runtime:{description:(0,l.localize)("vscode.extension.contributes.debuggers.runtime","Optional runtime in case the program attribute is not an executable but requires a runtime."),type:"string"},runtimeArgs:{description:(0,l.localize)("vscode.extension.contributes.debuggers.runtimeArgs","Optional runtime arguments."),type:"array"},variables:{description:(0,l.localize)("vscode.extension.contributes.debuggers.variables","Mapping from interactive variables (e.g. ${action.pickProcess}) in `launch.json` to a command."),type:"object"},initialConfigurations:{description:(0,l.localize)("vscode.extension.contributes.debuggers.initialConfigurations","Configurations for generating the initial 'launch.json'."),type:["array","string"]},languages:{description:(0,l.localize)("vscode.extension.contributes.debuggers.languages",'List of languages for which the debug extension could be considered the "default debugger".'),type:"array"},configurationSnippets:{description:(0,l.localize)("vscode.extension.contributes.debuggers.configurationSnippets","Snippets for adding new configurations in 'launch.json'."),type:"array"},configurationAttributes:{description:(0,l.localize)("vscode.extension.contributes.debuggers.configurationAttributes","JSON schema configurations for validating 'launch.json'."),type:"object"},when:{description:(0,l.localize)("vscode.extension.contributes.debuggers.when","Condition which must be true to enable this type of debugger. Consider using 'shellExecutionSupported', 'virtualWorkspace', 'resourceScheme' or an extension-defined context key as appropriate for this."),type:"string",default:""},windows:{description:(0,l.localize)("vscode.extension.contributes.debuggers.windows","Windows specific settings."),type:"object",properties:{runtime:{description:(0,l.localize)("vscode.extension.contributes.debuggers.windows.runtime","Runtime used for Windows."),type:"string"}}},osx:{description:(0,l.localize)("vscode.extension.contributes.debuggers.osx","macOS specific settings."),type:"object",properties:{runtime:{description:(0,l.localize)("vscode.extension.contributes.debuggers.osx.runtime","Runtime used for macOS."),type:"string"}}},linux:{description:(0,l.localize)("vscode.extension.contributes.debuggers.linux","Linux specific settings."),type:"object",properties:{runtime:{description:(0,l.localize)("vscode.extension.contributes.debuggers.linux.runtime","Runtime used for Linux."),type:"string"}}}}}},n.__decorate([(0,r.Autowired)(_.IDebugService),n.__metadata("design:type",Object)],h.prototype,"debugService",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],h.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(p.DebugSchemaManager),n.__metadata("design:type",p.DebugSchemaManager)],h.prototype,"debugSchemaManager",void 0),n.__decorate([(0,r.Autowired)(s.AbstractExtInstanceManagementService),n.__metadata("design:type",s.AbstractExtInstanceManagementService)],h.prototype,"extensionManageService",void 0),t.DebuggersContributionPoint=h=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("debuggers"),(0,m.LifeCycle)(4)],h)},60768:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrammarsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(62660),_=e(99220),v=e(71354);let p=class extends _.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:a}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);if(h)for(const d of a)this.textMateService.registerGrammar(d,o.URI.from(h.uri)),this.addDispose(o.Disposable.create(()=>{this.textMateService.unregisterGrammar(d)}))}}};t.GrammarsContributionPoint=p,p.schema={description:(0,o.localize)("vscode.extension.contributes.grammars","Contributes textmate tokenizers."),type:"array",defaultSnippets:[{body:[{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}}],properties:{language:{description:(0,o.localize)("vscode.extension.contributes.grammars.language","Language identifier for which this syntax is contributed to."),type:"string"},scopeName:{description:(0,o.localize)("vscode.extension.contributes.grammars.scopeName","Textmate scope name used by the tmLanguage file."),type:"string"},path:{description:(0,o.localize)("vscode.extension.contributes.grammars.path","Path of the tmLanguage file. The path is relative to the extension folder and typically starts with './syntaxes/'."),type:"string"},embeddedLanguages:{description:(0,o.localize)("vscode.extension.contributes.grammars.embeddedLanguages","A map of scope name to language id if this grammar contains embedded languages."),type:"object"},tokenTypes:{description:(0,o.localize)("vscode.extension.contributes.grammars.tokenTypes","A map of scope name to token types."),type:"object",additionalProperties:{enum:["string","comment","other"]}},injectTo:{description:(0,o.localize)("vscode.extension.contributes.grammars.injectTo","List of language scope names to which this grammar is injected to."),type:"array",items:{type:"string"}}},required:["scopeName","path"]}},n.__decorate([(0,r.Autowired)(l.ITextmateTokenizer),n.__metadata("design:type",Object)],p.prototype,"textMateService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],p.prototype,"extensionManageService",void 0),t.GrammarsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("grammars"),(0,_.LifeCycle)(2)],p)},43988:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconsContributionPoint=t.IconThemesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(32242),l=e(43718),_=e(52416),v=e(38667),p=e(99220),m=e(71354);let s=class extends p.VSCodeContributePoint{contribute(){for(const d of this.contributesMap){const{extensionId:u,contributes:E}=d,f=E.map(y=>({...y,label:this.getLocalizeFromNlsJSON(y.label,u),extensionId:u})),c=this.extensionManageService.getExtensionInstanceByExtId(u);c&&this.iconService.registerIconThemes(f,l.URI.from(c.uri))}}};t.IconThemesContributionPoint=s,n.__decorate([(0,r.Autowired)(_.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],s.prototype,"extensionManageService",void 0),t.IconThemesContributionPoint=s=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("iconThemes"),(0,p.LifeCycle)(2)],s);const g={ttf:"truetype",woff:"woff",woff2:"woff2"};let a=class extends p.VSCodeContributePoint{constructor(){super(...arguments),this.iconRegistry=(0,v.getIconRegistry)()}contribute(){for(const{extensionId:d,contributes:u}of this.contributesMap)Object.keys(u).forEach(E=>{const f=u[E],c=this.extensionManageService.getExtensionInstanceByExtId(d);if(c){const y=f.default;if(typeof y=="string")this.iconRegistry.registerIcon(E,{id:y},f.description);else if(typeof y=="object"&&typeof y.fontPath=="string"&&typeof y.fontCharacter=="string"){const b=l.URI.from(c.uri).resolve(f.default.fontPath),A=l.path.extname(y.fontPath).substring(1),S=g[A];if(!S){this.logger.warn((0,l.localize)("invalid.icons.default.fontPath.extension",`Expected \`contributes.icons.default.fontPath\` to have file extension 'woff', woff2' or 'ttf', is '${A}'.`));return}const D=l.path.join(d,y.fontPath),T=this.iconRegistry.registerIconFont(D,{src:[{location:this.staticResourceService.resolveStaticResource(b),format:S}]});this.iconRegistry.registerIcon(E,{fontCharacter:y.fontCharacter,font:{id:D,definition:T}},f.description)}}});this.productIconService.updateProductIconThemes()}};t.IconsContributionPoint=a,n.__decorate([(0,r.Autowired)(m.AbstractExtInstanceManagementService),n.__metadata("design:type",m.AbstractExtInstanceManagementService)],a.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(_.IProductIconService),n.__metadata("design:type",Object)],a.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",o.StaticResourceService)],a.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],a.prototype,"logger",void 0),t.IconsContributionPoint=a=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("icons"),(0,p.LifeCycle)(2)],a)},35321:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeContributesService=t.VSCodeContributesServiceToken=void 0;const n=e(85608),r=e(76003),o=e(99220),l=e(3098),_=e(57541),v=e(37614),p=e(8079),m=e(6143),s=e(4653),g=e(21086),a=e(61361),h=e(60768),d=e(43988),u=e(81404),E=e(82903),f=e(25588),c=e(35166),y=e(95765),b=e(49661),A=e(53082),S=e(3076),D=e(19669),T=e(92659),w=e(75943),I=e(77901),R=e(88797),M=e(91688),O=e(55993),x=e(12191),k=e(36198),F=e(21218);t.VSCodeContributesServiceToken=Symbol("VSCodeContributesService");let L=class extends o.ExtensionContributesService{constructor(){super(...arguments),this.ContributionPoints=[M.ThemesContributionPoint,d.IconThemesContributionPoint,d.IconsContributionPoint,f.LocalizationsContributionPoint,p.CommandsContributionPoint,A.ProductIconThemesContributionPoint,h.GrammarsContributionPoint,E.LanguagesContributionPoint,m.ConfigurationContributionPoint,s.ConfigurationDefaultsContributionPoint,v.ColorsContributionPoint,u.KeybindingContributionPoint,c.SubmenusContributionPoint,c.MenusContributionPoint,w.SnippetsContributionPoint,O.ViewContainersContributionPoint,x.ViewsContributionPoint,k.ViewsWelcomeContributionPoint,_.BreakpointsContributionPoint,a.DebuggersContributionPoint,l.ActionsContributionPoint,I.TaskDefinitionContributionPoint,b.ProblemPatternsContributionPoint,y.ProblemMatchersContributionPoint,g.CustomEditorContributionPoint,F.WalkthroughsContributionPoint,T.SemanticTokenTypesContributionPoint,S.SemanticTokenModifiersContributionPoint,D.SemanticTokenScopesContributionPoint,R.TerminalContributionPoint]}};t.VSCodeContributesService=L,t.VSCodeContributesService=L=n.__decorate([(0,r.Injectable)()],L)},81404:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeybindingContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(99220),_=e(71354);let v=class extends l.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{extensionId:s,contributes:g}=m,a=this.extensionManageService.getExtensionInstanceByExtId(s);if(!a)continue;const h=g.map(d=>this.toKeybinding(d,a.isBuiltin));this.addDispose(this.keybindingRegistry.registerKeybindings(h))}}toKeybinding(m,s){const g=this.toOSKeybinding(m),{command:a,when:h}=m;return{keybinding:g,command:a,when:h,priority:s?o.KeybindingWeight.BuiltinExtension*100:o.KeybindingWeight.ExternalExtension*100}}toOSKeybinding(m){let s;const g=o.OS.type();return g===o.OperatingSystem.Windows&&m.win?s=m.win:g===o.OperatingSystem.Macintosh&&m.mac?s=m.mac:m.linux&&(s=m.linux),s||m.key}};t.KeybindingContributionPoint=v,n.__decorate([(0,r.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],v.prototype,"keybindingRegistry",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],v.prototype,"extensionManageService",void 0),t.KeybindingContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("keybindings"),(0,l.LifeCycle)(4)],v)},82903:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguagesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(62660),_=e(99220),v=e(71354);let p=class extends _.VSCodeContributePoint{async contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:a}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&await this.textMateService.registerLanguages(a,o.URI.from(h.uri))}}};t.LanguagesContributionPoint=p,p.schema={allowComments:!0,allowTrailingCommas:!0,default:{comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["(",")"],["[","]"],["{","}"]],autoClosingPairs:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[["(",")"],["[","]"],["{","}"]]},definitions:{openBracket:{type:"string",description:(0,o.localize)("schema.openBracket","The opening bracket character or string sequence.")},closeBracket:{type:"string",description:(0,o.localize)("schema.closeBracket","The closing bracket character or string sequence.")},bracketPair:{type:"array",items:[{},{}]}},properties:{comments:{default:{blockComment:["/*","*/"],lineComment:"//"},description:(0,o.localize)("schema.comments","Defines the comment symbols"),type:"object",properties:{blockComment:{type:"array",description:(0,o.localize)("schema.blockComments","Defines how block comments are marked."),items:[{type:"string",description:(0,o.localize)("schema.blockComment.begin","The character sequence that starts a block comment.")},{type:"string",description:(0,o.localize)("schema.blockComment.end","The character sequence that ends a block comment.")}]},lineComment:{type:"string",description:(0,o.localize)("schema.lineComment","The character sequence that starts a line comment.")}}},brackets:{default:[["(",")"],["[","]"],["{","}"]],description:(0,o.localize)("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),type:"array",items:{}},autoClosingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:(0,o.localize)("schema.autoClosingPairs","Defines the bracket pairs. When a opening bracket is entered, the closing bracket is inserted automatically."),type:"array",items:{oneOf:[{},{type:"object",properties:{open:{},close:{},notIn:{type:"array",description:(0,o.localize)("schema.autoClosingPairs.notIn","Defines a list of scopes where the auto pairs are disabled."),items:{enum:["string","comment"]}}}}]}},autoCloseBefore:{default:`;:.,=}])>
|