@opensumi/cli-engine 3.8.3-next-1747291904.0 → 3.8.3-next-1747360267.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.
@@ -31721,7 +31721,7 @@ ${A.slice(1).join(`
31721
31721
  `).slice(d.startPosition.row);return`${f[0].slice(d.startPosition.column)}${f.length>1?`
31722
31722
  ${f.slice(1).join(`
31723
31723
  `)}`:""}`}}return l.text}findTypeIdentifier(l){let h=l;for(;h;){if(h.type==="type_identifier")return h.text;const u=h.child(1);if(!u)break;h=u}return""}async extractImportPaths(l){var h;const u=[],d=await this.parser.parse(l),E=d?.rootNode,f=[],c=[];if(E)for(let y=0;y<E?.childCount;y++){const b=E.child(y);if(b?.type==="import_statement")f.push(b);else if(b?.type==="type_annotation"){const A=b.child(1);A&&c.push(A.text)}else if(b?.type==="lexical_declaration"){const A=this.findTypeIdentifier(b);A&&c.push(A)}}for(const y of f)if(c.some(b=>y.text.includes(b))){let b=(h=y.child(3))===null||h===void 0?void 0:h.text;(b?.includes("'")||b?.includes('"'))&&(b=b.slice(1,-1)),b&&u.push(b)}return u}async extractInterfaceOrTypeCode(l){var h;const u=[];if(this.language==="typescript"){await this.parserLoaded.promise;const d=(h=this.parser)===null||h===void 0?void 0:h.parse(l),E=d?.rootNode;if(E)for(let f=0;f<E?.childCount;f++){const c=E.child(f);if(c?.type==="export_statement"){const y=c.child(1);(y?.type==="interface_declaration"||y?.type==="type_alias_declaration")&&u.push(y.text)}else(c?.type==="interface_declaration"||c?.type==="type_alias_declaration")&&u.push(c.text)}}return u}async findSyntaxErrorCount(l){var h;await this.parserLoaded.promise;const u=(h=this.parser)===null||h===void 0?void 0:h.parse(l),d=u?.rootNode;if(!d)return 0;let E=0;const f=c=>{(c.type==="function_declaration"||c.type==="class_declaration"||c.type==="variable_declarator"||c.type==="statement_block"||c.type==="expression_statement")&&(c.hasError||c.isMissing||c.type==="ERROR")&&E++;for(let b=0;b<c.childCount;b++){const A=c.child(b);A&&f(A)}};return f(d),E}async findNearestCodeBlockWithPosition(l,h){const u=await this.parser.parse(l);if(u){const{rootNode:d}=u,E=d.namedDescendantForIndex(h),f=this.findContainingCodeBlockWithPosition(E,h);if(!f)return null;let y=l.split(`
31724
- `).slice(0,f.startPosition.row).reduce((b,A)=>b+A.length,0);return y+=f.startPosition.row,y+=f.startPosition.column,{codeBlock:f.text,range:{start:{line:f.startPosition.row,character:0},end:{line:f.endPosition.row,character:1/0}},offset:y,type:f.startPosition.row===f.endPosition.row?p.NearestCodeBlockType.Line:p.NearestCodeBlockType.Block}}return null}dispose(){this.parser.delete(),this.lruCache.clear()}};t.LanguageParser=s,n.__decorate([(0,o.Autowired)(_.WasmModuleManager),n.__metadata("design:type",_.WasmModuleManager)],s.prototype,"wasmModuleManager",void 0),n.__decorate([(0,o.Autowired)(m.TreeSitterLanguageFacts),n.__metadata("design:type",m.TreeSitterLanguageFacts)],s.prototype,"languageFacts",void 0),t.LanguageParser=s=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],s)},85679:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParserService=void 0;const n=e(85608),r=e(76003),o=e(3073),a=e(22486);let p=class{constructor(){this.pool=new Map}createParser(m){const _=a.parserNameMap[m];if(_)return this.pool.has(_)||this.pool.set(_,this.injector.get(o.LanguageParser,[_])),this.pool.get(_)}dispose(){this.pool.forEach(m=>m.dispose()),this.pool.clear()}};t.LanguageParserService=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),t.LanguageParserService=p=n.__decorate([(0,r.Injectable)()],p)},53374:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toMonacoRange=e;function e(n){return{startLineNumber:n.startPosition.row+1,startColumn:n.startPosition.column+1,endLineNumber:n.endPosition.row+1,endColumn:n.endPosition.column+1}}},19584:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GolangLanguageFacts=void 0;const e=["function_declaration","method_declaration","block","if_statement","else_statement","switch_statement","case_clause","for_statement","range_clause","type_switch_statement","type_case_clause","comm_clause","select_statement","go_statement","defer_statement"],n=new Set(e);class r{constructor(){this.name="go",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return n}isCodeBlock(a){return n.has(a)}}t.GolangLanguageFacts=r},22486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeSitterLanguageFacts=t.knownLanguageFacts=void 0;const n=e(85608);n.__exportStar(e(17973),t);const r=e(76003),o=e(19584),a=e(44606),p=e(82381),v=e(41486),m=e(98588),_=e(96436),s=e(2349),g=e(78542),l=new Set;t.knownLanguageFacts=[o.GolangLanguageFacts,a.JavaLanguageFacts,p.JavaScriptLanguageFacts,v.JavaScriptReactLanguageFacts,m.PythonLanguageFacts,_.RustLanguageFacts,s.TypeScriptLanguageFacts,g.TypeScriptReactLanguageFacts];let h=class{constructor(){this.langs=new Map,t.knownLanguageFacts.forEach(d=>{const E=new d;this.langs.set(E.name,E)})}isCodeBlock(d,E){const f=this.langs.get(d);return f&&f.isCodeBlock?f.isCodeBlock(E):!1}isFunctionCodeBlock(d,E){const f=this.langs.get(d);return f&&f.isFunctionCodeBlocks?f.isFunctionCodeBlocks(E):!1}provideFunctionInfo(d,E){const f=this.langs.get(d);return f&&f.provideFunctionInfo?f.provideFunctionInfo(E):null}getCodeBlockTypes(d){const E=this.langs.get(d);return E?E.provideCodeBlocks():l}};t.TreeSitterLanguageFacts=h,t.TreeSitterLanguageFacts=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},44606:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaLanguageFacts=void 0;const e=["compilation_unit","class_declaration","interface_declaration","enum_declaration","method_declaration","constructor_declaration","block","static_initializer","instance_initializer","if_statement","switch_statement","while_statement","do_statement","for_statement","enhanced_for_statement","try_statement","catch_clause","finally_clause"],n=new Set(["method_declaration","constructor_declaration"]),r=new Set(e);class o{constructor(){this.name="java",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}isFunctionCodeBlocks(p){return n.has(p)}}t.JavaLanguageFacts=o},82381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptLanguageFacts=t.functionBlockCodeTypes=t.javascriptBlockCodeTypes=void 0;const n=e(53374);t.javascriptBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","method_definition","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","try_statement","catch_clause","block","export_statement","lexical_declaration"],t.functionBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","method_definition"];const r=new Set(t.functionBlockCodeTypes),o=new Set(t.javascriptBlockCodeTypes);class a{constructor(){this.name="javascript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return o}isCodeBlock(v){return o.has(v)}isFunctionCodeBlocks(v){return r.has(v)}provideFunctionInfo(v){var m,_,s;switch(v.type){case"function_declaration":case"function_expression":return{infoCategory:"function",type:v.type,name:((m=v.firstNamedChild)===null||m===void 0?void 0:m.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var l;return((l=g.firstChild)===null||l===void 0?void 0:l.text)||""}),range:(0,n.toMonacoRange)(v)};case"arrow_function":{const g=v.parent;return g&&g.type==="variable_declarator"&&g.parent&&(g.parent.type==="lexical_declaration"||g.parent.type==="export_statement"||g.parent.type==="variable_declaration")?{infoCategory:"function",type:v.type,name:((_=g.firstChild)===null||_===void 0?void 0:_.text)||"",signatures:v.children.filter(l=>l.type==="parameter").map(l=>{var h;return((h=l.firstChild)===null||h===void 0?void 0:h.text)||""}),range:(0,n.toMonacoRange)(g.parent)}:null}case"method_definition":return{infoCategory:"function",type:v.type,name:((s=v.firstNamedChild)===null||s===void 0?void 0:s.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var l;return((l=g.firstChild)===null||l===void 0?void 0:l.text)||""}),range:(0,n.toMonacoRange)(v)}}return null}}t.JavaScriptLanguageFacts=a},41486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptReactLanguageFacts=t.javascriptreactBlockCodeTypes=void 0;const n=e(82381);t.javascriptreactBlockCodeTypes=[...n.javascriptBlockCodeTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.javascriptreactBlockCodeTypes);class o{constructor(){this.name="jsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}}t.JavaScriptReactLanguageFacts=o},98588:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonLanguageFacts=t.pythonBlockCodeTypes=void 0,t.pythonBlockCodeTypes=["function_definition","class_definition","compound_statement","if_statement","elif_clause","else_clause","for_statement","while_statement","try_statement","except_clause","with_statement","decorated_definition"];const e=new Set(t.pythonBlockCodeTypes);class n{constructor(){this.name="python",this.listCommentStyle="# ",this.blockCommentStyle={start:"'''",end:"'''",linePrefix:""}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.PythonLanguageFacts=n},96436:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RustLanguageFacts=t.rustBlockCodeTypes=void 0,t.rustBlockCodeTypes=["function_item","impl_item","trait_item","block","if_expression","match_expression","while_expression","loop_expression","for_expression","closure_expression","struct_item","enum_item","union_item","mod_item"];const e=new Set(t.rustBlockCodeTypes);class n{constructor(){this.name="rust",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.RustLanguageFacts=n},17973:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserIdentifierMap=t.parserNameMap=void 0;const r=e(85608).__importDefault(e(19891)),o={typescript:"typescript",typescriptreact:"tsx",javascript:"javascript",javascriptreact:"jsx",rust:"rust",python:"python",java:"java",go:"go"};t.parserNameMap=o,t.parserIdentifierMap=(0,r.default)(t.parserNameMap)},2349:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptLanguageFacts=t.typescriptBlockTypes=void 0,t.typescriptBlockTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","interface_declaration","method_definition","method_signature","enum_declaration","type_alias_declaration","lexical_declaration","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","for_of_statement","try_statement","catch_clause","block","module","public_field_definition","private_field_definition","export_statement"];const e=new Set(t.typescriptBlockTypes);class n{constructor(){this.name="typescript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.TypeScriptLanguageFacts=n},78542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptReactLanguageFacts=t.typescriptreactBlockTypes=void 0;const n=e(2349);t.typescriptreactBlockTypes=[...n.typescriptBlockTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.typescriptreactBlockTypes);class o{constructor(){this.name="tsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}}t.TypeScriptReactLanguageFacts=o},67045:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WasmModuleManager=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),a=e(6858),p=e(70392);let v=class{async resolveResourceUri(){const _=await this.rendererRuntime.provideResourceUri(a.EKnownResources.TreeSitterWasmDirectory);this.resolvedResourceUriDeferred.resolve(_)}constructor(){this.resolvedResourceUriDeferred=new p.Deferred,this.cachedRuntime=new Map,this.parserInitialized=!1,this.resolveResourceUri()}async initParser(){const _=await this.resolvedResourceUriDeferred.promise;let s;return _.endsWith("/")?s=`${_}tree-sitter.wasm`:s=`${_}/tree-sitter.wasm`,this.parserInitialized||(await r.default.init({locateFile:()=>s}),this.parserInitialized=!0),new r.default}async loadLanguage(_){if(!this.cachedRuntime.has(_)){const s=new p.Deferred;this.cachedRuntime.set(_,s);const g=await this.resolvedResourceUriDeferred.promise;let l;g.endsWith("/")?l=`${g}tree-sitter-${_}.wasm`:l=`${g}/tree-sitter-${_}.wasm`,fetch(l).then(h=>h.arrayBuffer()).then(h=>{s.resolve(h)})}return this.cachedRuntime.get(_).promise}};t.WasmModuleManager=v,n.__decorate([(0,o.Autowired)(a.RendererRuntime),n.__metadata("design:type",a.RendererRuntime)],v.prototype,"rendererRuntime",void 0),t.WasmModuleManager=v=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],v)},4972:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIRightTabRenderer=t.AILeftTabRenderer=t.AIChatTabRendererWithTab=t.AIChatTabRenderer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(41869),p=e(89195),v=e(1149),m=e(43718),_=e(11090),s=e(63067),g=e(46245),l=e(66368),h=e(19951),u=e(752),d=e(19413),E=n.__importDefault(e(87708)),f=()=>{const{side:D}=o.default.useContext(h.TabbarConfig),I=(0,a.useInjectable)(u.TabbarServiceFactory)(D);return(0,o.useEffect)(()=>{I.setIsLatter(!0)},[I]),o.default.createElement("div",{style:{width:0}},o.default.createElement(g.TabbarViewBase,{tabSize:0,MoreTabView:g.IconElipses,TabView:g.IconTabView,barSize:0,panelBorderSize:1}))},c=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:d.AI_CHAT_VIEW_ID,direction:"left-to-right",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${d.AI_CHAT_VIEW_ID}-slot`),components:I,TabbarView:()=>o.default.createElement(f,null),TabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:l.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRenderer=c;const y=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:d.AI_CHAT_VIEW_ID,direction:"right-to-left",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${d.AI_CHAT_VIEW_ID}-slot`,"design_right_slot"),components:I,TabbarView:()=>o.default.createElement(g.ChatTabbarRenderer2,null),TabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:l.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRendererWithTab=y;const b=({className:D,components:I})=>o.default.createElement(_.DesignLeftTabRenderer,{className:D,components:I,tabbarView:A});t.AILeftTabRenderer=b;const A=()=>{const D=(0,a.useInjectable)(s.IMainLayoutService),I=(0,a.useInjectable)(u.TabbarServiceFactory)(a.SlotLocation.right),w=(0,a.useAutorun)(I.currentContainerId),T=o.default.useMemo(()=>D.getExtraMenu(),[D]),[R]=(0,a.useContextMenus)(T),P=(0,o.useCallback)(({renderContainers:O})=>{const M=I.visibleContainers.filter(k=>{var F;return!(!((F=k.options)===null||F===void 0)&&F.hideTab)});return o.default.createElement(o.default.Fragment,null,M.length>0&&o.default.createElement(p.HorizontalVertical,{margin:"8px auto 0px",width:"60%"}),M.map(k=>O(k,I,w)))},[w,I]);return o.default.createElement(g.LeftTabbarRenderer,{renderOtherVisibleContainers:P,isRenderExtraTopMenus:!1,renderExtraMenus:o.default.createElement("div",{className:E.default.extra_bottom_icon_container},R.length>=0?R.map(O=>o.default.createElement(p.EnhanceIconWithCtxMenu,{key:O.id,id:O.id,wrapperClassName:E.default.extra_bottom_icon,iconClass:O.icon,menuNodes:O.children,skew:{x:-8,y:-4}})):null)})},S=({className:D,components:I})=>{const w=(0,a.useInjectable)(u.TabbarServiceFactory)(a.SlotLocation.right),T=(0,a.useInjectable)(v.DesignLayoutConfig),R=(0,o.useCallback)(()=>{w.updateCurrentContainerId("")},[]),P=(0,o.useCallback)(M=>{const{component:k}=M,{options:F}=k;return o.default.createElement(l.ContainerView,{...M,customTitleBar:o.default.createElement("div",{className:E.default.header},o.default.createElement("span",{className:E.default.title},F&&F.title),o.default.createElement("div",{className:E.default.side},o.default.createElement(p.EnhancePopover,{id:"ai_right_panel_header_close",title:(0,m.localize)("editor.title.context.close")},o.default.createElement(p.EnhanceIcon,{icon:"close",onClick:R})))),renderContainerWrap:({children:L})=>o.default.createElement("div",{className:E.default.right_slot_container_wrap},o.default.createElement("div",{className:E.default.container},L))})},[]),O=(0,o.useMemo)(()=>T.useMergeRightWithLeftPanel?E.default.right_tab_renderer:"",[T]);return o.default.createElement(_.DesignRightTabRenderer,{components:I,className:O,tabbarView:()=>o.default.createElement(g.RightTabbarRenderer,{barSize:0,style:{width:0}}),tabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:P})})};t.AIRightTabRenderer=S},82983:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIChatLogoAvatar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(89195),p=e(63067),v=e(19413),m=n.__importDefault(e(88473)),_=()=>{const s=(0,o.useInjectable)(p.IMainLayoutService),g=r.default.useCallback(()=>{s.toggleSlot(v.AI_CHAT_VIEW_ID)},[s]);return r.default.createElement("div",{className:m.default.ai_switch,onClick:g},r.default.createElement(a.AILogoAvatar,{iconClassName:m.default.avatar_icon_large}))};t.AIChatLogoAvatar=_},73974:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseApplyService=void 0;const n=e(85608),r=e(41429),o=e(76003),a=e(41869),p=e(54414),v=e(57517),m=e(55126),_=e(20868),s=e(70392),g=e(2261),l=e(19413),h=e(59347),u=e(40111),d=e(15989);class E extends a.WithEventBus{constructor(){super(),this.onCodeBlockUpdateEmitter=new s.Emitter,this.onCodeBlockUpdate=this.onCodeBlockUpdateEmitter.event,this.activePreviewerMap=this.registerDispose(new s.DisposableMap),this.editorListenerMap=this.registerDispose(new s.DisposableMap),this.addDispose(this.chatInternalService.onCancelRequest(()=>{const c=this.chatInternalService.sessionModel.history.lastMessageId;if(!c)return;const y=this.getMessageCodeBlocks(c);y&&Object.values(y).forEach(b=>{this.cancelApply(b)})})),this.currentSessionId=this.chatInternalService.sessionModel.sessionId,this.addDispose(this.chatInternalService.onChangeSession(c=>{c!==this.currentSessionId&&(this.cancelAllApply(),this.currentSessionId=c)})),this.addDispose(this.chatInternalService.onRegenerateRequest(()=>{const c=this.chatInternalService.sessionModel.history.getMessages(),y=c[c.length-1].id,b=this.getMessageCodeBlocks(y);b&&Object.values(b).forEach(A=>{this.cancelApply(A)})})),this.addDispose(this.chatInternalService.onWillClearSession(c=>{this.cancelAllApply(c)}))}getMessageCodeBlocks(c,y){y=y||this.chatInternalService.sessionModel.sessionId;const b=this.chatInternalService.getSession(y);if(!b)throw new Error(`Session ${y} not found`);const A=b.history.getMessageAdditional(c);return A?.codeBlockMap}onEditorGroupClose(c){const y=s.path.relative(this.appConfig.workspaceDir,c.payload.resource.uri.path.toString());this.activePreviewerMap.get(y)&&this.activePreviewerMap.disposeKey(y),this.editorListenerMap.disposeKey(c.payload.resource.uri.toString())}async onEditorGroupOpen(c){var y;const b=s.path.relative(this.appConfig.workspaceDir,c.payload.resource.uri.path.toString());if(this.duringApply||this.activePreviewerMap.has(b)||!this.chatInternalService.sessionModel.history.getMessages().length)return;const A=((y=this.getUriCodeBlocks(c.payload.resource.uri))===null||y===void 0?void 0:y.filter(S=>S.status==="pending"))||[];if(A.length>0&&A[0].updatedCode){const S=c.payload.group.codeEditor.monacoEditor;await this.renderApplyResult(S,A[0],A[0].updatedCode)}}get currentPreviewer(){var c;const y=(c=this.editorService.currentEditor)===null||c===void 0?void 0:c.currentUri;if(y)return this.activePreviewerMap.get(s.path.relative(this.appConfig.workspaceDir,y.path.toString()))}getUriCodeBlocks(c){const y=this.getSessionCodeBlocks(),b=s.path.relative(this.appConfig.workspaceDir,c.path.toString());return y.filter(A=>A.relativePath===b).sort((A,S)=>S.version-A.version)}getPendingPaths(c){return this.getSessionCodeBlocks(c).filter(b=>b.status==="pending").map(b=>b.relativePath)}getSessionCodeBlocks(c){const y=c?this.chatInternalService.getSession(c):this.chatInternalService.sessionModel;if(!y)throw new Error(`Session ${c} not found`);const b=y.history.sessionAdditionals;return Array.from(b.values()).map(A=>A.codeBlockMap||{}).reduce((A,S)=>(Object.values(S).forEach(D=>{A.push(D)}),A),[])}getCodeBlock(c,y){if(y=y||this.chatInternalService.sessionModel.history.lastMessageId,!y)throw new Error("Message ID is required");const b=this.getMessageCodeBlocks(y);if(b)return b[c]}updateCodeBlock(c){const y=c.messageId,b=this.getMessageCodeBlocks(y);if(!b)throw new Error("Code block not found");b[c.toolCallId]=c,this.chatInternalService.sessionModel.history.setMessageAdditional(y,{codeBlockMap:b}),this.onCodeBlockUpdateEmitter.fire(c)}async registerCodeBlock(c,y,b,A){var S,D;const I=this.chatInternalService.sessionModel.history.lastMessageId,w=this.getUriCodeBlocks(s.URI.file(s.path.join(this.appConfig.workspaceDir,c))),T=await this.editorDocumentModelService.createModelReference(s.URI.file(s.path.join(this.appConfig.workspaceDir,c))),R={codeEdit:y,relativePath:c,status:"generating",iterationCount:1,version:1,createdAt:Date.now(),toolCallId:b,messageId:I,instructions:A,originalCode:T.instance.getText()};if(w?.length){R.version=w.length+1;for(const O of w)if(O.relativePath===c&&(!((D=(S=O.applyResult)===null||S===void 0?void 0:S.diagnosticInfos)===null||D===void 0)&&D.length))R.iterationCount++;else break}const P=this.getMessageCodeBlocks(I)||{};return P[b]=R,this.chatInternalService.sessionModel.history.setMessageAdditional(I,{codeBlockMap:P}),this.onCodeBlockUpdateEmitter.fire(R),R}async apply(c){try{if(this.duringApply=!0,c.iterationCount>3)throw new Error("Lint error max iteration count exceeded");const y=c.originalCode?await this.doApply(c):{result:c.codeEdit};if(!y.stream&&!y.result)return c.status="cancelled",this.updateCodeBlock(c),c;this.activePreviewerMap.has(c.relativePath)&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)).toString()),this.activePreviewerMap.disposeKey(c.relativePath));const b=await this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)));if(!b)throw new Error("Failed to open file");const A=await this.renderApplyResult(b.group.codeEditor.monacoEditor,c,y.result||y.stream,y.range);return c.updatedCode=A.updatedCode,c.status="pending",c.applyResult=A.result,this.updateCodeBlock(c),c}catch(y){throw c.status="failed",this.updateCodeBlock(c),y}finally{this.duringApply=!1}}async renderApplyResult(c,y,b,A){var S,D,I;const w=new s.Deferred,T=d.InlineDiffController.get(c);if(A=A||c.getModel().getFullModelRange(),typeof b=="string"){const R=b,P=c.getModel().getValue(),O=s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)),M=this.editorDocumentModelService.getModelReference(O);(P!==R||M?.instance.dirty)&&((S=c.getModel())===null||S===void 0||S.pushEditOperations([],[g.EditOperation.replace(A,R)],()=>null),await this.editorService.save(O));const k=(D=this.getUriCodeBlocks(O))===null||D===void 0?void 0:D.filter(j=>j.status==="pending"),F=k?.[k.length-1];if(((I=F||y)===null||I===void 0?void 0:I.originalCode)===R)throw new Error("No changes applied");const L=T.createDiffPreviewer(c,_.Selection.fromRange(A,_.SelectionDirection.LTR),{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!0,reverse:!0});this.activePreviewerMap.set(y.relativePath,L),L.setValue(F?.originalCode||y.originalCode||`
31724
+ `).slice(0,f.startPosition.row).reduce((b,A)=>b+A.length,0);return y+=f.startPosition.row,y+=f.startPosition.column,{codeBlock:f.text,range:{start:{line:f.startPosition.row,character:0},end:{line:f.endPosition.row,character:1/0}},offset:y,type:f.startPosition.row===f.endPosition.row?p.NearestCodeBlockType.Line:p.NearestCodeBlockType.Block}}return null}dispose(){this.parser.delete(),this.lruCache.clear()}};t.LanguageParser=s,n.__decorate([(0,o.Autowired)(_.WasmModuleManager),n.__metadata("design:type",_.WasmModuleManager)],s.prototype,"wasmModuleManager",void 0),n.__decorate([(0,o.Autowired)(m.TreeSitterLanguageFacts),n.__metadata("design:type",m.TreeSitterLanguageFacts)],s.prototype,"languageFacts",void 0),t.LanguageParser=s=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[String])],s)},85679:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageParserService=void 0;const n=e(85608),r=e(76003),o=e(3073),a=e(22486);let p=class{constructor(){this.pool=new Map}createParser(m){const _=a.parserNameMap[m];if(_)return this.pool.has(_)||this.pool.set(_,this.injector.get(o.LanguageParser,[_])),this.pool.get(_)}dispose(){this.pool.forEach(m=>m.dispose()),this.pool.clear()}};t.LanguageParserService=p,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),t.LanguageParserService=p=n.__decorate([(0,r.Injectable)()],p)},53374:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toMonacoRange=e;function e(n){return{startLineNumber:n.startPosition.row+1,startColumn:n.startPosition.column+1,endLineNumber:n.endPosition.row+1,endColumn:n.endPosition.column+1}}},19584:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GolangLanguageFacts=void 0;const e=["function_declaration","method_declaration","block","if_statement","else_statement","switch_statement","case_clause","for_statement","range_clause","type_switch_statement","type_case_clause","comm_clause","select_statement","go_statement","defer_statement"],n=new Set(e);class r{constructor(){this.name="go",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return n}isCodeBlock(a){return n.has(a)}}t.GolangLanguageFacts=r},22486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeSitterLanguageFacts=t.knownLanguageFacts=void 0;const n=e(85608);n.__exportStar(e(17973),t);const r=e(76003),o=e(19584),a=e(44606),p=e(82381),v=e(41486),m=e(98588),_=e(96436),s=e(2349),g=e(78542),l=new Set;t.knownLanguageFacts=[o.GolangLanguageFacts,a.JavaLanguageFacts,p.JavaScriptLanguageFacts,v.JavaScriptReactLanguageFacts,m.PythonLanguageFacts,_.RustLanguageFacts,s.TypeScriptLanguageFacts,g.TypeScriptReactLanguageFacts];let h=class{constructor(){this.langs=new Map,t.knownLanguageFacts.forEach(d=>{const E=new d;this.langs.set(E.name,E)})}isCodeBlock(d,E){const f=this.langs.get(d);return f&&f.isCodeBlock?f.isCodeBlock(E):!1}isFunctionCodeBlock(d,E){const f=this.langs.get(d);return f&&f.isFunctionCodeBlocks?f.isFunctionCodeBlocks(E):!1}provideFunctionInfo(d,E){const f=this.langs.get(d);return f&&f.provideFunctionInfo?f.provideFunctionInfo(E):null}getCodeBlockTypes(d){const E=this.langs.get(d);return E?E.provideCodeBlocks():l}};t.TreeSitterLanguageFacts=h,t.TreeSitterLanguageFacts=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},44606:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaLanguageFacts=void 0;const e=["compilation_unit","class_declaration","interface_declaration","enum_declaration","method_declaration","constructor_declaration","block","static_initializer","instance_initializer","if_statement","switch_statement","while_statement","do_statement","for_statement","enhanced_for_statement","try_statement","catch_clause","finally_clause"],n=new Set(["method_declaration","constructor_declaration"]),r=new Set(e);class o{constructor(){this.name="java",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}isFunctionCodeBlocks(p){return n.has(p)}}t.JavaLanguageFacts=o},82381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptLanguageFacts=t.functionBlockCodeTypes=t.javascriptBlockCodeTypes=void 0;const n=e(53374);t.javascriptBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","method_definition","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","try_statement","catch_clause","block","export_statement","lexical_declaration"],t.functionBlockCodeTypes=["function","function_declaration","function_expression","arrow_function","method_definition"];const r=new Set(t.functionBlockCodeTypes),o=new Set(t.javascriptBlockCodeTypes);class a{constructor(){this.name="javascript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return o}isCodeBlock(v){return o.has(v)}isFunctionCodeBlocks(v){return r.has(v)}provideFunctionInfo(v){var m,_,s;switch(v.type){case"function_declaration":case"function_expression":return{infoCategory:"function",type:v.type,name:((m=v.firstNamedChild)===null||m===void 0?void 0:m.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var l;return((l=g.firstChild)===null||l===void 0?void 0:l.text)||""}),range:(0,n.toMonacoRange)(v)};case"arrow_function":{const g=v.parent;return g&&g.type==="variable_declarator"&&g.parent&&(g.parent.type==="lexical_declaration"||g.parent.type==="export_statement"||g.parent.type==="variable_declaration")?{infoCategory:"function",type:v.type,name:((_=g.firstChild)===null||_===void 0?void 0:_.text)||"",signatures:v.children.filter(l=>l.type==="parameter").map(l=>{var h;return((h=l.firstChild)===null||h===void 0?void 0:h.text)||""}),range:(0,n.toMonacoRange)(g.parent)}:null}case"method_definition":return{infoCategory:"function",type:v.type,name:((s=v.firstNamedChild)===null||s===void 0?void 0:s.text)||"",signatures:v.children.filter(g=>g.type==="parameter").map(g=>{var l;return((l=g.firstChild)===null||l===void 0?void 0:l.text)||""}),range:(0,n.toMonacoRange)(v)}}return null}}t.JavaScriptLanguageFacts=a},41486:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JavaScriptReactLanguageFacts=t.javascriptreactBlockCodeTypes=void 0;const n=e(82381);t.javascriptreactBlockCodeTypes=[...n.javascriptBlockCodeTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.javascriptreactBlockCodeTypes);class o{constructor(){this.name="jsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}}t.JavaScriptReactLanguageFacts=o},98588:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PythonLanguageFacts=t.pythonBlockCodeTypes=void 0,t.pythonBlockCodeTypes=["function_definition","class_definition","compound_statement","if_statement","elif_clause","else_clause","for_statement","while_statement","try_statement","except_clause","with_statement","decorated_definition"];const e=new Set(t.pythonBlockCodeTypes);class n{constructor(){this.name="python",this.listCommentStyle="# ",this.blockCommentStyle={start:"'''",end:"'''",linePrefix:""}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.PythonLanguageFacts=n},96436:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RustLanguageFacts=t.rustBlockCodeTypes=void 0,t.rustBlockCodeTypes=["function_item","impl_item","trait_item","block","if_expression","match_expression","while_expression","loop_expression","for_expression","closure_expression","struct_item","enum_item","union_item","mod_item"];const e=new Set(t.rustBlockCodeTypes);class n{constructor(){this.name="rust",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.RustLanguageFacts=n},17973:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parserIdentifierMap=t.parserNameMap=void 0;const r=e(85608).__importDefault(e(19891)),o={typescript:"typescript",typescriptreact:"tsx",javascript:"javascript",javascriptreact:"jsx",rust:"rust",python:"python",java:"java",go:"go"};t.parserNameMap=o,t.parserIdentifierMap=(0,r.default)(t.parserNameMap)},2349:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptLanguageFacts=t.typescriptBlockTypes=void 0,t.typescriptBlockTypes=["function","function_declaration","function_expression","arrow_function","class_declaration","interface_declaration","method_definition","method_signature","enum_declaration","type_alias_declaration","lexical_declaration","if_statement","switch_case","while_statement","do_statement","for_statement","for_in_statement","for_of_statement","try_statement","catch_clause","block","module","public_field_definition","private_field_definition","export_statement"];const e=new Set(t.typescriptBlockTypes);class n{constructor(){this.name="typescript",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return e}isCodeBlock(o){return e.has(o)}}t.TypeScriptLanguageFacts=n},78542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeScriptReactLanguageFacts=t.typescriptreactBlockTypes=void 0;const n=e(2349);t.typescriptreactBlockTypes=[...n.typescriptBlockTypes,"jsx_element","jsx_self_closing_element","jsx_expression","jsx_fragment"];const r=new Set(t.typescriptreactBlockTypes);class o{constructor(){this.name="tsx",this.listCommentStyle="// ",this.blockCommentStyle={start:"/**",end:" */",linePrefix:" * "}}provideCodeBlocks(){return r}isCodeBlock(p){return r.has(p)}}t.TypeScriptReactLanguageFacts=o},67045:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WasmModuleManager=void 0;const n=e(85608),r=n.__importDefault(e(13833)),o=e(76003),a=e(6858),p=e(70392);let v=class{async resolveResourceUri(){const _=await this.rendererRuntime.provideResourceUri(a.EKnownResources.TreeSitterWasmDirectory);this.resolvedResourceUriDeferred.resolve(_)}constructor(){this.resolvedResourceUriDeferred=new p.Deferred,this.cachedRuntime=new Map,this.parserInitialized=!1,this.resolveResourceUri()}async initParser(){const _=await this.resolvedResourceUriDeferred.promise;let s;return _.endsWith("/")?s=`${_}tree-sitter.wasm`:s=`${_}/tree-sitter.wasm`,this.parserInitialized||(await r.default.init({locateFile:()=>s}),this.parserInitialized=!0),new r.default}async loadLanguage(_){if(!this.cachedRuntime.has(_)){const s=new p.Deferred;this.cachedRuntime.set(_,s);const g=await this.resolvedResourceUriDeferred.promise;let l;g.endsWith("/")?l=`${g}tree-sitter-${_}.wasm`:l=`${g}/tree-sitter-${_}.wasm`,fetch(l).then(h=>h.arrayBuffer()).then(h=>{s.resolve(h)})}return this.cachedRuntime.get(_).promise}};t.WasmModuleManager=v,n.__decorate([(0,o.Autowired)(a.RendererRuntime),n.__metadata("design:type",a.RendererRuntime)],v.prototype,"rendererRuntime",void 0),t.WasmModuleManager=v=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],v)},4972:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIRightTabRenderer=t.AILeftTabRenderer=t.AIChatTabRendererWithTab=t.AIChatTabRenderer=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(41869),p=e(89195),v=e(1149),m=e(43718),_=e(11090),s=e(63067),g=e(46245),l=e(66368),h=e(19951),u=e(752),d=e(19413),E=n.__importDefault(e(87708)),f=()=>{const{side:D}=o.default.useContext(h.TabbarConfig),I=(0,a.useInjectable)(u.TabbarServiceFactory)(D);return(0,o.useEffect)(()=>{I.setIsLatter(!0)},[I]),o.default.createElement("div",{style:{width:0}},o.default.createElement(g.TabbarViewBase,{tabSize:0,MoreTabView:g.IconElipses,TabView:g.IconTabView,barSize:0,panelBorderSize:1}))},c=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:d.AI_CHAT_VIEW_ID,direction:"left-to-right",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${d.AI_CHAT_VIEW_ID}-slot`),components:I,TabbarView:()=>o.default.createElement(f,null),TabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:l.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRenderer=c;const y=({className:D,components:I})=>o.default.createElement(h.TabRendererBase,{side:d.AI_CHAT_VIEW_ID,direction:"right-to-left",id:E.default.ai_chat_panel,className:(0,r.default)(D,`${d.AI_CHAT_VIEW_ID}-slot`,"design_right_slot"),components:I,TabbarView:()=>o.default.createElement(g.ChatTabbarRenderer2,null),TabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:l.ContainerView,PanelViewProps:{className:E.default.ai_chat_view_container}})});t.AIChatTabRendererWithTab=y;const b=({className:D,components:I})=>o.default.createElement(_.DesignLeftTabRenderer,{className:D,components:I,tabbarView:A});t.AILeftTabRenderer=b;const A=()=>{const D=(0,a.useInjectable)(s.IMainLayoutService),I=(0,a.useInjectable)(u.TabbarServiceFactory)(a.SlotLocation.right),w=(0,a.useAutorun)(I.currentContainerId),T=o.default.useMemo(()=>D.getExtraMenu(),[D]),[R]=(0,a.useContextMenus)(T),P=(0,o.useCallback)(({renderContainers:O})=>{const M=I.visibleContainers.filter(k=>{var F;return!(!((F=k.options)===null||F===void 0)&&F.hideTab)});return o.default.createElement(o.default.Fragment,null,M.length>0&&o.default.createElement(p.HorizontalVertical,{margin:"8px auto 0px",width:"60%"}),M.map(k=>O(k,I,w)))},[w,I]);return o.default.createElement(g.LeftTabbarRenderer,{renderOtherVisibleContainers:P,isRenderExtraTopMenus:!1,renderExtraMenus:o.default.createElement("div",{className:E.default.extra_bottom_icon_container},R.length>=0?R.map(O=>o.default.createElement(p.EnhanceIconWithCtxMenu,{key:O.id,id:O.id,wrapperClassName:E.default.extra_bottom_icon,iconClass:O.icon,menuNodes:O.children,skew:{x:-8,y:-4}})):null)})},S=({className:D,components:I})=>{const w=(0,a.useInjectable)(u.TabbarServiceFactory)(a.SlotLocation.right),T=(0,a.useInjectable)(v.DesignLayoutConfig),R=(0,o.useCallback)(()=>{w.updateCurrentContainerId("")},[]),P=(0,o.useCallback)(M=>{const{component:k}=M,{options:F}=k;return o.default.createElement(l.ContainerView,{...M,customTitleBar:o.default.createElement("div",{className:E.default.header},o.default.createElement("span",{className:E.default.title},F&&F.title),o.default.createElement("div",{className:E.default.side},o.default.createElement(p.EnhancePopover,{id:"ai_right_panel_header_close",title:(0,m.localize)("editor.title.context.close")},o.default.createElement(p.EnhanceIcon,{icon:"close",onClick:R})))),renderContainerWrap:({children:L})=>o.default.createElement("div",{className:E.default.right_slot_container_wrap},o.default.createElement("div",{className:E.default.container},L))})},[]),O=(0,o.useMemo)(()=>T.useMergeRightWithLeftPanel?E.default.right_tab_renderer:"",[T]);return o.default.createElement(_.DesignRightTabRenderer,{components:I,className:O,tabbarView:()=>o.default.createElement(g.RightTabbarRenderer,{barSize:0,style:{width:0}}),tabpanelView:()=>o.default.createElement(l.BaseTabPanelView,{PanelView:P})})};t.AIRightTabRenderer=S},82983:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIChatLogoAvatar=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),a=e(89195),p=e(63067),v=e(19413),m=n.__importDefault(e(88473)),_=()=>{const s=(0,o.useInjectable)(p.IMainLayoutService),g=r.default.useCallback(()=>{s.toggleSlot(v.AI_CHAT_VIEW_ID)},[s]);return r.default.createElement("div",{className:m.default.ai_switch,onClick:g},r.default.createElement(a.AILogoAvatar,{iconClassName:m.default.avatar_icon_large}))};t.AIChatLogoAvatar=_},73974:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseApplyService=void 0;const n=e(85608),r=e(41429),o=e(76003),a=e(41869),p=e(54414),v=e(57517),m=e(55126),_=e(20868),s=e(70392),g=e(2261),l=e(19413),h=e(59347),u=e(40111),d=e(15989);class E extends a.WithEventBus{constructor(){super(),this.onCodeBlockUpdateEmitter=new s.Emitter,this.onCodeBlockUpdate=this.onCodeBlockUpdateEmitter.event,this.activePreviewerMap=this.registerDispose(new s.DisposableMap),this.editorListenerMap=this.registerDispose(new s.DisposableMap),this.addDispose(this.chatInternalService.onCancelRequest(()=>{const c=this.chatInternalService.sessionModel.history.lastMessageId;if(!c)return;const y=this.getMessageCodeBlocks(c);y&&Object.values(y).forEach(b=>{this.cancelApply(b)})})),this.currentSessionId=this.chatInternalService.sessionModel.sessionId,this.addDispose(this.chatInternalService.onChangeSession(c=>{c!==this.currentSessionId&&(this.cancelAllApply(),this.currentSessionId=c)})),this.addDispose(this.chatInternalService.onRegenerateRequest(()=>{const c=this.chatInternalService.sessionModel.history.getMessages(),y=c[c.length-1].id,b=this.getMessageCodeBlocks(y);b&&Object.values(b).forEach(A=>{this.cancelApply(A)})})),this.addDispose(this.chatInternalService.onWillClearSession(c=>{this.cancelAllApply(c)}))}getMessageCodeBlocks(c,y){y=y||this.chatInternalService.sessionModel.sessionId;const b=this.chatInternalService.getSession(y);if(!b)throw new Error(`Session ${y} not found`);const A=b.history.getMessageAdditional(c);return A?.codeBlockMap}onEditorGroupClose(c){const y=s.path.relative(this.appConfig.workspaceDir,c.payload.resource.uri.path.toString());this.activePreviewerMap.get(y)&&this.activePreviewerMap.disposeKey(y),this.editorListenerMap.disposeKey(c.payload.resource.uri.toString())}async onEditorGroupOpen(c){var y;const b=s.path.relative(this.appConfig.workspaceDir,c.payload.resource.uri.path.toString());if(this.duringApply||this.activePreviewerMap.has(b)||!this.chatInternalService.sessionModel.history.getMessages().length)return;const A=((y=this.getUriCodeBlocks(c.payload.resource.uri))===null||y===void 0?void 0:y.filter(S=>S.status==="pending"))||[];if(A.length>0&&A[0].updatedCode){const S=c.payload.group.codeEditor.monacoEditor;await this.renderApplyResult(S,A[0],A[0].updatedCode)}}get currentPreviewer(){var c;const y=(c=this.editorService.currentEditor)===null||c===void 0?void 0:c.currentUri;if(y)return this.activePreviewerMap.get(s.path.relative(this.appConfig.workspaceDir,y.path.toString()))}getUriCodeBlocks(c){const y=this.getSessionCodeBlocks(),b=s.path.relative(this.appConfig.workspaceDir,c.path.toString());return y.filter(A=>A.relativePath===b).sort((A,S)=>S.version-A.version)}getPendingPaths(c){return this.getSessionCodeBlocks(c).filter(b=>b.status==="pending").map(b=>b.relativePath)}getSessionCodeBlocks(c){const y=c?this.chatInternalService.getSession(c):this.chatInternalService.sessionModel;if(!y)throw new Error(`Session ${c} not found`);const b=y.history.sessionAdditionals;return Array.from(b.values()).map(A=>A.codeBlockMap||{}).reduce((A,S)=>(Object.values(S).forEach(D=>{A.push(D)}),A),[])}getCodeBlock(c,y){if(y=y||this.chatInternalService.sessionModel.history.lastMessageId,!y)throw new Error("Message ID is required");const b=this.getMessageCodeBlocks(y);if(b)return b[c]}updateCodeBlock(c){const y=c.messageId,b=this.getMessageCodeBlocks(y);if(!b)throw new Error("Code block not found");b[c.toolCallId]=c,this.chatInternalService.sessionModel.history.setMessageAdditional(y,{codeBlockMap:b}),this.onCodeBlockUpdateEmitter.fire(c)}async registerCodeBlock(c,y,b,A){var S,D;const I=this.chatInternalService.sessionModel.history.lastMessageId,w=this.getUriCodeBlocks(s.URI.file(s.path.join(this.appConfig.workspaceDir,c))),T=await this.editorDocumentModelService.createModelReference(s.URI.file(s.path.join(this.appConfig.workspaceDir,c))),R={codeEdit:y,relativePath:c,status:"generating",iterationCount:1,version:1,createdAt:Date.now(),toolCallId:b,messageId:I,instructions:A,originalCode:T.instance.getText()};if(w?.length){R.version=w.length+1;for(const O of w)if(O.relativePath===c&&(!((D=(S=O.applyResult)===null||S===void 0?void 0:S.diagnosticInfos)===null||D===void 0)&&D.length))R.iterationCount++;else break}const P=this.getMessageCodeBlocks(I)||{};return P[b]=R,this.chatInternalService.sessionModel.history.setMessageAdditional(I,{codeBlockMap:P}),this.onCodeBlockUpdateEmitter.fire(R),R}async apply(c){try{if(this.duringApply=!0,c.iterationCount>3)throw new Error("Lint error max iteration count exceeded");const y=c.originalCode?await this.doApply(c):{result:c.codeEdit};if(!y.stream&&!y.result)return c.status="failed",this.updateCodeBlock(c),c;this.activePreviewerMap.has(c.relativePath)&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)).toString()),this.activePreviewerMap.disposeKey(c.relativePath));const b=await this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)));if(!b)throw new Error("Failed to open file");const A=await this.renderApplyResult(b.group.codeEditor.monacoEditor,c,y.result||y.stream,y.range);return c.updatedCode=A.updatedCode,c.status="pending",c.applyResult=A.result,this.updateCodeBlock(c),c}catch(y){throw c.status="failed",this.updateCodeBlock(c),y}finally{this.duringApply=!1}}async renderApplyResult(c,y,b,A){var S,D,I;const w=new s.Deferred,T=d.InlineDiffController.get(c);if(A=A||c.getModel().getFullModelRange(),typeof b=="string"){const R=b,P=c.getModel().getValue(),O=s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)),M=this.editorDocumentModelService.getModelReference(O);(P!==R||M?.instance.dirty)&&((S=c.getModel())===null||S===void 0||S.pushEditOperations([],[g.EditOperation.replace(A,R)],()=>null),await this.editorService.save(O));const k=(D=this.getUriCodeBlocks(O))===null||D===void 0?void 0:D.filter(j=>j.status==="pending"),F=k?.[k.length-1];if(((I=F||y)===null||I===void 0?void 0:I.originalCode)===R)throw new Error("No changes applied");const L=T.createDiffPreviewer(c,_.Selection.fromRange(A,_.SelectionDirection.LTR),{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!0,reverse:!0});this.activePreviewerMap.set(y.relativePath,L),L.setValue(F?.originalCode||y.originalCode||`
31725
31725
  `),this.eventBus.fire(new v.RegisterEditorSideComponentEvent),this.listenPartialEdit(c.getModel(),y).then(j=>{j&&(y.applyResult=j),this.updateCodeBlock(y),this.editorService.save(s.URI.file(s.path.join(this.appConfig.workspaceDir,y.relativePath)))});const{diff:B,rangesFromDiffHunk:U}=this.getDiffResult(y.originalCode,R,y.relativePath),W=this.getDiagnosticInfos(c.getModel().uri.toString(),U);w.resolve({result:{diff:B,diagnosticInfos:W},updatedCode:R})}else{const R=new u.InlineChatController;R.mountReadable(b);const P=T.showPreviewerByStream(c,{crossSelection:_.Selection.fromRange(A,_.SelectionDirection.LTR),chatResponse:R,previewerOptions:{disposeWhenEditorClosed:!0,renderRemovedWidgetImmediately:!1}});this.addDispose(R.onError(O=>{w.reject(O)})),this.addDispose(R.onAbort(()=>{w.reject(new Error("Apply aborted"))})),this.addDispose(P.getNode().onDiffFinished(async O=>{const M=O.newFullRangeTextLines.join(`
31726
31726
  `);if(y.originalCode===M){P.dispose(),w.reject(new Error("no changes applied"));return}P.dispose();try{const k=await this.renderApplyResult(c,y,M);w.resolve(k)}catch(k){w.reject(k)}})),this.activePreviewerMap.set(y.relativePath,P)}return w.promise}cancelApply(c,y){var b,A;(c.status==="generating"||c.status==="pending")&&(this.editorListenerMap.disposeKey(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)).toString()),this.activePreviewerMap.has(c.relativePath)&&((A=(b=this.activePreviewerMap.get(c.relativePath))===null||b===void 0?void 0:b.getNode())===null||A===void 0||A.livePreviewDiffDecorationModel.discardUnProcessed(),this.activePreviewerMap.disposeKey(c.relativePath)),c.status="cancelled",this.updateCodeBlock(c))}cancelAllApply(c){this.getSessionCodeBlocks(c).forEach(b=>{this.cancelApply(b)})}revealApplyPosition(c){var y;const b=(y=c.applyResult)===null||y===void 0?void 0:y.diff.split(`
31727
31727
  `).find(I=>I.startsWith("@@"));let A=0,S=0;if(b){const[,,,I,w]=b.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);A=parseInt(I,10)-1,S=parseInt(w,10)-1}this.editorService.open(s.URI.file(s.path.join(this.appConfig.workspaceDir,c.relativePath)));const D=this.editorService.currentEditor;D&&D.setSelection(new _.Selection(A,0,S,0))}async processAll(c,y){var b;const A=y?(b=this.getUriCodeBlocks(y))===null||b===void 0?void 0:b.filter(w=>w.status==="pending"):this.getSessionCodeBlocks().filter(w=>w.status==="pending");if(!A?.length)throw new Error("No pending code block found");const S=y?[A[0].relativePath]:A.map(w=>w.relativePath).reduce((w,T)=>(w.includes(T)||w.push(T),w),[]),D=this.editorService.getAllOpenedUris(),I=S.filter(w=>!D.some(T=>T.codeUri.fsPath.endsWith(w))).map(w=>s.URI.file(s.path.join(this.appConfig.workspaceDir,w)));I.length&&await this.editorService.openUris(I),S.forEach(w=>{this.doProcess(c,w)}),A.forEach(w=>{w.status=c==="accept"?"success":"cancelled",this.updateCodeBlock(w)})}doProcess(c,y){var b,A;const S=(A=(b=this.activePreviewerMap.get(y))===null||b===void 0?void 0:b.getNode())===null||A===void 0?void 0:A.livePreviewDiffDecorationModel;if(!S)throw new Error("No active previewer found");c==="accept"?S.acceptUnProcessed():S.discardUnProcessed(),this.editorService.save(s.URI.file(s.path.join(this.appConfig.workspaceDir,y)))}listenPartialEdit(c,y){const b=new s.Deferred,A=c.uri.toString(),S=this.inlineDiffService.onPartialEdit(D=>{if(D.totalPartialEditCount===D.resolvedPartialEditCount&&D.uri.path===c.uri.path.toString()){if(D.acceptPartialEditCount>0){y.status="success";const I=c.getValue(),{diff:w,rangesFromDiffHunk:T}=this.getDiffResult(y.originalCode,I,y.relativePath),R=this.getDiagnosticInfos(c.uri.toString(),T);this.aiReporter.send({msgType:a.AIServiceType.Chat,actionType:a.ActionTypeEnum.Accept,actionSource:a.ActionSourceEnum.Chat,sessionId:this.chatInternalService.sessionModel.sessionId,isReceive:!0,isDrop:D.acceptPartialEditCount!==D.totalPartialEditCount,code:I,originCode:y.originalCode,message:JSON.stringify({diff:w,diagnosticInfos:R,instructions:y.instructions,codeEdit:y.codeEdit,partialEditCount:D.totalPartialEditCount,acceptPartialEditCount:D.acceptPartialEditCount,addedLinesCount:D.totalAddedLinesCount,deletedLinesCount:D.totalDeletedLinesCount})}),b.resolve({diff:w,diagnosticInfos:R})}else y.status="cancelled",b.resolve(),this.aiReporter.send({msgType:a.AIServiceType.Chat,actionType:a.ActionTypeEnum.Discard,actionSource:a.ActionSourceEnum.Chat,sessionId:this.chatInternalService.sessionModel.sessionId,isReceive:!1,isDrop:!0,originCode:y.originalCode,message:JSON.stringify({instructions:y.instructions,codeEdit:y.codeEdit})});this.editorListenerMap.disposeKey(A)}});return this.editorListenerMap.set(A,S),b.promise}getDiffResult(c,y,b){const A=(0,r.createPatch)(b,c,y).split(`
@@ -31729,7 +31729,7 @@ ${f.slice(1).join(`
31729
31729
  `),S=A.split(`
31730
31730
  `).map(D=>{if(D.startsWith("@@")){const[,,,I,w]=D.match(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);return new _.Range(parseInt(I,10),0,parseInt(I,10)+parseInt(w,10)-1,0)}return null}).filter(D=>D!==null);return{diff:A,rangesFromDiffHunk:S}}getDiagnosticInfos(c,y){return this.markerService.getManager().getMarkers({resource:c}).filter(A=>A.severity>=a.MarkerSeverity.Warning&&y.some(S=>S.containsPosition(new _.Position(A.startLineNumber,A.startColumn))))}}t.BaseApplyService=E,E.CHAT_EDITING_SOURCE_RESOLVER_SCHEME="chat-editing-source",n.__decorate([(0,o.Autowired)(l.IChatInternalService),n.__metadata("design:type",h.ChatInternalService)],E.prototype,"chatInternalService",void 0),n.__decorate([(0,o.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],E.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],E.prototype,"editorService",void 0),n.__decorate([(0,o.Autowired)(l.InlineDiffServiceToken),n.__metadata("design:type",Object)],E.prototype,"inlineDiffService",void 0),n.__decorate([(0,o.Autowired)(m.IMarkerService),n.__metadata("design:type",Object)],E.prototype,"markerService",void 0),n.__decorate([(0,o.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],E.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,o.Autowired)(a.IAIReporter),n.__metadata("design:type",Object)],E.prototype,"aiReporter",void 0),n.__decorate([(0,a.OnEvent)(v.EditorGroupCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[v.EditorGroupCloseEvent]),n.__metadata("design:returntype",void 0)],E.prototype,"onEditorGroupClose",null),n.__decorate([(0,a.OnEvent)(v.EditorGroupOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[v.EditorGroupOpenEvent]),n.__metadata("design:returntype",Promise)],E.prototype,"onEditorGroupOpen",null)},75279:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPConfigView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(97267),p=e(41869),v=e(43718),m=e(19413),_=n.__importDefault(e(76599)),s=e(51750),g=()=>{const l=(0,p.useInjectable)(v.MCPConfigServiceToken),[h,u]=o.default.useState([]),[d,E]=o.default.useState(!1),[f,c]=o.default.useState(),[y,b]=o.default.useState(),[A,S]=o.default.useState(l.isInitialized),D=(0,o.useCallback)(async()=>{const M=await l.getServers();u(M)},[l]);o.default.useEffect(()=>{D();const M=l.onMCPServersChange(k=>{k&&S(!0),D()});return()=>{M.dispose()}},[D]);const I=(0,o.useCallback)(async(M,k)=>{try{b(M),await l.controlServer(M,k),await D(),b(void 0)}catch{b(void 0)}},[l,D]),w=(0,o.useCallback)(()=>{c(void 0),E(!0)},[]),T=(0,o.useCallback)(async M=>{const k=await l.getServerConfigByName(M.name);k&&(c(k),E(!0))},[l]),R=(0,o.useCallback)(async M=>{await l.deleteServer(M),await D()},[l,D]),P=(0,o.useCallback)(async(M,k)=>{E(!1),await l.saveServer(M,k),M?.enabled&&(b(k.name),await l.controlServer(k.name,!0),b(void 0)),await D()},[l,D]),O=(0,o.useCallback)(async M=>{b(M.name),await l.syncServer(M.name),await D(),b(void 0)},[l,D]);return o.default.createElement("div",{className:_.default.container},o.default.createElement("div",{className:_.default.header},o.default.createElement("div",null,o.default.createElement("h2",{className:_.default.title},"MCP Servers"),o.default.createElement("p",{className:_.default.description},(0,v.localize)("ai.native.mcp.manage.connections"))),o.default.createElement("button",{className:_.default.actionButton,onClick:w},o.default.createElement(a.Icon,{icon:"plus",className:_.default.actionButtonIcon}),(0,v.localize)("ai.native.mcp.addMCPServer.title"))),o.default.createElement("div",{className:_.default.serversList},h.map(M=>o.default.createElement("div",{key:M.name,className:_.default.serverItem},o.default.createElement("div",{className:_.default.serverHeader},o.default.createElement("div",{className:_.default.serverTitleRow},o.default.createElement("h3",{className:_.default.serverName},M.name,o.default.createElement("span",{className:(0,r.default)(_.default.serverStatusIcon,M.isStarted?_.default.active:_.default.inactive)}))),o.default.createElement("div",{className:_.default.serverActions},o.default.createElement(a.Popover,{id:"mcp-server-action-popover",trigger:a.PopoverTriggerType.hover,content:M.isStarted?(0,v.localize)("ai.native.mcp.disable.title"):(0,v.localize)("ai.native.mcp.enable.title")},o.default.createElement(a.Button,{type:"default",className:(0,r.default)(_.default.serverActionButton,M.isStarted&&_.default.active),onClick:()=>I(M.name,!M.isStarted)},o.default.createElement("i",{className:`codicon ${y===M.name||!A&&M.name!==m.BUILTIN_MCP_SERVER_NAME&&!M.isStarted?"codicon-loading kt-icon-loading":M.isStarted?"codicon-check":"codicon-circle"}`}),o.default.createElement("span",null,(0,v.localize)(M.isStarted?"ai.native.mcp.enabled":"ai.native.mcp.disabled")))),M.name!==m.BUILTIN_MCP_SERVER_NAME&&o.default.createElement(a.Button,{type:"icon",iconClass:"codicon codicon-edit",className:_.default.iconButton,title:(0,v.localize)("ai.native.mcp.tool.action.edit"),onClick:()=>T(M)}),M.name!==m.BUILTIN_MCP_SERVER_NAME&&o.default.createElement(a.Button,{type:"icon",iconClass:"codicon codicon-sync",className:_.default.iconButton,title:(0,v.localize)("ai.native.mcp.tool.action.sync"),onClick:()=>O(M)}),M.name!==m.BUILTIN_MCP_SERVER_NAME&&o.default.createElement(a.Button,{type:"icon",iconClass:"codicon codicon-trash",className:_.default.iconButton,title:(0,v.localize)("ai.native.mcp.tool.action.delete"),onClick:()=>R(M.name)}))),o.default.createElement("div",{className:_.default.serverDetail},M.type&&o.default.createElement("div",{className:_.default.detailRow},o.default.createElement("span",{className:_.default.detailLabel},"Type:"),o.default.createElement(a.Badge,{className:(0,r.default)(_.default.serverType,_.default.typeTag)},l.getReadableServerType(M.type)))),M.tools&&M.tools.length>0&&o.default.createElement("div",{className:_.default.serverDetail},o.default.createElement("div",{className:_.default.detailRow},o.default.createElement("span",{className:_.default.detailLabel},"Tools:"),o.default.createElement("span",{className:_.default.detailContent},M.tools.map((k,F)=>o.default.createElement(a.Badge,{key:F,className:_.default.toolTag,title:k.description},k.name))))),M.command&&o.default.createElement("div",{className:_.default.serverDetail},o.default.createElement("div",{className:_.default.detailRow},o.default.createElement("span",{className:_.default.detailLabel},"Command:"),o.default.createElement("span",{className:_.default.detailContent},M.command))),M.url&&o.default.createElement("div",{className:_.default.serverDetail},o.default.createElement("div",{className:_.default.detailRow},o.default.createElement("span",{className:_.default.detailLabel},"Server Link:"),o.default.createElement("span",{className:(0,r.default)(_.default.detailContent,_.default.link)},M.url)))))),o.default.createElement(s.MCPServerForm,{visible:d,initialData:f,servers:h,onSave:M=>P(f,M),onCancel:()=>E(!1)}))};t.MCPConfigView=g},51750:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPServerForm=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(97267),p=e(48412),v=e(53017),m=e(41869),_=e(43718),s=e(72665),g=e(69820),l=n.__importDefault(e(83761)),h=({visible:u,initialData:d,onSave:E,onCancel:f,servers:c})=>{const[y,b]=(0,o.useState)(()=>({name:"",command:"",args:[],env:{},type:g.MCP_SERVER_TYPE.STDIO,...d})),A=(0,m.useInjectable)(s.IMessageService),[S,D]=(0,o.useState)(()=>{var B;return((B=d?.args)===null||B===void 0?void 0:B.join(" "))||""}),[I,w]=(0,o.useState)(()=>d?.env?Object.entries(d.env).map(([B,U])=>`${B}=${U}`).join(`
31731
31731
  `):"");(0,o.useEffect)(()=>{var B;b({name:"",command:"",args:[],env:{},type:g.MCP_SERVER_TYPE.STDIO,...d}),D(((B=d?.args)===null||B===void 0?void 0:B.join(" "))||""),w(d?.env?Object.entries(d.env).map(([U,W])=>`${U}=${W}`).join(`
31732
- `):"")},[d]);const T=(0,o.useCallback)(B=>{var U,W;if(B.name.trim()==="")return A.error((0,_.localize)("ai.native.mcp.name.isRequired")),!1;if(!d&&c.some(Q=>Q.name.toLocaleLowerCase()===B.name.toLocaleLowerCase()))return A.error((0,_.formatLocalize)("ai.native.mcp.serverNameExists",B.name)),!1;if(B.type===g.MCP_SERVER_TYPE.SSE){const Q=((U=B.url)===null||U===void 0?void 0:U.trim())!=="";return Q||A.error((0,_.localize)("ai.native.mcp.url.isRequired")),Q}const j=((W=B.command)===null||W===void 0?void 0:W.trim())!=="";return j||A.error((0,_.localize)("ai.native.mcp.command.isRequired")),j},[c,d]),R=(0,o.useCallback)(B=>{var U;if(B.preventDefault(),!T(y))return;const j={...y};if(y.type===g.MCP_SERVER_TYPE.SSE)j.url=(U=j.url)===null||U===void 0?void 0:U.trim();else{const Q=S.split(" ").filter(Boolean),G=I.split(`
31732
+ `):"")},[d]);const T=(0,o.useCallback)(B=>{var U,W;if(B.name.trim()==="")return A.error((0,_.localize)("ai.native.mcp.name.isRequired")),!1;if(!d&&c.some(Q=>Q.name.toLocaleLowerCase()===B.name.toLocaleLowerCase()))return A.error((0,_.formatLocalize)("ai.native.mcp.serverNameExists",B.name)),!1;if(B.type===g.MCP_SERVER_TYPE.SSE){const Q=((U=B.url)===null||U===void 0?void 0:U.trim())!=="";return Q||A.error((0,_.localize)("ai.native.mcp.url.isRequired")),Q}const j=((W=B.command)===null||W===void 0?void 0:W.trim())!=="";return j||A.error((0,_.localize)("ai.native.mcp.command.isRequired")),j},[c,d]),R=(0,o.useCallback)(B=>{var U;if(B.preventDefault(),!T(y))return;const j={...y};if(j.command&&(j.command=j.command.trim()),j.url&&(j.url=j.url.trim()),y.type===g.MCP_SERVER_TYPE.SSE)j.url=(U=j.url)===null||U===void 0?void 0:U.trim();else{const Q=S.split(" ").filter(Boolean),G=I.split(`
31733
31733
  `).filter(Boolean).reduce((Z,$)=>{const[V,H]=$.split("=");return V&&H&&(Z[V.trim()]=H.trim()),Z},{});j.args=Q,j.env=G}b({...y,name:"",command:"",url:"",args:[],env:{}}),E(j)},[y,S,I,E,T]),P=(0,o.useCallback)(B=>{b({...y,command:B.target.value})},[y,S]),O=(0,o.useCallback)(B=>{D(B.target.value)},[S]),M=(0,o.useCallback)(B=>{w(B.target.value)},[I]),k=(0,o.useCallback)(B=>{b({...y,url:B.target.value})},[y]),F=(0,o.useCallback)(B=>{b({...y,type:B,command:"",args:[],env:{},url:""})},[y]),L=(0,o.useCallback)(()=>y?.type===g.MCP_SERVER_TYPE.STDIO?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:l.default.formItem},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.command")),o.default.createElement("input",{type:"text",value:y.command,onChange:P,placeholder:(0,_.localize)("ai.native.mcp.command.placeHolder"),required:!0})),o.default.createElement("div",{className:l.default.formItem},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.args")),o.default.createElement("textarea",{value:S,onChange:O,placeholder:(0,_.localize)("ai.native.mcp.args.placeHolder"),rows:3})),o.default.createElement("div",{className:l.default.formItem},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.env")),o.default.createElement("textarea",{value:I,onChange:M,placeholder:(0,_.localize)("ai.native.mcp.env.placeHolder"),rows:3}))):o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:l.default.formItem},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.url")),o.default.createElement("textarea",{value:y.url,onChange:k,placeholder:(0,_.localize)("ai.native.mcp.url.placeHolder"),rows:3}))),[y,S,I]);return o.default.createElement(v.Modal,{title:d?(0,_.localize)("ai.native.mcp.editMCPServer.title"):(0,_.localize)("ai.native.mcp.addMCPServer.title"),visible:u,onCancel:f,centered:!0,width:600,footer:null,style:{background:"var(--editor-background)"}},o.default.createElement("form",{className:l.default.form,onSubmit:B=>B.preventDefault()},o.default.createElement("div",{className:l.default.formRow},o.default.createElement("div",{className:(0,r.default)(l.default.formItem,l.default.formItemName)},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.name")),o.default.createElement("input",{type:"text",value:y.name,onChange:B=>b({...y,name:B.target.value}),placeholder:(0,_.localize)("ai.native.mcp.name.placeHolder"),required:!0})),o.default.createElement("div",{className:(0,r.default)(l.default.formItem,l.default.formItemType)},o.default.createElement("label",null,(0,_.localize)("ai.native.mcp.type")),o.default.createElement(a.Select,{size:"large",value:y.type,options:[{label:(0,_.localize)("ai.native.mcp.stdio"),value:g.MCP_SERVER_TYPE.STDIO},{label:(0,_.localize)("ai.native.mcp.sse"),value:g.MCP_SERVER_TYPE.SSE}],className:l.default.formItemSelect,onChange:F}))),L(),o.default.createElement("div",{className:l.default.formActions},o.default.createElement(p.Button,{onClick:f,type:"primary",className:l.default.secondaryButton},(0,_.localize)("ai.native.mcp.buttonCancel")),o.default.createElement(p.Button,{onClick:R,type:"primary"},d?(0,_.localize)("ai.native.mcp.buttonUpdate"):(0,_.localize)("ai.native.mcp.buttonSave")))))};t.MCPServerForm=h},27397:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPConfigCommandContribution=t.MCPConfigCommands=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(54414),v=e(5297),m=e(33108);var _;(function(g){g.OPEN_MCP_CONFIG={id:"mcp.openConfig",label:"Open MCP Configuration"},g.OPEN_MCP_CONFIG_FILE={id:"mcp.openConfigFile",label:"Open MCP Configuration (JSON)"}})(_||(t.MCPConfigCommands=_={}));let s=class{registerCommands(l){l.registerCommand(_.OPEN_MCP_CONFIG,{execute:()=>{const h=new o.URI().withScheme(v.MCP_CONFIG_COMPONENTS_SCHEME_ID);this.editorService.open(h,{preview:!1,focus:!0})}}),l.registerCommand(_.OPEN_MCP_CONFIG_FILE,{execute:()=>{this.mcpConfigService.openConfigFile()}})}};t.MCPConfigCommandContribution=s,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],s.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(a.MCPConfigServiceToken),n.__metadata("design:type",m.MCPConfigService)],s.prototype,"mcpConfigService",void 0),t.MCPConfigCommandContribution=s=n.__decorate([(0,a.Domain)(o.CommandContribution)],s)},5297:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPConfigContribution=t.MCP_CONFIG_COMPONENTS_SCHEME_ID=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(93899),p=e(39496),v=e(26542),m=e(43718),_=e(82196),s=e(7443),g=e(10560),l=e(75279),h=e(27397),u="opensumi-mcp-config-viewer";t.MCP_CONFIG_COMPONENTS_SCHEME_ID="mcp-config";let d=class{registerEditorComponent(f){f.registerEditorComponent({uid:u,scheme:t.MCP_CONFIG_COMPONENTS_SCHEME_ID,component:l.MCPConfigView,renderMode:_.EditorComponentRenderMode.ONE_PER_WORKBENCH}),f.registerEditorComponentResolver(t.MCP_CONFIG_COMPONENTS_SCHEME_ID,(c,y)=>{y.push({type:"component",componentId:u})})}registerResource(f){f.registerResourceProvider({scheme:t.MCP_CONFIG_COMPONENTS_SCHEME_ID,provideResource:async c=>{const{configType:y}=c.getParsedQuery();return{uri:c,name:(0,m.localize)("ai.native.mcp.config.title"),icon:(0,o.getIcon)("mcp"),metadata:{configType:y}}}})}registerMenus(f){f.registerMenuItem(p.MenuId.EditorTitle,{command:h.MCPConfigCommands.OPEN_MCP_CONFIG_FILE.id,iconClass:(0,o.getIcon)("open"),group:"navigation",order:4,when:`resourceScheme == ${t.MCP_CONFIG_COMPONENTS_SCHEME_ID}`}),f.registerMenuItem(p.MenuId.EditorTitle,{command:h.MCPConfigCommands.OPEN_MCP_CONFIG.id,iconClass:(0,o.getIcon)("open"),group:"navigation",order:4,when:"resourceFilename =~ /mcp.json/"})}};t.MCPConfigContribution=d,n.__decorate([(0,r.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(s.IconService),n.__metadata("design:type",s.IconService)],d.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.LabelService)],d.prototype,"labelService",void 0),t.MCPConfigContribution=d=n.__decorate([(0,m.Domain)(_.BrowserEditorContribution,a.MenuContribution)],d)},33108:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPConfigService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(78132),p=e(43718),v=e(54414),m=e(72665),_=e(19413),s=e(64811),g=e(69820),l=e(45331);let h=class extends p.Disposable{constructor(){super(),this.whenReadyDeferred=new p.Deferred,this._isInitialized=!1,this.mcpServersChangeEventEmitter=new p.Emitter,this.init(),this.disposables.push(this.mcpServerProxyService.onChangeMCPServers(()=>{this.fireMCPServersChange()})),this.disposables.push(this.preferenceService.onSpecificPreferenceChange("mcp",()=>{this.fireMCPServersChange()}))}async init(){this.chatStorage=await this.storageProvider(p.STORAGE_NAMESPACE.CHAT),this.whenReadyDeferred.resolve()}get whenReady(){return this.whenReadyDeferred.promise}get isInitialized(){return this._isInitialized}get onMCPServersChange(){return this.mcpServersChangeEventEmitter.event}fireMCPServersChange(d=!1){d&&(this._isInitialized=!0),this.mcpServersChangeEventEmitter.fire(d)}async getServers(){const{value:d,scope:E}=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0);if(E===p.PreferenceScope.Default){const S=(await this.mcpServerProxyService.$getServers()).find(D=>D.name===_.BUILTIN_MCP_SERVER_NAME);return S?[S]:[]}const f=Object.keys(d.mcpServers).map(A=>{const S=d.mcpServers[A];return S.url?{name:A,type:g.MCP_SERVER_TYPE.SSE,url:S.url}:{name:A,type:g.MCP_SERVER_TYPE.STDIO,command:S.command,args:S.args,env:S.env}}),c=await this.mcpServerProxyService.$getServers(),y=c.find(A=>A.name===_.BUILTIN_MCP_SERVER_NAME),b=f?.map(A=>{const S=c.find(D=>D.name===A.name);return S||this.sumiMCPServerBackendProxy.$addOrUpdateServer(A),{...A,isStarted:S?.isStarted||!1,tools:S?.tools||[]}});return y&&b.unshift(y),b}async controlServer(d,E){try{E?await this.mcpServerProxyService.$startServer(d):await this.mcpServerProxyService.$stopServer(d);const f=this.chatStorage.get(s.MCPServersEnabledKey,[_.BUILTIN_MCP_SERVER_NAME]),c=new Set(f);E?c.add(d):c.delete(d),this.chatStorage.set(s.MCPServersEnabledKey,Array.from(c))}catch(f){const c=f.message||f;throw this.logger.error(`Failed to ${E?"start":"stop"} server ${d}:`,c),this.messageService.error(c),f}}async saveServer(d,E){await this.whenReady;const{value:f}=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0),c=f.mcpServers;let y;E.type===g.MCP_SERVER_TYPE.SSE?y={url:E.url}:y={command:E.command,args:E.args,env:E.env},d?.name&&delete c[d.name],c[E.name]=y,await this.preferenceService.set("mcp",{mcpServers:c}),d?.enabled&&this.sumiMCPServerBackendProxy.$removeServer(d.name),this.sumiMCPServerBackendProxy.$addOrUpdateServer(E)}async deleteServer(d){const{value:E}=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0),f=E.mcpServers;f[d]&&(delete f[d],await this.sumiMCPServerBackendProxy.$removeServer(d),await this.preferenceService.set("mcp",{mcpServers:f}))}async syncServer(d){try{await this.sumiMCPServerBackendProxy.$syncServer(d)}catch(E){this.logger.error(`Failed to sync server ${d}:`,E),this.messageService.error(E.message||E)}}async getServerConfigByName(d){const{value:E}=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0);await this.whenReady;const f=this.chatStorage.get(s.MCPServersEnabledKey,[_.BUILTIN_MCP_SERVER_NAME]),c=E.mcpServers[d];if(c)return c.url?{name:d,type:g.MCP_SERVER_TYPE.SSE,url:c.url,enabled:f.includes(d)}:{name:d,type:g.MCP_SERVER_TYPE.STDIO,command:c.command,args:c.args,env:c.env,enabled:f.includes(d)}}getReadableServerType(d){switch(d){case g.MCP_SERVER_TYPE.STDIO:return(0,p.localize)("ai.native.mcp.type.stdio");case g.MCP_SERVER_TYPE.SSE:return(0,p.localize)("ai.native.mcp.type.sse");case g.MCP_SERVER_TYPE.BUILTIN:return(0,p.localize)("ai.native.mcp.type.builtin");default:return d}}async openConfigFile(){let d=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0);d.scope===p.PreferenceScope.Default&&(await this.preferenceService.set("mcp",{mcpServers:{}},p.PreferenceScope.Workspace),d=this.preferenceService.resolve("mcp",{mcpServers:{}},void 0));const E=d.configUri;E&&this.workbenchEditorService.open(E,{preview:!1})}};t.MCPConfigService=h,n.__decorate([(0,r.Autowired)(_.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],h.prototype,"sumiMCPServerBackendProxy",void 0),n.__decorate([(0,r.Autowired)(l.MCPServerProxyService),n.__metadata("design:type",l.MCPServerProxyService)],h.prototype,"mcpServerProxyService",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(m.IMessageService),n.__metadata("design:type",Object)],h.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(p.StorageProvider),n.__metadata("design:type",Function)],h.prototype,"storageProvider",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],h.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),t.MCPConfigService=h=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],h)},33368:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let a=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{mcp:{...m}}}getPath(v){if(v==="mcp")return[];if(v.startsWith("mcp."))return[v.substr(4)]}};t.MCPFolderPreferenceProvider=a,t.MCPFolderPreferenceProvider=a=n.__decorate([(0,r.Injectable)()],a)},55003:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPPreferencesContribution=t.MCPResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(57517),p=e(924);let v=class{provideResource(s){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:s}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.MCPResourceProvider=v,t.MCPResourceProvider=v=n.__decorate([(0,r.Injectable)()],v);let m=class{constructor(){this.schema=p.MCPPreferencesSchema,this.name="mcp"}registerResource(s){s.registerResourceProvider(this.prefResourceProvider)}registerSchema(s){s.registerSchema(p.MCPSchemaUri,p.MCPSchema,["mcp.json"])}};t.MCPPreferencesContribution=m,n.__decorate([(0,r.Autowired)(v),n.__metadata("design:type",v)],m.prototype,"prefResourceProvider",void 0),t.MCPPreferencesContribution=m=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,a.BrowserEditorContribution,o.JsonSchemaContribution)],m)},924:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPSchema=t.MCPPreferencesSchema=t.MCPSchemaUri=void 0,t.MCPSchemaUri="vscode://schemas/mcp/user",t.MCPPreferencesSchema={type:"object",scope:"resource",properties:{mcp:{$ref:t.MCPSchemaUri,description:"MCP configuration for Workspace.",defaultValue:{mcpServers:{}}}}},t.MCPSchema={$id:t.MCPSchemaUri,type:"object",title:"MCP",required:[],default:{mcpServers:{}},properties:{mcpServers:{type:"object",description:"List of MCP Servers. Add new servers or edit existing ones by using IntelliSense.",additionalProperties:{type:"object",properties:{command:{type:"string",description:"The command to start the MCP server."},args:{type:"array",description:"The arguments for the command to start the MCP server.",items:{type:"string"}},env:{type:"object",description:"The environment variables for the command to start the MCP server.",additionalProperties:{type:"string"}},url:{type:"string",description:"The SSE URL for the MCP server."}},oneOf:[{required:["command"]},{required:["url"]}]}}}}},45331:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPServerProxyService=void 0;const n=e(85608),r=e(48085),o=e(76003),a=e(41869),p=e(43718),v=e(19413),m=e(77633);let _=class{constructor(){this._onChangeMCPServers=new p.Emitter,this.onChangeMCPServers=this._onChangeMCPServers.event}$callMCPTool(g,l){return this.mcpServerRegistry.callMCPTool(g,l)}async $getBuiltinMCPTools(){const g=await this.mcpServerRegistry.getMCPTools().map(l=>({name:l.name,description:l.description,inputSchema:(0,r.zodToJsonSchema)(l.inputSchema),providerName:v.BUILTIN_MCP_SERVER_NAME}));return this.logger.log("SUMI MCP tools",g),g}async $updateMCPServers(){this._onChangeMCPServers.fire("update")}async getAllMCPTools(){return this.sumiMCPServerProxyService.$getAllMCPTools()}async $getServers(){return this.sumiMCPServerProxyService.$getServers()}async $startServer(g){await this.sumiMCPServerProxyService.$startServer(g)}async $stopServer(g){await this.sumiMCPServerProxyService.$stopServer(g)}};t.MCPServerProxyService=_,n.__decorate([(0,o.Autowired)(m.TokenMCPServerRegistry),n.__metadata("design:type",Object)],_.prototype,"mcpServerRegistry",void 0),n.__decorate([(0,o.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(v.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],_.prototype,"sumiMCPServerProxyService",void 0),t.MCPServerProxyService=_=n.__decorate([(0,o.Injectable)()],_)},79502:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPServerRegistry=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(19413),p=e(98864);class v{constructor(s){this.logger=s}appendLine(s){this.logger.log(s)}}let m=class{constructor(){this.tools=[],this.toolComponents={}}get logger(){return new v(this.baseLogger)}set activeMessageInfo(s){this._activeMessageInfo=s}getMCPTool(s,g=a.BUILTIN_MCP_SERVER_NAME){return this.tools.find(l=>(0,p.getToolName)(l.name,g)===s)}registerMCPTool(s){this.tools.push(s)}registerToolComponent(s,g,l=a.BUILTIN_MCP_SERVER_NAME){this.toolComponents[(0,p.getToolName)(s,l)]=g}getToolComponent(s){return this.toolComponents[s]}getMCPTools(){return this.tools.sort((s,g)=>{var l,h;return((l=s.order)!==null&&l!==void 0?l:1/0)-((h=g.order)!==null&&h!==void 0?h:1/0)})}async callMCPTool(s,g){try{const l=this.tools.find(d=>d.name===s);if(!l)throw new Error(`MCP tool ${s} not found`);const h=g.toolCallId;g=l.inputSchema.parse(g);const u=await l.handler({...g,toolCallId:h},this.logger);return this.reportToolCall(s,g,u,h),u}catch(l){return console.error("callMCPTool error:",l),this.reportToolCall(s,g,l,g.toolCallId),{content:[{type:"text",text:`The tool ${s} failed to execute. Error: ${l}`}],isError:!0}}}reportToolCall(s,g,l,h){if(!this.tools.find(d=>d.name===s))throw new Error(`MCP tool ${s} not found`);this.aiReporter.send({msgType:o.AIServiceType.ToolCall,message:JSON.stringify({args:g,name:s,result:l}),messageId:this._activeMessageInfo.messageId,sessionId:this._activeMessageInfo.sessionId,relationId:h})}};t.MCPServerRegistry=m,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],m.prototype,"baseLogger",void 0),n.__decorate([(0,r.Autowired)(o.IAIReporter),n.__metadata("design:type",Object)],m.prototype,"aiReporter",void 0),t.MCPServerRegistry=m=n.__decorate([(0,r.Injectable)()],m)},30703:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MCPToolsDialog=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(49783)),a=({tools:p})=>r.createElement("div",{className:o.default.mcp_tools_dialog},r.createElement("div",{className:o.default.dialog_title},"MCP Tools"),r.createElement("div",{className:o.default.tools_list},p.map(v=>r.createElement("div",{key:v.name,className:o.default.tool_item},r.createElement("div",{className:o.default.tool_name},v.name),r.createElement("div",{className:o.default.tool_description},v.description),v.providerName&&r.createElement("div",{className:o.default.tool_provider},"Provider: ",v.providerName)))));t.MCPToolsDialog=a},58260:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditFileToolComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),a=e(97267),p=e(41869),v=e(54414),m=e(14162),_=e(87822),s=e(16781),g=e(21967),l=e(56474),h=e(73974),u=n.__importDefault(e(51601)),d=E=>{var f,c,y;const{args:b,messageId:A,toolCallId:S}=E,[D,I]=(0,o.useState)("code"),w=(0,p.useInjectable)(p.LabelService),T=(0,p.useInjectable)(p.AppConfig),R=(0,p.useInjectable)(h.BaseApplyService),P=(0,p.useInjectable)(v.WorkbenchEditorService),{target_file:O="",code_edit:M,instructions:k}=b||{},F=p.path.join(T.workspaceDir,O),[L,B]=(0,o.useState)(R.getCodeBlock(S,A)),U=(0,o.useMemo)(()=>O?`file-icon ${w.getIcon(p.URI.file(F))}`:void 0,[O,F]),W=(0,o.useMemo)(()=>{if(!O)return;const G=s.StandaloneServices.get(_.IModelService),Z=s.StandaloneServices.get(m.ILanguageService);return(0,p.detectModeId)(G,Z,p.Uri.file(F))},[O,F]),j=(0,o.useMemo)(()=>{var G,Z;if(L?.status==="failed")try{return(Z=(G=JSON.parse(E.result||"{}").content)===null||G===void 0?void 0:G[0])===null||Z===void 0?void 0:Z.text}catch{return""}},[E.result,L]);(0,o.useEffect)(()=>{const G=R.onCodeBlockUpdate(Z=>{Z.toolCallId===S&&B({...Z})});return()=>{G.dispose()}},[]);const Q=G=>{G.stopPropagation(),I(D==="code"?"diff":"code")};return!b||!L?null:[k&&o.default.createElement("p",{key:"edit-file-tool-instructions"},k),o.default.createElement("div",{className:u.default["edit-file-tool"],key:"edit-file-tool"},o.default.createElement("div",{className:(0,r.default)(u.default["edit-file-tool-header"],{clickable:L.status==="pending"||L.status==="success"}),onClick:()=>{L.status==="pending"?P.open(p.URI.file(F)):L.status==="success"&&R.revealApplyPosition(L)}},o.default.createElement("div",{className:u.default.left},U&&o.default.createElement("span",{className:U}),o.default.createElement("span",{className:u.default["edit-file-tool-file-name"]},O),L.iterationCount>1&&o.default.createElement("span",{className:u.default["edit-file-tool-iteration-count"]},L.iterationCount,"/3"),o.default.createElement(g.ApplyStatus,{status:L.status,error:j})),o.default.createElement("div",{className:u.default.right},o.default.createElement(a.Popover,{title:"Show Code",id:"edit-file-tool-show-code"},o.default.createElement(a.Icon,{iconClass:"codicon codicon-file-code",onClick:Q})),((f=L.applyResult)===null||f===void 0?void 0:f.diff)&&o.default.createElement(a.Popover,{title:"Show Diff",id:"edit-file-tool-show-diff"},o.default.createElement(a.Icon,{iconClass:"codicon codicon-diff-multiple",onClick:Q})))),o.default.createElement(l.ChatMarkdown,{markdown:D==="code"?`\`\`\`${W||""}
31734
31734
  ${M}
31735
31735
  \`\`\``:`\`\`\`diff
@@ -31765,7 +31765,7 @@ ${u.applyResult.diagnosticInfos.map(d=>`Line ${d.startLineNumber}: ${d.message.s
31765
31765
  `)[0]}`).join(`
31766
31766
  `)}
31767
31767
 
31768
- Please fix the linter errors if it is clear how to (or you can easily figure out how to). Do not make uneducated guesses. And do not loop more than 3 times on fixing linter errors on the same file.`:"The apply model made no changes to the file."}`:"User cancelled the edit."}]}}};t.EditFileTool=s,n.__decorate([(0,o.Autowired)(m.EditFileHandler),n.__metadata("design:type",m.EditFileHandler)],s.prototype,"editFileHandler",void 0),t.EditFileTool=s=n.__decorate([(0,a.Domain)(p.MCPServerContribution)],s)},80173:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),a=e(79240),p=e(43718),v=e(87863),m=e(84660),_=e(51500),s=e(19413),g=e(59347),l=e(77633),h=e(95292),u=r.z.object({query:r.z.string().describe("Fuzzy filename to search for"),explanation:r.z.string().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}),d=10;let E=class{registerMCPServer(c){c.registerMCPTool(this.getToolDefinition()),c.registerToolComponent("file_search",h.FileSearchToolComponent)}getToolDefinition(){return{name:"file_search",label:"Search Files",order:6,description:"Fast file search based on fuzzy matching against file path. Use if you know part of the file path but don't know where it's located exactly. Response will be capped to 10 results. Make your query more specific if need to filter results further.",inputSchema:u,handler:this.handler.bind(this)}}async handler(c,y){if(!c.query)throw new Error("No fileSearch parameters provided. Need to give a query.");const b=this.workspaceService.tryGetRoots();if(!b||b.length===0)throw new Error("Cannot determine project directory");const A=this.normalizeQuery(c.query),S=await this.fileSearchService.find(A,{rootUris:[new p.URI(b[0].uri).codeUri.fsPath],excludePatterns:Object.keys(v.defaultFilesWatcherExcludes),limit:100,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0}),D=S.slice(0,d).map(w=>({uri:p.URI.parse(w).codeUri.fsPath,isDirectory:!1})),I=this.chatInternalService.sessionModel.history.getMessages();return this.chatInternalService.sessionModel.history.setMessageAdditional(I[I.length-1].id,{[c.toolCallId]:{files:D}}),y.appendLine(`Found ${D.length} files matching "${c.query}"`),{content:[{type:"text",text:`${D.map(w=>w.uri).join(`
31768
+ Please fix the linter errors if it is clear how to (or you can easily figure out how to). Do not make uneducated guesses. And do not loop more than 3 times on fixing linter errors on the same file.`:""}`:u.status==="cancelled"?"User cancelled the edit.":"The apply model made no changes to the file."}]}}};t.EditFileTool=s,n.__decorate([(0,o.Autowired)(m.EditFileHandler),n.__metadata("design:type",m.EditFileHandler)],s.prototype,"editFileHandler",void 0),t.EditFileTool=s=n.__decorate([(0,a.Domain)(p.MCPServerContribution)],s)},80173:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),a=e(79240),p=e(43718),v=e(87863),m=e(84660),_=e(51500),s=e(19413),g=e(59347),l=e(77633),h=e(95292),u=r.z.object({query:r.z.string().describe("Fuzzy filename to search for"),explanation:r.z.string().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}),d=10;let E=class{registerMCPServer(c){c.registerMCPTool(this.getToolDefinition()),c.registerToolComponent("file_search",h.FileSearchToolComponent)}getToolDefinition(){return{name:"file_search",label:"Search Files",order:6,description:"Fast file search based on fuzzy matching against file path. Use if you know part of the file path but don't know where it's located exactly. Response will be capped to 10 results. Make your query more specific if need to filter results further.",inputSchema:u,handler:this.handler.bind(this)}}async handler(c,y){if(!c.query)throw new Error("No fileSearch parameters provided. Need to give a query.");const b=this.workspaceService.tryGetRoots();if(!b||b.length===0)throw new Error("Cannot determine project directory");const A=this.normalizeQuery(c.query),S=await this.fileSearchService.find(A,{rootUris:[new p.URI(b[0].uri).codeUri.fsPath],excludePatterns:Object.keys(v.defaultFilesWatcherExcludes),limit:100,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0}),D=S.slice(0,d).map(w=>({uri:p.URI.parse(w).codeUri.fsPath,isDirectory:!1})),I=this.chatInternalService.sessionModel.history.getMessages();return this.chatInternalService.sessionModel.history.setMessageAdditional(I[I.length-1].id,{[c.toolCallId]:{files:D}}),y.appendLine(`Found ${D.length} files matching "${c.query}"`),{content:[{type:"text",text:`${D.map(w=>w.uri).join(`
31769
31769
  `)}
31770
31770
  ${S.length>d?`
31771
31771
  Found ${S.length} files matching "${c.query}", only return the first ${d} results`:""}`}]}}normalizeQuery(c){const y=c.trim().replace(/\s/g,"");return(0,a.getValidateInput)(y)}};t.FileSearchTool=E,n.__decorate([(0,o.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],E.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(m.FileSearchServicePath),n.__metadata("design:type",Object)],E.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(s.IChatInternalService),n.__metadata("design:type",g.ChatInternalService)],E.prototype,"chatInternalService",void 0),t.FileSearchTool=E=n.__decorate([(0,p.Domain)(l.MCPServerContribution)],E)},30645:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDiagnosticsByPathTool=void 0;const n=e(85608),r=n.__importStar(e(64756)),o=e(75995),a=e(76003),p=e(43718),v=e(51500),m=e(26592),_=e(34835),s=e(77633),g=o.z.object({filePathInProject:o.z.string().describe("The relative path to the file to get diagnostics for")});let l=class{registerMCPServer(u){u.registerMCPTool(this.getToolDefinition())}getToolDefinition(){return{name:"get_diagnostics_by_path",label:"Get Diagnostics By Path",order:9,description:`Retrieves diagnostic information (errors, warnings, etc.) from a specific file in the project. Use this tool to get information about problems in any project file. IMPORTANT: This tool should be called after any code generation or modification operations to verify and fix potential issues. Requires a filePathInProject parameter specifying the target file path relative to project root. Returns a JSON-formatted list of diagnostics, where each entry contains: - path: The file path where the diagnostic was found - line: The line number (1-based) of the diagnostic - severity: The severity level ("error", "warning", "information", or "hint") - message: The diagnostic message Returns an empty list ([]) if no diagnostics are found or the file doesn't exist. Best Practice: Always check diagnostics after code generation to ensure code quality and fix any issues immediately. Use this tool in combination with get_open_in_editor_file_diagnostics to verify all affected files after code changes. Diagnostic Severity Handling Guidelines: - "error": Must be fixed immediately as they indicate critical issues that will prevent code from working correctly. - "warning": For user code, preserve unless the warning indicates a clear improvement opportunity. For generated code, optimize to remove warnings. - "information"/"hint": For user code, preserve as they might reflect intentional patterns. For generated code, optimize if it improves code quality without changing functionality.`,inputSchema:g,handler:this.handler.bind(this)}}async handler(u,d){try{const E=this.workspaceService.tryGetRoots();if(!E||E.length===0)return d.appendLine("Error: Cannot determine project directory"),{content:[{type:"text",text:"[]"}],isError:!0};const f=p.URI.parse(E[0].uri),c=r.join(f.codeUri.fsPath,u.filePathInProject),y=m.URI.file(c),b=r.relative(f.codeUri.fsPath,c);if(b.startsWith("..")||r.isAbsolute(b))return d.appendLine("Error: File is outside of project scope"),{content:[{type:"text",text:"[]"}],isError:!0};const S=this.markerService.read({resource:y}).map(I=>({path:u.filePathInProject,line:I.startLineNumber,severity:this.getSeverityString(I.severity),message:I.message})),D=JSON.stringify(S,null,2);return d.appendLine(`Found ${S.length} diagnostics in ${u.filePathInProject}`),{content:[{type:"text",text:D}]}}catch(E){return d.appendLine(`Error getting diagnostics: ${E}`),{content:[{type:"text",text:"[]"}],isError:!0}}}getSeverityString(u){switch(u){case _.MarkerSeverity.Error:return"error";case _.MarkerSeverity.Warning:return"warning";case _.MarkerSeverity.Info:return"information";case _.MarkerSeverity.Hint:return"hint";default:return"unknown"}}};t.GetDiagnosticsByPathTool=l,n.__decorate([(0,a.Autowired)(v.IWorkspaceService),n.__metadata("design:type",Object)],l.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(_.IMarkerService),n.__metadata("design:type",Object)],l.prototype,"markerService",void 0),t.GetDiagnosticsByPathTool=l=n.__decorate([(0,p.Domain)(s.MCPServerContribution)],l)},82078:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetOpenEditorFileDiagnosticsTool=void 0;const n=e(85608),r=n.__importStar(e(64756)),o=e(75995),a=e(76003),p=e(43718),v=e(54414),m=e(51500),_=e(26592),s=e(34835),g=e(77633),l=o.z.object({});let h=class{registerMCPServer(d){d.registerMCPTool(this.getToolDefinition())}getToolDefinition(){return{name:"get_open_in_editor_file_diagnostics",label:"Get Current Editor Diagnostics",order:8,description:'Retrieves diagnostic information (errors, warnings, etc.) from the currently active file in VS Code editor. Use this tool to get information about problems in your current file. IMPORTANT: This tool should be called after any code generation or modification operations to verify and fix potential issues. Returns a JSON-formatted list of diagnostics, where each entry contains: - path: The file path where the diagnostic was found - line: The line number (1-based) of the diagnostic - severity: The severity level ("error", "warning", "information", or "hint") - message: The diagnostic message Returns an empty list ([]) if no diagnostics are found or no file is open. Best Practice: Always check diagnostics after code generation to ensure code quality and fix any issues immediately. Diagnostic Severity Handling Guidelines: - "error": Must be fixed immediately as they indicate critical issues that will prevent code from working correctly. - "warning": For user code, preserve unless the warning indicates a clear improvement opportunity. For generated code, optimize to remove warnings. - "information"/"hint": For user code, preserve as they might reflect intentional patterns. For generated code, optimize if it improves code quality without changing functionality.',inputSchema:l,handler:this.handler.bind(this)}}async handler(d,E){try{const f=this.editorService.currentEditor;if(!f||!f.currentUri)return E.appendLine("Error: No active text editor found"),{content:[{type:"text",text:"[]"}],isError:!0};const c=this.workspaceService.tryGetRoots();if(!c||c.length===0)return E.appendLine("Error: Cannot determine project directory"),{content:[{type:"text",text:"[]"}],isError:!0};const y=_.URI.parse(f.currentUri.toString()),b=this.markerService.read({resource:y}),A=p.URI.parse(c[0].uri),S=r.relative(A.codeUri.fsPath,f.currentUri.codeUri.fsPath),D=b.map(w=>({path:S,line:w.startLineNumber,severity:this.getSeverityString(w.severity),message:w.message})),I=JSON.stringify(D,null,2);return E.appendLine(`Found ${D.length} diagnostics in current file`),{content:[{type:"text",text:I}]}}catch(f){return E.appendLine(`Error getting diagnostics: ${f}`),{content:[{type:"text",text:"[]"}],isError:!0}}}getSeverityString(d){switch(d){case s.MarkerSeverity.Error:return"error";case s.MarkerSeverity.Warning:return"warning";case s.MarkerSeverity.Info:return"information";case s.MarkerSeverity.Hint:return"hint";default:return"unknown"}}};t.GetOpenEditorFileDiagnosticsTool=h,n.__decorate([(0,a.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],h.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],h.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(s.IMarkerService),n.__metadata("design:type",Object)],h.prototype,"markerService",void 0),t.GetOpenEditorFileDiagnosticsTool=h=n.__decorate([(0,p.Domain)(g.MCPServerContribution)],h)},39855:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrepSearchTool=void 0;const n=e(85608),r=e(75995),o=e(76003),a=e(43718),p=e(13439),v=e(51495),m=e(51500),_=e(19413),s=e(59347),g=e(77633),l=e(95292),h=r.z.object({query:r.z.string().describe("The regex pattern to search for"),case_sensitive:r.z.boolean().optional().describe("Whether the search should be case sensitive"),include_pattern:r.z.string().optional().describe('Glob pattern for files to include (e.g. "*.ts" for TypeScript files)'),exclude_pattern:r.z.string().optional().describe("Glob pattern for files to exclude"),explanation:r.z.string().optional().describe("One sentence explanation as to why this tool is being used, and how it contributes to the goal.")}),u=50;let d=class{registerMCPServer(f){f.registerMCPTool(this.getToolDefinition()),f.registerToolComponent("grep_search",l.GrepSearchToolComponent)}getToolDefinition(){return{name:"grep_search",label:"Search Contents",order:4,description:`Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.
@@ -31921,7 +31921,7 @@ Tokenizing line: ${R}`);for(let W=0;W<B.tokens.length;W++){const j=B.tokens[W];U
31921
31921
  //# sourceURL=${I.id}`)(P,O,M,k,L,B),{moduleExports:w?P.exports.default:P.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)(_.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)(l.AbstractWorkerExtProcessService),r.__metadata("design:type",l.AbstractWorkerExtProcessService)],A.prototype,"workerExtensionService",void 0),r.__decorate([(0,o.Autowired)(l.AbstractNodeExtProcessService),r.__metadata("design:type",l.AbstractNodeExtProcessService)],A.prototype,"nodeExtensionService",void 0),r.__decorate([(0,o.Autowired)(),r.__metadata("design:type",m.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)(_.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerExtProcessService=void 0;const n=e(85608),r=e(76003),o=e(84605),a=e(8919),p=e(92917),v=e(41869),m=e(43718),_=e(99220),s=e(37846),g=e(30824),l=e(28949),h=e(51072),u=e(17802),d=e(65055),{posix:E}=m.path;let f=class extends m.Disposable{constructor(){super(...arguments),this.ready=new v.Deferred,this._extHostUpdated=new v.Deferred,this.extensions=[],this.apiFactoryDisposable=new m.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,u.initSharedAPIProxy)(this.protocol,this.injector);this.apiFactoryDisposable.add(b),this.apiFactoryDisposable.add((0,m.toDisposable)((0,h.initWorkerThreadAPIProxy)(this.protocol,this.injector,this))),this.apiFactoryDisposable.add((0,m.toDisposable)((0,l.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:I,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}(I.sumiContributes&&(!((S=y.contributes)===null||S===void 0)&&S.workerMain)||b&&I.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:I}=(0,d.startInsideIframe)(y),w=T=>{if(T.source===D.contentWindow&&T.data.kaitianWebWorkerExtHostId===I&&T.data.data instanceof MessagePort){S.resolve(T.data.data);return}};window.addEventListener("message",w),this.apiFactoryDisposable.add({dispose:()=>{window.removeEventListener("message",w),D.remove()}}),S.promise.then(T=>{b(this.createProtocol(T))})}else try{const D=new Worker(y,{name:"KaitianWorkerExtensionHost"});D.onmessage=I=>{I.data instanceof MessagePort&&S.resolve(I.data)},D.onerror=I=>{A(I)},this.apiFactoryDisposable.add({dispose:()=>{D.terminate(),D.onmessage=null,D.onerror=null}}),S.promise.then(I=>{b(this.createProtocol(I))})}catch(D){A(D)}})}createProtocol(y){this.connection=new p.MessagePortConnection(y);const b=new a.SumiConnectionMultiplexer(this.connection,{timeout:this.appConfig.rpcMessageTimeout,name:"worker-ext-host",io:(0,a.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(_.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:(x,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),a=e(29220),p=e(54414),v=e(55113),m=e(72665),_=e(65046),s=e(99220),g=e(53043),l=e(71354),h=n.__importStar(e(72980)),u=e(17441),d=c=>c.get(o.IApplicationService).clientId;t.getClientId=d;let E=class{initialize(){this.extensionService.activate().then(()=>{const y=this.webviewService.registerWebviewReviver({handles:()=>0,revive:async b=>new Promise(A=>{this.eventBus.on(l.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)(a.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)(_.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 l.ExtHostEvent({eventName:b,eventArgs:A})),D=[];return S.forEach(I=>{I.err?D.push(I):D.push(...I.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:a.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),I=A==="default"?void 0:{type:v.EditorOpenType.component,componentId:`${o.CUSTOM_EDITOR_SCHEME}-${A}`};return this.doOpenWith(D,S,void 0,I)}}),y.registerCommand(h.DIFF,{execute:(b,A,S,D)=>{const I={...(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},I)}}),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,I]=b??[],w={};if(typeof D=="number"&&(w.groupIndex=D),I){if(w.focus=w.preserveFocus=I.preserveFocus,I.selection&&(0,g.isLikelyVscodeRange)(I.selection)&&(I.selection=(0,g.fromRange)(I.selection)),Array.isArray(I.selection)&&I.selection.length===2){const[T,R]=I.selection;w.range={startLineNumber:T.line+1,startColumn:T.character+1,endLineNumber:R.line+1,endColumn:R.character+1}}else w.range=I.selection;w.preview=I.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)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],f.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(l.IActivationEventService),n.__metadata("design:type",l.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)(a.IStatusBarService),n.__metadata("design:type",Object)],f.prototype,"statusBar",void 0),n.__decorate([(0,r.Autowired)(m.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)(_.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)(l.AbstractExtInstanceManagementService),n.__metadata("design:type",l.AbstractExtInstanceManagementService)],f.prototype,"extensionInstanceManageService",void 0),n.__decorate([(0,r.Autowired)(u.WalkthroughsService),n.__metadata("design:type",u.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Extension=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(40827),p=e(69734),v=e(99220),m=e(9663),_=e(71354),s=Symbol.for("metaDataSymbol");let g=class extends o.WithEventBus{constructor(h,u,d,E){super(),this.extensionData=h,this.isUseEnable=u,this.isBuiltin=d,this.isDevelopment=E,this.extraMetadata={},this._activated=!1,this.logger=(0,o.getDebugLogger)(),this.pkgLocalizedField=new Map,this._enabled=u,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 u=(0,o.replaceNlsField)(this.packageJSON[h],this.id);return this.pkgLocalizedField.set(h,u),u||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:p.LOCALE_TYPES.EN_US,localizedLanguageName:"English",contents:this.defaultPkgNlsJSON},this.id),this.extMetadataService.initialize(this))}async activate(h=new Set){var u;const d=((u=this.packageJSON)===null||u===void 0?void 0:u.extensionDependencies)||[];h.add(this.extensionId);for(const f of d){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 _.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 _.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)(m.ExtensionMetadataService),n.__metadata("design:type",m.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",a.StaticResourceService)],g.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.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:(x,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)),a=e(76003),p=e(18740),v=e(76271),m=e(41869),_=e(68969),s=e(43718),g=e(66482),l=e(50492),h=e(84660),u=e(14951),d=e(72665),E=e(51500),f=e(99220),c=e(25600),y=e(46147),b=e(57962),A=e(82389),S=e(71354),D=e(35321);let I=n=class extends s.WithEventBus{constructor(){super(),this.ready=new Map,this.isExtProcessRestarting=!1,this.isProgressShowing=!1,this.eagerExtensionsActivated=new m.Deferred,this.extensionScanDir=new Set,this.extensionCandidatePath=new Set,this.restartProgress=async(T=f.ERestartPolicy.Always)=>{const R=async O=>{this.disposeAllOverlayWindow(),O.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(M){this.logger.error(`[ext-restart]: ext-host restart failure, error: ${M}`)}this.isExtProcessRestarting=!1,this.isExtProcessWaitingForRestart=void 0,this.isProgressShowing=!1,this.disposeAllOverlayWindow()};await this.channelHandler.awaitChannelReady(v.RPCServiceChannelPath);const P=this.isExtProcessWaitingForRestart||T;switch(this.logger.log("[ext-restart]: restart ext process, restart policy:",P),P){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)(R),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 T={};return this.nodeExtensionService.protocol&&(T.node=await this.nodeExtensionService.getActivatedExtensions()),this.workerExtensionService.protocol&&(T.worker=await this.workerExtensionService.getActivatedExtensions()),T}async onActivateExtension(T){await this.activationEventService.fireEvent(T.payload.topic,T.payload.data)}async onExtensionEnabled(T){const R=T.payload;await this.updateExtHostData(),await this.fireActivationEventsIfNeed(R.packageJSON.activationEvents)}async onExtensionUninstalled(){await this.updateExtHostData()}async activate(){await this.initExtensionMetaData(),await this.initExtensionInstanceData(),await this.runEagerExtensionsContributes(),await this.setupExtensionNLSConfig(),this.doActivate();const T=()=>{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",T,!1),this.addDispose(m.Disposable.create(()=>{document.removeEventListener("visibilitychange",T)}))}async setupExtensionNLSConfig(){const T=await this.extensionStoragePathServer.getLastStoragePath()||"",R=this.preferenceService.get(s.GeneralSettingsId.Language)||(0,s.getLanguageId)();await this.extensionNodeClient.setupNLSConfig(R,T)}async initExtensionMetaData(){const{extensionDir:T,extensionCandidate:R}=this.appConfig;T&&this.extensionScanDir.add(T),R&&R.forEach(P=>{this.extensionCandidatePath.add(P.path)}),await this.getExtensionsMetaData(Array.from(this.extensionScanDir),Array.from(this.extensionCandidatePath))}async initExtensionInstanceData(){for(const R of this.extensionMetaDataArr){const P=this.extensionInstanceManageService.checkIsBuiltin(R),O=this.extensionInstanceManageService.checkIsDevelopment(R),M=await this.extensionInstanceManageService.createExtensionInstance(R,P,O);M&&this.extensionInstanceManageService.addExtensionInstance(M),M?.contributes&&M.enabled&&(this.contributesService.register(M.id,M.contributes),this.sumiContributesService.register(M.id,M.packageJSON.sumiContributes||{}))}this.eventBus.fire(new S.ExtensionsInitializedEvent(this.extensionInstanceManageService.getExtensionInstances())),this.eventBus.fire(new g.DebugConfigurationsReadyEvent(void 0));const T=this.extensionInstanceManageService.getExtensionInstances();this.nodeExtensionService.updateExtensionData(T),this.workerExtensionService.updateExtensionData(T),this.viewExtensionService.initExtension(T)}async doActivate(){await this.workspaceService.whenReady,await this.extensionStorageService.whenReady,await this.viewExtensionService.activate(),await this.startExtProcess(!0);try{await this.eventBus.fireAndAwait(new S.ExtensionBeforeActivateEvent),await this.activationEventService.fireEvent("*")}catch(T){this.logger.error(`[Extension Activate Error],
31922
31922
  ${T.message||T}`)}finally{this.eagerExtensionsActivated.resolve(),this.activationEventService.fireEvent("onStartupFinished"),this.eventBus.fire(new S.ExtensionApiReadyEvent)}}async restartExtProcess(T=f.ERestartPolicy.Always){document.visibilityState==="visible"?this.extProcessRestartHandler(T):(this.logger.log("[ext-restart]: page is not visible, waiting for restart, policy:",T),this.isExtProcessWaitingForRestart=T)}disposeAllOverlayWindow(){var T,R;this.pCrashMessageModel&&((R=(T=this.pCrashMessageModel).cancel)===null||R===void 0||R.call(T),this.pCrashMessageModel=void 0)}async extProcessRestartHandler(T=f.ERestartPolicy.Always){if(this.isExtProcessRestarting&&T!==f.ERestartPolicy.Always){this.logger.log("[ext-restart]: ext process is restarting, skip");return}this.isExtProcessRestarting=!0,this.isExtProcessWaitingForRestart?this.restartDebounced():this.restartProgress(T)}async getExtProcessPID(){return await Promise.race([this.extensionNodeClient.pid().catch(async T=>(this.logger.error(`[ext-restart]: get ext process pid error, ${T}`),await(0,s.sleep)(200),null)),(0,s.sleep)(1e3).then(()=>null)])}async startExtProcess(T){if(T||(this.resetExtensionInstances(),this.disposeSumiViewExtension(),await this.disposeExtProcess()),await Promise.all([this.startNodeExtHost(T),this.startWorkerExtHost(T)]),!T&&(await this.rerunSumiViewExtensionContributes(),this.activationEventService.activatedEventSet.size)){const R=Array.from(this.activationEventService.activatedEventSet);this.activationEventService.activatedEventSet.clear(),await Promise.allSettled(R.map(P=>{const{topic:O,data:M}=JSON.parse(P);return this.logger.verbose("fireEvent","event.topic",O,"event.data",M),this.activationEventService.fireEvent(O,M)}))}}async startNodeExtHost(T){if(this.appConfig.noExtHost)return;const R=await this.nodeExtensionService.activate();this.extensionCommandManager.registerProxyCommandExecutor("node",R.get(y.MainThreadAPIIdentifier.MainThreadCommands)),T&&this.ready.set("node",this.nodeExtensionService.ready)}async startWorkerExtHost(T){if(this.appConfig.extWorkerHost)try{const R=await this.workerExtensionService.activate(this.appConfig.ignoreWorkerHostCors);this.extensionCommandManager.registerProxyCommandExecutor("worker",R.get(y.MainThreadAPIIdentifier.MainThreadCommands)),T&&this.ready.set("worker",this.workerExtensionService.ready)}catch(R){this.logger.error(`Worker host activate fail,
31923
31923
  ${R.message}`)}}async updateExtHostData(){const T=this.extensionInstanceManageService.getExtensionInstances();this.appConfig.noExtHost||await this.nodeExtensionService.updateExtensionData(T),this.appConfig.extWorkerHost&&await this.workerExtensionService.updateExtensionData(T)}async fireActivationEventsIfNeed(T){if(!Array.isArray(T)||!T.length)return;const R=["*","onStartupFinished"],P=T.filter(M=>M!=="*"),O=Array.from(this.activationEventService.activatedEventSet).map(M=>JSON.parse(M)).filter(({topic:M,data:k})=>P.find(F=>F===`${M}:${k}`));for(const M of R)T.includes(M)&&(this.logger.verbose(`Fire activation event ${M}`),this.activationEventService.fireEvent(M));for(const M of O){const{topic:k,data:F}=M;this.logger.verbose(`Fire activation event ${k}:${F}`),this.activationEventService.fireEvent(k,F)}await this.activateByWorkspaceContains(T)}async activateByWorkspaceContains(T){if(!Array.isArray(T)||!T.length)return;const R=[],P=[];for(const M of T)if(/^workspaceContains:/.test(M)){const k=M.substr(18);k.indexOf("*")>=0||k.indexOf("?")>=0?P.push(k):R.push(k)}const O=[];R.length&&O.push(this.workspaceService.containsSome(R)),P.length&&O.push((async()=>{try{return(await this.fileSearchService.find("",{rootUris:this.workspaceService.tryGetRoots().map(k=>new s.URI(k.uri).codeUri.fsPath),includePatterns:P,limit:1})).length>0}catch(M){return this.logger.error(M),!1}})()),O.length&&await Promise.all(O).then(M=>M.some(k=>k))&&this.activationEventService.fireEvent("workspaceContains",[...R,...P][0])}async getExtensionsMetaData(T,R){if(!this.extensionMetaDataArr){const P=await this.extensionNodeClient.getAllExtensions(T,R,(0,s.getLanguageId)(),n.extraMetadata);this.extensionMetaDataArr=P}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(T,R)=>(await this.activationEventService.fireEvent("onCommand",T),R)),this.eventBus.fire(new s.ExtensionDidContributes)}async runExtensionContributes(){const T=Array.from(this.extensionInstanceManageService.getExtensionInstances());Promise.all(T.map(R=>this.activateByWorkspaceContains(R.packageJSON.activationEvents))).catch(R=>this.logger.error(R))}whetherWebExtension({packageJSON:T}){const{browser:R,main:P}=T||{},O=!!this.appConfig.noExtHost;if(R&&!P)return!0;if(R&&P)return O;if(!R&&P)return!1;if(typeof T.contributes<"u"){for(const M of["debuggers","terminal","typescriptServerPlugins"])if(T.contributes.hasOwnProperty(M))return!1}return O}async activeExtension(T){const R=this.whetherWebExtension(T);R&&!this.appConfig.extWorkerHost&&this.logger.error("[extension.service]: has no ext worker host"),await Promise.all([this.nodeExtensionService.activeExtension(T,R),this.workerExtensionService.activeExtension(T,R)]),await this.viewExtensionService.activeExtension(T,this.nodeExtensionService.protocol),this.eventBus.fire(new s.ExtensionActivatedEvent({topic:"onExtensionActivated",data:{id:T.id}}))}resetExtensionInstances(){this.extensionInstanceManageService.resetExtensionInstances(),this.nodeExtensionService.disposeApiFactory(),this.workerExtensionService.disposeApiFactory()}disposeSumiViewExtension(){const T=Array.from(this.viewExtensionService.activatedViewExtensionMap.keys());this.extensionInstanceManageService.disposeExtensionInstancesByPath(T)}async rerunSumiViewExtensionContributes(){const{activatedViewExtensionMap:T}=this.viewExtensionService,R=Array.from(T.keys());await Promise.all(R.map(P=>{const O=this.extensionInstanceManageService.getExtensionInstanceByPath(P);O&&(O.initialize(),this.sumiContributesService.register(O.id,O.packageJSON.sumiContributes||{}))})),T.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(T,R){var P;const O=this.extensionCommandManager.getExtensionCommandEnv(T);if(!O)throw new Error('No Command with id "'+T+'" is declared by extensions');return await((P=this.ready.get(O))===null||P===void 0?void 0:P.promise),this.extensionCommandManager.executeExtensionCommand(O,T,R)}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 T=(0,s.localize)("extension.invalidExthostReload.confirm.ok"),R=[T],P=this.invalidReloadStrategy==="ifRequired";P&&R.unshift((0,s.localize)("extension.invalidExthostReload.confirm.cancel")),await this.dialogService.info((0,s.localize)("extension.invalidExthostReload.confirm.content"),R,!!P)===T&&this.clientApp.fireOnReload()}async $processCrashRestart(){var T,R;this.pCrashMessageModel&&((R=(T=this.pCrashMessageModel).cancel)===null||R===void 0||R.call(T));const P=(0,s.localize)("common.yes"),O=[P],M=this.invalidReloadStrategy==="ifRequired";M&&O.unshift((0,s.localize)("common.no")),this.pCrashMessageModel=this.messageService.info((0,s.localize)("extension.crashedExthostReload.confirm"),O,!!M);const k=await this.pCrashMessageModel;this.pCrashMessageModel=void 0,k===P&&await this.restartExtProcess(f.ERestartPolicy.Always)}};t.ExtensionServiceImpl=I,I.extraMetadata={[f.LANGUAGE_BUNDLE_FIELD]:"./package.nls.json"},r.__decorate([(0,a.Autowired)(f.ExtensionNodeServiceServerPath),r.__metadata("design:type",Object)],I.prototype,"extensionNodeClient",void 0),r.__decorate([(0,a.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],I.prototype,"appConfig",void 0),r.__decorate([(0,a.Autowired)(m.CommandRegistry),r.__metadata("design:type",Object)],I.prototype,"commandRegistry",void 0),r.__decorate([(0,a.Autowired)(S.IActivationEventService),r.__metadata("design:type",b.ActivationEventServiceImpl)],I.prototype,"activationEventService",void 0),r.__decorate([(0,a.Autowired)(E.IWorkspaceService),r.__metadata("design:type",Object)],I.prototype,"workspaceService",void 0),r.__decorate([(0,a.Autowired)(l.IExtensionStorageService),r.__metadata("design:type",Object)],I.prototype,"extensionStorageService",void 0),r.__decorate([(0,a.Autowired)(_.IProgressService),r.__metadata("design:type",Object)],I.prototype,"progressService",void 0),r.__decorate([(0,a.Autowired)(d.IDialogService),r.__metadata("design:type",Object)],I.prototype,"dialogService",void 0),r.__decorate([(0,a.Autowired)(m.IClientApp),r.__metadata("design:type",Object)],I.prototype,"clientApp",void 0),r.__decorate([(0,a.Autowired)(m.ILogger),r.__metadata("design:type",Object)],I.prototype,"logger",void 0),r.__decorate([(0,a.Autowired)(d.IMessageService),r.__metadata("design:type",Object)],I.prototype,"messageService",void 0),r.__decorate([(0,a.Autowired)(m.CorePreferences),r.__metadata("design:type",Object)],I.prototype,"corePreferences",void 0),r.__decorate([(0,a.Autowired)(c.AbstractWorkerExtProcessService),r.__metadata("design:type",c.AbstractWorkerExtProcessService)],I.prototype,"workerExtensionService",void 0),r.__decorate([(0,a.Autowired)(c.AbstractNodeExtProcessService),r.__metadata("design:type",c.AbstractNodeExtProcessService)],I.prototype,"nodeExtensionService",void 0),r.__decorate([(0,a.Autowired)(c.AbstractViewExtProcessService),r.__metadata("design:type",c.AbstractViewExtProcessService)],I.prototype,"viewExtensionService",void 0),r.__decorate([(0,a.Autowired)(f.IExtCommandManagement),r.__metadata("design:type",f.IExtCommandManagement)],I.prototype,"extensionCommandManager",void 0),r.__decorate([(0,a.Autowired)(S.AbstractExtInstanceManagementService),r.__metadata("design:type",S.AbstractExtInstanceManagementService)],I.prototype,"extensionInstanceManageService",void 0),r.__decorate([(0,a.Autowired)(h.FileSearchServicePath),r.__metadata("design:type",Object)],I.prototype,"fileSearchService",void 0),r.__decorate([(0,a.Autowired)(D.VSCodeContributesServiceToken),r.__metadata("design:type",D.VSCodeContributesService)],I.prototype,"contributesService",void 0),r.__decorate([(0,a.Autowired)(A.SumiContributionsServiceToken),r.__metadata("design:type",A.SumiContributionsService)],I.prototype,"sumiContributesService",void 0),r.__decorate([(0,a.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],I.prototype,"preferenceService",void 0),r.__decorate([(0,a.Autowired)(l.IExtensionStoragePathServer),r.__metadata("design:type",Object)],I.prototype,"extensionStoragePathServer",void 0),r.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),r.__metadata("design:type",a.Injector)],I.prototype,"injector",void 0),r.__decorate([(0,a.Autowired)(u.IFileServiceClient),r.__metadata("design:type",Object)],I.prototype,"fileServiceClient",void 0),r.__decorate([(0,a.Autowired)(p.WSChannelHandler),r.__metadata("design:type",p.WSChannelHandler)],I.prototype,"channelHandler",void 0),r.__decorate([(0,s.OnEvent)(m.ExtensionActivateEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[m.ExtensionActivateEvent]),r.__metadata("design:returntype",Promise)],I.prototype,"onActivateExtension",null),r.__decorate([(0,s.OnEvent)(S.ExtensionDidEnabledEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[S.ExtensionDidEnabledEvent]),r.__metadata("design:returntype",Promise)],I.prototype,"onExtensionEnabled",null),r.__decorate([(0,s.OnEvent)(S.ExtensionDidUninstalledEvent),r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",Promise)],I.prototype,"onExtensionUninstalled",null),t.ExtensionServiceImpl=I=n=r.__decorate([(0,a.Injectable)(),r.__metadata("design:paramtypes",[])],I)},40731:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionModule=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(97186),p=e(64582),v=e(84660),m=e(99220),_=e(25600),s=e(72464),g=e(57962),l=e(87444),h=e(49413),u=e(98453),d=e(20670),E=e(90731),f=e(98736),c=e(62040),y=e(87543),b=e(70108),A=e(82389),S=e(71354),D=e(77385),I=e(35321);let w=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=[m.RequireInterceptorContribution,s.MainThreadExtenderContribution],this.providers=[{token:m.ExtensionService,useClass:y.ExtensionServiceImpl},{token:p.IDebugServer,useClass:D.ExtensionDebugService,override:!0},{token:a.DebugSessionContributionRegistry,useClass:D.ExtensionDebugSessionContributionRegistry,override:!0},{token:S.IActivationEventService,useClass:g.ActivationEventServiceImpl},{token:m.IExtCommandManagement,useClass:l.ExtCommandManagementImpl},{token:S.AbstractExtInstanceManagementService,useClass:h.ExtInstanceManagementService},{token:m.AbstractExtensionManagementService,useClass:u.ExtensionManagementService},{token:_.AbstractNodeExtProcessService,useClass:d.NodeExtProcessService},{token:_.AbstractWorkerExtProcessService,useClass:f.WorkerExtProcessService},{token:_.AbstractViewExtProcessService,useClass:E.ViewExtProcessService},{token:m.IRequireInterceptorService,useClass:m.RequireInterceptorService},{token:I.VSCodeContributesServiceToken,useClass:I.VSCodeContributesService},{token:A.SumiContributionsServiceToken,useClass:A.SumiContributionsService},{token:s.IMainThreadExtenderService,useClass:s.MainThreadExtenderService},c.ExtensionCommandContribution,c.ExtensionClientAppContribution,b.BrowserRequireInterceptorContribution],this.backServices=[{servicePath:m.ExtensionNodeServiceServerPath,clientToken:m.ExtensionService},{servicePath:v.FileSearchServicePath},{servicePath:m.ExtensionHostProfilerServicePath}]}};t.ExtensionModule=w,t.ExtensionModule=w=n.__decorate([(0,r.Injectable)()],w)},30824:(x,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionMetadataService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(71354);let p=class extends o.Disposable{initialize(m){this.eventBus.fire(new o.ExtensionEnabledEvent(m.toJSON())),this.addDispose(this.registerActivationEvent(m))}registerActivationEvent(m){const{activationEvents:_=[]}=m.packageJSON,s=new o.Disposable;return _.forEach(g=>{g==="onUri"&&(g=`onUri:${m.id}`),s.addDispose(this.activationService.onEvent(g,async()=>{await m.activate()}))}),s}};t.ExtensionMetadataService=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)(),n.__metadata("design:type",a.IActivationEventService)],p.prototype,"activationService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],p.prototype,"eventBus",void 0),t.ExtensionMetadataService=p=n.__decorate([(0,r.Injectable)({multiple:!0})],p)},54107:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProxiedDocument=r,t.createProxiedWindow=o;function e(){}function n(a,p){return typeof a[p]=="function"&&/^[a-z]/.test(p)?a[p].bind&&a[p].bind(a):a[p]}function r(a){return new Proxy(document,{get:(p,v)=>{switch(v){case"write":case"writeln":return e;case"querySelector":return m=>m==="head"?a:n(p,v)(m);default:return n(p,v)}}})}function o(a,p){return new Proxy(window,{get:(v,m)=>{switch(m){case"document":return a||r(p);default:return n(v,m)}}})}},70108:(x,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)),a=n.__importDefault(e(25873)),p=e(41869),v=e(89953),m=e(57996),_={...o.default,...a.default};let s=class{registerRequireInterceptor(l){l.registerRequireInterceptor({moduleName:"React",load:()=>r.default}),l.registerRequireInterceptor({moduleName:"ReactDOM",load:()=>_}),l.registerRequireInterceptor({moduleName:"ReactDOMClient",load:()=>a.default}),l.registerRequireInterceptor({moduleName:"kaitian-browser",load:h=>(0,m.createBrowserApi)(h.injector,h.extension,h.rpcProtocol)}),l.registerRequireInterceptor({moduleName:"sumi-browser",load:h=>(0,m.createBrowserApi)(h.injector,h.extension,h.rpcProtocol)})}};t.BrowserRequireInterceptorContribution=s,t.BrowserRequireInterceptorContribution=s=n.__decorate([(0,p.Domain)(v.RequireInterceptorContribution)],s)},9438:(x,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(l){const h=[];return e.forEach(u=>{const d=s(u);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=p(y),S=a(y);if(S?b=S:b=m(A),A&&b&&_(f,u,b),A&&b&&r[u]&&_(f,r[u],b),f.cancelBubble||y===l)break}}l.addEventListener(d,E,!1),h.push(()=>{l.removeEventListener(d,E,!1)})}),()=>{h.forEach(u=>{u()})}}function a(l){return v(l,"__reactEventHandlers")}function p(l){return v(l,"_reactInternal")}function v(l,h){for(const u in l)if(l.hasOwnProperty(u)&&u.indexOf(h)!==-1)return l[u]}function m(l){if(l){if(l.memoizedProps)return l.memoizedProps;if(l._currentElement&&l._currentElement.props)return l._currentElement.props}}function _(l,h,u){l.persist=()=>{l.isPersistent=()=>!0},u[h]&&u[h](l)}function s(l){return n[l]?n[l]:l.replace(/^on/,"").toLowerCase()}function g(l){const h=[];for(;l;){if(h.push(l),l.tagName==="HTML")return h.push(document),h.push(window),h;l=l.parentElement}}},8403:(x,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)),a=n.__importDefault(e(43144)),p=e(97267),v=e(41869),m=e(43718),_=e(52416),s=e(25600),g=e(26351),l=({root:b,children:A})=>a.default.createPortal(A,b);function h(b){return b.cloneNode(!0)}function u(b,A){const S=new MutationObserver(D=>{for(const I of D)if(I.type==="childList"){if(I.addedNodes.length>0)for(const w of Array.from(I.addedNodes))A.appendChild(w.cloneNode(!0));if(I.removedNodes.length>0)for(const w of Array.from(I.removedNodes))A.contains(w)&&A.removeChild(w)}});return S.observe(b,{childList:!0,subtree:!0}),{dispose:()=>{S.disconnect()}}}const d="@opensumi/ide-components";function E(b,A,S="alipay"){return(0,v.getCDNHref)(d,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:I,styleSheet:w})=>{const T=(0,o.useRef)(null),[R,P]=o.default.useState(null),O=(0,v.useInjectable)(s.AbstractViewExtProcessService),M=(0,v.useInjectable)(_.IThemeService),k=(0,v.useInjectable)(_.IIconService),F=(0,v.useInjectable)(_.IProductIconService),[L,B]=(0,o.useState)(null);return(0,o.useEffect)(()=>{var U,W;const j=new v.DisposableCollection;if(T.current){const Q=T.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,I))),D.appendChild(f(E("lib/icon/iconfont/iconfont.css",g.version,I))));const G=h(D);j.push(u(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=_.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||P(Q),M.getCurrentTheme().then(G=>B(G.type)),j.push(M.onThemeChange(G=>{G.type&&G.type!==L&&B(G.type)})),j.dispose.bind(j)}},[]),o.default.createElement("div",{id:b,style:{width:"100%",height:"100%"},ref:T},R&&o.default.createElement(l,{root:R},o.default.createElement("div",{className:(0,r.default)((0,_.getThemeTypeSelector)(L),"shadow-context-wrapper","show-file-icons"),style:{width:"100%",height:"100%"}},S)))};function y(b,A,S,D,I,w,T){const R=b,{getIcon:P}=o.default.useContext(p.IconContext),O=(0,v.useInjectable)(v.LabelService),M=(0,o.useCallback)((k,F)=>O.getIcon(m.URI.parse(k),F),[]);return o.default.createElement(p.ComponentContextProvider,{value:{getIcon:P,localize:m.localize,getResourceIcon:M}},o.default.createElement(c,{id:`${A.id}-${D}`,extensionId:A.id,proxiedHead:I,cdnType:w,styleSheet:T},o.default.createElement(R,{...S})))}},31381:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KaitianBrowserCommand=void 0,t.createBrowserCommandsApiFactory=_;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(21880),v=e(46147);let m=class{constructor(g){this.rpcProtocol=g,this.rpcProtocol&&(this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostCommands))}async executeCommand(g,l,...h){const u={id:l.id,extensionId:l.extensionId,isBuiltin:l.isBuiltin},d=this.commandRegistry.getCommand(g);if(this.proxy&&d)return this.proxy.$executeCommandWithExtensionInfo(g,u,...h);if(!this.commandRegistry.isPermittedCommand(g,u,...h))throw new Error(`Extension ${u.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=m,n.__decorate([(0,r.Autowired)(p.ICommandServiceToken),n.__metadata("design:type",Object)],m.prototype,"monacoCommandService",void 0),n.__decorate([(0,r.Autowired)(a.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.KaitianBrowserCommand=m=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],m);function _(s,g,l){const h=s.get(m,[l]);return{executeCommand(u,...d){return h.executeCommand(u,g,...d)}}}},25367:(x,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),a=n.__importStar(e(81878)),p=e(56405);function v(m,_){return m.get(o.AppConfig).useExperimentalShadowDom?new Proxy(a,{get(g,l){if(l==="Dialog"||l==="Overlay"){const h=a[l];return u=>r.default.createElement(p.PortalRoot,{otherProps:u,extensionId:_.id,original:h})}return g[l]}}):a}},73566:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(97558);let p=class extends a.AbstractSumiBrowserContributionRunner{run(m){const _=new o.Disposable;if(!this.injector.creatorMap.has(o.ChatAgentViewServiceToken))return this.logger.warn("Not found ChatAgentViewServiceToken"),_;const{chat:s}=this.contribution;return!s||!Array.isArray(s.view)||s.view.forEach(g=>{if(!g.id||!g.component)return;const{extendProtocol:l,extendService:h}=m.getExtensionExtendService(this.extension,g.id),u=`${this.extension.id}:${g.id}`;_.addDispose(this.chatAgentViewService.registerChatComponent({id:u,component:g.component,initialProps:{kaitianExtendService:h,kaitianExtendSet:l,sumiExtendService:h,sumiExtendSet:l}}))}),_}};t.ChatBrowserContributionRunner=p,n.__decorate([(0,r.Autowired)(o.ChatAgentViewServiceToken),n.__metadata("design:type",Object)],p.prototype,"chatAgentViewService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],p.prototype,"injector",void 0),t.ChatBrowserContributionRunner=p=n.__decorate([(0,r.Injectable)({multiple:!0})],p)},23561:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(54414),p=e(57517),v=e(63067),m=e(52416),_=e(97558);let s=class extends _.AbstractSumiBrowserContributionRunner{run(l){const h=new o.Disposable;return this.contribution.editor&&this.contribution.editor.view.forEach(u=>{h.addDispose(this.registerEditorComponent(u,l))}),h}registerEditorComponent(l,h){const u=new o.Disposable,{extendProtocol:d,extendService:E}=h.getExtensionExtendService(this.extension,l.id),f=l.scheme||o.Schemes.file;return u.addDispose(this.editorComponentRegistry.registerEditorComponent({uid:l.id,scheme:f,component:l.component,renderMode:l.renderMode},{kaitianExtendService:E,kaitianExtendSet:d,sumiExtendService:E,sumiExtendSet:d})),f===o.Schemes.file?u.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(f,(c,y)=>{let b=!1;if(l.fileExt&&l.fileExt.indexOf(c.uri.path.ext)>-1){if(!l.shouldPreview)return;l.shouldPreview(c.uri.path)&&(b=!0)}l.handles&&l.handles(c.uri.codeUri)&&(b=!0),b&&y.push({type:p.EditorOpenType.component,componentId:l.id,title:l.title||"\u9884\u89C8",weight:l.priority||10})})):u.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(f,(c,y)=>{l.handles&&!l.handles(c.uri.codeUri)||y.push({type:p.EditorOpenType.component,componentId:l.id,title:l.title||l.id,weight:l.priority||10})})),this.resourceService.registerResourceProvider({scheme:f,provideResource:c=>({uri:c,name:l.tabTitle||l.id,icon:l.tabIconPath?this.iconService.fromIcon(this.extension.path,l.tabIconPath,m.IconType.Background):""})}),u}};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)(a.ResourceService),n.__metadata("design:type",a.ResourceService)],s.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.EditorComponentRegistry),n.__metadata("design:type",p.EditorComponentRegistry)],s.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(m.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),t.EditorBrowserContributionRunner=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},85406:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditorSideBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(54414),p=e(57517),v=e(51553),m=e(97558);let _=class extends m.AbstractSumiBrowserContributionRunner{run(g){const l=new o.Disposable,h=this.contribution.editorSide;return h&&h.view.forEach(u=>{l.addDispose(this.registerEditorSideComponent(u,g))}),l}registerEditorSideComponent(g,l){const h=new o.Disposable,{extendProtocol:u,extendService:d}=l.getExtensionExtendService(this.extension,g.id);return h.addDispose(this.editorComponentRegistry.registerEditorSideWidget({id:g.id,side:g.side,component:g.component,initialProps:{kaitianExtendService:d,kaitianExtendSet:u,sumiExtendService:d,sumiExtendSet:u},displaysOnResource:()=>this.editorService.editorContextKeyService.match(g?.when)})),h}};t.EditorSideBrowserContributionRunner=_,n.__decorate([(0,r.Autowired)(p.EditorComponentRegistry),n.__metadata("design:type",p.EditorComponentRegistry)],_.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(a.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorServiceImpl)],_.prototype,"editorService",void 0),t.EditorSideBrowserContributionRunner=_=n.__decorate([(0,r.Injectable)({multiple:!0})],_)},31738:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumiBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(97558),p=e(73566),v=e(23561),m=e(85406),_=e(53728),s=e(15765);let g=class extends a.AbstractSumiBrowserContributionRunner{run(h){const u=new o.Disposable;return u.addDispose(this.injector.get(_.TabbarBrowserContributionRunner,[this.extension,this.contribution]).run(h)),u.addDispose(this.injector.get(v.EditorBrowserContributionRunner,[this.extension,this.contribution]).run(h)),u.addDispose(this.injector.get(m.EditorSideBrowserContributionRunner,[this.extension,this.contribution]).run(h)),u.addDispose(this.injector.get(s.ToolBarBrowserContributionRunner,[this.extension,this.contribution]).run(h)),u.addDispose(this.injector.get(p.ChatBrowserContributionRunner,[this.extension,this.contribution]).run(h)),u}};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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TabbarBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(63067),v=e(52416),m=e(97558),_=["left","right","bottom","editor","toolBar"];let s=class extends m.AbstractSumiBrowserContributionRunner{run(l){const h=new a.Disposable;return this.contribution.left&&this.contribution.left.view.forEach(u=>{var d;h.addDispose(this.registerTabBar(u,l,(d=this.contribution.left)===null||d===void 0?void 0:d.type,"left"))}),this.contribution.right&&this.contribution.right.view.forEach(u=>{var d;h.addDispose(this.registerTabBar(u,l,(d=this.contribution.right)===null||d===void 0?void 0:d.type,"right"))}),this.contribution.bottom&&this.contribution.bottom.view.forEach(u=>{var d;h.addDispose(this.registerTabBar(u,l,(d=this.contribution.bottom)===null||d===void 0?void 0:d.type,"bottom"))}),Object.keys(this.contribution).forEach(u=>{var d;_.indexOf(u)===-1&&((d=this.contribution[u])===null||d===void 0?void 0:d.view).forEach(E=>{h.addDispose(this.registerTabBar(E,l,"replace"))})}),h}registerTabBar(l,h,u="add",d){const{extendProtocol:E,extendService:f}=h.getExtensionExtendService(this.extension,l.id),c=`${this.extension.id}:${l.id}`,y={kaitianExtendService:f,kaitianExtendSet:E,sumiExtendService:f,sumiExtendSet:E};return this.layoutService.viewReady.promise.then(()=>{var b;if(u==="add"){const{component:A,titleComponent:S}=l;this.layoutService.collectTabbarComponent([{id:c}],{...l,iconClass:l.icon?(0,o.getIcon)(l.icon):l.iconPath?this.iconService.fromIcon(this.extension.path,l.iconPath):"",containerId:c,component:A,titleComponent:S,titleProps:y,initialProps:y,fromExtension:!0},d)}else this.layoutService.replaceViewComponent(l,y),l.titleComponent&&((b=this.layoutService.getTabbarHandler(c))===null||b===void 0||b.setTitleComponent(l.titleComponent,y))}),{dispose:()=>{const b=this.layoutService.getTabbarHandler(c);b&&b.dispose()}}}};t.TabbarBrowserContributionRunner=s,n.__decorate([(0,r.Autowired)(p.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolBarBrowserContributionRunner=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(63067),p=e(52416),v=e(47289),m=e(97558);let _=class extends m.AbstractSumiBrowserContributionRunner{run(g){const l=new o.Disposable;return this.injector.creatorMap.has(v.IToolBarViewService)?(this.contribution.toolBar&&this.contribution.toolBar.view.forEach(h=>{const{extendProtocol:u,extendService:d}=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:d,kaitianExtendSet:u,sumiExtendService:d,sumiExtendSet:u},description:h.description,order:h.order,weight:h.weight});E&&l.addDispose(E)}),l):(this.logger.warn("\u6CA1\u6709\u627E\u5230 toolbarViewService"),l)}};t.ToolBarBrowserContributionRunner=_,n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],_.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(v.IToolBarViewService),n.__metadata("design:type",v.IToolBarViewService)],_.prototype,"toolBarViewService",void 0),n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],_.prototype,"iconService",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.ToolBarBrowserContributionRunner=_=n.__decorate([(0,r.Injectable)({multiple:!0})],_)},57996:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBrowserApi=g;const n=e(41869),r=e(81878),o=e(57517),a=e(52416),p=e(16762),v=e(65046),m=e(31381),_=e(25367),{format:s}=n.strings;function g(l,h,u){const d=(0,m.createBrowserCommandsApiFactory)(l,h,u),E=(0,_.createBrowserComponents)(l,h),f=l.get(n.IReporterService);return{...E,commands:d,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=l.get(a.IThemeService).getCurrentThemeSync();return(0,a.getColorRegistry)().getColors().reduce((A,S)=>{const D=y.getColor(S.id);return D&&(A[S.id.replace(".","-")]=D.toString()),A},{})},ToolBarPosition:p.ToolBarPosition,EditorComponentRenderMode:o.EditorComponentRenderMode,reporter:f}}},97558:(x,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){}};t.BrowserMainContributionPoint=p,p.schema={type:"string",defaultSnippets:[{body:"./out/browser/index.js"}],description:(0,o.localize)("sumiContributes.browserMain")},t.BrowserMainContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("browserMain"),(0,a.LifeCycle)(4)],p)},88770:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserViewContributionPoint=void 0;const r=e(85608),o=e(76003),a=e(41869),p=e(21634),v=e(43718),m=e(63067),_=e(52416),s=e(99220),g=e(17428),l=e(71354),h=["left","right","bottom","editor","toolBar","editorSide","chat"];let u=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 I=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 I){w.titleComponentId&&(0,v.getDebugLogger)().warn(`custom title component '${w.titleComponentId}' is not allowed for built-in container ${D}!`);const{title:T,id:R,priority:P,component:O,when:M,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:P,component:O,name:T,when:M,weight:k},F,{},{fromExtension:!0});this.disposableCollection.push({dispose:()=>{this.mainLayoutService.getTabbarHandler(L).disposeView(R)}})}continue}for(const w of I){const{title:T,icon:R,iconPath:P,id:O,priority:M,component:k,expanded:F,noResize:L,when:B,weight:U,hideTab:W}=w,j=`${y}:${O}`,Q=this.mainLayoutService.collectTabbarComponent([{id:O,priority:M,component:k,when:B,weight:U}],{iconClass:P?this.iconService.fromIcon(A.path,P):(0,a.getIcon)(R),title:T&&this.getLocalizeFromNlsJSON(T,y),priority:M,expanded:F,containerId:j,noResize:L,fromExtension:!0,hideTab:W},D);this.disposableCollection.push({dispose:()=>{this.mainLayoutService.getTabbarHandler(Q).dispose()}})}}}E()})})}};t.BrowserViewContributionPoint=u,u.schema=p.browserViews.schema,u.unsupportLocation=["bottom","editor","toolBar","chat"],r.__decorate([(0,o.Autowired)(m.IMainLayoutService),r.__metadata("design:type",Object)],u.prototype,"mainLayoutService",void 0),r.__decorate([(0,o.Autowired)(_.IIconService),r.__metadata("design:type",Object)],u.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(l.AbstractExtInstanceManagementService),r.__metadata("design:type",l.AbstractExtInstanceManagementService)],u.prototype,"extensionManageService",void 0),t.BrowserViewContributionPoint=u=n=r.__decorate([(0,o.Injectable)(),(0,s.Contributes)("browserViews"),(0,s.LifeCycle)(3)],u)},82389:(x,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),a=e(56543),p=e(88770),v=e(35307),m=e(92097),_=e(75591),s=e(68360),g=e(52750),l=e(8678),h=e(43066),u=e(29337);t.SumiContributionsServiceToken=Symbol("SumiContributionsService");let d=class extends o.ExtensionContributesService{constructor(){super(...arguments),this.ContributionPoints=[p.BrowserViewContributionPoint,a.BrowserMainContributionPoint,_.NodeMainContributionPoint,u.WorkerMainContributionPoint,h.ViewsProxiesContributionPoint,m.MenubarsContributionPoint,g.SubmenusContributionPoint,l.ToolbarContributionPoint,v.MenuExtendContributionPoint,s.SCMContributionPoint]}};t.SumiContributionsService=d,t.SumiContributionsService=d=n.__decorate([(0,r.Injectable)()],d)},35307:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenuExtendContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(93899),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{extensionId:_,contributes:s}=m;for(const g of Object.keys(s)){const l=s[g];this.addDispose(this.menuRegistry.registerMenuExtendInfo(g,l.map(h=>{var u;return{...h,extraDesc:this.getLocalizeFromNlsJSON((u=h?.extraDesc)!==null&&u!==void 0?u:"",_)}})))}}}};t.MenuExtendContributionPoint=p,n.__decorate([(0,r.Autowired)(o.IMenuRegistry),n.__metadata("design:type",o.IMenuRegistry)],p.prototype,"menuRegistry",void 0),t.MenuExtendContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("menu-extend"),(0,a.LifeCycle)(3)],p)},92097:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenubarsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(93899),p=e(43718),v=e(52416),m=e(99220),_=e(71354);let s=class extends m.VSCodeContributePoint{contribute(){for(const l of this.contributesMap){const{extensionId:h,contributes:u}=l,d=this.extensionManageService.getExtensionInstanceByExtId(h);if(d)for(const E of u){const f=d.icon?this.iconService.fromIcon("",d.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,p.localize)("sumiContributes.menubars"),type:"array",items:{type:"object",required:["id","title"],defaultSnippets:[{body:{id:"${1}",title:"${2}"}}],properties:{id:{type:"string",description:(0,p.localize)("sumiContributes.menubars.id")},title:{type:"string",description:(0,p.localize)("sumiContributes.menubars.title")},order:{type:"number",description:(0,p.localize)("sumiContributes.menubars.order")},nativeRole:{type:"string",description:(0,p.localize)("sumiContributes.menubars.order")}}}},n.__decorate([(0,r.Autowired)(a.IMenuRegistry),n.__metadata("design:type",a.IMenuRegistry)],s.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.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,m.Contributes)("menubars"),(0,m.LifeCycle)(3)],s)},75591:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){}};t.NodeMainContributionPoint=p,p.schema={type:"string",defaultSnippets:[{body:"./out/node/index.js"}],description:(0,o.localize)("sumiContributes.nodeMain")},t.NodeMainContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("nodeMain"),(0,a.LifeCycle)(4)],p)},68360:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCMContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(61656),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{contributes:s}=_;if(s.additional){const{additional:g}=s;if(!g.input)return;const{input:l}=g;if(l.addonAfter||l.addonBefore)return;this.scmService.appendInputProps(l)}}}};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)(a.SCMService),n.__metadata("design:type",a.SCMService)],v.prototype,"scmService",void 0),t.SCMContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("scm"),(0,p.LifeCycle)(3)],v)},52750:(x,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),a=e(93899),p=e(43718),v=e(52416),m=e(99220),_=e(71354),s=e(35166);function g(h,u){if(!Array.isArray(h))return u.error((0,p.formatLocalize)("requirearray")),!1;for(const d of h){if(typeof d.id!="string")return u.error((0,p.formatLocalize)("requirestring","id")),!1;if(d.title&&typeof d.title!="string")return u.error((0,p.formatLocalize)("optstring","title")),!1;if(d.when&&typeof d.when!="string")return u.error((0,p.formatLocalize)("optstring","when")),!1;if(d.group&&typeof d.group!="string")return u.error((0,p.formatLocalize)("optstring","group")),!1}return!0}let l=class extends m.VSCodeContributePoint{contribute(){const u=console;for(const d of this.contributesMap){const{extensionId:E,contributes:f}=d,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,p.isUndefined)(A)){u.warn((0,p.formatLocalize)("menuId.invalid","`{0}` is not a valid submenu identifier",y));return}for(const S of b){const[D,I]=(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:I,nativeRole:S.nativeRole}))}}}}};t.SubmenusContributionPoint=l,l.schema=o.menus.subMenusSchema,n.__decorate([(0,r.Autowired)(a.IMenuRegistry),n.__metadata("design:type",a.IMenuRegistry)],l.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],l.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],l.prototype,"extensionManageService",void 0),t.SubmenusContributionPoint=l=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("submenus"),(0,m.LifeCycle)(3)],l)},8678:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(9905),p=e(99220),v=e(71354),m=e(96710);let _=class extends p.VSCodeContributePoint{toLocalized(g,l,h){return l.reduce((u,d)=>(u[d]&&(u[d]=this.getLocalizeFromNlsJSON(u[d],h)),u),g)}contribute(){for(const g of this.contributesMap){const{extensionId:l,contributes:h}=g,u=this.extensionManageService.getExtensionInstanceByExtId(l);if(u){if(h.groups)for(const d of h.groups)this.addDispose(this.toolbarRegistry.registerToolbarActionGroup({id:d.id,preferredLocation:d.preferredLocation,weight:d.weight}));if(h.actions)for(const d of h.actions)switch(d.type){case"button":this.addDispose(this.kaitianExtToolbarService.registerToolbarButton(l,u.path,this.toLocalized(d,["title"],l)));break;case"select":this.addDispose(this.kaitianExtToolbarService.registerToolbarSelect(l,u.path,this.toLocalized(d,["description"],l)));break;case"dropdownButton":this.addDispose(this.kaitianExtToolbarService.registerToolbarDropdownButton(l,u.path,this.toLocalized(d,["description"],l)));break}}}}};t.ToolbarContributionPoint=_,_.schema=a.toolbar.schema,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.KaitianExtensionToolbarService)],_.prototype,"kaitianExtToolbarService",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarRegistry),n.__metadata("design:type",Object)],_.prototype,"toolbarRegistry",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],_.prototype,"extensionManageService",void 0),t.ToolbarContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("toolbar"),(0,p.LifeCycle)(3)],_)},43066:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsProxiesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){}};t.ViewsProxiesContributionPoint=p,p.schema={type:"array",markdownDescription:(0,o.localize)("sumiContributes.viewsProxies"),defaultSnippets:[{body:["${1}"]}],items:{type:"string"}},t.ViewsProxiesContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("viewsProxies"),(0,a.LifeCycle)(3)],p)},29337:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMainContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){}};t.WorkerMainContributionPoint=p,p.schema={type:"string",defaultSnippets:[{body:"./out/worker/index.js"}],description:(0,o.localize)("sumiContributes.workerMain")},t.WorkerMainContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("workerMain"),(0,a.LifeCycle)(4)],p)},28949:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSumiAPIFactory=g;const n=e(43718),r=e(95507),o=e(41062),a=e(59860),p=e(29127),v=e(13877),m=e(25740),_=e(96710),s=e(43837);function g(l,h){const u=new n.Disposable,d=h.get(v.MainThreadLifeCycle,[h]),E=h.get(m.MainThreadTheme,[l,h]);u.addDispose(E);const f=h.get(p.MainThreadLayout,[l]);u.addDispose(f);const c=h.get(a.MainThreadCommon,[l,h]);u.addDispose(c);const y=h.get(_.MainThreadToolbar);u.addDispose(y);const b=h.get(s.MainThreadIDEWindow,[l]);u.addDispose(b);const A=h.get(o.MainThreadChatAgents,[l,h]);return u.addDispose(A),l.set(r.MainThreadSumiAPIIdentifier.MainThreadLifecycle,d),l.set(r.MainThreadSumiAPIIdentifier.MainThreadTheme,E),l.set(r.MainThreadSumiAPIIdentifier.MainThreadLayout,f),l.set(r.MainThreadSumiAPIIdentifier.MainThreadCommon,c),l.set(r.MainThreadSumiAPIIdentifier.MainThreadToolbar,y),l.set(r.MainThreadSumiAPIIdentifier.MainThreadIDEWindow,b),l.set(r.MainThreadSumiAPIIdentifier.MainThreadChatAgents,A),()=>{u.dispose()}}},41062:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadChatAgents=void 0;const r=e(85608),o=e(76003),a=e(59347),p=e(77633),v=e(40111),m=e(19413),_=e(8919),s=e(43718),g=e(93062),l=e(95507);let h=class{get chatAgentService(){try{return this.injector.get(m.IChatAgentService)}catch{return null}}get inlineChatFeatureRegistry(){try{return this.injector.get(s.InlineChatFeatureRegistryToken)}catch{return null}}get chatInternalService(){try{return this.injector.get(a.ChatInternalService)}catch{return null}}constructor(d,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,d.getProxy(l.ExtHostSumiAPIIdentifier.ExtHostChatAgents),"f")}$registerInlineChatProvider(d,E,f){if(!this.inlineChatFeatureRegistry||!this.chatInternalService)return;const c=this.inlineChatFeatureRegistry.registerInteractiveInput({handleStrategy:()=>p.ERunStrategy.PREVIEW},{providePreviewStrategy:async(y,b,A,S)=>{var D;const I=new v.InlineChatController({enableCodeblockRender:!!f.enableCodeblockRender}),w=this.chatInternalService.createRequest(A,E),T=new g.SumiReadableStream;I.mountReadable(T);const R=O=>{if(S.isCancellationRequested){T.abort();return}T.emitData(O)};this.pendingProgress.set(w.requestId,R);const P={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(d,P,{history:[]},S).then(O=>{if(!O){T.end();return}S.isCancellationRequested?T.abort():(O.errorDetails&&w.response.setErrorDetails(O.errorDetails),T.end())}).finally(()=>{this.pendingProgress.delete(w.requestId)}),I}});this.agents.set(d,{name:E,dispose:c.dispose})}$registerAgent(d,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(d,y,{history:A.map(I=>({role:s.CoreMessgaeRoleMap[I.role],content:I.content.toString()}))},S))!==null&&D!==void 0?D:{}}finally{this.pendingProgress.delete(y.requestId)}},provideSlashCommands:async y=>{var b;return!((b=this.agents.get(d))===null||b===void 0)&&b.hasSlashCommands?r.__classPrivateFieldGet(this,n,"f").$provideSlashCommands(d,y):[]},provideFollowups:async(y,b)=>{var A;return!((A=this.agents.get(d))===null||A===void 0)&&A.hasFollowups?r.__classPrivateFieldGet(this,n,"f").$provideFollowups(d,y,b):[]},provideSampleQuestions:async y=>{var b;return!((b=this.agents.get(d))===null||b===void 0)&&b.hasSampleQuestions?r.__classPrivateFieldGet(this,n,"f").$provideSampleQuestions(d,y):[]},provideChatWelcomeMessage:async y=>{var b;if(!((b=this.agents.get(d))===null||b===void 0)&&b.hasChatWelcomMessage)return r.__classPrivateFieldGet(this,n,"f").$provideChatWelcomeMessage(d,y)}});this.agents.set(d,{name:E,dispose:c.dispose,hasSlashCommands:f.hasSlashCommands,hasFollowups:f.hasFollowups})}$updateAgent(d,E){if(!this.chatAgentService)return;const f=this.agents.get(d);if(!f)throw new Error(`No agent with handle ${d} 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(d,E,f){var c,y;if(E.kind==="asyncContent"){const b=++this.responsePartHandlePool,A=`${d}_${b}`,S=new s.Deferred;return this.activeResponsePartPromises.set(A,S),(c=this.pendingProgress.get(d))===null||c===void 0||c({...E,resolvedContent:S.promise}),b}else if(typeof f=="number"){const b=`${d}_${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(d))===null||y===void 0||y(E)}$unregisterAgent(d){var E;(E=this.agents.get(d))===null||E===void 0||E.dispose(),this.agents.delete(d)}$populateChatInput(d,E){if(!this.chatAgentService)return;const f=this.agents.get(d);if(!f)throw new Error(`No agent with handle ${d} registered`);this.chatAgentService.populateChatInput(f.name,{command:E.command,message:E.prompt})}$sendMessage(d){this.chatAgentService&&this.chatAgentService.sendMessage(d)}dispose(){this.agents.forEach(d=>{d.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommon=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(95507),m=e(71354);let _=class extends a.WithEventBus{constructor(g,l){super(),this.rpcProtocol=g,this.injector=l,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(p.Disposable.create(()=>{this.$unSubscribeEvent(g)}))}async $unSubscribeEvent(g){this.subscribedEvent.delete(g)}};t.MainThreadCommon=_,n.__decorate([(0,r.Autowired)(a.IEventBus),n.__metadata("design:type",Object)],_.prototype,"themeService",void 0),n.__decorate([(0,a.OnEvent)(m.ExtHostEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[m.ExtHostEvent]),n.__metadata("design:returntype",void 0)],_.prototype,"onExtHostEvent",null),t.MainThreadCommon=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,r.Injector])],_)},29127:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLayout=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(63067),v=e(52416),m=e(95507);let _=class extends a.Disposable{constructor(g){super(),this.handlerMap=new Map,this.proxy=g.getProxy(m.ExtHostSumiAPIIdentifier.ExtHostLayout)}$setTitle(g,l){var h;(h=this.getHandler(g))===null||h===void 0||h.updateTitle(l)}$setIcon(g,l){var h;const u=this.iconService.fromIcon("",l,v.IconType.Background,v.IconShape.Square);(h=this.getHandler(g))===null||h===void 0||h.setIconClass(u)}$setSize(g,l){var h;(h=this.getHandler(g))===null||h===void 0||h.setSize(l)}$activate(g){var l;(l=this.getHandler(g))===null||l===void 0||l.activate()}$deactivate(g){var l;(l=this.getHandler(g))===null||l===void 0||l.deactivate()}$setBadge(g,l){var h;(h=this.getHandler(g))===null||h===void 0||h.setBadge(l)}async $setVisible(g,l){var h,u,d,E;l?(h=this.getHandler(g))===null||h===void 0||h.show():(!((u=this.getHandler(g))===null||u===void 0)&&u.isActivated()&&((d=this.getHandler(g))===null||d===void 0||d.deactivate()),(E=this.getHandler(g))===null||E===void 0||E.hide())}async $connectTabbar(g){if(!this.handlerMap.has(g)){const l=this.layoutService.getTabbarHandler(g);if(l)this.bindHandleEvents(l);else{const h=this.eventBus.on(p.TabBarRegistrationEvent,u=>{if(u.payload.tabBarId===g){const d=this.layoutService.getTabbarHandler(g);d&&this.bindHandleEvents(d),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 l=this.layoutService.getTabbarHandler(g);return l||this.logger.warn(`Could not find a handler with \`${g}\``),l}};t.MainThreadLayout=_,n.__decorate([(0,r.Autowired)(p.IMainLayoutService),n.__metadata("design:type",Object)],_.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],_.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(a.IEventBus),n.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.MainThreadLayout=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],_)},13877:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLifeCycle=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(37406),p=e(39156);let v=class{constructor(_){this.injector=_}$setExtensionCandidate(_){this.appConfig.isElectronRenderer?this.injector.get(a.IElectronMainLifeCycleService).setExtensionCandidate(_,o.electronEnv.currentWindowId):(0,p.throwNonElectronError)("MainThreadLifeCycle.$setExtensionCandidate")}$setExtensionDir(_){this.appConfig.isElectronRenderer?this.injector.get(a.IElectronMainLifeCycleService).setExtensionDir(_,o.electronEnv.currentWindowId):(0,p.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTheme=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(52416),v=e(95507);let m=class extends a.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,p.getColorRegistry)().getColors().reduce((l,h)=>{const u=s.getColor(h.id);return u&&(l[h.id.replace(".","-")]=u.toString()),l},{})}};t.MainThreadTheme=m,n.__decorate([(0,r.Autowired)(p.IThemeService),n.__metadata("design:type",Object)],m.prototype,"themeService",void 0),t.MainThreadTheme=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,r.Injector])],m)},96710:(x,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),a=e(52416),p=e(99220),v=e(90888),m=e(17428);let _=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:(l,h,u)=>{this.btnDelegates.has(l)&&this.btnDelegates.get(l).setState(h,u)}}),this.commandRegistry.registerCommand({id:v.BUTTON_SET_CONTEXT_ID},{execute:(l,h)=>{if(this.btnDelegates.has(l)){const u=this.btnDelegates.get(l);u&&u.setContext(h)}}}),this.commandRegistry.registerCommand({id:v.BUTTON_CONNECT_HANDLE_ID},{execute:l=>{this.connected.has(l)||(this.doConnectToolbarButtonHandle(l),this.connected.add(l))}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_STATE_ID},{execute:(l,h)=>{this.selectDelegates.has(l)&&this.selectDelegates.get(l).setState(h)}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_OPTIONS},{execute:(l,h,u)=>{this.selectDelegates.has(l)&&(u.forEach(d=>{d.iconPath&&(d.iconClass=this.iconService.fromIcon(h,d.iconPath,d.iconMaskMode?a.IconType.Mask:a.IconType.Background))}),this.selectDelegates.get(l).setOptions(u))}}),this.commandRegistry.registerCommand({id:v.SELECT_SET_SELECT_ID},{execute:(l,h)=>{this.selectDelegates.has(l)&&this.selectDelegates.get(l).setSelect(h)}}),this.commandRegistry.registerCommand({id:v.SELECT_CONNECT_HANDLE_ID},{execute:l=>{if(this.connected.has(l)||(this.doConnectToolbarSelectHandle(l),this.connected.add(l)),this.selectDelegates.get(l))return this.selectDelegates.get(l).getValue()}}),this.commandRegistry.registerCommand({id:v.SHOW_POPOVER_ID},{execute:(l,h)=>{this.btnDelegates.has(l)&&this.btnDelegates.get(l).showPopOver(h)}}),this.commandRegistry.registerCommand({id:v.HIDE_POPOVER_ID},{execute:l=>{this.btnDelegates.has(l)&&this.btnDelegates.get(l).hidePopOver()}})}getPopoverComponent(l,h){const u=()=>{var d,E,f,c;return(0,m.ExtensionLoadingView)({style:{minHeight:!((d=h.popoverStyle)===null||d===void 0)&&d.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(l)||u}registerToolbarButton(l,h,u){const d=l+"."+u.id,E={};return u.states&&Object.keys(u.states).forEach(f=>{const c=u.states[f];E[f]={...c},c.iconPath&&(E[f].iconClass=this.iconService.fromIcon(h,c.iconPath,c.iconMaskMode?a.IconType.Mask:a.IconType.Background))}),this.toolbarRegistry.registerToolbarAction({id:d,preferredPosition:u.preferredPosition,strictPosition:u.strictPosition,description:u.description||u.title||d,weight:u.weight,when:u.when,component:(0,o.createToolbarActionBtn)({id:d,popoverId:`${l}:${u.popoverComponent}`,title:u.title,styles:E,defaultState:u.defaultState,iconClass:this.iconService.fromIcon(h,u.iconPath,u.iconMaskMode?a.IconType.Mask:a.IconType.Background),popoverComponent:u.popoverComponent?this.getPopoverComponent(`${l}:${u.popoverComponent}`,u):void 0,popoverStyle:u.popoverStyle||{noContainerStyle:!1},delegate:f=>{f&&(this.btnDelegates.set(d,f),u.command&&f.onClick(async()=>{f.showPopOver(),await this.eventBus.fireAndAwait(new o.ExtensionActivateEvent({topic:"onAction",data:u.id})),this.commandService.executeCommand(u.command)}),this.connected.has(d)&&this.doConnectToolbarButtonHandle(d))}})})}doConnectToolbarButtonHandle(l){const h=this.btnDelegates.get(l);h&&(h.onClick(()=>this.commandService.executeCommand(p.EMIT_EXT_HOST_EVENT.id,v.BUTTON_CLICK_ID,l)),h.onChangeState(u=>this.commandService.executeCommand(p.EMIT_EXT_HOST_EVENT.id,v.BUTTON_STATE_CHANGE_ID,l,u)))}registerToolbarSelect(l,h,u){const d=l+"."+u.id,E=u.options||[];return E.forEach(f=>{f.iconPath&&(f.iconClass=this.iconService.fromIcon(h,f.iconPath,f.iconMaskMode?a.IconType.Mask:a.IconType.Background))}),this.toolbarRegistry.registerToolbarAction({id:d,preferredPosition:u.preferredPosition,strictPosition:u.strictPosition,description:u.description,component:(0,o.createToolbarActionSelect)({styles:u.states,options:E,defaultState:u.defaultState,defaultValue:u.defaultValue,equals:u.optionEqualityKey?(f,c)=>{const y=u.optionEqualityKey;return!f||!c?f===c:f[y]===c[y]}:void 0,delegate:f=>{f&&(this.selectDelegates.set(d,f),u.command&&f.onSelect(c=>{this.commandService.executeCommand(u.command,c)}),this.connected.has(d)&&this.doConnectToolbarSelectHandle(d))}})})}doConnectToolbarSelectHandle(l){const h=this.selectDelegates.get(l);h&&(h.onSelect(u=>this.commandService.executeCommand(p.EMIT_EXT_HOST_EVENT.id,v.SELECT_ON_SELECT_ID,l,u)),h.onChangeState(u=>this.commandService.executeCommand(p.EMIT_EXT_HOST_EVENT.id,v.SELECT_STATE_CHANGE_ID,l,u)))}registerToolbarDropdownButton(l,h,u){const d=l+"."+u.id,E=u.options||[];return this.toolbarRegistry.registerToolbarAction({id:d,preferredPosition:u.preferredPosition,strictPosition:u.strictPosition,description:u.description,component:(0,o.createToolbarActionDropdownButton)({options:E,trigger:u.trigger,delegate:f=>{f&&(this.dropdownButtonDelegates.set(d,f),u.command&&f.onSelect(c=>{this.commandService.executeCommand(u.command,c)}),this.connected.has(d)&&this.doConnectToolbarDropdownButtonHandle(d))}})})}doConnectToolbarDropdownButtonHandle(l){const h=this.selectDelegates.get(l);h&&h.onSelect(u=>this.commandService.executeCommand(p.EMIT_EXT_HOST_EVENT.id,v.DROPDOWN_BUTTON_ON_SELECT_ID,l,u))}};t.KaitianExtensionToolbarService=_,n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],_.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarPopoverRegistry),n.__metadata("design:type",Object)],_.prototype,"toolbarPopover",void 0),n.__decorate([(0,r.Autowired)(o.IToolbarRegistry),n.__metadata("design:type",Object)],_.prototype,"toolbarRegistry",void 0),n.__decorate([(0,r.Autowired)(a.IIconService),n.__metadata("design:type",Object)],_.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],_.prototype,"commandRegistry",void 0),t.KaitianExtensionToolbarService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_);let s=class extends o.Disposable{$registerToolbarButtonAction(l,h,u){return this.addDispose(this.toolbarService.registerToolbarButton(l,h,u)),Promise.resolve()}$registerToolbarSelectAction(l,h,u){return this.addDispose(this.toolbarService.registerToolbarSelect(l,h,u)),Promise.resolve()}$registerDropdownButtonAction(l,h,u){return this.addDispose(this.toolbarService.registerToolbarDropdownButton(l,h,u)),Promise.resolve()}};t.MainThreadToolbar=s,n.__decorate([(0,r.Autowired)(_),n.__metadata("design:type",_)],s.prototype,"toolbarService",void 0),t.MainThreadToolbar=s=n.__decorate([(0,r.Injectable)({multiple:!0})],s)},43837:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadIDEWindow=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(65046),v=e(95507);let m=class extends a.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,l){let h;return this._plainWebviewWindowMap.has(s)?h=this._plainWebviewWindowMap.get(s):(h=this.webviewService.createWebviewWindow(g,l),h&&(this.disposables.push(h.onMessage(u=>{this._proxy.$postMessage(s,u)})),this.disposables.push(h.onClosed(u=>{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 l=this._plainWebviewWindowMap.get(s);l?.setSize(g)}}async $postMessage(s,g){if(this._plainWebviewWindowMap.has(s)){const l=this._plainWebviewWindowMap.get(s);l?.postMessage(g)}}async $setAlwaysOnTop(s,g){if(this._plainWebviewWindowMap.has(s)){const l=this._plainWebviewWindowMap.get(s);l?.setAlwaysOnTop(g)}}async $loadURL(s,g){if(this._plainWebviewWindowMap.has(s)){const l=this._plainWebviewWindowMap.get(s);l?.loadURL(g)}}async $destroy(s){if(this._plainWebviewWindowMap.has(s)){const g=this._plainWebviewWindowMap.get(s);g?.dispose(),this._plainWebviewWindowMap.delete(s)}}};t.MainThreadIDEWindow=m,n.__decorate([(0,r.Autowired)(p.IWebviewService),n.__metadata("design:type",Object)],m.prototype,"webviewService",void 0),t.MainThreadIDEWindow=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],m)},71354:(x,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 a extends o.BasicEvent{}t.ExtHostEvent=a;let p=class{};t.IActivationEventService=p,t.IActivationEventService=p=n.__decorate([(0,r.Injectable)()],p);class v{}t.AbstractExtInstanceManagementService=v;class m extends o.BasicEvent{}t.ExtensionApiReadyEvent=m;class _ extends o.BasicEvent{}t.ExtensionBeforeActivateEvent=_;class s extends o.BasicEvent{}t.ExtensionWillActivateEvent=s;class g extends o.BasicEvent{}t.ExtensionWillContributeEvent=g;class l extends o.BasicEvent{}t.ExtensionDidActivatedEvent=l;class h extends o.BasicEvent{}t.ExtensionsInitializedEvent=h;class u extends o.BasicEvent{}t.ExtensionDidUninstalledEvent=u;class d extends o.BasicEvent{}t.ExtensionDidEnabledEvent=d},21259:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugAdapterContribution=void 0;class e{constructor(r,o,a){this.description=r,this.extDebug=o,this.activationEventService=a}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,a){return await this.extDebug.$provideDebugConfigurations(this.type,r,o,a)}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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(66482),p=e(37499),v=e(51500),m=e(51328),_=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(l=>this.ensureDebugActivation(l)),this.debugSessionManager.onWillResolveDebugConfiguration(l=>this.ensureDebugActivation(l,"onDebugResolve",l.debugType)),this.debugConfigurationManager.onWillProvideDebugConfiguration(l=>this.ensureDebugActivation(l,"onDebugInitialConfigurations")),this.toDispose.pushAll([o.Disposable.create(()=>{for(const l of this.sessionId2contrib.keys())this.sessionId2contrib.get(l).terminateDebugSession(l);this.sessionId2contrib.clear()})])}registerDebugAdapterContribution(l){const{type:h}=l;return this.contributors.has(h)?(this.logger.warn(`Debugger with type '${h}' already registered.`),o.Disposable.NULL):(this.contributors.set(h,l),o.Disposable.create(()=>this.unregisterDebugAdapterContribution(h)))}unregisterDebugAdapterContribution(l){this.contributors.delete(l)}ensureDebugActivation(l,h,u){typeof l.waitUntil=="function"&&l.waitUntil(this.activateByDebug(h,u))}async activateByDebug(l,h){const u=[this.activationEventService.fireEvent("onDebug")];l&&(u.push(this.activationEventService.fireEvent(l)),h&&u.push(this.activationEventService.fireEvent(l,h))),await Promise.all(u)}async debugTypes(){return Array.from(this.contributors.keys())}async provideDebugConfigurations(l,h,u){const d=this.contributors.get(l);return d?d.provideDebugConfigurations&&d.provideDebugConfigurations(h,void 0,u)||[]:[]}async getDynamicConfigurationsSupportTypes(){const l=new Set;this.extInstanceManagementService.getExtensionInstances().forEach(h=>{var u,d;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=>l.add(b));else if(y){const b=(d=(u=E.contributes)===null||u===void 0?void 0:u.debuggers)===null||d===void 0?void 0:d[0].type;b&&l.add(b)}});for(const[h,u]of this.contributors)await u.getDebugConfigurationProvidersCount(m.DebugConfigurationProviderTriggerKind.Dynamic)>0&&l.add(h);return Array.from(l)}async resolveDebugConfiguration(l,h){const u=this.contributors.get(l.type);if(u)try{return await u.resolveDebugConfiguration(l,h)}catch(d){this.logger.error(d)}}async resolveDebugConfigurationWithSubstitutedVariables(l,h){const u=this.contributors.get(l.type);if(u)try{return await u.resolveDebugConfigurationWithSubstitutedVariables(l,h)}catch(d){this.logger.error(d)}}async getDebuggersForLanguage(l){const h=[];for(const u of this.contributors.values()){const d=await u.languages;if(d&&d.indexOf(l)!==-1){const{type:E}=u;h.push({type:E,label:await u.label||E})}}return h}async getSchemaAttributes(l){const h=this.contributors.get(l);return h?h.getSchemaAttributes&&h.getSchemaAttributes()||[]:[]}async getConfigurationSnippets(){let l=[];for(const h of this.contributors.values())h.getConfigurationSnippets&&(l=l.concat(await h.getConfigurationSnippets()));return l}async createDebugSession(l){const{configuration:h}=l,u=this.contributors.get(h.type);if(u){const d=await u.createDebugSession(l);return this.sessionId2contrib.set(d,u),d}}async terminateDebugSession(l){const h=this.sessionId2contrib.get(l);if(h)return this.sessionId2contrib.delete(l),h.terminateDebugSession(l)}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)(a.IDebugSessionManager),n.__metadata("design:type",Object)],s.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(p.DebugConfigurationManager),n.__metadata("design:type",p.DebugConfigurationManager)],s.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(_.IActivationEventService),n.__metadata("design:type",_.IActivationEventService)],s.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],s.prototype,"extInstanceManagementService",void 0),t.ExtensionDebugService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},40576:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionDebugSessionContributionRegistry=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(97186);let p=class{constructor(){this.contribs=new Map,this.debug=(0,o.getDebugLogger)(),this.init()}init(){for(const m of this.contributions.getContributions())this.contribs.set(m.debugType,m)}get(m){return this.contribs.get(m)}registerDebugSessionContribution(m){const{debugType:_}=m;return this.contribs.has(_)?(this.debug.warn(`Debug session contribution already registered for ${_}`),o.Disposable.NULL):(this.contribs.set(_,m),o.Disposable.create(()=>this.unregisterDebugSessionContribution(_)))}unregisterDebugSessionContribution(m){this.contribs.delete(m)}};t.ExtensionDebugSessionContributionRegistry=p,n.__decorate([(0,r.Autowired)(a.DebugSessionContribution),n.__metadata("design:type",Object)],p.prototype,"contributions",void 0),t.ExtensionDebugSessionContributionRegistry=p=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],p)},76452:(x,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),a=e(51328);class p extends r.DebugSession{constructor(_,s,g,l,h,u,d,E,f,c,y,b){super(_,s,g,l,h,u,d,E,f,c,y),this.id=_,this.options=s,this.connection=g,this.terminalService=l,this.editorService=h,this.breakpointManager=u,this.modelManager=d,this.labelService=E,this.messageService=f,this.fileSystem=c,this.sessionManager=y,this.terminalOptionsExt=b}async doRunInTerminal(_){_.name||(_.name=(0,n.localize)("debug.terminal.title","Debug Process")),_.iconPath||(_.iconPath=new a.ThemeIcon("debug"));const s={..._,...this.terminalOptionsExt};return super.doRunInTerminal(s)}}t.ExtensionDebugSession=p;class v{constructor(_,s,g,l,h,u,d,E,f,c,y,b,A,S){this.editorManager=_,this.breakpoints=s,this.modelManager=g,this.terminalService=l,this.labelService=h,this.messageService=u,this.debugPreferences=d,this.connectionFactory=E,this.fileSystem=f,this.terminalOptionsExt=c,this.debugPreference=y,this.outputService=b,this.injector=A,this.sessionManager=S}get(_,s){const g=this.injector.get(o.DebugSessionConnection,[_,this.connectionFactory,this.getTraceOutputChannel()]);return new p(_,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:(x,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initNodeThreadAPIProxy=g,t.initWorkerThreadAPIProxy=l;const n=e(46147),r=e(57484),o=e(10273),a=e(24060),p=e(69696),v=e(53191),m=e(4321),_=e(43812),s=e(38408);function g(h,u,d){h.set(n.MainThreadAPIIdentifier.MainThreadExtensionService,d);const E=u.get(m.MainThreadTreeView,[h,"node"]),f=u.get(s.MainThreadWindowState,[h]),c=u.get(_.MainThreadWindow,[h]),y=u.get(r.MainThreadConnection,[h]),b=u.get(o.MainThreadDebug,[h,y]),A=u.get(p.MainThreadTerminal,[h]),S=u.get(a.MainThreadTasks,[h]),D=u.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 l(h,u,d){h.set(n.MainThreadAPIIdentifier.MainThreadExtensionService,d);const E=u.get(m.MainThreadTreeView,[h,"worker"]);return h.set(n.MainThreadAPIIdentifier.MainThreadTreeView,E),()=>{E.dispose()}}},2717:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadProgress=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(68969),p=e(43718),v=e(46147);let m=class{constructor(s){this.rpcProtocol=s,this.progress=new Map,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostProgress)}$startProgress(s,g,l){const h=this.createTask(s);g.location===p.ProgressLocation.Notification&&l&&(g={...g,location:p.ProgressLocation.Notification}),this.progressService.withProgress(g,h,()=>this.proxy.$acceptProgressCanceled(s))}$progressReport(s,g){const l=this.progress.get(s);l&&l.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(l=>{this.progress.set(s,{resolve:l,progress:g})})}};t.MainThreadProgress=m,n.__decorate([(0,r.Autowired)(a.IProgressService),n.__metadata("design:type",Object)],m.prototype,"progressService",void 0),t.MainThreadProgress=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],m)},17802:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initSharedAPIProxy=F;const n=e(71742),r=e(46147),o=e(2717),a=e(62783),p=e(61528),v=e(14678),m=e(33530),_=e(23105),s=e(78690),g=e(84680),l=e(85589),h=e(11646),u=e(22869),d=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),I=e(79813),w=e(33111),T=e(62876),R=e(93633),P=e(49731),O=e(31968),M=e(73082),k=e(13643);function F(L,B){const U=B.get(f.MainThreadLanguages,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadLanguages,U);const W=B.get(v.MainThreadCommands,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadCommands,W);const j=B.get(g.MainThreadExtensionDocumentData,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadDocuments,j);const Q=B.get(l.MainThreadEditorService,[L,j]);L.set(r.MainThreadAPIIdentifier.MainThreadEditors,Q);const G=B.get(A.MainThreadExtensionNotebook,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadNotebook,G);const Z=B.get(R.MainThreadStatusBar,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadStatusBar,Z);const $=B.get(b.MainThreadMessage,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadMessages,$);const V=B.get(P.MainThreadStorage,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadStorage,V);const H=B.get(k.MainThreadWorkspace,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadWorkspace,H);const K=B.get(I.MainThreadQuickOpen,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadQuickOpen,K);const Y=B.get(D.MainThreadPreference,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadPreference,Y);const X=B.get(u.MainThreadEnv,[L,V]);L.set(r.MainThreadAPIIdentifier.MainThreadEnv,X);const oe=B.get(y.MainThreadExtensionLog);L.set(n.MainThreadExtensionLogIdentifier,oe);const ie=B.get(o.MainThreadProgress,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadProgress,ie);const he=B.get(S.MainThreadOutput);L.set(r.MainThreadAPIIdentifier.MainThreadOutput,he);const me=B.get(d.MainThreadFileSystem,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadFileSystem,me);const q=B.get(E.MainThreadFileSystemEvent,[L]),Ee=B.get(a.MainThreadWebview,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadWebview,Ee);const ue=B.get(a.MainThreadWebviewView,[L,Ee]);L.set(r.MainThreadAPIIdentifier.MainThreadWebviewView,ue);const te=B.get(M.MainThreadUrls,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadUrls,te);const fe=B.get(m.MainThreadComments,[L,W]);L.set(r.MainThreadAPIIdentifier.MainThreadComments,fe);const Ie=B.get(p.MainThreadAuthentication,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadAuthentication,Ie);const Me=B.get(c.MainThreadLocalization,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadLocalization,Me);const Be=B.get(h.MainThreadEditorTabsService,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadEditorTabs,Be);const Pe=B.get(w.MainThreadSCM,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadSCM,Pe);const we=B.get(T.MainThreadSecret,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadSecret,we);const _e=B.get(s.MainThreadDecorations,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadDecorations,_e);const Ne=B.get(O.MainThreadTheming,[L]);L.set(r.MainThreadAPIIdentifier.MainThreadTheming,Ne);const Te=B.get(_.MainThreadCustomEditor,[L,Ee]);return L.set(r.MainThreadAPIIdentifier.MainThreadCustomEditor,Te),{setup:async()=>{await Ee.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(),ie.dispose(),he.dispose(),me.dispose(),q.dispose(),Ee.dispose(),ue.dispose(),te.dispose(),Ie.dispose(),fe.dispose(),Be.dispose(),Pe.dispose(),we.dispose(),_e.dispose(),Ne.dispose(),Te.dispose()}}}},62783:(x,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),a=e(8919),p=e(41869),v=e(74654),m=e(19805),_=e(40827),s=e(43718),g=e(54414),l=e(57517),h=e(63067),u=e(52416),d=e(65046),E=e(46147),f=e(53043),c=e(88341),y=e(71354),{addMapElement:b}=p.arrays;let A=class extends p.Disposable{constructor(T){super(),this.rpcProtocol=T,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 p.URI("extension-webview-panels").withScheme(p.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(T,R,P){if(m.HttpOpener.standardSupportedLinkSchemes.has(T.scheme))return!0;if(R.enableCommandUris&&T.scheme===p.Schemes.command){const{id:O,args:M}=v.CommandOpener.parseURI(T);if(!this.commandRegistry.isPermittedCommand(O,P,...M))throw new Error(`Extension ${P.id} has not permit to execute ${O}`);return!0}return!1}initEvents(){this.addDispose(this.editorService.onActiveResourceChange(()=>{this.onChange()})),this.addDispose(this.eventBus.on(l.EditorGroupChangeEvent,()=>{this.onChange()}))}isActive(T,R,P){return T.resourceState.uri.isEqual(R?.uri)&&T.resourceState.openTypeId===P?.componentId}onChange(){const T=this.editorService.currentResource,R=this.editorService.currentEditorGroup.currentOpenType,P=this.editorService.editorGroups.map(O=>({resource:O.currentResource,openType:O.currentOpenType,index:O.index+1}));this.webviewPanelStates.forEach((O,M)=>{if(!this.hasWebviewPanel(M))return;let k=!1;const F=this.getWebviewPanel(M);if(O.active?(!T||!this.isActive(F,T,R))&&(O.active=!1,k=!0):T&&this.isActive(F,T,R)&&(O.active=!0,k=!0),O.visible){const L=P.find(B=>B.resource&&this.isActive(F,B.resource,B.openType));L?L.index!==O.position&&(O.position=L.index,k=!0):(O.visible=!1,O.position=-1,k=!0)}else{const L=P.find(B=>B.resource&&this.isActive(F,B.resource,B.openType));L&&(O.visible=!0,O.position=L.index,k=!0)}k&&(this.proxy.$onDidChangeWebviewPanelViewState(M,O),O.position!==this.getWebviewPanel(M).viewColumn&&(this.getWebviewPanel(M).viewColumn=O.position,this._persistWebviewPanelMeta(M)))})}$createWebviewPanel(T,R,P,O={},M={},k){this.doCreateWebviewPanel(T,R,P,O,M,k)}pipeBrowserHostedWebviewPanel(T,R,P,O,M){const k=T.id,F=new S(k,P,R,{},{},M,T);this.onCreateWebviewPanel(F),this.proxy.$pipeBrowserHostedWebviewPanel(k,P)}async reviveWebview(T){var R;const P=(await this.extWebviewStorage).get(T);if(!P)throw new Error("No revival info for webview "+T);const{viewType:O,webviewOptions:M,extensionInfo:k,title:F}=P;await this.activation.fireEvent("onWebviewPanel",O);const L=await this.getPersistedWebviewState(O,T),B=this.webviewService.createEditorWebviewComponent({allowScripts:M.enableScripts,allowForms:(R=M.enableForms)!==null&&R!==void 0?R:M.enableScripts,longLive:M.retainContextWhenHidden},T,{extWebview:O}),U=B.group?B.group.index+1:P.viewColumn;await this.doCreateWebviewPanel(T,O,F,{viewColumn:U},M,k,L),await this.proxy.$deserializeWebviewPanel(T,O,F,await this.getPersistedWebviewState(O,T),U,M)}onCreateWebviewPanel(T){this.webviewPanels.set(T.id,T);const R=T.webview,P=T.id;T.editorWebview&&T.addDispose(T.editorWebview),T.addDispose(this.connectWebview(T.id,T.webview)),T.addDispose(R.onRemove(()=>{R.dispose(),this.proxy.$onDidDisposeWebviewPanel(P)})),this.webviewPanelStates.set(T.id,{active:!1,visible:!1,position:-1}),this.addDispose({dispose:()=>{this.webviewPanels.has(P)&&this.getWebviewPanel(P).dispose()}}),R.onDidClickLink(O=>{this.isSupportedLink(O,T.options,T.extensionInfo)&&this.openerService.open(O)}),this.addDispose(R.onDidUpdateState(O=>{this._hasSerializer.has(T.viewType)&&this.persistWebviewState(T.viewType,P,O)})),this._persistWebviewPanelMeta(P)}async doCreateWebviewPanel(T,R,P,O={},M={},k,F){var L;const B=this.webviewService.createEditorWebviewComponent({allowScripts:M.enableScripts,allowForms:(L=M.enableForms)!==null&&L!==void 0?L:M.enableScripts,longLive:M.retainContextWhenHidden},T,{extWebview:R}),U=new S(T,R,{uri:B.webviewUri,openTypeId:B.componentId},O,M,k,B.webview,B);B.title=P,this.onCreateWebviewPanel(U),B.supportsRevive=this._hasSerializer.has(U.viewType);const W=(0,f.viewColumnToResourceOpenOptions)(O.viewColumn);B.open(W),F&&(U.webview.state=F)}getWebviewPanel(T){if(!this.webviewPanels.has(T))throw new Error(`No Webview with id: ${T} was found in the browser process.`);return this.webviewPanels.get(T)}hasWebviewPanel(T){return this.webviewPanels.has(T)}$disposeWebview(T){this.getWebviewPanel(T).dispose(),this.webviewPanels.delete(T),this._persistWebviewPanelMeta(T)}$reveal(T,R={}){var P;const O=this.getWebviewPanel(T),M=Object.assign({},O.showOptions,R).viewColumn;(P=O.editorWebview)===null||P===void 0||P.open((0,f.viewColumnToResourceOpenOptions)(M))}$setTitle(T,R){const P=this.getWebviewPanel(T);P.editorWebview&&(P.editorWebview.title=R,P.title=R,this._persistWebviewPanelMeta(T))}$setIconPath(T,R){const P=this.getWebviewPanel(T);P.editorWebview&&(R?P.editorWebview.icon=this.iconService.fromIcon("",R,u.IconType.Background)+" background-tab-icon":P.editorWebview.icon="")}connectWebview(T,R){this.webviews.set(T,R);const P=new p.Disposable;return P.addDispose(R.onMessage(O=>{this.proxy.$onMessage(T,O)})),P.addDispose(b(this.webviews,T,R)),R.onDispose(()=>{P.dispose()}),P}getWebview(T){return this.webviews.get(T)}$setHtml(T,R){var P;(P=this.getWebview(T))===null||P===void 0||P.setContent(R)}$setOptions(T,R){var P;(P=this.getWebview(T))===null||P===void 0||P.updateOptions({allowScripts:R.enableScripts,allowForms:R.enableForms})}async $postMessage(T,R){var P;try{return await((P=this.getWebview(T))===null||P===void 0?void 0:P.postMessage(R)),!0}catch{return!1}}$registerSerializer(T){this._hasSerializer.add(T),this.webviewPanels.forEach(R=>{R.viewType===T&&R.editorWebview&&(R.editorWebview.supportsRevive=!0)})}$unregisterSerializer(T){this._hasSerializer.add(T)}_persistWebviewPanelMeta(T){return this.extWebviewStorage.then(R=>{this.webviewPanels.has(T)?R.set(T,this.getWebviewPanel(T).toJSON()):R.delete(T)})}async persistWebviewState(T,R,P){this.statePersister.has(T)||this.statePersister.set(T,this.getStorage(new p.URI("extension-webview/"+T).withScheme(p.STORAGE_SCHEMA.SCOPE)).then(O=>{const M=(0,r.default)(k=>O.set(R,k),500);return async k=>{await M(k)}})),(await this.statePersister.get(T))(P)}async getPersistedWebviewState(T,R){return(await this.getStorage(new p.URI("extension-webview/"+T).withScheme(p.STORAGE_SCHEMA.SCOPE))).get(R)}$connectPlainWebview(T){if(!this.plainWebviews.has(T)){const R=this.webviewService.getEditorPlainWebviewComponent(T)||this.webviewService.getOrCreatePlainWebviewComponent(T);R&&(this.plainWebviews.set(T,R),R.webview.onMessage(P=>{this.sumiProxy.$acceptMessage(T,P)}),R.webview.onDispose(()=>{this.plainWebviews.delete(T)}))}}async $postMessageToPlainWebview(T,R){if(this.plainWebviews.has(T))try{return await this.plainWebviews.get(T).webview.postMessage(R),!0}catch(P){return this.logger.error(P),!1}return!1}async $createPlainWebview(T,R,P){const O=this.webviewService.createEditorPlainWebviewComponent({},T);O.title=R,P&&(O.icon=this.iconService.fromIcon("",P)||""),this.$connectPlainWebview(T)}async $plainWebviewLoadUrl(T,R){if(!this.plainWebviews.has(T))throw new Error("No Plain Webview With id "+T);await this.plainWebviews.get(T).webview.loadURL(R)}async $setPlainWebviewPartition(T,R){if(!this.plainWebviews.has(T))throw new Error("No Plain Webview With id "+T);this.plainWebviews.get(T).webview.setPartition(R??T)}async $disposePlainWebview(T){var R;this.plainWebviews.has(T)&&((R=this.plainWebviews.get(T))===null||R===void 0||R.dispose())}async $revealPlainWebview(T,R){if(!this.plainWebviews.has(T))throw new Error("No Plain Webview With id "+T);const P=this.plainWebviews.get(T);if(!P.open)throw new Error("not able to open plain webview id:"+T);await P.open({groupIndex:R})}async $getWebviewResourceRoots(){return Array.from(this.staticResourceService.resourceRoots)}};t.MainThreadWebview=A,n.__decorate([(0,o.Autowired)(d.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)(p.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)(u.IIconService),n.__metadata("design:type",Object)],A.prototype,"iconService",void 0),n.__decorate([(0,o.Autowired)(p.IEventBus),n.__metadata("design:type",Object)],A.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(p.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(_.StaticResourceService),n.__metadata("design:type",_.StaticResourceService)],A.prototype,"staticResourceService",void 0),n.__decorate([(0,o.Autowired)(p.IOpenerService),n.__metadata("design:type",Object)],A.prototype,"openerService",void 0),n.__decorate([(0,o.Autowired)(p.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 p.Disposable{constructor(T,R,P,O,M,k,F,L){super(),this.id=T,this.viewType=R,this.resourceState=P,this.showOptions=O,this.options=M,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 p.Disposable{constructor(T,R,P,O){super(),this.id=T,this.viewType=R,this.extension=P,this.webview=O}}let I=class extends s.WithEventBus{constructor(T,R){super(),this.mainThreadWebview=R,this._webviewViews=new Map,this._resolvers=new Map,this.proxy=T.getProxy(E.ExtHostAPIIdentifier.ExtHostWebviewView)}$registerWebviewViewProvider(T,R,P={}){this._resolvers.set(R,{extension:T,options:P}),this.eventBus.fire(new E.WebviewViewResolverRegistrationEvent({viewType:R,options:P}))}$unregisterWebviewViewProvider(T){this._resolvers.delete(T),this.eventBus.fire(new E.WebviewViewResolverRegistrationRemovalEvent({viewType:T}))}$setWebviewViewTitle(T,R){var P;const O=this._webviewViews.get(T);O&&((P=this.mainLayout.getTabbarHandler(O.viewType))===null||P===void 0||P.updateViewTitle(O.viewType,R||""))}$setWebviewViewDescription(T,R){const P=this._webviewViews.get(T)}onWebviewViewShouldShow(T){const R=T.payload.viewType;this._resolvers.has(R)?T.payload.disposer.addDispose(this.resolveWebviewView(T.payload.container,R,T.payload.title,T.payload.cancellationToken)):this.addDispose(this.eventBus.on(E.WebviewViewResolverRegistrationEvent,P=>{P.payload.viewType===R&&this._resolvers.has(R)&&T.payload.disposer.addDispose(this.resolveWebviewView(T.payload.container,R,T.payload.title,T.payload.cancellationToken))}))}resolveWebviewView(T,R,P,O){var M;const k=new p.Disposable,F=this.webviewService.createWebview(),L=(M=this._resolvers.get(R))===null||M===void 0?void 0:M.options,B=this._resolvers.get(R).extension,U=F.id,W=new D(U,R,B,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(T),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,P,F.state,O);const G=this.mainLayout.isViewVisible(R);return this.proxy.$onDidChangeWebviewViewVisibility(U,G),(L?.retainContextWhenHidden||G)&&F.appendTo(T),k.addDispose(W),{dispose:()=>W.dispose()}}$setBadge(T,R){const P=this._webviewViews.get(T);if(P){P.badge=R;const O=this.mainLayout.getTabbarHandler(P.viewType);O&&(O.setBadge(R||""),O.accordionService.updateViewBadge(P.viewType,R||""))}}$show(T,R){const P=this._webviewViews.get(T);P&&this.mainLayout.revealView(P.viewType)}};t.MainThreadWebviewView=I,n.__decorate([(0,o.Autowired)(h.IMainLayoutService),n.__metadata("design:type",Object)],I.prototype,"mainLayout",void 0),n.__decorate([(0,o.Autowired)(d.IWebviewService),n.__metadata("design:type",Object)],I.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)],I.prototype,"onWebviewViewShouldShow",null),t.MainThreadWebviewView=I=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,A])],I)},61528:(x,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),a=e(41869),p=e(43718),v=e(72665),m=e(46147),_=e(71354);let s=class extends a.Disposable{constructor(h,u,d,E){super(),this._proxy=h,this.id=u,this.label=d,this.supportsMultipleAccounts=E,this._accounts=new Map,this._sessions=new Map}async initialize(){return this.registerCommandsAndContextMenuItems()}async manageTrustedExtensions(h){const u=await this.authenticationService.getAllowedExtensions(this.id,h);if(!u.length){this.dialogService.info((0,a.localize)("authentication.noTrustedExtensions"));return}const d=await this.authenticationService.getAccountUsages(this.id,h),E=u.map(c=>{const y=d.find(b=>c.id===b.extensionId);return{label:c.name,description:y?(0,a.localize)("authentication.accountLastUsedDate"):(0,a.localize)("authentication.notUsed"),value:c}}),f=await this.quickPickService.show(E,{title:(0,a.localize)("authentication.manageTrustedExtensions"),placeholder:(0,a.localize)("authentication.manageExtensions")});f&&await this.authenticationService.setAllowedExtensions(this.id,h,[f])}async signOut(h){const u=await this.authenticationService.getAccountUsages(this.id,h),d=this._accounts.get(h),E=u.length?(0,a.formatLocalize)("authentication.signOutMessage",h,u.map(c=>c.extensionName).join(`
31924
- `)):(0,a.formatLocalize)("authentication.signOutMessageSimple",h);await this.dialogService.info(E,[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonOK")])===(0,a.localize)("ButtonOK")&&(d?.forEach(c=>this.logout(c)),await this.authenticationService.removeAccountUsage(this.id,h),await this.authenticationService.removeAllowedExtensions(this.id,h))}async getSessions(h,u){return this._proxy.$getSessions(this.id,h,{account:u})}hasSessions(){return!!this._sessions.size}async updateSessionItems(h){const{added:u,removed:d}=h,f=(await this._proxy.$getSessions(this.id)).filter(c=>u.some(y=>y.id===c.id));d.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(u=>this.registerSession(u))}catch(h){this.logger.error(h)}}registerSession(h){this._sessions.set(h.id,h.account.label);const u=this._accounts.get(h.account.label);if(u){this._accounts.set(h.account.label,u.concat(h.id));return}else this._accounts.set(h.account.label,[h.id])}login(h,u){return this._proxy.$login(this.id,h,u)}async logout(h){await this._proxy.$logout(this.id,h),this.messageService.info((0,a.localize)("authentication.signedOut"))}};t.MainThreadAuthenticationProvider=s,n.__decorate([(0,r.Autowired)(p.IAuthenticationService),n.__metadata("design:type",Object)],s.prototype,"authenticationService",void 0),n.__decorate([(0,r.Autowired)(a.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)(a.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 a.Disposable{constructor(h){super(),this._proxy=h.getProxy(m.ExtHostAPIIdentifier.ExtHostAuthentication),this.addDispose(this.authenticationService.onDidChangeSessions(u=>{this._proxy.$onDidChangeAuthenticationSessions(u.providerId,u.label,u.event)})),this.addDispose(this.authenticationService.onDidRegisterAuthenticationProvider(u=>{this._proxy.$onDidChangeAuthenticationProviders([u],[])})),this.addDispose(this.authenticationService.onDidUnregisterAuthenticationProvider(u=>{this._proxy.$onDidChangeAuthenticationProviders([],[u])}))}$getProviderIds(){return Promise.resolve(this.authenticationService.getProviderIds())}async $registerAuthenticationProvider(h,u,d){const E=this.injector.get(s,[this._proxy,h,u,d]);await E.initialize(),this.authenticationService.registerAuthenticationProvider(h,E),this.addDispose(a.Disposable.create(()=>{this.$unregisterAuthenticationProvider(h)}))}$unregisterAuthenticationProvider(h){this.authenticationService.unregisterAuthenticationProvider(h)}$ensureProvider(h){return this.activationService.fireEvent("onAuthenticationRequest",h)}$sendDidChangeSessions(h,u){this.authenticationService.sessionsUpdate(h,u)}$getSessions(h){return this.authenticationService.getSessions(h)}$login(h,u,d){return this.authenticationService.login(h,u,d)}$logout(h,u){return this.authenticationService.logout(h,u)}$getAccounts(h){return this.authenticationService.getSessions(h).then(u=>u.map(d=>d.account))}async doGetSession(h,u,d,E,f){const c=await this.authenticationService.getSessions(h,u,!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,d))return S}}else if(await this.authenticationService.isAccessAllowed(h,c[0].account.label,d))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 I=c?.length&&!f.forceNewSession&&y?await this.selectSession(h,A,d,E,c,u,f,!!f.clearSessionPreference):await this.authenticationService.login(h,u,f);return await this.authenticationService.updatedAllowedExtension(h,I.account.label,d,E,!0),await this.authenticationService.setExtensionSessionId(E,h,I.id),I}const b=c.find(A=>this.authenticationService.isAccessAllowed(h,A.account.label,d));return!f.silent&&!b&&await this.authenticationService.requestNewSession(h,u,f,d,E),b}async $getSession(h,u,d,E,f){const c=await this.doGetSession(h,u,d,E,f);return c&&await this.authenticationService.addAccountUsage(h,c.account.label,d,E),c}async selectSession(h,u,d,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 T=await this.authenticationService.getExtensionSessionId(E,h);if(T){const R=f.find(P=>P.id===T);if(R&&await this.$getSessionsPrompt(h,R.account.label,u,d,E))return R}}const A=f.map(T=>({label:T.account.label,value:T}));A.push({label:(0,a.localize)("authentication.useOtherAccount"),value:void 0});const S=await this.quickPickService.show(A,{title:(0,a.formatLocalize)("authentication.selectAccount",E,u),placeholder:(0,a.formatLocalize)("authentication.getSessionPlaceholder",E),ignoreFocusOut:!0}),D=S??await this.authenticationService.login(h,c,y),I=D.account.label,w=await this.authenticationService.getAllowedExtensions(h,I);return w.find(T=>T.id===d)||(w.push({id:d,name:E}),await this.authenticationService.setAllowedExtensions(h,I,w)),await this.authenticationService.setExtensionSessionId(E,h,D.id),D}async $getSessionsPrompt(h,u,d,E,f){const c=await this.authenticationService.getAllowedExtensions(h,u);if(c.find(S=>S.id===E))return await this.authenticationService.addAccountUsage(h,u,E,f),!0;const A=await this.dialogService.info((0,a.formatLocalize)("authentication.confirmAuthenticationAccess",f,d,u),[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonAllow")])===(0,a.localize)("ButtonAllow");return A&&(this.authenticationService.addAccountUsage(h,u,E,f),c.push({id:E,name:f}),await this.authenticationService.setAllowedExtensions(h,u,c)),A}async loginPrompt(h,u,d,E){return await this.dialogService.info(d?(0,a.formatLocalize)("authentication.confirmReLogin",u,h):(0,a.formatLocalize)("authentication.confirmLogin",u,h),[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonAllow")])===(0,a.localize)("ButtonAllow")}async $setTrustedExtensionAndAccountPreference(h,u,d,E,f){const c=await this.authenticationService.getAllowedExtensions(h,u);c.find(y=>y.id===d)||(c.push({id:d,name:E}),await this.authenticationService.setAllowedExtensions(h,u,c)),await this.authenticationService.setExtensionSessionId(E,h,f),await this.authenticationService.addAccountUsage(h,u,d,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)(p.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)(a.QuickPickService),n.__metadata("design:type",Object)],g.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(_.IActivationEventService),n.__metadata("design:type",_.IActivationEventService)],g.prototype,"activationService",void 0),t.MainThreadAuthentication=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],g)},14678:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommands=void 0;const r=e(85608),o=e(76003),a=e(8919),p=e(41869),v=e(43718),m=e(21880),_=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(_.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(u=>u instanceof v.URI?u.codeUri:u):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 u=this.argumentProcessors.indexOf(h);u>=0&&this.argumentProcessors.splice(u,1)})}$registerCommand(h){const u=r.__classPrivateFieldGet(this,n,"f"),d=(...y)=>(y=y.map(b=>this.argumentProcessors.reduce((A,S)=>S.processArgument(A),b)),u.$executeContributedCommand(h,...y)),E=new v.Disposable,f={execute:d,dispose:()=>E.dispose()};this.commandRegistry.getCommand(h)?E.addDispose(this.commandRegistry.registerHandler(h,{execute:d})):E.addDispose(this.commandRegistry.registerCommand({id:h},{execute:d})),this.commands.set(h,f)}$unregisterCommand(h){const u=this.commands.get(h);u&&(u.dispose(),this.commands.delete(h))}$getCommands(){return Promise.resolve(this.commandRegistry.getCommands().map(h=>h.id))}$executeExtensionCommand(h,...u){return this.commands.has(h)?this.commands.get(h).execute(...u):(u=u.map(d=>this.argumentProcessors.reduce((E,f)=>f.processArgument(E),d)),r.__classPrivateFieldGet(this,n,"f").$executeContributedCommand(h,...u))}$executeCommandWithExtensionInfo(h,u,...d){if(!this.commandRegistry.isPermittedCommand(h,u,...d))throw new Error(`Extension ${u.id} has not permit to execute ${h}`);return this.$executeCommand(h,...d)}async $executeCommand(h,...u){try{return await this.monacoCommandService.executeCommand(h,...u)}catch(d){throw this.logger.error(d),d}}};t.MainThreadCommands=g,n=new WeakMap,r.__decorate([(0,o.Autowired)(p.CommandRegistry),r.__metadata("design:type",Object)],g.prototype,"commandRegistry",void 0),r.__decorate([(0,o.Autowired)(m.ICommandServiceToken),r.__metadata("design:type",Object)],g.prototype,"monacoCommandService",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],g.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(p.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)(a.IRPCProtocol)),r.__metadata("design:paramtypes",[Object])],g)},33530:(x,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),a=e(8919),p=e(93899),v=e(43718),m=e(20868),_=e(28423),s=e(46147),g=e(53043),l=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 p.MenuId.CommentsCommentThreadTitle:return{$mid:7,commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle};case p.MenuId.CommentsCommentThreadContext:return{$mid:8,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},text:f.text};case p.MenuId.CommentsCommentTitle:return{$mid:9,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},commentUniqueId:+f.comment.id};case p.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(d,[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 u=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,_.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()?l.CommentThreadCollapsibleState.Collapsed:l.CommentThreadCollapsibleState.Expanded}set collapsibleState(f){(0,_.transaction)(c=>{this._thread.isCollapsed.set(f===l.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 I=this.commentsService.commentsThreads.filter(R=>R.uri.toString()===A&&R.range.startLineNumber===S.startLineNumber),[w]=I.slice(-1),T={commentControlHandle:c,commentThreadHandle:f};w&&!w.data?(w.data=T,this._thread=w):this._thread=this.commentsService.createThread(new v.URI(A),(0,m.positionToRange)(S.startLineNumber),{data:T,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=u,n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],u.prototype,"commentsService",void 0),t.MainThreadCommentThread=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Number,Number,String,String,String,Object,Boolean])],u);let d=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(u,[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),I=D.convertToCoreComment(b),w=D.convertToCoreReaction(A);this.toggleReaction(y.uri,D,I,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=d,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],d.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],d.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)],d.prototype,"handleCommentReaction",null),t.MainThreadCommentController=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Number,String,String,Object])],d)},57484:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadConnection=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(46147);let m=class{constructor(s){this.rpcProtocol=s,this.connections=new Map,this.connectionsReady=new Map,this.toDispose=new p.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 l=this.connectionsReady.get(s);l&&await l.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 l=new a.Deferred;this.connectionsReady.set(s,l),g=await this.doCreateConnection(s),l.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(p.Disposable.create(()=>g.fireClose())),g}};t.MainThreadConnection=m,n.__decorate([(0,r.Autowired)(p.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.MainThreadConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],m)},23105:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCustomEditor=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(57517),v=e(65046),m=e(46147),_=e(35912),s=e(62783);let g=class extends a.WithEventBus{constructor(h,u){super(),this.webview=u,this.customEditors=new Map,this.proxy=h.getProxy(m.ExtHostAPIIdentifier.ExtHostCustomEditor)}$acceptCustomDocumentDirty(h,u){this.eventBus.fire(new p.ResourceDecorationNeedChangeEvent({uri:a.URI.from(h),decoration:{dirty:u}}))}async onShouldSave(h){const{viewType:u,uri:d,cancellationToken:E}=h.payload,f=this.customEditors.get(u);if(f){if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{await c.instance.save()}finally{c.dispose()}}else if(f.type===m.CustomEditorType.FullEditor)return this.proxy.$saveCustomDocument(u,d.codeUri,E)}}async onShouldRevert(h){const{viewType:u,uri:d,cancellationToken:E}=h.payload,f=this.customEditors.get(u);if(f){if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{await c.instance.revert()}finally{c.dispose()}}else if(f.type===m.CustomEditorType.FullEditor)return this.proxy.$revertCustomDocument(u,d.codeUri,E)}}async onShouldEdit(h){const{viewType:u,uri:d,type:E}=h.payload,f=this.customEditors.get(u);if(f)if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{E==="undo"?await c.instance.getMonacoModel().undo():await c.instance.getMonacoModel().redo()}finally{c.dispose()}}else f.type===m.CustomEditorType.FullEditor&&(E==="undo"?await this.proxy.$undo(u,d.codeUri):await this.proxy.$redo(u,d.codeUri))}async onCustomEditorShouldDisplayEvent(h){const u=this.customEditors.get(h.payload.viewType);if(u){const{viewType:d,uri:E,openTypeId:f,webviewPanelId:c,cancellationToken:y}=h.payload;if(u.type===m.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(_.CustomEditorShouldHideEvent,S=>{E.isEqual(S.payload.uri)&&b.dispose()}),this.webview.pipeBrowserHostedWebviewPanel(A,{uri:E,openTypeId:f},d,u.options.webviewOptions||{},u.extensionInfo),this.proxy.$resolveCustomTextEditor(d,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},d,u.options.webviewOptions||{},u.extensionInfo),this.proxy.$resolveCustomTextEditor(d,E.codeUri,c,y)}}}$registerCustomEditor(h,u,d={},E){this.customEditors.set(h,{type:u,options:d,extensionInfo:E}),this.eventBus.fire(new _.CustomEditorOptionChangeEvent({viewType:h,options:d}))}$unregisterCustomEditor(h){this.customEditors.delete(h)}};t.MainThreadCustomEditor=g,n.__decorate([(0,r.Autowired)(p.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,a.OnEvent)(_.CustomEditorShouldSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldSave",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldRevertEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldRevert",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldEditEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldEditEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldEdit",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldDisplayEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDebug=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(66482),m=e(99797),_=e(37499),s=e(31141),g=e(97186),l=e(38029),h=e(15153),u=e(70159),d=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),I=e(21259),w=e(90384);let T=class{constructor(P,O){this.rpcProtocol=P,this.mainThreadConnection=O,this.toDispose=new Map,this.listenerDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(A.ExtHostAPIIdentifier.ExtHostDebug),this.listen(),this.registerDebugContributions()}dispose(){this.toDispose.forEach(P=>{P.dispose()}),this.toDispose.clear(),this.listenerDispose.dispose()}listen(){this.listenerDispose.pushAll([this.breakpointManager.onDidChangeBreakpoints(({added:P,removed:O,changed:M})=>{const k=this.breakpointManager.getBreakpoints();this.proxy.$breakpointsDidChange(this.toCustomApiBreakpoints(k),this.toCustomApiBreakpoints(P),this.toCustomApiBreakpoints(O),this.toCustomApiBreakpoints(M))}),this.sessionManager.onDidStartDebugSession(P=>{this.proxy.$sessionDidStart(P.id)}),this.sessionManager.onDidDestroyDebugSession(P=>{this.proxy.$sessionDidDestroy(P.id)}),this.sessionManager.onDidChangeActiveDebugSession(P=>{this.proxy.$sessionDidChange(P.current&&P.current.id)}),this.sessionManager.onDidReceiveDebugSessionCustomEvent(P=>{this.proxy.$onSessionCustomEvent(P.session.id,P.event,P.body)}),this.debugService.onDidDebugContributionPointChange(({path:P,contributions:O,removed:M})=>{M?(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(P,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 P=this.debugService.debugContributionPoints;for(const[O,M]of P)this.proxy.$registerDebuggerContributions(O,M),M.forEach(k=>{this.$registerDebuggerContribution({type:k.type,label:k.label||k.type}),this.logger.log(`Debugger contribution has been registered: ${k.type}`)})}async $appendToDebugConsole(P){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.append(P)}async $appendLineToDebugConsole(P){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.appendLine(P)}async $unregisterDebuggerContribution(P){const O=this.toDispose.get(P.type);O?.dispose()}async $registerDebuggerContribution(P){const O=new a.DisposableCollection,M=await this.proxy.$getTerminalCreationOptions(P.type);this.toDispose.set(P.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,M,this.debugPreferences,this.outputService,this.injector,this.sessionManager);O.pushAll([this.adapterContributionRegister.registerDebugAdapterContribution(new I.ExtensionDebugAdapterContribution(P,this.proxy,this.activationEventService)),this.sessionContributionRegistry.registerDebugSessionContribution({debugType:P.type,debugSessionFactory:()=>k})])}async $addBreakpoints(P){const O=new Map;P.forEach(M=>O.set(M.id,M)),this.breakpointManager.findMarkers({dataFilter:M=>(O.has(M.id)&&O.delete(M.id),!1)});for(const M of O.values())if(M.location){const k=M.location;this.breakpointManager.addBreakpoint(m.DebugBreakpoint.create(a.Uri.revive(k.uri),{line:M.location.range.startLineNumber+1,column:1,condition:M.condition,hitCondition:M.hitCondition,logMessage:M.logMessage},!0))}}async $removeBreakpoints(P){const O=new Set;P.forEach(M=>O.add(M.id));for(const M of this.breakpointManager.findMarkers({dataFilter:k=>O.has(k.id)})){const k=this.modelManager.resolve(new a.URI(M.data.uri));k&&k[0].breakpoint&&this.breakpointManager.delBreakpoint(k[0].breakpoint)}}async $customRequest(P,O,M){const k=this.sessionManager.getSession(P);if(k)return k.sendCustomRequest(O,M);throw new Error(`Debug session '${P}' not found`)}$getDebugProtocolBreakpoint(P,O){const M=this.sessionManager.getSession(P);return M?Promise.resolve(M.getDebugProtocolBreakpoint(O)):Promise.reject(new Error("debug session not found"))}async $startDebugging(P,O,M){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(M.parentSessionID),repl:M.repl,compact:M.compact,lifecycleManagedByParent:M.lifecycleManagedByParent};return!!await this.sessionManager.start({configuration:k,workspaceFolderUri:P&&a.Uri.revive(P.uri).toString(),index:F,...L})}$stopDebugging(P){if(P){const O=this.sessionManager.getSession(P);if(O)return this.sessionManager.stopSession(O)}else return this.sessionManager.stopSession(void 0);throw new Error(`Debug session '${P}' not found`)}toCustomApiBreakpoints(P){return P.map(O=>({id:O.id,enabled:O.enabled,condition:O.raw.condition,hitCondition:O.raw.hitCondition,logMessage:O.raw.logMessage,location:{uri:a.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=T,n.__decorate([(0,r.Autowired)(d.IDebugSessionManager),n.__metadata("design:type",l.DebugSessionManager)],T.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],T.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(m.BreakpointManager),n.__metadata("design:type",m.BreakpointManager)],T.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(v.IDebugModelManager),n.__metadata("design:type",Object)],T.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(_.DebugConfigurationManager),n.__metadata("design:type",_.DebugConfigurationManager)],T.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(s.DebugPreferences),n.__metadata("design:type",Object)],T.prototype,"debugPreferences",void 0),n.__decorate([(0,r.Autowired)(E.WorkbenchEditorService),n.__metadata("design:type",E.WorkbenchEditorService)],T.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(y.IMessageService),n.__metadata("design:type",Object)],T.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(f.IFileServiceClient),n.__metadata("design:type",Object)],T.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(u.IDebugServer),n.__metadata("design:type",w.ExtensionDebugService)],T.prototype,"adapterContributionRegister",void 0),n.__decorate([(0,r.Autowired)(S.IActivationEventService),n.__metadata("design:type",S.IActivationEventService)],T.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(g.DebugSessionContributionRegistry),n.__metadata("design:type",D.ExtensionDebugSessionContributionRegistry)],T.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],T.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(b.ITerminalApiService),n.__metadata("design:type",Object)],T.prototype,"terminalService",void 0),n.__decorate([(0,r.Autowired)(v.IDebugConsoleModelService),n.__metadata("design:type",h.DebugConsoleModelService)],T.prototype,"debugConsoleModelService",void 0),n.__decorate([(0,r.Autowired)(c.OutputService),n.__metadata("design:type",c.OutputService)],T.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(u.IDebugService),n.__metadata("design:type",Object)],T.prototype,"debugService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],T.prototype,"injector",void 0),t.MainThreadDebug=T=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])],T)},78690:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDecorations=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(41893),v=e(46147);class m{constructor(g){this._proxy=g,this._idPool=0,this._requests=Object.create(null),this._resolver=Object.create(null)}enqueue(g,l,h){const u=++this._idPool,d=new Promise(E=>{this._requests[u]={id:u,handle:g,uri:l},this._resolver[u]=E,this._processQueue()});return h.onCancellationRequested(()=>{delete this._requests[u],delete this._resolver[u]}),d}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const g=this._requests,l=this._resolver;this._proxy.$provideFileDecorations(Object.values(g),a.CancellationToken.None).then(h=>{for(const u in l)l[u](h[u])}),this._requests=[],this._resolver=[],this._timer=void 0},0))}}let _=class{constructor(g){this.rpcProtocol=g,this._provider=new Map,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostDecorations),this._requestQueue=new m(this.proxy)}dispose(){this._provider.forEach(g=>(0,a.dispose)(g)),this._provider.clear()}$registerDecorationProvider(g,l){const h=new a.Emitter,u=this.decorationsService.registerDecorationsProvider({label:l,onDidChange:h.event,provideDecorations:(d,E)=>this._requestQueue.enqueue(g,d,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,u])}$onDidChange(g,l){const h=this._provider.get(g);if(h){const[u]=h;u.fire(l&&l.map(d=>a.Uri.revive(d)))}}$unregisterDecorationProvider(g){const l=this._provider.get(g);l&&((0,a.dispose)(l),this._provider.delete(g))}};t.MainThreadDecorations=_,n.__decorate([(0,r.Autowired)(p.IDecorationsService),n.__metadata("design:type",p.IDecorationsService)],_.prototype,"decorationsService",void 0),t.MainThreadDecorations=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],_)},84680:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionDocumentData=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(43718),m=e(54414),_=e(57517),s=e(17878),g=e(14951),l=e(46147),h=1e3*60*3,u=1e3*20,d=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(l.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,I])=>({name:D,icon:I,uri:S,metadata:null}))})),A.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(b,(S,D)=>{this.fileServiceClient.handlesScheme(b)||D.push({type:_.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)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"docManager",void 0),n.__decorate([(0,r.Autowired)(_.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],f.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.ResourceService)],f.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.EditorComponentRegistry)],f.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.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)(a.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)(_.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelContentChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentChangeEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelWillSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelWillSaveEvent]),n.__metadata("design:returntype",Promise)],f.prototype,"onEditorDocumentModelWillSaveEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelOptionChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelOptionChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelOptionChangedEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelCreationEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelCreationEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentCreationEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelRemovalEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelRemovalEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelRemovedEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelSavedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.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=d,this.maxAge=h,this.minAge=u,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 I=this.refs.indexOf(D);I!==0&&(this.length-=A,b.dispose(),clearTimeout(S),this.refs.splice(I,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorTabsService=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(75524),p=e(43718),v=e(54414),m=e(51553),_=e(46147);let s=class extends p.Disposable{constructor(d){super(),this.rpcProtocol=d,this.prevEditorGroups=new Set,this.groupDataStore=new Map,this.tabStore=new l,this.proxy=this.rpcProtocol.getProxy(_.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(d,E,f,c){const y=this.findEditorTabData(d);if(y){const{group:b,resource:A}=y;let S=b;(0,p.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(d,E){return(await Promise.all(d.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(d,E){return(await Promise.all(d.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(d){return this.tabStore.all.get(d)}getOrCreateGroupData(d){if(!this.groupDataStore.has(d.groupId)){const E=new h(d,this.workbenchEditorService,this.tabStore,this.proxy);E.addDispose({dispose:()=>{this.groupDataStore.get(d.groupId)===E&&this.groupDataStore.delete(d.groupId)}}),this.groupDataStore.set(d.groupId,E)}return this.groupDataStore.get(d.groupId)}updateGroups(){const d=(0,p.diffSets)(this.prevEditorGroups,new Set(this.workbenchEditorService.editorGroups));d.added.length>0||d.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",m.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(d,E){this.group=d,this.resource=E,this.tryUpdate()}updateResource(d){this.resource=d}tryUpdate(){const d=g.from(this.group,this.resource);return this._dto&&JSON.stringify(this._dto)!==JSON.stringify(d)?(this._dto=d,!0):(this._dto=d,!1)}get dto(){return this._dto}static getTabId(d,E){return`${d.groupId}~${E.uri.toString()}`}get index(){return this.group.resources.indexOf(this.resource)}static from(d,E){var f,c,y,b,A,S;const D=g.getTabId(d,E),I=d.getLastOpenType(E);let w={kind:0};if(I){if(I.type==="code")w={kind:1,uri:E.uri.codeUri};else if(I.type==="diff"){const{metadata:T}=E;T&&(w={kind:2,original:T.original.codeUri,modified:T.modified.codeUri})}else if(I.type==="mergeEditor"){const{metadata:T}=E;if(T){const{ancestor:R,input1:P,input2:O,output:M}=T,k=a.MergeEditorInputData.from(P),F=a.MergeEditorInputData.from(O);w={kind:3,base:p.Uri.parse(R),input1:k.uri.codeUri,input2:F.uri.codeUri,result:p.Uri.parse(M)}}}else if(I.type==="component"){const T=d.editorComponentRegistry.getEditorComponent(I.componentId);!((f=T?.metadata)===null||f===void 0)&&f.extWebview?w={kind:7,viewType:(c=T?.metadata)===null||c===void 0?void 0:c.extWebview}:!((y=T?.metadata)===null||y===void 0)&&y.customEditor&&(w={kind:6,viewType:(b=T?.metadata)===null||b===void 0?void 0:b.customEditor,uri:E.uri.codeUri})}}return{id:D,label:E.name,input:w,isActive:d.currentResource===E,isPinned:!1,isPreview:!!(!((A=d.previewURI)===null||A===void 0)&&A.isEqual(E.uri)),isDirty:!!(!((S=d.resourceService.getResourceDecoration(E.uri))===null||S===void 0)&&S.dirty)}}}class l{constructor(){this.all=new Map,this.mapByUri=new Map}getOrCreateData(d,E){const f=g.getTabId(d,E);if(this.all.has(f))this.all.get(f).updateResource(E);else{const c=new g(d,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(d){var E,f;const c=this.all.get(d);if(c){this.all.delete(d);const y=c.resource.uri.toString();(E=this.mapByUri.get(y))===null||E===void 0||E.delete(d),((f=this.mapByUri.get(y))===null||f===void 0?void 0:f.size)===0&&this.mapByUri.delete(y)}}getByResourceUri(d){var E;return Array.from(((E=this.mapByUri.get(d.toString()))===null||E===void 0?void 0:E.values())||[])}}class h extends p.Disposable{constructor(d,E,f,c){super(),this.editorGroup=d,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(d=>this.store.getOrCreateData(this.editorGroup,d)),this.addDispose(this.editorGroup.onDidEditorGroupTabOperation(d=>{const E={open:0,close:1,move:3}[d.type],f=this.store.getOrCreateData(this.editorGroup,d.resource);f.tryUpdate(),this.proxy.$acceptTabOperation({kind:E,groupId:this.editorGroup.groupId,tabDto:f.dto,index:d.index,oldIndex:d.oldIndex})})),this.addDispose(this.editorGroup.onDidEditorGroupBodyChanged(()=>{this.onTabsMayUpdated()})),this.addDispose(this.editorGroup.onDidEditorGroupTabChanged(()=>{this.onTabsMayUpdated()}))}onTabsMayUpdated(){this.tabs=this.editorGroup.resources.map((d,E)=>{const f=this.store.getOrCreateData(this.editorGroup,d);return f.tryUpdate()&&this.proxy.$acceptTabOperation({kind:2,tabDto:f.dto,index:E,groupId:this.editorGroup.groupId}),f})}tryCheckUpdate(){const d=this._data,E={groupId:this.editorGroup.groupId,isActive:this.editorService.currentEditorGroup===this.editorGroup,viewColumn:this.editorGroup.index};this._data=E,d&&(d.viewColumn!==E.viewColumn?this.proxy.$acceptTabGroupUpdate({...this.dto,tabs:[]}):!d.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorService=void 0,t.cursorStyleToString=P;const n=e(85608),r=n.__importDefault(e(82451)),o=n.__importDefault(e(97331)),a=e(76003),p=e(8919),v=e(40827),m=e(43718),_=e(54414),s=e(57517),g=e(71624),l=e(51553),h=n.__importStar(e(20868)),u=e(87822),d=e(16781),E=e(46147),f=e(53043),c=e(84680);let y=class extends m.WithEventBus{constructor(M,k){super(),this.rpcProtocol=M,this.documents=k,this.propertiesChangeCache=new Map,this.triggerPropertiesChange=(0,o.default)(()=>{const F=[];this.propertiesChangeCache.forEach(L=>{F.push(L)}),this.propertiesChangeCache.clear(),this.proxy.$acceptPropertiesChanges(F)},16,{leading:!0,trailing:!0}),this.proxy=this.rpcProtocol.getProxy(E.ExtHostAPIIdentifier.ExtHostEditors),this.$getInitialState().then(F=>{this.proxy.$acceptChange(F)})}async $getInitialState(){this.startEvents();const M=this.editorService.editorGroups.map(F=>{if(F.currentOpenType&&D(F.currentOpenType)){const L=F.currentEditor;return!L.currentDocumentModel||!this.documents.isDocSyncEnabled(L.currentDocumentModel.uri)?void 0:{id:b(F,F.currentResource.uri),uri:L.currentDocumentModel.uri.toString(),selections:L.getSelections()||[],options:S(L.monacoEditor),viewColumn:w(F),visibleRanges:L.monacoEditor.getVisibleRanges()}}}).filter(F=>!!F),k=this.editorService.currentResource&&M.find(F=>F.uri===this.editorService.currentResource.uri.toString());return{created:M,actived:k&&this.documents.isDocSyncEnabled(k.uri)&&k.id}}async $closeEditor(M){if(this.getEditor(M)){const F=this.getGroup(M);F.close(F.currentResource.uri)}}async $revealRange(M,k,F){const L=this.getEditor(M);if(L)switch(F){case E.TextEditorRevealType.InCenter:return L.monacoEditor.revealRangeInCenter(k);case E.TextEditorRevealType.AtTop:return L.monacoEditor.revealRangeAtTop(k);case E.TextEditorRevealType.InCenterIfOutsideViewport:return L.monacoEditor.revealRangeInCenterIfOutsideViewport(k);default:return L.monacoEditor.revealRange(k)}}async $createTextEditorDecorationType(M,k){this.resolveIconPaths(k),this.resolveIconPaths(k.dark),this.resolveIconPaths(k.light),this.decorationService.createTextEditorDecorationType(k,M)}resolveIconPaths(M){if(!M)return M;if(M.gutterIconPath){let k;typeof M.gutterIconPath=="string"?k=m.URI.file(M.gutterIconPath):k=m.URI.from(M.gutterIconPath),M.gutterIconPath=this.staticResourceService.resolveStaticResource(k).toString()}}async $deleteTextEditorDecorationType(M){const k=this.decorationService.getTextEditorDecorationType(M);k&&k.dispose()}async $applyDecoration(M,k,F){const L=this.getEditor(M);L&&L.applyDecoration(k,F)}async $insertSnippet(M,k,F=[],L={undoStopAfter:!0,undoStopBefore:!0}){const B=this.getEditor(M);B&&B.insertSnippet(k,F,L)}async $updateOptions(M,k){const F=this.getEditor(M);F&&await this.setConfiguration(F.monacoEditor,k)}getEditor(M){var k,F;const L=this.getGroup(M);if(!L)return;const B=L.currentResource;if(B&&L.currentOpenType&&D(L.currentOpenType)){if(M===b(L,B.uri))return L.currentEditor;if(((k=L.currentOpenType)===null||k===void 0?void 0:k.type)===s.EditorOpenType.diff&&M===b(L,B.metadata.original,"original"))return L.diffEditor.originalEditor;if(((F=L.currentOpenType)===null||F===void 0?void 0:F.type)===s.EditorOpenType.diff&&M===b(L,B.metadata.modified,"modified"))return L.diffEditor.modifiedEditor}}getGroup(M){const k=A(M);return this.editorService.getEditorGroup(k)}batchPropertiesChanges(M){const{id:k}=M;let F=this.propertiesChangeCache.get(k);F||(F={}),F=(0,r.default)(F,M),this.propertiesChangeCache.set(k,F),this.triggerPropertiesChange()}startEvents(){this.addDispose([this.eventBus.on(s.EditorGroupChangeEvent,M=>{const k=M.payload;if(!T(k.newResource,k.oldResource)||!R(k.newOpenType,k.oldOpenType)){const F={};if(k.newOpenType&&(k.newOpenType.type===s.EditorOpenType.code||k.newOpenType.type===s.EditorOpenType.diff)){const L=k.group.currentEditor;if(L.currentDocumentModel){if(this.documents.isDocSyncEnabled(L.currentDocumentModel.uri))if(F.created=[],k.newOpenType.type===s.EditorOpenType.diff){const B=k.group.diffEditor.originalEditor,U=k.group.diffEditor.modifiedEditor,W=b(k.group,k.newResource.metadata.original,"original");F.created.push({id:W,uri:B.currentUri.toString(),selections:B.getSelections()||[],options:S(B.monacoEditor),viewColumn:w(k.group),visibleRanges:B.monacoEditor.getVisibleRanges()});const j=b(k.group,k.newResource.metadata.modified,"modified");F.created.push({id:j,uri:U.currentUri.toString(),selections:U.getSelections()||[],options:S(U.monacoEditor),viewColumn:w(k.group),visibleRanges:U.monacoEditor.getVisibleRanges()})}else F.created.push({id:b(k.group,k.newResource.uri),uri:L.currentDocumentModel.uri.toString(),selections:L.getSelections()||[],options:S(L.monacoEditor),viewColumn:w(k.group),visibleRanges:L.monacoEditor.getVisibleRanges()})}T(k.newResource,k.oldResource)&&!R(k.newOpenType,k.oldOpenType)&&k.newResource===this.editorService.currentResource&&(F.actived=b(k.group,k.newResource.uri))}k.oldOpenType&&(k.oldOpenType.type===s.EditorOpenType.code||k.oldOpenType.type===s.EditorOpenType.diff)&&(F.removed=[],k.oldOpenType.type===s.EditorOpenType.diff?(F.removed.push(b(k.group,k.oldResource.metadata.original,"original")),F.removed.push(b(k.group,k.oldResource.metadata.modified,"modified"))):F.removed=[b(k.group,k.oldResource.uri)]),this.proxy.$acceptChange(F)}}),this.editorService.onActiveEditorUriChange(M=>{M&&this.editorService.currentEditorGroup&&D(this.editorService.currentEditorGroup.currentOpenType)?this.acceptCurrentEditor(M):this.proxy.$acceptChange({actived:"-1"})}),this.eventBus.on(s.EditorConfigurationChangedEvent,M=>{const k=b(M.payload.group,M.payload.resource.uri);M.payload.group.currentEditor&&M.payload.group.currentEditor.monacoEditor.getModel()&&this.batchPropertiesChanges({id:k,options:S(M.payload.group.currentEditor.monacoEditor)})}),this.eventBus.on(s.EditorSelectionChangeEvent,M=>{const k=b(M.payload.group,M.payload.editorUri,M.payload.side);this.batchPropertiesChanges({id:k,selections:{selections:M.payload.selections,source:M.payload.source}}),this.acceptCurrentEditor(M.payload.editorUri)}),this.eventBus.on(s.EditorVisibleChangeEvent,M=>{const k=b(M.payload.group,M.payload.resource.uri);this.batchPropertiesChanges({id:k,visibleRanges:M.payload.visibleRanges})}),this.eventBus.on(s.EditorGroupIndexChangedEvent,M=>{if(I(M.payload.group)){const k=b(M.payload.group,M.payload.group.currentResource.uri);this.batchPropertiesChanges({id:k,viewColumn:w(M.payload.group)})}})])}acceptCurrentEditor(M){var k,F,L,B,U;let W;const j=((k=this.editorService.currentEditorGroup.currentOpenType)===null||k===void 0?void 0:k.type)===s.EditorOpenType.diff&&((F=this.editorService.currentEditorGroup.diffEditor.originalEditor.currentUri)===null||F===void 0?void 0:F.isEqual(M)),Q=((L=this.editorService.currentEditorGroup.currentOpenType)===null||L===void 0?void 0:L.type)===s.EditorOpenType.diff&&((B=this.editorService.currentEditorGroup.diffEditor.modifiedEditor.currentUri)===null||B===void 0?void 0:B.isEqual(M));j&&(W="original"),Q&&(W="modified"),W?this.proxy.$acceptChange({actived:b(this.editorService.currentEditorGroup,M,W)}):this.proxy.$acceptChange({actived:b(this.editorService.currentEditorGroup,(U=this.editorService.currentEditorGroup.currentResource)===null||U===void 0?void 0:U.uri)})}async $applyEdits(M,k,F,L){const B=this.getEditor(M);if(B&&B.currentDocumentModel){const U=B.currentDocumentModel.getMonacoModel();if(U&&U.getVersionId()===k){typeof L.setEndOfLine<"u"&&U.pushEOL(L.setEndOfLine);const W=F.map(j=>({range:h.Range.lift(j.range),text:j.text,forceMoveMarkers:j.forceMoveMarkers}));return L.undoStopBefore&&B.monacoEditor.pushUndoStop(),B.monacoEditor.executeEdits("MainThreadTextEditor",W),L.undoStopAfter&&B.monacoEditor.pushUndoStop(),!0}else return!1}else return!1}async $openResource(M,k){k.forceOpenType={type:s.EditorOpenType.code},k.focus=!0,k={...k,...(0,f.viewColumnToResourceOpenOptions)(k.viewColumn)};const F=await this.editorService.open(new m.URI(M),k);if(F)return b(F.group,F.resource.uri);throw new Error("Editor Open uri "+M.toString()+" Failed")}$setSelections(M,k){return this.getEditor(M)?(this.getEditor(M).setSelections(k),Promise.resolve()):Promise.reject(`No Such TextEditor: ${M}`)}setConfiguration(M,k){if(M.getModel()&&this._setIndentConfiguration(M.getModel(),k),!!M){if(k.cursorStyle){const F=P(k.cursorStyle);M.updateOptions({cursorStyle:F})}if(typeof k.lineNumbers<"u"){let F;switch(k.lineNumbers){case 1:F="on";break;case 2:F="relative";break;case 3:F="interval";break;default:F="off"}M.updateOptions({lineNumbers:F})}}}$getDiffInformation(M){const k=this.getEditor(M);if(!k)return Promise.reject(new Error("No such TextEditor"));const F=k.monacoEditor;if(!F)return Promise.reject(new Error("No such CodeEditor"));const L=F.getId(),B=this.codeEditorService.listDiffEditors(),[U]=B.filter(j=>j.originalEditor.getId()===L||j.modifiedEditor.getId()===L);if(U){const j=U.monacoDiffEditor.getLineChanges();return j?Promise.resolve(j.map(Q=>{var G;return[Q.originalStartLineNumber,Q.originalEndLineNumber,Q.modifiedStartLineNumber,Q.modifiedEndLineNumber,(G=Q.charChanges)===null||G===void 0?void 0:G.map(Z=>[Z.originalStartLineNumber,Z.originalStartColumn,Z.originalEndLineNumber,Z.originalEndColumn,Z.modifiedStartLineNumber,Z.modifiedStartColumn,Z.modifiedEndLineNumber,Z.modifiedEndColumn])]})):Promise.resolve([])}const W=F.getContribution("editor.contrib.dirtydiff");return W?Promise.resolve(W.getChanges()):Promise.resolve([])}_setIndentConfiguration(M,k){const F=d.StandaloneServices.get(u.IModelService).getCreationOptions(M.getLanguageId(),M.uri,M.isForSimpleWidget);if(k.tabSize==="auto"||k.insertSpaces==="auto"){let B=F.insertSpaces,U=F.tabSize;k.insertSpaces!=="auto"&&typeof k.insertSpaces<"u"&&(B=k.insertSpaces),k.tabSize!=="auto"&&typeof k.tabSize<"u"&&(U=k.tabSize),M.detectIndentation(B,U);return}const L={};typeof k.insertSpaces<"u"&&(L.insertSpaces=k.insertSpaces),typeof k.tabSize<"u"&&(L.tabSize=k.tabSize),typeof k.indentSize<"u"&&(k.indentSize==="tabSize"?L.indentSize=L.tabSize||F.tabSize:L.indentSize=k.indentSize),M.updateOptions(L)}};t.MainThreadEditorService=y,n.__decorate([(0,a.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorServiceImpl)],y.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(s.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],y.prototype,"decorationService",void 0),n.__decorate([(0,a.Autowired)(_.EditorCollectionService),n.__metadata("design:type",g.EditorCollectionServiceImpl)],y.prototype,"codeEditorService",void 0),n.__decorate([(0,a.Autowired)(v.StaticResourceService),n.__metadata("design:type",v.StaticResourceService)],y.prototype,"staticResourceService",void 0),t.MainThreadEditorService=y=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object,c.MainThreadExtensionDocumentData])],y);function b(O,M,k){return O.name+"."+(k?`${k}.`:"")+M.toString()}function A(O){return O.substr(0,O.indexOf("."))}function S(O){const M=O.getModel().getOptions();return{tabSize:M.tabSize,indentSize:M.indentSize,insertSpaces:M.insertSpaces,cursorStyle:O.getOption(h.editor.EditorOption.cursorStyle),lineNumbers:O.getOption(h.editor.EditorOption.lineNumbers).renderType}}function D(O){return O?O.type===s.EditorOpenType.code||O.type===s.EditorOpenType.diff:!1}function I(O){return O.currentOpenType&&D(O.currentOpenType)}function w(O){return O.index+1}function T(O,M){return!!(!O&&!M||O&&M&&O.uri.isEqual(M.uri))}function R(O,M){return!!(!O&&!M||O&&M&&O.type===M.type&&O.componentId===M.componentId)}function P(O){if(O===E.TextEditorCursorStyle.Line)return"line";if(O===E.TextEditorCursorStyle.Block)return"block";if(O===E.TextEditorCursorStyle.Underline)return"underline";if(O===E.TextEditorCursorStyle.LineThin)return"line-thin";if(O===E.TextEditorCursorStyle.BlockOutline)return"block-outline";if(O===E.TextEditorCursorStyle.UnderlineThin)return"underline-thin";throw new Error("cursorStyleToString: Unknown cursorStyle")}},22869:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEnv=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(19805),v=e(43718),m=e(83507),_=e(46147),s=e(51328),g=e(49731);let l=class{isSupportedLink(u){return p.HttpOpener.standardSupportedLinkSchemes.has(u.scheme)||u.scheme===this.appConfig.uriScheme}constructor(u,d){this.rpcProtocol=u,this.storage=d,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostEnv),this.eventDispose=this.loggerManger.onDidChangeLogLevel(E=>{this.proxy.$fireChangeLogLevel(E)}),this.setLogLevel(),this.setEnvValues()}async setEnvValues(){const{appName:u,uriScheme:d,appHost:E,appRoot:f,customVSCodeEngineVersion:c}=this.appConfig,y=await this.storage.$getValue(!0,v.firstSessionDateStorageKey);this.proxy.$setEnvValues({customVSCodeEngineVersion:c,appName:u,uriScheme:d,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 u=await this.loggerManger.getGlobalLogLevel();await this.proxy.$setLogLevel(u)}async $clipboardReadText(){try{return await this.clipboardService.readText()}catch{return""}}$clipboardWriteText(u){return new Promise(async d=>{try{await this.clipboardService.writeText(u)}catch{}d()})}async $openExternal(u){return this.isSupportedLink(v.URI.from(u))?await this.openerService.open(u.toString(!0)):!1}getWindowId(){return this.applicationService.windowId}async $asExternalUri(u){const{uriScheme:d}=this.appConfig,E=v.URI.from(u);if(E.scheme===d){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=l,n.__decorate([(0,r.Autowired)(m.ILoggerManagerClient),n.__metadata("design:type",Object)],l.prototype,"loggerManger",void 0),n.__decorate([(0,r.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],l.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(a.IClipboardService),n.__metadata("design:type",Object)],l.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(a.IExternalUriService),n.__metadata("design:type",Object)],l.prototype,"externalUriService",void 0),n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],l.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.IApplicationService),n.__metadata("design:type",Object)],l.prototype,"applicationService",void 0),t.MainThreadEnv=l=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object,g.MainThreadStorage])],l)},13335:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystemEvent=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(68969),v=e(43718),m=e(14951),_=e(52902),s=e(72665),g=e(26199),l=e(46147);let h=class extends v.Disposable{constructor(d){super(),this.rpcProtocol=d,this._proxy=this.rpcProtocol.getProxy(l.ExtHostAPIIdentifier.ExtHostFileSystemEvent),this._dispatchFileEventListener(),this._participateFileOperation(),this._initShowPreview()}_dispatchFileEventListener(){const d={created:[],changed:[],deleted:[]};this.addDispose(this.fileService.onFilesChanged(E=>{let f=!1;for(const c of E)switch(c.type){case m.FileChangeType.ADDED:d.created.push(v.Uri.parse(c.uri)),f=!0;break;case m.FileChangeType.UPDATED:d.changed.push(v.Uri.parse(c.uri)),f=!0;break;case m.FileChangeType.DELETED:d.deleted.push(v.Uri.parse(c.uri)),f=!0;break}f&&(this._proxy.$onFileEvent(d),d.created=[],d.changed=[],d.deleted=[])}))}_participateFileOperation(){this.addDispose(this.workspaceFileService.registerFileOperationParticipant({participate:this.fileOperationParticipant.bind(this)})),this.addDispose(this.workspaceFileService.onDidRunWorkspaceFileOperation(d=>this._proxy.$onDidRunFileOperation(d.operation,d.files)))}_initShowPreview(){this._showPreview=this.preferenceService.get("workbench.refactoringChanges.showPreviewStrategy"),this.addDispose(this.preferenceService.onPreferenceChanged(d=>{d.preferenceName==="workbench.refactoringChanges.showPreviewStrategy"&&(this._showPreview=d.newValue)}))}async fileOperationParticipant(...d){const[E,f,c,y,b]=d,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 I=this._showPreview;const w=D.edit.edits.some(R=>{var P;return(P=R.metadata)===null||P===void 0?void 0:P.needsConfirmation});if(I==="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 P=[(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:P});if(I="show",O===P[1])return}else{const P=[(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:P});if(O===P[1])return;I=O===P[0]?"show":"hide"}}this.logger.log("[onWill-handler] applying additional workspace edit from extensions",D.extensionNames);const T=D?.edit;T&&await this.bulkEditService.apply(_.ResourceEdit.convert(T),{showPreview:I==="show"})}getProgressLabel(d){switch(d){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)(m.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)(a.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(p.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:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystem=void 0;const r=e(85608),o=e(76003),a=e(8919),p=e(41869),v=e(43163),m=e(42933),_=e(46147),s=e(53043),g=e(34687);let l=n=class{constructor(d){this.rpcProtocol=d,this.disposable=new p.Disposable,this._fileProvider=new Map,this._proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostFileSystem);const E=this.rpcProtocol.getProxy(_.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(d=>d.dispose()),this._fileProvider.clear()}$registerFileSystemProvider(d,E,f){this.disposable.addDispose(this.schemeRegistry.registerFileSystemProvider({scheme:E})),this._fileProvider.set(d,new h(this._fileService,E,f,d,this._proxy))}$unregisterProvider(d){(0,p.dispose)(this._fileProvider.get(d)),this._fileProvider.delete(d)}$onFileSystemChange(d,E){const f=this._fileProvider.get(d);if(!f)throw new Error("Unknown file provider");f.$onFileSystemChange(E)}$stat(d){return this._fileService.getFileStat(p.URI.revive(d).toString()).then(E=>(0,s.toFileStat)(E)).catch(n._handleError)}$readdir(d){return this._fileService.getFileStat(p.URI.revive(d).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 p.URI(f.uri).displayName,n._asFileType(f)]):[]}).catch(n._handleError)}static _asFileType(d){let E=0;return d.type&&d.type===m.FileType.File?E+=m.FileType.File:d.isDirectory&&(E+=m.FileType.Directory),d.isSymbolicLink&&(E+=m.FileType.SymbolicLink),E}$readFile(d){return this._fileService.readFile(p.URI.revive(d).toString()).then(E=>E.content.buffer).catch(n._handleError)}async $writeFile(d,E){try{const f=p.URI.revive(d),c=await this._fileService.getFileStat(f.toString(),!1);c?await this._fileService.setContent(c,E):(await(0,v.ensureDir)(new p.URI(f).path.dir.toString(),{mkdir:y=>this.$mkdir(p.URI.file(y).codeUri),access:y=>this._fileService.access(p.URI.file(y).codeUri.toString())}),await this._fileService.createFile(f.toString(),{content:p.BinaryBuffer.wrap(E).toString()}))}catch(f){return n._handleError(f)}}$rename(d,E,f){return this._fileService.move(p.URI.revive(d).toString(),p.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$copy(d,E,f){return this._fileService.copy(p.URI.revive(d).toString(),p.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$mkdir(d){return this._fileService.createFolder(p.URI.revive(d).toString()).then(()=>{}).catch(n._handleError)}$delete(d,E){return this._fileService.delete(p.URI.revive(d).toString(),{moveToTrash:E.useTrash}).catch(n._handleError)}static _handleError(d){if(d instanceof m.FileOperationError)switch(d.fileOperationResult){case 1:d.name=g.FileSystemProviderErrorCode.FileNotFound;break;case 0:d.name=g.FileSystemProviderErrorCode.FileIsADirectory;break;case 6:d.name=g.FileSystemProviderErrorCode.NoPermissions;break;case 4:d.name=g.FileSystemProviderErrorCode.FileExists;break}throw d}};t.MainThreadFileSystem=l,r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],l.prototype,"_fileService",void 0),r.__decorate([(0,o.Autowired)(m.IBrowserFileSystemRegistry),r.__metadata("design:type",Object)],l.prototype,"schemeRegistry",void 0),t.MainThreadFileSystem=l=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object])],l);class h{get readonly(){return!!(this.capabilities&2048)}constructor(d,E,f,c,y){this._handle=c,this._proxy=y,this._onDidChange=new p.Emitter,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=p.Event.None,this.capabilities=f,this._registration=d.registerProvider(E,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(d,E){const f=Math.random();return this._proxy.$watch(this._handle,f,d,E),f}unwatch(d){this._proxy.$unwatch(this._handle,d)}$onFileSystemChange(d){this._onDidChange.fire(d.map(h._createFileChange))}static _createFileChange(d){return{uri:d.uri,type:d.type}}async stat(d){return await this.doGetStat(d)}async readFile(d){return await this._proxy.$readFile(this._handle,d)}writeFile(d,E,f){return this._proxy.$writeFile(this._handle,d,E,f)}delete(d,E){return this._proxy.$delete(this._handle,d,E)}createDirectory(d){return this._proxy.$mkdir(this._handle,d)}readDirectory(d){return this._proxy.$readdir(this._handle,d)}rename(d,E,f){return this._proxy.$rename(this._handle,d,E,f)}copy(d,E,f){return this._proxy.$copy(this._handle,d,E,f)}async doGetStat(d,E=1){var f;const c=await this._proxy.$stat(this._handle,d),y=(0,s.fromFileStat)(c,d);return y.isDirectory&&(y.children=await this.doGetChildren(d,E)),y.readonly=!!(((f=c.permissions)!==null&&f!==void 0?f:0)&g.FilePermission.Readonly)||!!(this.capabilities&2048),y}async doGetChildren(d,E){if(E<=0)return[];const f=await this.readDirectory(d);return await Promise.all(f.map(y=>new p.URI(d).resolve(y[0])).map(y=>this.doGetStat(y.codeUri,E-1)))}}},89626:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLanguages=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(16885),m=e(54414),_=e(57517),s=n.__importStar(e(20868)),g=e(55218),l=e(62660),h=e(28694),u=e(52902),d=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),I=e(43710),w=e(97673),{extname:T}=p.path;let R=class{_reviveCodeActionDto(O){return O&&O.forEach(M=>this.reviveWorkspaceEditDto(M.edit)),O}constructor(O){this.rpcProtocol=O,this.disposables=new Map,this.languageFeatureEnabled=new p.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 M=this.disposables.get(O);M&&(this.disposables.delete(O),M.dispose())}$getLanguages(){return this.textmateService.getLanguages().map(O=>O.id)}async $changeLanguage(O,M){const k=y.StandaloneServices.get(c.ILanguageService).getLanguageIdByLanguageName(M);if(!k||k!==M)return Promise.reject(new Error(`Unknown language id: ${M}`));const F=new p.URI(p.URI.revive(O)),L=await this.documentModelManager.createModelReference(F);try{L.instance.languageId=M}finally{L.dispose()}}isLanguageFeatureEnabled(O){if(O.uri.scheme===p.Schemes.inMemory)return!1;const M=O.uri.toString();return this.languageFeatureEnabled.has(M)||this.languageFeatureEnabled.set(M,O.getValueLength()<(this.preference.get("editor.languageFeatureEnabledMaxSize")||4*1024*1024*1024)),this.languageFeatureEnabled.get(M)}getUniqueLanguages(){const O=[],M=this.textmateService.getLanguages().map(k=>k.id);for(const k of M)O.indexOf(k)===-1&&O.push(k);return O}$registerHoverProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createHoverProvider(O,k);this.disposables.set(O,d.languageFeaturesService.hoverProvider.register(M,F))}createHoverProvider(O,M){return{provideHover:(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_HOVER);return this.proxy.$provideHoverWithDuration(O,k.uri,F,L).then(({result:U,_dur:W})=>(U&&B.timeEnd(T(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 M=O.split("~|");return Array.isArray(M)&&M.length>1?{label:M[0],description:M[1],detail:M[2]}:O}inflateSuggestDto(O,M){var k,F;if(!this.isDeflatedSuggestDto(M))return M;const L=this.inflateLabel(M[b.ISuggestDataDtoField.label]),B=M[b.ISuggestDataDtoField.range];return{label:L,kind:(k=M[b.ISuggestDataDtoField.kind])!==null&&k!==void 0?k:f.CompletionItemKind.Property,tags:M[b.ISuggestDataDtoField.kindModifier],detail:M[b.ISuggestDataDtoField.detail],documentation:M[b.ISuggestDataDtoField.documentation],sortText:M[b.ISuggestDataDtoField.sortText],filterText:M[b.ISuggestDataDtoField.filterText],preselect:M[b.ISuggestDataDtoField.preselect],insertText:(F=M[b.ISuggestDataDtoField.insertText])!==null&&F!==void 0?F:typeof L=="string"?L:L.label,range:Array.isArray(B)&&B.length===4?E.Range.lift({startLineNumber:B[0],startColumn:B[1],endLineNumber:B[2],endColumn:B[3]}):O,insertTextRules:M[b.ISuggestDataDtoField.insertTextRules],commitCharacters:M[b.ISuggestDataDtoField.commitCharacters],additionalTextEdits:M[b.ISuggestDataDtoField.additionalTextEdits],command:M[b.ISuggestDataDtoField.command],_id:M.x}}$registerCompletionSupport(O,M,k,F){this.disposables.set(O,u.monaco.languages.registerCompletionItemProvider((0,A.fromLanguageSelector)(M),{_debugDisplayName:`ext-${O}`,triggerCharacters:k,provideCompletionItems:async(L,B,U,W)=>{if(!this.isLanguageFeatureEnabled(L))return;const j=this.reporter.time(p.REPORT_NAME.PROVIDE_COMPLETION_ITEMS),Q=await this.proxy.$provideCompletionItems(O,L.uri,B,U,W);return Q?(Q[b.ISuggestResultDtoField.completions].length&&j.timeEnd(T(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,B)=>(this.reporter.point(p.REPORT_NAME.RESOLVE_COMPLETION_ITEM),this.proxy.$resolveCompletionItem(O,L._id,B).then(U=>{if(!U)return L;const W=this.inflateSuggestDto(L.range,U);return(0,I.mixin)(L,W,!0)})):void 0}))}$registerInlineCompletionsSupport(O,M,k,F,L){const B={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,u.monaco.languages.registerInlineCompletionsProvider((0,A.fromLanguageSelector)(M),B))}$registerInlineEditProvider(O,M,k,F){const L={displayName:F,provideInlineEdit:async(B,U,W)=>this.proxy.$provideInlineEdit(O,B.uri,U,W),freeInlineEdit:B=>{this.proxy.$freeInlineEdit(O,B.pid)}};this.disposables.set(O,u.monaco.languages.registerInlineEditProvider((0,A.fromLanguageSelector)(M),L))}matchLanguage(O,M){return Array.isArray(O)?O.some(k=>this.matchLanguage(k,M)):(0,D.isDocumentFilter)(O)?!O.language&&(O.pattern||O.scheme)?!0:O?.language===M:O===M}matchModel(O,M){return Array.isArray(O)?O.some(k=>this.matchModel(k,M)):(0,D.isDocumentFilter)(O)?!(O.language&&O.language!==M.languageId||O.scheme&&O.scheme!==M.uri.scheme||O.pattern&&!(0,b.testGlob)(O.pattern,M.uri.path)):O===M.languageId}$registerDefinitionProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDefinitionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDefinitionProvider(k,F))}$registerDeclarationProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=new p.DisposableCollection;for(const L of this.getUniqueLanguages())this.matchLanguage(k,L);this.disposables.set(O,F)}createDefinitionProvider(O,M){return{provideDefinition:async(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DEFINITION),{result:U,_dur:W}=await this.proxy.$provideDefinitionWithDuration(O,k.uri,F,L);if(U)if(B.timeEnd(T(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,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createTypeDefinitionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerTypeDefinitionProvider(k,F))}createTypeDefinitionProvider(O,M){return{provideTypeDefinition:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_TYPE_DEFINITION);return this.proxy.$provideTypeDefinition(O,k.uri,F,L).then(U=>{if(U)if(B.timeEnd(T(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,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createFoldingRangeProvider(O,F);if(typeof k=="number"){const B=new p.Emitter;this.disposables.set(k,B),L.onDidChange=B.event}this.disposables.set(O,u.monaco.languages.registerFoldingRangeProvider(F,L))}$emitFoldingRangeEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}createFoldingRangeProvider(O,M){return{provideFoldingRanges:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_FOLDING_RANGES);return this.proxy.$provideFoldingRange(O,k.uri,F,L).then(U=>(U&&B.timeEnd(T(k.uri.fsPath)),U))}}}$registerDocumentColorProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createColorProvider(O,k);this.disposables.set(O,u.monaco.languages.registerColorProvider(k,F))}createColorProvider(O,M){return{provideDocumentColors:(k,F)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_COLORS);return this.proxy.$provideDocumentColors(O,k.uri,F).then(B=>(L.timeEnd(T(k.uri.fsPath)),B.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 B=this.reporter.time(p.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&&B.timeEnd(T(k.uri.fsPath)),U))}}}$registerDocumentHighlightProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDocumentHighlightProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDocumentHighlightProvider(k,F))}createDocumentHighlightProvider(O,M){return{provideDocumentHighlights:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_HIGHLIGHTS);return this.proxy.$provideDocumentHighlights(O,k.uri,F,L).then(U=>{if(U&&Array.isArray(U)){B.timeEnd(T(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,M,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentFormattingEditProvider(O,M,F);this.disposables.set(O,u.monaco.languages.registerDocumentFormattingEditProvider(F,L))}createDocumentFormattingEditProvider(O,M,k){return{displayName:M.displayName,extensionId:M.id,provideDocumentFormattingEdits:async(F,L)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_FORMATTING_EDITS);return this.proxy.$provideDocumentFormattingEdits(O,F.uri,L).then(U=>{if(B.timeEnd(T(F.uri.fsPath)),!!U)return U})}}}$registerRangeFormattingProvider(O,M,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentRangeFormattingEditProvider(O,M,F);this.disposables.set(O,u.monaco.languages.registerDocumentRangeFormattingEditProvider(F,L))}createDocumentRangeFormattingEditProvider(O,M,k){return{displayName:M.displayName,extensionId:M.id,provideDocumentRangeFormattingEdits:async(F,L,B)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_RANGE_FORMATTING_EDITS);return this.proxy.$provideDocumentRangeFormattingEdits(O,F.uri,L,B).then(W=>{if(U.timeEnd(T(F.uri.fsPath)),!!W)return W})}}}$registerOnTypeFormattingProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createOnTypeFormattingProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerOnTypeFormattingEditProvider(F,L))}createOnTypeFormattingProvider(O,M,k){return{autoFormatTriggerCharacters:k,provideOnTypeFormattingEdits:async(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_ON_TYPE_FORMATTING_EDITS);return this.proxy.$provideOnTypeFormattingEditsWithDuration(O,F.uri,L,B,U).then(({result:j,_dur:Q})=>(j&&W.timeEnd(T(F.uri.fsPath),{extDuration:Q}),j))}}}$registerCodeLensSupport(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createCodeLensProvider(O,F);if(typeof k=="number"){const B=new p.Emitter;this.disposables.set(k,B),L.onDidChange=B.event}this.disposables.set(O,u.monaco.languages.registerCodeLensProvider(F,L))}createCodeLensProvider(O,M){return{provideCodeLenses:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_CODE_LENSES);return this.proxy.$provideCodeLenses(O,k.uri,F).then(B=>(B&&L.timeEnd(T(k.uri.fsPath)),{lenses:B?.lenses||[],dispose:()=>B?.cacheId&&this.proxy.$releaseCodeLens(O,B.cacheId)}))},resolveCodeLens:async(k,F,L)=>{if(this.isLanguageFeatureEnabled(k))return this.reporter.point(p.REPORT_NAME.RESOLVE_CODE_LENS),this.proxy.$resolveCodeLens(O,F,L).then(B=>B)}}}$emitCodeLensEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$clearDiagnostics(O){this.markerManager.clearMarkers(O)}$changeDiagnostics(O,M){for(const[k,F]of M)this.markerManager.updateMarkers(O,k,F)}$registerImplementationProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createImplementationProvider(O,k);this.disposables.set(O,u.monaco.languages.registerImplementationProvider(k,F))}$registerDocumentLinkProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createLinkProvider(O,k);this.disposables.set(O,u.monaco.languages.registerLinkProvider(F,L))}createImplementationProvider(O,M){return{provideImplementation:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_IMPLEMENTATION);return this.proxy.$provideImplementationWithDuration(O,k.uri,F).then(({result:U,_dur:W})=>{if(U)if(B.timeEnd(T(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,M,k,F,L){const B=(0,A.fromLanguageSelector)(M);if(!B)return;const U=this.createQuickFixProvider(O,B,k,F,L);this.disposables.set(O,d.languageFeaturesService.codeActionProvider.register(B,U))}createQuickFixProvider(O,M,k,F,L){const B={provideCodeActions:async(U,W,j,Q)=>{if(!this.isLanguageFeatureEnabled(U)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(U)))return;const G=this.reporter.time(p.REPORT_NAME.PROVIDE_CODE_ACTIONS),Z=await this.proxy.$provideCodeActions(O,U.uri,W,j,Q).then($=>(G.timeEnd(T(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&&(B.resolveCodeAction=async(U,W)=>{const j=await this.proxy.$resolveCodeAction(O,U.cacheId,W);return U.edit=this.reviveWorkspaceEditDto(j),U}),B}createLinkProvider(O,M){const k={provideLinks:(F,L)=>{if(!this.isLanguageFeatureEnabled(F))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_LINKS);return this.proxy.$provideDocumentLinks(O,F.uri,L).then(U=>U?(B.timeEnd(T(F.uri.fsPath)),{links:U.links.map(j=>this.reviveLink(j)),dispose:()=>{U.id&&this.proxy.$releaseDocumentLinks(O,U.id)}}):void 0)}};return M&&(k.resolveLink=(F,L)=>{const B=F;return B.cacheId?this.proxy.$resolveDocumentLink(O,B.cacheId,L).then(U=>{if(U)return this.reviveLink(U)}):F}),k}reviveLink(O){return O.url&&typeof O.url!="string"&&(O.url=p.URI.revive(O.url)),O}$setLanguageConfiguration(O,M,k){const F={comments:k.comments,brackets:k.brackets,wordPattern:(0,I.reviveRegExp)(k.wordPattern),indentationRules:(0,I.reviveIndentationRule)(k.indentationRules),onEnterRules:(0,I.reviveOnEnterRules)(k.onEnterRules),autoClosingPairs:k.autoClosingPairs};this.disposables.set(O,u.monaco.languages.setLanguageConfiguration(M,F))}$registerReferenceProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createReferenceProvider(O,k);this.disposables.set(O,u.monaco.languages.registerReferenceProvider(k,F))}createReferenceProvider(O,M){return{provideReferences:(k,F,L,B)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_REFERENCES);return this.proxy.$provideReferencesWithDuration(O,k.uri,F,L,B).then(({result:W,_dur:j})=>{if(W&&Array.isArray(W)){U.timeEnd(T(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 M=this.createWorkspaceSymbolProvider(O);this.disposables.set(O,this.languageService.registerWorkspaceSymbolProvider(M))}createWorkspaceSymbolProvider(O){return{provideWorkspaceSymbols:(M,k)=>this.proxy.$provideWorkspaceSymbols(O,M.query,k),resolveWorkspaceSymbol:(M,k)=>this.proxy.$resolveWorkspaceSymbol(O,M,k)}}$registerOutlineSupport(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDocumentSymbolProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDocumentSymbolProvider(k,F))}createDocumentSymbolProvider(O,M){return{provideDocumentSymbols:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_SYMBOLS);return this.proxy.$provideDocumentSymbols(O,k.uri,F).then(B=>(B&&L.timeEnd(T(k.uri.fsPath)),B))}}}$registerSignatureHelpProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createSignatureHelpProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerSignatureHelpProvider(F,L))}createSignatureHelpProvider(O,M,k){return{signatureHelpTriggerCharacters:k.triggerCharacters,signatureHelpRetriggerCharacters:k.retriggerCharacters,provideSignatureHelp:(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_SIGNATURE_HELP);return this.proxy.$provideSignatureHelp(O,F.uri,L,U,B).then(j=>{if(j)return W.timeEnd(T(F.uri.fsPath)),{value:j,dispose:()=>j.id&&this.proxy.$releaseSignatureHelp(O,j.id)}})}}}$registerRenameProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createRenameProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerRenameProvider(F,L))}createRenameProvider(O,M,k){return{provideRenameEdits:(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_RENAME_EDITS);return this.proxy.$provideRenameEdits(O,F.uri,L,B,U).then(j=>(j&&W.timeEnd(T(F.uri.fsPath)),this.reviveWorkspaceEditDto(j)))},resolveRenameLocation:k?(F,L,B)=>{if(this.isLanguageFeatureEnabled(F)&&this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return this.proxy.$resolveRenameLocation(O,F.uri,L,B).then(U=>U)}:void 0}}createNewSymbolNamesProvider(O,M){return{provideNewSymbolNames:(k,F,L,B)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_NEW_SYMBOL_NAMES);return this.proxy.$provideNewSymbolNames(O,k.uri,F,L,B).then(W=>(W&&U.timeEnd(T(k.uri.fsPath)),W))}}}$registerNewSymbolNamesProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createNewSymbolNamesProvider(O,k);this.disposables.set(O,u.monaco.languages.registerNewSymbolNameProvider(k,F))}reviveWorkspaceEditDto(O){if(O&&O.edits)for(const M of O.edits)typeof M.resource=="object"?M.resource=s.Uri.revive(M.resource):(M.newResource=s.Uri.revive(M.newResource),M.oldResource=s.Uri.revive(M.oldResource));return O}$registerSelectionRangeProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createSelectionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerSelectionRangeProvider(k,F))}createSelectionProvider(O,M){return{provideSelectionRanges:(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_SELECTION_RANGES);return this.proxy.$provideSelectionRanges(O,k.uri,F,L).then(U=>(B.timeEnd(T(k.uri.fsPath)),U))}}}$registerCallHierarchyProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createCallHierarchyProvider(O,k);this.callHierarchyService.registerCallHierarchyProvider(M,F)}reviveCallHierarchyItemDto(O){return O&&(O.uri=p.URI.revive(O.uri)),O}createCallHierarchyProvider(O,M){return{prepareCallHierarchy:async(k,F,L)=>{const B=await this.proxy.$prepareCallHierarchy(O,k.uri,F,L);if(B)return{dispose:()=>{for(const U of B)this.proxy.$releaseCallHierarchy(O,U._sessionId)},roots:B.map(this.reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyOutgoingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(B=>{B.to=this.reviveCallHierarchyItemDto(B.to)}),L)},provideIncomingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyIncomingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(B=>{B.from=this.reviveCallHierarchyItemDto(B.from)}),L)}}}$registerTypeHierarchyProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createTypeHierarchyProvider(O,k);this.typeHierarchyService.registerTypeHierarchyProvider(M,F)}createTypeHierarchyProvider(O,M){return{prepareTypeHierarchy:async(k,F,L)=>{const B=await this.proxy.$prepareTypeHierarchy(O,k.uri,F,L);if(B)return{dispose:()=>{for(const U of B)this.proxy.$releaseTypeHierarchy(O,U._sessionId)},roots:B.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=p.URI.revive(O.uri)),O}$registerDocumentSemanticTokensProvider(O,M,k){const F=new w.DocumentSemanticTokensProvider(this.proxy,O,k);this.disposables.set(O,d.languageFeaturesService.documentSemanticTokensProvider.register((0,A.fromLanguageSelector)(M),F))}$registerDocumentRangeSemanticTokensProvider(O,M,k){const F=new w.DocumentRangeSemanticTokensProviderImpl(this.proxy,O,k);this.disposables.set(O,d.languageFeaturesService.documentRangeSemanticTokensProvider.register((0,A.fromLanguageSelector)(M),F))}$registerEvaluatableExpressionProvider(O,M){const k={provideEvaluatableExpression:(F,L,B)=>this.proxy.$provideEvaluatableExpression(O,F.uri,L,B)};this.disposables.set(O,this.evaluatableExpressionService.registerEvaluatableExpressionProvider(M,k))}$registerInlineValuesProvider(O,M,k){const F={provideInlineValues:(L,B,U,W)=>this.proxy.$provideInlineValues(O,L.uri,B,U,W)};if(typeof k=="number"){const L=new p.Emitter;this.disposables.set(k,L),F.onDidChangeInlineValues=L.event}this.disposables.set(O,d.languageFeaturesService.inlineValuesProvider.register(M,F))}$emitInlineValuesEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$registerLinkedEditingRangeProvider(O,M){const k=(0,A.fromLanguageSelector)(M);d.languageFeaturesService.linkedEditingRangeProvider.register(k,{provideLinkedEditingRanges:async(F,L,B)=>{const U=await this.proxy.$provideLinkedEditingRanges(O,F.uri,L,B);if(U)return{ranges:U.ranges,wordPattern:U.wordPattern?(0,I.reviveRegExp)(U.wordPattern):void 0}}})}$registerInlayHintsProvider(O,M,k,F){const L={provideInlayHints:async(B,U,W)=>{const j=await this.proxy.$provideInlayHints(O,B.uri,U,W);if(j)return{hints:(0,p.revive)(j?.hints),dispose:()=>{j.cacheId&&this.proxy.$releaseInlayHints(O,j.cacheId)}}}};if(k&&(L.resolveInlayHint=async(B,U)=>{const W=B;if(!W.cacheId)return B;const j=await this.proxy.$resolveInlayHint(O,W.cacheId,U);if(U.isCancellationRequested)throw new S.CancellationError;return j?{...B,tooltip:j.tooltip,label:(0,p.revive)(j.label)}:B}),typeof F=="number"){const B=new p.Emitter;this.disposables.set(F,B),L.onDidChangeInlayHints=B.event}this.disposables.set(O,d.languageFeaturesService.inlayHintsProvider.register(M,L))}$emitInlayHintsEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$setLanguageStatus(O,M){var k;(k=this._status.get(O))===null||k===void 0||k.dispose(),this._status.set(O,this.languageStatusService.addStatus(M))}$removeLanguageStatus(O){var M;(M=this._status.get(O))===null||M===void 0||M.dispose()}};t.MainThreadLanguages=R,n.__decorate([(0,r.Autowired)(p.MarkerManager),n.__metadata("design:type",p.MarkerManager)],R.prototype,"markerManager",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],R.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(a.IReporterService),n.__metadata("design:type",Object)],R.prototype,"reporter",void 0),n.__decorate([(0,r.Autowired)(m.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)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],R.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(_.ILanguageStatusService),n.__metadata("design:type",Object)],R.prototype,"languageStatusService",void 0),n.__decorate([(0,r.Autowired)(l.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLocalization=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(14951),v=e(99220),m=e(46147),_=e(51328);let s=class{constructor(l){this.rpcProtocol=l,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostLocalization),this.currentLanguage=this.preferenceService.get("general.language","en").toLocaleLowerCase(),this.proxy.$setCurrentLanguage(this.currentLanguage)}async $fetchBuiltInBundleUri(l,h){try{const u=await this.extensionNodeClient.getLanguagePack(h||this.currentLanguage);return u&&u.translations[l]?_.Uri.file(u.translations[l]):void 0}catch{return}}async $fetchBundleContents(l){return(await this.fileService.readFile(_.Uri.revive(l).fsPath.toString())).content.toString()}};t.MainThreadLocalization=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(a.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:(x,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),a=e(71742);let p=class{$getLevel(){return this.logger.getLevel()}$setLevel(_){return this.logger.setLevel(_)}async $verbose(..._){return this.logger.verbose(..._)}async $debug(..._){return this.logger.debug(..._)}async $log(..._){return this.logger.log(..._)}async $warn(..._){return this.logger.warn(..._)}async $error(..._){return this.logger.error(..._)}async $critical(..._){return this.logger.critical(..._)}$dispose(){return this.logger.dispose()}};t.MainThreadExtensionLog=p,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.MainThreadExtensionLog=p=n.__decorate([(0,r.Injectable)()],p);function v(m,_){m.set(a.MainThreadExtensionLogIdentifier,_.get(p))}},48721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadMessage=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(72665),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostMessage)}dispose(){}async $showMessage(_,s,g,l,h){const u=g.modal?await this.dialogService.open({message:s,type:_,buttons:l,options:g}):await this.messageService.open({message:s,type:_,buttons:l,closable:!0,from:h});return u?l.indexOf(u):void 0}};t.MainThreadMessage=v,n.__decorate([(0,r.Autowired)(a.IDialogService),n.__metadata("design:type",Object)],v.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionNotebook=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(54414),v=e(46147);let m=class extends a.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=m,n.__decorate([(0,r.Autowired)(p.INotebookService),n.__metadata("design:type",Object)],m.prototype,"notebookService",void 0),t.MainThreadExtensionNotebook=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},39261:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadOutput=void 0;const n=e(85608),r=e(76003),o=e(63067),a=e(83145);let p=class{constructor(){this.channels=new Map}dispose(){this.channels.forEach(m=>{this.outputService.deleteChannel(m.name)}),this.channels.clear()}$replace(m,_){const s=this.getChannel(m);return s&&(s.clear(),s.append(_)),Promise.resolve()}$append(m,_){const s=this.getChannel(m);return s&&s.append(_),Promise.resolve()}$appendLine(m,_){const s=this.getChannel(m);return s&&s.appendLine(_),Promise.resolve()}$clear(m){const _=this.getChannel(m);return _&&_.clear(),Promise.resolve()}$dispose(m){return this.outputService.deleteChannel(m),this.channels.has(m)&&this.channels.delete(m),Promise.resolve()}async $reveal(m,_){const s=this.getChannel(m);s&&(s.setVisibility(!0),this.outputService.updateSelectedChannel(s))}$close(m){const _=this.getChannel(m);return _&&_.setVisibility(!1),Promise.resolve()}getChannel(m){let _;return this.channels.has(m)?_=this.channels.get(m):(_=this.outputService.getChannel(m),this.channels.set(m,_)),_}async $setLanguageId(m,_){const s=this.getChannel(m);s&&await s.setLanguageId(_)}};t.MainThreadOutput=p,n.__decorate([(0,r.Autowired)(a.OutputService),n.__metadata("design:type",a.OutputService)],p.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(o.IMainLayoutService),n.__metadata("design:type",Object)],p.prototype,"layoutService",void 0),t.MainThreadOutput=p=n.__decorate([(0,r.Injectable)({multiple:!0})],p)},87781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadPreference=void 0,t.getPreferences=m;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(51500),v=e(46147);function m(s,g){const l=g.map(h=>h.uri.toString());return a.PreferenceScope.getScopes().reduce((h,u)=>{h[u]={};const d=s(u);if(u===a.PreferenceScope.Folder)for(const E of l){const f=d.getPreferences(E);h[u][E]=f}else{h[u]=d.getPreferences();const E=d.getLanguagePreferences();E&&Object.keys(E).forEach(f=>{h[u][`[${f}]`]=E[f]})}return h},{})}let _=class{constructor(g){this.rpcProtocol=g,this.toDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostPreference),this.toDispose.push(this.preferenceService.onPreferencesChanged(l=>{const h=this.workspaceService.tryGetRoots(),u=m(this.preferenceProviderProvider,h),d=[];for(const E of Object.keys(l)){const{newValue:f}=l[E];d.push({preferenceName:E,newValue:f})}this.proxy.$acceptConfigurationChanged(u,d)})),this.initializeConfiguration(),this.toDispose.push(this.preferenceSchemaProvider.onDidPreferenceSchemaChanged(()=>{this.initializeConfiguration()}))}dispose(){this.toDispose.dispose()}async initializeConfiguration(){const g=this.workspaceService.tryGetRoots(),l=m(this.preferenceProviderProvider,g);this.proxy.$initializeConfiguration(l)}async $updateConfigurationOption(g,l,h,u){const d=this.parseConfigurationTarget(g);await this.preferenceService.set(l,h,d,u)}async $removeConfigurationOption(g,l,h){const u=this.parseConfigurationTarget(g);await this.preferenceService.set(l,void 0,u,h)}parseConfigurationTarget(g){if(typeof g=="boolean")return g?a.PreferenceScope.User:a.PreferenceScope.Workspace;switch(g){case v.ConfigurationTarget.Global:return a.PreferenceScope.User;case v.ConfigurationTarget.Workspace:return a.PreferenceScope.Workspace;case v.ConfigurationTarget.WorkspaceFolder:return a.PreferenceScope.Folder;default:return}}};t.MainThreadPreference=_,n.__decorate([(0,r.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceProviderProvider),n.__metadata("design:type",Function)],_.prototype,"preferenceProviderProvider",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceSchemaProvider),n.__metadata("design:type",a.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),t.MainThreadPreference=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],_)},79813:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadQuickOpen=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(8919),p=e(41869),v=e(74404),m=e(97821),_=e(78245),s=e(50426),g=e(44854),l=e(46147);let h=class extends p.Disposable{constructor(d){super(),this.rpcProtocol=d,this.createdInputBox=new Map,this.proxy=this.rpcProtocol.getProxy(l.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(d,E,f){return this.quickPickService.show(E,{...f,onSelect:(c,y)=>{this.proxy.$onItemSelected(E[y].value)},onChangeValue:c=>{this.proxy.$onDidChangeValue(d,c)}})}$hideQuickPick(){this.quickPickService.hide()}severityToValidateType(d){switch(d){case l.Severity.Info:return o.VALIDATE_TYPE.INFO;case l.Severity.Warning:return o.VALIDATE_TYPE.WARNING;case l.Severity.Error:return o.VALIDATE_TYPE.ERROR;case l.Severity.Ignore:return o.VALIDATE_TYPE.IGNORE;default:return o.VALIDATE_TYPE.ERROR}}$showQuickInput(d,E){return E&&(d.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(d)}$createOrUpdateInputBox(d,E){const f={...E,validationType:this.severityToValidateType(E?.severity)};if(this.createdInputBox.has(d)){const c=this.createdInputBox.get(d);c?.updateOptions(f)}else{const c=this.injector.get(g.InputBoxImpl,[f]);c.open(),c.onDidChangeValue(y=>{this.proxy.$onCreatedInputBoxDidChangeValue(d,y)}),c.onDidAccept(()=>{this.proxy.$onCreatedInputBoxDidAccept(d)}),c.onDidHide(()=>{this.proxy.$onCreatedInputBoxDidHide(d)}),c.onDidTriggerButton(y=>{this.proxy.$onCreatedInputBoxDidTriggerButton(d,y)}),this.createdInputBox.set(d,c)}}$updateQuickPick(d){this.quickPickService.updateOptions(d)}$hideInputBox(d){if(this.createdInputBox.has(d)){const E=this.createdInputBox.get(d);E?.hide()}}$disposeInputBox(d){if(this.createdInputBox.has(d)){const E=this.createdInputBox.get(d);E?.dispose(),this.createdInputBox.delete(d)}}$hideQuickInput(){this.quickInputService.hide()}};t.MainThreadQuickOpen=h,n.__decorate([(0,r.Autowired)(m.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)(_.QuickOpenItemService),n.__metadata("design:type",_.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)(a.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],h)},33111:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSCM=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(64964),m=e(46147);class _{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 p.Emitter,this.onDidSplice=this._onDidSplice.event,this._onDidChange=new p.Emitter,this.onDidChange=this._onDidChange.event}toJSON(){return{$mid:4,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(f,c,y){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,I,w){this.proxy=f,this.sourceControlHandle=c,this.groupHandle=y,this.handle=b,this.sourceUri=A,this.resourceGroup=S,this.decorations=D,this.contextValue=I,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(p.Uri.isUri(E.icon))return p.Uri.revive(E.icon);{const f=E.icon;return{light:p.Uri.revive(f.light),dark:p.Uri.revive(f.dark)}}}else return}class l{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 p.Emitter,this.onDidChangeActionButton=this._onDidChangeActionButton.event,this._onDidChangeCurrentHistoryItemGroup=new p.Emitter,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupBase(f){return this.proxy.$resolveHistoryItemGroupBase(this.handle,f,p.CancellationToken.None)}async resolveHistoryItemGroupCommonAncestor(f,c){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,f,c,p.CancellationToken.None)}async provideHistoryItems(f,c){const y=await this.proxy.$provideHistoryItems(this.handle,f,c,p.CancellationToken.None);return y?.map(b=>({...b,icon:g(b)}))}async provideHistoryItemChanges(f){const c=await this.proxy.$provideHistoryItemChanges(this.handle,f,p.CancellationToken.None);return c?.map(y=>({uri:p.Uri.revive(y.uri),originalUri:y.originalUri&&p.Uri.revive(y.originalUri),modifiedUri:y.modifiedUri&&p.Uri.revive(y.modifiedUri),renameUri:y.renameUri&&p.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 p.Sequence,this._groupsByHandle=Object.create(null),this._onDidChangeResources=new p.Emitter,this.onDidChangeResources=this._onDidChangeResources.event,this.features={},this._onDidChangeCommitTemplate=new p.Emitter,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new p.Emitter,this._onDidChangeHistoryProvider=new p.Emitter,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new p.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 l(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 _(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 I=D.map(w=>{const[T,R,P,O,M,k,F,L]=w,B=P[0],U=P[1]||B,W={icon:B?p.Uri.parse(B):void 0,iconDark:U?p.Uri.parse(U):void 0,tooltip:O,strikeThrough:M,faded:k};return new s(this.proxy,this.handle,c,T,p.Uri.revive(R),b,W,F||void 0,L)});b.splice(A,S,I)}}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,p.CancellationToken.None);return c&&p.Uri.revive(c)}toJSON(){return{$mid:5,handle:this.handle}}dispose(){}}h.ID_HANDLE=0,n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0);let u=class extends p.Disposable{constructor(f){super(),this.rpcProtocol=f,this._repositories=new Map,this._inputDisposables=new Map,this._proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostSCM),p.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&&p.Uri.revive(b)),S=this.scmService.registerSCMProvider(A);this._repositories.set(f,S);const D=S.input.onDidChange(I=>this._proxy.$onInputBoxValueChange(f,I));this._inputDisposables.set(f,D),this.addDispose(p.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(p.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:d(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=u,n.__decorate([(0,r.Autowired)(v.SCMService),n.__metadata("design:type",v.SCMService)],u.prototype,"scmService",void 0),t.MainThreadSCM=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],u);function d(E){if(E.icon){if(p.Uri.isUri(E.icon))return p.Uri.revive(E.icon);{const f=E.icon;return{light:p.Uri.revive(f.light),dark:p.Uri.revive(f.dark)}}}else return}},62876:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSecret=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(46147);let m=class extends a.Disposable{constructor(s){super(),this._proxy=s.getProxy(v.ExtHostAPIIdentifier.ExtHostSecret),this.addDispose(this.credentialsService.onDidChangePassword(g=>{const l=g.service.substring(this.appConfig.uriScheme.length);this._proxy.$onDidChangePassword({extensionId:l,key:g.account})}))}getFullKey(s){return`${this.appConfig.uriScheme}${s}`}async $getPassword(s,g){const l=this.getFullKey(s),h=await this.credentialsService.getPassword(l,g),u=h&&await this.cryptoService.decrypt(h);if(u)try{const d=JSON.parse(u);if(d.extensionId===s)return d.content}catch{throw new Error("Cannot get password")}}async $setPassword(s,g,l){const h=this.getFullKey(s),u=JSON.stringify({extensionId:s,content:l}),d=await this.cryptoService.encrypt(u);return this.credentialsService.setPassword(h,g,d)}async $deletePassword(s,g){try{const l=this.getFullKey(s);await this.credentialsService.deletePassword(l,g)}catch{throw new Error("Cannot delete password")}}};t.MainThreadSecret=m,n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],m.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(a.ICredentialsService),n.__metadata("design:type",Object)],m.prototype,"credentialsService",void 0),n.__decorate([(0,r.Autowired)(p.ICryptoService),n.__metadata("design:type",Object)],m.prototype,"cryptoService",void 0),t.MainThreadSecret=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},93633:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStatusBar=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(71298),m=e(46147),_=n.__importStar(e(51328));let s=class{constructor(l){this.rpcProtocol=l,this.disposable=new a.Disposable,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostStatusBar)}dispose(){this.disposable.dispose()}$setStatusBarMessage(l){this.disposable.addDispose(this.statusBar.addElement("ext_default_statusbar_text",{text:l,alignment:p.StatusBarAlignment.LEFT}))}$dispose(l){l?this.statusBar.removeElement(l):this.statusBar.removeElement("ext_default_statusbar_text")}$createStatusBarItem(l,h,u,d){this.disposable.addDispose(this.statusBar.addElement(l,{id:h,alignment:u,priority:d}))}async $setMessage(l,h,u,d,E,f,c,y,b,A,S,D){const I=A?.label||(0,v.getCodiconAriaLabel)(d),w={id:h,name:u,text:d||"",priority:E,alignment:f===_.StatusBarAlignment.Left?p.StatusBarAlignment.LEFT:p.StatusBarAlignment.RIGHT,color:c,backgroundColor:y,tooltip:b,command:S,arguments:D,role:A?.role,ariaLabel:I};this.disposable.addDispose(this.statusBar.addElement(l,w))}};t.MainThreadStatusBar=s,n.__decorate([(0,r.Autowired)(a.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(p.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStorage=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(50492),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostStorage),this.init()}dispose(){}async init(){await this.extensionStorageService.whenReady,this.proxy.$acceptStoragePath(this.extensionStorageService.extensionStoragePath)}$setValue(_,s,g){try{this.extensionStorageService.set(s,g,_)}catch(l){return Promise.reject(l)}return Promise.resolve(void 0)}$getValue(_,s){try{return Promise.resolve(this.extensionStorageService.get(s,_))}catch(g){return Promise.reject(g)}}};t.MainThreadStorage=v,n.__decorate([(0,r.Autowired)(a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTasks=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(93950),v=e(1041),m=e(51500),_=e(46147),s=e(54741);var g;(function(R){function P(O){const M=O;return M&&(0,a.isString)(M.id)&&!!M.workspaceFolder}R.is=P})(g||(g={}));var l;(function(R){function P(O){return{id:O.id,task:w.from(O.task)}}R.from=P})(l||(l={}));var h;(function(R){function P(O,M){return{id:O.id,processId:M}}R.from=P})(h||(h={}));var u;(function(R){function P(O,M){return{id:O.id,exitCode:M}}R.from=P})(u||(u={}));var d;(function(R){function P(M){const k=Object.assign(Object.create(null),M);return delete k._key,k}R.from=P;function O(M,k,F){let L=F.createTaskIdentifier(M,console);return L===void 0&&k&&(L={_key:(0,a.uuid)(),type:"$executeOnly"}),L}R.to=O})(d||(d={}));var E;(function(R){function P(M){if(M!=null)return Object.assign(Object.create(null),M)}R.from=P;function O(M){return M==null?v.PresentationOptions.defaults:Object.assign(Object.create(null),v.PresentationOptions.defaults,M)}R.to=O})(E||(E={}));var f;(function(R){function P(M){if(M!=null)return Object.assign(Object.create(null),M)}R.from=P;function O(M){return M==null?v.RunOptions.defaults:Object.assign(Object.create(null),v.RunOptions.defaults,M)}R.to=O})(f||(f={}));var c;(function(R){function P(M){if(M!=null)return{cwd:M.cwd,env:M.env}}R.from=P;function O(M){return M==null?v.CommandOptions.defaults:{cwd:M.cwd||v.CommandOptions.defaults.cwd,env:M.env}}R.to=O})(c||(c={}));var y;(function(R){function P(k){const F=k;return F&&!!F.process}R.is=P;function O(k){const F=(0,a.isString)(k.name)?k.name:k.name.value,L=k.args?k.args.map(U=>(0,a.isString)(U)?U:U.value):[],B={process:F,args:L};return k.options&&(B.options=c.from(k.options)),B}R.from=O;function M(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=M})(y||(y={}));var b;(function(R){function P(M){if(M==null)return;const k={cwd:M.cwd||v.CommandOptions.defaults.cwd,env:M.env};return M.shell&&(k.executable=M.shell.executable,k.shellArgs=M.shell.args,k.shellQuoting=M.shell.quoting),k}R.from=P;function O(M){if(M==null)return;const k={cwd:M.cwd,env:M.env};return M.executable&&(k.shell={executable:M.executable},M.shellArgs&&(k.shell.args=M.shellArgs),M.shellQuoting&&(k.shell.quoting=M.shellQuoting)),k}R.to=O})(b||(b={}));var A;(function(R){function P(k){const F=k;return F&&(!!F.commandLine||!!F.command)}R.is=P;function O(k){const F={};return k.name&&(0,a.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 M(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=M})(A||(A={}));var S;(function(R){function P(k){const F=k;return F&&F.customExecution==="customExecution"}R.is=P;function O(){return{customExecution:"customExecution"}}R.from=O;function M(){return{runtime:v.RuntimeType.CustomExecution,presentation:void 0}}R.to=M})(S||(S={}));var D;(function(R){function P(k){const F=k;return F&&F.customExecution==="customExecution2"}R.is=P;function O(){return{customExecution:"customExecution2"}}R.from=O;function M(){return{runtime:v.RuntimeType.CustomExecution2,presentation:void 0}}R.to=M})(D||(D={}));var I;(function(R){function P(M){const k={label:M.label};return M.kind===v.TaskSourceKind.Extension?(k.extensionId=M.extension,M.workspaceFolder?k.scope=M.workspaceFolder.uri:k.scope=M.scope):M.kind===v.TaskSourceKind.Workspace&&(k.extensionId="$core",k.scope=M.config.workspaceFolder.uri),k}R.from=P;function O(M,k){let F,L;const B=k.tryGetRoots().map(W=>a.Uri.parse(W.uri));return M.scope===void 0||typeof M.scope=="number"&&M.scope!==1?k.tryGetRoots().map(W=>a.Uri.file(W.uri)).length===0?(F=1,L=void 0):(F=3,L={name:"workspace",uri:B[0],index:0}):typeof M.scope=="number"?F=M.scope:(F=3,L=(0,a.withNullAsUndefined)({uri:k.tryGetRoots().map(W=>a.Uri.parse(W.uri))[0],name:k.getWorkspaceName(k.tryGetRoots().map(W=>a.URI.file(W.uri))[0]),index:0})),{kind:v.TaskSourceKind.Extension,label:M.label,extension:M.extensionId,scope:F,workspaceFolder:L}}R.to=O})(I||(I={}));var w;(function(R){function P(M){if(M==null||!v.CustomTask.is(M)&&!v.ContributedTask.is(M)&&!v.ConfiguringTask.is(M))return;const k={_id:M._id,name:M.configurationProperties.name,definition:d.from(M.getDefinition()),source:I.from(M._source),execution:void 0,presentationOptions:!v.ConfiguringTask.is(M)&&M.command?E.from(M.command.presentation):void 0,isBackground:M.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:v.ContributedTask.is(M)?M.hasDefinedMatchers:!1,runOptions:f.from(M.runOptions)};if(M.configurationProperties.group&&(k.group=M.configurationProperties.group),!v.ConfiguringTask.is(M)&&M.command&&(M.command.runtime===v.RuntimeType.Process?k.execution=y.from(M.command):M.command.runtime===v.RuntimeType.Shell&&(k.execution=A.from(M.command))),M.configurationProperties.problemMatchers)for(const F of M.configurationProperties.problemMatchers)(0,a.isString)(F)&&k.problemMatchers.push(F);return k}R.from=P;function O(M,k,F,L){if(!M||typeof M.name!="string")return;let B;if(M.execution&&(A.is(M.execution)?B=A.to(M.execution):y.is(M.execution)?B=y.to(M.execution):S.is(M.execution)&&(B=S.to())),!B)return;B.presentation=E.to(M.presentationOptions);const U=I.to(M.source,k),W=(0,a.formatLocalize)("task.label",U.label,M.name),j=d.to(M.definition,F,L),Q=`${M.source.extensionId}.${j._key}`;return new v.ContributedTask(Q,U,W,j.type,j,B,M.hasDefinedMatchers,f.to(M.runOptions),{name:M.name,identifier:W,group:M.group,isBackground:!!M.isBackground,problemMatchers:M.problemMatchers.slice()})}R.to=O})(w||(w={}));let T=class extends a.Disposable{constructor(P){super(),this.rpcProtocol=P,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostTasks),this.providers=new Map,this.context={createTaskIdentifier:(O,M)=>this.taskDefinitionRegistry.createTaskIdentifier(O,M)},this.addDispose(this.taskService.onDidStateChange(O=>{const M=O.__task;O.kind==="start"?(this.logger.verbose(`task ${M._label||M._id} start`,O.terminalId),this.proxy.$onDidStartTask(l.from(M.getTaskExecution()),O.terminalId)):O.kind==="processStarted"?(this.logger.verbose(`task ${M._label||M._id} process start`,O.processId),this.proxy.$onDidStartTaskProcess(h.from(M.getTaskExecution(),O.processId))):O.kind==="processEnded"?(this.logger.verbose(`task ${M._label||M._id} process end`,O.exitCode),this.proxy.$onDidEndTaskProcess(u.from(M.getTaskExecution(),O.exitCode))):O.kind==="end"&&(this.logger.verbose(`task ${M._label||M._id} end`),this.proxy.$onDidEndTask(l.from(M.getTaskExecution())))}))}dispose(){super.dispose(),this.providers.forEach(P=>P.disposable.dispose()),this.providers.clear()}$registerTaskProvider(P,O){this.logger.verbose(`register task provider ${O}, handler ${P}`);const M={provideTasks:F=>(this.logger.verbose(`${O} provideTask`),Promise.resolve(this.proxy.$provideTask(P,F)).then(L=>{const B=[];for(const U of L.tasks){const W=w.to(U,this.workspaceService,!0,this.context);W?B.push(W):this.logger.error(`Task System: can not convert task: ${JSON.stringify(U.definition,void 0,0)}. Task will be dropped`)}return{tasks:B,extension:L.extension,type:O}})),resolveTask:F=>(this.logger.verbose(`${O} resolveTask`),Promise.resolve(this.proxy.$resolveTask(P,F)).then(L=>{if(L)return w.to(L,this.workspaceService,!0,this.context)}))},k=this.taskService.registerTaskProvider(M,O);return this.providers.set(P,{disposable:k,provider:M}),Promise.resolve()}$unregisterTaskProvider(P){throw new Error("Method not implemented.")}$fetchTasks(P){return this.taskService.tasks(s.TaskFilterDTO.to(P)).then(O=>{const M=[];for(const k of O){const F=w.from(k);F&&M.push(F)}return M})}$executeTask(P){return new Promise((O,M)=>{if(g.is(P)){const k=this.workspaceService.getWorkspaceRootUri(a.URI.from(P.workspaceFolder));k?this.taskService.getTask(k.codeUri,P.id,!0).then(F=>{this.taskService.run(F).then(()=>{});const L={id:P.id,task:w.from(F)};O(L)},F=>{M(new Error("Task not found"))}):M(new Error("No workspace folder"))}else{const k=w.to(P,this.workspaceService,!0,this.context);this.taskService.run(k).then(()=>{});const F={id:k._id,task:w.from(k)};O(F)}})}$createTaskId(P){return new Promise((O,M)=>{const k=w.to(P,this.workspaceService,!0,this.context);k?O(k._id):M(new Error("Task could not be created from DTO"))})}async $terminateTask(P){await this.taskService.terminateTask(P)}};t.MainThreadTasks=T,n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],T.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(p.ITaskService),n.__metadata("design:type",Object)],T.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],T.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(a.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],T.prototype,"taskDefinitionRegistry",void 0),t.MainThreadTasks=T=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],T)},69696:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTerminal=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(6487),v=e(94620),m=e(85504),_=e(46147),s=e(71354);let g=class{constructor(u){this.rpcProtocol=u,this.shortId2LongIdMap=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this.disposable=new a.Disposable,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostTerminal),this.initData(),this.bindEvent()}dispose(){this.disposable.dispose()}bindEvent(){this.disposable.addDispose(this.terminalApi.onDidChangeActiveTerminal(u=>{this.proxy.$onDidChangeActiveTerminal(u)})),this.disposable.addDispose(this.terminalApi.onDidCloseTerminal(u=>{this.proxy.$onDidCloseTerminal(u)})),this.disposable.addDispose(this.terminalApi.onDidTerminalTitleChange(u=>{this.proxy.$onDidTerminalTitleChange(u.id,u.name)})),this.disposable.addDispose(this.terminalApi.onDidOpenTerminal(u=>{const d=this.controller.clients.get(u.id);d&&d.addDispose(d.xterm.raw.onData(()=>{this.proxy.$acceptTerminalInteraction(u.id)})),this.proxy.$onDidOpenTerminal(u)})),this.disposable.addDispose(this.controller.onInstanceRequestStartExtensionTerminal(u=>this._onRequestStartExtensionTerminal(u))),this.disposable.addDispose(this.profileService.onDidChangeAvailableProfiles(()=>{this._updateDefaultProfile()})),this.disposable.addDispose(this.profileService.onTerminalProfileResolved(async u=>{await this.activationEventService.fireEvent(`onTerminalProfile:${u}`)})),this.disposable.addDispose(this.profileService.onDidChangeDefaultShell(u=>{this.proxy.$setShell(u)}))}initData(){const u=this.terminalApi.terminals,d=[];u.forEach(E=>{d.push({id:E.id,name:E.name,isActive:E.isActive})}),this.proxy.$setTerminals(d),this._updateDefaultProfile()}transform(u,d){const E=this.shortId2LongIdMap.get(u);return d(E||u)}$sendText(u,d,E){return this.transform(u,f=>(this.proxy.$acceptTerminalInteraction(f),this.terminalApi.sendText(f,d,E)))}$show(u,d){return this.transform(u,E=>this.terminalApi.showTerm(E,d))}$hide(u){return this.transform(u,d=>this.terminalApi.hideTerm(d))}$dispose(u){return this.transform(u,d=>this.terminalApi.removeTerm(d))}$getProcessId(u){return this.transform(u,d=>this.terminalApi.getProcessId(d))}async $createTerminal(u,d){await this.controller.ready.promise;const E=await this.terminalApi.createTerminal(u,d);if(!E){this.logger.error(`Create Terminal ${d} fail.`);return}this.shortId2LongIdMap.set(d,E.id)}_onRequestStartExtensionTerminal(u){const d=u.proxy;this._terminalProcessProxies.set(d.terminalId,d);const E=u.cols&&u.rows?{columns:u.cols,rows:u.rows}:void 0;this.proxy.$startExtensionTerminal(d.terminalId,E).then(u.callback),d.onInput(f=>this.proxy.$acceptProcessInput(d.terminalId,f)),d.onShutdown(f=>this.proxy.$acceptProcessShutdown(d.terminalId,f)),d.onRequestCwd(()=>this.proxy.$acceptProcessRequestCwd(d.terminalId)),d.onRequestInitialCwd(()=>this.proxy.$acceptProcessRequestInitialCwd(d.terminalId))}_getTerminalProcess(u){return this.transform(u,d=>{const E=this._terminalProcessProxies.get(d);if(!E)throw new Error(`Unknown terminal: ${d}`);return E})}$sendProcessTitle(u,d){return this.transform(u,E=>{const f=this.terminalGroupViewService.getWidget(E);f&&(f.rename(d),this.proxy.$acceptTerminalTitleChange(E,d))})}$sendProcessData(u,d){this._getTerminalProcess(u).emitData(d)}$sendProcessReady(u,d,E){this._getTerminalProcess(u).emitReady(d,E)}$sendProcessExit(u,d){this._getTerminalProcess(u).emitExit(d),this._terminalProcessProxies.delete(u)}$sendOverrideDimensions(u,d){this._getTerminalProcess(u).emitOverrideDimensions(d)}$sendProcessInitialCwd(u,d){this._getTerminalProcess(u).emitInitialCwd(d)}$sendProcessCwd(u,d){this._getTerminalProcess(u).emitCwd(d)}$startLinkProvider(){var u;(u=this._linkProvider)===null||u===void 0||u.dispose(),this._linkProvider=this.controller.registerLinkProvider(new l(this.proxy))}$stopLinkProvider(){var u;(u=this._linkProvider)===null||u===void 0||u.dispose(),this._linkProvider=void 0}$registerProfileProvider(u,d){this._profileProviders.set(u,this.profileService.registerTerminalProfileProvider(d,u,{createContributedTerminalProfile:async E=>{this.proxy.$createContributedProfileTerminal(u,E)}}))}$unregisterProfileProvider(u){var d;(d=this._profileProviders.get(u))===null||d===void 0||d.dispose(),this._profileProviders.delete(u)}async _updateDefaultProfile(){const u=await this.profileInternalSerivce.resolveDefaultProfile();u&&this.proxy.$acceptDefaultProfile(u)}$setEnvironmentVariableCollection(u,d,E){if(E){const f={persistent:d,map:(0,v.deserializeEnvironmentVariableCollection)(E)};this.environmentVariableService.set(u,f)}else this.environmentVariableService.delete(u)}};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)(p.ITerminalApiService),n.__metadata("design:type",Object)],g.prototype,"terminalApi",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],g.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalProfileService),n.__metadata("design:type",Object)],g.prototype,"profileService",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalProfileInternalService),n.__metadata("design:type",Object)],g.prototype,"profileInternalSerivce",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalGroupViewService),n.__metadata("design:type",Object)],g.prototype,"terminalGroupViewService",void 0),n.__decorate([(0,r.Autowired)(a.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)(a.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 l{constructor(u){this._proxy=u}async provideLinks(u,d){const E=this._proxy;return(await E.$provideLinks(u.id,d)).map(c=>({id:c.id,startIndex:c.startIndex,length:c.length,label:c.label,activate:()=>E.$activateLink(u.id,c.id)}))}}},53191:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTestsImpl=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(48465),m=e(30005),_=e(20215),s=e(48385),g=e(44781),l=e(46147),h=d=>{var E,f;for(const c of d)if(c[0]===0||c[0]===1){const y=c[1];!((E=y.item)===null||E===void 0)&&E.uri&&(y.item.uri=p.URI.revive(y.item.uri)),!((f=y.item)===null||f===void 0)&&f.range&&(y.item.range=g.Range.lift(y.item.range))}};let u=class extends p.Disposable{constructor(E){super(),this.testProviderRegistrations=new Map,this.proxy=E.getProxy(l.ExtHostAPIIdentifier.ExtHostTests)}$registerTestController(E,f,c){const y=new p.DisposableStore,b=y.add(new m.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(p.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=p.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=p.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:p.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=u,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.Logger)],u.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.TestServiceToken),n.__metadata("design:type",Object)],u.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(_.TestProfileServiceToken),n.__metadata("design:type",Object)],u.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(s.TestResultServiceToken),n.__metadata("design:type",Object)],u.prototype,"resultService",void 0),t.MainThreadTestsImpl=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],u)},31968:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTheming=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(52416),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.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)(a.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:(x,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),a=e(97267),p=e(8919),v=e(41869),m=e(93899),_=e(68969),s=e(14951),g=e(63067),l=e(52416),h=e(46147),u=e(53043),d=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,T){super(),this.rpcProtocol=w,this.extensionHostType=T,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 P=this.treeModels.get(R.payload.viewId);P&&this.progressService.withProgress({location:R.payload.viewId},()=>P.refresh())}}))}dispose(){this.disposable.dispose(),this.disposableCollection.forEach(w=>{w.dispose()}),this.disposableCollection.clear()}createTreeModel(w,T,R,P){return y.ExtensionTreeViewModel.createModel(this.injector,T,R,w,P||{})}async $registerTreeDataProvider(w,T){if(this.treeModels.has(w))return;const R=new v.DisposableStore,P=new S(w,this.proxy,this.iconService,this.themeService,this.labelService,this.contextKeyService,this.menuService,this.userhome),O=new D(w,T.dropMimeTypes,T.dragMimeTypes,T.hasHandleDrag,this.proxy),M=this.createTreeModel(w,P,O,T);this.treeModels.set(w,M),this.dndControllers.set(w,O),R.add((0,v.toDisposable)(()=>this.treeModels.delete(w))),this.mainLayoutService.replaceViewComponent({id:w,component:c.ExtensionTabBarTreeView},{model:M,dataProvider:P,treeViewId:w}),T?.showCollapseAll&&R.add(this.menuRegistry.registerMenuItem(m.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(M.onDidSelectedNodeChange(F=>{P.setSelection(w,F)})),R.add(M.onDidChangeExpansionState(F=>{const{treeItemId:L,expanded:B}=F;P.setExpanded(w,L,B)}));const k=this.mainLayoutService.getTabbarHandler(w);k&&(R.add(k.onActivate(()=>{P.setVisible(w,!0)})),R.add(k.onInActivate(()=>{P.setVisible(w,!1)})),R.add(R.add((0,v.toDisposable)(()=>k.disposeView(w))))),this.disposableCollection.set(w,R)}async $unregisterTreeDataProvider(w){const T=this.disposableCollection.get(w);T&&T.dispose()}async $resolveDropFileData(w,T,R){const P=this.dndControllers.get(w);if(!P)throw new Error("Unknown tree");return P.resolveDropFileData(T,R)}async $refresh(w,T){const R=this.treeModels.get(w);R&&await R.refresh(T)}async $setTitle(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewTitle(w,T)}async $setDescription(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewDescription(w,T)}async $setBadge(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&(R.setBadge(T||""),R.accordionService.updateViewBadge(w,T||""))}async $setMessage(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewMessage(w,T)}async $reveal(w,T,R){this.mainLayoutService.revealView(w);const P=this.treeModels.get(w);P&&T&&P.reveal(T,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 T=this.treeModels.get(w);T&&T.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)(l.IIconService),r.__metadata("design:type",Object)],A.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(m.IMenuRegistry),r.__metadata("design:type",m.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)(l.IThemeService),r.__metadata("design:type",Object)],A.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(_.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)(m.AbstractMenuService),r.__metadata("design:type",m.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)(p.IRPCProtocol)),r.__metadata("design:paramtypes",[Object,String])],A);class S extends a.Tree{constructor(w,T,R,P,O,M,k,F){super(),this.treeViewId=w,this.proxy=T,this.iconService=R,this.themeService=P,this.labelService=O,this.contextKeyService=M,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 T;return(T=this.treeItemId2TreeNode.get(w))===null||T===void 0?void 0:T.id}getReadableDescription(w){if(w.resourceUri){if(this.userhome){const T=v.URI.from(w.resourceUri);if(this.userhome.isEqualOrParent(T))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 T=w.resourceUri.path.toString();T=decodeURIComponent(T),T.indexOf("/")>=0&&(T=T.substring(T.lastIndexOf("/")+1));const R=this.getReadableDescription(w);return{label:T,description:R}}return{label:w.label,description:w.description}}async createFoldNode(w,T){var R;const P=f.TreeItemCollapsibleState.Expanded===w.collapsibleState,O=await this.toIconClass(w),M=this.getInlineMenuNodes(w.contextValue||""),{label:k,description:F}=this.getLabelAndDescription(w);return new b.ExtensionCompositeTreeNode(this,T,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,M,w.checkboxInfo,w.accessibilityInformation,P,w.resourceUri)}async createNormalNode(w,T){var R;const P=await this.toIconClass(w),O=this.getInlineMenuNodes(w.contextValue||""),{label:M,description:k}=this.getLabelAndDescription(w);return new b.ExtensionTreeNode(this,T,M,k,P,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 T=/^data:image\//;return w?(0,v.isString)(w)?T.test(w):T.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)?l.IconType.Base64:l.IconType.Background,void 0,!0);if(w.themeIcon){let T=(0,v.getExternalIcon)(w.themeIcon.id);w.resourceUri&&(w.themeIcon.id==="file"?T=this.labelService.getIcon(v.URI.from(w.resourceUri)):w.themeIcon.id==="folder"&&(T=this.labelService.getIcon(v.URI.from(w.resourceUri),{isDirectory:!0})));const R=this.themeService.getColorClassNameByColorToken(w.themeIcon.color);return`${T} ${R??""}`}else return""}getInlineMenuNodes(w){if(this.cachedMenu.has(w))return this.cachedMenu.get(w);const T=this.contextKeyService.createScoped();T.createKey("view",this.treeViewId),T.createKey("viewItem",w);const R=this.menuService.createMenu(m.MenuId.ViewItemContext,T),P=(0,m.generateCtxMenu)({menus:R,separator:"inline"});return R.dispose(),T.dispose(),this.cachedMenu.set(w,P[0]),P[0]}async createTreeNode(w,T){return!(0,v.isUndefined)(w.collapsibleState)&&w.collapsibleState!==f.TreeItemCollapsibleState.None?await this.createFoldNode(w,T):await this.createNormalNode(w,T)}async resolveChildren(w){let T=[];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 P of R){const O=await this.createTreeNode(P,w);this.treeItemId2TreeNode.set(P.id,O),T.push(O)}if(b.ExtensionTreeRoot.is(w)){const P=this.isEmpty;this.isEmpty=!R||R.length===0,P!==this.isEmpty&&this._onDidChangeEmpty.fire()}}else T=[new b.ExtensionTreeRoot(this,this.treeViewId)];return T}async resolveTreeItem(w,T){const R=new v.CancellationTokenSource().token;return this.proxy.$resolveTreeItem(w,T,R)}sortComparator(w,T){return w?T?0:-1:1}async refresh(w){await this.onTreeDataChangedEmitter.fire(w)}async reveal(w){await this.onRevealChangedEmitter.fire(w)}async setSelection(w,T){this.proxy.$setSelection(w,T)}async setExpanded(w,T,R){this.proxy.$setExpanded(w,T,R)}async setVisible(w,T){this.proxy.$setVisible(w,T)}dispose(){super.dispose(),this.treeItemId2TreeNode.clear()}markAsChecked(w,T,R){var P;function O(F,L){var B,U;((B=F.parent)===null||B===void 0?void 0:B.checkboxInfo)!==void 0&&F.parent.checkboxInfo.checked!==T&&(!T||!(!((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 M(F,L){var B;a.CompositeTreeNode.is(F)&&((B=F.children)===null||B===void 0||B.forEach(U=>{U.checkboxInfo!==void 0&&U.checkboxInfo.checked!==T&&L.push(U),M(U,L)}))}const k=[w];R||(O(w,k),M(w,k)),k.forEach(F=>F.checkboxInfo.checked=T),(P=this.proxy)===null||P===void 0||P.$checkStateChanged(this.treeViewId,[{treeItemId:w.treeItemId,checked:T}])}}t.TreeViewDataProvider=S;class D extends v.Disposable{constructor(w,T=[],R=[],P,O){super(),this.treeViewId=w,this.dropMimeTypes=T,this.dragMimeTypes=R,this.hasHandleDrag=P,this._proxy=O,this.dataTransfersCache=new E.DataTransferCache}async handleDrop(w,T,R,P,O,M){const k=this.dataTransfersCache.add(w);try{return await this._proxy.$handleDrop(this.treeViewId,k.id,await u.DataTransfer.toDataTransferDTO(w),T?.treeItemId,R,P,O,M)}finally{k.dispose()}}async handleDrag(w,T,R){if(!this.hasHandleDrag)return;const P=await this._proxy.$handleDrag(this.treeViewId,w,T,R);if(!P)return;const O=new d.VSDataTransfer;return P.items.forEach(([M,k])=>{O.replace(M,(0,d.createStringDataTransferItem)(k.asString))}),O}resolveDropFileData(w,T){return this.dataTransfersCache.resolveDropFileData(w,T)}}t.TreeViewDragAndDropController=D},73082:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadUrls=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(46147),v=e(71354);class m{constructor(l,h,u){this.proxy=l,this.handle=h,this.extensionId=u}async handleURL(l){return this.extensionId!==l.authority?!1:(await this.proxy.$handleExternalUri(this.handle,l.codeUri),!0)}}let _=class{constructor(){this.extensionUrlHandlers=new Map}async open(l){let h=!1;const u=l.authority,d=this.extensionUrlHandlers.get(u);if(d)try{h=await d.handleURL(l)}catch(E){this.logger.error(E)}return await this.activationEventService.fireEvent("onUri",u),h}handleScheme(l){return l===this.config.uriScheme}registerExtensionHandler(l,h,u){const d=new m(u,l,h);return this.extensionUrlHandlers.set(h,d),{dispose:()=>{this.extensionUrlHandlers.delete(h)}}}dispose(){this.extensionUrlHandlers.clear()}};n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],_.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.IActivationEventService)],_.prototype,"activationEventService",void 0),_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(l){this.handlers=new Map,this.proxy=l.getProxy(p.ExtHostAPIIdentifier.ExtHostUrls),this.openerService.registerOpener(this.extensionOpener)}async $registerUriHandler(l,h){this.handlers.set(l,this.extensionOpener.registerExtensionHandler(l,h,this.proxy))}async $unregisterUriHandler(l){const h=this.handlers.get(l);h&&(h.dispose(),this.handlers.delete(l))}dispose(){this.handlers.clear(),this.extensionOpener.dispose()}};t.MainThreadUrls=s,n.__decorate([(0,r.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],s.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(_),n.__metadata("design:type",_)],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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindowState=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(46147),v=e(38894);let m=class{constructor(s){this.rpcProtocol=s,this.toDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(p.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(l=>this.onActiveStateChanged(l))),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=m,t.MainThreadWindowState=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},43812:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindow=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(72665),v=e(46147);let m=class{constructor(s){this.rpcProtocol=s,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostWindow)}getDefaultDialogOptions(s){return{...s,defaultUri:s.defaultUri?a.URI.from(s.defaultUri):void 0}}async $showOpenDialog(s,g={}){const l=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showOpenDialog(l);this.proxy.$onOpenDialogResult(s,h&&h.map(u=>u.codeUri))}async $showSaveDialog(s,g={}){const l=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showSaveDialog(l);this.proxy.$onSaveDialogResult(s,h&&h.codeUri)}dispose(){}};t.MainThreadWindow=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(p.IDialogService),n.__metadata("design:type",Object)],m.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(p.IWindowDialogService),n.__metadata("design:type",Object)],m.prototype,"windowDialogService",void 0),t.MainThreadWindow=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},13643:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWorkspace=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(54414),v=e(50492),m=e(84660),_=e(52902),s=e(51500),g=e(26199),l=e(46147);let h=class extends a.WithEventBus{constructor(d){super(),this.rpcProtocol=d,this.proxy=this.rpcProtocol.getProxy(l.ExtHostAPIIdentifier.ExtHostWorkspace),this.processWorkspaceFoldersChanged(this.workspaceService.tryGetRoots()),this.addDispose(this.workspaceChangeEvent=this.workspaceService.onWorkspaceChanged(E=>{this.processWorkspaceFoldersChanged(E)})),this.storageProxy=d.getProxy(l.ExtHostAPIIdentifier.ExtHostStorage)}async $startFileSearch(d,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:[d]};return await this.fileSearchService.find("",b,y)}isAnyRootChanged(d){return!this.roots||this.roots.length!==d.length?!0:this.roots.some((E,f)=>E.uri!==d[f].uri)}processWorkspaceFoldersChanged(d){this.isAnyRootChanged(d)!==!1&&(this.roots=d,this.proxy.$onWorkspaceFoldersChanged({roots:d}),this.extensionStorageService.getAll(!1).then(E=>{this.storageProxy.$updateWorkspaceStorageData(E)}))}dispose(){super.dispose(),this.workspaceChangeEvent.dispose()}async $updateWorkspaceFolders(d,E,f,...c){await this.workspaceService.spliceRoots(d,E,f,...c.map(y=>new a.URI(y)))}async $tryApplyWorkspaceEdit(d,E){try{const f=_.ResourceEdit.convert(d),{success:c}=await this.bulkEditService.apply(f,{respectAutoSaveConfig:E?.isRefactoring});return c}catch{return!1}}async $save(d){if(d)try{const E=a.URI.file(d.path.toString());return await this.editorService.save(E)}catch(E){this.logger.error(`Save Failed: ${E.message}`);return}}async $saveAs(d){if(d)try{return await this.editorService.saveAs(d)}catch(E){this.logger.error(`SaveAs Failed: ${E.message}`);return}}async $saveAll(){try{return await this.editorService.saveAll(),!0}catch(d){return this.logger.error(d),!1}}onRenameFile(d){this.proxy.$didRenameFile(d.payload.oldUri.codeUri,d.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)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],h.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(m.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)(a.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRangeSemanticTokensProviderImpl=t.DocumentSemanticTokensProvider=void 0;const n=e(70858);function r(p){if(p instanceof Uint8Array)return p;if(Array.isArray(p))return Uint8Array.from(p);const v=[];for(const m in p)Object.prototype.hasOwnProperty.call(p,m)&&v.push(Number(p[m]));return Uint8Array.from(v)}class o{constructor(v,m,_){this.proxy=v,this.handleId=m,this.legend=_}getLegend(){return this.legend}async provideDocumentSemanticTokens(v,m,_){const s=m?parseInt(m,10):0,g=await this.proxy.$provideDocumentSemanticTokens(this.handleId,v.uri,s,_);if(!g||_.isCancellationRequested)return null;const l=(0,n.decodeSemanticTokensDto)(r(g));return l.type==="full"?{resultId:String(l.id),data:l.data}:{resultId:String(l.id),edits:l.deltas}}releaseDocumentSemanticTokens(v){v&&this.proxy.$releaseDocumentSemanticTokens(this.handleId,parseInt(v,10))}}t.DocumentSemanticTokensProvider=o;class a{constructor(v,m,_){this.proxy=v,this.handleId=m,this.legend=_}getLegend(){return this.legend}async provideDocumentRangeSemanticTokens(v,m,_){const s=await this.proxy.$provideDocumentRangeSemanticTokens(this.handleId,v.uri,m,_);if(!s||_.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=a},74501:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTreeModel=void 0;const r=e(85608),o=e(76003),a=e(97267),p=e(41869),v=e(72217);let m=n=class extends a.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(a.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.ExtensionTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.ExtensionTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExtensionTreeRoot])],m)},74228:(x,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),a=e(97267),p=e(41869),v=e(93899),m=e(43718),_=e(46147),s=e(98475),g=e(4321),l=r.__importDefault(e(50790)),h=e(74501),u=e(72217);t.IExtensionTreeViewModel=Symbol("IExtensionTreeViewModel"),t.ITreeViewId=Symbol("ITreeViewId"),t.ITreeViewBaseOptions=Symbol("TreeViewBaseOptions"),t.ITreeViewDragAndDropController=Symbol("ITreeViewDragAndDropController"),t.ITreeViewsService=Symbol("ITreeViewsService");const d=Symbol("ITreeViewDataProvider");let E=n=class{static createContainer(c,y,b,A,S){return c.createChild([{token:d,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 _.TreeviewsService}])}static createModel(c,y,b,A,S){return n.createContainer(c,y,b,A,S).get(t.IExtensionTreeViewModel)}constructor(){this.selectedDecoration=new a.Decoration(l.default.mod_selected),this.focusedDecoration=new a.Decoration(l.default.mod_focused),this.contextMenuDecoration=new a.Decoration(l.default.mod_actived),this.loadingDecoration=new a.Decoration(l.default.mod_loading),this.draggingDecoration=new a.Decoration(l.default.mod_dragging),this.draggedOverDecoration=new a.Decoration(l.default.mod_dragover),this.beingDraggedNodes=[],this._selectedNodes=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedNodeChangeEmitter=new p.Emitter,this.onDidSelectedNodeChangeEmitter=new p.Emitter,this.onDidChangeExpansionStateEmitter=new p.Emitter,this._isMultiSelected=!1,this.revealDelayer=new p.ThrottledDelayer(n.DEFAULT_REVEAL_DELAY),this.toCancelNodeExpansion=new p.DisposableCollection,this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.treeItemsTransfer=s.LocalSelectionTransfer.getInstance(),this.treeHandlerReadyDeffer=new p.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=[],I={id:this.treeViewId,itemHandles:[]};if(A.forEach(w=>{I.itemHandles.push(w.treeItemId),w.uri&&D.push(m.URI.revive(w.uri))}),this.addResourceInfoToTransfer(c,D),this.addExtensionProvidedTransferTypes(c,I.itemHandles),c.dataTransfer.setData(this.treeMimeType,JSON.stringify(I)),A.forEach(w=>{this.draggingDecoration.addTarget(w,a.TargetMatchMode.Self)}),c.dataTransfer){const w=this.getDragLabel(A)||"",T=document.createElement("div");T.className=l.default.tree_view_drag_image,T.textContent=w,document.body.appendChild(T),c.dataTransfer.setDragImage(T,-10,-10),setTimeout(()=>document.body.removeChild(T),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(T=>{this.draggingDecoration.removeTarget(T)}),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 I=new s.VSDataTransfer;for(const[T,R]of A.entries())if((T===this.treeMimeType||b.dropMimeTypes.includes(T)||R.asFile()&&b.dropMimeTypes.includes(s.DataTransfers.FILES.toLowerCase()))&&(I.append(T,R),T===this.treeMimeType))try{S=JSON.parse(await R.asString())}catch{}const w=await this.treeViewsDragAndDropService.removeDragOperationTransfer(D);if(w)for(const[T,R]of w.entries())I.append(T,R);return b.handleDrop(I,y,m.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=u.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,a.TargetMatchMode.SelfAndChildren),this.treeModel.dispatchChange()),this.potentialParent!==y&&u.ExtensionCompositeTreeNode.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,a.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,a.TargetMatchMode.SelfAndChildren))),this.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(m.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!==a.TreeNodeType.CompositeTreeNode&&y!==a.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===a.TreeNodeType.CompositeTreeNode||y===a.TreeNodeType.TreeNode)&&this.activeNodeDecoration(c),c.resolved||await c.resolveTreeItem(),c.command?this.commandService.executeCommand(c.command.id,...c.command.arguments||[]):(this.clickTimes++,y===a.TreeNodeType.CompositeTreeNode&&this.preferenceService.get("workbench.list.openMode")==="singleClick"&&this.toggleDirectory(c),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&y!==a.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 I=this.getCtxMenuNodes(D.contextValue);this.injector.get(v.ICtxMenuRenderer).show({anchor:{x:b,y:A},menuNodes:I,args:[{treeViewId:this.treeViewId,treeItemId:D.treeItemId},S.map(T=>({treeViewId:this.treeViewId,treeItemId:T.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(a.TreeNodeEvent.WillResolveChildren,y=>{this.loadingDecoration.addTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(a.TreeNodeEvent.DidResolveChildren,y=>{this.loadingDecoration.removeTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(a.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 a.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?m.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(m.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 I of S.entries())I[0]!==this.treeMimeType&&c.dragMimeTypes.findIndex(w=>w===I[0])<0&&D.push(I[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,m.uuid)();this.dragCancellationToken=new m.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===m.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===m.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&&(u.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,m.isUndefinedOrNull)(y.select)?!1:y.select,I=(0,m.isUndefinedOrNull)(y.focus)?!1:y.focus;let w=Math.min((0,m.isNumber)(y.expand)?y.expand:y.expand===!0?1:0,3),T=await((b=this.extensionTreeHandle)===null||b===void 0?void 0:b.ensureVisible(S.path));for(T&&(D&&this.selectNodeDecoration(T),I&&this.activeNodeFocusedDecoration(T,!1,!0));u.ExtensionCompositeTreeNode.is(T)&&w>0;w--)await this.extensionTreeHandle.expandNode(T),T=T?.children?T?.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)(d),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)(p.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)(p.IContextKeyService),r.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(p.CommandService),r.__metadata("design:type",Object)],E.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(p.LabelService),r.__metadata("design:type",p.LabelService)],E.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(m.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:(x,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(m){return!!m&&"children"in m&&!m.parent}constructor(m,_=""){super(m,void 0),this.treeViewId=_}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 a extends n.CompositeTreeNode{constructor(m,_,s,g="",l="",h="",u,d="",E="",f,c,y,b,A){super(m,_,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=l,this.contextValue=d,this.treeItemId=E,this.actions=f,this._checkboxInfo=c,this._accessibilityInformation=y,this._resolved=!1,this.isExpanded=b||!1,this.sourceUri=A,this._command=u,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 m,_;return{role:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.role)||"treeitem",label:((_=this._accessibilityInformation)===null||_===void 0?void 0:_.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 m;const _=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);_&&(this._tooltip=typeof _.tooltip=="string"?_.tooltip:(m=_.tooltip)===null||m===void 0?void 0:m.value,this._command=_.command),this._resolved=!0}dispose(){super.dispose()}}t.ExtensionCompositeTreeNode=a;class p extends n.TreeNode{constructor(m,_,s,g="",l="",h,u,d="",E="",f,c,y,b){super(m,_,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=l,this._tooltip=h,this._command=u,this.contextValue=d,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 m,_;return{role:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.role)||"treeitem",label:((_=this._accessibilityInformation)===null||_===void 0?void 0:_.label)||this.displayName}}get strikethrough(){return this._strikethrough}get highlights(){return this._hightlights}async resolveTreeItem(){var m;const _=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);_&&(this._tooltip=typeof _.tooltip=="string"?_.tooltip:(m=_.tooltip)===null||m===void 0?void 0:m.value,this._command=_.command),this._resolved=!0}}t.ExtensionTreeNode=p},38894:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowActivityTimer=void 0;const n=e(41869),r=30,o=1e3;class a extends n.Disposable{constructor(v,m=30,_=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=m,this.inactivityCheckInterval=_,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=a},72980:(x,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(77666),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){const _=this;for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=[];for(const u of l){const{title:d,description:E}=u;switch(u.type){case"action":h.push({title:d,description:E,iconClass:(0,o.getIcon)(u.icon),click:()=>{u.command&&_.commandService.executeCommand(u.command)},type:u.type});break;case"enum":h.push({type:u.type,title:d,description:E,select:f=>{u.command&&_.commandService.executeCommand(u.command,f)},enum:u.enum,defaultValue:u.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)(a.IToolbarActionService),n.__metadata("design:type",Object)],v.prototype,"toolbarActionService",void 0),t.ActionsContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("actions"),(0,p.LifeCycle)(3)],v)},57541:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(37499),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{contributes:_}=m;_.forEach(s=>{this.debugConfigurationManager.addSupportBreakpoints(s.language)})}}unregister(m){m.forEach(_=>{this.debugConfigurationManager.removeSupportBreakpoints(_.language)})}dispose(){for(const m of this.contributesMap){const{contributes:_}=m;this.unregister(_)}}};t.BreakpointsContributionPoint=p,n.__decorate([(0,r.Autowired)(o.DebugConfigurationManager),n.__metadata("design:type",o.DebugConfigurationManager)],p.prototype,"debugConfigurationManager",void 0),t.BreakpointsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("breakpoints"),(0,a.LifeCycle)(3)],p)},37614:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(52416),p=e(99220),v="^\\w+[.\\w+]*$";let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{contributes:g}=s;for(const l of g)l&&l.description&&(l.description=(0,o.replaceLocalizePlaceholder)(l.description)),this.themeService.registerColor(l)}}};t.ColorsContributionPoint=m,m.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)(a.IThemeService),n.__metadata("design:type",Object)],m.prototype,"themeService",void 0),t.ColorsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("colors"),(0,p.LifeCycle)(4)],m)},8079:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(52416),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&l.forEach(u=>{this.addDispose(this.commandRegistry.registerCommand({category:this.getLocalizeFromNlsJSON(u.category,g),label:this.getLocalizeFromNlsJSON(u.title,g),shortLabel:u.shortTitle?this.getLocalizeFromNlsJSON(u.shortTitle,g):void 0,categoryLocalized:this.createLocalizedStr(u.category,g),labelLocalized:this.createLocalizedStr(u.title,g),shortLabelLocalized:u.shortTitle?this.createLocalizedStr(u.shortTitle,g):void 0,id:u.command,iconClass:typeof u.icon=="string"&&this.iconService.fromString(u.icon)||this.iconService.fromIcon(h.path,u.icon,a.IconType.Background),enablement:u.enablement},{execute:(...d)=>this.extensionService.executeExtensionCommand(u.command,d)})),this.config.noExtHost?this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(u.command,"worker")):this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(u.command,"node"))})}}};t.CommandsContributionPoint=m,n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ExtensionService),n.__metadata("design:type",p.ExtensionService)],m.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(p.IExtCommandManagement),n.__metadata("design:type",p.IExtCommandManagement)],m.prototype,"extensionCommandManager",void 0),n.__decorate([(0,r.Autowired)(a.IIconService),n.__metadata("design:type",Object)],m.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],m.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.CommandsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("commands"),(0,p.LifeCycle)(3)],m)},6143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(99220),v=e(71354),m=e(25588);let _=class extends p.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:l,contributes:h}=g,u=this.extensionManageService.getExtensionInstanceByExtId(l);if(!u)continue;let d=h;Array.isArray(d)||(d=[d]);const E=[];for(const f of d)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,l)),b.enumDescriptions&&(c[y].enumDescriptions=b.enumDescriptions.map(A=>this.getLocalizeFromNlsJSON(A,l))),b.markdownDescription&&(c[y].markdownDescription=this.getLocalizeFromNlsJSON(b.markdownDescription,l))}f.properties=c,f.title=this.getLocalizeFromNlsJSON(f.title,l)||f.title,this.updateConfigurationSchema(f),E.push({title:f.title,extensionId:l,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(u.packageJSON.displayName,l)||u.packageJSON.displayName,subSections:E}))}}updateConfigurationSchema(g){this.validateConfigurationSchema(g),this.addDispose(this.preferenceSchemaProvider.setSchema(g))}validateConfigurationSchema(g){for(const l in g.properties){const h=g.properties[l];if(h.type==="string[]"&&(h.type="array"),h.type!=="object")continue;typeof h.default>"u"&&this.validateDefaultValue(h);const u=h.properties;if(u)for(const d in u)typeof u[d]!="object"&&delete u[d]}}validateDefaultValue(g){g.default={};const l=g.properties;if(l)for(const h in l)l[h].default&&(g.default[h]=l[h].default,delete l[h].default)}};t.ConfigurationContributionPoint=_,n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],_.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],_.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(m.LocalizationsContributionPoint),n.__metadata("design:type",m.LocalizationsContributionPoint)],_.prototype,"localizationsContributionPoint",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ConfigurationContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("configuration"),(0,p.LifeCycle)(2)],_)},4653:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationDefaultsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{contributes:_}=m;_&&this.updateDefaultOverridesSchema(_)}}updateDefaultOverridesSchema(m){for(const _ in m){const s=m[_];if(o.OVERRIDE_PROPERTY_PATTERN.test(_)){const g=_.match(o.OVERRIDE_PROPERTY_PATTERN)[1];Object.keys(s).forEach(l=>{this.defaultPreferenceProvider.setPreference(l,s[l],void 0,g)})}}}};t.ConfigurationDefaultsContributionPoint=p,n.__decorate([(0,r.Autowired)(o.PreferenceProvider,{tag:o.PreferenceScope.Default}),n.__metadata("design:type",o.PreferenceProvider)],p.prototype,"defaultPreferenceProvider",void 0),t.ConfigurationDefaultsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("configurationDefaults"),(0,a.LifeCycle)(3)],p)},21086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomEditorContributionPoint=void 0,t.createCustomEditorComponent=u;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),a=e(41869),p=e(43718),v=e(57517),m=e(65046),_=e(50234),s=e(99220),g=e(35912),l=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=`${p.CUSTOM_EDITOR_SCHEME}-${E.viewType}`,b=u(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,I)=>{for(const w of A)((0,p.match)(w,D.uri.path.toString().toLowerCase())||(0,p.match)(w,D.uri.path.base.toLowerCase()))&&I.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:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldSaveEvent({uri:T.uri,viewType:c,cancellationToken:new p.CancellationTokenSource().token})),revertResource:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldRevertEvent({uri:T.uri,viewType:c,cancellationToken:new p.CancellationTokenSource().token})),undo:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:T.uri,viewType:c,type:"undo"})),redo:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:T.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)(p.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(a.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 u(d,E,f){return({resource:c})=>{const y=(0,a.useInjectable)(l.IActivationEventService),b=(0,a.useInjectable)(m.IWebviewService),A=(0,a.useInjectable)(a.IEventBus),S=(0,a.useInjectable)(s.ExtensionService);let D=null;return r.default.useEffect(()=>{const I=new p.CancellationTokenSource,w=new p.Disposable;return Promise.all([y.fireEvent("onCustomEditor",d),S.eagerExtensionsActivated.promise]).then(()=>{if(I.token.isCancellationRequested)return;const T=b.createWebview(f().webviewOptions);if(T&&D){const R=new _.WebviewMounter(T,D,document.getElementById("workbench-editor"),document.getElementById("workbench-editor"));T.onRemove(()=>{R.dispose()}),w.addDispose({dispose:()=>{T.remove(),T.dispose(),A.fire(new g.CustomEditorShouldHideEvent({uri:c.uri,viewType:d}))}}),A.fire(new g.CustomEditorShouldDisplayEvent({uri:c.uri,viewType:d,webviewPanelId:T.id,cancellationToken:I.token,openTypeId:E}))}}),()=>{w.dispose(),I.cancel()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"editor-webview-webview-component",ref:I=>D=I})}}},61361:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggersContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(66482),v=e(37499),m=e(69946),_=e(99220),s=e(71354),{deepClone:g}=a.objects,l={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,a.localize)("preference.debug.internalConsoleOptions")};let h=class extends _.VSCodeContributePoint{contribute(){for(const d of this.contributesMap){const{extensionId:E,contributes:f}=d,c=this.extensionManageService.getExtensionInstanceByExtId(E);c&&this.debugService.registerDebugContributionPoints(c.path,this.resolveDebuggers(f,c))}this.debugSchemaManager.update()}resolveDebuggers(d,E){return d.map(f=>{const c=this.doResolveDebuggers(f,E);return this.debugConfigurationManager.registerDebugger(c),c})}doResolveDebuggers(d,E){const f={type:d.type,label:d.label?(0,o.replaceLocalizePlaceholder)(d.label,E.id):"",languages:d.languages,enableBreakpointsFor:d.enableBreakpointsFor,variables:d.variables,adapterExecutableCommand:d.adapterExecutableCommand,configurationSnippets:(d.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:d.win,winx86:d.winx86,windows:d.windows,osx:d.osx,linux:d.linux,program:d.program,args:d.args,runtime:d.runtime,runtimeArgs:d.runtimeArgs};return f.configurationAttributes=d.configurationAttributes&&this.resolveSchemaAttributes(d.type,d.configurationAttributes,E),f}resolveSchemaAttributes(d,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:[d],description:(0,a.localize)("debug.launch.configurations.debugType"),pattern:"^(?!node2)",errorMessage:(0,a.localize)("debug.launch.configurations.debugTypeNotRecognised"),patternErrorMessage:(0,a.localize)("debug.launch.configurations.node2NotSupported")},D.name={type:"string",description:(0,a.localize)("debug.launch.configurations.debugName"),default:"Launch"},D.request={enum:[b],description:(0,a.localize)("debug.launch.configurations.debugRequest")},D.debugServer={type:"number",description:(0,a.localize)("debug.launch.configurations.debugServer"),default:4711},D.preLaunchTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,a.localize)("debug.launch.configurations.debugPrelaunchTask")},D.postDebugTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,a.localize)("debug.launch.configurations.debugPostDebugTask")},D.internalConsoleOptions=l;const I=Object.assign({},D);return D.windows={type:"object",description:(0,a.localize)("debug.launch.configurations.debugWindowsConfiguration"),properties:I},D.osx={type:"object",description:(0,a.localize)("debug.launch.configurations.debugOSXConfiguration"),properties:I},D.linux={type:"object",description:(0,a.localize)("debug.launch.configurations.debugLinuxConfiguration"),properties:I},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,a.localize)("deprecatedVariables","'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.")}),y(A.properties),A})}dispose(){for(const d of this.contributesMap){const{extensionId:E}=d,f=this.extensionManageService.getExtensionInstanceByExtId(E);f&&this.debugService.unregisterDebugContributionPoints(f.path)}}};t.DebuggersContributionPoint=h,h.schema={description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.type","Unique identifier for this debug adapter."),type:"string"},label:{description:(0,a.localize)("vscode.extension.contributes.debuggers.label","Display name for this debug adapter."),type:"string"},program:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.args","Optional arguments to pass to the adapter."),type:"array"},runtime:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.runtimeArgs","Optional runtime arguments."),type:"array"},variables:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.initialConfigurations","Configurations for generating the initial 'launch.json'."),type:["array","string"]},languages:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.configurationSnippets","Snippets for adding new configurations in 'launch.json'."),type:"array"},configurationAttributes:{description:(0,a.localize)("vscode.extension.contributes.debuggers.configurationAttributes","JSON schema configurations for validating 'launch.json'."),type:"object"},when:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.windows","Windows specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.windows.runtime","Runtime used for Windows."),type:"string"}}},osx:{description:(0,a.localize)("vscode.extension.contributes.debuggers.osx","macOS specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.osx.runtime","Runtime used for macOS."),type:"string"}}},linux:{description:(0,a.localize)("vscode.extension.contributes.debuggers.linux","Linux specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.linux.runtime","Runtime used for Linux."),type:"string"}}}}}},n.__decorate([(0,r.Autowired)(p.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)(m.DebugSchemaManager),n.__metadata("design:type",m.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,_.Contributes)("debuggers"),(0,_.LifeCycle)(4)],h)},60768:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrammarsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(62660),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);if(h)for(const u of l)this.textMateService.registerGrammar(u,o.URI.from(h.uri)),this.addDispose(o.Disposable.create(()=>{this.textMateService.unregisterGrammar(u)}))}}};t.GrammarsContributionPoint=m,m.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)(a.ITextmateTokenizer),n.__metadata("design:type",Object)],m.prototype,"textMateService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.GrammarsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("grammars"),(0,p.LifeCycle)(2)],m)},43988:(x,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),a=e(43718),p=e(52416),v=e(38667),m=e(99220),_=e(71354);let s=class extends m.VSCodeContributePoint{contribute(){for(const u of this.contributesMap){const{extensionId:d,contributes:E}=u,f=E.map(y=>({...y,label:this.getLocalizeFromNlsJSON(y.label,d),extensionId:d})),c=this.extensionManageService.getExtensionInstanceByExtId(d);c&&this.iconService.registerIconThemes(f,a.URI.from(c.uri))}}};t.IconThemesContributionPoint=s,n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],s.prototype,"extensionManageService",void 0),t.IconThemesContributionPoint=s=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("iconThemes"),(0,m.LifeCycle)(2)],s);const g={ttf:"truetype",woff:"woff",woff2:"woff2"};let l=class extends m.VSCodeContributePoint{constructor(){super(...arguments),this.iconRegistry=(0,v.getIconRegistry)()}contribute(){for(const{extensionId:u,contributes:d}of this.contributesMap)Object.keys(d).forEach(E=>{const f=d[E],c=this.extensionManageService.getExtensionInstanceByExtId(u);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=a.URI.from(c.uri).resolve(f.default.fontPath),A=a.path.extname(y.fontPath).substring(1),S=g[A];if(!S){this.logger.warn((0,a.localize)("invalid.icons.default.fontPath.extension",`Expected \`contributes.icons.default.fontPath\` to have file extension 'woff', woff2' or 'ttf', is '${A}'.`));return}const D=a.path.join(u,y.fontPath),I=this.iconRegistry.registerIconFont(D,{src:[{location:this.staticResourceService.resolveStaticResource(b),format:S}]});this.iconRegistry.registerIcon(E,{fontCharacter:y.fontCharacter,font:{id:D,definition:I}},f.description)}}});this.productIconService.updateProductIconThemes()}};t.IconsContributionPoint=l,n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],l.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(p.IProductIconService),n.__metadata("design:type",Object)],l.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",o.StaticResourceService)],l.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],l.prototype,"logger",void 0),t.IconsContributionPoint=l=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("icons"),(0,m.LifeCycle)(2)],l)},35321:(x,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),a=e(3098),p=e(57541),v=e(37614),m=e(8079),_=e(6143),s=e(4653),g=e(21086),l=e(61361),h=e(60768),u=e(43988),d=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),I=e(92659),w=e(75943),T=e(77901),R=e(88797),P=e(91688),O=e(55993),M=e(12191),k=e(36198),F=e(21218);t.VSCodeContributesServiceToken=Symbol("VSCodeContributesService");let L=class extends o.ExtensionContributesService{constructor(){super(...arguments),this.ContributionPoints=[P.ThemesContributionPoint,u.IconThemesContributionPoint,u.IconsContributionPoint,f.LocalizationsContributionPoint,m.CommandsContributionPoint,A.ProductIconThemesContributionPoint,h.GrammarsContributionPoint,E.LanguagesContributionPoint,_.ConfigurationContributionPoint,s.ConfigurationDefaultsContributionPoint,v.ColorsContributionPoint,d.KeybindingContributionPoint,c.SubmenusContributionPoint,c.MenusContributionPoint,w.SnippetsContributionPoint,O.ViewContainersContributionPoint,M.ViewsContributionPoint,k.ViewsWelcomeContributionPoint,p.BreakpointsContributionPoint,l.DebuggersContributionPoint,a.ActionsContributionPoint,T.TaskDefinitionContributionPoint,b.ProblemPatternsContributionPoint,y.ProblemMatchersContributionPoint,g.CustomEditorContributionPoint,F.WalkthroughsContributionPoint,I.SemanticTokenTypesContributionPoint,S.SemanticTokenModifiersContributionPoint,D.SemanticTokenScopesContributionPoint,R.TerminalContributionPoint]}};t.VSCodeContributesService=L,t.VSCodeContributesService=L=n.__decorate([(0,r.Injectable)()],L)},81404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeybindingContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(99220),p=e(71354);let v=class extends a.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{extensionId:s,contributes:g}=_,l=this.extensionManageService.getExtensionInstanceByExtId(s);if(!l)continue;const h=g.map(u=>this.toKeybinding(u,l.isBuiltin));this.addDispose(this.keybindingRegistry.registerKeybindings(h))}}toKeybinding(_,s){const g=this.toOSKeybinding(_),{command:l,when:h}=_;return{keybinding:g,command:l,when:h,priority:s?o.KeybindingWeight.BuiltinExtension*100:o.KeybindingWeight.ExternalExtension*100}}toOSKeybinding(_){let s;const g=o.OS.type();return g===o.OperatingSystem.Windows&&_.win?s=_.win:g===o.OperatingSystem.Macintosh&&_.mac?s=_.mac:_.linux&&(s=_.linux),s||_.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)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],v.prototype,"extensionManageService",void 0),t.KeybindingContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("keybindings"),(0,a.LifeCycle)(4)],v)},82903:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguagesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(62660),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{async contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&await this.textMateService.registerLanguages(l,o.URI.from(h.uri))}}};t.LanguagesContributionPoint=m,m.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:`;:.,=}])>
31924
+ `)):(0,a.formatLocalize)("authentication.signOutMessageSimple",h);await this.dialogService.info(E,[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonOK")])===(0,a.localize)("ButtonOK")&&(d?.forEach(c=>this.logout(c)),await this.authenticationService.removeAccountUsage(this.id,h),await this.authenticationService.removeAllowedExtensions(this.id,h))}async getSessions(h,u){return this._proxy.$getSessions(this.id,h,{account:u})}hasSessions(){return!!this._sessions.size}async updateSessionItems(h){const{added:u,removed:d}=h,f=(await this._proxy.$getSessions(this.id)).filter(c=>u.some(y=>y.id===c.id));d.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(u=>this.registerSession(u))}catch(h){this.logger.error(h)}}registerSession(h){this._sessions.set(h.id,h.account.label);const u=this._accounts.get(h.account.label);if(u){this._accounts.set(h.account.label,u.concat(h.id));return}else this._accounts.set(h.account.label,[h.id])}login(h,u){return this._proxy.$login(this.id,h,u)}async logout(h){await this._proxy.$logout(this.id,h),this.messageService.info((0,a.localize)("authentication.signedOut"))}};t.MainThreadAuthenticationProvider=s,n.__decorate([(0,r.Autowired)(p.IAuthenticationService),n.__metadata("design:type",Object)],s.prototype,"authenticationService",void 0),n.__decorate([(0,r.Autowired)(a.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)(a.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 a.Disposable{constructor(h){super(),this._proxy=h.getProxy(m.ExtHostAPIIdentifier.ExtHostAuthentication),this.addDispose(this.authenticationService.onDidChangeSessions(u=>{this._proxy.$onDidChangeAuthenticationSessions(u.providerId,u.label,u.event)})),this.addDispose(this.authenticationService.onDidRegisterAuthenticationProvider(u=>{this._proxy.$onDidChangeAuthenticationProviders([u],[])})),this.addDispose(this.authenticationService.onDidUnregisterAuthenticationProvider(u=>{this._proxy.$onDidChangeAuthenticationProviders([],[u])}))}$getProviderIds(){return Promise.resolve(this.authenticationService.getProviderIds())}async $registerAuthenticationProvider(h,u,d){const E=this.injector.get(s,[this._proxy,h,u,d]);await E.initialize(),this.authenticationService.registerAuthenticationProvider(h,E),this.addDispose(a.Disposable.create(()=>{this.$unregisterAuthenticationProvider(h)}))}$unregisterAuthenticationProvider(h){this.authenticationService.unregisterAuthenticationProvider(h)}$ensureProvider(h){return this.activationService.fireEvent("onAuthenticationRequest",h)}$sendDidChangeSessions(h,u){this.authenticationService.sessionsUpdate(h,u)}$getSessions(h){return this.authenticationService.getSessions(h)}$login(h,u,d){return this.authenticationService.login(h,u,d)}$logout(h,u){return this.authenticationService.logout(h,u)}$getAccounts(h){return this.authenticationService.getSessions(h).then(u=>u.map(d=>d.account))}async doGetSession(h,u,d,E,f){const c=await this.authenticationService.getSessions(h,u,!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,d))return S}}else if(await this.authenticationService.isAccessAllowed(h,c[0].account.label,d))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 I=c?.length&&!f.forceNewSession&&y?await this.selectSession(h,A,d,E,c,u,f,!!f.clearSessionPreference):await this.authenticationService.login(h,u,f);return await this.authenticationService.updatedAllowedExtension(h,I.account.label,d,E,!0),await this.authenticationService.setExtensionSessionId(E,h,I.id),I}const b=c.find(A=>this.authenticationService.isAccessAllowed(h,A.account.label,d));return!f.silent&&!b&&await this.authenticationService.requestNewSession(h,u,f,d,E),b}async $getSession(h,u,d,E,f){const c=await this.doGetSession(h,u,d,E,f);return c&&await this.authenticationService.addAccountUsage(h,c.account.label,d,E),c}async selectSession(h,u,d,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 T=await this.authenticationService.getExtensionSessionId(E,h);if(T){const R=f.find(P=>P.id===T);if(R&&await this.$getSessionsPrompt(h,R.account.label,u,d,E))return R}}const A=f.map(T=>({label:T.account.label,value:T}));A.push({label:(0,a.localize)("authentication.useOtherAccount"),value:void 0});const S=await this.quickPickService.show(A,{title:(0,a.formatLocalize)("authentication.selectAccount",E,u),placeholder:(0,a.formatLocalize)("authentication.getSessionPlaceholder",E),ignoreFocusOut:!0}),D=S??await this.authenticationService.login(h,c,y),I=D.account.label,w=await this.authenticationService.getAllowedExtensions(h,I);return w.find(T=>T.id===d)||(w.push({id:d,name:E}),await this.authenticationService.setAllowedExtensions(h,I,w)),await this.authenticationService.setExtensionSessionId(E,h,D.id),D}async $getSessionsPrompt(h,u,d,E,f){const c=await this.authenticationService.getAllowedExtensions(h,u);if(c.find(S=>S.id===E))return await this.authenticationService.addAccountUsage(h,u,E,f),!0;const A=await this.dialogService.info((0,a.formatLocalize)("authentication.confirmAuthenticationAccess",f,d,u),[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonAllow")])===(0,a.localize)("ButtonAllow");return A&&(this.authenticationService.addAccountUsage(h,u,E,f),c.push({id:E,name:f}),await this.authenticationService.setAllowedExtensions(h,u,c)),A}async loginPrompt(h,u,d,E){return await this.dialogService.info(d?(0,a.formatLocalize)("authentication.confirmReLogin",u,h):(0,a.formatLocalize)("authentication.confirmLogin",u,h),[(0,a.localize)("ButtonCancel"),(0,a.localize)("ButtonAllow")])===(0,a.localize)("ButtonAllow")}async $setTrustedExtensionAndAccountPreference(h,u,d,E,f){const c=await this.authenticationService.getAllowedExtensions(h,u);c.find(y=>y.id===d)||(c.push({id:d,name:E}),await this.authenticationService.setAllowedExtensions(h,u,c)),await this.authenticationService.setExtensionSessionId(E,h,f),await this.authenticationService.addAccountUsage(h,u,d,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)(p.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)(a.QuickPickService),n.__metadata("design:type",Object)],g.prototype,"quickPickService",void 0),n.__decorate([(0,r.Autowired)(_.IActivationEventService),n.__metadata("design:type",_.IActivationEventService)],g.prototype,"activationService",void 0),t.MainThreadAuthentication=g=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],g)},14678:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCommands=void 0;const r=e(85608),o=e(76003),a=e(8919),p=e(41869),v=e(43718),m=e(21880),_=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(_.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(u=>u instanceof v.URI?u.codeUri:u):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 u=this.argumentProcessors.indexOf(h);u>=0&&this.argumentProcessors.splice(u,1)})}$registerCommand(h){const u=r.__classPrivateFieldGet(this,n,"f"),d=(...y)=>(y=y.map(b=>this.argumentProcessors.reduce((A,S)=>S.processArgument(A),b)),u.$executeContributedCommand(h,...y)),E=new v.Disposable,f={execute:d,dispose:()=>E.dispose()};this.commandRegistry.getCommand(h)?E.addDispose(this.commandRegistry.registerHandler(h,{execute:d})):E.addDispose(this.commandRegistry.registerCommand({id:h},{execute:d})),this.commands.set(h,f)}$unregisterCommand(h){const u=this.commands.get(h);u&&(u.dispose(),this.commands.delete(h))}$getCommands(){return Promise.resolve(this.commandRegistry.getCommands().map(h=>h.id))}$executeExtensionCommand(h,...u){return this.commands.has(h)?this.commands.get(h).execute(...u):(u=u.map(d=>this.argumentProcessors.reduce((E,f)=>f.processArgument(E),d)),r.__classPrivateFieldGet(this,n,"f").$executeContributedCommand(h,...u))}$executeCommandWithExtensionInfo(h,u,...d){if(!this.commandRegistry.isPermittedCommand(h,u,...d))throw new Error(`Extension ${u.id} has not permit to execute ${h}`);return this.$executeCommand(h,...d)}async $executeCommand(h,...u){try{return await this.monacoCommandService.executeCommand(h,...u)}catch(d){throw this.logger.error(d),d}}};t.MainThreadCommands=g,n=new WeakMap,r.__decorate([(0,o.Autowired)(p.CommandRegistry),r.__metadata("design:type",Object)],g.prototype,"commandRegistry",void 0),r.__decorate([(0,o.Autowired)(m.ICommandServiceToken),r.__metadata("design:type",Object)],g.prototype,"monacoCommandService",void 0),r.__decorate([(0,o.Autowired)(p.ILogger),r.__metadata("design:type",Object)],g.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(p.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)(a.IRPCProtocol)),r.__metadata("design:paramtypes",[Object])],g)},33530:(x,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),a=e(8919),p=e(93899),v=e(43718),m=e(20868),_=e(28423),s=e(46147),g=e(53043),l=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 p.MenuId.CommentsCommentThreadTitle:return{$mid:7,commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle};case p.MenuId.CommentsCommentThreadContext:return{$mid:8,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},text:f.text};case p.MenuId.CommentsCommentTitle:return{$mid:9,thread:{commentControlHandle:f.thread.data.commentControlHandle,commentThreadHandle:f.thread.data.commentThreadHandle},commentUniqueId:+f.comment.id};case p.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(d,[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 u=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,_.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()?l.CommentThreadCollapsibleState.Collapsed:l.CommentThreadCollapsibleState.Expanded}set collapsibleState(f){(0,_.transaction)(c=>{this._thread.isCollapsed.set(f===l.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 I=this.commentsService.commentsThreads.filter(R=>R.uri.toString()===A&&R.range.startLineNumber===S.startLineNumber),[w]=I.slice(-1),T={commentControlHandle:c,commentThreadHandle:f};w&&!w.data?(w.data=T,this._thread=w):this._thread=this.commentsService.createThread(new v.URI(A),(0,m.positionToRange)(S.startLineNumber),{data:T,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=u,n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],u.prototype,"commentsService",void 0),t.MainThreadCommentThread=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Number,Number,String,String,String,Object,Boolean])],u);let d=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(u,[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),I=D.convertToCoreComment(b),w=D.convertToCoreReaction(A);this.toggleReaction(y.uri,D,I,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=d,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsService),n.__metadata("design:type",Object)],d.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],d.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)],d.prototype,"handleCommentReaction",null),t.MainThreadCommentController=d=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Number,String,String,Object])],d)},57484:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadConnection=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(46147);let m=class{constructor(s){this.rpcProtocol=s,this.connections=new Map,this.connectionsReady=new Map,this.toDispose=new p.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 l=this.connectionsReady.get(s);l&&await l.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 l=new a.Deferred;this.connectionsReady.set(s,l),g=await this.doCreateConnection(s),l.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(p.Disposable.create(()=>g.fireClose())),g}};t.MainThreadConnection=m,n.__decorate([(0,r.Autowired)(p.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.MainThreadConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],m)},23105:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadCustomEditor=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(57517),v=e(65046),m=e(46147),_=e(35912),s=e(62783);let g=class extends a.WithEventBus{constructor(h,u){super(),this.webview=u,this.customEditors=new Map,this.proxy=h.getProxy(m.ExtHostAPIIdentifier.ExtHostCustomEditor)}$acceptCustomDocumentDirty(h,u){this.eventBus.fire(new p.ResourceDecorationNeedChangeEvent({uri:a.URI.from(h),decoration:{dirty:u}}))}async onShouldSave(h){const{viewType:u,uri:d,cancellationToken:E}=h.payload,f=this.customEditors.get(u);if(f){if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{await c.instance.save()}finally{c.dispose()}}else if(f.type===m.CustomEditorType.FullEditor)return this.proxy.$saveCustomDocument(u,d.codeUri,E)}}async onShouldRevert(h){const{viewType:u,uri:d,cancellationToken:E}=h.payload,f=this.customEditors.get(u);if(f){if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{await c.instance.revert()}finally{c.dispose()}}else if(f.type===m.CustomEditorType.FullEditor)return this.proxy.$revertCustomDocument(u,d.codeUri,E)}}async onShouldEdit(h){const{viewType:u,uri:d,type:E}=h.payload,f=this.customEditors.get(u);if(f)if(f.type===m.CustomEditorType.TextEditor){const c=this.editorDocumentModelService.getModelReference(d);if(c)try{E==="undo"?await c.instance.getMonacoModel().undo():await c.instance.getMonacoModel().redo()}finally{c.dispose()}}else f.type===m.CustomEditorType.FullEditor&&(E==="undo"?await this.proxy.$undo(u,d.codeUri):await this.proxy.$redo(u,d.codeUri))}async onCustomEditorShouldDisplayEvent(h){const u=this.customEditors.get(h.payload.viewType);if(u){const{viewType:d,uri:E,openTypeId:f,webviewPanelId:c,cancellationToken:y}=h.payload;if(u.type===m.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(_.CustomEditorShouldHideEvent,S=>{E.isEqual(S.payload.uri)&&b.dispose()}),this.webview.pipeBrowserHostedWebviewPanel(A,{uri:E,openTypeId:f},d,u.options.webviewOptions||{},u.extensionInfo),this.proxy.$resolveCustomTextEditor(d,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},d,u.options.webviewOptions||{},u.extensionInfo),this.proxy.$resolveCustomTextEditor(d,E.codeUri,c,y)}}}$registerCustomEditor(h,u,d={},E){this.customEditors.set(h,{type:u,options:d,extensionInfo:E}),this.eventBus.fire(new _.CustomEditorOptionChangeEvent({viewType:h,options:d}))}$unregisterCustomEditor(h){this.customEditors.delete(h)}};t.MainThreadCustomEditor=g,n.__decorate([(0,r.Autowired)(p.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,a.OnEvent)(_.CustomEditorShouldSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldSave",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldRevertEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldSaveEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldRevert",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldEditEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.CustomEditorShouldEditEvent]),n.__metadata("design:returntype",Promise)],g.prototype,"onShouldEdit",null),n.__decorate([(0,a.OnEvent)(_.CustomEditorShouldDisplayEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDebug=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(66482),m=e(99797),_=e(37499),s=e(31141),g=e(97186),l=e(38029),h=e(15153),u=e(70159),d=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),I=e(21259),w=e(90384);let T=class{constructor(P,O){this.rpcProtocol=P,this.mainThreadConnection=O,this.toDispose=new Map,this.listenerDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(A.ExtHostAPIIdentifier.ExtHostDebug),this.listen(),this.registerDebugContributions()}dispose(){this.toDispose.forEach(P=>{P.dispose()}),this.toDispose.clear(),this.listenerDispose.dispose()}listen(){this.listenerDispose.pushAll([this.breakpointManager.onDidChangeBreakpoints(({added:P,removed:O,changed:M})=>{const k=this.breakpointManager.getBreakpoints();this.proxy.$breakpointsDidChange(this.toCustomApiBreakpoints(k),this.toCustomApiBreakpoints(P),this.toCustomApiBreakpoints(O),this.toCustomApiBreakpoints(M))}),this.sessionManager.onDidStartDebugSession(P=>{this.proxy.$sessionDidStart(P.id)}),this.sessionManager.onDidDestroyDebugSession(P=>{this.proxy.$sessionDidDestroy(P.id)}),this.sessionManager.onDidChangeActiveDebugSession(P=>{this.proxy.$sessionDidChange(P.current&&P.current.id)}),this.sessionManager.onDidReceiveDebugSessionCustomEvent(P=>{this.proxy.$onSessionCustomEvent(P.session.id,P.event,P.body)}),this.debugService.onDidDebugContributionPointChange(({path:P,contributions:O,removed:M})=>{M?(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(P,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 P=this.debugService.debugContributionPoints;for(const[O,M]of P)this.proxy.$registerDebuggerContributions(O,M),M.forEach(k=>{this.$registerDebuggerContribution({type:k.type,label:k.label||k.type}),this.logger.log(`Debugger contribution has been registered: ${k.type}`)})}async $appendToDebugConsole(P){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.append(P)}async $appendLineToDebugConsole(P){this.debugConsoleModelService.debugConsoleSession&&this.debugConsoleModelService.debugConsoleSession.appendLine(P)}async $unregisterDebuggerContribution(P){const O=this.toDispose.get(P.type);O?.dispose()}async $registerDebuggerContribution(P){const O=new a.DisposableCollection,M=await this.proxy.$getTerminalCreationOptions(P.type);this.toDispose.set(P.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,M,this.debugPreferences,this.outputService,this.injector,this.sessionManager);O.pushAll([this.adapterContributionRegister.registerDebugAdapterContribution(new I.ExtensionDebugAdapterContribution(P,this.proxy,this.activationEventService)),this.sessionContributionRegistry.registerDebugSessionContribution({debugType:P.type,debugSessionFactory:()=>k})])}async $addBreakpoints(P){const O=new Map;P.forEach(M=>O.set(M.id,M)),this.breakpointManager.findMarkers({dataFilter:M=>(O.has(M.id)&&O.delete(M.id),!1)});for(const M of O.values())if(M.location){const k=M.location;this.breakpointManager.addBreakpoint(m.DebugBreakpoint.create(a.Uri.revive(k.uri),{line:M.location.range.startLineNumber+1,column:1,condition:M.condition,hitCondition:M.hitCondition,logMessage:M.logMessage},!0))}}async $removeBreakpoints(P){const O=new Set;P.forEach(M=>O.add(M.id));for(const M of this.breakpointManager.findMarkers({dataFilter:k=>O.has(k.id)})){const k=this.modelManager.resolve(new a.URI(M.data.uri));k&&k[0].breakpoint&&this.breakpointManager.delBreakpoint(k[0].breakpoint)}}async $customRequest(P,O,M){const k=this.sessionManager.getSession(P);if(k)return k.sendCustomRequest(O,M);throw new Error(`Debug session '${P}' not found`)}$getDebugProtocolBreakpoint(P,O){const M=this.sessionManager.getSession(P);return M?Promise.resolve(M.getDebugProtocolBreakpoint(O)):Promise.reject(new Error("debug session not found"))}async $startDebugging(P,O,M){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(M.parentSessionID),repl:M.repl,compact:M.compact,lifecycleManagedByParent:M.lifecycleManagedByParent};return!!await this.sessionManager.start({configuration:k,workspaceFolderUri:P&&a.Uri.revive(P.uri).toString(),index:F,...L})}$stopDebugging(P){if(P){const O=this.sessionManager.getSession(P);if(O)return this.sessionManager.stopSession(O)}else return this.sessionManager.stopSession(void 0);throw new Error(`Debug session '${P}' not found`)}toCustomApiBreakpoints(P){return P.map(O=>({id:O.id,enabled:O.enabled,condition:O.raw.condition,hitCondition:O.raw.hitCondition,logMessage:O.raw.logMessage,location:{uri:a.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=T,n.__decorate([(0,r.Autowired)(d.IDebugSessionManager),n.__metadata("design:type",l.DebugSessionManager)],T.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],T.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(m.BreakpointManager),n.__metadata("design:type",m.BreakpointManager)],T.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(v.IDebugModelManager),n.__metadata("design:type",Object)],T.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(_.DebugConfigurationManager),n.__metadata("design:type",_.DebugConfigurationManager)],T.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(s.DebugPreferences),n.__metadata("design:type",Object)],T.prototype,"debugPreferences",void 0),n.__decorate([(0,r.Autowired)(E.WorkbenchEditorService),n.__metadata("design:type",E.WorkbenchEditorService)],T.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(y.IMessageService),n.__metadata("design:type",Object)],T.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(f.IFileServiceClient),n.__metadata("design:type",Object)],T.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(u.IDebugServer),n.__metadata("design:type",w.ExtensionDebugService)],T.prototype,"adapterContributionRegister",void 0),n.__decorate([(0,r.Autowired)(S.IActivationEventService),n.__metadata("design:type",S.IActivationEventService)],T.prototype,"activationEventService",void 0),n.__decorate([(0,r.Autowired)(g.DebugSessionContributionRegistry),n.__metadata("design:type",D.ExtensionDebugSessionContributionRegistry)],T.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],T.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(b.ITerminalApiService),n.__metadata("design:type",Object)],T.prototype,"terminalService",void 0),n.__decorate([(0,r.Autowired)(v.IDebugConsoleModelService),n.__metadata("design:type",h.DebugConsoleModelService)],T.prototype,"debugConsoleModelService",void 0),n.__decorate([(0,r.Autowired)(c.OutputService),n.__metadata("design:type",c.OutputService)],T.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(u.IDebugService),n.__metadata("design:type",Object)],T.prototype,"debugService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],T.prototype,"injector",void 0),t.MainThreadDebug=T=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])],T)},78690:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadDecorations=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(41893),v=e(46147);class m{constructor(g){this._proxy=g,this._idPool=0,this._requests=Object.create(null),this._resolver=Object.create(null)}enqueue(g,l,h){const u=++this._idPool,d=new Promise(E=>{this._requests[u]={id:u,handle:g,uri:l},this._resolver[u]=E,this._processQueue()});return h.onCancellationRequested(()=>{delete this._requests[u],delete this._resolver[u]}),d}_processQueue(){typeof this._timer!="number"&&(this._timer=setTimeout(()=>{const g=this._requests,l=this._resolver;this._proxy.$provideFileDecorations(Object.values(g),a.CancellationToken.None).then(h=>{for(const u in l)l[u](h[u])}),this._requests=[],this._resolver=[],this._timer=void 0},0))}}let _=class{constructor(g){this.rpcProtocol=g,this._provider=new Map,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostDecorations),this._requestQueue=new m(this.proxy)}dispose(){this._provider.forEach(g=>(0,a.dispose)(g)),this._provider.clear()}$registerDecorationProvider(g,l){const h=new a.Emitter,u=this.decorationsService.registerDecorationsProvider({label:l,onDidChange:h.event,provideDecorations:(d,E)=>this._requestQueue.enqueue(g,d,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,u])}$onDidChange(g,l){const h=this._provider.get(g);if(h){const[u]=h;u.fire(l&&l.map(d=>a.Uri.revive(d)))}}$unregisterDecorationProvider(g){const l=this._provider.get(g);l&&((0,a.dispose)(l),this._provider.delete(g))}};t.MainThreadDecorations=_,n.__decorate([(0,r.Autowired)(p.IDecorationsService),n.__metadata("design:type",p.IDecorationsService)],_.prototype,"decorationsService",void 0),t.MainThreadDecorations=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],_)},84680:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionDocumentData=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(43718),m=e(54414),_=e(57517),s=e(17878),g=e(14951),l=e(46147),h=1e3*60*3,u=1e3*20,d=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(l.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,I])=>({name:D,icon:I,uri:S,metadata:null}))})),A.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(b,(S,D)=>{this.fileServiceClient.handlesScheme(b)||D.push({type:_.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)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"docManager",void 0),n.__decorate([(0,r.Autowired)(_.IEditorDocumentModelContentRegistry),n.__metadata("design:type",Object)],f.prototype,"contentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",m.ResourceService)],f.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",_.EditorComponentRegistry)],f.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.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)(a.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)(_.EditorDocumentModelContentChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelContentChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentChangeEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelWillSaveEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelWillSaveEvent]),n.__metadata("design:returntype",Promise)],f.prototype,"onEditorDocumentModelWillSaveEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelOptionChangedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelOptionChangedEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelOptionChangedEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelCreationEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelCreationEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelContentCreationEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelRemovalEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.EditorDocumentModelRemovalEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onEditorDocumentModelRemovedEvent",null),n.__decorate([(0,v.OnEvent)(_.EditorDocumentModelSavedEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[_.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=d,this.maxAge=h,this.minAge=u,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 I=this.refs.indexOf(D);I!==0&&(this.length-=A,b.dispose(),clearTimeout(S),this.refs.splice(I,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorTabsService=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(75524),p=e(43718),v=e(54414),m=e(51553),_=e(46147);let s=class extends p.Disposable{constructor(d){super(),this.rpcProtocol=d,this.prevEditorGroups=new Set,this.groupDataStore=new Map,this.tabStore=new l,this.proxy=this.rpcProtocol.getProxy(_.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(d,E,f,c){const y=this.findEditorTabData(d);if(y){const{group:b,resource:A}=y;let S=b;(0,p.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(d,E){return(await Promise.all(d.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(d,E){return(await Promise.all(d.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(d){return this.tabStore.all.get(d)}getOrCreateGroupData(d){if(!this.groupDataStore.has(d.groupId)){const E=new h(d,this.workbenchEditorService,this.tabStore,this.proxy);E.addDispose({dispose:()=>{this.groupDataStore.get(d.groupId)===E&&this.groupDataStore.delete(d.groupId)}}),this.groupDataStore.set(d.groupId,E)}return this.groupDataStore.get(d.groupId)}updateGroups(){const d=(0,p.diffSets)(this.prevEditorGroups,new Set(this.workbenchEditorService.editorGroups));d.added.length>0||d.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",m.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(d,E){this.group=d,this.resource=E,this.tryUpdate()}updateResource(d){this.resource=d}tryUpdate(){const d=g.from(this.group,this.resource);return this._dto&&JSON.stringify(this._dto)!==JSON.stringify(d)?(this._dto=d,!0):(this._dto=d,!1)}get dto(){return this._dto}static getTabId(d,E){return`${d.groupId}~${E.uri.toString()}`}get index(){return this.group.resources.indexOf(this.resource)}static from(d,E){var f,c,y,b,A,S;const D=g.getTabId(d,E),I=d.getLastOpenType(E);let w={kind:0};if(I){if(I.type==="code")w={kind:1,uri:E.uri.codeUri};else if(I.type==="diff"){const{metadata:T}=E;T&&(w={kind:2,original:T.original.codeUri,modified:T.modified.codeUri})}else if(I.type==="mergeEditor"){const{metadata:T}=E;if(T){const{ancestor:R,input1:P,input2:O,output:M}=T,k=a.MergeEditorInputData.from(P),F=a.MergeEditorInputData.from(O);w={kind:3,base:p.Uri.parse(R),input1:k.uri.codeUri,input2:F.uri.codeUri,result:p.Uri.parse(M)}}}else if(I.type==="component"){const T=d.editorComponentRegistry.getEditorComponent(I.componentId);!((f=T?.metadata)===null||f===void 0)&&f.extWebview?w={kind:7,viewType:(c=T?.metadata)===null||c===void 0?void 0:c.extWebview}:!((y=T?.metadata)===null||y===void 0)&&y.customEditor&&(w={kind:6,viewType:(b=T?.metadata)===null||b===void 0?void 0:b.customEditor,uri:E.uri.codeUri})}}return{id:D,label:E.name,input:w,isActive:d.currentResource===E,isPinned:!1,isPreview:!!(!((A=d.previewURI)===null||A===void 0)&&A.isEqual(E.uri)),isDirty:!!(!((S=d.resourceService.getResourceDecoration(E.uri))===null||S===void 0)&&S.dirty)}}}class l{constructor(){this.all=new Map,this.mapByUri=new Map}getOrCreateData(d,E){const f=g.getTabId(d,E);if(this.all.has(f))this.all.get(f).updateResource(E);else{const c=new g(d,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(d){var E,f;const c=this.all.get(d);if(c){this.all.delete(d);const y=c.resource.uri.toString();(E=this.mapByUri.get(y))===null||E===void 0||E.delete(d),((f=this.mapByUri.get(y))===null||f===void 0?void 0:f.size)===0&&this.mapByUri.delete(y)}}getByResourceUri(d){var E;return Array.from(((E=this.mapByUri.get(d.toString()))===null||E===void 0?void 0:E.values())||[])}}class h extends p.Disposable{constructor(d,E,f,c){super(),this.editorGroup=d,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(d=>this.store.getOrCreateData(this.editorGroup,d)),this.addDispose(this.editorGroup.onDidEditorGroupTabOperation(d=>{const E={open:0,close:1,move:3}[d.type],f=this.store.getOrCreateData(this.editorGroup,d.resource);f.tryUpdate(),this.proxy.$acceptTabOperation({kind:E,groupId:this.editorGroup.groupId,tabDto:f.dto,index:d.index,oldIndex:d.oldIndex})})),this.addDispose(this.editorGroup.onDidEditorGroupBodyChanged(()=>{this.onTabsMayUpdated()})),this.addDispose(this.editorGroup.onDidEditorGroupTabChanged(()=>{this.onTabsMayUpdated()}))}onTabsMayUpdated(){this.tabs=this.editorGroup.resources.map((d,E)=>{const f=this.store.getOrCreateData(this.editorGroup,d);return f.tryUpdate()&&this.proxy.$acceptTabOperation({kind:2,tabDto:f.dto,index:E,groupId:this.editorGroup.groupId}),f})}tryCheckUpdate(){const d=this._data,E={groupId:this.editorGroup.groupId,isActive:this.editorService.currentEditorGroup===this.editorGroup,viewColumn:this.editorGroup.index};this._data=E,d&&(d.viewColumn!==E.viewColumn?this.proxy.$acceptTabGroupUpdate({...this.dto,tabs:[]}):!d.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEditorService=void 0,t.cursorStyleToString=P;const n=e(85608),r=n.__importDefault(e(82451)),o=n.__importDefault(e(97331)),a=e(76003),p=e(8919),v=e(40827),m=e(43718),_=e(54414),s=e(57517),g=e(71624),l=e(51553),h=n.__importStar(e(20868)),u=e(87822),d=e(16781),E=e(46147),f=e(53043),c=e(84680);let y=class extends m.WithEventBus{constructor(M,k){super(),this.rpcProtocol=M,this.documents=k,this.propertiesChangeCache=new Map,this.triggerPropertiesChange=(0,o.default)(()=>{const F=[];this.propertiesChangeCache.forEach(L=>{F.push(L)}),this.propertiesChangeCache.clear(),this.proxy.$acceptPropertiesChanges(F)},16,{leading:!0,trailing:!0}),this.proxy=this.rpcProtocol.getProxy(E.ExtHostAPIIdentifier.ExtHostEditors),this.$getInitialState().then(F=>{this.proxy.$acceptChange(F)})}async $getInitialState(){this.startEvents();const M=this.editorService.editorGroups.map(F=>{if(F.currentOpenType&&D(F.currentOpenType)){const L=F.currentEditor;return!L.currentDocumentModel||!this.documents.isDocSyncEnabled(L.currentDocumentModel.uri)?void 0:{id:b(F,F.currentResource.uri),uri:L.currentDocumentModel.uri.toString(),selections:L.getSelections()||[],options:S(L.monacoEditor),viewColumn:w(F),visibleRanges:L.monacoEditor.getVisibleRanges()}}}).filter(F=>!!F),k=this.editorService.currentResource&&M.find(F=>F.uri===this.editorService.currentResource.uri.toString());return{created:M,actived:k&&this.documents.isDocSyncEnabled(k.uri)&&k.id}}async $closeEditor(M){if(this.getEditor(M)){const F=this.getGroup(M);F.close(F.currentResource.uri)}}async $revealRange(M,k,F){const L=this.getEditor(M);if(L)switch(F){case E.TextEditorRevealType.InCenter:return L.monacoEditor.revealRangeInCenter(k);case E.TextEditorRevealType.AtTop:return L.monacoEditor.revealRangeAtTop(k);case E.TextEditorRevealType.InCenterIfOutsideViewport:return L.monacoEditor.revealRangeInCenterIfOutsideViewport(k);default:return L.monacoEditor.revealRange(k)}}async $createTextEditorDecorationType(M,k){this.resolveIconPaths(k),this.resolveIconPaths(k.dark),this.resolveIconPaths(k.light),this.decorationService.createTextEditorDecorationType(k,M)}resolveIconPaths(M){if(!M)return M;if(M.gutterIconPath){let k;typeof M.gutterIconPath=="string"?k=m.URI.file(M.gutterIconPath):k=m.URI.from(M.gutterIconPath),M.gutterIconPath=this.staticResourceService.resolveStaticResource(k).toString()}}async $deleteTextEditorDecorationType(M){const k=this.decorationService.getTextEditorDecorationType(M);k&&k.dispose()}async $applyDecoration(M,k,F){const L=this.getEditor(M);L&&L.applyDecoration(k,F)}async $insertSnippet(M,k,F=[],L={undoStopAfter:!0,undoStopBefore:!0}){const B=this.getEditor(M);B&&B.insertSnippet(k,F,L)}async $updateOptions(M,k){const F=this.getEditor(M);F&&await this.setConfiguration(F.monacoEditor,k)}getEditor(M){var k,F;const L=this.getGroup(M);if(!L)return;const B=L.currentResource;if(B&&L.currentOpenType&&D(L.currentOpenType)){if(M===b(L,B.uri))return L.currentEditor;if(((k=L.currentOpenType)===null||k===void 0?void 0:k.type)===s.EditorOpenType.diff&&M===b(L,B.metadata.original,"original"))return L.diffEditor.originalEditor;if(((F=L.currentOpenType)===null||F===void 0?void 0:F.type)===s.EditorOpenType.diff&&M===b(L,B.metadata.modified,"modified"))return L.diffEditor.modifiedEditor}}getGroup(M){const k=A(M);return this.editorService.getEditorGroup(k)}batchPropertiesChanges(M){const{id:k}=M;let F=this.propertiesChangeCache.get(k);F||(F={}),F=(0,r.default)(F,M),this.propertiesChangeCache.set(k,F),this.triggerPropertiesChange()}startEvents(){this.addDispose([this.eventBus.on(s.EditorGroupChangeEvent,M=>{const k=M.payload;if(!T(k.newResource,k.oldResource)||!R(k.newOpenType,k.oldOpenType)){const F={};if(k.newOpenType&&(k.newOpenType.type===s.EditorOpenType.code||k.newOpenType.type===s.EditorOpenType.diff)){const L=k.group.currentEditor;if(L.currentDocumentModel){if(this.documents.isDocSyncEnabled(L.currentDocumentModel.uri))if(F.created=[],k.newOpenType.type===s.EditorOpenType.diff){const B=k.group.diffEditor.originalEditor,U=k.group.diffEditor.modifiedEditor,W=b(k.group,k.newResource.metadata.original,"original");F.created.push({id:W,uri:B.currentUri.toString(),selections:B.getSelections()||[],options:S(B.monacoEditor),viewColumn:w(k.group),visibleRanges:B.monacoEditor.getVisibleRanges()});const j=b(k.group,k.newResource.metadata.modified,"modified");F.created.push({id:j,uri:U.currentUri.toString(),selections:U.getSelections()||[],options:S(U.monacoEditor),viewColumn:w(k.group),visibleRanges:U.monacoEditor.getVisibleRanges()})}else F.created.push({id:b(k.group,k.newResource.uri),uri:L.currentDocumentModel.uri.toString(),selections:L.getSelections()||[],options:S(L.monacoEditor),viewColumn:w(k.group),visibleRanges:L.monacoEditor.getVisibleRanges()})}T(k.newResource,k.oldResource)&&!R(k.newOpenType,k.oldOpenType)&&k.newResource===this.editorService.currentResource&&(F.actived=b(k.group,k.newResource.uri))}k.oldOpenType&&(k.oldOpenType.type===s.EditorOpenType.code||k.oldOpenType.type===s.EditorOpenType.diff)&&(F.removed=[],k.oldOpenType.type===s.EditorOpenType.diff?(F.removed.push(b(k.group,k.oldResource.metadata.original,"original")),F.removed.push(b(k.group,k.oldResource.metadata.modified,"modified"))):F.removed=[b(k.group,k.oldResource.uri)]),this.proxy.$acceptChange(F)}}),this.editorService.onActiveEditorUriChange(M=>{M&&this.editorService.currentEditorGroup&&D(this.editorService.currentEditorGroup.currentOpenType)?this.acceptCurrentEditor(M):this.proxy.$acceptChange({actived:"-1"})}),this.eventBus.on(s.EditorConfigurationChangedEvent,M=>{const k=b(M.payload.group,M.payload.resource.uri);M.payload.group.currentEditor&&M.payload.group.currentEditor.monacoEditor.getModel()&&this.batchPropertiesChanges({id:k,options:S(M.payload.group.currentEditor.monacoEditor)})}),this.eventBus.on(s.EditorSelectionChangeEvent,M=>{const k=b(M.payload.group,M.payload.editorUri,M.payload.side);this.batchPropertiesChanges({id:k,selections:{selections:M.payload.selections,source:M.payload.source}}),this.acceptCurrentEditor(M.payload.editorUri)}),this.eventBus.on(s.EditorVisibleChangeEvent,M=>{const k=b(M.payload.group,M.payload.resource.uri);this.batchPropertiesChanges({id:k,visibleRanges:M.payload.visibleRanges})}),this.eventBus.on(s.EditorGroupIndexChangedEvent,M=>{if(I(M.payload.group)){const k=b(M.payload.group,M.payload.group.currentResource.uri);this.batchPropertiesChanges({id:k,viewColumn:w(M.payload.group)})}})])}acceptCurrentEditor(M){var k,F,L,B,U;let W;const j=((k=this.editorService.currentEditorGroup.currentOpenType)===null||k===void 0?void 0:k.type)===s.EditorOpenType.diff&&((F=this.editorService.currentEditorGroup.diffEditor.originalEditor.currentUri)===null||F===void 0?void 0:F.isEqual(M)),Q=((L=this.editorService.currentEditorGroup.currentOpenType)===null||L===void 0?void 0:L.type)===s.EditorOpenType.diff&&((B=this.editorService.currentEditorGroup.diffEditor.modifiedEditor.currentUri)===null||B===void 0?void 0:B.isEqual(M));j&&(W="original"),Q&&(W="modified"),W?this.proxy.$acceptChange({actived:b(this.editorService.currentEditorGroup,M,W)}):this.proxy.$acceptChange({actived:b(this.editorService.currentEditorGroup,(U=this.editorService.currentEditorGroup.currentResource)===null||U===void 0?void 0:U.uri)})}async $applyEdits(M,k,F,L){const B=this.getEditor(M);if(B&&B.currentDocumentModel){const U=B.currentDocumentModel.getMonacoModel();if(U&&U.getVersionId()===k){typeof L.setEndOfLine<"u"&&U.pushEOL(L.setEndOfLine);const W=F.map(j=>({range:h.Range.lift(j.range),text:j.text,forceMoveMarkers:j.forceMoveMarkers}));return L.undoStopBefore&&B.monacoEditor.pushUndoStop(),B.monacoEditor.executeEdits("MainThreadTextEditor",W),L.undoStopAfter&&B.monacoEditor.pushUndoStop(),!0}else return!1}else return!1}async $openResource(M,k){k.forceOpenType={type:s.EditorOpenType.code},k.focus=!0,k={...k,...(0,f.viewColumnToResourceOpenOptions)(k.viewColumn)};const F=await this.editorService.open(new m.URI(M),k);if(F)return b(F.group,F.resource.uri);throw new Error("Editor Open uri "+M.toString()+" Failed")}$setSelections(M,k){return this.getEditor(M)?(this.getEditor(M).setSelections(k),Promise.resolve()):Promise.reject(`No Such TextEditor: ${M}`)}setConfiguration(M,k){if(M.getModel()&&this._setIndentConfiguration(M.getModel(),k),!!M){if(k.cursorStyle){const F=P(k.cursorStyle);M.updateOptions({cursorStyle:F})}if(typeof k.lineNumbers<"u"){let F;switch(k.lineNumbers){case 1:F="on";break;case 2:F="relative";break;case 3:F="interval";break;default:F="off"}M.updateOptions({lineNumbers:F})}}}$getDiffInformation(M){const k=this.getEditor(M);if(!k)return Promise.reject(new Error("No such TextEditor"));const F=k.monacoEditor;if(!F)return Promise.reject(new Error("No such CodeEditor"));const L=F.getId(),B=this.codeEditorService.listDiffEditors(),[U]=B.filter(j=>j.originalEditor.getId()===L||j.modifiedEditor.getId()===L);if(U){const j=U.monacoDiffEditor.getLineChanges();return j?Promise.resolve(j.map(Q=>{var G;return[Q.originalStartLineNumber,Q.originalEndLineNumber,Q.modifiedStartLineNumber,Q.modifiedEndLineNumber,(G=Q.charChanges)===null||G===void 0?void 0:G.map(Z=>[Z.originalStartLineNumber,Z.originalStartColumn,Z.originalEndLineNumber,Z.originalEndColumn,Z.modifiedStartLineNumber,Z.modifiedStartColumn,Z.modifiedEndLineNumber,Z.modifiedEndColumn])]})):Promise.resolve([])}const W=F.getContribution("editor.contrib.dirtydiff");return W?Promise.resolve(W.getChanges()):Promise.resolve([])}_setIndentConfiguration(M,k){const F=d.StandaloneServices.get(u.IModelService).getCreationOptions(M.getLanguageId(),M.uri,M.isForSimpleWidget);if(k.tabSize==="auto"||k.insertSpaces==="auto"){let B=F.insertSpaces,U=F.tabSize;k.insertSpaces!=="auto"&&typeof k.insertSpaces<"u"&&(B=k.insertSpaces),k.tabSize!=="auto"&&typeof k.tabSize<"u"&&(U=k.tabSize),M.detectIndentation(B,U);return}const L={};typeof k.insertSpaces<"u"&&(L.insertSpaces=k.insertSpaces),typeof k.tabSize<"u"&&(L.tabSize=k.tabSize),typeof k.indentSize<"u"&&(k.indentSize==="tabSize"?L.indentSize=L.tabSize||F.tabSize:L.indentSize=k.indentSize),M.updateOptions(L)}};t.MainThreadEditorService=y,n.__decorate([(0,a.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",l.WorkbenchEditorServiceImpl)],y.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(s.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],y.prototype,"decorationService",void 0),n.__decorate([(0,a.Autowired)(_.EditorCollectionService),n.__metadata("design:type",g.EditorCollectionServiceImpl)],y.prototype,"codeEditorService",void 0),n.__decorate([(0,a.Autowired)(v.StaticResourceService),n.__metadata("design:type",v.StaticResourceService)],y.prototype,"staticResourceService",void 0),t.MainThreadEditorService=y=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object,c.MainThreadExtensionDocumentData])],y);function b(O,M,k){return O.name+"."+(k?`${k}.`:"")+M.toString()}function A(O){return O.substr(0,O.indexOf("."))}function S(O){const M=O.getModel().getOptions();return{tabSize:M.tabSize,indentSize:M.indentSize,insertSpaces:M.insertSpaces,cursorStyle:O.getOption(h.editor.EditorOption.cursorStyle),lineNumbers:O.getOption(h.editor.EditorOption.lineNumbers).renderType}}function D(O){return O?O.type===s.EditorOpenType.code||O.type===s.EditorOpenType.diff:!1}function I(O){return O.currentOpenType&&D(O.currentOpenType)}function w(O){return O.index+1}function T(O,M){return!!(!O&&!M||O&&M&&O.uri.isEqual(M.uri))}function R(O,M){return!!(!O&&!M||O&&M&&O.type===M.type&&O.componentId===M.componentId)}function P(O){if(O===E.TextEditorCursorStyle.Line)return"line";if(O===E.TextEditorCursorStyle.Block)return"block";if(O===E.TextEditorCursorStyle.Underline)return"underline";if(O===E.TextEditorCursorStyle.LineThin)return"line-thin";if(O===E.TextEditorCursorStyle.BlockOutline)return"block-outline";if(O===E.TextEditorCursorStyle.UnderlineThin)return"underline-thin";throw new Error("cursorStyleToString: Unknown cursorStyle")}},22869:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadEnv=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(19805),v=e(43718),m=e(83507),_=e(46147),s=e(51328),g=e(49731);let l=class{isSupportedLink(u){return p.HttpOpener.standardSupportedLinkSchemes.has(u.scheme)||u.scheme===this.appConfig.uriScheme}constructor(u,d){this.rpcProtocol=u,this.storage=d,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostEnv),this.eventDispose=this.loggerManger.onDidChangeLogLevel(E=>{this.proxy.$fireChangeLogLevel(E)}),this.setLogLevel(),this.setEnvValues()}async setEnvValues(){const{appName:u,uriScheme:d,appHost:E,appRoot:f,customVSCodeEngineVersion:c}=this.appConfig,y=await this.storage.$getValue(!0,v.firstSessionDateStorageKey);this.proxy.$setEnvValues({customVSCodeEngineVersion:c,appName:u,uriScheme:d,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 u=await this.loggerManger.getGlobalLogLevel();await this.proxy.$setLogLevel(u)}async $clipboardReadText(){try{return await this.clipboardService.readText()}catch{return""}}$clipboardWriteText(u){return new Promise(async d=>{try{await this.clipboardService.writeText(u)}catch{}d()})}async $openExternal(u){return this.isSupportedLink(v.URI.from(u))?await this.openerService.open(u.toString(!0)):!1}getWindowId(){return this.applicationService.windowId}async $asExternalUri(u){const{uriScheme:d}=this.appConfig,E=v.URI.from(u);if(E.scheme===d){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=l,n.__decorate([(0,r.Autowired)(m.ILoggerManagerClient),n.__metadata("design:type",Object)],l.prototype,"loggerManger",void 0),n.__decorate([(0,r.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],l.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(a.IClipboardService),n.__metadata("design:type",Object)],l.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(a.IExternalUriService),n.__metadata("design:type",Object)],l.prototype,"externalUriService",void 0),n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],l.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.IApplicationService),n.__metadata("design:type",Object)],l.prototype,"applicationService",void 0),t.MainThreadEnv=l=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object,g.MainThreadStorage])],l)},13335:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystemEvent=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(68969),v=e(43718),m=e(14951),_=e(52902),s=e(72665),g=e(26199),l=e(46147);let h=class extends v.Disposable{constructor(d){super(),this.rpcProtocol=d,this._proxy=this.rpcProtocol.getProxy(l.ExtHostAPIIdentifier.ExtHostFileSystemEvent),this._dispatchFileEventListener(),this._participateFileOperation(),this._initShowPreview()}_dispatchFileEventListener(){const d={created:[],changed:[],deleted:[]};this.addDispose(this.fileService.onFilesChanged(E=>{let f=!1;for(const c of E)switch(c.type){case m.FileChangeType.ADDED:d.created.push(v.Uri.parse(c.uri)),f=!0;break;case m.FileChangeType.UPDATED:d.changed.push(v.Uri.parse(c.uri)),f=!0;break;case m.FileChangeType.DELETED:d.deleted.push(v.Uri.parse(c.uri)),f=!0;break}f&&(this._proxy.$onFileEvent(d),d.created=[],d.changed=[],d.deleted=[])}))}_participateFileOperation(){this.addDispose(this.workspaceFileService.registerFileOperationParticipant({participate:this.fileOperationParticipant.bind(this)})),this.addDispose(this.workspaceFileService.onDidRunWorkspaceFileOperation(d=>this._proxy.$onDidRunFileOperation(d.operation,d.files)))}_initShowPreview(){this._showPreview=this.preferenceService.get("workbench.refactoringChanges.showPreviewStrategy"),this.addDispose(this.preferenceService.onPreferenceChanged(d=>{d.preferenceName==="workbench.refactoringChanges.showPreviewStrategy"&&(this._showPreview=d.newValue)}))}async fileOperationParticipant(...d){const[E,f,c,y,b]=d,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 I=this._showPreview;const w=D.edit.edits.some(R=>{var P;return(P=R.metadata)===null||P===void 0?void 0:P.needsConfirmation});if(I==="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 P=[(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:P});if(I="show",O===P[1])return}else{const P=[(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:P});if(O===P[1])return;I=O===P[0]?"show":"hide"}}this.logger.log("[onWill-handler] applying additional workspace edit from extensions",D.extensionNames);const T=D?.edit;T&&await this.bulkEditService.apply(_.ResourceEdit.convert(T),{showPreview:I==="show"})}getProgressLabel(d){switch(d){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)(m.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)(a.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(p.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:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadFileSystem=void 0;const r=e(85608),o=e(76003),a=e(8919),p=e(41869),v=e(43163),m=e(42933),_=e(46147),s=e(53043),g=e(34687);let l=n=class{constructor(d){this.rpcProtocol=d,this.disposable=new p.Disposable,this._fileProvider=new Map,this._proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostFileSystem);const E=this.rpcProtocol.getProxy(_.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(d=>d.dispose()),this._fileProvider.clear()}$registerFileSystemProvider(d,E,f){this.disposable.addDispose(this.schemeRegistry.registerFileSystemProvider({scheme:E})),this._fileProvider.set(d,new h(this._fileService,E,f,d,this._proxy))}$unregisterProvider(d){(0,p.dispose)(this._fileProvider.get(d)),this._fileProvider.delete(d)}$onFileSystemChange(d,E){const f=this._fileProvider.get(d);if(!f)throw new Error("Unknown file provider");f.$onFileSystemChange(E)}$stat(d){return this._fileService.getFileStat(p.URI.revive(d).toString()).then(E=>(0,s.toFileStat)(E)).catch(n._handleError)}$readdir(d){return this._fileService.getFileStat(p.URI.revive(d).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 p.URI(f.uri).displayName,n._asFileType(f)]):[]}).catch(n._handleError)}static _asFileType(d){let E=0;return d.type&&d.type===m.FileType.File?E+=m.FileType.File:d.isDirectory&&(E+=m.FileType.Directory),d.isSymbolicLink&&(E+=m.FileType.SymbolicLink),E}$readFile(d){return this._fileService.readFile(p.URI.revive(d).toString()).then(E=>E.content.buffer).catch(n._handleError)}async $writeFile(d,E){try{const f=p.URI.revive(d),c=await this._fileService.getFileStat(f.toString(),!1);c?await this._fileService.setContent(c,E):(await(0,v.ensureDir)(new p.URI(f).path.dir.toString(),{mkdir:y=>this.$mkdir(p.URI.file(y).codeUri),access:y=>this._fileService.access(p.URI.file(y).codeUri.toString())}),await this._fileService.createFile(f.toString(),{content:p.BinaryBuffer.wrap(E).toString()}))}catch(f){return n._handleError(f)}}$rename(d,E,f){return this._fileService.move(p.URI.revive(d).toString(),p.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$copy(d,E,f){return this._fileService.copy(p.URI.revive(d).toString(),p.URI.revive(E).toString(),f).then(()=>{}).catch(n._handleError)}$mkdir(d){return this._fileService.createFolder(p.URI.revive(d).toString()).then(()=>{}).catch(n._handleError)}$delete(d,E){return this._fileService.delete(p.URI.revive(d).toString(),{moveToTrash:E.useTrash}).catch(n._handleError)}static _handleError(d){if(d instanceof m.FileOperationError)switch(d.fileOperationResult){case 1:d.name=g.FileSystemProviderErrorCode.FileNotFound;break;case 0:d.name=g.FileSystemProviderErrorCode.FileIsADirectory;break;case 6:d.name=g.FileSystemProviderErrorCode.NoPermissions;break;case 4:d.name=g.FileSystemProviderErrorCode.FileExists;break}throw d}};t.MainThreadFileSystem=l,r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],l.prototype,"_fileService",void 0),r.__decorate([(0,o.Autowired)(m.IBrowserFileSystemRegistry),r.__metadata("design:type",Object)],l.prototype,"schemeRegistry",void 0),t.MainThreadFileSystem=l=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object])],l);class h{get readonly(){return!!(this.capabilities&2048)}constructor(d,E,f,c,y){this._handle=c,this._proxy=y,this._onDidChange=new p.Emitter,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=p.Event.None,this.capabilities=f,this._registration=d.registerProvider(E,this)}dispose(){this._registration.dispose(),this._onDidChange.dispose()}watch(d,E){const f=Math.random();return this._proxy.$watch(this._handle,f,d,E),f}unwatch(d){this._proxy.$unwatch(this._handle,d)}$onFileSystemChange(d){this._onDidChange.fire(d.map(h._createFileChange))}static _createFileChange(d){return{uri:d.uri,type:d.type}}async stat(d){return await this.doGetStat(d)}async readFile(d){return await this._proxy.$readFile(this._handle,d)}writeFile(d,E,f){return this._proxy.$writeFile(this._handle,d,E,f)}delete(d,E){return this._proxy.$delete(this._handle,d,E)}createDirectory(d){return this._proxy.$mkdir(this._handle,d)}readDirectory(d){return this._proxy.$readdir(this._handle,d)}rename(d,E,f){return this._proxy.$rename(this._handle,d,E,f)}copy(d,E,f){return this._proxy.$copy(this._handle,d,E,f)}async doGetStat(d,E=1){var f;const c=await this._proxy.$stat(this._handle,d),y=(0,s.fromFileStat)(c,d);return y.isDirectory&&(y.children=await this.doGetChildren(d,E)),y.readonly=!!(((f=c.permissions)!==null&&f!==void 0?f:0)&g.FilePermission.Readonly)||!!(this.capabilities&2048),y}async doGetChildren(d,E){if(E<=0)return[];const f=await this.readDirectory(d);return await Promise.all(f.map(y=>new p.URI(d).resolve(y[0])).map(y=>this.doGetStat(y.codeUri,E-1)))}}},89626:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLanguages=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(16885),m=e(54414),_=e(57517),s=n.__importStar(e(20868)),g=e(55218),l=e(62660),h=e(28694),u=e(52902),d=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),I=e(43710),w=e(97673),{extname:T}=p.path;let R=class{_reviveCodeActionDto(O){return O&&O.forEach(M=>this.reviveWorkspaceEditDto(M.edit)),O}constructor(O){this.rpcProtocol=O,this.disposables=new Map,this.languageFeatureEnabled=new p.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 M=this.disposables.get(O);M&&(this.disposables.delete(O),M.dispose())}$getLanguages(){return this.textmateService.getLanguages().map(O=>O.id)}async $changeLanguage(O,M){const k=y.StandaloneServices.get(c.ILanguageService).getLanguageIdByLanguageName(M);if(!k||k!==M)return Promise.reject(new Error(`Unknown language id: ${M}`));const F=new p.URI(p.URI.revive(O)),L=await this.documentModelManager.createModelReference(F);try{L.instance.languageId=M}finally{L.dispose()}}isLanguageFeatureEnabled(O){if(O.uri.scheme===p.Schemes.inMemory)return!1;const M=O.uri.toString();return this.languageFeatureEnabled.has(M)||this.languageFeatureEnabled.set(M,O.getValueLength()<(this.preference.get("editor.languageFeatureEnabledMaxSize")||4*1024*1024*1024)),this.languageFeatureEnabled.get(M)}getUniqueLanguages(){const O=[],M=this.textmateService.getLanguages().map(k=>k.id);for(const k of M)O.indexOf(k)===-1&&O.push(k);return O}$registerHoverProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createHoverProvider(O,k);this.disposables.set(O,d.languageFeaturesService.hoverProvider.register(M,F))}createHoverProvider(O,M){return{provideHover:(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_HOVER);return this.proxy.$provideHoverWithDuration(O,k.uri,F,L).then(({result:U,_dur:W})=>(U&&B.timeEnd(T(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 M=O.split("~|");return Array.isArray(M)&&M.length>1?{label:M[0],description:M[1],detail:M[2]}:O}inflateSuggestDto(O,M){var k,F;if(!this.isDeflatedSuggestDto(M))return M;const L=this.inflateLabel(M[b.ISuggestDataDtoField.label]),B=M[b.ISuggestDataDtoField.range];return{label:L,kind:(k=M[b.ISuggestDataDtoField.kind])!==null&&k!==void 0?k:f.CompletionItemKind.Property,tags:M[b.ISuggestDataDtoField.kindModifier],detail:M[b.ISuggestDataDtoField.detail],documentation:M[b.ISuggestDataDtoField.documentation],sortText:M[b.ISuggestDataDtoField.sortText],filterText:M[b.ISuggestDataDtoField.filterText],preselect:M[b.ISuggestDataDtoField.preselect],insertText:(F=M[b.ISuggestDataDtoField.insertText])!==null&&F!==void 0?F:typeof L=="string"?L:L.label,range:Array.isArray(B)&&B.length===4?E.Range.lift({startLineNumber:B[0],startColumn:B[1],endLineNumber:B[2],endColumn:B[3]}):O,insertTextRules:M[b.ISuggestDataDtoField.insertTextRules],commitCharacters:M[b.ISuggestDataDtoField.commitCharacters],additionalTextEdits:M[b.ISuggestDataDtoField.additionalTextEdits],command:M[b.ISuggestDataDtoField.command],_id:M.x}}$registerCompletionSupport(O,M,k,F){this.disposables.set(O,u.monaco.languages.registerCompletionItemProvider((0,A.fromLanguageSelector)(M),{_debugDisplayName:`ext-${O}`,triggerCharacters:k,provideCompletionItems:async(L,B,U,W)=>{if(!this.isLanguageFeatureEnabled(L))return;const j=this.reporter.time(p.REPORT_NAME.PROVIDE_COMPLETION_ITEMS),Q=await this.proxy.$provideCompletionItems(O,L.uri,B,U,W);return Q?(Q[b.ISuggestResultDtoField.completions].length&&j.timeEnd(T(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,B)=>(this.reporter.point(p.REPORT_NAME.RESOLVE_COMPLETION_ITEM),this.proxy.$resolveCompletionItem(O,L._id,B).then(U=>{if(!U)return L;const W=this.inflateSuggestDto(L.range,U);return(0,I.mixin)(L,W,!0)})):void 0}))}$registerInlineCompletionsSupport(O,M,k,F,L){const B={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,u.monaco.languages.registerInlineCompletionsProvider((0,A.fromLanguageSelector)(M),B))}$registerInlineEditProvider(O,M,k,F){const L={displayName:F,provideInlineEdit:async(B,U,W)=>this.proxy.$provideInlineEdit(O,B.uri,U,W),freeInlineEdit:B=>{this.proxy.$freeInlineEdit(O,B.pid)}};this.disposables.set(O,u.monaco.languages.registerInlineEditProvider((0,A.fromLanguageSelector)(M),L))}matchLanguage(O,M){return Array.isArray(O)?O.some(k=>this.matchLanguage(k,M)):(0,D.isDocumentFilter)(O)?!O.language&&(O.pattern||O.scheme)?!0:O?.language===M:O===M}matchModel(O,M){return Array.isArray(O)?O.some(k=>this.matchModel(k,M)):(0,D.isDocumentFilter)(O)?!(O.language&&O.language!==M.languageId||O.scheme&&O.scheme!==M.uri.scheme||O.pattern&&!(0,b.testGlob)(O.pattern,M.uri.path)):O===M.languageId}$registerDefinitionProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDefinitionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDefinitionProvider(k,F))}$registerDeclarationProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=new p.DisposableCollection;for(const L of this.getUniqueLanguages())this.matchLanguage(k,L);this.disposables.set(O,F)}createDefinitionProvider(O,M){return{provideDefinition:async(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DEFINITION),{result:U,_dur:W}=await this.proxy.$provideDefinitionWithDuration(O,k.uri,F,L);if(U)if(B.timeEnd(T(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,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createTypeDefinitionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerTypeDefinitionProvider(k,F))}createTypeDefinitionProvider(O,M){return{provideTypeDefinition:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_TYPE_DEFINITION);return this.proxy.$provideTypeDefinition(O,k.uri,F,L).then(U=>{if(U)if(B.timeEnd(T(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,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createFoldingRangeProvider(O,F);if(typeof k=="number"){const B=new p.Emitter;this.disposables.set(k,B),L.onDidChange=B.event}this.disposables.set(O,u.monaco.languages.registerFoldingRangeProvider(F,L))}$emitFoldingRangeEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}createFoldingRangeProvider(O,M){return{provideFoldingRanges:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_FOLDING_RANGES);return this.proxy.$provideFoldingRange(O,k.uri,F,L).then(U=>(U&&B.timeEnd(T(k.uri.fsPath)),U))}}}$registerDocumentColorProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createColorProvider(O,k);this.disposables.set(O,u.monaco.languages.registerColorProvider(k,F))}createColorProvider(O,M){return{provideDocumentColors:(k,F)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_COLORS);return this.proxy.$provideDocumentColors(O,k.uri,F).then(B=>(L.timeEnd(T(k.uri.fsPath)),B.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 B=this.reporter.time(p.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&&B.timeEnd(T(k.uri.fsPath)),U))}}}$registerDocumentHighlightProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDocumentHighlightProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDocumentHighlightProvider(k,F))}createDocumentHighlightProvider(O,M){return{provideDocumentHighlights:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_HIGHLIGHTS);return this.proxy.$provideDocumentHighlights(O,k.uri,F,L).then(U=>{if(U&&Array.isArray(U)){B.timeEnd(T(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,M,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentFormattingEditProvider(O,M,F);this.disposables.set(O,u.monaco.languages.registerDocumentFormattingEditProvider(F,L))}createDocumentFormattingEditProvider(O,M,k){return{displayName:M.displayName,extensionId:M.id,provideDocumentFormattingEdits:async(F,L)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_FORMATTING_EDITS);return this.proxy.$provideDocumentFormattingEdits(O,F.uri,L).then(U=>{if(B.timeEnd(T(F.uri.fsPath)),!!U)return U})}}}$registerRangeFormattingProvider(O,M,k){const F=(0,A.fromLanguageSelector)(k);if(!F)return;const L=this.createDocumentRangeFormattingEditProvider(O,M,F);this.disposables.set(O,u.monaco.languages.registerDocumentRangeFormattingEditProvider(F,L))}createDocumentRangeFormattingEditProvider(O,M,k){return{displayName:M.displayName,extensionId:M.id,provideDocumentRangeFormattingEdits:async(F,L,B)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(k,b.MonacoModelIdentifier.fromModel(F)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_RANGE_FORMATTING_EDITS);return this.proxy.$provideDocumentRangeFormattingEdits(O,F.uri,L,B).then(W=>{if(U.timeEnd(T(F.uri.fsPath)),!!W)return W})}}}$registerOnTypeFormattingProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createOnTypeFormattingProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerOnTypeFormattingEditProvider(F,L))}createOnTypeFormattingProvider(O,M,k){return{autoFormatTriggerCharacters:k,provideOnTypeFormattingEdits:async(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_ON_TYPE_FORMATTING_EDITS);return this.proxy.$provideOnTypeFormattingEditsWithDuration(O,F.uri,L,B,U).then(({result:j,_dur:Q})=>(j&&W.timeEnd(T(F.uri.fsPath),{extDuration:Q}),j))}}}$registerCodeLensSupport(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createCodeLensProvider(O,F);if(typeof k=="number"){const B=new p.Emitter;this.disposables.set(k,B),L.onDidChange=B.event}this.disposables.set(O,u.monaco.languages.registerCodeLensProvider(F,L))}createCodeLensProvider(O,M){return{provideCodeLenses:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_CODE_LENSES);return this.proxy.$provideCodeLenses(O,k.uri,F).then(B=>(B&&L.timeEnd(T(k.uri.fsPath)),{lenses:B?.lenses||[],dispose:()=>B?.cacheId&&this.proxy.$releaseCodeLens(O,B.cacheId)}))},resolveCodeLens:async(k,F,L)=>{if(this.isLanguageFeatureEnabled(k))return this.reporter.point(p.REPORT_NAME.RESOLVE_CODE_LENS),this.proxy.$resolveCodeLens(O,F,L).then(B=>B)}}}$emitCodeLensEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$clearDiagnostics(O){this.markerManager.clearMarkers(O)}$changeDiagnostics(O,M){for(const[k,F]of M)this.markerManager.updateMarkers(O,k,F)}$registerImplementationProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createImplementationProvider(O,k);this.disposables.set(O,u.monaco.languages.registerImplementationProvider(k,F))}$registerDocumentLinkProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createLinkProvider(O,k);this.disposables.set(O,u.monaco.languages.registerLinkProvider(F,L))}createImplementationProvider(O,M){return{provideImplementation:(k,F,L)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_IMPLEMENTATION);return this.proxy.$provideImplementationWithDuration(O,k.uri,F).then(({result:U,_dur:W})=>{if(U)if(B.timeEnd(T(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,M,k,F,L){const B=(0,A.fromLanguageSelector)(M);if(!B)return;const U=this.createQuickFixProvider(O,B,k,F,L);this.disposables.set(O,d.languageFeaturesService.codeActionProvider.register(B,U))}createQuickFixProvider(O,M,k,F,L){const B={provideCodeActions:async(U,W,j,Q)=>{if(!this.isLanguageFeatureEnabled(U)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(U)))return;const G=this.reporter.time(p.REPORT_NAME.PROVIDE_CODE_ACTIONS),Z=await this.proxy.$provideCodeActions(O,U.uri,W,j,Q).then($=>(G.timeEnd(T(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&&(B.resolveCodeAction=async(U,W)=>{const j=await this.proxy.$resolveCodeAction(O,U.cacheId,W);return U.edit=this.reviveWorkspaceEditDto(j),U}),B}createLinkProvider(O,M){const k={provideLinks:(F,L)=>{if(!this.isLanguageFeatureEnabled(F))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_LINKS);return this.proxy.$provideDocumentLinks(O,F.uri,L).then(U=>U?(B.timeEnd(T(F.uri.fsPath)),{links:U.links.map(j=>this.reviveLink(j)),dispose:()=>{U.id&&this.proxy.$releaseDocumentLinks(O,U.id)}}):void 0)}};return M&&(k.resolveLink=(F,L)=>{const B=F;return B.cacheId?this.proxy.$resolveDocumentLink(O,B.cacheId,L).then(U=>{if(U)return this.reviveLink(U)}):F}),k}reviveLink(O){return O.url&&typeof O.url!="string"&&(O.url=p.URI.revive(O.url)),O}$setLanguageConfiguration(O,M,k){const F={comments:k.comments,brackets:k.brackets,wordPattern:(0,I.reviveRegExp)(k.wordPattern),indentationRules:(0,I.reviveIndentationRule)(k.indentationRules),onEnterRules:(0,I.reviveOnEnterRules)(k.onEnterRules),autoClosingPairs:k.autoClosingPairs};this.disposables.set(O,u.monaco.languages.setLanguageConfiguration(M,F))}$registerReferenceProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createReferenceProvider(O,k);this.disposables.set(O,u.monaco.languages.registerReferenceProvider(k,F))}createReferenceProvider(O,M){return{provideReferences:(k,F,L,B)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_REFERENCES);return this.proxy.$provideReferencesWithDuration(O,k.uri,F,L,B).then(({result:W,_dur:j})=>{if(W&&Array.isArray(W)){U.timeEnd(T(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 M=this.createWorkspaceSymbolProvider(O);this.disposables.set(O,this.languageService.registerWorkspaceSymbolProvider(M))}createWorkspaceSymbolProvider(O){return{provideWorkspaceSymbols:(M,k)=>this.proxy.$provideWorkspaceSymbols(O,M.query,k),resolveWorkspaceSymbol:(M,k)=>this.proxy.$resolveWorkspaceSymbol(O,M,k)}}$registerOutlineSupport(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createDocumentSymbolProvider(O,k);this.disposables.set(O,u.monaco.languages.registerDocumentSymbolProvider(k,F))}createDocumentSymbolProvider(O,M){return{provideDocumentSymbols:(k,F)=>{if(!this.isLanguageFeatureEnabled(k))return;const L=this.reporter.time(p.REPORT_NAME.PROVIDE_DOCUMENT_SYMBOLS);return this.proxy.$provideDocumentSymbols(O,k.uri,F).then(B=>(B&&L.timeEnd(T(k.uri.fsPath)),B))}}}$registerSignatureHelpProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createSignatureHelpProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerSignatureHelpProvider(F,L))}createSignatureHelpProvider(O,M,k){return{signatureHelpTriggerCharacters:k.triggerCharacters,signatureHelpRetriggerCharacters:k.retriggerCharacters,provideSignatureHelp:(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_SIGNATURE_HELP);return this.proxy.$provideSignatureHelp(O,F.uri,L,U,B).then(j=>{if(j)return W.timeEnd(T(F.uri.fsPath)),{value:j,dispose:()=>j.id&&this.proxy.$releaseSignatureHelp(O,j.id)}})}}}$registerRenameProvider(O,M,k){const F=(0,A.fromLanguageSelector)(M);if(!F)return;const L=this.createRenameProvider(O,F,k);this.disposables.set(O,u.monaco.languages.registerRenameProvider(F,L))}createRenameProvider(O,M,k){return{provideRenameEdits:(F,L,B,U)=>{if(!this.isLanguageFeatureEnabled(F)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return;const W=this.reporter.time(p.REPORT_NAME.PROVIDE_RENAME_EDITS);return this.proxy.$provideRenameEdits(O,F.uri,L,B,U).then(j=>(j&&W.timeEnd(T(F.uri.fsPath)),this.reviveWorkspaceEditDto(j)))},resolveRenameLocation:k?(F,L,B)=>{if(this.isLanguageFeatureEnabled(F)&&this.matchModel(M,b.MonacoModelIdentifier.fromModel(F)))return this.proxy.$resolveRenameLocation(O,F.uri,L,B).then(U=>U)}:void 0}}createNewSymbolNamesProvider(O,M){return{provideNewSymbolNames:(k,F,L,B)=>{if(!this.isLanguageFeatureEnabled(k)||!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k)))return;const U=this.reporter.time(p.REPORT_NAME.PROVIDE_NEW_SYMBOL_NAMES);return this.proxy.$provideNewSymbolNames(O,k.uri,F,L,B).then(W=>(W&&U.timeEnd(T(k.uri.fsPath)),W))}}}$registerNewSymbolNamesProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createNewSymbolNamesProvider(O,k);this.disposables.set(O,u.monaco.languages.registerNewSymbolNameProvider(k,F))}reviveWorkspaceEditDto(O){if(O&&O.edits)for(const M of O.edits)typeof M.resource=="object"?M.resource=s.Uri.revive(M.resource):(M.newResource=s.Uri.revive(M.newResource),M.oldResource=s.Uri.revive(M.oldResource));return O}$registerSelectionRangeProvider(O,M){const k=(0,A.fromLanguageSelector)(M);if(!k)return;const F=this.createSelectionProvider(O,k);this.disposables.set(O,u.monaco.languages.registerSelectionRangeProvider(k,F))}createSelectionProvider(O,M){return{provideSelectionRanges:(k,F,L)=>{if(!this.matchModel(M,b.MonacoModelIdentifier.fromModel(k))||!this.isLanguageFeatureEnabled(k))return;const B=this.reporter.time(p.REPORT_NAME.PROVIDE_SELECTION_RANGES);return this.proxy.$provideSelectionRanges(O,k.uri,F,L).then(U=>(B.timeEnd(T(k.uri.fsPath)),U))}}}$registerCallHierarchyProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createCallHierarchyProvider(O,k);this.callHierarchyService.registerCallHierarchyProvider(M,F)}reviveCallHierarchyItemDto(O){return O&&(O.uri=p.URI.revive(O.uri)),O}createCallHierarchyProvider(O,M){return{prepareCallHierarchy:async(k,F,L)=>{const B=await this.proxy.$prepareCallHierarchy(O,k.uri,F,L);if(B)return{dispose:()=>{for(const U of B)this.proxy.$releaseCallHierarchy(O,U._sessionId)},roots:B.map(this.reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyOutgoingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(B=>{B.to=this.reviveCallHierarchyItemDto(B.to)}),L)},provideIncomingCalls:async(k,F)=>{const L=await this.proxy.$provideCallHierarchyIncomingCalls(O,k._sessionId,k._itemId,F);return L&&(L.forEach(B=>{B.from=this.reviveCallHierarchyItemDto(B.from)}),L)}}}$registerTypeHierarchyProvider(O,M){const k=(0,A.fromLanguageSelector)(M),F=this.createTypeHierarchyProvider(O,k);this.typeHierarchyService.registerTypeHierarchyProvider(M,F)}createTypeHierarchyProvider(O,M){return{prepareTypeHierarchy:async(k,F,L)=>{const B=await this.proxy.$prepareTypeHierarchy(O,k.uri,F,L);if(B)return{dispose:()=>{for(const U of B)this.proxy.$releaseTypeHierarchy(O,U._sessionId)},roots:B.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=p.URI.revive(O.uri)),O}$registerDocumentSemanticTokensProvider(O,M,k){const F=new w.DocumentSemanticTokensProvider(this.proxy,O,k);this.disposables.set(O,d.languageFeaturesService.documentSemanticTokensProvider.register((0,A.fromLanguageSelector)(M),F))}$registerDocumentRangeSemanticTokensProvider(O,M,k){const F=new w.DocumentRangeSemanticTokensProviderImpl(this.proxy,O,k);this.disposables.set(O,d.languageFeaturesService.documentRangeSemanticTokensProvider.register((0,A.fromLanguageSelector)(M),F))}$registerEvaluatableExpressionProvider(O,M){const k={provideEvaluatableExpression:(F,L,B)=>this.proxy.$provideEvaluatableExpression(O,F.uri,L,B)};this.disposables.set(O,this.evaluatableExpressionService.registerEvaluatableExpressionProvider(M,k))}$registerInlineValuesProvider(O,M,k){const F={provideInlineValues:(L,B,U,W)=>this.proxy.$provideInlineValues(O,L.uri,B,U,W)};if(typeof k=="number"){const L=new p.Emitter;this.disposables.set(k,L),F.onDidChangeInlineValues=L.event}this.disposables.set(O,d.languageFeaturesService.inlineValuesProvider.register(M,F))}$emitInlineValuesEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$registerLinkedEditingRangeProvider(O,M){const k=(0,A.fromLanguageSelector)(M);d.languageFeaturesService.linkedEditingRangeProvider.register(k,{provideLinkedEditingRanges:async(F,L,B)=>{const U=await this.proxy.$provideLinkedEditingRanges(O,F.uri,L,B);if(U)return{ranges:U.ranges,wordPattern:U.wordPattern?(0,I.reviveRegExp)(U.wordPattern):void 0}}})}$registerInlayHintsProvider(O,M,k,F){const L={provideInlayHints:async(B,U,W)=>{const j=await this.proxy.$provideInlayHints(O,B.uri,U,W);if(j)return{hints:(0,p.revive)(j?.hints),dispose:()=>{j.cacheId&&this.proxy.$releaseInlayHints(O,j.cacheId)}}}};if(k&&(L.resolveInlayHint=async(B,U)=>{const W=B;if(!W.cacheId)return B;const j=await this.proxy.$resolveInlayHint(O,W.cacheId,U);if(U.isCancellationRequested)throw new S.CancellationError;return j?{...B,tooltip:j.tooltip,label:(0,p.revive)(j.label)}:B}),typeof F=="number"){const B=new p.Emitter;this.disposables.set(F,B),L.onDidChangeInlayHints=B.event}this.disposables.set(O,d.languageFeaturesService.inlayHintsProvider.register(M,L))}$emitInlayHintsEvent(O,M){const k=this.disposables.get(O);k instanceof p.Emitter&&k.fire(M)}$setLanguageStatus(O,M){var k;(k=this._status.get(O))===null||k===void 0||k.dispose(),this._status.set(O,this.languageStatusService.addStatus(M))}$removeLanguageStatus(O){var M;(M=this._status.get(O))===null||M===void 0||M.dispose()}};t.MainThreadLanguages=R,n.__decorate([(0,r.Autowired)(p.MarkerManager),n.__metadata("design:type",p.MarkerManager)],R.prototype,"markerManager",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],R.prototype,"preference",void 0),n.__decorate([(0,r.Autowired)(a.IReporterService),n.__metadata("design:type",Object)],R.prototype,"reporter",void 0),n.__decorate([(0,r.Autowired)(m.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)(_.IEditorDocumentModelService),n.__metadata("design:type",Object)],R.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(_.ILanguageStatusService),n.__metadata("design:type",Object)],R.prototype,"languageStatusService",void 0),n.__decorate([(0,r.Autowired)(l.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadLocalization=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(14951),v=e(99220),m=e(46147),_=e(51328);let s=class{constructor(l){this.rpcProtocol=l,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostLocalization),this.currentLanguage=this.preferenceService.get("general.language","en").toLocaleLowerCase(),this.proxy.$setCurrentLanguage(this.currentLanguage)}async $fetchBuiltInBundleUri(l,h){try{const u=await this.extensionNodeClient.getLanguagePack(h||this.currentLanguage);return u&&u.translations[l]?_.Uri.file(u.translations[l]):void 0}catch{return}}async $fetchBundleContents(l){return(await this.fileService.readFile(_.Uri.revive(l).fsPath.toString())).content.toString()}};t.MainThreadLocalization=s,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileService",void 0),n.__decorate([(0,r.Autowired)(a.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:(x,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),a=e(71742);let p=class{$getLevel(){return this.logger.getLevel()}$setLevel(_){return this.logger.setLevel(_)}async $verbose(..._){return this.logger.verbose(..._)}async $debug(..._){return this.logger.debug(..._)}async $log(..._){return this.logger.log(..._)}async $warn(..._){return this.logger.warn(..._)}async $error(..._){return this.logger.error(..._)}async $critical(..._){return this.logger.critical(..._)}$dispose(){return this.logger.dispose()}};t.MainThreadExtensionLog=p,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),t.MainThreadExtensionLog=p=n.__decorate([(0,r.Injectable)()],p);function v(m,_){m.set(a.MainThreadExtensionLogIdentifier,_.get(p))}},48721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadMessage=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(72665),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostMessage)}dispose(){}async $showMessage(_,s,g,l,h){const u=g.modal?await this.dialogService.open({message:s,type:_,buttons:l,options:g}):await this.messageService.open({message:s,type:_,buttons:l,closable:!0,from:h});return u?l.indexOf(u):void 0}};t.MainThreadMessage=v,n.__decorate([(0,r.Autowired)(a.IDialogService),n.__metadata("design:type",Object)],v.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadExtensionNotebook=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(54414),v=e(46147);let m=class extends a.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=m,n.__decorate([(0,r.Autowired)(p.INotebookService),n.__metadata("design:type",Object)],m.prototype,"notebookService",void 0),t.MainThreadExtensionNotebook=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},39261:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadOutput=void 0;const n=e(85608),r=e(76003),o=e(63067),a=e(83145);let p=class{constructor(){this.channels=new Map}dispose(){this.channels.forEach(m=>{this.outputService.deleteChannel(m.name)}),this.channels.clear()}$replace(m,_){const s=this.getChannel(m);return s&&(s.clear(),s.append(_)),Promise.resolve()}$append(m,_){const s=this.getChannel(m);return s&&s.append(_),Promise.resolve()}$appendLine(m,_){const s=this.getChannel(m);return s&&s.appendLine(_),Promise.resolve()}$clear(m){const _=this.getChannel(m);return _&&_.clear(),Promise.resolve()}$dispose(m){return this.outputService.deleteChannel(m),this.channels.has(m)&&this.channels.delete(m),Promise.resolve()}async $reveal(m,_){const s=this.getChannel(m);s&&(s.setVisibility(!0),this.outputService.updateSelectedChannel(s))}$close(m){const _=this.getChannel(m);return _&&_.setVisibility(!1),Promise.resolve()}getChannel(m){let _;return this.channels.has(m)?_=this.channels.get(m):(_=this.outputService.getChannel(m),this.channels.set(m,_)),_}async $setLanguageId(m,_){const s=this.getChannel(m);s&&await s.setLanguageId(_)}};t.MainThreadOutput=p,n.__decorate([(0,r.Autowired)(a.OutputService),n.__metadata("design:type",a.OutputService)],p.prototype,"outputService",void 0),n.__decorate([(0,r.Autowired)(o.IMainLayoutService),n.__metadata("design:type",Object)],p.prototype,"layoutService",void 0),t.MainThreadOutput=p=n.__decorate([(0,r.Injectable)({multiple:!0})],p)},87781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadPreference=void 0,t.getPreferences=m;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(51500),v=e(46147);function m(s,g){const l=g.map(h=>h.uri.toString());return a.PreferenceScope.getScopes().reduce((h,u)=>{h[u]={};const d=s(u);if(u===a.PreferenceScope.Folder)for(const E of l){const f=d.getPreferences(E);h[u][E]=f}else{h[u]=d.getPreferences();const E=d.getLanguagePreferences();E&&Object.keys(E).forEach(f=>{h[u][`[${f}]`]=E[f]})}return h},{})}let _=class{constructor(g){this.rpcProtocol=g,this.toDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostPreference),this.toDispose.push(this.preferenceService.onPreferencesChanged(l=>{const h=this.workspaceService.tryGetRoots(),u=m(this.preferenceProviderProvider,h),d=[];for(const E of Object.keys(l)){const{newValue:f}=l[E];d.push({preferenceName:E,newValue:f})}this.proxy.$acceptConfigurationChanged(u,d)})),this.initializeConfiguration(),this.toDispose.push(this.preferenceSchemaProvider.onDidPreferenceSchemaChanged(()=>{this.initializeConfiguration()}))}dispose(){this.toDispose.dispose()}async initializeConfiguration(){const g=this.workspaceService.tryGetRoots(),l=m(this.preferenceProviderProvider,g);this.proxy.$initializeConfiguration(l)}async $updateConfigurationOption(g,l,h,u){const d=this.parseConfigurationTarget(g);await this.preferenceService.set(l,h,d,u)}async $removeConfigurationOption(g,l,h){const u=this.parseConfigurationTarget(g);await this.preferenceService.set(l,void 0,u,h)}parseConfigurationTarget(g){if(typeof g=="boolean")return g?a.PreferenceScope.User:a.PreferenceScope.Workspace;switch(g){case v.ConfigurationTarget.Global:return a.PreferenceScope.User;case v.ConfigurationTarget.Workspace:return a.PreferenceScope.Workspace;case v.ConfigurationTarget.WorkspaceFolder:return a.PreferenceScope.Folder;default:return}}};t.MainThreadPreference=_,n.__decorate([(0,r.Autowired)(a.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceProviderProvider),n.__metadata("design:type",Function)],_.prototype,"preferenceProviderProvider",void 0),n.__decorate([(0,r.Autowired)(a.PreferenceSchemaProvider),n.__metadata("design:type",a.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),t.MainThreadPreference=_=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],_)},79813:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadQuickOpen=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(8919),p=e(41869),v=e(74404),m=e(97821),_=e(78245),s=e(50426),g=e(44854),l=e(46147);let h=class extends p.Disposable{constructor(d){super(),this.rpcProtocol=d,this.createdInputBox=new Map,this.proxy=this.rpcProtocol.getProxy(l.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(d,E,f){return this.quickPickService.show(E,{...f,onSelect:(c,y)=>{this.proxy.$onItemSelected(E[y].value)},onChangeValue:c=>{this.proxy.$onDidChangeValue(d,c)}})}$hideQuickPick(){this.quickPickService.hide()}severityToValidateType(d){switch(d){case l.Severity.Info:return o.VALIDATE_TYPE.INFO;case l.Severity.Warning:return o.VALIDATE_TYPE.WARNING;case l.Severity.Error:return o.VALIDATE_TYPE.ERROR;case l.Severity.Ignore:return o.VALIDATE_TYPE.IGNORE;default:return o.VALIDATE_TYPE.ERROR}}$showQuickInput(d,E){return E&&(d.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(d)}$createOrUpdateInputBox(d,E){const f={...E,validationType:this.severityToValidateType(E?.severity)};if(this.createdInputBox.has(d)){const c=this.createdInputBox.get(d);c?.updateOptions(f)}else{const c=this.injector.get(g.InputBoxImpl,[f]);c.open(),c.onDidChangeValue(y=>{this.proxy.$onCreatedInputBoxDidChangeValue(d,y)}),c.onDidAccept(()=>{this.proxy.$onCreatedInputBoxDidAccept(d)}),c.onDidHide(()=>{this.proxy.$onCreatedInputBoxDidHide(d)}),c.onDidTriggerButton(y=>{this.proxy.$onCreatedInputBoxDidTriggerButton(d,y)}),this.createdInputBox.set(d,c)}}$updateQuickPick(d){this.quickPickService.updateOptions(d)}$hideInputBox(d){if(this.createdInputBox.has(d)){const E=this.createdInputBox.get(d);E?.hide()}}$disposeInputBox(d){if(this.createdInputBox.has(d)){const E=this.createdInputBox.get(d);E?.dispose(),this.createdInputBox.delete(d)}}$hideQuickInput(){this.quickInputService.hide()}};t.MainThreadQuickOpen=h,n.__decorate([(0,r.Autowired)(m.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)(_.QuickOpenItemService),n.__metadata("design:type",_.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)(a.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],h)},33111:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSCM=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(64964),m=e(46147);class _{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 p.Emitter,this.onDidSplice=this._onDidSplice.event,this._onDidChange=new p.Emitter,this.onDidChange=this._onDidChange.event}toJSON(){return{$mid:4,sourceControlHandle:this.sourceControlHandle,groupHandle:this.handle}}splice(f,c,y){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}))}$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,I,w){this.proxy=f,this.sourceControlHandle=c,this.groupHandle=y,this.handle=b,this.sourceUri=A,this.resourceGroup=S,this.decorations=D,this.contextValue=I,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(p.Uri.isUri(E.icon))return p.Uri.revive(E.icon);{const f=E.icon;return{light:p.Uri.revive(f.light),dark:p.Uri.revive(f.dark)}}}else return}class l{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 p.Emitter,this.onDidChangeActionButton=this._onDidChangeActionButton.event,this._onDidChangeCurrentHistoryItemGroup=new p.Emitter,this.onDidChangeCurrentHistoryItemGroup=this._onDidChangeCurrentHistoryItemGroup.event}async resolveHistoryItemGroupBase(f){return this.proxy.$resolveHistoryItemGroupBase(this.handle,f,p.CancellationToken.None)}async resolveHistoryItemGroupCommonAncestor(f,c){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,f,c,p.CancellationToken.None)}async provideHistoryItems(f,c){const y=await this.proxy.$provideHistoryItems(this.handle,f,c,p.CancellationToken.None);return y?.map(b=>({...b,icon:g(b)}))}async provideHistoryItemChanges(f){const c=await this.proxy.$provideHistoryItemChanges(this.handle,f,p.CancellationToken.None);return c?.map(y=>({uri:p.Uri.revive(y.uri),originalUri:y.originalUri&&p.Uri.revive(y.originalUri),modifiedUri:y.modifiedUri&&p.Uri.revive(y.modifiedUri),renameUri:y.renameUri&&p.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 p.Sequence,this._groupsByHandle=Object.create(null),this._onDidChangeResources=new p.Emitter,this.onDidChangeResources=this._onDidChangeResources.event,this.features={},this._onDidChangeCommitTemplate=new p.Emitter,this.onDidChangeCommitTemplate=this._onDidChangeCommitTemplate.event,this._onDidChangeStatusBarCommands=new p.Emitter,this._onDidChangeHistoryProvider=new p.Emitter,this.onDidChangeHistoryProvider=this._onDidChangeHistoryProvider.event,this._onDidChange=new p.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 l(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 _(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 I=D.map(w=>{const[T,R,P,O,M,k,F,L]=w,B=P[0],U=P[1]||B,W={icon:B?p.Uri.parse(B):void 0,iconDark:U?p.Uri.parse(U):void 0,tooltip:O,strikeThrough:M,faded:k};return new s(this.proxy,this.handle,c,T,p.Uri.revive(R),b,W,F||void 0,L)});b.splice(A,S,I)}}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,p.CancellationToken.None);return c&&p.Uri.revive(c)}toJSON(){return{$mid:5,handle:this.handle}}dispose(){}}h.ID_HANDLE=0,n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0);let u=class extends p.Disposable{constructor(f){super(),this.rpcProtocol=f,this._repositories=new Map,this._inputDisposables=new Map,this._proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostSCM),p.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&&p.Uri.revive(b)),S=this.scmService.registerSCMProvider(A);this._repositories.set(f,S);const D=S.input.onDidChange(I=>this._proxy.$onInputBoxValueChange(f,I));this._inputDisposables.set(f,D),this.addDispose(p.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(p.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:d(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=u,n.__decorate([(0,r.Autowired)(v.SCMService),n.__metadata("design:type",v.SCMService)],u.prototype,"scmService",void 0),t.MainThreadSCM=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(o.IRPCProtocol)),n.__metadata("design:paramtypes",[Object])],u);function d(E){if(E.icon){if(p.Uri.isUri(E.icon))return p.Uri.revive(E.icon);{const f=E.icon;return{light:p.Uri.revive(f.light),dark:p.Uri.revive(f.dark)}}}else return}},62876:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadSecret=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(46147);let m=class extends a.Disposable{constructor(s){super(),this._proxy=s.getProxy(v.ExtHostAPIIdentifier.ExtHostSecret),this.addDispose(this.credentialsService.onDidChangePassword(g=>{const l=g.service.substring(this.appConfig.uriScheme.length);this._proxy.$onDidChangePassword({extensionId:l,key:g.account})}))}getFullKey(s){return`${this.appConfig.uriScheme}${s}`}async $getPassword(s,g){const l=this.getFullKey(s),h=await this.credentialsService.getPassword(l,g),u=h&&await this.cryptoService.decrypt(h);if(u)try{const d=JSON.parse(u);if(d.extensionId===s)return d.content}catch{throw new Error("Cannot get password")}}async $setPassword(s,g,l){const h=this.getFullKey(s),u=JSON.stringify({extensionId:s,content:l}),d=await this.cryptoService.encrypt(u);return this.credentialsService.setPassword(h,g,d)}async $deletePassword(s,g){try{const l=this.getFullKey(s);await this.credentialsService.deletePassword(l,g)}catch{throw new Error("Cannot delete password")}}};t.MainThreadSecret=m,n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],m.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(a.ICredentialsService),n.__metadata("design:type",Object)],m.prototype,"credentialsService",void 0),n.__decorate([(0,r.Autowired)(p.ICryptoService),n.__metadata("design:type",Object)],m.prototype,"cryptoService",void 0),t.MainThreadSecret=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},93633:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStatusBar=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(26542),v=e(71298),m=e(46147),_=n.__importStar(e(51328));let s=class{constructor(l){this.rpcProtocol=l,this.disposable=new a.Disposable,this.proxy=this.rpcProtocol.getProxy(m.ExtHostAPIIdentifier.ExtHostStatusBar)}dispose(){this.disposable.dispose()}$setStatusBarMessage(l){this.disposable.addDispose(this.statusBar.addElement("ext_default_statusbar_text",{text:l,alignment:p.StatusBarAlignment.LEFT}))}$dispose(l){l?this.statusBar.removeElement(l):this.statusBar.removeElement("ext_default_statusbar_text")}$createStatusBarItem(l,h,u,d){this.disposable.addDispose(this.statusBar.addElement(l,{id:h,alignment:u,priority:d}))}async $setMessage(l,h,u,d,E,f,c,y,b,A,S,D){const I=A?.label||(0,v.getCodiconAriaLabel)(d),w={id:h,name:u,text:d||"",priority:E,alignment:f===_.StatusBarAlignment.Left?p.StatusBarAlignment.LEFT:p.StatusBarAlignment.RIGHT,color:c,backgroundColor:y,tooltip:b,command:S,arguments:D,role:A?.role,ariaLabel:I};this.disposable.addDispose(this.statusBar.addElement(l,w))}};t.MainThreadStatusBar=s,n.__decorate([(0,r.Autowired)(a.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(p.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadStorage=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(50492),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.ExtHostAPIIdentifier.ExtHostStorage),this.init()}dispose(){}async init(){await this.extensionStorageService.whenReady,this.proxy.$acceptStoragePath(this.extensionStorageService.extensionStoragePath)}$setValue(_,s,g){try{this.extensionStorageService.set(s,g,_)}catch(l){return Promise.reject(l)}return Promise.resolve(void 0)}$getValue(_,s){try{return Promise.resolve(this.extensionStorageService.get(s,_))}catch(g){return Promise.reject(g)}}};t.MainThreadStorage=v,n.__decorate([(0,r.Autowired)(a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTasks=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(43718),p=e(93950),v=e(1041),m=e(51500),_=e(46147),s=e(54741);var g;(function(R){function P(O){const M=O;return M&&(0,a.isString)(M.id)&&!!M.workspaceFolder}R.is=P})(g||(g={}));var l;(function(R){function P(O){return{id:O.id,task:w.from(O.task)}}R.from=P})(l||(l={}));var h;(function(R){function P(O,M){return{id:O.id,processId:M}}R.from=P})(h||(h={}));var u;(function(R){function P(O,M){return{id:O.id,exitCode:M}}R.from=P})(u||(u={}));var d;(function(R){function P(M){const k=Object.assign(Object.create(null),M);return delete k._key,k}R.from=P;function O(M,k,F){let L=F.createTaskIdentifier(M,console);return L===void 0&&k&&(L={_key:(0,a.uuid)(),type:"$executeOnly"}),L}R.to=O})(d||(d={}));var E;(function(R){function P(M){if(M!=null)return Object.assign(Object.create(null),M)}R.from=P;function O(M){return M==null?v.PresentationOptions.defaults:Object.assign(Object.create(null),v.PresentationOptions.defaults,M)}R.to=O})(E||(E={}));var f;(function(R){function P(M){if(M!=null)return Object.assign(Object.create(null),M)}R.from=P;function O(M){return M==null?v.RunOptions.defaults:Object.assign(Object.create(null),v.RunOptions.defaults,M)}R.to=O})(f||(f={}));var c;(function(R){function P(M){if(M!=null)return{cwd:M.cwd,env:M.env}}R.from=P;function O(M){return M==null?v.CommandOptions.defaults:{cwd:M.cwd||v.CommandOptions.defaults.cwd,env:M.env}}R.to=O})(c||(c={}));var y;(function(R){function P(k){const F=k;return F&&!!F.process}R.is=P;function O(k){const F=(0,a.isString)(k.name)?k.name:k.name.value,L=k.args?k.args.map(U=>(0,a.isString)(U)?U:U.value):[],B={process:F,args:L};return k.options&&(B.options=c.from(k.options)),B}R.from=O;function M(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=M})(y||(y={}));var b;(function(R){function P(M){if(M==null)return;const k={cwd:M.cwd||v.CommandOptions.defaults.cwd,env:M.env};return M.shell&&(k.executable=M.shell.executable,k.shellArgs=M.shell.args,k.shellQuoting=M.shell.quoting),k}R.from=P;function O(M){if(M==null)return;const k={cwd:M.cwd,env:M.env};return M.executable&&(k.shell={executable:M.executable},M.shellArgs&&(k.shell.args=M.shellArgs),M.shellQuoting&&(k.shell.quoting=M.shellQuoting)),k}R.to=O})(b||(b={}));var A;(function(R){function P(k){const F=k;return F&&(!!F.commandLine||!!F.command)}R.is=P;function O(k){const F={};return k.name&&(0,a.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 M(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=M})(A||(A={}));var S;(function(R){function P(k){const F=k;return F&&F.customExecution==="customExecution"}R.is=P;function O(){return{customExecution:"customExecution"}}R.from=O;function M(){return{runtime:v.RuntimeType.CustomExecution,presentation:void 0}}R.to=M})(S||(S={}));var D;(function(R){function P(k){const F=k;return F&&F.customExecution==="customExecution2"}R.is=P;function O(){return{customExecution:"customExecution2"}}R.from=O;function M(){return{runtime:v.RuntimeType.CustomExecution2,presentation:void 0}}R.to=M})(D||(D={}));var I;(function(R){function P(M){const k={label:M.label};return M.kind===v.TaskSourceKind.Extension?(k.extensionId=M.extension,M.workspaceFolder?k.scope=M.workspaceFolder.uri:k.scope=M.scope):M.kind===v.TaskSourceKind.Workspace&&(k.extensionId="$core",k.scope=M.config.workspaceFolder.uri),k}R.from=P;function O(M,k){let F,L;const B=k.tryGetRoots().map(W=>a.Uri.parse(W.uri));return M.scope===void 0||typeof M.scope=="number"&&M.scope!==1?k.tryGetRoots().map(W=>a.Uri.file(W.uri)).length===0?(F=1,L=void 0):(F=3,L={name:"workspace",uri:B[0],index:0}):typeof M.scope=="number"?F=M.scope:(F=3,L=(0,a.withNullAsUndefined)({uri:k.tryGetRoots().map(W=>a.Uri.parse(W.uri))[0],name:k.getWorkspaceName(k.tryGetRoots().map(W=>a.URI.file(W.uri))[0]),index:0})),{kind:v.TaskSourceKind.Extension,label:M.label,extension:M.extensionId,scope:F,workspaceFolder:L}}R.to=O})(I||(I={}));var w;(function(R){function P(M){if(M==null||!v.CustomTask.is(M)&&!v.ContributedTask.is(M)&&!v.ConfiguringTask.is(M))return;const k={_id:M._id,name:M.configurationProperties.name,definition:d.from(M.getDefinition()),source:I.from(M._source),execution:void 0,presentationOptions:!v.ConfiguringTask.is(M)&&M.command?E.from(M.command.presentation):void 0,isBackground:M.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:v.ContributedTask.is(M)?M.hasDefinedMatchers:!1,runOptions:f.from(M.runOptions)};if(M.configurationProperties.group&&(k.group=M.configurationProperties.group),!v.ConfiguringTask.is(M)&&M.command&&(M.command.runtime===v.RuntimeType.Process?k.execution=y.from(M.command):M.command.runtime===v.RuntimeType.Shell&&(k.execution=A.from(M.command))),M.configurationProperties.problemMatchers)for(const F of M.configurationProperties.problemMatchers)(0,a.isString)(F)&&k.problemMatchers.push(F);return k}R.from=P;function O(M,k,F,L){if(!M||typeof M.name!="string")return;let B;if(M.execution&&(A.is(M.execution)?B=A.to(M.execution):y.is(M.execution)?B=y.to(M.execution):S.is(M.execution)&&(B=S.to())),!B)return;B.presentation=E.to(M.presentationOptions);const U=I.to(M.source,k),W=(0,a.formatLocalize)("task.label",U.label,M.name),j=d.to(M.definition,F,L),Q=`${M.source.extensionId}.${j._key}`;return new v.ContributedTask(Q,U,W,j.type,j,B,M.hasDefinedMatchers,f.to(M.runOptions),{name:M.name,identifier:W,group:M.group,isBackground:!!M.isBackground,problemMatchers:M.problemMatchers.slice()})}R.to=O})(w||(w={}));let T=class extends a.Disposable{constructor(P){super(),this.rpcProtocol=P,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostTasks),this.providers=new Map,this.context={createTaskIdentifier:(O,M)=>this.taskDefinitionRegistry.createTaskIdentifier(O,M)},this.addDispose(this.taskService.onDidStateChange(O=>{const M=O.__task;O.kind==="start"?(this.logger.verbose(`task ${M._label||M._id} start`,O.terminalId),this.proxy.$onDidStartTask(l.from(M.getTaskExecution()),O.terminalId)):O.kind==="processStarted"?(this.logger.verbose(`task ${M._label||M._id} process start`,O.processId),this.proxy.$onDidStartTaskProcess(h.from(M.getTaskExecution(),O.processId))):O.kind==="processEnded"?(this.logger.verbose(`task ${M._label||M._id} process end`,O.exitCode),this.proxy.$onDidEndTaskProcess(u.from(M.getTaskExecution(),O.exitCode))):O.kind==="end"&&(this.logger.verbose(`task ${M._label||M._id} end`),this.proxy.$onDidEndTask(l.from(M.getTaskExecution())))}))}dispose(){super.dispose(),this.providers.forEach(P=>P.disposable.dispose()),this.providers.clear()}$registerTaskProvider(P,O){this.logger.verbose(`register task provider ${O}, handler ${P}`);const M={provideTasks:F=>(this.logger.verbose(`${O} provideTask`),Promise.resolve(this.proxy.$provideTask(P,F)).then(L=>{const B=[];for(const U of L.tasks){const W=w.to(U,this.workspaceService,!0,this.context);W?B.push(W):this.logger.error(`Task System: can not convert task: ${JSON.stringify(U.definition,void 0,0)}. Task will be dropped`)}return{tasks:B,extension:L.extension,type:O}})),resolveTask:F=>(this.logger.verbose(`${O} resolveTask`),Promise.resolve(this.proxy.$resolveTask(P,F)).then(L=>{if(L)return w.to(L,this.workspaceService,!0,this.context)}))},k=this.taskService.registerTaskProvider(M,O);return this.providers.set(P,{disposable:k,provider:M}),Promise.resolve()}$unregisterTaskProvider(P){throw new Error("Method not implemented.")}$fetchTasks(P){return this.taskService.tasks(s.TaskFilterDTO.to(P)).then(O=>{const M=[];for(const k of O){const F=w.from(k);F&&M.push(F)}return M})}$executeTask(P){return new Promise((O,M)=>{if(g.is(P)){const k=this.workspaceService.getWorkspaceRootUri(a.URI.from(P.workspaceFolder));k?this.taskService.getTask(k.codeUri,P.id,!0).then(F=>{this.taskService.run(F).then(()=>{});const L={id:P.id,task:w.from(F)};O(L)},F=>{M(new Error("Task not found"))}):M(new Error("No workspace folder"))}else{const k=w.to(P,this.workspaceService,!0,this.context);this.taskService.run(k).then(()=>{});const F={id:k._id,task:w.from(k)};O(F)}})}$createTaskId(P){return new Promise((O,M)=>{const k=w.to(P,this.workspaceService,!0,this.context);k?O(k._id):M(new Error("Task could not be created from DTO"))})}async $terminateTask(P){await this.taskService.terminateTask(P)}};t.MainThreadTasks=T,n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],T.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(p.ITaskService),n.__metadata("design:type",Object)],T.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(m.IWorkspaceService),n.__metadata("design:type",Object)],T.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(a.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],T.prototype,"taskDefinitionRegistry",void 0),t.MainThreadTasks=T=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],T)},69696:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTerminal=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(6487),v=e(94620),m=e(85504),_=e(46147),s=e(71354);let g=class{constructor(u){this.rpcProtocol=u,this.shortId2LongIdMap=new Map,this._terminalProcessProxies=new Map,this._profileProviders=new Map,this.disposable=new a.Disposable,this.proxy=this.rpcProtocol.getProxy(_.ExtHostAPIIdentifier.ExtHostTerminal),this.initData(),this.bindEvent()}dispose(){this.disposable.dispose()}bindEvent(){this.disposable.addDispose(this.terminalApi.onDidChangeActiveTerminal(u=>{this.proxy.$onDidChangeActiveTerminal(u)})),this.disposable.addDispose(this.terminalApi.onDidCloseTerminal(u=>{this.proxy.$onDidCloseTerminal(u)})),this.disposable.addDispose(this.terminalApi.onDidTerminalTitleChange(u=>{this.proxy.$onDidTerminalTitleChange(u.id,u.name)})),this.disposable.addDispose(this.terminalApi.onDidOpenTerminal(u=>{const d=this.controller.clients.get(u.id);d&&d.addDispose(d.xterm.raw.onData(()=>{this.proxy.$acceptTerminalInteraction(u.id)})),this.proxy.$onDidOpenTerminal(u)})),this.disposable.addDispose(this.controller.onInstanceRequestStartExtensionTerminal(u=>this._onRequestStartExtensionTerminal(u))),this.disposable.addDispose(this.profileService.onDidChangeAvailableProfiles(()=>{this._updateDefaultProfile()})),this.disposable.addDispose(this.profileService.onTerminalProfileResolved(async u=>{await this.activationEventService.fireEvent(`onTerminalProfile:${u}`)})),this.disposable.addDispose(this.profileService.onDidChangeDefaultShell(u=>{this.proxy.$setShell(u)}))}initData(){const u=this.terminalApi.terminals,d=[];u.forEach(E=>{d.push({id:E.id,name:E.name,isActive:E.isActive})}),this.proxy.$setTerminals(d),this._updateDefaultProfile()}transform(u,d){const E=this.shortId2LongIdMap.get(u);return d(E||u)}$sendText(u,d,E){return this.transform(u,f=>(this.proxy.$acceptTerminalInteraction(f),this.terminalApi.sendText(f,d,E)))}$show(u,d){return this.transform(u,E=>this.terminalApi.showTerm(E,d))}$hide(u){return this.transform(u,d=>this.terminalApi.hideTerm(d))}$dispose(u){return this.transform(u,d=>this.terminalApi.removeTerm(d))}$getProcessId(u){return this.transform(u,d=>this.terminalApi.getProcessId(d))}async $createTerminal(u,d){await this.controller.ready.promise;const E=await this.terminalApi.createTerminal(u,d);if(!E){this.logger.error(`Create Terminal ${d} fail.`);return}this.shortId2LongIdMap.set(d,E.id)}_onRequestStartExtensionTerminal(u){const d=u.proxy;this._terminalProcessProxies.set(d.terminalId,d);const E=u.cols&&u.rows?{columns:u.cols,rows:u.rows}:void 0;this.proxy.$startExtensionTerminal(d.terminalId,E).then(u.callback),d.onInput(f=>this.proxy.$acceptProcessInput(d.terminalId,f)),d.onShutdown(f=>this.proxy.$acceptProcessShutdown(d.terminalId,f)),d.onRequestCwd(()=>this.proxy.$acceptProcessRequestCwd(d.terminalId)),d.onRequestInitialCwd(()=>this.proxy.$acceptProcessRequestInitialCwd(d.terminalId))}_getTerminalProcess(u){return this.transform(u,d=>{const E=this._terminalProcessProxies.get(d);if(!E)throw new Error(`Unknown terminal: ${d}`);return E})}$sendProcessTitle(u,d){return this.transform(u,E=>{const f=this.terminalGroupViewService.getWidget(E);f&&(f.rename(d),this.proxy.$acceptTerminalTitleChange(E,d))})}$sendProcessData(u,d){this._getTerminalProcess(u).emitData(d)}$sendProcessReady(u,d,E){this._getTerminalProcess(u).emitReady(d,E)}$sendProcessExit(u,d){this._getTerminalProcess(u).emitExit(d),this._terminalProcessProxies.delete(u)}$sendOverrideDimensions(u,d){this._getTerminalProcess(u).emitOverrideDimensions(d)}$sendProcessInitialCwd(u,d){this._getTerminalProcess(u).emitInitialCwd(d)}$sendProcessCwd(u,d){this._getTerminalProcess(u).emitCwd(d)}$startLinkProvider(){var u;(u=this._linkProvider)===null||u===void 0||u.dispose(),this._linkProvider=this.controller.registerLinkProvider(new l(this.proxy))}$stopLinkProvider(){var u;(u=this._linkProvider)===null||u===void 0||u.dispose(),this._linkProvider=void 0}$registerProfileProvider(u,d){this._profileProviders.set(u,this.profileService.registerTerminalProfileProvider(d,u,{createContributedTerminalProfile:async E=>{this.proxy.$createContributedProfileTerminal(u,E)}}))}$unregisterProfileProvider(u){var d;(d=this._profileProviders.get(u))===null||d===void 0||d.dispose(),this._profileProviders.delete(u)}async _updateDefaultProfile(){const u=await this.profileInternalSerivce.resolveDefaultProfile();u&&this.proxy.$acceptDefaultProfile(u)}$setEnvironmentVariableCollection(u,d,E){if(E){const f={persistent:d,map:(0,v.deserializeEnvironmentVariableCollection)(E)};this.environmentVariableService.set(u,f)}else this.environmentVariableService.delete(u)}};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)(p.ITerminalApiService),n.__metadata("design:type",Object)],g.prototype,"terminalApi",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalController),n.__metadata("design:type",Object)],g.prototype,"controller",void 0),n.__decorate([(0,r.Autowired)(m.ITerminalProfileService),n.__metadata("design:type",Object)],g.prototype,"profileService",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalProfileInternalService),n.__metadata("design:type",Object)],g.prototype,"profileInternalSerivce",void 0),n.__decorate([(0,r.Autowired)(p.ITerminalGroupViewService),n.__metadata("design:type",Object)],g.prototype,"terminalGroupViewService",void 0),n.__decorate([(0,r.Autowired)(a.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)(a.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 l{constructor(u){this._proxy=u}async provideLinks(u,d){const E=this._proxy;return(await E.$provideLinks(u.id,d)).map(c=>({id:c.id,startIndex:c.startIndex,length:c.length,label:c.label,activate:()=>E.$activateLink(u.id,c.id)}))}}},53191:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTestsImpl=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(43718),v=e(48465),m=e(30005),_=e(20215),s=e(48385),g=e(44781),l=e(46147),h=d=>{var E,f;for(const c of d)if(c[0]===0||c[0]===1){const y=c[1];!((E=y.item)===null||E===void 0)&&E.uri&&(y.item.uri=p.URI.revive(y.item.uri)),!((f=y.item)===null||f===void 0)&&f.range&&(y.item.range=g.Range.lift(y.item.range))}};let u=class extends p.Disposable{constructor(E){super(),this.testProviderRegistrations=new Map,this.proxy=E.getProxy(l.ExtHostAPIIdentifier.ExtHostTests)}$registerTestController(E,f,c){const y=new p.DisposableStore,b=y.add(new m.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(p.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=p.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=p.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:p.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=u,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",a.Logger)],u.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.TestServiceToken),n.__metadata("design:type",Object)],u.prototype,"testService",void 0),n.__decorate([(0,r.Autowired)(_.TestProfileServiceToken),n.__metadata("design:type",Object)],u.prototype,"testProfiles",void 0),n.__decorate([(0,r.Autowired)(s.TestResultServiceToken),n.__metadata("design:type",Object)],u.prototype,"resultService",void 0),t.MainThreadTestsImpl=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],u)},31968:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadTheming=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(52416),p=e(46147);let v=class{constructor(_){this.rpcProtocol=_,this.proxy=this.rpcProtocol.getProxy(p.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)(a.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:(x,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),a=e(97267),p=e(8919),v=e(41869),m=e(93899),_=e(68969),s=e(14951),g=e(63067),l=e(52416),h=e(46147),u=e(53043),d=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,T){super(),this.rpcProtocol=w,this.extensionHostType=T,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 P=this.treeModels.get(R.payload.viewId);P&&this.progressService.withProgress({location:R.payload.viewId},()=>P.refresh())}}))}dispose(){this.disposable.dispose(),this.disposableCollection.forEach(w=>{w.dispose()}),this.disposableCollection.clear()}createTreeModel(w,T,R,P){return y.ExtensionTreeViewModel.createModel(this.injector,T,R,w,P||{})}async $registerTreeDataProvider(w,T){if(this.treeModels.has(w))return;const R=new v.DisposableStore,P=new S(w,this.proxy,this.iconService,this.themeService,this.labelService,this.contextKeyService,this.menuService,this.userhome),O=new D(w,T.dropMimeTypes,T.dragMimeTypes,T.hasHandleDrag,this.proxy),M=this.createTreeModel(w,P,O,T);this.treeModels.set(w,M),this.dndControllers.set(w,O),R.add((0,v.toDisposable)(()=>this.treeModels.delete(w))),this.mainLayoutService.replaceViewComponent({id:w,component:c.ExtensionTabBarTreeView},{model:M,dataProvider:P,treeViewId:w}),T?.showCollapseAll&&R.add(this.menuRegistry.registerMenuItem(m.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(M.onDidSelectedNodeChange(F=>{P.setSelection(w,F)})),R.add(M.onDidChangeExpansionState(F=>{const{treeItemId:L,expanded:B}=F;P.setExpanded(w,L,B)}));const k=this.mainLayoutService.getTabbarHandler(w);k&&(R.add(k.onActivate(()=>{P.setVisible(w,!0)})),R.add(k.onInActivate(()=>{P.setVisible(w,!1)})),R.add(R.add((0,v.toDisposable)(()=>k.disposeView(w))))),this.disposableCollection.set(w,R)}async $unregisterTreeDataProvider(w){const T=this.disposableCollection.get(w);T&&T.dispose()}async $resolveDropFileData(w,T,R){const P=this.dndControllers.get(w);if(!P)throw new Error("Unknown tree");return P.resolveDropFileData(T,R)}async $refresh(w,T){const R=this.treeModels.get(w);R&&await R.refresh(T)}async $setTitle(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewTitle(w,T)}async $setDescription(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewDescription(w,T)}async $setBadge(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&(R.setBadge(T||""),R.accordionService.updateViewBadge(w,T||""))}async $setMessage(w,T){const R=this.mainLayoutService.getTabbarHandler(w);R&&R.updateViewMessage(w,T)}async $reveal(w,T,R){this.mainLayoutService.revealView(w);const P=this.treeModels.get(w);P&&T&&P.reveal(T,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 T=this.treeModels.get(w);T&&T.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)(l.IIconService),r.__metadata("design:type",Object)],A.prototype,"iconService",void 0),r.__decorate([(0,o.Autowired)(m.IMenuRegistry),r.__metadata("design:type",m.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)(l.IThemeService),r.__metadata("design:type",Object)],A.prototype,"themeService",void 0),r.__decorate([(0,o.Autowired)(_.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)(m.AbstractMenuService),r.__metadata("design:type",m.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)(p.IRPCProtocol)),r.__metadata("design:paramtypes",[Object,String])],A);class S extends a.Tree{constructor(w,T,R,P,O,M,k,F){super(),this.treeViewId=w,this.proxy=T,this.iconService=R,this.themeService=P,this.labelService=O,this.contextKeyService=M,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 T;return(T=this.treeItemId2TreeNode.get(w))===null||T===void 0?void 0:T.id}getReadableDescription(w){if(w.resourceUri){if(this.userhome){const T=v.URI.from(w.resourceUri);if(this.userhome.isEqualOrParent(T))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 T=w.resourceUri.path.toString();T=decodeURIComponent(T),T.indexOf("/")>=0&&(T=T.substring(T.lastIndexOf("/")+1));const R=this.getReadableDescription(w);return{label:T,description:R}}return{label:w.label,description:w.description}}async createFoldNode(w,T){var R;const P=f.TreeItemCollapsibleState.Expanded===w.collapsibleState,O=await this.toIconClass(w),M=this.getInlineMenuNodes(w.contextValue||""),{label:k,description:F}=this.getLabelAndDescription(w);return new b.ExtensionCompositeTreeNode(this,T,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,M,w.checkboxInfo,w.accessibilityInformation,P,w.resourceUri)}async createNormalNode(w,T){var R;const P=await this.toIconClass(w),O=this.getInlineMenuNodes(w.contextValue||""),{label:M,description:k}=this.getLabelAndDescription(w);return new b.ExtensionTreeNode(this,T,M,k,P,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 T=/^data:image\//;return w?(0,v.isString)(w)?T.test(w):T.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)?l.IconType.Base64:l.IconType.Background,void 0,!0);if(w.themeIcon){let T=(0,v.getExternalIcon)(w.themeIcon.id);w.resourceUri&&(w.themeIcon.id==="file"?T=this.labelService.getIcon(v.URI.from(w.resourceUri)):w.themeIcon.id==="folder"&&(T=this.labelService.getIcon(v.URI.from(w.resourceUri),{isDirectory:!0})));const R=this.themeService.getColorClassNameByColorToken(w.themeIcon.color);return`${T} ${R??""}`}else return""}getInlineMenuNodes(w){if(this.cachedMenu.has(w))return this.cachedMenu.get(w);const T=this.contextKeyService.createScoped();T.createKey("view",this.treeViewId),T.createKey("viewItem",w);const R=this.menuService.createMenu(m.MenuId.ViewItemContext,T),P=(0,m.generateCtxMenu)({menus:R,separator:"inline"});return R.dispose(),T.dispose(),this.cachedMenu.set(w,P[0]),P[0]}async createTreeNode(w,T){return!(0,v.isUndefined)(w.collapsibleState)&&w.collapsibleState!==f.TreeItemCollapsibleState.None?await this.createFoldNode(w,T):await this.createNormalNode(w,T)}async resolveChildren(w){let T=[];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 P of R){const O=await this.createTreeNode(P,w);this.treeItemId2TreeNode.set(P.id,O),T.push(O)}if(b.ExtensionTreeRoot.is(w)){const P=this.isEmpty;this.isEmpty=!R||R.length===0,P!==this.isEmpty&&this._onDidChangeEmpty.fire()}}else T=[new b.ExtensionTreeRoot(this,this.treeViewId)];return T}async resolveTreeItem(w,T){const R=new v.CancellationTokenSource().token;return this.proxy.$resolveTreeItem(w,T,R)}sortComparator(w,T){return w?T?0:-1:1}async refresh(w){await this.onTreeDataChangedEmitter.fire(w)}async reveal(w){await this.onRevealChangedEmitter.fire(w)}async setSelection(w,T){this.proxy.$setSelection(w,T)}async setExpanded(w,T,R){this.proxy.$setExpanded(w,T,R)}async setVisible(w,T){this.proxy.$setVisible(w,T)}dispose(){super.dispose(),this.treeItemId2TreeNode.clear()}markAsChecked(w,T,R){var P;function O(F,L){var B,U;((B=F.parent)===null||B===void 0?void 0:B.checkboxInfo)!==void 0&&F.parent.checkboxInfo.checked!==T&&(!T||!(!((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 M(F,L){var B;a.CompositeTreeNode.is(F)&&((B=F.children)===null||B===void 0||B.forEach(U=>{U.checkboxInfo!==void 0&&U.checkboxInfo.checked!==T&&L.push(U),M(U,L)}))}const k=[w];R||(O(w,k),M(w,k)),k.forEach(F=>F.checkboxInfo.checked=T),(P=this.proxy)===null||P===void 0||P.$checkStateChanged(this.treeViewId,[{treeItemId:w.treeItemId,checked:T}])}}t.TreeViewDataProvider=S;class D extends v.Disposable{constructor(w,T=[],R=[],P,O){super(),this.treeViewId=w,this.dropMimeTypes=T,this.dragMimeTypes=R,this.hasHandleDrag=P,this._proxy=O,this.dataTransfersCache=new E.DataTransferCache}async handleDrop(w,T,R,P,O,M){const k=this.dataTransfersCache.add(w);try{return await this._proxy.$handleDrop(this.treeViewId,k.id,await u.DataTransfer.toDataTransferDTO(w),T?.treeItemId,R,P,O,M)}finally{k.dispose()}}async handleDrag(w,T,R){if(!this.hasHandleDrag)return;const P=await this._proxy.$handleDrag(this.treeViewId,w,T,R);if(!P)return;const O=new d.VSDataTransfer;return P.items.forEach(([M,k])=>{O.replace(M,(0,d.createStringDataTransferItem)(k.asString))}),O}resolveDropFileData(w,T){return this.dataTransfersCache.resolveDropFileData(w,T)}}t.TreeViewDragAndDropController=D},73082:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadUrls=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(46147),v=e(71354);class m{constructor(l,h,u){this.proxy=l,this.handle=h,this.extensionId=u}async handleURL(l){return this.extensionId!==l.authority?!1:(await this.proxy.$handleExternalUri(this.handle,l.codeUri),!0)}}let _=class{constructor(){this.extensionUrlHandlers=new Map}async open(l){let h=!1;const u=l.authority,d=this.extensionUrlHandlers.get(u);if(d)try{h=await d.handleURL(l)}catch(E){this.logger.error(E)}return await this.activationEventService.fireEvent("onUri",u),h}handleScheme(l){return l===this.config.uriScheme}registerExtensionHandler(l,h,u){const d=new m(u,l,h);return this.extensionUrlHandlers.set(h,d),{dispose:()=>{this.extensionUrlHandlers.delete(h)}}}dispose(){this.extensionUrlHandlers.clear()}};n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.AppConfig),n.__metadata("design:type",Object)],_.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",v.IActivationEventService)],_.prototype,"activationEventService",void 0),_=n.__decorate([(0,r.Injectable)()],_);let s=class{constructor(l){this.handlers=new Map,this.proxy=l.getProxy(p.ExtHostAPIIdentifier.ExtHostUrls),this.openerService.registerOpener(this.extensionOpener)}async $registerUriHandler(l,h){this.handlers.set(l,this.extensionOpener.registerExtensionHandler(l,h,this.proxy))}async $unregisterUriHandler(l){const h=this.handlers.get(l);h&&(h.dispose(),this.handlers.delete(l))}dispose(){this.handlers.clear(),this.extensionOpener.dispose()}};t.MainThreadUrls=s,n.__decorate([(0,r.Autowired)(a.IOpenerService),n.__metadata("design:type",Object)],s.prototype,"openerService",void 0),n.__decorate([(0,r.Autowired)(_),n.__metadata("design:type",_)],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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindowState=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(46147),v=e(38894);let m=class{constructor(s){this.rpcProtocol=s,this.toDispose=new a.DisposableCollection,this.proxy=this.rpcProtocol.getProxy(p.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(l=>this.onActiveStateChanged(l))),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=m,t.MainThreadWindowState=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},43812:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWindow=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(72665),v=e(46147);let m=class{constructor(s){this.rpcProtocol=s,this.proxy=this.rpcProtocol.getProxy(v.ExtHostAPIIdentifier.ExtHostWindow)}getDefaultDialogOptions(s){return{...s,defaultUri:s.defaultUri?a.URI.from(s.defaultUri):void 0}}async $showOpenDialog(s,g={}){const l=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showOpenDialog(l);this.proxy.$onOpenDialogResult(s,h&&h.map(u=>u.codeUri))}async $showSaveDialog(s,g={}){const l=this.getDefaultDialogOptions(g),h=await this.windowDialogService.showSaveDialog(l);this.proxy.$onSaveDialogResult(s,h&&h.codeUri)}dispose(){}};t.MainThreadWindow=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(p.IDialogService),n.__metadata("design:type",Object)],m.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(p.IWindowDialogService),n.__metadata("design:type",Object)],m.prototype,"windowDialogService",void 0),t.MainThreadWindow=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)(Symbol())),n.__metadata("design:paramtypes",[Object])],m)},13643:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainThreadWorkspace=void 0;const n=e(85608),r=e(76003),o=e(8919),a=e(41869),p=e(54414),v=e(50492),m=e(84660),_=e(52902),s=e(51500),g=e(26199),l=e(46147);let h=class extends a.WithEventBus{constructor(d){super(),this.rpcProtocol=d,this.proxy=this.rpcProtocol.getProxy(l.ExtHostAPIIdentifier.ExtHostWorkspace),this.processWorkspaceFoldersChanged(this.workspaceService.tryGetRoots()),this.addDispose(this.workspaceChangeEvent=this.workspaceService.onWorkspaceChanged(E=>{this.processWorkspaceFoldersChanged(E)})),this.storageProxy=d.getProxy(l.ExtHostAPIIdentifier.ExtHostStorage)}async $startFileSearch(d,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:[d]};return await this.fileSearchService.find("",b,y)}isAnyRootChanged(d){return!this.roots||this.roots.length!==d.length?!0:this.roots.some((E,f)=>E.uri!==d[f].uri)}processWorkspaceFoldersChanged(d){this.isAnyRootChanged(d)!==!1&&(this.roots=d,this.proxy.$onWorkspaceFoldersChanged({roots:d}),this.extensionStorageService.getAll(!1).then(E=>{this.storageProxy.$updateWorkspaceStorageData(E)}))}dispose(){super.dispose(),this.workspaceChangeEvent.dispose()}async $updateWorkspaceFolders(d,E,f,...c){await this.workspaceService.spliceRoots(d,E,f,...c.map(y=>new a.URI(y)))}async $tryApplyWorkspaceEdit(d,E){try{const f=_.ResourceEdit.convert(d),{success:c}=await this.bulkEditService.apply(f,{respectAutoSaveConfig:E?.isRefactoring});return c}catch{return!1}}async $save(d){if(d)try{const E=a.URI.file(d.path.toString());return await this.editorService.save(E)}catch(E){this.logger.error(`Save Failed: ${E.message}`);return}}async $saveAs(d){if(d)try{return await this.editorService.saveAs(d)}catch(E){this.logger.error(`SaveAs Failed: ${E.message}`);return}}async $saveAll(){try{return await this.editorService.saveAll(),!0}catch(d){return this.logger.error(d),!1}}onRenameFile(d){this.proxy.$didRenameFile(d.payload.oldUri.codeUri,d.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)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],h.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(m.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)(a.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,a.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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRangeSemanticTokensProviderImpl=t.DocumentSemanticTokensProvider=void 0;const n=e(70858);function r(p){if(p instanceof Uint8Array)return p;if(Array.isArray(p))return Uint8Array.from(p);const v=[];for(const m in p)Object.prototype.hasOwnProperty.call(p,m)&&v.push(Number(p[m]));return Uint8Array.from(v)}class o{constructor(v,m,_){this.proxy=v,this.handleId=m,this.legend=_}getLegend(){return this.legend}async provideDocumentSemanticTokens(v,m,_){const s=m?parseInt(m,10):0,g=await this.proxy.$provideDocumentSemanticTokens(this.handleId,v.uri,s,_);if(!g||_.isCancellationRequested)return null;const l=(0,n.decodeSemanticTokensDto)(r(g));return l.type==="full"?{resultId:String(l.id),data:l.data}:{resultId:String(l.id),edits:l.deltas}}releaseDocumentSemanticTokens(v){v&&this.proxy.$releaseDocumentSemanticTokens(this.handleId,parseInt(v,10))}}t.DocumentSemanticTokensProvider=o;class a{constructor(v,m,_){this.proxy=v,this.handleId=m,this.legend=_}getLegend(){return this.legend}async provideDocumentRangeSemanticTokens(v,m,_){const s=await this.proxy.$provideDocumentRangeSemanticTokens(this.handleId,v.uri,m,_);if(!s||_.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=a},74501:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionTreeModel=void 0;const r=e(85608),o=e(76003),a=e(97267),p=e(41869),v=e(72217);let m=n=class extends a.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(a.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.ExtensionTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.ExtensionTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExtensionTreeRoot])],m)},74228:(x,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),a=e(97267),p=e(41869),v=e(93899),m=e(43718),_=e(46147),s=e(98475),g=e(4321),l=r.__importDefault(e(50790)),h=e(74501),u=e(72217);t.IExtensionTreeViewModel=Symbol("IExtensionTreeViewModel"),t.ITreeViewId=Symbol("ITreeViewId"),t.ITreeViewBaseOptions=Symbol("TreeViewBaseOptions"),t.ITreeViewDragAndDropController=Symbol("ITreeViewDragAndDropController"),t.ITreeViewsService=Symbol("ITreeViewsService");const d=Symbol("ITreeViewDataProvider");let E=n=class{static createContainer(c,y,b,A,S){return c.createChild([{token:d,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 _.TreeviewsService}])}static createModel(c,y,b,A,S){return n.createContainer(c,y,b,A,S).get(t.IExtensionTreeViewModel)}constructor(){this.selectedDecoration=new a.Decoration(l.default.mod_selected),this.focusedDecoration=new a.Decoration(l.default.mod_focused),this.contextMenuDecoration=new a.Decoration(l.default.mod_actived),this.loadingDecoration=new a.Decoration(l.default.mod_loading),this.draggingDecoration=new a.Decoration(l.default.mod_dragging),this.draggedOverDecoration=new a.Decoration(l.default.mod_dragover),this.beingDraggedNodes=[],this._selectedNodes=[],this.disposableCollection=new p.DisposableCollection,this.onDidFocusedNodeChangeEmitter=new p.Emitter,this.onDidSelectedNodeChangeEmitter=new p.Emitter,this.onDidChangeExpansionStateEmitter=new p.Emitter,this._isMultiSelected=!1,this.revealDelayer=new p.ThrottledDelayer(n.DEFAULT_REVEAL_DELAY),this.toCancelNodeExpansion=new p.DisposableCollection,this.dragOverTrigger=new p.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.treeItemsTransfer=s.LocalSelectionTransfer.getInstance(),this.treeHandlerReadyDeffer=new p.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=[],I={id:this.treeViewId,itemHandles:[]};if(A.forEach(w=>{I.itemHandles.push(w.treeItemId),w.uri&&D.push(m.URI.revive(w.uri))}),this.addResourceInfoToTransfer(c,D),this.addExtensionProvidedTransferTypes(c,I.itemHandles),c.dataTransfer.setData(this.treeMimeType,JSON.stringify(I)),A.forEach(w=>{this.draggingDecoration.addTarget(w,a.TargetMatchMode.Self)}),c.dataTransfer){const w=this.getDragLabel(A)||"",T=document.createElement("div");T.className=l.default.tree_view_drag_image,T.textContent=w,document.body.appendChild(T),c.dataTransfer.setDragImage(T,-10,-10),setTimeout(()=>document.body.removeChild(T),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(T=>{this.draggingDecoration.removeTarget(T)}),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 I=new s.VSDataTransfer;for(const[T,R]of A.entries())if((T===this.treeMimeType||b.dropMimeTypes.includes(T)||R.asFile()&&b.dropMimeTypes.includes(s.DataTransfers.FILES.toLowerCase()))&&(I.append(T,R),T===this.treeMimeType))try{S=JSON.parse(await R.asString())}catch{}const w=await this.treeViewsDragAndDropService.removeDragOperationTransfer(D);if(w)for(const[T,R]of w.entries())I.append(T,R);return b.handleDrop(I,y,m.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=u.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,a.TargetMatchMode.SelfAndChildren),this.treeModel.dispatchChange()),this.potentialParent!==y&&u.ExtensionCompositeTreeNode.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,a.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDecoration.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDecoration.addTarget(this.potentialParent,a.TargetMatchMode.SelfAndChildren))),this.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(m.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!==a.TreeNodeType.CompositeTreeNode&&y!==a.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===a.TreeNodeType.CompositeTreeNode||y===a.TreeNodeType.TreeNode)&&this.activeNodeDecoration(c),c.resolved||await c.resolveTreeItem(),c.command?this.commandService.executeCommand(c.command.id,...c.command.arguments||[]):(this.clickTimes++,y===a.TreeNodeType.CompositeTreeNode&&this.preferenceService.get("workbench.list.openMode")==="singleClick"&&this.toggleDirectory(c),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&y!==a.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 I=this.getCtxMenuNodes(D.contextValue);this.injector.get(v.ICtxMenuRenderer).show({anchor:{x:b,y:A},menuNodes:I,args:[{treeViewId:this.treeViewId,treeItemId:D.treeItemId},S.map(T=>({treeViewId:this.treeViewId,treeItemId:T.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(a.TreeNodeEvent.WillResolveChildren,y=>{this.loadingDecoration.addTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(a.TreeNodeEvent.DidResolveChildren,y=>{this.loadingDecoration.removeTarget(y)})),this.disposableCollection.push(this.treeModel.root.watcher.on(a.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 a.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?m.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(m.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 I of S.entries())I[0]!==this.treeMimeType&&c.dragMimeTypes.findIndex(w=>w===I[0])<0&&D.push(I[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,m.uuid)();this.dragCancellationToken=new m.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===m.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===m.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&&(u.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,m.isUndefinedOrNull)(y.select)?!1:y.select,I=(0,m.isUndefinedOrNull)(y.focus)?!1:y.focus;let w=Math.min((0,m.isNumber)(y.expand)?y.expand:y.expand===!0?1:0,3),T=await((b=this.extensionTreeHandle)===null||b===void 0?void 0:b.ensureVisible(S.path));for(T&&(D&&this.selectNodeDecoration(T),I&&this.activeNodeFocusedDecoration(T,!1,!0));u.ExtensionCompositeTreeNode.is(T)&&w>0;w--)await this.extensionTreeHandle.expandNode(T),T=T?.children?T?.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)(d),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)(p.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)(p.IContextKeyService),r.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(p.CommandService),r.__metadata("design:type",Object)],E.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(p.LabelService),r.__metadata("design:type",p.LabelService)],E.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(m.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:(x,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(m){return!!m&&"children"in m&&!m.parent}constructor(m,_=""){super(m,void 0),this.treeViewId=_}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 a extends n.CompositeTreeNode{constructor(m,_,s,g="",l="",h="",u,d="",E="",f,c,y,b,A){super(m,_,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=l,this.contextValue=d,this.treeItemId=E,this.actions=f,this._checkboxInfo=c,this._accessibilityInformation=y,this._resolved=!1,this.isExpanded=b||!1,this.sourceUri=A,this._command=u,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 m,_;return{role:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.role)||"treeitem",label:((_=this._accessibilityInformation)===null||_===void 0?void 0:_.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 m;const _=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);_&&(this._tooltip=typeof _.tooltip=="string"?_.tooltip:(m=_.tooltip)===null||m===void 0?void 0:m.value,this._command=_.command),this._resolved=!0}dispose(){super.dispose()}}t.ExtensionCompositeTreeNode=a;class p extends n.TreeNode{constructor(m,_,s,g="",l="",h,u,d="",E="",f,c,y,b){super(m,_,void 0,{name:encodeURIComponent(E)}),this.description=g,this.icon=l,this._tooltip=h,this._command=u,this.contextValue=d,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 m,_;return{role:((m=this._accessibilityInformation)===null||m===void 0?void 0:m.role)||"treeitem",label:((_=this._accessibilityInformation)===null||_===void 0?void 0:_.label)||this.displayName}}get strikethrough(){return this._strikethrough}get highlights(){return this._hightlights}async resolveTreeItem(){var m;const _=await this._tree.resolveTreeItem(this._tree.treeViewId,this.treeItemId);_&&(this._tooltip=typeof _.tooltip=="string"?_.tooltip:(m=_.tooltip)===null||m===void 0?void 0:m.value,this._command=_.command),this._resolved=!0}}t.ExtensionTreeNode=p},38894:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowActivityTimer=void 0;const n=e(41869),r=30,o=1e3;class a extends n.Disposable{constructor(v,m=30,_=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=m,this.inactivityCheckInterval=_,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=a},72980:(x,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:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(77666),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){const _=this;for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=[];for(const u of l){const{title:d,description:E}=u;switch(u.type){case"action":h.push({title:d,description:E,iconClass:(0,o.getIcon)(u.icon),click:()=>{u.command&&_.commandService.executeCommand(u.command)},type:u.type});break;case"enum":h.push({type:u.type,title:d,description:E,select:f=>{u.command&&_.commandService.executeCommand(u.command,f)},enum:u.enum,defaultValue:u.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)(a.IToolbarActionService),n.__metadata("design:type",Object)],v.prototype,"toolbarActionService",void 0),t.ActionsContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("actions"),(0,p.LifeCycle)(3)],v)},57541:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(37499),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{contributes:_}=m;_.forEach(s=>{this.debugConfigurationManager.addSupportBreakpoints(s.language)})}}unregister(m){m.forEach(_=>{this.debugConfigurationManager.removeSupportBreakpoints(_.language)})}dispose(){for(const m of this.contributesMap){const{contributes:_}=m;this.unregister(_)}}};t.BreakpointsContributionPoint=p,n.__decorate([(0,r.Autowired)(o.DebugConfigurationManager),n.__metadata("design:type",o.DebugConfigurationManager)],p.prototype,"debugConfigurationManager",void 0),t.BreakpointsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("breakpoints"),(0,a.LifeCycle)(3)],p)},37614:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(52416),p=e(99220),v="^\\w+[.\\w+]*$";let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{contributes:g}=s;for(const l of g)l&&l.description&&(l.description=(0,o.replaceLocalizePlaceholder)(l.description)),this.themeService.registerColor(l)}}};t.ColorsContributionPoint=m,m.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)(a.IThemeService),n.__metadata("design:type",Object)],m.prototype,"themeService",void 0),t.ColorsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("colors"),(0,p.LifeCycle)(4)],m)},8079:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(52416),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&l.forEach(u=>{this.addDispose(this.commandRegistry.registerCommand({category:this.getLocalizeFromNlsJSON(u.category,g),label:this.getLocalizeFromNlsJSON(u.title,g),shortLabel:u.shortTitle?this.getLocalizeFromNlsJSON(u.shortTitle,g):void 0,categoryLocalized:this.createLocalizedStr(u.category,g),labelLocalized:this.createLocalizedStr(u.title,g),shortLabelLocalized:u.shortTitle?this.createLocalizedStr(u.shortTitle,g):void 0,id:u.command,iconClass:typeof u.icon=="string"&&this.iconService.fromString(u.icon)||this.iconService.fromIcon(h.path,u.icon,a.IconType.Background),enablement:u.enablement},{execute:(...d)=>this.extensionService.executeExtensionCommand(u.command,d)})),this.config.noExtHost?this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(u.command,"worker")):this.addDispose(this.extensionCommandManager.registerExtensionCommandEnv(u.command,"node"))})}}};t.CommandsContributionPoint=m,n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(p.ExtensionService),n.__metadata("design:type",p.ExtensionService)],m.prototype,"extensionService",void 0),n.__decorate([(0,r.Autowired)(p.IExtCommandManagement),n.__metadata("design:type",p.IExtCommandManagement)],m.prototype,"extensionCommandManager",void 0),n.__decorate([(0,r.Autowired)(a.IIconService),n.__metadata("design:type",Object)],m.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],m.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.CommandsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("commands"),(0,p.LifeCycle)(3)],m)},6143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(99220),v=e(71354),m=e(25588);let _=class extends p.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:l,contributes:h}=g,u=this.extensionManageService.getExtensionInstanceByExtId(l);if(!u)continue;let d=h;Array.isArray(d)||(d=[d]);const E=[];for(const f of d)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,l)),b.enumDescriptions&&(c[y].enumDescriptions=b.enumDescriptions.map(A=>this.getLocalizeFromNlsJSON(A,l))),b.markdownDescription&&(c[y].markdownDescription=this.getLocalizeFromNlsJSON(b.markdownDescription,l))}f.properties=c,f.title=this.getLocalizeFromNlsJSON(f.title,l)||f.title,this.updateConfigurationSchema(f),E.push({title:f.title,extensionId:l,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(u.packageJSON.displayName,l)||u.packageJSON.displayName,subSections:E}))}}updateConfigurationSchema(g){this.validateConfigurationSchema(g),this.addDispose(this.preferenceSchemaProvider.setSchema(g))}validateConfigurationSchema(g){for(const l in g.properties){const h=g.properties[l];if(h.type==="string[]"&&(h.type="array"),h.type!=="object")continue;typeof h.default>"u"&&this.validateDefaultValue(h);const u=h.properties;if(u)for(const d in u)typeof u[d]!="object"&&delete u[d]}}validateDefaultValue(g){g.default={};const l=g.properties;if(l)for(const h in l)l[h].default&&(g.default[h]=l[h].default,delete l[h].default)}};t.ConfigurationContributionPoint=_,n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],_.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],_.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],_.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(m.LocalizationsContributionPoint),n.__metadata("design:type",m.LocalizationsContributionPoint)],_.prototype,"localizationsContributionPoint",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.ConfigurationContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("configuration"),(0,p.LifeCycle)(2)],_)},4653:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationDefaultsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(99220);let p=class extends a.VSCodeContributePoint{contribute(){for(const m of this.contributesMap){const{contributes:_}=m;_&&this.updateDefaultOverridesSchema(_)}}updateDefaultOverridesSchema(m){for(const _ in m){const s=m[_];if(o.OVERRIDE_PROPERTY_PATTERN.test(_)){const g=_.match(o.OVERRIDE_PROPERTY_PATTERN)[1];Object.keys(s).forEach(l=>{this.defaultPreferenceProvider.setPreference(l,s[l],void 0,g)})}}}};t.ConfigurationDefaultsContributionPoint=p,n.__decorate([(0,r.Autowired)(o.PreferenceProvider,{tag:o.PreferenceScope.Default}),n.__metadata("design:type",o.PreferenceProvider)],p.prototype,"defaultPreferenceProvider",void 0),t.ConfigurationDefaultsContributionPoint=p=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("configurationDefaults"),(0,a.LifeCycle)(3)],p)},21086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomEditorContributionPoint=void 0,t.createCustomEditorComponent=u;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),a=e(41869),p=e(43718),v=e(57517),m=e(65046),_=e(50234),s=e(99220),g=e(35912),l=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=`${p.CUSTOM_EDITOR_SCHEME}-${E.viewType}`,b=u(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,I)=>{for(const w of A)((0,p.match)(w,D.uri.path.toString().toLowerCase())||(0,p.match)(w,D.uri.path.base.toLowerCase()))&&I.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:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldSaveEvent({uri:T.uri,viewType:c,cancellationToken:new p.CancellationTokenSource().token})),revertResource:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldRevertEvent({uri:T.uri,viewType:c,cancellationToken:new p.CancellationTokenSource().token})),undo:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:T.uri,viewType:c,type:"undo"})),redo:T=>this.eventBus.fireAndAwait(new g.CustomEditorShouldEditEvent({uri:T.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)(p.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(a.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 u(d,E,f){return({resource:c})=>{const y=(0,a.useInjectable)(l.IActivationEventService),b=(0,a.useInjectable)(m.IWebviewService),A=(0,a.useInjectable)(a.IEventBus),S=(0,a.useInjectable)(s.ExtensionService);let D=null;return r.default.useEffect(()=>{const I=new p.CancellationTokenSource,w=new p.Disposable;return Promise.all([y.fireEvent("onCustomEditor",d),S.eagerExtensionsActivated.promise]).then(()=>{if(I.token.isCancellationRequested)return;const T=b.createWebview(f().webviewOptions);if(T&&D){const R=new _.WebviewMounter(T,D,document.getElementById("workbench-editor"),document.getElementById("workbench-editor"));T.onRemove(()=>{R.dispose()}),w.addDispose({dispose:()=>{T.remove(),T.dispose(),A.fire(new g.CustomEditorShouldHideEvent({uri:c.uri,viewType:d}))}}),A.fire(new g.CustomEditorShouldDisplayEvent({uri:c.uri,viewType:d,webviewPanelId:T.id,cancellationToken:I.token,openTypeId:E}))}}),()=>{w.dispose(),I.cancel()}},[]),r.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"},className:"editor-webview-webview-component",ref:I=>D=I})}}},61361:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggersContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(66482),v=e(37499),m=e(69946),_=e(99220),s=e(71354),{deepClone:g}=a.objects,l={enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,a.localize)("preference.debug.internalConsoleOptions")};let h=class extends _.VSCodeContributePoint{contribute(){for(const d of this.contributesMap){const{extensionId:E,contributes:f}=d,c=this.extensionManageService.getExtensionInstanceByExtId(E);c&&this.debugService.registerDebugContributionPoints(c.path,this.resolveDebuggers(f,c))}this.debugSchemaManager.update()}resolveDebuggers(d,E){return d.map(f=>{const c=this.doResolveDebuggers(f,E);return this.debugConfigurationManager.registerDebugger(c),c})}doResolveDebuggers(d,E){const f={type:d.type,label:d.label?(0,o.replaceLocalizePlaceholder)(d.label,E.id):"",languages:d.languages,enableBreakpointsFor:d.enableBreakpointsFor,variables:d.variables,adapterExecutableCommand:d.adapterExecutableCommand,configurationSnippets:(d.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:d.win,winx86:d.winx86,windows:d.windows,osx:d.osx,linux:d.linux,program:d.program,args:d.args,runtime:d.runtime,runtimeArgs:d.runtimeArgs};return f.configurationAttributes=d.configurationAttributes&&this.resolveSchemaAttributes(d.type,d.configurationAttributes,E),f}resolveSchemaAttributes(d,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:[d],description:(0,a.localize)("debug.launch.configurations.debugType"),pattern:"^(?!node2)",errorMessage:(0,a.localize)("debug.launch.configurations.debugTypeNotRecognised"),patternErrorMessage:(0,a.localize)("debug.launch.configurations.node2NotSupported")},D.name={type:"string",description:(0,a.localize)("debug.launch.configurations.debugName"),default:"Launch"},D.request={enum:[b],description:(0,a.localize)("debug.launch.configurations.debugRequest")},D.debugServer={type:"number",description:(0,a.localize)("debug.launch.configurations.debugServer"),default:4711},D.preLaunchTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,a.localize)("debug.launch.configurations.debugPrelaunchTask")},D.postDebugTask={anyOf:[c,{type:["string","null"]}],default:"",description:(0,a.localize)("debug.launch.configurations.debugPostDebugTask")},D.internalConsoleOptions=l;const I=Object.assign({},D);return D.windows={type:"object",description:(0,a.localize)("debug.launch.configurations.debugWindowsConfiguration"),properties:I},D.osx={type:"object",description:(0,a.localize)("debug.launch.configurations.debugOSXConfiguration"),properties:I},D.linux={type:"object",description:(0,a.localize)("debug.launch.configurations.debugLinuxConfiguration"),properties:I},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,a.localize)("deprecatedVariables","'env.', 'config.' and 'command.' are deprecated, use 'env:', 'config:' and 'command:' instead.")}),y(A.properties),A})}dispose(){for(const d of this.contributesMap){const{extensionId:E}=d,f=this.extensionManageService.getExtensionInstanceByExtId(E);f&&this.debugService.unregisterDebugContributionPoints(f.path)}}};t.DebuggersContributionPoint=h,h.schema={description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.type","Unique identifier for this debug adapter."),type:"string"},label:{description:(0,a.localize)("vscode.extension.contributes.debuggers.label","Display name for this debug adapter."),type:"string"},program:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.args","Optional arguments to pass to the adapter."),type:"array"},runtime:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.runtimeArgs","Optional runtime arguments."),type:"array"},variables:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.initialConfigurations","Configurations for generating the initial 'launch.json'."),type:["array","string"]},languages:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.configurationSnippets","Snippets for adding new configurations in 'launch.json'."),type:"array"},configurationAttributes:{description:(0,a.localize)("vscode.extension.contributes.debuggers.configurationAttributes","JSON schema configurations for validating 'launch.json'."),type:"object"},when:{description:(0,a.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,a.localize)("vscode.extension.contributes.debuggers.windows","Windows specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.windows.runtime","Runtime used for Windows."),type:"string"}}},osx:{description:(0,a.localize)("vscode.extension.contributes.debuggers.osx","macOS specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.osx.runtime","Runtime used for macOS."),type:"string"}}},linux:{description:(0,a.localize)("vscode.extension.contributes.debuggers.linux","Linux specific settings."),type:"object",properties:{runtime:{description:(0,a.localize)("vscode.extension.contributes.debuggers.linux.runtime","Runtime used for Linux."),type:"string"}}}}}},n.__decorate([(0,r.Autowired)(p.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)(m.DebugSchemaManager),n.__metadata("design:type",m.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,_.Contributes)("debuggers"),(0,_.LifeCycle)(4)],h)},60768:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GrammarsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(62660),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);if(h)for(const u of l)this.textMateService.registerGrammar(u,o.URI.from(h.uri)),this.addDispose(o.Disposable.create(()=>{this.textMateService.unregisterGrammar(u)}))}}};t.GrammarsContributionPoint=m,m.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)(a.ITextmateTokenizer),n.__metadata("design:type",Object)],m.prototype,"textMateService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.GrammarsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("grammars"),(0,p.LifeCycle)(2)],m)},43988:(x,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),a=e(43718),p=e(52416),v=e(38667),m=e(99220),_=e(71354);let s=class extends m.VSCodeContributePoint{contribute(){for(const u of this.contributesMap){const{extensionId:d,contributes:E}=u,f=E.map(y=>({...y,label:this.getLocalizeFromNlsJSON(y.label,d),extensionId:d})),c=this.extensionManageService.getExtensionInstanceByExtId(d);c&&this.iconService.registerIconThemes(f,a.URI.from(c.uri))}}};t.IconThemesContributionPoint=s,n.__decorate([(0,r.Autowired)(p.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],s.prototype,"extensionManageService",void 0),t.IconThemesContributionPoint=s=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("iconThemes"),(0,m.LifeCycle)(2)],s);const g={ttf:"truetype",woff:"woff",woff2:"woff2"};let l=class extends m.VSCodeContributePoint{constructor(){super(...arguments),this.iconRegistry=(0,v.getIconRegistry)()}contribute(){for(const{extensionId:u,contributes:d}of this.contributesMap)Object.keys(d).forEach(E=>{const f=d[E],c=this.extensionManageService.getExtensionInstanceByExtId(u);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=a.URI.from(c.uri).resolve(f.default.fontPath),A=a.path.extname(y.fontPath).substring(1),S=g[A];if(!S){this.logger.warn((0,a.localize)("invalid.icons.default.fontPath.extension",`Expected \`contributes.icons.default.fontPath\` to have file extension 'woff', woff2' or 'ttf', is '${A}'.`));return}const D=a.path.join(u,y.fontPath),I=this.iconRegistry.registerIconFont(D,{src:[{location:this.staticResourceService.resolveStaticResource(b),format:S}]});this.iconRegistry.registerIcon(E,{fontCharacter:y.fontCharacter,font:{id:D,definition:I}},f.description)}}});this.productIconService.updateProductIconThemes()}};t.IconsContributionPoint=l,n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],l.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(p.IProductIconService),n.__metadata("design:type",Object)],l.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",o.StaticResourceService)],l.prototype,"staticResourceService",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],l.prototype,"logger",void 0),t.IconsContributionPoint=l=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("icons"),(0,m.LifeCycle)(2)],l)},35321:(x,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),a=e(3098),p=e(57541),v=e(37614),m=e(8079),_=e(6143),s=e(4653),g=e(21086),l=e(61361),h=e(60768),u=e(43988),d=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),I=e(92659),w=e(75943),T=e(77901),R=e(88797),P=e(91688),O=e(55993),M=e(12191),k=e(36198),F=e(21218);t.VSCodeContributesServiceToken=Symbol("VSCodeContributesService");let L=class extends o.ExtensionContributesService{constructor(){super(...arguments),this.ContributionPoints=[P.ThemesContributionPoint,u.IconThemesContributionPoint,u.IconsContributionPoint,f.LocalizationsContributionPoint,m.CommandsContributionPoint,A.ProductIconThemesContributionPoint,h.GrammarsContributionPoint,E.LanguagesContributionPoint,_.ConfigurationContributionPoint,s.ConfigurationDefaultsContributionPoint,v.ColorsContributionPoint,d.KeybindingContributionPoint,c.SubmenusContributionPoint,c.MenusContributionPoint,w.SnippetsContributionPoint,O.ViewContainersContributionPoint,M.ViewsContributionPoint,k.ViewsWelcomeContributionPoint,p.BreakpointsContributionPoint,l.DebuggersContributionPoint,a.ActionsContributionPoint,T.TaskDefinitionContributionPoint,b.ProblemPatternsContributionPoint,y.ProblemMatchersContributionPoint,g.CustomEditorContributionPoint,F.WalkthroughsContributionPoint,I.SemanticTokenTypesContributionPoint,S.SemanticTokenModifiersContributionPoint,D.SemanticTokenScopesContributionPoint,R.TerminalContributionPoint]}};t.VSCodeContributesService=L,t.VSCodeContributesService=L=n.__decorate([(0,r.Injectable)()],L)},81404:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeybindingContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(99220),p=e(71354);let v=class extends a.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{extensionId:s,contributes:g}=_,l=this.extensionManageService.getExtensionInstanceByExtId(s);if(!l)continue;const h=g.map(u=>this.toKeybinding(u,l.isBuiltin));this.addDispose(this.keybindingRegistry.registerKeybindings(h))}}toKeybinding(_,s){const g=this.toOSKeybinding(_),{command:l,when:h}=_;return{keybinding:g,command:l,when:h,priority:s?o.KeybindingWeight.BuiltinExtension*100:o.KeybindingWeight.ExternalExtension*100}}toOSKeybinding(_){let s;const g=o.OS.type();return g===o.OperatingSystem.Windows&&_.win?s=_.win:g===o.OperatingSystem.Macintosh&&_.mac?s=_.mac:_.linux&&(s=_.linux),s||_.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)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],v.prototype,"extensionManageService",void 0),t.KeybindingContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("keybindings"),(0,a.LifeCycle)(4)],v)},82903:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguagesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(62660),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{async contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=this.extensionManageService.getExtensionInstanceByExtId(g);h&&await this.textMateService.registerLanguages(l,o.URI.from(h.uri))}}};t.LanguagesContributionPoint=m,m.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:`;:.,=}])>
31925
31925
  `,description:(0,o.localize)("schema.autoCloseBefore","Defines what characters must be after the cursor in order for bracket or quote autoclosing to occur when using the 'languageDefined' autoclosing setting. This is typically the set of characters which can not start an expression."),type:"string"},surroundingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:(0,o.localize)("schema.surroundingPairs","Defines the bracket pairs that can be used to surround a selected string."),type:"array",items:{oneOf:[{},{type:"object",properties:{open:{},close:{}}}]}},wordPattern:{default:"",description:(0,o.localize)("schema.wordPattern","Defines what is considered to be a word in the programming language."),type:["string","object"],properties:{pattern:{type:"string",description:(0,o.localize)("schema.wordPattern.pattern","The RegExp pattern used to match words."),default:""},flags:{type:"string",description:(0,o.localize)("schema.wordPattern.flags","The RegExp flags used to match words."),default:"g",pattern:"^([gimuy]+)$",patternErrorMessage:(0,o.localize)("schema.wordPattern.flags.errorMessage","Must match the pattern `/^([gimuy]+)$/`.")}}},indentationRules:{default:{increaseIndentPattern:"",decreaseIndentPattern:""},description:(0,o.localize)("schema.indentationRules","The language's indentation settings."),type:"object",properties:{increaseIndentPattern:{type:["string","object"],description:(0,o.localize)("schema.indentationRules.increaseIndentPattern","If a line matches this pattern, then all the lines after it should be indented once (until another rule matches)."),properties:{pattern:{type:"string",description:(0,o.localize)("schema.indentationRules.increaseIndentPattern.pattern","The RegExp pattern for increaseIndentPattern."),default:""},flags:{type:"string",description:(0,o.localize)("schema.indentationRules.increaseIndentPattern.flags","The RegExp flags for increaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:(0,o.localize)("schema.indentationRules.increaseIndentPattern.errorMessage","Must match the pattern `/^([gimuy]+)$/`.")}}},decreaseIndentPattern:{type:["string","object"],description:(0,o.localize)("schema.indentationRules.decreaseIndentPattern","If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches)."),properties:{pattern:{type:"string",description:(0,o.localize)("schema.indentationRules.decreaseIndentPattern.pattern","The RegExp pattern for decreaseIndentPattern."),default:""},flags:{type:"string",description:(0,o.localize)("schema.indentationRules.decreaseIndentPattern.flags","The RegExp flags for decreaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:(0,o.localize)("schema.indentationRules.decreaseIndentPattern.errorMessage","Must match the pattern `/^([gimuy]+)$/`.")}}},indentNextLinePattern:{type:["string","object"],description:(0,o.localize)("schema.indentationRules.indentNextLinePattern","If a line matches this pattern, then **only the next line** after it should be indented once."),properties:{pattern:{type:"string",description:(0,o.localize)("schema.indentationRules.indentNextLinePattern.pattern","The RegExp pattern for indentNextLinePattern."),default:""},flags:{type:"string",description:(0,o.localize)("schema.indentationRules.indentNextLinePattern.flags","The RegExp flags for indentNextLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:(0,o.localize)("schema.indentationRules.indentNextLinePattern.errorMessage","Must match the pattern `/^([gimuy]+)$/`.")}}},unIndentedLinePattern:{type:["string","object"],description:(0,o.localize)("schema.indentationRules.unIndentedLinePattern","If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules."),properties:{pattern:{type:"string",description:(0,o.localize)("schema.indentationRules.unIndentedLinePattern.pattern","The RegExp pattern for unIndentedLinePattern."),default:""},flags:{type:"string",description:(0,o.localize)("schema.indentationRules.unIndentedLinePattern.flags","The RegExp flags for unIndentedLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:(0,o.localize)("schema.indentationRules.unIndentedLinePattern.errorMessage","Must match the pattern `/^([gimuy]+)$/`.")}}}}},folding:{type:"object",description:(0,o.localize)("schema.folding","The language's folding settings."),properties:{offSide:{type:"boolean",description:(0,o.localize)("schema.folding.offSide","A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.")},markers:{type:"object",description:(0,o.localize)("schema.folding.markers","Language specific folding markers such as '#region' and '#endregion'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently"),properties:{start:{type:"string",description:(0,o.localize)("schema.folding.markers.start","The RegExp pattern for the start marker. The regexp must start with '^'.")},end:{type:"string",description:(0,o.localize)("schema.folding.markers.end","The RegExp pattern for the end marker. The regexp must start with '^'.")}}}}}}},n.__decorate([(0,r.Autowired)(a.ITextmateTokenizer),n.__metadata("design:type",Object)],m.prototype,"textMateService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.LanguagesContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("languages"),(0,p.LifeCycle)(2)],m)},25588:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalizationsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(50492),v=e(42933),m=e(99220),_=e(71354),{Path:s}=o.path;let g=class extends m.VSCodeContributePoint{constructor(){super(...arguments),this._whenContributed=new a.Deferred}get whenContributed(){return this._whenContributed.promise}safeParseJSON(u){let d;try{return d=(0,o.parseWithComments)(u),d}catch(E){return this.logger.error(`Language configuration file parsing error, ${E.stack}`)}}async contribute(){try{const u=[],d=this.preferenceService.get(o.GeneralSettingsId.Language)||(0,o.getLanguageId)(),E=this.extensionManageService.getExtensionInstances();for(const f of this.contributesMap){const{extensionId:c,contributes:y}=f,b=this.extensionManageService.getExtensionInstanceByExtId(c);for await(const A of y)if(A.translations){const S=l(A.languageId);if(S!==(0,o.getLanguageId)())continue;u.push(...A.translations.map(async D=>{if(E.findIndex(w=>w.id===D.id)===-1)return;const I=await this.registerLanguage(D,b.path);(0,o.registerLocalizationBundle)({languageId:S,languageName:A.languageName,localizedLanguageName:A.localizedLanguageName,contents:I},D.id)})),this.storagePath||(this.storagePath=await this.extensionStoragePathServer.getLastStoragePath()||""),u.push(this.extensionNodeService.updateLanguagePack(d,b.path,this.storagePath))}}await Promise.all(u),this._whenContributed.resolve()}catch(u){this.logger.error("Failed to contribute localizations:",u),this._whenContributed.reject(u)}}async registerLanguage(u,d){const E=new s(d).join(u.path.replace(/^\.\//,"")).toString(),{content:f}=await this.fileServiceClient.readFile(o.URI.file(E).toString()),c=this.safeParseJSON(f.toString()),y={};if(c.contents){for(const b of Object.keys(c.contents))if(c.contents[b])for(const A of Object.keys(c.contents[b]))y[A]=c.contents[b][A]}return y}};t.LocalizationsContributionPoint=g,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],g.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(p.IExtensionStoragePathServer),n.__metadata("design:type",Object)],g.prototype,"extensionStoragePathServer",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],g.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(m.ExtensionNodeServiceServerPath),n.__metadata("design:type",Object)],g.prototype,"extensionNodeService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],g.prototype,"extensionManageService",void 0),t.LocalizationsContributionPoint=g=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("localizations"),(0,m.LifeCycle)(2)],g);function l(h){const u=h.split("-");return u[1]&&(u[1]=u[1].toUpperCase()),u.join("-")}},35166:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MenusContributionPoint=t.SubmenusContributionPoint=void 0,t.parseMenuId=d,t.parseMenuGroup=E,t.isValidMenuItem=f;const n=e(85608),r=e(76003),o=e(41869),a=e(57559),p=e(68456),v=e(93899),m=e(54414),_=e(57517),s=e(52416),g=e(42912),l=e(99220),h=e(71354);function u(D){return typeof D.command=="string"}function d(D){switch(D){case"touchBar":return v.MenuId.TouchBarContext;case"debug/toolBar":return v.MenuId.DebugToolBar;case"statusBar/windowIndicator":return v.MenuId.StatusBarWindowIndicatorMenu;case"menuBar/file":return v.MenuId.MenubarFileMenu;default:return D}}function E(D){let I,w;if(D){const T=D.lastIndexOf("@");T>0?(I=D.substr(0,T),w=Number(D.substr(T+1))||void 0):I=D}return[I,w]}function f(D,I){return typeof D.command!="string"?(I.error((0,o.formatLocalize)("requirestring","command")),!1):D.alt&&typeof D.alt!="string"?(I.error((0,o.formatLocalize)("optstring","alt")),!1):D.when&&typeof D.when!="string"?(I.error((0,o.formatLocalize)("optstring","when")),!1):D.group&&typeof D.group!="string"?(I.error((0,o.formatLocalize)("optstring","group")),!1):!0}function c(D,I){return typeof D.submenu!="string"?(I.error((0,o.formatLocalize)("requirestring","property `{0}` is mandatory and must be of type `string`","submenu")),!1):D.when&&typeof D.when!="string"?(I.error((0,o.formatLocalize)("optstring","property `{0}` can be omitted or must be of type `string`","when")),!1):D.group&&typeof D.group!="string"?(I.error((0,o.formatLocalize)("optstring","property `{0}` can be omitted or must be of type `string`","group")),!1):!0}function y(D,I){if(!Array.isArray(D))return I.error((0,o.formatLocalize)("requirearray","submenu items must be an array")),!1;for(const w of D)if(u(w)){if(!f(w,I))return!1}else if(!c(w,I))return!1;return!0}const b=new Map;let A=class extends l.VSCodeContributePoint{contribute(){for(const I of this.contributesMap){const{extensionId:w,contributes:T}=I;b.set(w,T)}}};t.SubmenusContributionPoint=A,A.schema={},t.SubmenusContributionPoint=A=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("submenus"),(0,l.LifeCycle)(3)],A);let S=class extends l.VSCodeContributePoint{constructor(){super(...arguments),this.phase=2}createSyntheticCommandId(I,w){const T=I.command;let R=w+T,P=0;for(;this.commandRegistry.getCommand(R);)R=w+T+":"+P,P++;return R}getDataFromQuery(I,w){return new URLSearchParams(I).get(w)}contribute(){const I=console;for(const w of this.contributesMap){const{extensionId:T,contributes:R}=w,P=this.extensionManageService.getExtensionInstanceByExtId(T);if(P)for(const O of Object.keys(R)){const M=R[O];if(!y(M,console))return;const k=d(O);if((0,o.isUndefined)(k)){I.warn((0,o.formatLocalize)("menuId.invalid","`{0}` is not a valid menu identifier",O));return}for(const F of M)if(u(F)){const L=this.commandRegistry.getRawCommand(F.command),B=F.alt&&this.commandRegistry.getRawCommand(F.alt);if(!L){I.error((0,o.formatLocalize)("menu.missing.command",k,F.command));continue}F.alt&&!B&&I.warn((0,o.formatLocalize)("menu.missing.altCommand",k,F.alt)),F.command===F.alt&&I.info((0,o.formatLocalize)("menu.dupe.command",k,F.command,F.alt));const[U,W]=E(F.group);let j;k===v.MenuId.EditorTitleContext?j=({uri:Q})=>[Q.codeUri]:k===v.MenuId.EditorTitle&&(j=(Q,G,Z)=>{if(Q.scheme===m.EditorOpenType.diff){const $=this.getDataFromQuery(decodeURIComponent(Q.query),"modified");if($)return[new o.URI($).codeUri]}return[Z?.codeUri||Q.codeUri]}),this.addDispose(this.menuRegistry.registerMenuItem(k,{command:F.command,alt:B,group:U,order:W,when:F.when,argsTransformer:j,type:F.type,toggledWhen:F.toggledWhen,enabledWhen:F.enabledWhen}))}else{const L=b.get(T);if(!L){I.error((0,o.localize)("missing.submenu.section","Need a submenu contributes firstly",F.submenu));continue}const B=L.find(j=>j.id===F.submenu);if(!B){I.error((0,o.localize)("missing.submenu","Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",F.submenu));continue}const[U,W]=E(F.group);this.addDispose(this.menuRegistry.registerMenuItem(k,{submenu:F.submenu,label:this.getLocalizeFromNlsJSON(B.label,T),when:F.when,group:U,order:W,iconClass:B.icon&&this.toIconClass(B.icon,s.IconType.Background,P.path)}))}}}}};t.MenusContributionPoint=S,S.schema=a.menus.schema,n.__decorate([(0,r.Autowired)(o.CommandRegistry),n.__metadata("design:type",Object)],S.prototype,"commandRegistry",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],S.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],S.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(v.IMenuRegistry),n.__metadata("design:type",v.IMenuRegistry)],S.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",p.ToolbarRegistry)],S.prototype,"toolBarRegistry",void 0),n.__decorate([(0,r.Autowired)(_.IEditorActionRegistry),n.__metadata("design:type",Object)],S.prototype,"editorActionRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(g.IIconService),n.__metadata("design:type",Object)],S.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(h.AbstractExtInstanceManagementService),n.__metadata("design:type",h.AbstractExtInstanceManagementService)],S.prototype,"extensionManageService",void 0),t.MenusContributionPoint=S=n.__decorate([(0,r.Injectable)(),(0,l.Contributes)("menus"),(0,l.LifeCycle)(3)],S)},95765:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProblemMatchersContributionPoint=t.problemMatchersSchema=t.Schemas=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220),p=e(49661),{deepClone:v}=o.objects;var m;(function(s){s.WatchingPattern={type:"object",additionalProperties:!1,properties:{regexp:{type:"string",description:(0,o.localize)("WatchingPatternSchema.regexp","The regular expression to detect the begin or end of a background task.")},file:{type:"integer",description:(0,o.localize)("WatchingPatternSchema.file","The match group index of the filename. Can be omitted.")}}},s.PatternType={anyOf:[{type:"string",description:(0,o.localize)("PatternTypeSchema.name","The name of a contributed or predefined pattern")},p.PatternSchemas.ProblemPattern,p.PatternSchemas.MultiLineProblemPattern],description:(0,o.localize)("PatternTypeSchema.description","A problem pattern or the name of a contributed or predefined problem pattern. Can be omitted if base is specified.")},s.ProblemMatcher={type:"object",additionalProperties:!1,properties:{base:{type:"string",description:(0,o.localize)("ProblemMatcherSchema.base","The name of a base problem matcher to use.")},owner:{type:"string",description:(0,o.localize)("ProblemMatcherSchema.owner","The owner of the problem inside Code. Can be omitted if base is specified. Defaults to 'external' if omitted and base is not specified.")},source:{type:"string",description:(0,o.localize)("ProblemMatcherSchema.source","A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.")},severity:{type:"string",enum:["error","warning","info"],description:(0,o.localize)("ProblemMatcherSchema.severity","The default severity for captures problems. Is used if the pattern doesn't define a match group for severity.")},applyTo:{type:"string",enum:["allDocuments","openDocuments","closedDocuments"],description:(0,o.localize)("ProblemMatcherSchema.applyTo","Controls if a problem reported on a text document is applied only to open, closed or all documents.")},pattern:s.PatternType,fileLocation:{oneOf:[{type:"string",enum:["absolute","relative","autoDetect"]},{type:"array",items:{type:"string"}}],description:(0,o.localize)("ProblemMatcherSchema.fileLocation","Defines how file names reported in a problem pattern should be interpreted.")},background:{type:"object",additionalProperties:!1,description:(0,o.localize)("ProblemMatcherSchema.background","Patterns to track the begin and end of a matcher active on a background task."),properties:{activeOnStart:{type:"boolean",description:(0,o.localize)("ProblemMatcherSchema.background.activeOnStart","If set to true the background monitor is in active mode when the task starts. This is equals of issuing a line that matches the beginsPattern")},beginsPattern:{oneOf:[{type:"string"},s.WatchingPattern],description:(0,o.localize)("ProblemMatcherSchema.background.beginsPattern","If matched in the output the start of a background task is signaled.")},endsPattern:{oneOf:[{type:"string"},s.WatchingPattern],description:(0,o.localize)("ProblemMatcherSchema.background.endsPattern","If matched in the output the end of a background task is signaled.")}}},watching:{type:"object",additionalProperties:!1,deprecationMessage:(0,o.localize)("ProblemMatcherSchema.watching.deprecated","The watching property is deprecated. Use background instead."),description:(0,o.localize)("ProblemMatcherSchema.watching","Patterns to track the begin and end of a watching matcher."),properties:{activeOnStart:{type:"boolean",description:(0,o.localize)("ProblemMatcherSchema.watching.activeOnStart","If set to true the watcher is in active mode when the task starts. This is equals of issuing a line that matches the beginPattern")},beginsPattern:{oneOf:[{type:"string"},s.WatchingPattern],description:(0,o.localize)("ProblemMatcherSchema.watching.beginsPattern","If matched in the output the start of a watching task is signaled.")},endsPattern:{oneOf:[{type:"string"},s.WatchingPattern],description:(0,o.localize)("ProblemMatcherSchema.watching.endsPattern","If matched in the output the end of a watching task is signaled.")}}}}},s.LegacyProblemMatcher=v(s.ProblemMatcher),s.LegacyProblemMatcher.properties=v(s.LegacyProblemMatcher.properties)||{},s.LegacyProblemMatcher.properties.watchedTaskBeginsRegExp={type:"string",deprecationMessage:(0,o.localize)("LegacyProblemMatcherSchema.watchedBegin.deprecated","This property is deprecated. Use the watching property instead."),description:(0,o.localize)("LegacyProblemMatcherSchema.watchedBegin","A regular expression signaling that a watched tasks begins executing triggered through file watching.")},s.LegacyProblemMatcher.properties.watchedTaskEndsRegExp={type:"string",deprecationMessage:(0,o.localize)("LegacyProblemMatcherSchema.watchedEnd.deprecated","This property is deprecated. Use the watching property instead."),description:(0,o.localize)("LegacyProblemMatcherSchema.watchedEnd","A regular expression signaling that a watched tasks ends executing.")},s.NamedProblemMatcher=v(s.ProblemMatcher),s.NamedProblemMatcher.properties=v(s.NamedProblemMatcher.properties)||{},s.NamedProblemMatcher.properties.name={type:"string",description:(0,o.localize)("NamedProblemMatcherSchema.name","The name of the problem matcher used to refer to it.")},s.NamedProblemMatcher.properties.label={type:"string",description:(0,o.localize)("NamedProblemMatcherSchema.label","A human readable label of the problem matcher.")}})(m||(t.Schemas=m={})),t.problemMatchersSchema={description:(0,o.localize)("ProblemMatcherExtPoint","Contributes problem matchers"),type:"array",items:m.NamedProblemMatcher};let _=class extends a.VSCodeContributePoint{contribute(){for(const g of this.contributesMap){const{contributes:l}=g;for(const h of l)this.addDispose(this.problemMatcher.register(h))}}};t.ProblemMatchersContributionPoint=_,n.__decorate([(0,r.Autowired)(o.IProblemMatcherRegistry),n.__metadata("design:type",Object)],_.prototype,"problemMatcher",void 0),t.ProblemMatchersContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("problemMatchers"),(0,a.LifeCycle)(4)],_)},49661:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProblemPatternsContributionPoint=t.problemPatternsSchema=t.PatternSchemas=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(99220),{deepClone:p}=o.objects;var v;(function(_){_.ProblemPattern={default:{regexp:"^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",file:1,location:2,message:3},type:"object",additionalProperties:!1,properties:{regexp:{type:"string",description:(0,o.localize)("ProblemPatternSchema.regexp","The regular expression to find an error, warning or info in the output.")},kind:{type:"string",description:(0,o.localize)("ProblemPatternSchema.kind","whether the pattern matches a location (file and line) or only a file.")},file:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.file","The match group index of the filename. If omitted 1 is used.")},location:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.location","The match group index of the problem's location. Valid location patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). If omitted (line,column) is assumed.")},line:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.line","The match group index of the problem's line. Defaults to 2")},column:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.column","The match group index of the problem's line character. Defaults to 3")},endLine:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.endLine","The match group index of the problem's end line. Defaults to undefined")},endColumn:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.endColumn","The match group index of the problem's end line character. Defaults to undefined")},severity:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.severity","The match group index of the problem's severity. Defaults to undefined")},code:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.code","The match group index of the problem's code. Defaults to undefined")},message:{type:"integer",description:(0,o.localize)("ProblemPatternSchema.message","The match group index of the message. If omitted it defaults to 4 if location is specified. Otherwise it defaults to 5.")},loop:{type:"boolean",description:(0,o.localize)("ProblemPatternSchema.loop","In a multi line matcher loop indicated whether this pattern is executed in a loop as long as it matches. Can only specified on a last pattern in a multi line pattern.")}}},_.NamedProblemPattern=p(_.ProblemPattern),_.NamedProblemPattern.properties=p(_.NamedProblemPattern.properties)||{},_.NamedProblemPattern.properties.name={type:"string",description:(0,o.localize)("NamedProblemPatternSchema.name","The name of the problem pattern.")},_.MultiLineProblemPattern={type:"array",items:_.ProblemPattern},_.NamedMultiLineProblemPattern={type:"object",additionalProperties:!1,properties:{name:{type:"string",description:(0,o.localize)("NamedMultiLineProblemPatternSchema.name","The name of the problem multi line problem pattern.")},patterns:{type:"array",description:(0,o.localize)("NamedMultiLineProblemPatternSchema.patterns","The actual patterns."),items:_.ProblemPattern}}}})(v||(t.PatternSchemas=v={})),t.problemPatternsSchema={description:(0,o.localize)("ProblemPatternExtPoint","Contributes problem patterns"),type:"array",items:{anyOf:[v.NamedProblemPattern,v.NamedMultiLineProblemPattern]}};let m=class extends a.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{contributes:g}=s;for(const l of g)this.addDispose(this.problemPattern.register(l))}}};t.ProblemPatternsContributionPoint=m,n.__decorate([(0,r.Autowired)(o.IProblemPatternRegistry),n.__metadata("design:type",Object)],m.prototype,"problemPattern",void 0),t.ProblemPatternsContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("problemPatterns"),(0,a.LifeCycle)(4)],m)},53082:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductIconThemesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(52416),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=l.map(d=>({...d,label:this.getLocalizeFromNlsJSON(d.label,g),extensionId:g})),u=this.extensionManageService.getExtensionInstanceByExtId(g);u&&this.productIconService.registerProductIconThemes(h,o.URI.from(u.uri))}}};t.ProductIconThemesContributionPoint=m,n.__decorate([(0,r.Autowired)(a.IProductIconService),n.__metadata("design:type",Object)],m.prototype,"productIconService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.ProductIconThemesContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("productIconThemes"),(0,p.LifeCycle)(2)],m)},3076:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokenModifiersContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(85521),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{contributes:s}=_;if(!Array.isArray(s)){this.logger.warn("'configuration.semanticTokenTypes' must be an array");return}for(const g of s)(0,p.validateTypeOrModifier)(g,"semanticTokenModifier",this.logger)&&this.semanticTokenRegistry.registerTokenModifier(g.id,g.description)}}};t.SemanticTokenModifiersContributionPoint=v,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.ISemanticTokenRegistry),n.__metadata("design:type",Object)],v.prototype,"semanticTokenRegistry",void 0),t.SemanticTokenModifiersContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("semanticTokenModifiers"),(0,p.LifeCycle)(4)],v)},19669:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokenScopesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(4892),a=e(85521),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{contributes:s}=_;if(!Array.isArray(s)){this.logger.warn("'configuration.semanticTokenScopes' must be an array");return}for(const g of s){if(!g.scopes||typeof g.scopes!="object"){this.logger.warn("'configuration.semanticTokenScopes.scopes' must be defined as an object");continue}if(g.language&&typeof g.language!="string"){this.logger.warn("'configuration.semanticTokenScopes.language' must be as a string");continue}for(const l in g.scopes){const h=g.scopes[l];if(!Array.isArray(h)||h.some(u=>typeof u!="string")){this.logger.error("'configuration.semanticTokenScopes.scopes' values must be an array of strings");continue}try{const u=this.semanticTokenRegistry.parseTokenSelector(l,g.language);this.semanticTokenRegistry.registerTokenStyleDefault(u,{scopesToProbe:h.map(d=>d.split(" "))})}catch{this.logger.error(`configuration.semanticTokenScopes.scopes': Problems parsing selector ${l}.`)}}}}}};t.SemanticTokenScopesContributionPoint=v,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.ISemanticTokenRegistry),n.__metadata("design:type",Object)],v.prototype,"semanticTokenRegistry",void 0),t.SemanticTokenScopesContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("semanticTokenScopes"),(0,p.LifeCycle)(4)],v)},92659:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokenTypesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(75694),a=e(85521),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{contributes:s}=_;if(!Array.isArray(s)){this.logger.warn("'configuration.semanticTokenTypes' must be an array");return}for(const g of s)(0,p.validateTypeOrModifier)(g,"semanticTokenType",this.logger)&&this.semanticTokenRegistry.registerTokenType(g.id,g.description,g.superType)}}};t.SemanticTokenTypesContributionPoint=v,n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(a.ISemanticTokenRegistry),n.__metadata("design:type",Object)],v.prototype,"semanticTokenRegistry",void 0),t.SemanticTokenTypesContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("semanticTokenTypes"),(0,p.LifeCycle)(4)],v)},75943:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SnippetsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(32002),a=e(99220),p=e(71354);let v=class extends a.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{extensionId:s,contributes:g}=_,l=this.extensionManageService.getExtensionInstanceByExtId(s);if(l)for(const h of g)this.addDispose(this.snippetSuggestProvider.fromPath(h.path,{extPath:l.path,language:h.language,source:l.packageJSON.name}))}this.addDispose(this.snippetSuggestProvider.registerSnippetsProvider())}};t.SnippetsContributionPoint=v,n.__decorate([(0,r.Autowired)(o.MonacoSnippetSuggestProvider),n.__metadata("design:type",o.MonacoSnippetSuggestProvider)],v.prototype,"snippetSuggestProvider",void 0),n.__decorate([(0,r.Autowired)(p.AbstractExtInstanceManagementService),n.__metadata("design:type",p.AbstractExtInstanceManagementService)],v.prototype,"extensionManageService",void 0),t.SnippetsContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,a.Contributes)("snippets"),(0,a.LifeCycle)(4)],v)},77901:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskDefinitionContributionPoint=t.taskDefinitionSchema=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(99220);t.taskDefinitionSchema={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:(0,o.localize)("TaskDefinition.description","The actual task type. Please note that types starting with a '$' are reserved for internal usage.")},required:{type:"array",items:{type:"string"}},properties:{type:"object",description:(0,o.localize)("TaskDefinition.properties","Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-04/schema#"}}}};let v=class extends p.VSCodeContributePoint{constructor(){super(...arguments),this.phase=3}contribute(){for(const _ of this.contributesMap){const{extensionId:s,contributes:g}=_;for(const l of g)this.logger.verbose(`${s} register taskDefinition ${JSON.stringify(l)}`),this.addDispose(this.taskDefinitionRegistry.register(l.type,{...l,taskType:l.type,extensionId:s}))}}};t.TaskDefinitionContributionPoint=v,n.__decorate([(0,r.Autowired)(a.ITaskDefinitionRegistry),n.__metadata("design:type",Object)],v.prototype,"taskDefinitionRegistry",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),t.TaskDefinitionContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("taskDefinitions"),(0,p.LifeCycle)(4)],v)},88797:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(26405),p=e(99220);let v=class extends p.VSCodeContributePoint{contribute(){for(const _ of this.contributesMap){const{extensionId:s,contributes:g}=_;this.profileService.addContributedProfile(s,g)}}dispose(){for(const _ of this.contributesMap){const{extensionId:s}=_;this.profileService.removeContributedProfile(s)}}};t.TerminalContributionPoint=v,v.schema={description:(0,o.localize)("vscode.extension.contributes.terminal","Contributes terminal functionality."),type:"object",properties:{types:{type:"array",description:(0,o.localize)("vscode.extension.contributes.terminal.types","Defines additional terminal types that the user can create."),items:{type:"object",required:["command","title"],properties:{command:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.command","Command to execute when the user creates this type of terminal."),type:"string"},title:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.title","Title for this type of terminal."),type:"string"},icon:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon","A codicon, URI, or light and dark URIs to associate with this terminal type."),anyOf:[{type:"string"},{type:"object",properties:{light:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon.light","Icon path when a light theme is used"),type:"string"},dark:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon.dark","Icon path when a dark theme is used"),type:"string"}}}]}}}},profiles:{type:"array",description:(0,o.localize)("vscode.extension.contributes.terminal.profiles","Defines additional terminal profiles that the user can create."),items:{type:"object",required:["id","title"],defaultSnippets:[{body:{id:"$1",title:"$2"}}],properties:{id:{description:(0,o.localize)("vscode.extension.contributes.terminal.profiles.id","The ID of the terminal profile provider."),type:"string"},title:{description:(0,o.localize)("vscode.extension.contributes.terminal.profiles.title","Title for this terminal profile."),type:"string"},icon:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon","A codicon, URI, or light and dark URIs to associate with this terminal type."),anyOf:[{type:"string"},{type:"object",properties:{light:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon.light","Icon path when a light theme is used"),type:"string"},dark:{description:(0,o.localize)("vscode.extension.contributes.terminal.types.icon.dark","Icon path when a dark theme is used"),type:"string"}}}]}}}}}},n.__decorate([(0,r.Autowired)(a.ITerminalProfileService),n.__metadata("design:type",Object)],v.prototype,"profileService",void 0),t.TerminalContributionPoint=v=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("terminal"),(0,p.LifeCycle)(4)],v)},91688:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemesContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(43718),a=e(52416),p=e(99220),v=e(71354);let m=class extends p.VSCodeContributePoint{contribute(){for(const s of this.contributesMap){const{extensionId:g,contributes:l}=s,h=l.map(d=>({...d,label:this.getLocalizeFromNlsJSON(d.label,g),extensionId:g})),u=this.extensionManageService.getExtensionInstanceByExtId(g);u&&this.themeService.registerThemes(h,o.URI.from(u.uri))}}};t.ThemesContributionPoint=m,n.__decorate([(0,r.Autowired)(a.IThemeService),n.__metadata("design:type",Object)],m.prototype,"themeService",void 0),n.__decorate([(0,r.Autowired)(v.AbstractExtInstanceManagementService),n.__metadata("design:type",v.AbstractExtInstanceManagementService)],m.prototype,"extensionManageService",void 0),t.ThemesContributionPoint=m=n.__decorate([(0,r.Injectable)(),(0,p.Contributes)("themes"),(0,p.LifeCycle)(2)],m)},55993:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewContainersContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(26471),a=e(43718),p=e(63067),v=e(52416),m=e(99220),_=e(71354);let s=class extends m.VSCodeContributePoint{constructor(){super(...arguments),this.disposableCollection=new a.DisposableCollection}convertLocationToSide(l){switch(l){case"activitybar":return["left","vertical"];case"ai-chat":return[o.AI_CHAT_VIEW_ID,"vertical"];default:return["bottom","horizontal"]}}contribute(){for(const l of this.contributesMap){const{extensionId:h,contributes:u}=l,d=this.extensionManageService.getExtensionInstanceByExtId(h);if(d)for(const E of Object.keys(u)){const[f,c]=this.convertLocationToSide(E);for(const y of u[E]){const b=this.mainlayoutService.collectTabbarComponent([],{iconClass:this.toIconClass(y.icon,v.IconType.Mask,d.path),title:this.getLocalizeFromNlsJSON(y.title,h),containerId:y.id,priority:0,fromExtension:!0,hideIfEmpty:!0,alignment:c},f);this.disposableCollection.push({dispose:()=>{const A=this.mainlayoutService.getTabbarHandler(b);A?.dispose()}})}}}}dispose(){this.disposableCollection.dispose()}getViewsMap(l){const h=l.views,u={};if(h)for(const d of Object.keys(h))h[d]&&Array.isArray(h[d])&&(u[d]=h[d].map(E=>E.id));return u}};t.ViewContainersContributionPoint=s,n.__decorate([(0,r.Autowired)(p.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],s.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(_.AbstractExtInstanceManagementService),n.__metadata("design:type",_.AbstractExtInstanceManagementService)],s.prototype,"extensionManageService",void 0),t.ViewContainersContributionPoint=s=n.__decorate([(0,r.Injectable)(),(0,m.Contributes)("viewsContainers"),(0,m.LifeCycle)(2)],s)},36198:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsWelcomeContributionPoint=t.ViewIdentifierMap=t.ViewsWelcomeExtensionPointFields=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(66482),p=e(87518),v=e(63067),m=e(61656),_=e(23268),s=e(99220);var g;(function(u){u.view="view",u.contents="contents",u.when="when",u.group="group",u.enablement="enablement"})(g||(t.ViewsWelcomeExtensionPointFields=g={})),t.ViewIdentifierMap={explorer:p.FILE_EXPLORER_WELCOME_ID,debug:a.DEBUG_WELCOME_ID,scm:m.SCM_WELCOME_ID};let l=class extends s.VSCodeContributePoint{constructor(){super(...arguments),this.disposableCollection=new o.DisposableCollection}contribute(){var d;const E=new Map;for(const f of this.contributesMap){const{extensionId:c,contributes:y}=f;for(const b of y){const{group:A,order:S}=h(b),D=_.ContextKeyExpr.deserialize(b.enablement),I=(d=t.ViewIdentifierMap[b.view])!==null&&d!==void 0?d:b.view;let w=E.get(I);w||(w=new Map,E.set(I,w)),w.set(b,{content:this.getLocalizeFromNlsJSON(b.contents,c),when:_.ContextKeyExpr.deserialize(b.when),precondition:D,group:A,order:S})}}for(const[f,c]of E){const y=this.viewsRegistry.registerViewWelcomeContent2(f,c);for(const[,b]of y)this.disposableCollection.push(b)}}dispose(){this.disposableCollection.dispose()}};t.ViewsWelcomeContributionPoint=l,l.schema={type:"array",description:(0,o.localize)("contributes.viewsWelcome","Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view."),items:{type:"object",description:(0,o.localize)("contributes.viewsWelcome.view","Contributed welcome content for a specific view."),required:[g.view,g.contents],properties:{[g.view]:{anyOf:[{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.view","Target view identifier for this welcome content. Only tree based views are supported.")},{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.view","Target view identifier for this welcome content. Only tree based views are supported."),enum:Object.keys(t.ViewIdentifierMap)}]},[g.contents]:{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.contents","Welcome content to be displayed. The format of the contents is a subset of Markdown, with support for links only.")},[g.when]:{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.when","Condition when the welcome content should be displayed.")},[g.group]:{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.group","Group to which this welcome content belongs.")},[g.enablement]:{type:"string",description:(0,o.localize)("contributes.viewsWelcome.view.enablement","Condition when the welcome content buttons and command links should be enabled.")}}}},n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],l.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(v.IViewsRegistry),n.__metadata("design:type",Object)],l.prototype,"viewsRegistry",void 0),t.ViewsWelcomeContributionPoint=l=n.__decorate([(0,r.Injectable)(),(0,s.Contributes)("viewsWelcome"),(0,s.LifeCycle)(3)],l);function h(u){let d,E;if(u.group){const f=u.group.lastIndexOf("@");f>0?(d=u.group.substr(0,f),E=Number(u.group.substr(f+1))||void 0):d=u.group}return{group:d,order:E}}},12191:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ViewsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(63067),p=e(24429),v=e(99220),m=e(88341);let _=class extends v.VSCodeContributePoint{constructor(){super(...arguments),this.disposableCollection=new o.DisposableCollection}contribute(){for(const g of this.contributesMap){const{extensionId:l,contributes:h}=g;for(const u of Object.keys(h)){const d=h[u].map(E=>({...E,name:this.getLocalizeFromNlsJSON(E.name,l),component:E.type==="webview"?m.ExtensionWebviewView:p.WelcomeView}));for(const E of d){const f=this.mainLayoutService.collectViewComponent(E,u,{viewId:E.id},{fromExtension:!0});this.disposableCollection.push({dispose:()=>{const c=this.mainLayoutService.getTabbarHandler(f);c?.disposeView(E.id)}})}}}}dispose(){this.disposableCollection.dispose()}};t.ViewsContributionPoint=_,n.__decorate([(0,r.Autowired)(a.IMainLayoutService),n.__metadata("design:type",Object)],_.prototype,"mainLayoutService",void 0),t.ViewsContributionPoint=_=n.__decorate([(0,r.Injectable)(),(0,v.Contributes)("views"),(0,v.LifeCycle)(2)],_)},21218:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsContributionPoint=void 0;const n=e(85608),r=e(76003),o=e(97267),a=e(41869),p=e(43718),v=e(54414),m=e(57517),_=e(99220),s=e(21167),g=e(17441);let l=class extends _.VSCodeContributePoint{contribute(){this.addDispose(this.walkthroughsService.onDidAddWalkthrough(u=>this.registerWalkthroughEditor(u))),this.addDispose(this.resourceService.registerResourceProvider({scheme:p.Schemes.walkThrough,provideResource:async u=>({uri:u,icon:(0,o.getIcon)("smile"),supportsRevive:!1,name:(0,p.localize)("walkthroughs.welcome")})})),this.addDispose(this.walkthroughsService.onDidOpenWalkthrough(async u=>{const d=this.walkthroughsService.getWalkthrough(u);d&&await this.commandService.executeCommand(a.EDITOR_COMMANDS.OPEN_RESOURCE.id,p.URI.from({scheme:p.Schemes.walkThrough,authority:d.source,query:d.id,path:"/"+d.id}),{disableNavigate:!0,preview:!1,forceOpenType:{type:"component",componentId:this.toComponentId(d.id)}})}));for(const u of this.contributesMap){const{extensionId:d,contributes:E}=u;if(!E.length)return;for(const f of E)this.walkthroughsService.registerExtensionWalkthroughContributions(d,f)}}toComponentId(u){return`${p.CUSTOM_EDITOR_SCHEME}-${u}`}registerWalkthroughEditor(u){this.addDispose(this.editorComponentRegistry.registerEditorComponent({uid:this.toComponentId(u.id),component:s.WalkthroughsEditorView,scheme:p.Schemes.walkThrough})),this.addDispose(this.editorComponentRegistry.registerEditorComponentResolver(p.Schemes.walkThrough,(d,E,f)=>{f([{type:m.EditorOpenType.component,componentId:this.toComponentId(u.id)}])}))}};t.WalkthroughsContributionPoint=l,n.__decorate([(0,r.Autowired)(m.EditorComponentRegistry),n.__metadata("design:type",m.EditorComponentRegistry)],l.prototype,"editorComponentRegistry",void 0),n.__decorate([(0,r.Autowired)(g.WalkthroughsService),n.__metadata("design:type",g.WalkthroughsService)],l.prototype,"walkthroughsService",void 0),n.__decorate([(0,r.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],l.prototype,"resourceService",void 0),n.__decorate([(0,r.Autowired)(p.CommandService),n.__metadata("design:type",Object)],l.prototype,"commandService",void 0),t.WalkthroughsContributionPoint=l=n.__decorate([(0,r.Injectable)(),(0,_.Contributes)("walkthroughs"),(0,_.LifeCycle)(3)],l)},17441:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkthroughsService=void 0;const n=e(85608),r=e(76003),o=e(41869),a=e(43718),p=e(14951),v=e(2156),m=e(55121),_=e(23268),s=e(99220),g=e(71354),l=u=>u.split(`
31926
31926
  `).filter(d=>d).map(d=>(0,o.parseLinkedText)(d));let h=class extends o.Disposable{constructor(){super(),this._onDidOpenWalkthrough=new o.Emitter,this.onDidOpenWalkthrough=this._onDidOpenWalkthrough.event,this._onDidAddWalkthrough=new o.Emitter,this.onDidAddWalkthrough=this._onDidAddWalkthrough.event,this._onDidProgressStep=new o.Emitter,this.onDidProgressStep=this._onDidProgressStep.event,this.sessionEvents=new Set,this.categoryVisibilityContextKeys=new Set,this.stepCompletionContextKeyExpressions=new Set,this.stepCompletionContextKeys=new Set,this.completionListeners=new Map,this.contributions=new Map,this.steps=new Map,this.extensionSteps=new Map,this.stepProgress={},this.initCompletionEventListeners()}initCompletionEventListeners(){this.addDispose(this.commandService.onDidExecuteCommand(({commandId:d})=>{this.progressByEvent(`${s.CompletionEventsType.onCommand}:${d}`)})),this.addDispose(this.contextKeyService.onDidChangeContext(({payload:d})=>{d.affectsSome(this.stepCompletionContextKeys)&&this.stepCompletionContextKeyExpressions.forEach(E=>{d.affectsSome(new Set(E.keys()))&&this.contextKeyService.match(E)&&this.progressByEvent(s.CompletionEventsType.onContext+":"+E.serialize())})})),this.addDispose(this.eventBus.on(a.ExtensionActivateEvent,({payload:{topic:d,data:E}})=>{d===s.CompletionEventsType.onView&&this.progressByEvent(s.CompletionEventsType.onView+":"+E)})),this.addDispose(this.preferenceService.onPreferenceChanged(({preferenceName:d})=>{d&&this.progressByEvent(s.CompletionEventsType.onSettingChanged+":"+d)}))}registerDoneListeners(d){var E;d.completionEvents.length||d.completionEvents.push(s.CompletionEventsType.stepSelected);for(let f of d.completionEvents){const[c,y,b]=(E=/^([^:]*):?(.*)$/.exec(f))!==null&&E!==void 0?E:[];if(!y){this.logger.error(`Unknown completionEvent ${f} when registering step ${d.id}`);continue}switch(y){case s.CompletionEventsType.onLink:case s.CompletionEventsType.onEvent:case s.CompletionEventsType.onView:case s.CompletionEventsType.onSettingChanged:break;case s.CompletionEventsType.onContext:{const A=_.ContextKeyExpr.deserialize(b);A?(this.stepCompletionContextKeyExpressions.add(A),A.keys().forEach(S=>this.stepCompletionContextKeys.add(S)),f=y+":"+A.serialize(),this.contextKeyService.match(A)&&this.sessionEvents.add(f)):this.logger.error(`Unable to parse context key expression: ${A} in walkthrough step ${d.id}`);break}case s.CompletionEventsType.onStepSelected:case s.CompletionEventsType.stepSelected:f=s.CompletionEventsType.stepSelected+":"+d.id;break;case s.CompletionEventsType.onCommand:f=y+":"+b.replace(/^toSide:/,"");break;case s.CompletionEventsType.onExtensionInstalled:case s.CompletionEventsType.extensionInstalled:f=s.CompletionEventsType.extensionInstalled+":"+b.toLowerCase();break;default:this.logger.error(`${f} Unknown`);continue}this.registerCompletionListener(f,d),this.sessionEvents.has(f)&&this.progressStep(d.id)}}getStep(d){return this.steps.get(d)}registerCompletionListener(d,E){var f;this.completionListeners.has(d)||this.completionListeners.set(d,new Set),(f=this.completionListeners.get(d))===null||f===void 0||f.add(E.id)}registerWalkthrough(d){this.contributions.get(d.id)||(this.contributions.set(d.id,d),d.steps.forEach(f=>{if(this.steps.has(f.id)){this.logger.error(`${f.id} Repeat`);return}this.steps.set(f.id,f),f.when.keys().forEach(c=>this.categoryVisibilityContextKeys.add(c)),this.registerDoneListeners(f)}),d.when.keys().forEach(f=>this.categoryVisibilityContextKeys.add(f)))}getStepProgress(d){return{...d,done:!1,...this.stepProgress[d.id]}}progressByEvent(d){var E;this.sessionEvents.has(d)||(this.sessionEvents.add(d),(E=this.completionListeners.get(d))===null||E===void 0||E.forEach(f=>this.progressStep(f)))}progressStep(d){const E=this.stepProgress[d];if(!E||E.done!==!0){this.stepProgress[d]={done:!0};const f=this.getStep(d);if(!f)return;this._onDidProgressStep.fire(this.getStepProgress(f))}}openWalkthroughEditor(d){this.stepProgress={},this._onDidOpenWalkthrough.fire(d)}getWalkthrough(d){return this.contributions.get(d)}getStepsByExtension(d){return this.extensionSteps.get(d)}getWalkthroughs(){return Array.from(this.contributions.values())}async getFileContent(d,E){const f=a.BinaryBuffer.alloc(0),c=this.extensionManageService.getExtensionInstanceByExtId(d);if(!c||!c.uri)return f;const y=o.URI.from(c.uri).resolve(E).toString(),b=await this.fileSystem.getFileStat(y);if(b&&b.type===a.FileType.File){const{content:A}=await this.fileSystem.readFile(y);return A}return f}async registerExtensionWalkthroughContributions(d,E){var f,c;const y=this.extensionManageService.getExtensionInstanceByExtId(d);if(!y)return;const b=T=>T.startsWith("https://")?o.URI.parse(T):o.URI.from(y.extensionLocation).resolve(T),A=T=>{var R;if(typeof T=="string"){const P=b(T);return{hcDark:P,hcLight:P,dark:P,light:P}}else return{hcDark:b(T.hc),hcLight:b((R=T.hcLight)!==null&&R!==void 0?R:T.light),light:b(T.light),dark:b(T.dark)}},S=d+"#"+E.id,D=((f=E.steps)!==null&&f!==void 0?f:[]).filter(T=>{if(!T.media){this.logger.error("missing media in walkthrough step: "+E.id+"@"+T.id);return}if(!(T.media.markdown||T.media.svg||T.media.image)){this.logger.error("Unknown walkthrough format detected for: "+d+"#"+E.id+"#"+T.id);return}return T}).map((T,R)=>{var P,O,M;const k=l(T.description||""),F=d+"#"+E.id+"#"+T.id;let L;return T.media.image?L={type:"image",altText:T.media.altText,path:A(T.media.image)}:T.media.markdown?L={type:"markdown",path:b(T.media.markdown),base:b((0,m.dirname)(T.media.markdown)),root:o.URI.from(y.extensionLocation)}:T.media.svg&&(L={type:"svg",path:b(T.media.svg),altText:T.media.svg}),this.extensionSteps.set(F,T),{description:k,media:L,completionEvents:(O=(P=T.completionEvents)===null||P===void 0?void 0:P.filter(B=>typeof B=="string"))!==null&&O!==void 0?O:[],id:F,title:T.title,when:(M=_.ContextKeyExpr.deserialize(T.when))!==null&&M!==void 0?M:_.ContextKeyExpr.true(),category:S,order:R}});let I=E.icon?o.URI.from(y.extensionLocation).resolve(E.icon):y.icon;I||(I=await y.getDefaultIcon());const w={description:E.description,title:E.title,id:S,isFeatured:!1,source:d,order:0,steps:D,icon:{type:"image",path:I},when:(c=_.ContextKeyExpr.deserialize(E.when))!==null&&c!==void 0?c:_.ContextKeyExpr.true()};this.registerWalkthrough(w),this._onDidAddWalkthrough.fire(w)}};t.WalkthroughsService=h,n.__decorate([(0,r.Autowired)(g.AbstractExtInstanceManagementService),n.__metadata("design:type",g.AbstractExtInstanceManagementService)],h.prototype,"extensionManageService",void 0),n.__decorate([(0,r.Autowired)(a.CommandService),n.__metadata("design:type",Object)],h.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],h.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",v.FileServiceClient)],h.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(a.IEventBus),n.__metadata("design:type",Object)],h.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(a.ILogger),n.__metadata("design:type",Object)],h.prototype,"logger",void 0),t.WalkthroughsService=h=n.__decorate([(0,r.Injectable)({multiple:!1}),n.__metadata("design:paramtypes",[])],h)},65055:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WORKER_HOST_HARD_CODE=void 0,t.startInsideIframe=r;const n=e(43718);t.WORKER_HOST_HARD_CODE=`
31927
31927
  (function() {