ext("  |  "),Y.appendMarkdown(`$(${d.installCountIcon.id}) ${Z}`),te=!0),this.extension.rating){te&&Y.appendText("  |  ");const ne=Math.round(this.extension.rating*2)/2;Y.appendMarkdown(`$(${d.starFullIcon.id}) [${ne}](${this.extension.url}&ssr=false#review-details)`),te=!0}this.extension.publisherSponsorLink&&(te&&Y.appendText("  |  "),Y.appendMarkdown(`$(${d.sponsorIcon.id}) [${(0,E.localize)(7,null)}](${this.extension.publisherSponsorLink})`),te=!0),te&&Y.appendText(`
`)}if(this.extension.description&&(Y.appendMarkdown(`${this.extension.description}`),Y.appendText(`
`)),this.extension.publisherDomain?.verified){const te=this.themeService.getColorTheme().getColor(e.extensionVerifiedPublisherIconColor),Z=(0,E.localize)(8,null,`[${g.URI.parse(this.extension.publisherDomain.link).authority}](${this.extension.publisherDomain.link})`);Y.appendMarkdown(`<span style="color:${te?D.Color.Format.CSS.formatHex(te):"#ffffff"};">$(${d.verifiedPublisherIcon.id})</span>&nbsp;${Z}`),Y.appendText(`
`)}this.extension.outdated&&(Y.appendMarkdown((0,E.localize)(9,null)),Y.appendMarkdown(`&nbsp;<span style="background-color:#8080802B;">**&nbsp;_v${this.extension.latestVersion}_**&nbsp;</span>`),Y.appendText(`
`));const ee=Vc.getPreReleaseMessage(this.extension),ie=this.extensionsWorkbenchService.getExtensionStatus(this.extension),re=this.extensionStatusAction.status,oe=this.extension.reloadRequiredStatus,se=this.getRecommendationMessage(this.extension);if(ie||re||oe||se||ee){if(Y.appendMarkdown("---"),Y.appendText(`
`),ie){if(ie.activationTimes){const te=ie.activationTimes.codeLoadingTime+ie.activationTimes.activateCallTime;Y.appendMarkdown(`${(0,E.localize)(10,null)}${ie.activationTimes.activationReason.startup?` (${(0,E.localize)(11,null)})`:""}: \`${te}ms\``),Y.appendText(`
`)}if(ie.runtimeErrors.length||ie.messages.length){const te=ie.runtimeErrors.length||ie.messages.some(de=>de.type===m.default.Error),Z=ie.messages.some(de=>de.type===m.default.Warning),ne=ie.runtimeErrors.length?`[${ie.runtimeErrors.length===1?(0,E.localize)(12,null):(0,E.localize)(13,null,ie.runtimeErrors.length)}](${g.URI.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,"runtimeStatus"]))}`)})`:void 0,ce=ie.messages.length?`[${ie.messages.length===1?(0,E.localize)(14,null):(0,E.localize)(15,null,ie.messages.length)}](${g.URI.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,"runtimeStatus"]))}`)})`:void 0;Y.appendMarkdown(`$(${te?d.errorIcon.id:Z?d.warningIcon.id:d.infoIcon.id}) This extension has reported `),ne&&ce?Y.appendMarkdown(`${ne} and ${ce}`):Y.appendMarkdown(`${ne||ce}`),Y.appendText(`
`)}}if(re&&(re.icon&&Y.appendMarkdown(`$(${re.icon.id})&nbsp;`),Y.appendMarkdown(re.message.value),this.extension.enablementState===5&&this.extension.local&&Y.appendMarkdown(`&nbsp;[${(0,E.localize)(16,null)}](${g.URI.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,"dependencies"]))}`)})`),Y.appendText(`
`)),oe&&(Y.appendMarkdown(`$(${d.infoIcon.id})&nbsp;`),Y.appendMarkdown(`${oe}`),Y.appendText(`
`)),ee){const te=this.themeService.getColorTheme().getColor(e.extensionPreReleaseIconColor);Y.appendMarkdown(`<span style="color:${te?D.Color.Format.CSS.formatHex(te):"#ffffff"};">$(${d.preReleaseIcon.id})</span>&nbsp;${ee}`),Y.appendText(`
`)}se&&(Y.appendMarkdown(se),Y.appendText(`
`))}return Y}getRecommendationMessage(Y){if(Y.state===1||Y.deprecationInfo)return;const ee=this.extensionRecommendationsService.getAllRecommendationsWithReason()[Y.identifier.id.toLowerCase()];if(!ee?.reasonText)return;const ie=this.themeService.getColorTheme().getColor(C.extensionButtonProminentBackground);return`<span style="color:${ie?D.Color.Format.CSS.formatHex(ie):"#ffffff"};">$(${d.starEmptyIcon.id})</span>&nbsp;${ee.reasonText}`}static getPreReleaseMessage(Y){if(!Y.hasPreReleaseVersion||Y.isBuiltin||Y.local?.isPreReleaseVersion||Y.gallery?.properties.isPreReleaseVersion)return;const ee=`[${(0,E.localize)(17,null)}](${g.URI.parse(`command:workbench.extensions.action.showPreReleaseVersion?${encodeURIComponent(JSON.stringify([Y.identifier.id]))}`)})`;return(0,E.localize)(18,null,ee)}};G=we([F(2,R.IExtensionsWorkbenchService),F(3,a.IHoverService),F(4,l.IConfigurationService),F(5,b.IExtensionRecommendationsService),F(6,r.IThemeService)],G),e.ExtensionHoverWidget=G;let Q=class extends N{constructor(Y,ee,ie){super(),this.container=Y,this.extensionStatusAction=ee,this.openerService=ie,this.renderDisposables=this._register(new p.DisposableStore),this._onDidRender=this._register(new i.Emitter),this.onDidRender=this._onDidRender.event,this.render(),this._register(ee.onDidChangeStatus(()=>this.render()))}render(){(0,A.reset)(this.container);const Y=this.extensionStatusAction.status;if(Y){const ee=new o.MarkdownString("",{isTrusted:!0,supportThemeIcons:!0});Y.icon&&ee.appendMarkdown(`$(${Y.icon.id})&nbsp;`),ee.appendMarkdown(Y.message.value);const ie=this.renderDisposables.add((0,y.renderMarkdown)(ee,{actionHandler:{callback:re=>{this.openerService.open(re,{allowCommands:!0}).catch(_.onUnexpectedError)},disposables:this.renderDisposables}}));(0,A.append)(this.container,ie.element)}this._onDidRender.fire()}};Q=we([F(2,T.IOpenerService)],Q),e.ExtensionStatusWidget=Q;let j=class extends N{constructor(Y,ee,ie){super(),this.container=Y,this.extensionRecommendationsService=ee,this.extensionIgnoredRecommendationsService=ie,this._onDidRender=this._register(new i.Emitter),this.onDidRender=this._onDidRender.event,this.render(),this._register(this.extensionRecommendationsService.onDidChangeRecommendations(()=>this.render()))}render(){(0,A.reset)(this.container);const Y=this.getRecommendationStatus();Y&&(Y.icon&&(0,A.append)(this.container,(0,A.$)(`div${r.ThemeIcon.asCSSSelector(Y.icon)}`)),(0,A.append)(this.container,(0,A.$)("div.recommendation-text",void 0,Y.message))),this._onDidRender.fire()}getRecommendationStatus(){if(!this.extension||this.extension.deprecationInfo||this.extension.state===1)return;const Y=this.extensionRecommendationsService.getAllRecommendationsWithReason();if(Y[this.extension.identifier.id.toLowerCase()]){const ee=Y[this.extension.identifier.id.toLowerCase()].reasonText;if(ee)return{icon:d.starEmptyIcon,message:ee}}else if(this.extensionIgnoredRecommendationsService.globalIgnoredRecommendations.indexOf(this.extension.identifier.id.toLowerCase())!==-1)return{icon:void 0,message:(0,E.localize)(19,null)}}};j=we([F(1,b.IExtensionRecommendationsService),F(2,b.IExtensionIgnoredRecommendationsService)],j),e.ExtensionRecommendationWidget=j,e.extensionRatingIconColor=(0,n.registerColor)("extensionIcon.starForeground",{light:"#DF6100",dark:"#FF8E00",hcDark:"#FF8E00",hcLight:n.textLinkForeground},(0,E.localize)(20,null),!0),e.extensionVerifiedPublisherIconColor=(0,n.registerColor)("extensionIcon.verifiedForeground",{dark:n.textLinkForeground,light:n.textLinkForeground,hcDark:n.textLinkForeground,hcLight:n.textLinkForeground},(0,E.localize)(21,null),!0),e.extensionPreReleaseIconColor=(0,n.registerColor)("extensionIcon.preReleaseForeground",{dark:"#1d9271",light:"#1d9271",hcDark:"#1d9271",hcLight:n.textLinkForeground},(0,E.localize)(22,null),!0),e.extensionSponsorIconColor=(0,n.registerColor)("extensionIcon.sponsorForeground",{light:"#B51E78",dark:"#D758B3",hcDark:null,hcLight:"#B51E78"},(0,E.localize)(23,null),!0),(0,r.registerThemingParticipant)((K,Y)=>{const ee=K.getColor(e.extensionRatingIconColor);ee&&(Y.addRule(`.extension-ratings .codicon-extensions-star-full, .extension-ratings .codicon-extensions-star-half { color: ${ee}; }`),Y.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${r.ThemeIcon.asCSSSelector(d.starFullIcon)} { color: ${ee}; }`));const ie=K.getColor(e.extensionVerifiedPublisherIconColor);ie&&Y.addRule(`${r.ThemeIcon.asCSSSelector(d.verifiedPublisherIcon)} { color: ${ie}; }`),Y.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${r.ThemeIcon.asCSSSelector(d.sponsorIcon)} { color: var(--vscode-extensionIcon-sponsorForeground); }`),Y.addRule(`.extension-editor > .header > .details > .subtitle .sponsor ${r.ThemeIcon.asCSSSelector(d.sponsorIcon)} { color: var(--vscode-extensionIcon-sponsorForeground); }`)})}),define(ae[705],le([1,0,10,2,79,5,6,119,320,100,1016,39,120,26,115,12,33,80,37,338,1139]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Renderer=e.Delegate=e.EXTENSION_LIST_ELEMENT_HEIGHT=void 0,e.EXTENSION_LIST_ELEMENT_HEIGHT=62;class n{getHeight(){return e.EXTENSION_LIST_ELEMENT_HEIGHT}getTemplateId(){return"extension"}}e.Delegate=n;let a=class{constructor(g,h,v,m,w,D,y,T){this.extensionViewState=g,this.options=h,this.instantiationService=v,this.notificationService=m,this.extensionService=w,this.extensionManagementServerService=D,this.extensionsWorkbenchService=y,this.contextMenuService=T}get templateId(){return"extension"}renderTemplate(g){const h=this.instantiationService.createInstance(S.RecommendationWidget,(0,t.append)(g,(0,t.$)(".extension-bookmark-container"))),v=this.instantiationService.createInstance(S.PreReleaseBookmarkWidget,(0,t.append)(g,(0,t.$)(".extension-bookmark-container"))),m=(0,t.append)(g,(0,t.$)(".extension-list-item")),w=(0,t.append)(m,(0,t.$)(".icon-container")),D=(0,t.append)(w,(0,t.$)("img.icon")),y=this.instantiationService.createInstance(S.RemoteBadgeWidget,w,!1),T=this.instantiationService.createInstance(S.ExtensionPackCountWidget,w),_=(0,t.append)(m,(0,t.$)(".details")),L=(0,t.append)(_,(0,t.$)(".header-container")),M=(0,t.append)(L,(0,t.$)(".header")),O=(0,t.append)(M,(0,t.$)("span.name")),N=(0,t.append)(M,(0,t.$)("span.install-count")),P=(0,t.append)(M,(0,t.$)("span.ratings")),B=(0,t.append)(M,(0,t.$)("span.sync-ignored")),V=(0,t.append)(M,(0,t.$)("span.activation-status")),z=this.instantiationService.createInstance(S.RemoteBadgeWidget,M,!1),x=(0,t.append)(_,(0,t.$)(".description.ellipsis")),H=(0,t.append)(_,(0,t.$)(".footer")),W=(0,t.append)(H,(0,t.$)(".author.ellipsis")),U=(0,t.append)(W,(0,t.$)(`.publisher-verified${f.ThemeIcon.asCSSSelector(d.verifiedPublisherIcon)}`)),$=(0,t.append)(W,(0,t.$)(".publisher-name.ellipsis")),q=new R.ActionBar(H,{animated:!1,actionViewItemProvider:ee=>{if(ee instanceof I.ActionWithDropDownAction)return new I.ExtensionActionWithDropdownActionViewItem(ee,{icon:!0,label:!0,menuActionsOrProvider:{getActions:()=>ee.menuActions},menuActionClassNames:(ee.class||"").split(" ")},this.contextMenuService);if(ee instanceof I.ExtensionDropDownAction)return ee.createActionViewItem()},focusOnlyEnabledItems:!0});q.setFocusable(!1),q.onDidRun(({error:ee})=>ee&&this.notificationService.error(ee));const X=this.instantiationService.createInstance(I.ExtensionStatusAction),G=[this.instantiationService.createInstance(I.ExtensionStatusLabelAction),this.instantiationService.createInstance(I.MigrateDeprecatedExtensionAction,!0),this.instantiationService.createInstance(I.ReloadAction),this.instantiationService.createInstance(I.ActionWithDropDownAction,"extensions.updateActions","",[[this.instantiationService.createInstance(I.UpdateAction,!1)],[this.instantiationService.createInstance(I.SkipUpdateAction)]]),this.instantiationService.createInstance(I.InstallDropdownAction),this.instantiationService.createInstance(I.InstallingLabelAction),this.instantiationService.createInstance(I.SetLanguageAction),this.instantiationService.createInstance(I.ClearLanguageAction),this.instantiationService.createInstance(I.RemoteInstallAction,!1),this.instantiationService.createInstance(I.LocalInstallAction),this.instantiationService.createInstance(I.WebInstallAction),X,this.instantiationService.createInstance(I.SwitchToReleasedVersionAction,!0),this.instantiationService.createInstance(I.SwitchToPreReleaseVersionAction,!0),this.instantiationService.createInstance(I.ManageExtensionAction)],Q=this.instantiationService.createInstance(S.ExtensionHoverWidget,{target:g,position:this.options.hoverOptions.position},X),j=[h,v,y,T,z,Q,this.instantiationService.createInstance(S.SyncIgnoredWidget,B),this.instantiationService.createInstance(S.ExtensionActivationStatusWidget,V,!0),this.instantiationService.createInstance(S.InstallCountWidget,N,!0),this.instantiationService.createInstance(S.RatingsWidget,P,!0)],K=this.instantiationService.createInstance(E.ExtensionContainers,[...G,...j]);q.push(G,{icon:!0,label:!0});const Y=(0,p.combinedDisposable)(...G,...j,q,K);return{root:g,element:m,icon:D,name:O,installCount:N,ratings:P,description:x,publisherDisplayName:$,verifiedPublisherIcon:U,disposables:[Y],actionbar:q,extensionDisposables:[],set extension(ee){K.extension=ee}}}renderPlaceholder(g,h){h.element.classList.add("loading"),h.root.removeAttribute("aria-label"),h.root.removeAttribute("data-extension-id"),h.extensionDisposables=(0,p.dispose)(h.extensionDisposables),h.icon.src="",h.name.textContent="",h.description.textContent="",h.publisherDisplayName.textContent="",h.verifiedPublisherIcon.style.display="none",h.installCount.style.display="none",h.ratings.style.display="none",h.extension=null}renderElement(g,h,v){v.element.classList.remove("loading"),v.root.setAttribute("data-extension-id",g.identifier.id),g.state!==3&&!g.server&&(g=this.extensionsWorkbenchService.local.filter(y=>y.server===g.server&&(0,b.areSameExtensions)(y.identifier,g.identifier))[0]||g),v.extensionDisposables=(0,p.dispose)(v.extensionDisposables);const m=async()=>{if(g.state===3)return g.deprecationInfo?!0:this.extensionsWorkbenchService.canSetLanguage(g)?!1:!await this.extensionsWorkbenchService.canInstall(g);if(g.local&&!(0,i.isLanguagePackExtension)(g.local.manifest)){const y=this.extensionService.extensions.filter(T=>(0,b.areSameExtensions)({id:T.identifier.value,uuid:T.uuid},g.identifier))[0];return!(y&&g.server===this.extensionManagementServerService.getExtensionManagementServer((0,C.toExtension)(y)))}return!1},w=async()=>{const y=await m(),T=!!g.deprecationInfo;v.element.classList.toggle("deprecated",T),v.root.classList.toggle("disabled",y)};w(),this.extensionService.onDidChangeExtensions(()=>w(),this,v.extensionDisposables),v.extensionDisposables.push((0,t.addDisposableListener)(v.icon,"error",()=>v.icon.src=g.iconUrlFallback,{once:!0})),v.icon.src=g.iconUrl,v.icon.complete?v.icon.style.visibility="inherit":(v.icon.style.visibility="hidden",v.icon.onload=()=>v.icon.style.visibility="inherit"),v.name.textContent=g.displayName,v.description.textContent=g.description;const D=()=>{v.publisherDisplayName.textContent=g.publisherDisplayName,v.verifiedPublisherIcon.style.display=g.publisherDomain?.verified?"inherit":"none"};D(),k.Event.filter(this.extensionsWorkbenchService.onChange,y=>!!y&&(0,b.areSameExtensions)(y.identifier,g.identifier))(()=>D(),this,v.extensionDisposables),v.installCount.style.display="",v.ratings.style.display="",v.extension=g,g.gallery&&g.gallery.properties&&g.gallery.properties.localizedLanguages&&g.gallery.properties.localizedLanguages.length&&(v.description.textContent=g.gallery.properties.localizedLanguages.map(y=>y[0].toLocaleUpperCase()+y.slice(1)).join(", ")),this.extensionViewState.onFocus(y=>{(0,b.areSameExtensions)(g.identifier,y.identifier)&&v.actionbar.setFocusable(!0)},this,v.extensionDisposables),this.extensionViewState.onBlur(y=>{(0,b.areSameExtensions)(g.identifier,y.identifier)&&v.actionbar.setFocusable(!1)},this,v.extensionDisposables)}disposeElement(g,h,v){v.extensionDisposables=(0,p.dispose)(v.extensionDisposables)}disposeTemplate(g){g.extensionDisposables=(0,p.dispose)(g.extensionDisposables),g.disposables=(0,p.dispose)(g.disposables)}};a=we([F(2,A.IInstantiationService),F(3,u.INotificationService),F(4,C.IExtensionService),F(5,r.IExtensionManagementServerService),F(6,E.IExtensionsWorkbenchService),F(7,s.IContextMenuService)],a),e.Renderer=a,(0,f.registerThemingParticipant)((o,g)=>{const h=o.getColor(c.foreground);if(h){const T=h.transparent(.9).makeOpaque((0,l.WORKBENCH_BACKGROUND)(o));g.addRule(`.extensions-list .monaco-list .monaco-list-row:not(.disabled) .author { color: ${T}; }`);const _=h.transparent(.5).makeOpaque((0,l.WORKBENCH_BACKGROUND)(o));g.addRule(`.extensions-list .monaco-list .monaco-list-row.disabled { color: ${_}; }`)}const v=o.getColor(c.listActiveSelectionForeground);if(v){const T=o.getColor(c.listActiveSelectionBackground)||(0,l.WORKBENCH_BACKGROUND)(o),_=v.transparent(.9).makeOpaque(T);g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row:not(.disabled).focused.selected .author { color: ${_}; }`),g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row:not(.disabled).selected .author { color: ${_}; }`);const L=v.transparent(.5).makeOpaque(T);g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row.disabled.focused.selected { color: ${L}; }`),g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row.disabled.selected { color: ${L}; }`)}const m=o.getColor(c.listInactiveSelectionForeground);if(m){const T=o.getColor(c.listInactiveSelectionBackground)||(0,l.WORKBENCH_BACKGROUND)(o),_=m.transparent(.9).makeOpaque(T);g.addRule(`.extensions-list .monaco-list .monaco-list-row:not(.disabled).selected .author { color: ${_}; }`);const L=m.transparent(.5).makeOpaque(T);g.addRule(`.extensions-list .monaco-list .monaco-list-row.disabled.selected { color: ${L}; }`)}const w=o.getColor(c.listFocusForeground);if(w){const T=o.getColor(c.listFocusBackground)||(0,l.WORKBENCH_BACKGROUND)(o),_=w.transparent(.9).makeOpaque(T);g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row:not(.disabled).focused .author { color: ${_}; }`);const L=w.transparent(.5).makeOpaque(T);g.addRule(`.extensions-list .monaco-list:focus .monaco-list-row.disabled.focused { color: ${L}; }`)}const D=o.getColor(c.listHoverForeground);if(D){const T=o.getColor(c.listHoverBackground)||(0,l.WORKBENCH_BACKGROUND)(o),_=D.transparent(.9).makeOpaque(T);g.addRule(`.extensions-list .monaco-list .monaco-list-row:hover:not(.disabled):not(.selected):.not(.focused) .author { color: ${_}; }`);const L=D.transparent(.5).makeOpaque(T);g.addRule(`.extensions-list .monaco-list .monaco-list-row.disabled:hover:not(.selected):.not(.focused) { color: ${L}; }`)}const y=o.getColor(S.extensionVerifiedPublisherIconColor);if(y){const T=y.transparent(.5).makeOpaque((0,l.WORKBENCH_BACKGROUND)(o));g.addRule(`.extensions-list .monaco-list .monaco-list-row.disabled .author .publisher-verified${f.ThemeIcon.asCSSSelector(d.verifiedPublisherIcon)} { color: ${T}; }`)}})}),define(ae[3020],le([1,0,10,1656,2,36,119,6,5,76,8,7,12,32,16,705,33,90,139]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getExtensions=e.ExtensionData=e.ExtensionsTree=e.UnknownExtensionRenderer=e.ExtensionRenderer=e.VirualDelegate=e.AsyncDataSource=e.ExtensionsGridView=void 0;let d=class extends R.Disposable{constructor(y,T,_){super(),this.instantiationService=_,this.element=t.append(y,t.$(".extensions-grid-view")),this.renderer=this.instantiationService.createInstance(f.Renderer,{onFocus:E.Event.None,onBlur:E.Event.None},{hoverOptions:{position(){return 2}}}),this.delegate=T,this.disposableStore=this._register(new R.DisposableStore)}setExtensions(y){this.disposableStore.clear(),y.forEach((T,_)=>this.renderExtension(T,_))}renderExtension(y,T){const _=t.append(this.element,t.$(".extension-container"));_.style.height=`${this.delegate.getHeight()}px`,_.setAttribute("tabindex","0");const L=this.renderer.renderTemplate(_);this.disposableStore.add((0,R.toDisposable)(()=>this.renderer.disposeTemplate(L)));const M=this.instantiationService.createInstance(h);M.extension=y,L.name.setAttribute("tabindex","0");const O=N=>{N instanceof l.StandardKeyboardEvent&&N.keyCode!==3||(M.run(N.ctrlKey||N.metaKey),N.stopPropagation(),N.preventDefault())};this.disposableStore.add(t.addDisposableListener(L.name,t.EventType.CLICK,N=>O(new s.StandardMouseEvent(N)))),this.disposableStore.add(t.addDisposableListener(L.name,t.EventType.KEY_DOWN,N=>O(new l.StandardKeyboardEvent(N)))),this.disposableStore.add(t.addDisposableListener(_,t.EventType.KEY_DOWN,N=>O(new l.StandardKeyboardEvent(N)))),this.renderer.renderElement(y,T,L)}};d=we([F(2,I.IInstantiationService)],d),e.ExtensionsGridView=d;class n{hasChildren({hasChildren:y}){return y}getChildren(y){return y.getChildren()}}e.AsyncDataSource=n;class a{getHeight(y){return 62}getTemplateId({extension:y}){return y?o.TEMPLATE_ID:g.TEMPLATE_ID}}e.VirualDelegate=a;let o=class Wc{constructor(y){this.instantiationService=y}get templateId(){return Wc.TEMPLATE_ID}renderTemplate(y){y.classList.add("extension");const T=t.append(y,t.$("img.icon")),_=t.append(y,t.$(".details")),L=t.append(_,t.$(".header")),M=t.append(L,t.$("span.name")),O=this.instantiationService.createInstance(h),N=[t.addDisposableListener(M,"click",z=>{O.run(z.ctrlKey||z.metaKey),z.stopPropagation(),z.preventDefault()})],P=t.append(L,t.$("span.identifier")),B=t.append(_,t.$(".footer")),V=t.append(B,t.$(".author"));return{icon:T,name:M,identifier:P,author:V,extensionDisposables:N,set extensionData(z){O.extension=z.extension}}}renderElement(y,T,_){const L=y.element.extension;_.extensionDisposables.push(t.addDisposableListener(_.icon,"error",()=>_.icon.src=L.iconUrlFallback,{once:!0})),_.icon.src=L.iconUrl,_.icon.complete?_.icon.style.visibility="inherit":(_.icon.style.visibility="hidden",_.icon.onload=()=>_.icon.style.visibility="inherit"),_.name.textContent=L.displayName,_.identifier.textContent=L.identifier.id,_.author.textContent=L.publisherDisplayName,_.extensionData=y.element}disposeTemplate(y){y.extensionDisposables=(0,R.dispose)(y.extensionDisposables)}};o.TEMPLATE_ID="extension-template",o=we([F(0,I.IInstantiationService)],o),e.ExtensionRenderer=o;class g{get templateId(){return g.TEMPLATE_ID}renderTemplate(y){const T=t.append(y,t.$("div.unknown-extension"));return t.append(T,t.$("span.error-marker")).textContent=(0,p.localize)(0,null),t.append(T,t.$("span.message")).textContent=(0,p.localize)(1,null),{identifier:t.append(T,t.$("span.message"))}}renderElement(y,T,_){_.identifier.textContent=y.element.extension.identifier.id}disposeTemplate(y){}}e.UnknownExtensionRenderer=g,g.TEMPLATE_ID="unknown-extension-template";let h=class extends A.Action{constructor(y){super("extensions.action.openExtension",""),this.extensionsWorkdbenchService=y}set extension(y){this._extension=y}run(y){return this._extension?this.extensionsWorkdbenchService.open(this._extension,{sideByside:y}):Promise.resolve()}};h=we([F(0,k.IExtensionsWorkbenchService)],h);let v=class extends b.WorkbenchAsyncDataTree{constructor(y,T,_,L,M,O,N,P,B){const V=new a,z=new n,x=[N.createInstance(o),N.createInstance(g)],H={getId({extension:W,parent:U}){return U?this.getId(U)+"/"+W.identifier.id:W.identifier.id}};super("ExtensionsTree",T,V,x,z,{indent:40,identityProvider:H,multipleSelectionSupport:!1,overrideStyles:_,accessibilityProvider:{getAriaLabel(W){const U=W.extension;return(0,p.localize)(2,null,U.displayName,U.version,U.publisherDisplayName,U.description)},getWidgetAriaLabel(){return(0,p.localize)(3,null)}}},N,L,M,O,P),this.setInput(y),this.disposables.add(this.onDidChangeSelection(W=>{W.browserEvent&&W.browserEvent instanceof KeyboardEvent&&B.open(W.elements[0].extension,{sideByside:!1})}))}};v=we([F(3,C.IContextKeyService),F(4,b.IListService),F(5,r.IThemeService),F(6,I.IInstantiationService),F(7,S.IConfigurationService),F(8,k.IExtensionsWorkbenchService)],v),e.ExtensionsTree=v;class m{constructor(y,T,_,L){this.extension=y,this.parent=T,this.getChildrenExtensionIds=_,this.extensionsWorkbenchService=L,this.childrenExtensionIds=this.getChildrenExtensionIds(y)}get hasChildren(){return(0,i.isNonEmptyArray)(this.childrenExtensionIds)}async getChildren(){return this.hasChildren?(await w(this.childrenExtensionIds,this.extensionsWorkbenchService)).map(T=>new m(T,this,this.getChildrenExtensionIds,this.extensionsWorkbenchService)):null}}e.ExtensionData=m;async function w(D,y){const T=y.local.reduce((M,O)=>(M.set(O.identifier.id.toLowerCase(),O),M),new Map),_=[],L=[];for(const M of D){const O=M.toLowerCase(),N=T.get(O);N?_.push(N):L.push(O)}if(L.length){const M=await y.getExtensions(L.map(O=>({id:O})),u.CancellationToken.None);_.push(...M)}return _}e.getExtensions=w,(0,r.registerThemingParticipant)((D,y)=>{const T=D.getColor(c.listFocusBackground);T&&y.addRule(`.extensions-grid-view .extension-container:focus { background-color: ${T}; outline: none; }`);const _=D.getColor(c.listFocusForeground);_&&y.addRule(`.extensions-grid-view .extension-container:focus { color: ${_}; }`);const L=D.getColor(c.foreground),M=D.getColor(c.editorBackground);if(L&&M){const O=L.transparent(.9).makeOpaque(M);y.addRule(`.extensions-grid-view .extension-container:not(.disabled) .author { color: ${O}; }`);const N=L.transparent(.5).makeOpaque(M);y.addRule(`.extensions-grid-view .extension-container.disabled { color: ${N}; }`)}})}),define(ae[1017],le([1,0,1647,16,14,6,573,36,21,2,10,188,27,5,274,119,1016,79,320,38,147,41,12,368,7,24,65,26,32,3020,900,23,39,55,13,202,72,209,9,22,638,42,92,410,33,15,37,59,705,238,73,100,338,91,82,306,1141]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U,$,q,X,G,Q,j,K,Y,ee,ie,re,oe){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionEditor=void 0;class se extends b.Disposable{get onChange(){return this._onChange.event}get currentId(){return this._currentId}constructor(Ie){super(),this._onChange=this._register(new A.Emitter),this._currentId=null;const ve=(0,S.append)(Ie,(0,S.$)(".navbar"));this.actions=[],this.actionbar=this._register(new l.ActionBar(ve,{animated:!1}))}push(Ie,ve,be){const ge=new E.Action(Ie,ve,void 0,!0,()=>this.update(Ie,!0));ge.tooltip=be,this.actions.push(ge),this.actionbar.push(ge),this.actions.length===1&&this.update(Ie)}clear(){this.actions=(0,b.dispose)(this.actions),this.actionbar.clear()}switch(Ie){const ve=this.actions.find(be=>be.id===Ie);return ve?(ve.run(),!0):!1}update(Ie,ve){this._currentId=Ie,this._onChange.fire({id:Ie,focus:!!ve}),this.actions.forEach(be=>be.checked=be.id===Ie)}}var te;(function(Se){Se[Se.Readme=0]="Readme",Se[Se.Changelog=1]="Changelog"})(te||(te={}));const Z=new h.RawContextKey("showPreReleaseVersion",!1);class ne extends c.ExtensionWidget{constructor(){super(...arguments),this._gallery=null}get gallery(){return this._gallery}set gallery(Ie){this.extension&&Ie&&!(0,Y.areSameExtensions)(this.extension.identifier,Ie.identifier)||(this._gallery=Ie,this.update())}}class ce extends ne{constructor(Ie){super(),this.element=(0,S.append)(Ie,(0,S.$)("code.version",{title:(0,t.localize)(0,null)})),this.render()}render(){!this.extension||!oe.valid(this.extension.version)||(this.element.textContent=`v${this.gallery?.version??this.extension.version}`)}}class de extends ne{constructor(Ie){super(),this.element=(0,S.append)(Ie,(0,S.$)("span.pre-release")),(0,S.append)(this.element,(0,S.$)("span"+o.ThemeIcon.asCSSSelector(ee.preReleaseIcon)));const ve=(0,S.append)(this.element,(0,S.$)("span.pre-release-text"));ve.textContent=(0,t.localize)(1,null),this.render()}render(){this.element.style.display=this.isPreReleaseVersion()?"inherit":"none"}isPreReleaseVersion(){return this.extension?this.gallery?this.gallery.properties.isPreReleaseVersion:!!(this.extension.state===1?this.extension.local?.isPreReleaseVersion:this.extension.gallery?.properties.isPreReleaseVersion):!1}}let he=class zc extends C.EditorPane{constructor(Ie,ve,be,ge,ue,Ce,De,Ae,Pe,fe,ye,ke,Ee,Te,_e,Re){super(zc.ID,Ie,Ce,ye),this.instantiationService=ve,this.paneCompositeService=be,this.extensionsWorkbenchService=ge,this.extensionGalleryService=ue,this.keybindingService=De,this.notificationService=Ae,this.openerService=Pe,this.extensionRecommendationsService=fe,this.extensionService=ke,this.webviewService=Ee,this.languageService=Te,this.contextMenuService=_e,this.contextKeyService=Re,this._scopedContextKeyService=this._register(new b.MutableDisposable),this.initialScrollProgress=new Map,this.currentIdentifier="",this.layoutParticipants=[],this.contentDisposables=this._register(new b.DisposableStore),this.transientDisposables=this._register(new b.DisposableStore),this.activeElement=null,this.extensionReadme=null,this.extensionChangelog=null,this.extensionManifest=null}get scopedContextKeyService(){return this._scopedContextKeyService.value}createEditor(Ie){const ve=(0,S.append)(Ie,(0,S.$)(".extension-editor"));this._scopedContextKeyService.value=this.contextKeyService.createScoped(ve),this._scopedContextKeyService.value.createKey("inExtensionEditor",!0),this.showPreReleaseVersionContextKey=Z.bindTo(this._scopedContextKeyService.value),ve.tabIndex=0,ve.style.outline="none",ve.setAttribute("role","document");const be=(0,S.append)(ve,(0,S.$)(".header")),ge=(0,S.append)(be,(0,S.$)(".icon-container")),ue=(0,S.append)(ge,(0,S.$)("img.icon",{draggable:!1})),Ce=this.instantiationService.createInstance(c.RemoteBadgeWidget,ge,!0),De=(0,S.append)(be,(0,S.$)(".details")),Ae=(0,S.append)(De,(0,S.$)(".title")),Pe=(0,S.append)(Ae,(0,S.$)("span.name.clickable",{title:(0,t.localize)(2,null),role:"heading",tabIndex:0})),fe=new ce(Ae),ye=new de(Ae),ke=(0,S.append)(Ae,(0,S.$)("span.preview",{title:(0,t.localize)(3,null)}));ke.textContent=(0,t.localize)(4,null);const Ee=(0,S.append)(Ae,(0,S.$)("span.builtin"));Ee.textContent=(0,t.localize)(5,null);const Te=(0,S.append)(De,(0,S.$)(".subtitle")),_e=(0,S.append)((0,S.append)(Te,(0,S.$)(".subtitle-entry")),(0,S.$)(".publisher.clickable",{title:(0,t.localize)(6,null),tabIndex:0}));_e.setAttribute("role","button");const Re=(0,S.append)(_e,(0,S.$)(`.publisher-verified${o.ThemeIcon.asCSSSelector(ee.verifiedPublisherIcon)}`)),Le=(0,S.append)(_e,(0,S.$)(".publisher-name")),Me=(0,S.append)((0,S.append)(Te,(0,S.$)(".subtitle-entry")),(0,S.$)("span.install",{title:(0,t.localize)(7,null),tabIndex:0})),Oe=this.instantiationService.createInstance(c.InstallCountWidget,Me,!1),Ke=(0,S.append)((0,S.append)(Te,(0,S.$)(".subtitle-entry")),(0,S.$)("span.rating.clickable",{title:(0,t.localize)(8,null),tabIndex:0}));Ke.setAttribute("role","link");const We=this.instantiationService.createInstance(c.RatingsWidget,Ke,!1),Xe=this.instantiationService.createInstance(c.SponsorWidget,(0,S.append)(Te,(0,S.$)(".subtitle-entry"))),Je=[Ce,fe,ye,Oe,We,Xe],rt=(0,S.append)(De,(0,S.$)(".description")),je=this.instantiationService.createInstance(s.InstallDropdownAction),Ue=[this.instantiationService.createInstance(s.ReloadAction),this.instantiationService.createInstance(s.ExtensionStatusLabelAction),this.instantiationService.createInstance(s.ActionWithDropDownAction,"extensions.updateActions","",[[this.instantiationService.createInstance(s.UpdateAction,!0)],[this.instantiationService.createInstance(s.SkipUpdateAction)]]),this.instantiationService.createInstance(s.SetColorThemeAction),this.instantiationService.createInstance(s.SetFileIconThemeAction),this.instantiationService.createInstance(s.SetProductIconThemeAction),this.instantiationService.createInstance(s.SetLanguageAction),this.instantiationService.createInstance(s.ClearLanguageAction),this.instantiationService.createInstance(s.EnableDropDownAction),this.instantiationService.createInstance(s.DisableDropDownAction),this.instantiationService.createInstance(s.RemoteInstallAction,!1),this.instantiationService.createInstance(s.LocalInstallAction),this.instantiationService.createInstance(s.WebInstallAction),je,this.instantiationService.createInstance(s.InstallingLabelAction),this.instantiationService.createInstance(s.ActionWithDropDownAction,"extensions.uninstall",s.UninstallAction.UninstallLabel,[[this.instantiationService.createInstance(s.MigrateDeprecatedExtensionAction,!1),this.instantiationService.createInstance(s.UninstallAction),this.instantiationService.createInstance(s.InstallAnotherVersionAction)]]),this.instantiationService.createInstance(s.SwitchToPreReleaseVersionAction,!1),this.instantiationService.createInstance(s.SwitchToReleasedVersionAction,!1),this.instantiationService.createInstance(s.ToggleSyncExtensionAction),new s.ExtensionEditorManageExtensionAction(this.scopedContextKeyService||this.contextKeyService,this.instantiationService)],Fe=(0,S.append)(De,(0,S.$)(".actions-status-container")),He=this._register(new l.ActionBar(Fe,{animated:!1,actionViewItemProvider:_t=>{if(_t instanceof s.ExtensionDropDownAction)return _t.createActionViewItem();if(_t instanceof s.ActionWithDropDownAction)return new s.ExtensionActionWithDropdownActionViewItem(_t,{icon:!0,label:!0,menuActionsOrProvider:{getActions:()=>_t.menuActions},menuActionClassNames:(_t.class||"").split(" ")},this.contextMenuService)},focusOnlyEnabledItems:!0}));He.push(Ue,{icon:!0,label:!0}),He.setFocusable(!0),this._register(A.Event.any(...Ue.map(_t=>A.Event.filter(_t.onDidChange,lt=>lt.enabled!==void 0)))(()=>{He.setFocusable(!1),He.setFocusable(!0)}));const Be=[],ze=this.instantiationService.createInstance(s.ExtensionStatusAction),nt=this._register(this.instantiationService.createInstance(c.ExtensionStatusWidget,(0,S.append)(Fe,(0,S.$)(".status")),ze));Be.push(ze,new class extends c.ExtensionWidget{render(){Fe.classList.toggle("list-layout",this.extension?.state===1)}});const ut=this.instantiationService.createInstance(c.ExtensionRecommendationWidget,(0,S.append)(De,(0,S.$)(".recommendation")));Je.push(ut),this._register(A.Event.any(nt.onDidRender,ut.onDidRender)(()=>{this.dimension&&this.layout(this.dimension)}));const ot=this.instantiationService.createInstance(f.ExtensionContainers,[...Ue,...Je,...Be]);for(const _t of[...Ue,...Je,...Be,ot])this._register(_t);this._register(A.Event.chain(He.onDidRun).map(({error:_t})=>_t).filter(_t=>!!_t).on(this.onError,this));const at=(0,S.append)(ve,(0,S.$)(".body")),wt=new se(at),It=(0,S.append)(at,(0,S.$)(".content"));It.id=(0,P.generateUuid)(),this.template={builtin:Ee,content:It,description:rt,header:be,icon:ue,iconContainer:ge,installCount:Me,name:Pe,navbar:wt,preview:ke,publisher:_e,publisherDisplayName:Le,verifiedPublisherIcon:Re,rating:Ke,actionsAndStatusContainer:Fe,extensionActionBar:He,set extension(_t){ot.extension=_t},set gallery(_t){fe.gallery=_t,ye.gallery=_t},set manifest(_t){je.manifest=_t}}}async setInput(Ie,ve,be,ge){await super.setInput(Ie,ve,be,ge),this.updatePreReleaseVersionContext(),this.template&&this.render(Ie.extension,this.template,!!ve?.preserveFocus)}setOptions(Ie){const ve=this.options;super.setOptions(Ie),this.updatePreReleaseVersionContext(),this.input&&this.template&&ve?.showPreReleaseVersion!==Ie?.showPreReleaseVersion&&this.render(this.input.extension,this.template,!!Ie?.preserveFocus)}updatePreReleaseVersionContext(){let Ie=this.options?.showPreReleaseVersion;(0,O.isUndefined)(Ie)&&(Ie=!!this.input.extension.gallery?.properties.isPreReleaseVersion),this.showPreReleaseVersionContextKey?.set(Ie)}async openTab(Ie){!this.input||!this.template||this.template.navbar.switch(Ie)||Ie==="extensionPack"&&this.template.navbar.switch("readme")}async getGalleryVersionToShow(Ie,ve){return(0,O.isUndefined)(ve)||ve===Ie.gallery?.properties.isPreReleaseVersion||ve&&!Ie.hasPreReleaseVersion||!ve&&!Ie.hasReleaseVersion?null:(await this.extensionGalleryService.getExtensions([{...Ie.identifier,preRelease:ve,hasPreRelease:Ie.hasPreReleaseVersion}],D.CancellationToken.None))[0]||null}async render(Ie,ve,be){this.activeElement=null,this.transientDisposables.clear();const ge=this.transientDisposables.add(new D.CancellationTokenSource).token,ue=await this.getGalleryVersionToShow(Ie,this.options?.showPreReleaseVersion);if(ge.isCancellationRequested)return;this.extensionReadme=new k.Cache(()=>ue?this.extensionGalleryService.getReadme(ue,ge):Ie.getReadme(ge)),this.extensionChangelog=new k.Cache(()=>ue?this.extensionGalleryService.getChangelog(ue,ge):Ie.getChangelog(ge)),this.extensionManifest=new k.Cache(()=>ue?this.extensionGalleryService.getManifest(ue,ge):Ie.getManifest(ge)),ve.extension=Ie,ve.gallery=ue,ve.manifest=null,this.transientDisposables.add((0,S.addDisposableListener)(ve.icon,"error",()=>ve.icon.src=Ie.iconUrlFallback,{once:!0})),ve.icon.src=Ie.iconUrl,ve.name.textContent=Ie.displayName,ve.name.classList.toggle("clickable",!!Ie.url),ve.name.classList.toggle("deprecated",!!Ie.deprecationInfo),ve.preview.style.display=Ie.preview?"inherit":"none",ve.builtin.style.display=Ie.isBuiltin?"inherit":"none",ve.description.textContent=Ie.description,ve.publisher.classList.toggle("clickable",!!Ie.url),ve.publisherDisplayName.textContent=Ie.publisherDisplayName,ve.verifiedPublisherIcon.style.display=Ie.publisherDomain?.verified?"inherit":"none",ve.publisher.title=Ie.publisherDomain?.verified&&Ie.publisherDomain.link?(0,t.localize)(9,null,V.URI.parse(Ie.publisherDomain.link).authority):"",ve.installCount.parentElement?.classList.toggle("hide",!Ie.url),ve.rating.parentElement?.classList.toggle("hide",!Ie.url),ve.rating.classList.toggle("clickable",!!Ie.url),Ie.url&&(this.transientDisposables.add((0,c.onClick)(ve.name,()=>this.openerService.open(V.URI.parse(Ie.url)))),this.transientDisposables.add((0,c.onClick)(ve.rating,()=>this.openerService.open(V.URI.parse(`${Ie.url}&ssr=false#review-details`)))),this.transientDisposables.add((0,c.onClick)(ve.publisher,()=>{this.paneCompositeService.openPaneComposite(f.VIEWLET_ID,0,!0).then(Pe=>Pe?.getViewPaneContainer()).then(Pe=>Pe.search(`publisher:"${Ie.publisherDisplayName}"`))})));const Ce=await this.extensionManifest.get().promise;if(ge.isCancellationRequested)return;Ce&&(ve.manifest=Ce),this.renderNavbar(Ie,Ce,ve,be);const De=this.extensionRecommendationsService.getAllRecommendationsWithReason();let Ae={};De[Ie.identifier.id.toLowerCase()]&&(Ae={recommendationReason:De[Ie.identifier.id.toLowerCase()].reasonId}),this.telemetryService.publicLog("extensionGallery:openExtension",{...Ie.telemetryData,...Ae})}renderNavbar(Ie,ve,be,ge){be.content.innerText="",be.navbar.clear(),this.currentIdentifier!==Ie.identifier.id&&(this.initialScrollProgress.clear(),this.currentIdentifier=Ie.identifier.id),Ie.hasReadme()&&be.navbar.push("readme",(0,t.localize)(10,null),(0,t.localize)(11,null)),ve&&ve.contributes&&be.navbar.push("contributions",(0,t.localize)(12,null),(0,t.localize)(13,null)),Ie.hasChangelog()&&be.navbar.push("changelog",(0,t.localize)(14,null),(0,t.localize)(15,null)),Ie.dependencies.length&&be.navbar.push("dependencies",(0,t.localize)(16,null),(0,t.localize)(17,null)),ve&&ve.extensionPack?.length&&!this.shallRenderAsExensionPack(ve)&&be.navbar.push("extensionPack",(0,t.localize)(18,null),(0,t.localize)(19,null));const ue=()=>be.navbar.push("runtimeStatus",(0,t.localize)(20,null),(0,t.localize)(21,null));if(this.extensionsWorkbenchService.getExtensionStatus(Ie))ue();else{const Ce=this.extensionService.onDidChangeExtensionsStatus(De=>{De.some(Ae=>(0,Y.areSameExtensions)({id:Ae.value},Ie.identifier))&&(ue(),Ce.dispose())},this,this.transientDisposables)}be.navbar.currentId&&this.onNavbarChange(Ie,{id:be.navbar.currentId,focus:!ge},be),be.navbar.onChange(Ce=>this.onNavbarChange(Ie,Ce,be),this,this.transientDisposables)}clearInput(){this.contentDisposables.clear(),this.transientDisposables.clear(),super.clearInput()}focus(){this.activeElement?.focus()}showFind(){this.activeWebview?.showFind()}runFindAction(Ie){this.activeWebview?.runFindAction(Ie)}get activeWebview(){if(!(!this.activeElement||!this.activeElement.runFindAction))return this.activeElement}onNavbarChange(Ie,{id:ve,focus:be},ge){if(this.contentDisposables.clear(),ge.content.innerText="",this.activeElement=null,ve){const ue=new D.CancellationTokenSource;this.contentDisposables.add((0,b.toDisposable)(()=>ue.dispose(!0))),this.open(ve,Ie,ge,ue.token).then(Ce=>{ue.token.isCancellationRequested||(this.activeElement=Ce,be&&this.focus())})}}open(Ie,ve,be,ge){switch(Ie){case"readme":return this.openDetails(ve,be,ge);case"contributions":return this.openContributions(be,ge);case"changelog":return this.openChangelog(be,ge);case"dependencies":return this.openExtensionDependencies(ve,be,ge);case"extensionPack":return this.openExtensionPack(ve,be,ge);case"runtimeStatus":return this.openRuntimeStatus(ve,be,ge)}return Promise.resolve(null)}async openMarkdown(Ie,ve,be,ge,ue){try{const Ce=await this.renderMarkdown(Ie,be,ue);if(ue.isCancellationRequested)return Promise.resolve(null);const De=this.contentDisposables.add(this.webviewService.createWebviewOverlay({id:(0,P.generateUuid)(),options:{enableFindWidget:!0,tryRestoreScrollPosition:!0},contentOptions:{},extension:void 0}));De.initialScrollProgress=this.initialScrollProgress.get(ge)||0,De.claim(this,this.scopedContextKeyService),(0,S.setParentFlowTo)(De.container,be),De.layoutWebviewOverElement(be),De.html=Ce,De.claim(this,void 0),this.contentDisposables.add(De.onDidFocus(()=>this.fireOnDidFocus())),this.contentDisposables.add(De.onDidScroll(()=>this.initialScrollProgress.set(ge,De.initialScrollProgress)));const Ae=p.insert(this.layoutParticipants,{layout:()=>{De.layoutWebviewOverElement(be)}});this.contentDisposables.add((0,b.toDisposable)(Ae));let Pe=!1;return this.contentDisposables.add((0,b.toDisposable)(()=>{Pe=!0})),this.contentDisposables.add(this.themeService.onDidColorThemeChange(async()=>{const fe=await this.renderMarkdown(Ie,be);Pe||(De.html=fe)})),this.contentDisposables.add(De.onDidClickLink(fe=>{!fe||(((0,a.matchesScheme)(fe,z.Schemas.http)||(0,a.matchesScheme)(fe,z.Schemas.https)||(0,a.matchesScheme)(fe,z.Schemas.mailto))&&this.openerService.open(fe),(0,a.matchesScheme)(fe,z.Schemas.command)&&V.URI.parse(fe).path===T.ShowCurrentReleaseNotesActionId&&this.openerService.open(fe,{allowCommands:!0}))})),De}catch{const De=(0,S.append)(be,(0,S.$)("p.nocontent"));return De.textContent=ve,De}}async renderMarkdown(Ie,ve,be){const ge=await this.loadContents(()=>Ie,ve);if(be?.isCancellationRequested)return"";const ue=await(0,x.renderMarkdownDocument)(ge,this.extensionService,this.languageService,!0,!1,be);return be?.isCancellationRequested?"":this.renderBody(ue)}renderBody(Ie){const ve=(0,P.generateUuid)(),be=W.TokenizationRegistry.getColorMap(),ge=be?(0,U.generateTokensCSSForColorMap)(be):"";return`<!DOCTYPE html>
		<html>
			<head>
				<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
				<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; script-src 'none'; style-src 'nonce-${ve}';">
				<style nonce="${ve}">
					${x.DEFAULT_MARKDOWN_STYLES}

					#scroll-to-top {
						position: fixed;
						width: 40px;
						height: 40px;
						right: 25px;
						bottom: 25px;
						background-color: var(--vscode-button-background);
						border-color: var(--vscode-button-border);
						border-radius: 50%;
						cursor: pointer;
						box-shadow: 1px 1px 1px rgba(0,0,0,.25);
						outline: none;
						display: flex;
						justify-content: center;
						align-items: center;
					}

					#scroll-to-top:hover {
						background-color: var(--vscode-button-hoverBackground);
						box-shadow: 2px 2px 2px rgba(0,0,0,.25);
					}

					body.vscode-high-contrast #scroll-to-top {
						border-width: 2px;
						border-style: solid;
						box-shadow: none;
					}

					#scroll-to-top span.icon::before {
						content: "";
						display: block;
						background: var(--vscode-button-foreground);
						/* Chevron up icon */
						webkit-mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KCS5zdDF7ZmlsbDpub25lO30KPC9zdHlsZT4KPHRpdGxlPnVwY2hldnJvbjwvdGl0bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04LDUuMWwtNy4zLDcuM0wwLDExLjZsOC04bDgsOGwtMC43LDAuN0w4LDUuMXoiLz4KPHJlY3QgY2xhc3M9InN0MSIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+Cjwvc3ZnPgo=');
						-webkit-mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KCS5zdDF7ZmlsbDpub25lO30KPC9zdHlsZT4KPHRpdGxlPnVwY2hldnJvbjwvdGl0bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04LDUuMWwtNy4zLDcuM0wwLDExLjZsOC04bDgsOGwtMC43LDAuN0w4LDUuMXoiLz4KPHJlY3QgY2xhc3M9InN0MSIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+Cjwvc3ZnPgo=');
						width: 16px;
						height: 16px;
					}
					${ge}
				</style>
			</head>
			<body>
				<a id="scroll-to-top" role="button" aria-label="scroll to top" href="#"><span class="icon"></span></a>
				${Ie}
			</body>
		</html>`}async openDetails(Ie,ve,be){const ge=(0,S.append)(ve.content,(0,S.$)(".details")),ue=(0,S.append)(ge,(0,S.$)(".readme-container")),Ce=(0,S.append)(ge,(0,S.$)(".additional-details-container")),De=()=>ge.classList.toggle("narrow",this.dimension&&this.dimension.width<500);De(),this.contentDisposables.add((0,b.toDisposable)(p.insert(this.layoutParticipants,{layout:De})));let Ae=null;const Pe=await this.extensionManifest.get().promise;return Pe&&Pe.extensionPack?.length&&this.shallRenderAsExensionPack(Pe)?Ae=await this.openExtensionPackReadme(Pe,ue,be):Ae=await this.openMarkdown(this.extensionReadme.get(),(0,t.localize)(22,null),ue,0,be),this.renderAdditionalDetails(Ce,Ie),Ae}shallRenderAsExensionPack(Ie){return!!Ie.categories?.some(ve=>ve.toLowerCase()==="extension packs")}async openExtensionPackReadme(Ie,ve,be){if(be.isCancellationRequested)return Promise.resolve(null);const ge=(0,S.append)(ve,(0,S.$)("div",{class:"extension-pack-readme"}));ge.style.margin="0 auto",ge.style.maxWidth="882px";const ue=(0,S.append)(ge,(0,S.$)("div",{class:"extension-pack"}));Ie.extensionPack.length<=3?ge.classList.add("one-row"):Ie.extensionPack.length<=6?ge.classList.add("two-rows"):Ie.extensionPack.length<=9?ge.classList.add("three-rows"):ge.classList.add("more-rows");const Ce=(0,S.append)(ue,(0,S.$)("div.header"));Ce.textContent=(0,t.localize)(23,null,Ie.extensionPack.length);const De=(0,S.append)(ue,(0,S.$)("div",{class:"extension-pack-content"}));De.setAttribute("tabindex","0"),(0,S.append)(ue,(0,S.$)("div.footer"));const Ae=(0,S.append)(ge,(0,S.$)("div.readme-content"));return await Promise.all([this.renderExtensionPack(Ie,De,be),this.openMarkdown(this.extensionReadme.get(),(0,t.localize)(24,null),Ae,0,be)]),{focus:()=>De.focus()}}renderAdditionalDetails(Ie,ve){const be=(0,S.$)("div",{class:"additional-details-content",tabindex:"0"}),ge=new n.DomScrollableElement(be,{}),ue=()=>ge.scanDomNode(),Ce=p.insert(this.layoutParticipants,{layout:ue});this.contentDisposables.add((0,b.toDisposable)(Ce)),this.contentDisposables.add(ge),this.renderCategories(be,ve),this.renderExtensionResources(be,ve),this.renderMoreInfo(be,ve),(0,S.append)(Ie,ge.getDomNode()),ge.scanDomNode()}renderCategories(Ie,ve){if(ve.categories.length){const be=(0,S.append)(Ie,(0,S.$)(".categories-container.additional-details-element"));(0,S.append)(be,(0,S.$)(".additional-details-title",void 0,(0,t.localize)(25,null)));const ge=(0,S.append)(be,(0,S.$)(".categories"));for(const ue of ve.categories)this.transientDisposables.add((0,c.onClick)((0,S.append)(ge,(0,S.$)("span.category",{tabindex:"0"},ue)),()=>{this.paneCompositeService.openPaneComposite(f.VIEWLET_ID,0,!0).then(Ce=>Ce?.getViewPaneContainer()).then(Ce=>Ce.search(`@category:"${ue}"`))}))}}renderExtensionResources(Ie,ve){const be=[];if(ve.url&&be.push([(0,t.localize)(26,null),V.URI.parse(ve.url)]),ve.repository)try{be.push([(0,t.localize)(27,null),V.URI.parse(ve.repository)])}catch{}if(ve.url&&ve.licenseUrl)try{be.push([(0,t.localize)(28,null),V.URI.parse(ve.licenseUrl)])}catch{}if(ve.publisherUrl&&be.push([ve.publisherDisplayName,ve.publisherUrl]),be.length||ve.publisherSponsorLink){const ge=(0,S.append)(Ie,(0,S.$)(".resources-container.additional-details-element"));(0,S.append)(ge,(0,S.$)(".additional-details-title",void 0,(0,t.localize)(29,null)));const ue=(0,S.append)(ge,(0,S.$)(".resources"));for(const[Ce,De]of be)this.transientDisposables.add((0,c.onClick)((0,S.append)(ue,(0,S.$)("a.resource",{title:De.toString(),tabindex:"0"},Ce)),()=>this.openerService.open(De)))}}renderMoreInfo(Ie,ve){const be=ve.gallery,ge=(0,S.append)(Ie,(0,S.$)(".more-info-container.additional-details-element"));(0,S.append)(ge,(0,S.$)(".additional-details-title",void 0,(0,t.localize)(30,null)));const ue=(0,S.append)(ge,(0,S.$)(".more-info"));be&&(0,S.append)(ue,(0,S.$)(".more-info-entry",void 0,(0,S.$)("div",void 0,(0,t.localize)(31,null)),(0,S.$)("div",void 0,new Date(be.releaseDate).toLocaleString(R.locale,{hourCycle:"h23"}))),(0,S.$)(".more-info-entry",void 0,(0,S.$)("div",void 0,(0,t.localize)(32,null)),(0,S.$)("div",void 0,new Date(be.lastUpdated).toLocaleString(R.locale,{hourCycle:"h23"})))),ve.local&&ve.local.installedTimestamp&&(0,S.append)(ue,(0,S.$)(".more-info-entry",void 0,(0,S.$)("div",void 0,(0,t.localize)(33,null)),(0,S.$)("div",void 0,new Date(ve.local.installedTimestamp).toLocaleString(R.locale,{hourCycle:"h23"})))),(0,S.append)(ue,(0,S.$)(".more-info-entry",void 0,(0,S.$)("div",void 0,(0,t.localize)(34,null)),(0,S.$)("code",void 0,ve.identifier.id)))}openChangelog(Ie,ve){return this.openMarkdown(this.extensionChangelog.get(),(0,t.localize)(35,null),Ie.content,1,ve)}openContributions(Ie,ve){const be=(0,S.$)("div.subcontent.feature-contributions",{tabindex:"0"});return this.loadContents(()=>this.extensionManifest.get(),Ie.content).then(ge=>{if(ve.isCancellationRequested)return null;if(!ge)return be;const ue=new n.DomScrollableElement(be,{}),Ce=()=>ue.scanDomNode(),De=p.insert(this.layoutParticipants,{layout:Ce});this.contentDisposables.add((0,b.toDisposable)(De));const Ae=[this.renderSettings(be,ge,Ce),this.renderCommands(be,ge,Ce),this.renderCodeActions(be,ge,Ce),this.renderLanguages(be,ge,Ce),this.renderColorThemes(be,ge,Ce),this.renderIconThemes(be,ge,Ce),this.renderProductIconThemes(be,ge,Ce),this.renderColors(be,ge,Ce),this.renderJSONValidation(be,ge,Ce),this.renderDebuggers(be,ge,Ce),this.renderViewContainers(be,ge,Ce),this.renderViews(be,ge,Ce),this.renderLocalizations(be,ge,Ce),this.renderCustomEditors(be,ge,Ce),this.renderNotebooks(be,ge,Ce),this.renderNotebookRenderers(be,ge,Ce),this.renderAuthentication(be,ge,Ce),this.renderActivationEvents(be,ge,Ce)];return ue.scanDomNode(),!Ae.some(fe=>fe)?((0,S.append)(be,(0,S.$)("p.nocontent")).textContent=(0,t.localize)(36,null),(0,S.append)(Ie.content,be)):((0,S.append)(Ie.content,ue.getDomNode()),this.contentDisposables.add(ue)),be},()=>ve.isCancellationRequested?null:((0,S.append)(be,(0,S.$)("p.nocontent")).textContent=(0,t.localize)(37,null),(0,S.append)(Ie.content,be),be))}openExtensionDependencies(Ie,ve,be){if(be.isCancellationRequested)return Promise.resolve(null);if(p.isFalsyOrEmpty(Ie.dependencies))return(0,S.append)(ve.content,(0,S.$)("p.nocontent")).textContent=(0,t.localize)(38,null),Promise.resolve(ve.content);const ge=(0,S.$)("div",{class:"subcontent"}),ue=new n.DomScrollableElement(ge,{});(0,S.append)(ve.content,ue.getDomNode()),this.contentDisposables.add(ue);const Ce=this.instantiationService.createInstance(y.ExtensionsTree,new y.ExtensionData(Ie,null,Pe=>Pe.dependencies||[],this.extensionsWorkbenchService),ge,{listBackground:$.editorBackground}),De=()=>{ue.scanDomNode();const Pe=ue.getScrollDimensions();Ce.layout(Pe.height)},Ae=p.insert(this.layoutParticipants,{layout:De});return this.contentDisposables.add((0,b.toDisposable)(Ae)),this.contentDisposables.add(Ce),ue.scanDomNode(),Promise.resolve({focus(){Ce.domFocus()}})}async openExtensionPack(Ie,ve,be){if(be.isCancellationRequested)return Promise.resolve(null);const ge=await this.loadContents(()=>this.extensionManifest.get(),ve.content);return be.isCancellationRequested||!ge?null:this.renderExtensionPack(ge,ve.content,be)}async openRuntimeStatus(Ie,ve,be){const ge=(0,S.$)("div",{class:"subcontent",tabindex:"0"}),ue=new n.DomScrollableElement(ge,{}),Ce=()=>ue.scanDomNode(),De=p.insert(this.layoutParticipants,{layout:Ce});this.contentDisposables.add((0,b.toDisposable)(De));const Ae=()=>{ue.scanDomNode(),(0,S.reset)(ge,this.renderRuntimeStatus(Ie,Ce))};return Ae(),this.extensionService.onDidChangeExtensionsStatus(Pe=>{Pe.some(fe=>(0,Y.areSameExtensions)({id:fe.value},Ie.identifier))&&Ae()},this,this.contentDisposables),this.contentDisposables.add(ue),(0,S.append)(ve.content,ue.getDomNode()),ge}renderRuntimeStatus(Ie,ve){const be=this.extensionsWorkbenchService.getExtensionStatus(Ie),ge=(0,S.$)(".runtime-status");if(be?.activationTimes){const ue=be.activationTimes.codeLoadingTime+be.activationTimes.activateCallTime;(0,S.append)(ge,(0,S.$)("div.activation-message",void 0,`${(0,t.localize)(39,null)}${be.activationTimes.activationReason.startup?` (${(0,t.localize)(40,null)})`:""} : ${ue}ms`))}else Ie.local&&(Ie.local.manifest.main||Ie.local.manifest.browser)&&(0,S.append)(ge,(0,S.$)("div.activation-message",void 0,(0,t.localize)(41,null)));return be?.runtimeErrors.length&&(0,S.append)(ge,(0,S.$)("details",{open:!0,ontoggle:ve},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(42,null,be.runtimeErrors.length)),(0,S.$)("div",void 0,...be.runtimeErrors.map(ue=>(0,S.$)("div.message-entry",void 0,(0,S.$)(`span${o.ThemeIcon.asCSSSelector(ee.errorIcon)}`,void 0),(0,S.$)("span",void 0,(0,I.getErrorMessage)(ue))))))),be?.messages.length&&(0,S.append)(ge,(0,S.$)("details",{open:!0,ontoggle:ve},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(43,null,be?.messages.length)),(0,S.$)("div",void 0,...be.messages.sort((ue,Ce)=>Ce.type-ue.type).map(ue=>(0,S.$)("div.message-entry",void 0,(0,S.$)(`span${o.ThemeIcon.asCSSSelector(ue.type===w.Severity.Error?ee.errorIcon:ue.type===w.Severity.Warning?ee.warningIcon:ee.infoIcon)}`,void 0),(0,S.$)("span",void 0,ue.message)))))),ge.children.length===0&&((0,S.append)(ge,(0,S.$)("div.no-status-message")).textContent=(0,t.localize)(44,null)),ge}async renderExtensionPack(Ie,ve,be){if(be.isCancellationRequested)return null;const ge=(0,S.$)("div",{class:"subcontent"}),ue=new n.DomScrollableElement(ge,{useShadows:!1});(0,S.append)(ve,ue.getDomNode());const Ce=this.instantiationService.createInstance(y.ExtensionsGridView,ge,new Q.Delegate),De=await(0,y.getExtensions)(Ie.extensionPack,this.extensionsWorkbenchService);return Ce.setExtensions(De),ue.scanDomNode(),this.contentDisposables.add(ue),this.contentDisposables.add(Ce),this.contentDisposables.add((0,b.toDisposable)(p.insert(this.layoutParticipants,{layout:()=>ue.scanDomNode()}))),ge}renderSettings(Ie,ve,be){const ge=ve.contributes?.configuration;let ue={};Array.isArray(ge)?ge.forEach(Ae=>{ue={...ue,...Ae.properties}}):ge&&(ue=ge.properties);let Ce=ue?Object.keys(ue):[];if(Ce=Ce.filter(Ae=>{const Pe=ue[Ae];return!Pe.deprecationMessage&&!Pe.markdownDeprecationMessage}),!Ce.length)return!1;const De=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(45,null,Ce.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(46,null)),(0,S.$)("th",void 0,(0,t.localize)(47,null)),(0,S.$)("th",void 0,(0,t.localize)(48,null))),...Ce.map(Ae=>{let Pe=ue[Ae].description||"";if(ue[Ae].markdownDescription){const{element:fe,dispose:ye}=(0,j.renderMarkdown)({value:ue[Ae].markdownDescription},{actionHandler:{callback:ke=>this.openerService.open(ke).catch(I.onUnexpectedError),disposables:this.contentDisposables}});Pe=fe,this.contentDisposables.add((0,b.toDisposable)(ye))}return(0,S.$)("tr",void 0,(0,S.$)("td",void 0,(0,S.$)("code",void 0,Ae)),(0,S.$)("td",void 0,Pe),(0,S.$)("td",void 0,(0,S.$)("code",void 0,`${(0,O.isUndefined)(ue[Ae].default)?(0,M.getDefaultValue)(ue[Ae].type):ue[Ae].default}`)))})));return(0,S.append)(Ie,De),!0}renderDebuggers(Ie,ve,be){const ge=ve.contributes?.debuggers||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(49,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(50,null)),(0,S.$)("th",void 0,(0,t.localize)(51,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.label),(0,S.$)("td",void 0,Ce.type)))));return(0,S.append)(Ie,ue),!0}renderViewContainers(Ie,ve,be){const ge=ve.contributes?.viewsContainers||{},ue=Object.keys(ge).reduce((De,Ae)=>{const Pe=ge[Ae];return De.push(...Pe.map(fe=>({...fe,location:Ae}))),De},[]);if(!ue.length)return!1;const Ce=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(52,null,ue.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(53,null)),(0,S.$)("th",void 0,(0,t.localize)(54,null)),(0,S.$)("th",void 0,(0,t.localize)(55,null))),...ue.map(De=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,De.id),(0,S.$)("td",void 0,De.title),(0,S.$)("td",void 0,De.location)))));return(0,S.append)(Ie,Ce),!0}renderViews(Ie,ve,be){const ge=ve.contributes?.views||{},ue=Object.keys(ge).reduce((De,Ae)=>{const Pe=ge[Ae];return De.push(...Pe.map(fe=>({...fe,location:Ae}))),De},[]);if(!ue.length)return!1;const Ce=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(56,null,ue.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(57,null)),(0,S.$)("th",void 0,(0,t.localize)(58,null)),(0,S.$)("th",void 0,(0,t.localize)(59,null))),...ue.map(De=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,De.id),(0,S.$)("td",void 0,De.name),(0,S.$)("td",void 0,De.location)))));return(0,S.append)(Ie,Ce),!0}renderLocalizations(Ie,ve,be){const ge=ve.contributes?.localizations||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(60,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(61,null)),(0,S.$)("th",void 0,(0,t.localize)(62,null)),(0,S.$)("th",void 0,(0,t.localize)(63,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.languageId),(0,S.$)("td",void 0,Ce.languageName||""),(0,S.$)("td",void 0,Ce.localizedLanguageName||"")))));return(0,S.append)(Ie,ue),!0}renderCustomEditors(Ie,ve,be){const ge=ve.contributes?.customEditors||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(64,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(65,null)),(0,S.$)("th",void 0,(0,t.localize)(66,null)),(0,S.$)("th",void 0,(0,t.localize)(67,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.viewType),(0,S.$)("td",void 0,Ce.priority),(0,S.$)("td",void 0,p.coalesce(Ce.selector.map(De=>De.filenamePattern)).join(", "))))));return(0,S.append)(Ie,ue),!0}renderCodeActions(Ie,ve,be){const ge=ve.contributes?.codeActions||[];if(!ge.length)return!1;const ue=p.flatten(ge.map(De=>De.actions.map(Ae=>({...Ae,languages:De.languages})))),Ce=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(68,null,ue.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(69,null)),(0,S.$)("th",void 0,(0,t.localize)(70,null)),(0,S.$)("th",void 0,(0,t.localize)(71,null)),(0,S.$)("th",void 0,(0,t.localize)(72,null))),...ue.map(De=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,De.title),(0,S.$)("td",void 0,(0,S.$)("code",void 0,De.kind)),(0,S.$)("td",void 0,De.description??""),(0,S.$)("td",void 0,...De.languages.map(Ae=>(0,S.$)("code",void 0,Ae)))))));return(0,S.append)(Ie,Ce),!0}renderAuthentication(Ie,ve,be){const ge=ve.contributes?.authentication||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(73,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(74,null)),(0,S.$)("th",void 0,(0,t.localize)(75,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.label),(0,S.$)("td",void 0,Ce.id)))));return(0,S.append)(Ie,ue),!0}renderColorThemes(Ie,ve,be){const ge=ve.contributes?.themes||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(76,null,ge.length)),(0,S.$)("ul",void 0,...ge.map(Ce=>(0,S.$)("li",void 0,Ce.label))));return(0,S.append)(Ie,ue),!0}renderIconThemes(Ie,ve,be){const ge=ve.contributes?.iconThemes||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(77,null,ge.length)),(0,S.$)("ul",void 0,...ge.map(Ce=>(0,S.$)("li",void 0,Ce.label))));return(0,S.append)(Ie,ue),!0}renderProductIconThemes(Ie,ve,be){const ge=ve.contributes?.productIconThemes||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(78,null,ge.length)),(0,S.$)("ul",void 0,...ge.map(Ce=>(0,S.$)("li",void 0,Ce.label))));return(0,S.append)(Ie,ue),!0}renderColors(Ie,ve,be){const ge=ve.contributes?.colors||[];if(!ge.length)return!1;function ue(De){const Ae=[];if(De&&De[0]==="#"){const Pe=m.Color.fromHex(De);Pe&&Ae.push((0,S.$)("span",{class:"colorBox",style:"background-color: "+m.Color.Format.CSS.format(Pe)},""))}return Ae.push((0,S.$)("code",void 0,De)),Ae}const Ce=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(79,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(80,null)),(0,S.$)("th",void 0,(0,t.localize)(81,null)),(0,S.$)("th",void 0,(0,t.localize)(82,null)),(0,S.$)("th",void 0,(0,t.localize)(83,null)),(0,S.$)("th",void 0,(0,t.localize)(84,null))),...ge.map(De=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,(0,S.$)("code",void 0,De.id)),(0,S.$)("td",void 0,De.description),(0,S.$)("td",void 0,...ue(De.defaults.dark)),(0,S.$)("td",void 0,...ue(De.defaults.light)),(0,S.$)("td",void 0,...ue(De.defaults.highContrast))))));return(0,S.append)(Ie,Ce),!0}renderJSONValidation(Ie,ve,be){const ge=ve.contributes?.jsonValidation||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(85,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(86,null)),(0,S.$)("th",void 0,(0,t.localize)(87,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,(0,S.$)("code",void 0,Array.isArray(Ce.fileMatch)?Ce.fileMatch.join(", "):Ce.fileMatch)),(0,S.$)("td",void 0,Ce.url)))));return(0,S.append)(Ie,ue),!0}renderCommands(Ie,ve,be){const ue=(ve.contributes?.commands||[]).map(ye=>({id:ye.command,title:ye.title,keybindings:[],menus:[]})),Ce=p.index(ue,ye=>ye.id),De=ve.contributes?.menus||{};if(Object.keys(De).forEach(ye=>{De[ye].forEach(ke=>{let Ee=Ce[ke.command];Ee?Ee.menus.push(ye):(Ee={id:ke.command,title:"",keybindings:[],menus:[ye]},Ce[Ee.id]=Ee,ue.push(Ee))})}),(ve.contributes?.keybindings?Array.isArray(ve.contributes.keybindings)?ve.contributes.keybindings:[ve.contributes.keybindings]:[]).forEach(ye=>{const ke=this.resolveKeybinding(ye);if(!ke)return;let Ee=Ce[ye.command];Ee?Ee.keybindings.push(ke):(Ee={id:ye.command,title:"",keybindings:[ke],menus:[]},Ce[Ee.id]=Ee,ue.push(Ee))}),!ue.length)return!1;const Pe=ye=>{const ke=(0,S.$)(""),Ee=new g.KeybindingLabel(ke,R.OS);return Ee.set(ye),this.contentDisposables.add((0,K.attachKeybindingLabelStyler)(Ee,this.themeService)),ke},fe=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(88,null,ue.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(89,null)),(0,S.$)("th",void 0,(0,t.localize)(90,null)),(0,S.$)("th",void 0,(0,t.localize)(91,null)),(0,S.$)("th",void 0,(0,t.localize)(92,null))),...ue.map(ye=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,(0,S.$)("code",void 0,ye.id)),(0,S.$)("td",void 0,typeof ye.title=="string"?ye.title:ye.title.value),(0,S.$)("td",void 0,...ye.keybindings.map(ke=>Pe(ke))),(0,S.$)("td",void 0,...ye.menus.map(ke=>(0,S.$)("code",void 0,ke)))))));return(0,S.append)(Ie,fe),!0}renderLanguages(Ie,ve,be){const ge=ve.contributes,Ce=(ge?.languages||[]).map(ye=>({id:ye.id,name:(ye.aliases||[])[0]||ye.id,extensions:ye.extensions||[],hasGrammar:!1,hasSnippets:!1})),De=p.index(Ce,ye=>ye.id);if((ge?.grammars||[]).forEach(ye=>{let ke=De[ye.language];ke?ke.hasGrammar=!0:(ke={id:ye.language,name:ye.language,extensions:[],hasGrammar:!0,hasSnippets:!1},De[ke.id]=ke,Ce.push(ke))}),(ge?.snippets||[]).forEach(ye=>{let ke=De[ye.language];ke?ke.hasSnippets=!0:(ke={id:ye.language,name:ye.language,extensions:[],hasGrammar:!1,hasSnippets:!0},De[ke.id]=ke,Ce.push(ke))}),!Ce.length)return!1;const fe=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(93,null,Ce.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(94,null)),(0,S.$)("th",void 0,(0,t.localize)(95,null)),(0,S.$)("th",void 0,(0,t.localize)(96,null)),(0,S.$)("th",void 0,(0,t.localize)(97,null)),(0,S.$)("th",void 0,(0,t.localize)(98,null))),...Ce.map(ye=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,ye.id),(0,S.$)("td",void 0,ye.name),(0,S.$)("td",void 0,...(0,S.join)(ye.extensions.map(ke=>(0,S.$)("code",void 0,ke))," ")),(0,S.$)("td",void 0,document.createTextNode(ye.hasGrammar?"\u2714\uFE0E":"\u2014")),(0,S.$)("td",void 0,document.createTextNode(ye.hasSnippets?"\u2714\uFE0E":"\u2014"))))));return(0,S.append)(Ie,fe),!0}renderActivationEvents(Ie,ve,be){const ge=ve.activationEvents||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(99,null,ge.length)),(0,S.$)("ul",void 0,...ge.map(Ce=>(0,S.$)("li",void 0,(0,S.$)("code",void 0,Ce)))));return(0,S.append)(Ie,ue),!0}renderNotebooks(Ie,ve,be){const ge=ve.contributes?.notebooks||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(100,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(101,null)),(0,S.$)("th",void 0,(0,t.localize)(102,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.type),(0,S.$)("td",void 0,Ce.displayName)))));return(0,S.append)(Ie,ue),!0}renderNotebookRenderers(Ie,ve,be){const ge=ve.contributes?.notebookRenderer||[];if(!ge.length)return!1;const ue=(0,S.$)("details",{open:!0,ontoggle:be},(0,S.$)("summary",{tabindex:"0"},(0,t.localize)(103,null,ge.length)),(0,S.$)("table",void 0,(0,S.$)("tr",void 0,(0,S.$)("th",void 0,(0,t.localize)(104,null)),(0,S.$)("th",void 0,(0,t.localize)(105,null))),...ge.map(Ce=>(0,S.$)("tr",void 0,(0,S.$)("td",void 0,Ce.displayName),(0,S.$)("td",void 0,Ce.mimeTypes.join(","))))));return(0,S.append)(Ie,ue),!0}resolveKeybinding(Ie){let ve;switch(B.platform){case"win32":ve=Ie.win;break;case"linux":ve=Ie.linux;break;case"darwin":ve=Ie.mac;break}return this.keybindingService.resolveUserBinding(ve||Ie.key)[0]}loadContents(Ie,ve){ve.classList.add("loading");const be=this.contentDisposables.add(Ie()),ge=()=>ve.classList.remove("loading");return be.promise.then(ge,ge),be.promise}layout(Ie){this.dimension=Ie,this.layoutParticipants.forEach(ve=>ve.layout())}onError(Ie){(0,I.isCancellationError)(Ie)||this.notificationService.error(Ie)}};he.ID="workbench.editor.extension",he=we([F(0,r.ITelemetryService),F(1,u.IInstantiationService),F(2,ie.IPaneCompositePartService),F(3,f.IExtensionsWorkbenchService),F(4,re.IExtensionGalleryService),F(5,o.IThemeService),F(6,d.IKeybindingService),F(7,w.INotificationService),F(8,a.IOpenerService),F(9,i.IExtensionRecommendationsService),F(10,_.IStorageService),F(11,L.IExtensionService),F(12,N.IWebviewService),F(13,H.ILanguageService),F(14,X.IContextMenuService),F(15,h.IContextKeyService)],he),e.ExtensionEditor=he;const pe=h.ContextKeyExpr.and(h.ContextKeyExpr.equals("activeEditor",he.ID),G.EditorContextKeys.focus.toNegated());(0,q.registerAction2)(class extends q.Action2{constructor(){super({id:"editor.action.extensioneditor.showfind",title:(0,t.localize)(106,null),keybinding:{when:pe,weight:100,primary:2084}})}run(Ie){me(Ie)?.showFind()}}),(0,q.registerAction2)(class extends q.Action2{constructor(){super({id:"editor.action.extensioneditor.findNext",title:(0,t.localize)(107,null),keybinding:{when:h.ContextKeyExpr.and(pe,N.KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED),primary:3,weight:100}})}run(Ie){me(Ie)?.runFindAction(!1)}}),(0,q.registerAction2)(class extends q.Action2{constructor(){super({id:"editor.action.extensioneditor.findPrevious",title:(0,t.localize)(108,null),keybinding:{when:h.ContextKeyExpr.and(pe,N.KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED),primary:1027,weight:100}})}run(Ie){me(Ie)?.runFindAction(!0)}}),(0,o.registerThemingParticipant)((Se,Ie)=>{const ve=Se.getColor($.textLinkForeground);ve&&(Ie.addRule(`.monaco-workbench .extension-editor .content .details .additional-details-container .resources-container a.resource { color: ${ve}; }`),Ie.addRule(`.monaco-workbench .extension-editor .content .feature-contributions a { color: ${ve}; }`));const be=Se.getColor($.textLinkActiveForeground);be&&(Ie.addRule(`.monaco-workbench .extension-editor .content .details .additional-details-container .resources-container a.resource:hover,
			.monaco-workbench .extension-editor .content .details .additional-details-container .resources-container a.resource:active { color: ${be}; }`),Ie.addRule(`.monaco-workbench .extension-editor .content .feature-contributions a:hover,
			.monaco-workbench .extension-editor .content .feature-contributions a:active { color: ${be}; }`));const ge=Se.getColor($.buttonHoverBackground);ge&&(Ie.addRule(`.monaco-workbench .extension-editor .content > .details > .additional-details-container .categories-container > .categories > .category:hover { background-color: ${ge}; border-color: ${ge}; }`),Ie.addRule(`.monaco-workbench .extension-editor .content > .details > .additional-details-container .tags-container > .tags > .tag:hover { background-color: ${ge}; border-color: ${ge}; }`));const ue=Se.getColor($.buttonForeground);ue&&(Ie.addRule(`.monaco-workbench .extension-editor .content > .details > .additional-details-container .categories-container > .categories > .category:hover { color: ${ue}; }`),Ie.addRule(`.monaco-workbench .extension-editor .content > .details > .additional-details-container .tags-container > .tags > .tag:hover { color: ${ue}; }`))});function me(Se){const Ie=Se.get(v.IEditorService).activeEditorPane;return Ie instanceof he?Ie:null}}),define(ae[3021],le([1,0,1658,2,6,21,117,745,120,274,100,38,37,10,5,705,119,635,39,12,73,27,277,320,76,8,26,129,34,16,552,110,32,36,115,11,46,432,7,80,45,41,106,23,233,227,118,83,25,711]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U,$,q,X,G,Q,j){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceRecommendedExtensionsView=e.RecommendedExtensionsView=e.DefaultRecommendedExtensionsView=e.SearchMarketplaceExtensionsView=e.DeprecatedExtensionsView=e.VirtualWorkspacePartiallySupportedExtensionsView=e.VirtualWorkspaceUnsupportedExtensionsView=e.UntrustedWorkspacePartiallySupportedExtensionsView=e.UntrustedWorkspaceUnsupportedExtensionsView=e.BuiltInProgrammingLanguageExtensionsView=e.BuiltInThemesExtensionsView=e.BuiltInFeatureExtensionsView=e.RecentlyUpdatedExtensionsView=e.OutdatedExtensionsView=e.DisabledExtensionsView=e.EnabledExtensionsView=e.ServerInstalledExtensionsView=e.DefaultPopularExtensionsView=e.ExtensionsListView=void 0;const K=["vscode.git","vscode.git-base","vscode.search-result"];class Y extends p.Disposable{constructor(){super(...arguments),this._onFocus=this._register(new R.Emitter),this.onFocus=this._onFocus.event,this._onBlur=this._register(new R.Emitter),this.onBlur=this._onBlur.event,this.currentlyFocusedItems=[]}onFocusChange(fe){this.currentlyFocusedItems.forEach(ye=>this._onBlur.fire(ye)),this.currentlyFocusedItems=fe,this.currentlyFocusedItems.forEach(ye=>this._onFocus.fire(ye))}}var ee;(function(Pe){Pe.UpdateDate="UpdateDate"})(ee||(ee={}));function ie(Pe){switch(Pe){case"UpdateDate":return!0}}let re=class ti extends w.ViewPane{constructor(fe,ye,ke,Ee,Te,_e,Re,Le,Me,Oe,Ke,We,Xe,Je,rt,je,Ue,Fe,He,Be,ze,nt,ut,ot,at,wt,It,_t){super({...ye,showActionsAlways:!0,maximumBodySize:fe.flexibleHeight?ot.getNumber(`${ye.id}.size`,0,0)?void 0:0:void 0},Ee,Te,We,Be,ze,_e,nt,Re,Ke),this.options=fe,this.notificationService=ke,this.extensionService=Le,this.extensionsWorkbenchService=Me,this.extensionRecommendationsService=Oe,this.contextService=Xe,this.experimentService=Je,this.extensionManagementServerService=rt,this.extensionManifestPropertiesService=je,this.extensionManagementService=Ue,this.workspaceService=Fe,this.productService=He,this.preferencesService=ut,this.storageService=ot,this.workspaceTrustManagementService=at,this.extensionEnablementService=wt,this.layoutService=It,this.logService=_t,this.list=null,this.queryRequest=null,this.contextMenuActionRunner=this._register(new M.ActionRunner),this.options.onDidChangeTitle&&this._register(this.options.onDidChangeTitle(lt=>this.updateTitle(lt))),this._register(this.contextMenuActionRunner.onDidRun(({error:lt})=>lt&&this.notificationService.error(lt))),this.registerActions()}registerActions(){}renderHeader(fe){fe.classList.add("extension-view-header"),super.renderHeader(fe),this.options.hideBadge||(this.badge=new o.CountBadge((0,u.append)(fe,(0,u.$)(".count-badge-wrapper"))),this._register((0,n.attachBadgeStyler)(this.badge,this.themeService)))}renderBody(fe){super.renderBody(fe);const ye=(0,u.append)(fe,(0,u.$)(".extensions-list")),ke=(0,u.append)(fe,(0,u.$)(".message-container")),Ee=(0,u.append)(ke,(0,u.$)("")),Te=(0,u.append)(ke,(0,u.$)(".message")),_e=new f.Delegate,Re=new Y,Le=this.instantiationService.createInstance(f.Renderer,Re,{hoverOptions:{position:()=>this.layoutService.getSideBarPosition()===0?1:0}});this.list=this.instantiationService.createInstance(h.WorkbenchPagedList,"Extensions",ye,_e,[Le],{multipleSelectionSupport:!1,setRowLineHeight:!1,horizontalScrolling:!1,accessibilityProvider:{getAriaLabel(Me){if(!Me)return"";const Oe=(0,t.localize)(0,null,Me.publisherDisplayName),Ke=Me?.deprecationInfo?(0,t.localize)(1,null):"";return`${Me.displayName}, ${Ke?`${Ke}, `:""}${Me.version}, ${Oe}, ${Me.description}`},getWidgetAriaLabel(){return(0,t.localize)(2,null)}},overrideStyles:{listBackground:z.SIDE_BAR_BACKGROUND},openOnSingleClick:!0}),this._register(this.list.onContextMenu(Me=>this.onContextMenu(Me),this)),this._register(this.list.onDidChangeFocus(Me=>Re.onFocusChange((0,y.coalesce)(Me.elements)),this)),this._register(this.list),this._register(Re),this._register(R.Event.debounce(R.Event.filter(this.list.onDidOpen,Me=>Me.element!==null),(Me,Oe)=>Oe,75,!0)(Me=>{this.openExtension(Me.element,{sideByside:Me.sideBySide,...Me.editorOptions})})),this.bodyTemplate={extensionsList:ye,messageBox:Te,messageContainer:ke,messageSeverityIcon:Ee}}layoutBody(fe,ye){super.layoutBody(fe,ye),this.bodyTemplate&&(this.bodyTemplate.extensionsList.style.height=fe+"px"),this.list?.layout(fe,ye)}async show(fe,ye){if(this.queryRequest){if(!ye&&this.queryRequest.query===fe)return this.queryRequest.request;this.queryRequest.request.cancel(),this.queryRequest=null}this.queryResult&&(this.queryResult.disposables.dispose(),this.queryResult=void 0);const ke=l.Query.parse(fe),Ee={sortOrder:0};switch(ke.sortBy){case"installs":Ee.sortBy=4;break;case"rating":Ee.sortBy=12;break;case"name":Ee.sortBy=2;break;case"publishedDate":Ee.sortBy=10;break;case"updateDate":Ee.sortBy="UpdateDate";break}const Te=(0,N.createCancelablePromise)(async _e=>{try{this.queryResult=await this.query(ke,Ee,_e);const Re=this.queryResult.model;return this.setModel(Re),this.queryResult.onDidChangeModel&&this.queryResult.disposables.add(this.queryResult.onDidChangeModel(Le=>this.updateModel(Le))),Re}catch(Re){const Le=new E.PagedModel([]);return(0,A.isCancellationError)(Re)||(this.logService.error(Re),this.setModel(Le,Re)),this.list?this.list.model:Le}});return Te.finally(()=>this.queryRequest=null),this.queryRequest={query:fe,request:Te},Te}count(){return this.list?this.list.length:0}showEmptyModel(){const fe=new E.PagedModel([]);return this.setModel(fe),Promise.resolve(fe)}async onContextMenu(fe){if(fe.element){const ye=new p.DisposableStore,ke=ye.add(this.instantiationService.createInstance(g.ManageExtensionAction)),Ee=fe.element&&this.extensionsWorkbenchService.local.find(Re=>(0,S.areSameExtensions)(Re.identifier,fe.element.identifier)&&(!fe.element.server||fe.element.server===Re.server))||fe.element;ke.extension=Ee;let Te=[];ke.enabled?Te=await ke.getActionGroups():Ee&&(Te=await(0,g.getContextMenuActions)(Ee,this.contextKeyService,this.instantiationService),Te.forEach(Re=>Re.forEach(Le=>{Le instanceof g.ExtensionAction&&(Le.extension=Ee)})));let _e=[];for(const Re of Te)_e=[..._e,...Re,new M.Separator];_e.pop(),this.contextMenuService.showContextMenu({getAnchor:()=>fe.anchor,getActions:()=>_e,actionRunner:this.contextMenuActionRunner,onHide:()=>ye.dispose()})}}async query(fe,ye,ke){const Ee=/@id:(([a-z0-9A-Z][a-z0-9\-A-Z]*)\.([a-z0-9A-Z][a-z0-9\-A-Z]*))/g,Te=[];let _e;for(;(_e=Ee.exec(fe.value))!==null;){const Me=_e[1];Te.push(Me)}if(Te.length)return{model:await this.queryByIds(Te,ye,ke),disposables:new p.DisposableStore};if(ti.isLocalExtensionsQuery(fe.value,fe.sortBy))return this.queryLocal(fe,ye);ti.isSearchPopularQuery(fe.value)?(fe.value=fe.value.replace("@popular",""),ye.sortBy=ye.sortBy?ye.sortBy:4):ti.isSearchRecentlyPublishedQuery(fe.value)&&(fe.value=fe.value.replace("@recentlyPublished",""),ye.sortBy=ye.sortBy?ye.sortBy:10);const Re={...ye,sortBy:ie(ye.sortBy)?void 0:ye.sortBy};return{model:await this.queryGallery(fe,Re,ke),disposables:new p.DisposableStore}}async queryByIds(fe,ye,ke){const Ee=fe.reduce((Re,Le)=>(Re.add(Le.toLowerCase()),Re),new Set),Te=(await this.extensionsWorkbenchService.queryLocal(this.options.server)).filter(Re=>Ee.has(Re.identifier.id.toLowerCase())),_e=Te.length?fe.filter(Re=>Te.every(Le=>!(0,S.areSameExtensions)(Le.identifier,{id:Re}))):fe;if(_e.length){const Re=await this.extensionsWorkbenchService.getExtensions(_e.map(Le=>({id:Le})),{source:"queryById"},ke);Te.push(...Re)}return this.getPagedModel(Te)}async queryLocal(fe,ye){const ke=await this.extensionsWorkbenchService.queryLocal(this.options.server);let{extensions:Ee,canIncludeInstalledExtensions:Te}=await this.filterLocal(ke,this.extensionService.extensions,fe,ye);const _e=new p.DisposableStore,Re=_e.add(new R.Emitter);if(Te){let Le=!1;_e.add((0,p.toDisposable)(()=>Le=!0)),_e.add(R.Event.debounce(R.Event.any(R.Event.filter(this.extensionsWorkbenchService.onChange,Me=>Me?.state===1),this.extensionService.onDidChangeExtensions),()=>{})(async()=>{const Me=this.options.server?this.extensionsWorkbenchService.installed.filter(Ke=>Ke.server===this.options.server):this.extensionsWorkbenchService.local,{extensions:Oe}=await this.filterLocal(Me,this.extensionService.extensions,fe,ye);if(!Le){const Ke=this.mergeAddedExtensions(Ee,Oe);Ke&&(Ee=Ke,Re.fire(new E.PagedModel(Ee)))}}))}return{model:new E.PagedModel(Ee),onDidChangeModel:Re.event,disposables:_e}}async filterLocal(fe,ye,ke,Ee){const Te=ke.value;let _e=[],Re=!0;return/@builtin/i.test(Te)?(_e=this.filterBuiltinExtensions(fe,ke,Ee),Re=!1):/@installed/i.test(Te)?_e=this.filterInstalledExtensions(fe,ye,ke,Ee):/@outdated/i.test(Te)?_e=this.filterOutdatedExtensions(fe,ke,Ee):/@disabled/i.test(Te)?_e=this.filterDisabledExtensions(fe,ye,ke,Ee):/@enabled/i.test(Te)?_e=this.filterEnabledExtensions(fe,ye,ke,Ee):/@workspaceUnsupported/i.test(Te)?_e=this.filterWorkspaceUnsupportedExtensions(fe,ke,Ee):/@deprecated/i.test(ke.value)?_e=await this.filterDeprecatedExtensions(fe,ke,Ee):/@recentlyUpdated/i.test(ke.value)&&(_e=this.filterRecentlyUpdatedExtensions(fe,ke,Ee)),{extensions:_e,canIncludeInstalledExtensions:Re}}filterBuiltinExtensions(fe,ye,ke){let Ee=ye.value;const Te=/@builtin:themes/i.test(Ee);Te&&(Ee=Ee.replace(/@builtin:themes/g,""));const _e=/@builtin:basics/i.test(Ee);_e&&(Ee=Ee.replace(/@builtin:basics/g,""));const Re=/@builtin:features/i.test(Ee);Re&&(Ee=Ee.replace(/@builtin:features/g,"")),Ee=Ee.replace(/@builtin/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase();const Le=fe.filter(Ke=>Ke.isBuiltin&&(Ke.name.toLowerCase().indexOf(Ee)>-1||Ke.displayName.toLowerCase().indexOf(Ee)>-1)),Me=Ke=>Array.isArray(Ke.local?.manifest?.contributes?.themes)&&Ke.local.manifest.contributes.themes.length>0||Array.isArray(Ke.local?.manifest?.contributes?.iconThemes)&&Ke.local.manifest.contributes.iconThemes.length>0;if(Te){const Ke=Le.filter(Me);return this.sortExtensions(Ke,ke)}const Oe=Ke=>K.indexOf(Ke.identifier.id)===-1&&Array.isArray(Ke.local?.manifest?.contributes?.grammars)&&Ke.local.manifest.contributes.grammars.length>0;if(_e){const Ke=Le.filter(Oe);return this.sortExtensions(Ke,ke)}if(Re){const Ke=Le.filter(We=>We.local&&We.local.manifest&&!Me(We)&&!Oe(We));return this.sortExtensions(Ke,ke)}return this.sortExtensions(Le,ke)}parseCategories(fe){const ye=[];return fe=fe.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(ke,Ee,Te)=>{const _e=(Te||Ee||"").toLowerCase();return ye.indexOf(_e)===-1&&ye.push(_e),""}),{value:fe,categories:ye}}filterInstalledExtensions(fe,ye,ke,Ee){let{value:Te,categories:_e}=this.parseCategories(ke.value);Te=Te.replace(/@installed/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase();const Re=Me=>(Me.name.toLowerCase().indexOf(Te)>-1||Me.displayName.toLowerCase().indexOf(Te)>-1)&&(!_e.length||_e.some(Oe=>(Me.local&&Me.local.manifest.categories||[]).some(Ke=>Ke.toLowerCase()===Oe)));let Le;if(Ee.sortBy!==void 0)Le=fe.filter(Me=>!Me.isBuiltin&&Re(Me)),Le=this.sortExtensions(Le,Ee);else{Le=fe.filter(Je=>(!Je.isBuiltin||Je.outdated||Je.reloadRequiredStatus!==void 0)&&Re(Je));const Me=ye.reduce((Je,rt)=>(Je.set(O.ExtensionIdentifier.toKey(rt.identifier.value),rt),Je),new Map),Oe=(Je,rt)=>{const je=Me.get(O.ExtensionIdentifier.toKey(Je.identifier.id)),Ue=!!je&&this.extensionManagementServerService.getExtensionManagementServer((0,s.toExtension)(je))===Je.server,Fe=Me.get(O.ExtensionIdentifier.toKey(rt.identifier.id)),He=Fe&&this.extensionManagementServerService.getExtensionManagementServer((0,s.toExtension)(Fe))===rt.server;if(Ue&&He)return Je.displayName.localeCompare(rt.displayName);const Be=Je.local&&(0,O.isLanguagePackExtension)(Je.local.manifest),ze=rt.local&&(0,O.isLanguagePackExtension)(rt.local.manifest);return!Ue&&!He?Be?-1:ze?1:Je.displayName.localeCompare(rt.displayName):Ue&&ze||He&&Be?Je.displayName.localeCompare(rt.displayName):Ue?-1:1},Ke=[],We=[],Xe=[];Le.forEach(Je=>{Je.outdated&&!this.extensionsWorkbenchService.isExtensionIgnoresUpdates(Je)?Ke.push(Je):Je.reloadRequiredStatus?We.push(Je):Xe.push(Je)}),Le=[...Ke.sort(Oe),...We.sort(Oe),...Xe.sort(Oe)]}return Le}filterOutdatedExtensions(fe,ye,ke){let{value:Ee,categories:Te}=this.parseCategories(ye.value);Ee=Ee.replace(/@outdated/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase();const _e=fe.sort((Re,Le)=>Re.displayName.localeCompare(Le.displayName)).filter(Re=>Re.outdated&&(Re.name.toLowerCase().indexOf(Ee)>-1||Re.displayName.toLowerCase().indexOf(Ee)>-1)&&(!Te.length||Te.some(Le=>!!Re.local&&Re.local.manifest.categories.some(Me=>Me.toLowerCase()===Le))));return this.sortExtensions(_e,ke)}filterDisabledExtensions(fe,ye,ke,Ee){let{value:Te,categories:_e}=this.parseCategories(ke.value);Te=Te.replace(/@disabled/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase();const Re=fe.sort((Le,Me)=>Le.displayName.localeCompare(Me.displayName)).filter(Le=>ye.every(Me=>!(0,S.areSameExtensions)({id:Me.identifier.value,uuid:Me.uuid},Le.identifier))&&(Le.name.toLowerCase().indexOf(Te)>-1||Le.displayName.toLowerCase().indexOf(Te)>-1)&&(!_e.length||_e.some(Me=>(Le.local&&Le.local.manifest.categories||[]).some(Oe=>Oe.toLowerCase()===Me))));return this.sortExtensions(Re,Ee)}filterEnabledExtensions(fe,ye,ke,Ee){let{value:Te,categories:_e}=this.parseCategories(ke.value);Te=Te?Te.replace(/@enabled/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase():"",fe=fe.filter(Le=>!Le.isBuiltin);const Re=fe.sort((Le,Me)=>Le.displayName.localeCompare(Me.displayName)).filter(Le=>ye.some(Me=>(0,S.areSameExtensions)({id:Me.identifier.value,uuid:Me.uuid},Le.identifier))&&(Le.name.toLowerCase().indexOf(Te)>-1||Le.displayName.toLowerCase().indexOf(Te)>-1)&&(!_e.length||_e.some(Me=>(Le.local&&Le.local.manifest.categories||[]).some(Oe=>Oe.toLowerCase()===Me))));return this.sortExtensions(Re,Ee)}filterWorkspaceUnsupportedExtensions(fe,ye,ke){const Te=ye.value.match(/^\s*@workspaceUnsupported(?::(untrusted|virtual)(Partial)?)?(?:\s+([^\s]*))?/i);if(!Te)return[];const _e=Te[1]?.toLowerCase(),Re=!!Te[2],Le=Te[3]?.toLowerCase();Le&&(fe=fe.filter(Xe=>Xe.name.toLowerCase().indexOf(Le)>-1||Xe.displayName.toLowerCase().indexOf(Le)>-1));const Me=(Xe,Je)=>Xe.local&&this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(Xe.local.manifest)===Je,Oe=(Xe,Je)=>{if(!Xe.local)return!1;const rt=this.extensionEnablementService.getEnablementState(Xe.local);return rt!==8&&rt!==9&&rt!==0&&rt!==5?!1:this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(Xe.local.manifest)===Je?!0:Je===!1?(0,S.getExtensionDependencies)(fe.map(Ue=>Ue.local),Xe.local).some(Ue=>this.extensionManifestPropertiesService.getExtensionUntrustedWorkspaceSupportType(Ue.manifest)===Je):!1},Ke=(0,q.isVirtualWorkspace)(this.workspaceService.getWorkspace()),We=!this.workspaceTrustManagementService.isWorkspaceTrusted();return _e==="virtual"?fe=fe.filter(Xe=>Ke&&Me(Xe,Re?"limited":!1)&&!(We&&Oe(Xe,!1))):_e==="untrusted"?fe=fe.filter(Xe=>Oe(Xe,Re?"limited":!1)&&!(Ke&&Me(Xe,!1))):fe=fe.filter(Xe=>Ke&&!Me(Xe,!0)||We&&!Oe(Xe,!0)),this.sortExtensions(fe,ke)}async filterDeprecatedExtensions(fe,ye,ke){const Ee=ye.value.replace(/@deprecated/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase(),Te=await this.extensionManagementService.getExtensionsControlManifest(),_e=Object.keys(Te.deprecated);return fe=fe.filter(Re=>_e.includes(Re.identifier.id)&&(!Ee||Re.name.toLowerCase().indexOf(Ee)>-1||Re.displayName.toLowerCase().indexOf(Ee)>-1)),this.sortExtensions(fe,ke)}filterRecentlyUpdatedExtensions(fe,ye,ke){let{value:Ee,categories:Te}=this.parseCategories(ye.value);const _e=Date.now();fe=fe.filter(Le=>!Le.isBuiltin&&!Le.outdated&&Le.local?.updated&&Le.local?.installedTimestamp!==void 0&&_e-Le.local.installedTimestamp<ti.RECENT_UPDATE_DURATION),Ee=Ee.replace(/@recentlyUpdated/g,"").replace(/@sort:(\w+)(-\w*)?/g,"").trim().toLowerCase();const Re=fe.filter(Le=>(Le.name.toLowerCase().indexOf(Ee)>-1||Le.displayName.toLowerCase().indexOf(Ee)>-1)&&(!Te.length||Te.some(Me=>(Le.local&&Le.local.manifest.categories||[]).some(Oe=>Oe.toLowerCase()===Me))));return ke.sortBy=ke.sortBy??"UpdateDate",this.sortExtensions(Re,ke)}mergeAddedExtensions(fe,ye){const ke=[...fe],Ee=_e=>{let Re=-1;const Le=ye[_e];return Le&&(Re=ke.findIndex(Me=>(0,S.areSameExtensions)(Me.identifier,Le.identifier)),Re===-1)?Ee(_e-1):Re};let Te=!1;for(let _e=0;_e<ye.length;_e++){const Re=ye[_e];fe.every(Le=>!(0,S.areSameExtensions)(Le.identifier,Re.identifier))&&(Te=!0,fe.splice(Ee(_e-1)+1,0,Re))}return Te?fe:void 0}async queryGallery(fe,ye,ke){const Ee=ye.sortBy!==void 0;if(!Ee&&!fe.value.trim()&&(ye.sortBy=4),this.isRecommendationsQuery(fe))return this.queryRecommendations(fe,ye,ke);if(/\bcurated:([^\s]+)\b/.test(fe.value))return this.getCuratedModel(fe,ye,ke);const Te=fe.value;if(/\bext:([^\s]+)\b/g.test(Te))return ye.text=Te,ye.source="file-extension-tags",this.extensionsWorkbenchService.queryGallery(ye,ke).then(Me=>this.getPagedModel(Me));let _e=[];if(Te){if(ye.text=Te.substring(0,350),ye.source="searchText",!Ee){const Me=await this.getSearchExperiments();for(const Oe of Me)if(Oe.action&&Te.toLowerCase()===Oe.action.properties.searchText&&Array.isArray(Oe.action.properties.preferredResults)){_e=Oe.action.properties.preferredResults,ye.source+=`-experiment-${Oe.id}`;break}}}else ye.source="viewlet";const Re=await this.extensionsWorkbenchService.queryGallery(ye,ke);let Le=0;for(const Me of _e)for(let Oe=Le;Oe<Re.firstPage.length;Oe++)if((0,S.areSameExtensions)(Re.firstPage[Oe].identifier,{id:Me})){if(Le!==Oe){const Ke=Re.firstPage.splice(Oe,1)[0];Re.firstPage.splice(Le,0,Ke),Le++}break}return this.getPagedModel(Re)}resetSearchExperiments(){ti.searchExperiments=void 0}getSearchExperiments(){return ti.searchExperiments||(ti.searchExperiments=this.experimentService.getExperimentsByType(T.ExperimentActionType.ExtensionSearchResults).then(null,fe=>(this.logService.error(fe),[]))),ti.searchExperiments}sortExtensions(fe,ye){switch(ye.sortBy){case 4:fe=fe.sort((ke,Ee)=>typeof Ee.installCount=="number"&&typeof ke.installCount=="number"?Ee.installCount-ke.installCount:NaN);break;case"UpdateDate":fe=fe.sort((ke,Ee)=>typeof Ee.local?.installedTimestamp=="number"&&typeof ke.local?.installedTimestamp=="number"?Ee.local.installedTimestamp-ke.local.installedTimestamp:typeof Ee.local?.installedTimestamp=="number"?1:typeof ke.local?.installedTimestamp=="number"?-1:NaN);break;case 6:case 12:fe=fe.sort((ke,Ee)=>typeof Ee.rating=="number"&&typeof ke.rating=="number"?Ee.rating-ke.rating:NaN);break;default:fe=fe.sort((ke,Ee)=>ke.displayName.localeCompare(Ee.displayName));break}return ye.sortOrder===2&&(fe=fe.reverse()),fe}async getCuratedModel(fe,ye,ke){const Ee=fe.value.replace(/curated:/g,"").trim();let Te=await this.experimentService.getCuratedExtensionsList(Ee);if(Array.isArray(Te)&&Te.length){Te=Te.map(Re=>Re.toLowerCase());const _e=await this.extensionsWorkbenchService.getExtensions(Te.map(Re=>({id:Re})),{source:`curated:${Ee}`},ke);return _e.sort((Re,Le)=>Te.indexOf(Re.identifier.id.toLowerCase())<Te.indexOf(Le.identifier.id.toLowerCase())?-1:1),this.getPagedModel(_e)}return new E.PagedModel([])}isRecommendationsQuery(fe){return ti.isWorkspaceRecommendedExtensionsQuery(fe.value)||ti.isKeymapsRecommendedExtensionsQuery(fe.value)||ti.isLanguageRecommendedExtensionsQuery(fe.value)||ti.isExeRecommendedExtensionsQuery(fe.value)||/@recommended:all/i.test(fe.value)||ti.isSearchRecommendedExtensionsQuery(fe.value)||ti.isRecommendedExtensionsQuery(fe.value)}async queryRecommendations(fe,ye,ke){return ti.isWorkspaceRecommendedExtensionsQuery(fe.value)?this.getWorkspaceRecommendationsModel(fe,ye,ke):ti.isKeymapsRecommendedExtensionsQuery(fe.value)?this.getKeymapRecommendationsModel(fe,ye,ke):ti.isLanguageRecommendedExtensionsQuery(fe.value)?this.getLanguageRecommendationsModel(fe,ye,ke):ti.isExeRecommendedExtensionsQuery(fe.value)?this.getExeRecommendationsModel(fe,ye,ke):/@recommended:all/i.test(fe.value)?this.getAllRecommendationsModel(ye,ke):ti.isSearchRecommendedExtensionsQuery(fe.value)||ti.isRecommendedExtensionsQuery(fe.value)&&ye.sortBy!==void 0?this.searchRecommendations(fe,ye,ke):ti.isRecommendedExtensionsQuery(fe.value)?this.getOtherRecommendationsModel(fe,ye,ke):new E.PagedModel([])}async getInstallableRecommendations(fe,ye,ke){const Ee=[];if(fe.length){const Te=await this.extensionsWorkbenchService.getExtensions(fe.map(_e=>({id:_e})),{source:ye.source},ke);for(const _e of Te)_e.gallery&&await this.extensionManagementService.canInstall(_e.gallery)&&Ee.push(_e)}return Ee}async getWorkspaceRecommendations(){const fe=await this.extensionRecommendationsService.getWorkspaceRecommendations(),{important:ye}=await this.extensionRecommendationsService.getConfigBasedRecommendations();for(const ke of ye)fe.find(Ee=>Ee===ke)||fe.push(ke);return fe}async getWorkspaceRecommendationsModel(fe,ye,ke){const Ee=await this.getWorkspaceRecommendations(),Te=await this.getInstallableRecommendations(Ee,{...ye,source:"recommendations-workspace"},ke),_e=(0,y.coalesce)(Ee.map(Re=>Te.find(Le=>(0,S.areSameExtensions)(Le.identifier,{id:Re}))));return new E.PagedModel(_e)}async getKeymapRecommendationsModel(fe,ye,ke){const Ee=fe.value.replace(/@recommended:keymaps/g,"").trim().toLowerCase(),Te=this.extensionRecommendationsService.getKeymapRecommendations(),_e=(await this.getInstallableRecommendations(Te,{...ye,source:"recommendations-keymaps"},ke)).filter(Re=>Re.identifier.id.toLowerCase().indexOf(Ee)>-1);return new E.PagedModel(_e)}async getLanguageRecommendationsModel(fe,ye,ke){const Ee=fe.value.replace(/@recommended:languages/g,"").trim().toLowerCase(),Te=this.extensionRecommendationsService.getLanguageRecommendations(),_e=(await this.getInstallableRecommendations(Te,{...ye,source:"recommendations-languages"},ke)).filter(Re=>Re.identifier.id.toLowerCase().indexOf(Ee)>-1);return new E.PagedModel(_e)}async getExeRecommendationsModel(fe,ye,ke){const Ee=fe.value.replace(/@exe:/g,"").trim().toLowerCase(),{important:Te,others:_e}=await this.extensionRecommendationsService.getExeBasedRecommendations(Ee.startsWith('"')?Ee.substring(1,Ee.length-1):Ee),Re=await this.getInstallableRecommendations([...Te,..._e],{...ye,source:"recommendations-exe"},ke);return new E.PagedModel(Re)}async getOtherRecommendationsModel(fe,ye,ke){const Ee=await this.getOtherRecommendations(),Te=await this.getInstallableRecommendations(Ee,{...ye,source:"recommendations-other",sortBy:void 0},ke),_e=(0,y.coalesce)(Ee.map(Re=>Te.find(Le=>(0,S.areSameExtensions)(Le.identifier,{id:Re}))));return new E.PagedModel(_e)}async getOtherRecommendations(){const fe=(await this.extensionsWorkbenchService.queryLocal(this.options.server)).map(ke=>ke.identifier.id.toLowerCase()),ye=(await this.getWorkspaceRecommendations()).map(ke=>ke.toLowerCase());return(0,y.distinct)((0,y.flatten)(await Promise.all([this.extensionRecommendationsService.getImportantRecommendations(),this.extensionRecommendationsService.getFileBasedRecommendations(),this.extensionRecommendationsService.getOtherRecommendations()])).filter(ke=>!fe.includes(ke.toLowerCase())&&!ye.includes(ke.toLowerCase())),ke=>ke.toLowerCase())}async getAllRecommendationsModel(fe,ye){const ke=(await this.extensionsWorkbenchService.queryLocal(this.options.server)).map(Re=>Re.identifier.id.toLowerCase()),Ee=(0,y.distinct)((0,y.flatten)(await Promise.all([this.getWorkspaceRecommendations(),this.extensionRecommendationsService.getImportantRecommendations(),this.extensionRecommendationsService.getFileBasedRecommendations(),this.extensionRecommendationsService.getOtherRecommendations()])).filter(Re=>!ke.includes(Re.toLowerCase())),Re=>Re.toLowerCase()),Te=await this.getInstallableRecommendations(Ee,{...fe,source:"recommendations-all",sortBy:void 0},ye),_e=(0,y.coalesce)(Ee.map(Re=>Te.find(Le=>(0,S.areSameExtensions)(Le.identifier,{id:Re}))));return new E.PagedModel(_e.slice(0,8))}async searchRecommendations(fe,ye,ke){const Ee=fe.value.replace(/@recommended/g,"").trim().toLowerCase(),Te=(0,y.distinct)([...await this.getWorkspaceRecommendations(),...await this.getOtherRecommendations()]),_e=(await this.getInstallableRecommendations(Te,{...ye,source:"recommendations",sortBy:void 0},ke)).filter(Le=>Le.identifier.id.toLowerCase().indexOf(Ee)>-1),Re=(0,y.coalesce)(Te.map(Le=>_e.find(Me=>(0,S.areSameExtensions)(Me.identifier,{id:Le}))));return new E.PagedModel(this.sortExtensions(Re,ye))}setModel(fe,ye){this.list&&(this.list.model=new E.DelayedPagedModel(fe),this.list.scrollTop=0,this.updateBody(ye))}updateBody(fe){const ye=this.count();this.bodyTemplate&&this.badge&&(this.bodyTemplate.extensionsList.classList.toggle("hidden",ye===0),this.bodyTemplate.messageContainer.classList.toggle("hidden",ye>0),this.badge.setCount(ye),ye===0&&this.isBodyVisible()&&(fe?(0,j.isOfflineError)(fe)?(this.bodyTemplate.messageSeverityIcon.className=B.SeverityIcon.className(m.Severity.Warning),this.bodyTemplate.messageBox.textContent=(0,t.localize)(3,null)):(this.bodyTemplate.messageSeverityIcon.className=B.SeverityIcon.className(m.Severity.Error),this.bodyTemplate.messageBox.textContent=(0,t.localize)(4,null,(0,A.getErrorMessage)(fe))):(this.bodyTemplate.messageSeverityIcon.className="",this.bodyTemplate.messageBox.textContent=(0,t.localize)(5,null)),(0,_.alert)(this.bodyTemplate.messageBox.textContent))),this.updateSize()}updateSize(){this.options.flexibleHeight&&(this.maximumBodySize=this.list?.model.length?Number.POSITIVE_INFINITY:0,this.storageService.store(`${this.id}.size`,this.list?.model.length||0,0,1))}updateModel(fe){this.list&&(this.list.model=new E.DelayedPagedModel(fe),this.updateBody())}openExtension(fe,ye){fe=this.extensionsWorkbenchService.local.filter(ke=>(0,S.areSameExtensions)(ke.identifier,fe.identifier))[0]||fe,this.extensionsWorkbenchService.open(fe,ye).then(void 0,ke=>this.onError(ke))}onError(fe){if((0,A.isCancellationError)(fe))return;const ye=fe&&fe.message||"";if(/ECONNREFUSED/.test(ye)){const ke=(0,k.createErrorWithActions)((0,t.localize)(6,null),[new M.Action("open user settings",(0,t.localize)(7,null),void 0,!0,()=>this.preferencesService.openUserSettings())]);this.notificationService.error(ke);return}this.notificationService.error(fe)}getPagedModel(fe){if(Array.isArray(fe))return new E.PagedModel(fe);const ye={total:fe.total,pageSize:fe.pageSize,firstPage:fe.firstPage,getPage:(ke,Ee)=>fe.getPage(ke,Ee)};return new E.PagedModel(ye)}dispose(){super.dispose(),this.queryRequest&&(this.queryRequest.request.cancel(),this.queryRequest=null),this.queryResult&&(this.queryResult.disposables.dispose(),this.queryResult=void 0),this.list=null}static isLocalExtensionsQuery(fe,ye){return this.isInstalledExtensionsQuery(fe)||this.isOutdatedExtensionsQuery(fe)||this.isEnabledExtensionsQuery(fe)||this.isDisabledExtensionsQuery(fe)||this.isBuiltInExtensionsQuery(fe)||this.isSearchBuiltInExtensionsQuery(fe)||this.isBuiltInGroupExtensionsQuery(fe)||this.isSearchDeprecatedExtensionsQuery(fe)||this.isSearchWorkspaceUnsupportedExtensionsQuery(fe)||this.isSearchRecentlyUpdatedQuery(fe)||this.isSearchExtensionUpdatesQuery(fe)||this.isSortInstalledExtensionsQuery(fe,ye)}static isSearchBuiltInExtensionsQuery(fe){return/@builtin\s.+/i.test(fe)}static isBuiltInExtensionsQuery(fe){return/^\s*@builtin$/i.test(fe.trim())}static isBuiltInGroupExtensionsQuery(fe){return/^\s*@builtin:.+$/i.test(fe.trim())}static isSearchWorkspaceUnsupportedExtensionsQuery(fe){return/^\s*@workspaceUnsupported(:(untrusted|virtual)(Partial)?)?(\s|$)/i.test(fe)}static isInstalledExtensionsQuery(fe){return/@installed/i.test(fe)}static isOutdatedExtensionsQuery(fe){return/@outdated/i.test(fe)}static isEnabledExtensionsQuery(fe){return/@enabled/i.test(fe)}static isDisabledExtensionsQuery(fe){return/@disabled/i.test(fe)}static isSearchDeprecatedExtensionsQuery(fe){return/@deprecated\s?.*/i.test(fe)}static isRecommendedExtensionsQuery(fe){return/^@recommended$/i.test(fe.trim())}static isSearchRecommendedExtensionsQuery(fe){return/@recommended\s.+/i.test(fe)}static isWorkspaceRecommendedExtensionsQuery(fe){return/@recommended:workspace/i.test(fe)}static isExeRecommendedExtensionsQuery(fe){return/@exe:.+/i.test(fe)}static isKeymapsRecommendedExtensionsQuery(fe){return/@recommended:keymaps/i.test(fe)}static isLanguageRecommendedExtensionsQuery(fe){return/@recommended:languages/i.test(fe)}static isSortInstalledExtensionsQuery(fe,ye){return ye!==void 0&&ye!==""&&fe===""||!ye&&/^@sort:\S*$/i.test(fe)}static isSearchPopularQuery(fe){return/@popular/i.test(fe)}static isSearchRecentlyPublishedQuery(fe){return/@recentlyPublished/i.test(fe)}static isSearchRecentlyUpdatedQuery(fe){return/@recentlyUpdated/i.test(fe)}static isSearchExtensionUpdatesQuery(fe){return/@updates/i.test(fe)}static isSortUpdateDateQuery(fe){return/@sort:updateDate/i.test(fe)}focus(){super.focus(),this.list&&(this.list.getFocus().length||this.list.getSelection().length||this.list.focusNext(),this.list.domFocus())}};re.RECENT_UPDATE_DURATION=7*24*60*60*1e3,re=we([F(2,m.INotificationService),F(3,C.IKeybindingService),F(4,r.IContextMenuService),F(5,i.IInstantiationService),F(6,d.IThemeService),F(7,s.IExtensionService),F(8,c.IExtensionsWorkbenchService),F(9,b.IExtensionRecommendationsService),F(10,a.ITelemetryService),F(11,v.IConfigurationService),F(12,D.IWorkspaceContextService),F(13,T.IExperimentService),F(14,I.IExtensionManagementServerService),F(15,$.IExtensionManifestPropertiesService),F(16,I.IWorkbenchExtensionManagementService),F(17,D.IWorkspaceContextService),F(18,P.IProductService),F(19,V.IContextKeyService),F(20,x.IViewDescriptorService),F(21,H.IOpenerService),F(22,W.IPreferencesService),F(23,U.IStorageService),F(24,X.IWorkspaceTrustManagementService),F(25,I.IWorkbenchExtensionEnablementService),F(26,G.IWorkbenchLayoutService),F(27,Q.ILogService)],re),e.ExtensionsListView=re;class oe extends re{async show(){const fe=this.extensionManagementServerService.webExtensionManagementServer&&!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer?"@web":"";return super.show(fe)}}e.DefaultPopularExtensionsView=oe;class se extends re{async show(fe){return fe=fe||"@installed",(!re.isLocalExtensionsQuery(fe)||re.isSortInstalledExtensionsQuery(fe))&&(fe=fe+=" @installed"),super.show(fe.trim())}}e.ServerInstalledExtensionsView=se;class te extends re{async show(fe){return fe=fe||"@enabled",re.isEnabledExtensionsQuery(fe)?super.show(fe):re.isSortInstalledExtensionsQuery(fe)?super.show("@enabled "+fe):this.showEmptyModel()}}e.EnabledExtensionsView=te;class Z extends re{async show(fe){return fe=fe||"@disabled",re.isDisabledExtensionsQuery(fe)?super.show(fe):re.isSortInstalledExtensionsQuery(fe)?super.show("@disabled "+fe):this.showEmptyModel()}}e.DisabledExtensionsView=Z;class ne extends re{async show(fe){fe=fe||"@outdated",re.isSearchExtensionUpdatesQuery(fe)&&(fe=fe.replace("@updates","@outdated"));const ye=await super.show(fe.trim());return this.setExpanded(ye.length>0),ye}}e.OutdatedExtensionsView=ne;class ce extends re{async show(fe){return fe=fe||"@recentlyUpdated",re.isSearchExtensionUpdatesQuery(fe)&&(fe=fe.replace("@updates","@recentlyUpdated")),super.show(fe.trim())}}e.RecentlyUpdatedExtensionsView=ce;class de extends re{async show(fe){return fe&&fe.trim()!=="@builtin"?this.showEmptyModel():super.show("@builtin:features")}}e.BuiltInFeatureExtensionsView=de;class he extends re{async show(fe){return fe&&fe.trim()!=="@builtin"?this.showEmptyModel():super.show("@builtin:themes")}}e.BuiltInThemesExtensionsView=he;class pe extends re{async show(fe){return fe&&fe.trim()!=="@builtin"?this.showEmptyModel():super.show("@builtin:basics")}}e.BuiltInProgrammingLanguageExtensionsView=pe;function me(Pe,fe){if(!Pe)return"@workspaceUnsupported:"+fe;const ye=Pe.match(new RegExp(`@workspaceUnsupported(:${fe})?(\\s|$)`,"i"));if(ye)return ye[1]?Pe:Pe.replace(/@workspaceUnsupported/gi,"@workspaceUnsupported:"+fe)}class Se extends re{async show(fe){const ye=me(fe,"untrusted");return ye?super.show(ye):this.showEmptyModel()}}e.UntrustedWorkspaceUnsupportedExtensionsView=Se;class Ie extends re{async show(fe){const ye=me(fe,"untrustedPartial");return ye?super.show(ye):this.showEmptyModel()}}e.UntrustedWorkspacePartiallySupportedExtensionsView=Ie;class ve extends re{async show(fe){const ye=me(fe,"virtual");return ye?super.show(ye):this.showEmptyModel()}}e.VirtualWorkspaceUnsupportedExtensionsView=ve;class be extends re{async show(fe){const ye=me(fe,"virtualPartial");return ye?super.show(ye):this.showEmptyModel()}}e.VirtualWorkspacePartiallySupportedExtensionsView=be;class ge extends re{async show(fe){return re.isSearchDeprecatedExtensionsQuery(fe)?super.show(fe):this.showEmptyModel()}}e.DeprecatedExtensionsView=ge;class ue extends re{constructor(){super(...arguments),this.reportSearchFinishedDelayer=this._register(new N.ThrottledDelayer(2e3)),this.searchWaitPromise=Promise.resolve()}async show(fe){const ye=super.show(fe);return this.reportSearchFinishedDelayer.trigger(()=>this.reportSearchFinished()),this.searchWaitPromise=ye.then(null,null),ye}async reportSearchFinished(){await this.searchWaitPromise,this.telemetryService.publicLog2("extensionsView:MarketplaceSearchFinished")}}e.SearchMarketplaceExtensionsView=ue;class Ce extends re{constructor(){super(...arguments),this.recommendedExtensionsQuery="@recommended:all"}renderBody(fe){super.renderBody(fe),this._register(this.extensionRecommendationsService.onDidChangeRecommendations(()=>{this.show("")}))}async show(fe){if(fe&&fe.trim()!==this.recommendedExtensionsQuery)return this.showEmptyModel();const ye=await super.show(this.recommendedExtensionsQuery);return this.extensionsWorkbenchService.local.some(ke=>!ke.isBuiltin)||this.setExpanded(ye.length>0),ye}}e.DefaultRecommendedExtensionsView=Ce;class De extends re{constructor(){super(...arguments),this.recommendedExtensionsQuery="@recommended"}renderBody(fe){super.renderBody(fe),this._register(this.extensionRecommendationsService.onDidChangeRecommendations(()=>{this.show("")}))}async show(fe){return fe&&fe.trim()!==this.recommendedExtensionsQuery?this.showEmptyModel():super.show(this.recommendedExtensionsQuery)}}e.RecommendedExtensionsView=De;class Ae extends re{constructor(){super(...arguments),this.recommendedExtensionsQuery="@recommended:workspace"}renderBody(fe){super.renderBody(fe),this._register(this.extensionRecommendationsService.onDidChangeRecommendations(()=>this.show(this.recommendedExtensionsQuery))),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.show(this.recommendedExtensionsQuery)))}async show(fe){const ke=await(fe&&fe.trim()!=="@recommended"&&fe.trim()!=="@recommended:workspace"?this.showEmptyModel():super.show(this.recommendedExtensionsQuery));return this.setExpanded(ke.length>0),ke}async getInstallableWorkspaceRecommendations(){const fe=(await this.extensionsWorkbenchService.queryLocal()).filter(ke=>ke.enablementState!==1),ye=(await this.getWorkspaceRecommendations()).filter(ke=>fe.every(Ee=>!(0,S.areSameExtensions)({id:ke},Ee.identifier)));return this.getInstallableRecommendations(ye,{source:"install-all-workspace-recommendations"},L.CancellationToken.None)}async installWorkspaceRecommendations(){const fe=await this.getInstallableWorkspaceRecommendations();fe.length?await this.extensionManagementService.installExtensions(fe.map(ye=>ye.gallery)):this.notificationService.notify({severity:m.Severity.Info,message:(0,t.localize)(8,null)})}}e.WorkspaceRecommendedExtensionsView=Ae}),define(ae[1018],le([1,0,1657,11,21,117,2,6,36,10,27,5,39,119,320,82,120,523,3021,66,58,68,190,12,8,45,23,34,7,37,25,26,74,83,163,635,693,110,17,49,97,106,80,51,71,31,338,15,91,16,253,18,100,1142]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U,$,q,X,G,Q,j,K,Y,ee){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MaliciousExtensionChecker=e.StatusUpdater=e.ExtensionsViewPaneContainer=e.ExtensionsViewletViewsContribution=e.RecommendedExtensionsContext=e.BuiltInExtensionsContext=e.SearchHasTextContext=e.SearchMarketplaceExtensionsContext=e.ExtensionsSortByContext=e.DefaultViewsContext=void 0,e.DefaultViewsContext=new D.RawContextKey("defaultExtensionViews",!0),e.ExtensionsSortByContext=new D.RawContextKey("extensionsSortByValue",""),e.SearchMarketplaceExtensionsContext=new D.RawContextKey("searchMarketplaceExtensions",!1),e.SearchHasTextContext=new D.RawContextKey("extensionSearchHasText",!1);const ie=new D.RawContextKey("searchInstalledExtensions",!1),re=new D.RawContextKey("searchRecentlyUpdatedExtensions",!1),oe=new D.RawContextKey("searchExtensionUpdates",!1),se=new D.RawContextKey("searchOutdatedExtensions",!1),te=new D.RawContextKey("searchEnabledExtensions",!1),Z=new D.RawContextKey("searchDisabledExtensions",!1),ne=new D.RawContextKey("hasInstalledExtensions",!0);e.BuiltInExtensionsContext=new D.RawContextKey("builtInExtensions",!1);const ce=new D.RawContextKey("searchBuiltInExtensions",!1),de=new D.RawContextKey("searchUnsupportedWorkspaceExtensions",!1),he=new D.RawContextKey("searchDeprecatedExtensions",!1);e.RecommendedExtensionsContext=new D.RawContextKey("recommendedExtensions",!1);const pe=new D.RawContextKey("sortByUpdateDate",!1),me={value:(0,t.localize)(0,null),original:"Remote"};let Se=class{constructor(ue,Ce,De,Ae){this.extensionManagementServerService=ue,this.labelService=Ce,this.contextKeyService=Ae,this.container=De.getViewContainerById(u.VIEWLET_ID),this.registerViews()}registerViews(){const ue=[];ue.push(...this.createDefaultExtensionsViewDescriptors()),ue.push(...this.createSearchExtensionsViewDescriptors()),ue.push(...this.createRecommendedExtensionsViewDescriptors()),ue.push(...this.createBuiltinExtensionsViewDescriptors()),ue.push(...this.createUnsupportedWorkspaceExtensionsViewDescriptors()),ue.push(...this.createOtherLocalFilteredExtensionsViewDescriptors()),V.Registry.as(v.Extensions.ViewsRegistry).registerViews(ue,this.container)}createDefaultExtensionsViewDescriptors(){const ue=[],Ce=[];this.extensionManagementServerService.localExtensionManagementServer&&Ce.push(this.extensionManagementServerService.localExtensionManagementServer),this.extensionManagementServerService.remoteExtensionManagementServer&&Ce.push(this.extensionManagementServerService.remoteExtensionManagementServer),this.extensionManagementServerService.webExtensionManagementServer&&Ce.push(this.extensionManagementServerService.webExtensionManagementServer);const De=(fe,ye)=>Ce.length>1?`${ye.label} - ${fe}`:fe;let Ae=E.Event.None;if(this.extensionManagementServerService.webExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer){const fe=new Set;fe.add("hasInstalledWebExtensions"),Ae=E.Event.filter(this.contextKeyService.onDidChangeContext,ye=>ye.affectsSome(fe))}const Pe=E.Event.any(this.labelService.onDidChangeFormatters,Ae);for(const fe of Ce){const ye=()=>De((0,t.localize)(1,null),fe),ke=E.Event.map(Pe,()=>ye()),Ee=Ce.length>1?`workbench.views.extensions.${fe.id}.installed`:"workbench.views.extensions.installed";ue.push({id:Ee,get name(){return ye()},weight:100,order:1,when:D.ContextKeyExpr.and(e.DefaultViewsContext),ctorDescriptor:new x.SyncDescriptor(s.ServerInstalledExtensionsView,[{server:fe,flexibleHeight:!0,onDidChangeTitle:ke}]),canToggleVisibility:Ce.length===1}),fe===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManagementServerService.localExtensionManagementServer&&(0,G.registerAction2)(class extends G.Action2{constructor(){super({id:"workbench.extensions.installLocalExtensions",get title(){return{value:(0,t.localize)(2,null,fe.label),original:`Install Local Extensions in '${fe.label}'...`}},category:me,icon:X.installLocalInRemoteIcon,f1:!0,menu:{id:G.MenuId.ViewTitle,when:D.ContextKeyExpr.equals("view",Ee),group:"navigation"}})}run(_e){return _e.get(C.IInstantiationService).createInstance(i.InstallLocalExtensionsInRemoteAction).run()}})}return this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManagementServerService.remoteExtensionManagementServer&&(0,G.registerAction2)(class extends G.Action2{constructor(){super({id:"workbench.extensions.actions.installLocalExtensionsInRemote",title:{value:(0,t.localize)(3,null),original:"Install Remote Extensions Locally..."},category:me,f1:!0})}run(ye){return ye.get(C.IInstantiationService).createInstance(i.InstallRemoteExtensionsInLocalAction,"workbench.extensions.actions.installLocalExtensionsInRemote").run()}}),ue.push({id:"workbench.views.extensions.popular",name:(0,t.localize)(4,null),ctorDescriptor:new x.SyncDescriptor(s.DefaultPopularExtensionsView,[{hideBadge:!0}]),when:D.ContextKeyExpr.and(e.DefaultViewsContext,D.ContextKeyExpr.not("hasInstalledExtensions"),u.CONTEXT_HAS_GALLERY),weight:60,order:2,canToggleVisibility:!1}),ue.push({id:"extensions.recommendedList",name:(0,t.localize)(5,null),ctorDescriptor:new x.SyncDescriptor(s.DefaultRecommendedExtensionsView,[{flexibleHeight:!0}]),when:D.ContextKeyExpr.and(e.DefaultViewsContext,pe.negate(),D.ContextKeyExpr.not("config.extensions.showRecommendationsOnlyOnDemand"),u.CONTEXT_HAS_GALLERY),weight:40,order:3,canToggleVisibility:!0}),Ce.length===1&&(ue.push({id:"workbench.views.extensions.enabled",name:(0,t.localize)(6,null),ctorDescriptor:new x.SyncDescriptor(s.EnabledExtensionsView,[{}]),when:D.ContextKeyExpr.and(e.DefaultViewsContext,D.ContextKeyExpr.has("hasInstalledExtensions")),hideByDefault:!0,weight:40,order:4,canToggleVisibility:!0}),ue.push({id:"workbench.views.extensions.disabled",name:(0,t.localize)(7,null),ctorDescriptor:new x.SyncDescriptor(s.DisabledExtensionsView,[{}]),when:D.ContextKeyExpr.and(e.DefaultViewsContext,D.ContextKeyExpr.has("hasInstalledExtensions")),hideByDefault:!0,weight:10,order:5,canToggleVisibility:!0})),ue}createSearchExtensionsViewDescriptors(){const ue=[];return ue.push({id:"workbench.views.extensions.marketplace",name:(0,t.localize)(8,null),ctorDescriptor:new x.SyncDescriptor(s.SearchMarketplaceExtensionsView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchMarketplaceExtensions"))}),ue.push({id:"workbench.views.extensions.searchInstalled",name:(0,t.localize)(9,null),ctorDescriptor:new x.SyncDescriptor(s.ExtensionsListView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchInstalledExtensions"))}),ue.push({id:"workbench.views.extensions.searchRecentlyUpdated",name:(0,t.localize)(10,null),ctorDescriptor:new x.SyncDescriptor(s.RecentlyUpdatedExtensionsView,[{}]),when:D.ContextKeyExpr.or(oe,D.ContextKeyExpr.has("searchRecentlyUpdatedExtensions")),order:2}),ue.push({id:"workbench.views.extensions.searchEnabled",name:(0,t.localize)(11,null),ctorDescriptor:new x.SyncDescriptor(s.ExtensionsListView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchEnabledExtensions"))}),ue.push({id:"workbench.views.extensions.searchDisabled",name:(0,t.localize)(12,null),ctorDescriptor:new x.SyncDescriptor(s.ExtensionsListView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchDisabledExtensions"))}),ue.push({id:u.OUTDATED_EXTENSIONS_VIEW_ID,name:(0,t.localize)(13,null),ctorDescriptor:new x.SyncDescriptor(s.OutdatedExtensionsView,[{}]),when:D.ContextKeyExpr.or(oe,D.ContextKeyExpr.has("searchOutdatedExtensions")),order:1}),ue.push({id:"workbench.views.extensions.searchBuiltin",name:(0,t.localize)(14,null),ctorDescriptor:new x.SyncDescriptor(s.ExtensionsListView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchBuiltInExtensions"))}),ue.push({id:"workbench.views.extensions.searchWorkspaceUnsupported",name:(0,t.localize)(15,null),ctorDescriptor:new x.SyncDescriptor(s.ExtensionsListView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("searchWorkspaceUnsupportedExtensions"))}),ue}createRecommendedExtensionsViewDescriptors(){const ue=[];return ue.push({id:u.WORKSPACE_RECOMMENDATIONS_VIEW_ID,name:(0,t.localize)(16,null),ctorDescriptor:new x.SyncDescriptor(s.WorkspaceRecommendedExtensionsView,[{}]),when:D.ContextKeyExpr.and(D.ContextKeyExpr.has("recommendedExtensions"),$.WorkbenchStateContext.notEqualsTo("empty")),order:1}),ue.push({id:"workbench.views.extensions.otherRecommendations",name:(0,t.localize)(17,null),ctorDescriptor:new x.SyncDescriptor(s.RecommendedExtensionsView,[{}]),when:D.ContextKeyExpr.has("recommendedExtensions"),order:2}),ue}createBuiltinExtensionsViewDescriptors(){const ue=[];return ue.push({id:"workbench.views.extensions.builtinFeatureExtensions",name:(0,t.localize)(18,null),ctorDescriptor:new x.SyncDescriptor(s.BuiltInFeatureExtensionsView,[{}]),when:D.ContextKeyExpr.has("builtInExtensions")}),ue.push({id:"workbench.views.extensions.builtinThemeExtensions",name:(0,t.localize)(19,null),ctorDescriptor:new x.SyncDescriptor(s.BuiltInThemesExtensionsView,[{}]),when:D.ContextKeyExpr.has("builtInExtensions")}),ue.push({id:"workbench.views.extensions.builtinProgrammingLanguageExtensions",name:(0,t.localize)(20,null),ctorDescriptor:new x.SyncDescriptor(s.BuiltInProgrammingLanguageExtensionsView,[{}]),when:D.ContextKeyExpr.has("builtInExtensions")}),ue}createUnsupportedWorkspaceExtensionsViewDescriptors(){const ue=[];return ue.push({id:"workbench.views.extensions.untrustedUnsupportedExtensions",name:(0,t.localize)(21,null),ctorDescriptor:new x.SyncDescriptor(s.UntrustedWorkspaceUnsupportedExtensionsView,[{}]),when:D.ContextKeyExpr.and(de)}),ue.push({id:"workbench.views.extensions.untrustedPartiallySupportedExtensions",name:(0,t.localize)(22,null),ctorDescriptor:new x.SyncDescriptor(s.UntrustedWorkspacePartiallySupportedExtensionsView,[{}]),when:D.ContextKeyExpr.and(de)}),ue.push({id:"workbench.views.extensions.virtualUnsupportedExtensions",name:(0,t.localize)(23,null),ctorDescriptor:new x.SyncDescriptor(s.VirtualWorkspaceUnsupportedExtensionsView,[{}]),when:D.ContextKeyExpr.and($.VirtualWorkspaceContext,de)}),ue.push({id:"workbench.views.extensions.virtualPartiallySupportedExtensions",name:(0,t.localize)(24,null),ctorDescriptor:new x.SyncDescriptor(s.VirtualWorkspacePartiallySupportedExtensionsView,[{}]),when:D.ContextKeyExpr.and($.VirtualWorkspaceContext,de)}),ue}createOtherLocalFilteredExtensionsViewDescriptors(){const ue=[];return ue.push({id:"workbench.views.extensions.deprecatedExtensions",name:(0,t.localize)(25,null),ctorDescriptor:new x.SyncDescriptor(s.DeprecatedExtensionsView,[{}]),when:D.ContextKeyExpr.and(he)}),ue}};Se=we([F(0,c.IExtensionManagementServerService),F(1,z.ILabelService),F(2,v.IViewDescriptorService),F(3,D.IContextKeyService)],Se),e.ExtensionsViewletViewsContribution=Se;let Ie=class extends O.ViewPaneContainer{constructor(ue,Ce,De,Ae,Pe,fe,ye,ke,Ee,Te,_e,Re,Le,Me,Oe,Ke,We,Xe,Je){super(u.VIEWLET_ID,{mergeViewWithContainerWhenSingleView:!0},Ae,_e,ue,Oe,Ce,Ke,Te,Re,Le,We),this.progressService=De,this.editorGroupService=Pe,this.extensionsWorkbenchService=fe,this.extensionManagementServerService=ye,this.notificationService=ke,this.paneCompositeService=Ee,this.contextKeyService=Me,this.preferencesService=Xe,this.commandService=Je,this.searchDelayer=new p.Delayer(500),this.defaultViewsContextKey=e.DefaultViewsContext.bindTo(Me),this.sortByContextKey=e.ExtensionsSortByContext.bindTo(Me),this.searchMarketplaceExtensionsContextKey=e.SearchMarketplaceExtensionsContext.bindTo(Me),this.searchHasTextContextKey=e.SearchHasTextContext.bindTo(Me),this.sortByUpdateDateContextKey=pe.bindTo(Me),this.searchInstalledExtensionsContextKey=ie.bindTo(Me),this.searchRecentlyUpdatedExtensionsContextKey=re.bindTo(Me),this.searchExtensionUpdatesContextKey=oe.bindTo(Me),this.searchWorkspaceUnsupportedExtensionsContextKey=de.bindTo(Me),this.searchDeprecatedExtensionsContextKey=he.bindTo(Me),this.searchOutdatedExtensionsContextKey=se.bindTo(Me),this.searchEnabledExtensionsContextKey=te.bindTo(Me),this.searchDisabledExtensionsContextKey=Z.bindTo(Me),this.hasInstalledExtensionsContextKey=ne.bindTo(Me),this.builtInExtensionsContextKey=e.BuiltInExtensionsContext.bindTo(Me),this.searchBuiltInExtensionsContextKey=ce.bindTo(Me),this.recommendedExtensionsContextKey=e.RecommendedExtensionsContext.bindTo(Me),this._register(this.paneCompositeService.onDidPaneCompositeOpen(rt=>{rt.viewContainerLocation===0&&this.onViewletOpen(rt.composite)},this)),this._register(fe.onReset(()=>this.refresh())),this.searchViewletState=this.getMemento(1,0)}get searchValue(){return this.searchBox?.getValue()}create(ue){ue.classList.add("extensions-viewlet"),this.root=ue;const Ce=(0,b.append)(this.root,(0,b.$)(".overlay")),De=this.getColor(W.SIDE_BAR_DRAG_AND_DROP_BACKGROUND)??"";Ce.style.backgroundColor=De,(0,b.hide)(Ce);const Ae=(0,b.append)(this.root,(0,b.$)(".header")),Pe=(0,t.localize)(26,null),fe=this.searchViewletState["query.value"]?this.searchViewletState["query.value"]:"";this.searchBox=this._register(this.instantiationService.createInstance(P.SuggestEnabledInput,`${u.VIEWLET_ID}.searchbox`,Ae,{triggerCharacters:["@"],sortKey:ye=>ye.indexOf(":")===-1?"a":/ext:/.test(ye)||/id:/.test(ye)||/tag:/.test(ye)?"b":/sort:/.test(ye)?"c":"d",provideResults:ye=>N.Query.suggestions(ye)},Pe,"extensions:searchinput",{placeholderText:Pe,value:fe})),this.updateInstalledExtensionsContexts(),this.searchBox.getValue()&&this.triggerSearch(),this._register((0,P.attachSuggestEnabledInputBoxStyler)(this.searchBox,this.themeService)),this._register(this.searchBox.onInputDidChange(()=>{this.sortByContextKey.set(N.Query.parse(this.searchBox.getValue()||"").sortBy),this.triggerSearch()},this)),this._register(this.searchBox.onShouldFocusResults(()=>this.focusListView(),this)),this._register(new b.DragAndDropObserver(this.root,{onDragEnd:ye=>{},onDragEnter:ye=>{this.isSupportedDragElement(ye)&&(0,b.show)(Ce)},onDragLeave:ye=>{this.isSupportedDragElement(ye)&&(0,b.hide)(Ce)},onDragOver:ye=>{this.isSupportedDragElement(ye)&&(ye.dataTransfer.dropEffect="copy")},onDrop:async ye=>{if(this.isSupportedDragElement(ye)){(0,b.hide)(Ce);const ke=(0,j.coalesce)((await this.instantiationService.invokeFunction(Ee=>(0,K.extractEditorsAndFilesDropData)(Ee,ye))).map(Ee=>Ee.resource&&(0,Y.extname)(Ee.resource)===".vsix"?Ee.resource:void 0));if(ke.length>0)try{await this.commandService.executeCommand(u.INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID,ke)}catch(Ee){this.notificationService.error(Ee)}}}})),super.create((0,b.append)(this.root,(0,b.$)(".extensions")))}focus(){this.searchBox?.focus()}layout(ue){this.root&&(this.root.classList.toggle("narrow",ue.width<=250),this.root.classList.toggle("mini",ue.width<=200)),this.searchBox?.layout(new b.Dimension(ue.width-34-8,20)),super.layout(new b.Dimension(ue.width,ue.height-41))}getOptimalWidth(){return 400}search(ue){this.searchBox&&this.searchBox.getValue()!==ue&&this.searchBox.setValue(ue)}async refresh(){await this.updateInstalledExtensionsContexts(),this.doSearch(!0),this.configurationService.getValue(u.AutoCheckUpdatesConfigurationKey)&&this.extensionsWorkbenchService.checkForUpdates()}async updateInstalledExtensionsContexts(){const ue=await this.extensionsWorkbenchService.queryLocal();this.hasInstalledExtensionsContextKey.set(ue.some(Ce=>!Ce.isBuiltin))}triggerSearch(){this.searchDelayer.trigger(()=>this.doSearch(),this.searchBox&&this.searchBox.getValue()?500:0).then(void 0,ue=>this.onError(ue))}normalizedQuery(){return this.searchBox?this.searchBox.getValue().trim().replace(/@category/g,"category").replace(/@tag:/g,"tag:").replace(/@ext:/g,"ext:").replace(/@featured/g,"featured").replace(/@popular/g,this.extensionManagementServerService.webExtensionManagementServer&&!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer?"@web":"@popular"):""}saveState(){const ue=this.searchBox?this.searchBox.getValue():"";s.ExtensionsListView.isLocalExtensionsQuery(ue)?this.searchViewletState["query.value"]=ue:this.searchViewletState["query.value"]="",super.saveState()}doSearch(ue){const Ce=this.normalizedQuery();return this.contextKeyService.bufferChangeEvents(()=>{const De=s.ExtensionsListView.isRecommendedExtensionsQuery(Ce);this.searchHasTextContextKey.set(Ce.trim()!==""),this.searchInstalledExtensionsContextKey.set(s.ExtensionsListView.isInstalledExtensionsQuery(Ce)),this.searchRecentlyUpdatedExtensionsContextKey.set(s.ExtensionsListView.isSearchRecentlyUpdatedQuery(Ce)&&!s.ExtensionsListView.isSearchExtensionUpdatesQuery(Ce)),this.searchOutdatedExtensionsContextKey.set(s.ExtensionsListView.isOutdatedExtensionsQuery(Ce)&&!s.ExtensionsListView.isSearchExtensionUpdatesQuery(Ce)),this.searchExtensionUpdatesContextKey.set(s.ExtensionsListView.isSearchExtensionUpdatesQuery(Ce)),this.searchEnabledExtensionsContextKey.set(s.ExtensionsListView.isEnabledExtensionsQuery(Ce)),this.searchDisabledExtensionsContextKey.set(s.ExtensionsListView.isDisabledExtensionsQuery(Ce)),this.searchBuiltInExtensionsContextKey.set(s.ExtensionsListView.isSearchBuiltInExtensionsQuery(Ce)),this.searchWorkspaceUnsupportedExtensionsContextKey.set(s.ExtensionsListView.isSearchWorkspaceUnsupportedExtensionsQuery(Ce)),this.searchDeprecatedExtensionsContextKey.set(s.ExtensionsListView.isSearchDeprecatedExtensionsQuery(Ce)),this.builtInExtensionsContextKey.set(s.ExtensionsListView.isBuiltInExtensionsQuery(Ce)),this.recommendedExtensionsContextKey.set(De),this.searchMarketplaceExtensionsContextKey.set(!!Ce&&!s.ExtensionsListView.isLocalExtensionsQuery(Ce)&&!De),this.sortByUpdateDateContextKey.set(s.ExtensionsListView.isSortUpdateDateQuery(Ce)),this.defaultViewsContextKey.set(!Ce||s.ExtensionsListView.isSortInstalledExtensionsQuery(Ce))}),this.progress(Promise.all(this.panes.map(De=>De.show(this.normalizedQuery(),ue).then(Ae=>this.alertSearchResult(Ae.length,De.id))))).then(()=>{})}onDidAddViewDescriptors(ue){const Ce=super.onDidAddViewDescriptors(ue);return this.progress(Promise.all(Ce.map(De=>De.show(this.normalizedQuery()).then(Ae=>this.alertSearchResult(Ae.length,De.id))))),Ce}alertSearchResult(ue,Ce){const De=this.viewContainerModel.visibleViewDescriptors.find(Ae=>Ae.id===Ce);switch(ue){case 0:break;case 1:De?(0,B.alert)((0,t.localize)(27,null,De.name)):(0,B.alert)((0,t.localize)(28,null));break;default:De?(0,B.alert)((0,t.localize)(29,null,ue,De.name)):(0,B.alert)((0,t.localize)(30,null,ue));break}}count(){return this.panes.reduce((ue,Ce)=>Ce.count()+ue,0)}focusListView(){this.count()>0&&this.panes[0].focus()}onViewletOpen(ue){if(!(!ue||ue.getId()===u.VIEWLET_ID)&&this.configurationService.getValue(u.CloseExtensionDetailsOnViewChangeKey)){const Ce=this.editorGroupService.groups.map(De=>{const Ae=De.editors.filter(Pe=>Pe instanceof l.ExtensionsInput);return De.closeEditors(Ae)});Promise.all(Ce)}}progress(ue){return this.progressService.withProgress({location:5},()=>ue)}onError(ue){if((0,R.isCancellationError)(ue))return;const Ce=ue&&ue.message||"";if(/ECONNREFUSED/.test(Ce)){const De=(0,A.createErrorWithActions)((0,t.localize)(31,null),[new I.Action("open user settings",(0,t.localize)(32,null),void 0,!0,()=>this.preferencesService.openUserSettings())]);this.notificationService.error(De);return}this.notificationService.error(ue)}isSupportedDragElement(ue){return ue.dataTransfer?ue.dataTransfer.types.map(De=>De.toLocaleLowerCase()).indexOf("files")!==-1:!1}};Ie=we([F(0,M.IWorkbenchLayoutService),F(1,S.ITelemetryService),F(2,d.IProgressService),F(3,C.IInstantiationService),F(4,n.IEditorGroupsService),F(5,u.IExtensionsWorkbenchService),F(6,c.IExtensionManagementServerService),F(7,_.INotificationService),F(8,Q.IPaneCompositePartService),F(9,g.IThemeService),F(10,h.IConfigurationService),F(11,m.IStorageService),F(12,w.IWorkspaceContextService),F(13,D.IContextKeyService),F(14,y.IContextMenuService),F(15,r.IExtensionService),F(16,v.IViewDescriptorService),F(17,H.IPreferencesService),F(18,q.ICommandService)],Ie),e.ExtensionsViewPaneContainer=Ie;let ve=class extends k.Disposable{constructor(ue,Ce,De){super(),this.activityService=ue,this.extensionsWorkbenchService=Ce,this.extensionEnablementService=De,this.badgeHandle=this._register(new k.MutableDisposable),this._register(E.Event.debounce(Ce.onChange,()=>{},100,void 0,void 0,this._store)(this.onServiceChange,this))}onServiceChange(){this.badgeHandle.clear();const ue=this.extensionsWorkbenchService.installed.filter(Ae=>Ae.reloadRequiredStatus!==void 0),Ce=this.extensionsWorkbenchService.outdated.reduce((Ae,Pe)=>Ae+(this.extensionEnablementService.isEnabled(Pe.local)&&!this.extensionsWorkbenchService.isExtensionIgnoresUpdates(Pe)&&!ue.includes(Pe)?1:0),0),De=Ce+ue.length;if(De>0){let Ae="";Ce&&(Ae+=Ce===1?(0,t.localize)(33,null,Ce):(0,t.localize)(34,null,Ce)),Ce>0&&ue.length>0&&(Ae+=", "),ue.length&&(Ae+=ue.length===1?(0,t.localize)(35,null,ue.length):(0,t.localize)(36,null,ue.length));const Pe=new o.NumberBadge(De,()=>Ae);this.badgeHandle.value=this.activityService.showViewContainerActivity(u.VIEWLET_ID,{badge:Pe,clazz:"extensions-badge count-badge"})}}};ve=we([F(0,o.IActivityService),F(1,u.IExtensionsWorkbenchService),F(2,c.IWorkbenchExtensionEnablementService)],ve),e.StatusUpdater=ve;let be=class{constructor(ue,Ce,De,Ae,Pe){this.extensionsManagementService=ue,this.hostService=Ce,this.logService=De,this.notificationService=Ae,this.environmentService=Pe,this.environmentService.disableExtensions||this.loopCheckForMaliciousExtensions()}loopCheckForMaliciousExtensions(){this.checkForMaliciousExtensions().then(()=>(0,p.timeout)(1e3*60*5)).then(()=>this.loopCheckForMaliciousExtensions())}checkForMaliciousExtensions(){return this.extensionsManagementService.getExtensionsControlManifest().then(ue=>this.extensionsManagementService.getInstalled(1).then(Ce=>{const De=Ce.filter(Ae=>ue.malicious.some(Pe=>(0,ee.areSameExtensions)(Ae.identifier,Pe)));return De.length?p.Promises.settled(De.map(Ae=>this.extensionsManagementService.uninstall(Ae).then(()=>{this.notificationService.prompt(a.default.Warning,(0,t.localize)(37,null,Ae.identifier.id),[{label:(0,t.localize)(38,null),run:()=>this.hostService.reload()}],{sticky:!0})}))):Promise.resolve(void 0)}).then(()=>{}),ue=>this.logService.error(ue))}};be=we([F(0,f.IExtensionManagementService),F(1,L.IHostService),F(2,T.ILogService),F(3,_.INotificationService),F(4,U.IWorkbenchEnvironmentService)],be),e.MaliciousExtensionChecker=be}),define(ae[3022],le([1,0,1660,306,6,16,11,21,2,745,27,82,120,100,5,8,74,9,119,24,435,523,25,66,26,18,32,23,19,115,42,46,22,436,95,7,13,233,39,1017,14,374,526]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsWorkbenchService=e.Extension=void 0;let U=class{constructor(G,Q,j,K,Y,ee,ie,re,oe,se){this.stateProvider=G,this.runtimeStateProvider=Q,this.server=j,this.local=K,this.gallery=Y,this.galleryService=ee,this.telemetryService=ie,this.logService=re,this.fileService=oe,this.productService=se,this.enablementState=8,this.isMalicious=!1}get type(){return this.local?this.local.type:1}get isBuiltin(){return this.local?this.local.isBuiltin:!1}get name(){return this.gallery?this.gallery.name:this.local.manifest.name}get displayName(){return this.gallery?this.gallery.displayName||this.gallery.name:this.local.manifest.displayName||this.local.manifest.name}get identifier(){return this.gallery?this.gallery.identifier:this.local.identifier}get uuid(){return this.gallery?this.gallery.identifier.uuid:this.local.identifier.uuid}get publisher(){return this.gallery?this.gallery.publisher:this.local.manifest.publisher}get publisherDisplayName(){return this.gallery?this.gallery.publisherDisplayName||this.gallery.publisher:this.local?.publisherDisplayName?this.local.publisherDisplayName:this.local.manifest.publisher}get publisherUrl(){if(!(!this.productService.extensionsGallery||!this.gallery))return v.joinPath(l.URI.parse(this.productService.extensionsGallery.publisherUrl),this.publisher)}get publisherDomain(){return this.gallery?.publisherDomain}get publisherSponsorLink(){return this.gallery?.publisherSponsorLink?l.URI.parse(this.gallery.publisherSponsorLink):void 0}get version(){return this.local?this.local.manifest.version:this.latestVersion}get latestVersion(){return this.gallery?this.gallery.version:this.local.manifest.version}get description(){return this.gallery?this.gallery.description:this.local.manifest.description||""}get url(){if(!(!this.productService.extensionsGallery||!this.gallery))return`${this.productService.extensionsGallery.itemUrl}?itemName=${this.publisher}.${this.name}`}get iconUrl(){return this.galleryIconUrl||this.localIconUrl||this.defaultIconUrl}get iconUrlFallback(){return this.galleryIconUrlFallback||this.localIconUrl||this.defaultIconUrl}get localIconUrl(){return this.local&&this.local.manifest.icon?L.FileAccess.asBrowserUri(v.joinPath(this.local.location,this.local.manifest.icon)).toString(!0):null}get galleryIconUrl(){return this.gallery?.assets.icon?this.gallery.assets.icon.uri:null}get galleryIconUrlFallback(){return this.gallery?.assets.icon?this.gallery.assets.icon.fallbackUri:null}get defaultIconUrl(){if(this.type===0&&this.local&&this.local.manifest&&this.local.manifest.contributes){if(Array.isArray(this.local.manifest.contributes.themes)&&this.local.manifest.contributes.themes.length)return L.FileAccess.asBrowserUri("./media/theme-icon.png",J).toString(!0);if(Array.isArray(this.local.manifest.contributes.grammars)&&this.local.manifest.contributes.grammars.length)return L.FileAccess.asBrowserUri("./media/language-icon.svg",J).toString(!0)}return r.DefaultIconPath}get repository(){return this.gallery&&this.gallery.assets.repository?this.gallery.assets.repository.uri:void 0}get licenseUrl(){return this.gallery&&this.gallery.assets.license?this.gallery.assets.license.uri:void 0}get state(){return this.stateProvider(this)}get installCount(){return this.gallery?this.gallery.installCount:void 0}get rating(){return this.gallery?this.gallery.rating:void 0}get ratingCount(){return this.gallery?this.gallery.ratingCount:void 0}get outdated(){try{if(!this.gallery||!this.local||this.type===0&&this.productService.quality==="stable"||!this.local.preRelease&&this.gallery.properties.isPreReleaseVersion)return!1;if(p.gt(this.latestVersion,this.version)||this.outdatedTargetPlatform)return!0}catch{}return!1}get outdatedTargetPlatform(){return!!this.local&&!!this.gallery&&!["undefined","web"].includes(this.local.targetPlatform)&&this.gallery.properties.targetPlatform!=="web"&&this.local.targetPlatform!==this.gallery.properties.targetPlatform&&p.eq(this.latestVersion,this.version)}get reloadRequiredStatus(){return this.runtimeStateProvider(this)}get telemetryData(){const{local:G,gallery:Q}=this;return Q?(0,u.getGalleryExtensionTelemetryData)(Q):(0,u.getLocalExtensionTelemetryData)(G)}get preview(){return this.local?.manifest.preview??this.gallery?.preview??!1}get hasPreReleaseVersion(){return!!this.gallery?.hasPreReleaseVersion}get hasReleaseVersion(){return!!this.gallery?.hasReleaseVersion}getLocal(){return this.local&&!this.outdated?this.local:void 0}async getManifest(G){const Q=this.getLocal();return Q?Q.manifest:this.gallery?this.gallery.assets.manifest?this.galleryService.getManifest(this.gallery,G):(this.logService.error(t.localize(0,null),this.identifier.id),null):null}hasReadme(){return this.local&&this.local.readmeUrl||this.gallery&&this.gallery.assets.readme?!0:this.type===0}async getReadme(G){const Q=this.getLocal();if(Q?.readmeUrl)return(await this.fileService.readFile(Q.readmeUrl)).value.toString();if(this.gallery){if(this.gallery.assets.readme)return this.galleryService.getReadme(this.gallery,G);this.telemetryService.publicLog("extensions:NotFoundReadMe",this.telemetryData)}return this.type===0?Promise.resolve(`# ${this.displayName||this.name}
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
## Features
${this.description}
`):Promise.reject(new Error("not available"))}hasChangelog(){return this.local&&this.local.changelogUrl||this.gallery&&this.gallery.assets.changelog?!0:this.type===0}async getChangelog(G){const Q=this.getLocal();return Q?.changelogUrl?(await this.fileService.readFile(Q.changelogUrl)).value.toString():this.gallery?.assets.changelog?this.galleryService.getChangelog(this.gallery,G):this.type===0?Promise.resolve("Please check the [VS Code Release Notes](command:update.showCurrentReleaseNotes) for changes to the built-in extensions."):Promise.reject(new Error("not available"))}get categories(){const{local:G,gallery:Q}=this;return G&&G.manifest.categories&&!this.outdated?G.manifest.categories:Q?Q.categories:[]}get tags(){const{gallery:G}=this;return G?G.tags.filter(Q=>!Q.startsWith("_")):[]}get dependencies(){const{local:G,gallery:Q}=this;return G&&G.manifest.extensionDependencies&&!this.outdated?G.manifest.extensionDependencies:Q?Q.properties.dependencies||[]:[]}get extensionPack(){const{local:G,gallery:Q}=this;return G&&G.manifest.extensionPack&&!this.outdated?G.manifest.extensionPack:Q?Q.properties.extensionPack||[]:[]}};U=we([F(5,C.IExtensionGalleryService),F(6,S.ITelemetryService),F(7,o.ILogService),F(8,D.IFileService),F(9,_.IProductService)],U),e.Extension=U;let $=class Hr extends I.Disposable{static updateExtensionFromControlManifest(G,Q){G.isMalicious=Q.malicious.some(j=>(0,u.areSameExtensions)(G.identifier,j)),G.deprecationInfo=Q.deprecated?Q.deprecated[G.identifier.id.toLowerCase()]:void 0}get onChange(){return this._onChange.event}get onReset(){return this._onReset.event}constructor(G,Q,j,K,Y,ee){super(),this.server=G,this.stateProvider=Q,this.runtimeStateProvider=j,this.galleryService=K,this.extensionEnablementService=Y,this.instantiationService=ee,this._onChange=this._register(new R.Emitter),this._onReset=this._register(new R.Emitter),this.installing=[],this.uninstalling=[],this.installed=[],this._register(G.extensionManagementService.onInstallExtension(ie=>this.onInstallExtension(ie))),this._register(G.extensionManagementService.onDidInstallExtensions(ie=>this.onDidInstallExtensions(ie))),this._register(G.extensionManagementService.onUninstallExtension(ie=>this.onUninstallExtension(ie.identifier))),this._register(G.extensionManagementService.onDidUninstallExtension(ie=>this.onDidUninstallExtension(ie))),this._register(G.extensionManagementService.onDidChangeProfile(ie=>this.onDidChangeProfile(ie.added,ie.removed))),this._register(Y.onEnablementChanged(ie=>this.onEnablementChanged(ie)))}get local(){const G=this.installing.filter(Q=>!this.installed.some(j=>(0,u.areSameExtensions)(j.identifier,Q.identifier))).map(Q=>Q);return[...this.installed,...G]}async queryInstalled(){const G=await this.server.extensionManagementService.getExtensionsControlManifest(),Q=await this.server.extensionManagementService.getInstalled(),j=(0,u.groupByExtension)(Q,Y=>Y.identifier).reduce((Y,ee)=>{const ie=ee.length===1?ee[0]:ee.find(re=>re.type===1)||ee.find(re=>re.type===0);return Y.push(ie),Y},[]),K=(0,A.index)(this.installed,Y=>Y.local?Y.local.identifier.id:Y.identifier.id);return this.installed=j.map(Y=>{const ee=K[Y.identifier.id]||this.instantiationService.createInstance(U,this.stateProvider,this.runtimeStateProvider,this.server,Y,void 0);return ee.local=Y,ee.enablementState=this.extensionEnablementService.getEnablementState(Y),Hr.updateExtensionFromControlManifest(ee,G),ee}),this._onChange.fire(void 0),this.local}async syncInstalledExtensionsWithGallery(G){let Q=!1;const j=await this.mapInstalledExtensionWithCompatibleGalleryExtension(G);for(const[K,Y]of j)K.local&&!K.local.identifier.uuid&&(K.local=await this.updateMetadata(K.local,Y)),(!K.gallery||K.gallery.version!==Y.version||K.gallery.properties.targetPlatform!==Y.properties.targetPlatform)&&(K.gallery=Y,this._onChange.fire({extension:K}),Q=!0);return Q}async mapInstalledExtensionWithCompatibleGalleryExtension(G){const Q=this.mapInstalledExtensionWithGalleryExtension(G),j=await this.server.extensionManagementService.getTargetPlatform(),K=[],Y=[];if(await Promise.allSettled(Q.map(async([ee,ie])=>{ee.local&&(await this.galleryService.isExtensionCompatible(ie,ee.local.preRelease,j)?K.push(ie):Y.push({...ee.local.identifier,preRelease:ee.local.preRelease}))})),Y.length){const ee=await this.galleryService.getExtensions(Y,{targetPlatform:j,compatible:!0,queryAllVersions:!0},m.CancellationToken.None);K.push(...ee)}return this.mapInstalledExtensionWithGalleryExtension(K)}mapInstalledExtensionWithGalleryExtension(G){const Q=[],j=new Map,K=new Map;for(const Y of G)j.set(Y.identifier.uuid,Y),K.set(Y.identifier.id.toLowerCase(),Y);for(const Y of this.installed){if(Y.uuid){const ie=j.get(Y.uuid);if(ie){Q.push([Y,ie]);continue}}const ee=K.get(Y.identifier.id.toLowerCase());ee&&Q.push([Y,ee])}return Q}async updateMetadata(G,Q){let j=!1;return G.manifest.version!==Q.version&&(j=!!(await this.galleryService.getExtensions([{...G.identifier,version:G.manifest.version}],m.CancellationToken.None))[0]?.properties?.isPreReleaseVersion),this.server.extensionManagementService.updateMetadata(G,{id:Q.identifier.uuid,publisherDisplayName:Q.publisherDisplayName,publisherId:Q.publisherId,isPreReleaseVersion:j})}canInstall(G){return this.server.extensionManagementService.canInstall(G)}onInstallExtension(G){const{source:Q}=G;if(Q&&!l.URI.isUri(Q)){const j=this.installed.filter(K=>(0,u.areSameExtensions)(K.identifier,Q.identifier))[0]||this.instantiationService.createInstance(U,this.stateProvider,this.runtimeStateProvider,this.server,void 0,Q);this.installing.push(j),this._onChange.fire({extension:j})}}async onDidChangeProfile(G,Q){const j=await this.server.extensionManagementService.getExtensionsControlManifest();for(const K of G)if(this.installed.find(Y=>(0,u.areSameExtensions)(Y.identifier,K.identifier))){const Y=this.instantiationService.createInstance(U,this.stateProvider,this.runtimeStateProvider,this.server,K,void 0);this.installed.push(Y),Hr.updateExtensionFromControlManifest(Y,j)}Q.length&&(this.installed=this.installed.filter(K=>!Q.some(Y=>(0,u.areSameExtensions)(K.identifier,Y.identifier)))),this._onReset.fire()}async onDidInstallExtensions(G){for(const Q of G){const{local:j,source:K}=Q,Y=K&&!l.URI.isUri(K)?K:void 0,ee=K&&l.URI.isUri(K)?K:void 0,ie=Y?this.installing.filter(oe=>(0,u.areSameExtensions)(oe.identifier,Y.identifier))[0]:null;this.installing=ie?this.installing.filter(oe=>oe!==ie):this.installing;let re=ie||(ee||j?this.instantiationService.createInstance(U,this.stateProvider,this.runtimeStateProvider,this.server,j,void 0):void 0);if(re&&j){const oe=this.installed.filter(se=>(0,u.areSameExtensions)(se.identifier,re.identifier))[0];oe?re=oe:this.installed.push(re),re.local=j,re.gallery||(re.gallery=Y),Hr.updateExtensionFromControlManifest(re,await this.server.extensionManagementService.getExtensionsControlManifest()),re.enablementState=this.extensionEnablementService.getEnablementState(j)}this._onChange.fire(!j||!re?void 0:{extension:re,operation:Q.operation}),re&&re.local&&!re.gallery&&await this.syncInstalledExtensionWithGallery(re)}}async syncInstalledExtensionWithGallery(G){if(!this.galleryService.isEnabled())return;const[Q]=await this.galleryService.getExtensions([{...G.identifier,preRelease:G.local?.preRelease}],{compatible:!0,targetPlatform:await this.server.extensionManagementService.getTargetPlatform()},m.CancellationToken.None);Q&&(G.gallery=Q,this._onChange.fire({extension:G}))}onUninstallExtension(G){const Q=this.installed.filter(j=>(0,u.areSameExtensions)(j.identifier,G))[0];if(Q){const j=this.uninstalling.filter(K=>(0,u.areSameExtensions)(K.identifier,G))[0]||Q;this.uninstalling=[j,...this.uninstalling.filter(K=>!(0,u.areSameExtensions)(K.identifier,G))],this._onChange.fire(j?{extension:j}:void 0)}}onDidUninstallExtension({identifier:G,error:Q}){const j=this.uninstalling.find(K=>(0,u.areSameExtensions)(K.identifier,G))||this.installed.find(K=>(0,u.areSameExtensions)(K.identifier,G));this.uninstalling=this.uninstalling.filter(K=>!(0,u.areSameExtensions)(K.identifier,G)),Q||(this.installed=this.installed.filter(K=>!(0,u.areSameExtensions)(K.identifier,G))),j&&this._onChange.fire({extension:j})}onEnablementChanged(G){const Q=this.local.filter(j=>G.some(K=>(0,u.areSameExtensions)(j.identifier,K.identifier)));for(const j of Q)if(j.local){const K=this.extensionEnablementService.getEnablementState(j.local);K!==j.enablementState&&(j.enablementState=K,this._onChange.fire({extension:j}))}}getExtensionState(G){return G.gallery&&this.installing.some(j=>!!j.gallery&&(0,u.areSameExtensions)(j.gallery.identifier,G.gallery.identifier))?0:this.uninstalling.some(j=>(0,u.areSameExtensions)(j.identifier,G.identifier))?2:this.installed.filter(j=>j===G||j.gallery&&G.gallery&&(0,u.areSameExtensions)(j.gallery.identifier,G.gallery.identifier))[0]?1:3}};$=we([F(3,C.IExtensionGalleryService),F(4,r.IWorkbenchExtensionEnablementService),F(5,i.IInstantiationService)],$);let q=class Mo extends I.Disposable{get onChange(){return this._onChange.event}get onReset(){return this._onReset.event}constructor(G,Q,j,K,Y,ee,ie,re,oe,se,te,Z,ne,ce,de,he,pe,me,Se,Ie,ve,be,ge){super(),this.instantiationService=G,this.editorService=Q,this.extensionManagementService=j,this.galleryService=K,this.configurationService=Y,this.telemetryService=ee,this.notificationService=ie,this.extensionEnablementService=oe,this.hostService=se,this.progressService=te,this.extensionManagementServerService=Z,this.storageService=ne,this.languageService=ce,this.extensionsSyncManagementService=de,this.userDataAutoSyncService=he,this.productService=pe,this.extensionManifestPropertiesService=Se,this.logService=Ie,this.extensionService=ve,this.languagePackService=be,this.localeService=ge,this.localExtensions=null,this.remoteExtensions=null,this.webExtensions=null,this._onChange=new R.Emitter,this._onReset=new R.Emitter,this.preferPreReleases=this.productService.quality!=="stable",this.installing=[],this._activityCallBack=null;const ue=Y.getValue("_extensions.preferPreReleases");(0,P.isUndefined)(ue)||(this.preferPreReleases=!!ue),this.hasOutdatedExtensionsContextKey=s.HasOutdatedExtensionsContext.bindTo(me),Z.localExtensionManagementServer&&(this.localExtensions=this._register(G.createInstance($,Z.localExtensionManagementServer,Ce=>this.getExtensionState(Ce),Ce=>this.getReloadStatus(Ce))),this._register(this.localExtensions.onChange(Ce=>this._onChange.fire(Ce?Ce.extension:void 0))),this._register(this.localExtensions.onReset(Ce=>{this._onChange.fire(void 0),this._onReset.fire()}))),Z.remoteExtensionManagementServer&&(this.remoteExtensions=this._register(G.createInstance($,Z.remoteExtensionManagementServer,Ce=>this.getExtensionState(Ce),Ce=>this.getReloadStatus(Ce))),this._register(this.remoteExtensions.onChange(Ce=>this._onChange.fire(Ce?Ce.extension:void 0))),this._register(this.remoteExtensions.onReset(Ce=>{this._onChange.fire(void 0),this._onReset.fire()}))),Z.webExtensionManagementServer&&(this.webExtensions=this._register(G.createInstance($,Z.webExtensionManagementServer,Ce=>this.getExtensionState(Ce),Ce=>this.getReloadStatus(Ce))),this._register(this.webExtensions.onChange(Ce=>this._onChange.fire(Ce?Ce.extension:void 0))),this._register(this.webExtensions.onReset(Ce=>{this._onChange.fire(void 0),this._onReset.fire()}))),this.updatesCheckDelayer=new k.ThrottledDelayer(Mo.UpdatesCheckInterval),this.autoUpdateDelayer=new k.ThrottledDelayer(1e3),this._register((0,I.toDisposable)(()=>{this.updatesCheckDelayer.cancel(),this.autoUpdateDelayer.cancel()})),re.registerHandler(this),this._register(this.configurationService.onDidChangeConfiguration(Ce=>{Ce.affectsConfiguration(s.AutoUpdateConfigurationKey)&&this.isAutoUpdateEnabled()&&this.checkForUpdates(),Ce.affectsConfiguration(s.AutoCheckUpdatesConfigurationKey)&&this.isAutoCheckUpdatesEnabled()&&this.checkForUpdates()},this)),this._register(oe.onEnablementChanged(Ce=>{this.getAutoUpdateValue()==="onlyEnabledExtensions"&&Ce.some(De=>this.extensionEnablementService.isEnabled(De))&&this.checkForUpdates()},this)),this.queryLocal().then(()=>{this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.onDidChangeRunningExtensions(this.extensionService.extensions,[]),this._register(this.extensionService.onDidChangeExtensions(({added:Ce,removed:De})=>this.onDidChangeRunningExtensions(Ce,De)))}),this.resetIgnoreAutoUpdateExtensions(),this.eventuallyCheckForUpdates(!0),this._reportTelemetry(),x.isWeb&&!this.isAutoUpdateEnabled()&&this.autoUpdateBuiltinExtensions()}),this._register(this.onChange(()=>{this.updateContexts(),this.updateActivity()})),this._register(this.storageService.onDidChangeValue(Ce=>this.onDidChangeStorage(Ce)))}_reportTelemetry(){const G=this.installed.filter(Q=>!Q.isBuiltin&&(Q.enablementState===9||Q.enablementState===8)).map(Q=>y.ExtensionIdentifier.toKey(Q.identifier.id));this.telemetryService.publicLog2("installedExtensions",{extensionIds:G.join(";"),count:G.length})}async onDidChangeRunningExtensions(G,Q){const j=this.local,K=[],Y=[];for(const ee of G){const ie=j.find(re=>(0,u.areSameExtensions)({id:ee.identifier.value,uuid:ee.uuid},re.identifier));ie?K.push(ie):Y.push({id:ee.identifier.value,uuid:ee.uuid})}K.push(...await this.getExtensions(Y,m.CancellationToken.None)),K.forEach(ee=>this._onChange.fire(ee))}get local(){return(0,u.groupByExtension)(this.installed,Q=>Q.identifier).reduce((Q,j)=>(Q.push(this.getPrimaryExtension(j)),Q),[])}get installed(){const G=[];return this.localExtensions&&G.push(...this.localExtensions.local),this.remoteExtensions&&G.push(...this.remoteExtensions.local),this.webExtensions&&G.push(...this.webExtensions.local),G}get outdated(){const G=[];return this.localExtensions&&G.push(...this.localExtensions.local),this.remoteExtensions&&G.push(...this.remoteExtensions.local),this.webExtensions&&G.push(...this.webExtensions.local),G.filter(Q=>Q.outdated&&Q.local&&Q.state===1)}async queryLocal(G){if(G){if(this.localExtensions&&this.extensionManagementServerService.localExtensionManagementServer===G)return this.localExtensions.queryInstalled();if(this.remoteExtensions&&this.extensionManagementServerService.remoteExtensionManagementServer===G)return this.remoteExtensions.queryInstalled();if(this.webExtensions&&this.extensionManagementServerService.webExtensionManagementServer===G)return this.webExtensions.queryInstalled()}if(this.localExtensions)try{await this.localExtensions.queryInstalled()}catch(Q){this.logService.error(Q)}if(this.remoteExtensions)try{await this.remoteExtensions.queryInstalled()}catch(Q){this.logService.error(Q)}if(this.webExtensions)try{await this.webExtensions.queryInstalled()}catch(Q){this.logService.error(Q)}return this.local}async queryGallery(G,Q){if(!this.galleryService.isEnabled())return(0,b.singlePagePager)([]);const j=m.CancellationToken.isCancellationToken(G)?{}:G,K=m.CancellationToken.isCancellationToken(G)?G:Q;j.text=j.text?this.resolveQueryText(j.text):j.text,j.includePreRelease=(0,P.isUndefined)(j.includePreRelease)?this.preferPreReleases:j.includePreRelease;const Y=await this.extensionManagementService.getExtensionsControlManifest(),ee=await this.galleryService.query(j,K);return this.syncInstalledExtensionsWithGallery(ee.firstPage),{firstPage:ee.firstPage.map(ie=>this.fromGallery(ie,Y)),total:ee.total,pageSize:ee.pageSize,getPage:async(ie,re)=>{const oe=await ee.getPage(ie,re);return this.syncInstalledExtensionsWithGallery(oe),oe.map(se=>this.fromGallery(se,Y))}}}async getExtensions(G,Q,j){if(!this.galleryService.isEnabled())return[];G.forEach(ee=>ee.preRelease=ee.preRelease??this.preferPreReleases);const K=await this.extensionManagementService.getExtensionsControlManifest(),Y=await this.galleryService.getExtensions(G,Q,j);return this.syncInstalledExtensionsWithGallery(Y),Y.map(ee=>this.fromGallery(ee,K))}resolveQueryText(G){G=G.replace(/@web/g,`tag:"${C.WEB_EXTENSION_TAG}"`);const Q=/\bext:([^\s]+)\b/g;return Q.test(G)&&(G=G.replace(Q,(j,K)=>{const ee=(this.productService.extensionKeywords||{})[K]||[],ie=this.languageService.guessLanguageIdByFilepathOrFirstLine(l.URI.file(`.${K}`)),re=ie&&this.languageService.getLanguageName(ie),oe=re?` tag:"${re}"`:"";return`tag:"__ext_${K}" tag:"__ext_.${K}" ${ee.map(se=>`tag:"${se}"`).join(" ")}${oe} tag:"${K}"`})),G.substr(0,350)}fromGallery(G,Q){let j=this.getInstalledExtensionMatchingGallery(G);return j||(j=this.instantiationService.createInstance(U,K=>this.getExtensionState(K),K=>this.getReloadStatus(K),void 0,void 0,G),$.updateExtensionFromControlManifest(j,Q)),j}getInstalledExtensionMatchingGallery(G){for(const Q of this.local)if(Q.identifier.uuid){if(Q.identifier.uuid===G.identifier.uuid)return Q}else if((0,u.areSameExtensions)(Q.identifier,G.identifier))return Q;return null}async open(G,Q){const j=await this.editorService.openEditor(this.instantiationService.createInstance(a.ExtensionsInput,G),Q,Q?.sideByside?d.SIDE_GROUP:d.ACTIVE_GROUP);Q?.tab&&j instanceof z.ExtensionEditor&&await j.openTab(Q.tab)}getExtensionStatus(G){const Q=this.extensionService.getExtensionsStatus();for(const j of Object.keys(Q))if((0,u.areSameExtensions)({id:j},G.identifier))return Q[j]}getReloadStatus(G){const Q=G.state===3,j=this.extensionService.extensions.find(K=>(0,u.areSameExtensions)({id:K.identifier.value,uuid:K.uuid},G.identifier));if(Q){const K=j&&this.extensionService.canRemoveExtension(j),Y=j&&(!G.server||G.server===this.extensionManagementServerService.getExtensionManagementServer((0,V.toExtension)(j)));return!K&&Y?t.localize(1,null):void 0}if(G.local){const K=j&&G.server===this.extensionManagementServerService.getExtensionManagementServer((0,V.toExtension)(j)),Y=this.extensionEnablementService.isEnabled(G.local);if(j){if(Y){if(this.extensionService.canAddExtension((0,V.toExtensionDescription)(G.local)))return;const ee=this.extensionManagementServerService.getExtensionManagementServer((0,V.toExtension)(j));if(K){if(G.version!==j.version||G.local.targetPlatform!==j.targetPlatform)return t.localize(2,null);const ie=this.installed.filter(re=>(0,u.areSameExtensions)(re.identifier,G.identifier)&&re.server!==G.server)[0];if(ie){if(ee===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(G.local.manifest)&&ie.server===this.extensionManagementServerService.localExtensionManagementServer)return t.localize(3,null);if(ee===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(G.local.manifest)&&ie.server===this.extensionManagementServerService.remoteExtensionManagementServer)return t.localize(4,null,this.extensionManagementServerService.remoteExtensionManagementServer?.label)}}else{if(G.server===this.extensionManagementServerService.localExtensionManagementServer&&ee===this.extensionManagementServerService.remoteExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnUI(G.local.manifest))return t.localize(5,null);if(G.server===this.extensionManagementServerService.remoteExtensionManagementServer&&ee===this.extensionManagementServerService.localExtensionManagementServer&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(G.local.manifest))return t.localize(6,null)}return}else if(K)return t.localize(7,null);return}else{if(Y&&!this.extensionService.canAddExtension((0,V.toExtensionDescription)(G.local)))return t.localize(8,null);const ee=G.server?G.server===this.extensionManagementServerService.localExtensionManagementServer?this.extensionManagementServerService.remoteExtensionManagementServer:this.extensionManagementServerService.localExtensionManagementServer:null;if(ee&&G.enablementState===1){const ie=this.local.filter(re=>(0,u.areSameExtensions)(re.identifier,G.identifier)&&re.server===ee)[0];if(ie&&ie.local&&this.extensionEnablementService.isEnabled(ie.local))return t.localize(9,null)}}}}getPrimaryExtension(G){if(G.length===1)return G[0];const Q=G.filter(ie=>ie.local&&this.extensionEnablementService.isEnabled(ie.local));if(Q.length===1)return Q[0];const j=Q.length?Q:G,K=j.find(ie=>ie.local&&ie.local.manifest)?.local?.manifest;if(!K)return j[0];const Y=this.extensionManifestPropertiesService.getExtensionKind(K);let ee=j.find(ie=>{for(const re of Y)switch(re){case"ui":return ie.server===this.extensionManagementServerService.localExtensionManagementServer;case"workspace":return ie.server===this.extensionManagementServerService.remoteExtensionManagementServer;case"web":return ie.server===this.extensionManagementServerService.webExtensionManagementServer}return!1});return!ee&&this.extensionManagementServerService.localExtensionManagementServer&&(ee=j.find(ie=>{for(const re of Y)switch(re){case"workspace":return ie.server===this.extensionManagementServerService.localExtensionManagementServer;case"web":return ie.server===this.extensionManagementServerService.localExtensionManagementServer}return!1})),!ee&&this.extensionManagementServerService.webExtensionManagementServer&&(ee=j.find(ie=>{for(const re of Y)switch(re){case"web":return ie.server===this.extensionManagementServerService.webExtensionManagementServer}return!1})),!ee&&this.extensionManagementServerService.remoteExtensionManagementServer&&(ee=j.find(ie=>{for(const re of Y)switch(re){case"web":return ie.server===this.extensionManagementServerService.remoteExtensionManagementServer}return!1})),ee||G[0]}getExtensionState(G){const Q=this.installing.some(j=>(0,u.areSameExtensions)(j.identifier,G.identifier));if(G.server){const j=(G.server===this.extensionManagementServerService.localExtensionManagementServer?this.localExtensions:G.server===this.extensionManagementServerService.remoteExtensionManagementServer?this.remoteExtensions:this.webExtensions).getExtensionState(G);return j===3&&Q?0:j}else if(Q)return 0;if(this.remoteExtensions){const j=this.remoteExtensions.getExtensionState(G);if(j!==3)return j}if(this.webExtensions){const j=this.webExtensions.getExtensionState(G);if(j!==3)return j}return this.localExtensions?this.localExtensions.getExtensionState(G):3}async checkForUpdates(G){if(!this.galleryService.isEnabled())return;const Q=[];if(this.localExtensions&&Q.push(this.localExtensions),this.remoteExtensions&&Q.push(this.remoteExtensions),this.webExtensions&&Q.push(this.webExtensions),!Q.length)return;const j=[];for(const K of this.local)G&&!K.isBuiltin||K.isBuiltin&&(!K.local?.identifier.uuid||!x.isWeb&&this.productService.quality==="stable")||j.push({...K.identifier,preRelease:!!K.local?.preRelease});if(j.length){const K=await Q[0].server.extensionManagementService.getTargetPlatform(),Y=await this.galleryService.getExtensions(j,{targetPlatform:K,compatible:!0},m.CancellationToken.None);Y.length&&await this.syncInstalledExtensionsWithGallery(Y)}}async syncInstalledExtensionsWithGallery(G){const Q=[];if(this.localExtensions&&Q.push(this.localExtensions),this.remoteExtensions&&Q.push(this.remoteExtensions),this.webExtensions&&Q.push(this.webExtensions),!Q.length)return;const j=await Promise.allSettled(Q.map(K=>K.syncInstalledExtensionsWithGallery(G)));this.isAutoUpdateEnabled()&&j.some(K=>K.status==="fulfilled"&&K.value)&&this.eventuallyAutoUpdateExtensions()}getAutoUpdateValue(){const G=this.configurationService.getValue(s.AutoUpdateConfigurationKey);return(0,P.isBoolean)(G)||G==="onlyEnabledExtensions"?G:!0}isAutoUpdateEnabled(){return this.getAutoUpdateValue()!==!1}isAutoCheckUpdatesEnabled(){return this.configurationService.getValue(s.AutoCheckUpdatesConfigurationKey)}eventuallyCheckForUpdates(G=!1){this.updatesCheckDelayer.trigger(async()=>{(this.isAutoUpdateEnabled()||this.isAutoCheckUpdatesEnabled())&&await this.checkForUpdates(),this.eventuallyCheckForUpdates()},G?0:Mo.UpdatesCheckInterval).then(void 0,Q=>null)}eventuallyAutoUpdateExtensions(){this.autoUpdateDelayer.trigger(()=>this.autoUpdateExtensions()).then(void 0,G=>null)}async autoUpdateBuiltinExtensions(){await this.checkForUpdates(!0);const G=this.outdated.filter(Q=>Q.isBuiltin);await k.Promises.settled(G.map(Q=>this.install(Q,Q.local?.preRelease?{installPreReleaseVersion:!0}:void 0)))}autoUpdateExtensions(){if(!this.isAutoUpdateEnabled())return Promise.resolve();const G=this.outdated.filter(Q=>!this.isAutoUpdateIgnored(new u.ExtensionKey(Q.identifier,Q.version))&&(this.getAutoUpdateValue()===!0||Q.local&&this.extensionEnablementService.isEnabled(Q.local)));return k.Promises.settled(G.map(Q=>this.install(Q,Q.local?.preRelease?{installPreReleaseVersion:!0}:void 0)))}async canInstall(G){return!(G instanceof U)||G.isMalicious||G.deprecationInfo?.disallowInstall||!G.gallery?!1:!!(this.localExtensions&&await this.localExtensions.canInstall(G.gallery)||this.remoteExtensions&&await this.remoteExtensions.canInstall(G.gallery)||this.webExtensions&&await this.webExtensions.canInstall(G.gallery))}install(G,Q,j){if(G instanceof l.URI)return this.installWithProgress(()=>this.installFromVSIX(G,Q));if(G.isMalicious)return Promise.reject(new Error(t.localize(10,null)));const K=G.gallery;return K?this.installWithProgress(()=>this.installFromGallery(G,K,Q),K.displayName,j):Promise.reject(new Error("Missing gallery"))}canSetLanguage(G){return!(!x.isWeb||!G.gallery||!this.languagePackService.getLocale(G.gallery))}async setLanguage(G){if(!this.canSetLanguage(G))throw new Error("Can not set language");const Q=this.languagePackService.getLocale(G.gallery);if(Q!==x.language)return this.localeService.setLocale({id:Q,galleryExtension:G.gallery,extensionId:G.identifier.id,label:G.displayName})}setEnablement(G,Q){return G=Array.isArray(G)?G:[G],this.promptAndSetEnablement(G,Q)}uninstall(G){const Q=G.local?G:this.local.filter(K=>(0,u.areSameExtensions)(K.identifier,G.identifier))[0],j=Q&&Q.local?Q.local:null;return j?this.progressService.withProgress({location:5,title:t.localize(11,null),source:`${j.identifier.id}`},()=>this.extensionManagementService.uninstall(j).then(()=>{})):Promise.reject(new Error("Missing local"))}async installVersion(G,Q,j={}){if(!(G instanceof U))return G;if(!G.gallery)throw new Error("Missing gallery");const K=G.server?await G.server.extensionManagementService.getTargetPlatform():void 0,[Y]=await this.galleryService.getExtensions([{id:G.gallery.identifier.id,version:Q}],{targetPlatform:K},m.CancellationToken.None);if(!Y)throw new Error(t.localize(12,null,G.gallery.identifier.id,Q));return this.installWithProgress(async()=>{j.installGivenVersion=!0;const ee=await this.installFromGallery(G,Y,j);return G.latestVersion!==Q&&this.ignoreAutoUpdate(new u.ExtensionKey(Y.identifier,Q)),ee},Y.displayName)}reinstall(G){const Q=G.local?G:this.local.filter(K=>(0,u.areSameExtensions)(K.identifier,G.identifier))[0],j=Q&&Q.local?Q.local:null;return j?this.progressService.withProgress({location:5,source:`${j.identifier.id}`},()=>this.extensionManagementService.reinstallFromGallery(j).then(()=>this.local.filter(K=>(0,u.areSameExtensions)(K.identifier,G.identifier))[0])):Promise.reject(new Error("Missing local"))}isExtensionIgnoredToSync(G){return G.local?!this.isInstalledExtensionSynced(G.local):this.extensionsSyncManagementService.hasToNeverSyncExtension(G.identifier.id)}async toggleExtensionIgnoredToSync(G){const Q=this.isExtensionIgnoredToSync(G);G.local&&Q?(G.local=await this.updateSynchronizingInstalledExtension(G.local,!0),this._onChange.fire(G)):this.extensionsSyncManagementService.updateIgnoredExtensions(G.identifier.id,!Q),await this.userDataAutoSyncService.triggerSync(["IgnoredExtensionsUpdated"],!1,!1)}isInstalledExtensionSynced(G){return G.isMachineScoped?!1:this.extensionsSyncManagementService.hasToAlwaysSyncExtension(G.identifier.id)?!0:!this.extensionsSyncManagementService.hasToNeverSyncExtension(G.identifier.id)}async updateSynchronizingInstalledExtension(G,Q){const j=!Q;return G.isMachineScoped!==j&&(G=await this.extensionManagementService.updateExtensionScope(G,j)),Q&&this.extensionsSyncManagementService.updateIgnoredExtensions(G.identifier.id,!1),G}installWithProgress(G,Q,j){const K=Q?t.localize(13,null,Q):t.localize(14,null);return this.progressService.withProgress({location:j??5,title:K},()=>G())}async installFromVSIX(G,Q){const j=await this.extensionManagementService.getManifest(G),K=this.local.find(ee=>(0,u.areSameExtensions)(ee.identifier,{id:(0,u.getGalleryExtensionId)(j.publisher,j.name)})),{identifier:Y}=await this.extensionManagementService.installVSIX(G,j,Q);return K&&K.latestVersion!==j.version&&this.ignoreAutoUpdate(new u.ExtensionKey(Y,j.version)),this.waitAndGetInstalledExtension(Y)}async installFromGallery(G,Q,j){this.installing.push(G),this._onChange.fire(G);try{return G.state===1&&G.local?await this.extensionManagementService.updateFromGallery(Q,G.local,j):await this.extensionManagementService.installFromGallery(Q,j),this.waitAndGetInstalledExtension(Q.identifier)}finally{this.installing=this.installing.filter(K=>K!==G),this._onChange.fire(this.local.filter(K=>(0,u.areSameExtensions)(K.identifier,G.identifier))[0])}}async waitAndGetInstalledExtension(G){let Q=this.local.find(j=>(0,u.areSameExtensions)(j.identifier,G));if(Q||await R.Event.toPromise(R.Event.filter(this.onChange,j=>!!j&&this.local.some(K=>(0,u.areSameExtensions)(K.identifier,G)))),Q=this.local.find(j=>(0,u.areSameExtensions)(j.identifier,G)),!Q)throw new Error("Extension should have been installed");return Q}promptAndSetEnablement(G,Q){if(Q===8||Q===9){const K=this.getExtensionsRecursively(G,this.local,Q,{dependencies:!0,pack:!0});return this.checkAndSetEnablement(G,K,Q)}else{const K=this.getExtensionsRecursively(G,this.local,Q,{dependencies:!1,pack:!0});return K.length?this.checkAndSetEnablement(G,K,Q):this.checkAndSetEnablement(G,[],Q)}}checkAndSetEnablement(G,Q,j){const K=[...G,...Q];if(!(j===8||j===9))for(const ee of G){const ie=this.getDependentsAfterDisablement(ee,K,this.local);if(ie.length)return new Promise((re,oe)=>{this.notificationService.prompt(h.Severity.Error,this.getDependentsErrorMessage(ee,K,ie),[{label:t.localize(15,null),run:async()=>{try{await this.checkAndSetEnablement(ie,[ee],j),re()}catch(se){oe(se)}}}],{onCancel:()=>oe(new E.CancellationError)})})}return this.doSetEnablement(K,j)}getExtensionsRecursively(G,Q,j,K,Y=[]){const ee=G.filter(ie=>Y.indexOf(ie)===-1);if(ee.length){for(const re of ee)Y.push(re);const ie=Q.filter(re=>{if(Y.indexOf(re)!==-1)return!1;const oe=j===8||j===9,se=re.enablementState===8||re.enablementState===9;return oe===se?!1:(oe||!re.isBuiltin)&&(K.dependencies||K.pack)&&G.some(te=>K.dependencies&&te.dependencies.some(Z=>(0,u.areSameExtensions)({id:Z},re.identifier))||K.pack&&te.extensionPack.some(Z=>(0,u.areSameExtensions)({id:Z},re.identifier)))});return ie.length&&ie.push(...this.getExtensionsRecursively(ie,Q,j,K,Y)),ie}return[]}getDependentsAfterDisablement(G,Q,j){return j.filter(K=>K.dependencies.length===0||K===G||!this.extensionEnablementService.isEnabledEnablementState(K.enablementState)||Q.indexOf(K)!==-1?!1:K.dependencies.some(Y=>[G,...Q].some(ee=>(0,u.areSameExtensions)(ee.identifier,{id:Y}))))}getDependentsErrorMessage(G,Q,j){for(const K of[G,...Q]){const Y=j.filter(ee=>ee.dependencies.some(ie=>(0,u.areSameExtensions)({id:ie},K.identifier)));if(Y.length)return this.getErrorMessageForDisablingAnExtensionWithDependents(K,Y)}return""}getErrorMessageForDisablingAnExtensionWithDependents(G,Q){return Q.length===1?t.localize(16,null,G.displayName,Q[0].displayName):Q.length===2?t.localize(17,null,G.displayName,Q[0].displayName,Q[1].displayName):t.localize(18,null,G.displayName,Q[0].displayName,Q[1].displayName)}async doSetEnablement(G,Q){const j=await this.extensionEnablementService.setEnablement(G.map(K=>K.local),Q);for(let K=0;K<j.length;K++)j[K]&&this.telemetryService.publicLog(Q===8||Q===9?"extension:enable":"extension:disable",G[K].telemetryData);return j}updateContexts(G){G&&G.outdated?this.hasOutdatedExtensionsContextKey.set(!0):this.hasOutdatedExtensionsContextKey.set(this.outdated.length>0)}updateActivity(){this.localExtensions&&this.localExtensions.local.some(G=>G.state===0||G.state===2)||this.remoteExtensions&&this.remoteExtensions.local.some(G=>G.state===0||G.state===2)||this.webExtensions&&this.webExtensions.local.some(G=>G.state===0||G.state===2)?this._activityCallBack||this.progressService.withProgress({location:5},()=>new Promise(G=>this._activityCallBack=G)):(this._activityCallBack?.(),this._activityCallBack=null)}onError(G){if((0,E.isCancellationError)(G))return;const Q=G&&G.message||"";/getaddrinfo ENOTFOUND|getaddrinfo ENOENT|connect EACCES|connect ECONNREFUSED/.test(Q)||this.notificationService.error(G)}handleURL(G,Q){return/^extension/.test(G.path)?(this.onOpenExtensionUrl(G),Promise.resolve(!0)):Promise.resolve(!1)}onOpenExtensionUrl(G){const Q=/^extension\/([^/]+)$/.exec(G.path);if(!Q)return;const j=Q[1];this.queryLocal().then(async K=>{let Y=K.find(ee=>(0,u.areSameExtensions)(ee.identifier,{id:j}));Y||([Y]=await this.getExtensions([{id:j}],{source:"uri"},m.CancellationToken.None)),Y&&(await this.hostService.focus(),await this.open(Y))}).then(void 0,K=>this.onError(K))}get ignoredAutoUpdateExtensions(){return this._ignoredAutoUpdateExtensions||(this._ignoredAutoUpdateExtensions=JSON.parse(this.storageService.get("extensions.ignoredAutoUpdateExtension",0,"[]")||"[]")),this._ignoredAutoUpdateExtensions}set ignoredAutoUpdateExtensions(G){this._ignoredAutoUpdateExtensions=(0,A.distinct)(G.map(Q=>Q.toLowerCase())),this.storageService.store("extensions.ignoredAutoUpdateExtension",JSON.stringify(this._ignoredAutoUpdateExtensions),0,1)}onDidChangeStorage(G){G.scope===0&&G.key==="extensions.ignoredAutoUpdateExtension"&&(this._ignoredAutoUpdateExtensions=void 0)}ignoreAutoUpdate(G){this.isAutoUpdateIgnored(G)||(this.ignoredAutoUpdateExtensions=[...this.ignoredAutoUpdateExtensions,G.toString()])}setExtensionIgnoresUpdate(G,Q){const j=new u.ExtensionKey(G.identifier,G.version);if(Q)this.ignoreAutoUpdate(j);else if(this.isAutoUpdateIgnored(j))this.ignoredAutoUpdateExtensions=this.ignoredAutoUpdateExtensions.filter(K=>K!==j.toString());else return;this._onChange.fire(G)}isExtensionIgnoresUpdates(G){return this.isAutoUpdateIgnored(new u.ExtensionKey(G.identifier,G.version))}isAutoUpdateIgnored(G){return this.ignoredAutoUpdateExtensions.indexOf(G.toString())!==-1}resetIgnoreAutoUpdateExtensions(){this.ignoredAutoUpdateExtensions=this.ignoredAutoUpdateExtensions.filter(G=>this.local.some(Q=>!!Q.local&&new u.ExtensionKey(Q.identifier,Q.version).toString()===G))}};q.UpdatesCheckInterval=1e3*60*60*12,q=we([F(0,i.IInstantiationService),F(1,d.IEditorService),F(2,r.IWorkbenchExtensionManagementService),F(3,C.IExtensionGalleryService),F(4,f.IConfigurationService),F(5,S.ITelemetryService),F(6,h.INotificationService),F(7,n.IURLService),F(8,r.IWorkbenchExtensionEnablementService),F(9,c.IHostService),F(10,g.IProgressService),F(11,r.IExtensionManagementServerService),F(12,w.IStorageService),F(13,T.ILanguageService),F(14,M.IIgnoredExtensionsManagementService),F(15,O.IUserDataAutoSyncService),F(16,_.IProductService),F(17,N.IContextKeyService),F(18,B.IExtensionManifestPropertiesService),F(19,o.ILogService),F(20,V.IExtensionService),F(21,H.ILanguagePackService),F(22,W.ILocaleService)],q),e.ExtensionsWorkbenchService=q}),define(ae[3023],le([1,0,1649,17,15,35,82,120,274,44,97,119,320,523,1017,1018,55,155,861,31,5,941,100,153,9,2498,21,2568,32,45,93,106,7,222,2669,2782,276,508,24,3022,70,428,3019,39,26,74,71,458,22,922,2567,338,115,2,8,47,130,635,11,43,564,2312,48,6,91,2487,14,335,23,307]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U,$,q,X,G,Q,j,K,Y,ee,ie,re,oe,se,te,Z,ne,ce,de,he,pe,me,Se,Ie,ve,be,ge){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONTEXT_HAS_WEB_SERVER=e.CONTEXT_HAS_REMOTE_SERVER=e.CONTEXT_HAS_LOCAL_SERVER=void 0,(0,A.registerSingleton)(C.IExtensionsWorkbenchService,z.ExtensionsWorkbenchService,0),(0,A.registerSingleton)(H.IExtensionRecommendationNotificationService,W.ExtensionRecommendationNotificationService,1),(0,A.registerSingleton)(I.IExtensionRecommendationsService,N.ExtensionRecommendationsService,0),p.Registry.as(M.Extensions.Quickaccess).registerQuickAccessProvider({ctor:O.ManageExtensionsQuickAccessProvider,prefix:O.ManageExtensionsQuickAccessProvider.PREFIX,placeholder:(0,t.localize)(0,null),helpEntries:[{description:(0,t.localize)(1,null)}]}),p.Registry.as(ne.EditorExtensions.EditorPane).registerEditorPane(g.EditorPaneDescriptor.create(i.ExtensionEditor,i.ExtensionEditor.ID,(0,t.localize)(2,null)),[new S.SyncDescriptor(u.ExtensionsInput)]),p.Registry.as(y.Extensions.ViewContainersRegistry).registerViewContainer({id:C.VIEWLET_ID,title:{value:(0,t.localize)(3,null),original:"Extensions"},openCommandActionDescriptor:{id:C.VIEWLET_ID,mnemonicTitle:(0,t.localize)(4,null),keybindings:{primary:3126},order:4},ctorDescriptor:new S.SyncDescriptor(f.ExtensionsViewPaneContainer),icon:Y.extensionsViewIcon,order:4,rejectAddedViews:!0,alwaysUseContainerInfo:!0},0),p.Registry.as(c.Extensions.Configuration).registerConfiguration({id:"extensions",order:30,title:(0,t.localize)(5,null),type:"object",properties:{"extensions.autoUpdate":{enum:[!0,"onlyEnabledExtensions",!1],enumItemLabels:[(0,t.localize)(6,null),(0,t.localize)(7,null),(0,t.localize)(8,null)],enumDescriptions:[(0,t.localize)(9,null),(0,t.localize)(10,null),(0,t.localize)(11,null)],description:(0,t.localize)(12,null),default:!0,scope:1,tags:["usesOnlineServices"]},"extensions.autoCheckUpdates":{type:"boolean",description:(0,t.localize)(13,null),default:!0,scope:1,tags:["usesOnlineServices"]},"extensions.ignoreRecommendations":{type:"boolean",description:(0,t.localize)(14,null),default:!1},"extensions.showRecommendationsOnlyOnDemand":{type:"boolean",deprecationMessage:(0,t.localize)(15,null),default:!1,tags:["usesOnlineServices"]},"extensions.closeExtensionDetailsOnViewChange":{type:"boolean",description:(0,t.localize)(16,null),default:!1},"extensions.confirmedUriHandlerExtensionIds":{type:"array",items:{type:"string"},description:(0,t.localize)(17,null),default:[],scope:1},"extensions.webWorker":{type:["boolean","string"],enum:[!0,!1,"auto"],enumDescriptions:[(0,t.localize)(18,null),(0,t.localize)(19,null),(0,t.localize)(20,null)],description:(0,t.localize)(21,null),default:"auto"},"extensions.supportVirtualWorkspaces":{type:"object",markdownDescription:(0,t.localize)(22,null),patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:"boolean",default:!1}},additionalProperties:!1,default:{},defaultSnippets:[{body:{"pub.name":!1}}]},"extensions.experimental.affinity":{type:"object",markdownDescription:(0,t.localize)(23,null),patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:"integer",default:1}},additionalProperties:!1,default:{},defaultSnippets:[{body:{"pub.name":1}}]},"extensions.experimental.useUtilityProcess":{type:"boolean",tags:["experimental"],description:(0,t.localize)(24,null),default:ge.default.quality!=="stable"},[ce.WORKSPACE_TRUST_EXTENSION_SUPPORT]:{type:"object",scope:1,markdownDescription:(0,t.localize)(25,null),patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:"object",properties:{supported:{type:["boolean","string"],enum:[!0,!1,"limited"],enumDescriptions:[(0,t.localize)(26,null),(0,t.localize)(27,null),(0,t.localize)(28,null)],description:(0,t.localize)(29,null)},version:{type:"string",description:(0,t.localize)(30,null)}}}}}}}),p.Registry.as(l.Extensions.JSONContribution).registerSchema(s.ExtensionsConfigurationSchemaId,s.ExtensionsConfigurationSchema),d.CommandsRegistry.registerCommand("_extensions.manage",(ye,ke,Ee)=>{const Te=ye.get(C.IExtensionsWorkbenchService),_e=Te.local.filter(Re=>(0,o.areSameExtensions)(Re.identifier,{id:ke}));_e.length===1&&Te.open(_e[0],{tab:Ee})}),d.CommandsRegistry.registerCommand("extension.open",async(ye,ke,Ee)=>{const Te=ye.get(C.IExtensionsWorkbenchService),_e=ye.get(d.ICommandService),[Re]=await Te.getExtensions([{id:ke}],D.CancellationToken.None);return Re?Te.open(Re,{tab:Ee}):_e.executeCommand("_extensions.manage",ke,Ee)}),d.CommandsRegistry.registerCommand({id:"workbench.extensions.installExtension",description:{description:(0,t.localize)(31,null),args:[{name:"extensionIdOrVSIXUri",description:(0,t.localize)(32,null),constraint:ye=>typeof ye=="string"||ye instanceof h.URI},{name:"options",description:"(optional) Options for installing the extension. Object with the following properties: `installOnlyNewlyAddedFromExtensionPackVSIX`: When enabled, VS Code installs only newly added extensions from the extension pack VSIX. This option is considered only when installing VSIX. ",isOptional:!0,schema:{type:"object",properties:{installOnlyNewlyAddedFromExtensionPackVSIX:{type:"boolean",description:(0,t.localize)(33,null),default:!1},installPreReleaseVersion:{type:"boolean",description:(0,t.localize)(34,null),default:!1},donotSync:{type:"boolean",description:(0,t.localize)(35,null),default:!1},context:{type:"object",description:(0,t.localize)(36,null)}}}}]},handler:async(ye,ke,Ee)=>{const Te=ye.get(C.IExtensionsWorkbenchService);try{if(typeof ke=="string"){const[_e,Re]=(0,o.getIdAndVersion)(ke),[Le]=await Te.getExtensions([{id:_e,preRelease:Ee?.installPreReleaseVersion}],D.CancellationToken.None);if(Le){const Me={isMachineScoped:Ee?.donotSync?!0:void 0,installPreReleaseVersion:Ee?.installPreReleaseVersion,installGivenVersion:!!Re,context:Ee?.context};Re?await Te.installVersion(Le,Re,Me):await Te.install(Le,Me)}else throw new Error((0,t.localize)(37,null,ke))}else{const _e=h.URI.revive(ke);await Te.install(_e,{installOnlyNewlyAddedFromExtensionPack:Ee?.installOnlyNewlyAddedFromExtensionPackVSIX})}}catch(_e){throw(0,m.onUnexpectedError)(_e),_e}}}),d.CommandsRegistry.registerCommand({id:"workbench.extensions.uninstallExtension",description:{description:(0,t.localize)(38,null),args:[{name:(0,t.localize)(39,null),schema:{type:"string"}}]},handler:async(ye,ke)=>{if(!ke)throw new Error((0,t.localize)(40,null));const Ee=ye.get(k.IExtensionManagementService),Te=await Ee.getInstalled(),[_e]=Te.filter(Re=>(0,o.areSameExtensions)(Re.identifier,{id:ke}));if(!_e)throw new Error((0,t.localize)(41,null,ke));if(_e.isBuiltin)throw new Error((0,t.localize)(42,null,ke));try{await Ee.uninstall(_e)}catch(Re){throw(0,m.onUnexpectedError)(Re),Re}}}),d.CommandsRegistry.registerCommand({id:"workbench.extensions.search",description:{description:(0,t.localize)(43,null),args:[{name:(0,t.localize)(44,null),schema:{type:"string"}}]},handler:async(ye,ke="")=>{const Te=await ye.get(me.IPaneCompositePartService).openPaneComposite(C.VIEWLET_ID,0,!0);!Te||(Te.getViewPaneContainer().search(ke),Te.focus())}});function Ce(ye,ke){ye?.addImplementation(105,"extensions-editor",Ee=>{const _e=Ee.get(V.IEditorService).activeEditorPane;return _e instanceof i.ExtensionEditor&&_e.activeWebview?.isFocused?(ke(_e.activeWebview),!0):!1})}Ce(B.CopyAction,ye=>ye.copy()),Ce(B.CutAction,ye=>ye.cut()),Ce(B.PasteAction,ye=>ye.paste()),e.CONTEXT_HAS_LOCAL_SERVER=new L.RawContextKey("hasLocalServer",!1),e.CONTEXT_HAS_REMOTE_SERVER=new L.RawContextKey("hasRemoteServer",!1),e.CONTEXT_HAS_WEB_SERVER=new L.RawContextKey("hasWebServer",!1);async function De(ye){try{await ye.run()}finally{(0,ie.isDisposable)(ye)&&ye.dispose()}}let Ae=class extends ie.Disposable{constructor(ke,Ee,Te,_e,Re,Le,Me,Oe,Ke){super(),this.extensionManagementServerService=ke,this.paneCompositeService=_e,this.extensionsWorkbenchService=Re,this.extensionEnablementService=Le,this.instantiationService=Me,this.dialogService=Oe,this.commandService=Ke;const We=C.CONTEXT_HAS_GALLERY.bindTo(Te);Ee.isEnabled()&&We.set(!0);const Xe=e.CONTEXT_HAS_LOCAL_SERVER.bindTo(Te);this.extensionManagementServerService.localExtensionManagementServer&&Xe.set(!0);const Je=e.CONTEXT_HAS_REMOTE_SERVER.bindTo(Te);this.extensionManagementServerService.remoteExtensionManagementServer&&Je.set(!0);const rt=e.CONTEXT_HAS_WEB_SERVER.bindTo(Te);this.extensionManagementServerService.webExtensionManagementServer&&rt.set(!0),this.registerGlobalActions(),this.registerContextMenuActions(),this.registerQuickAccessProvider()}registerQuickAccessProvider(){(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer||this.extensionManagementServerService.webExtensionManagementServer)&&p.Registry.as(M.Extensions.Quickaccess).registerQuickAccessProvider({ctor:O.InstallExtensionQuickAccessProvider,prefix:O.InstallExtensionQuickAccessProvider.PREFIX,placeholder:(0,t.localize)(45,null),helpEntries:[{description:(0,t.localize)(46,null)}]})}registerGlobalActions(){this._register(R.MenuRegistry.appendMenuItems([{id:R.MenuId.MenubarPreferencesMenu,item:{command:{id:C.VIEWLET_ID,title:(0,t.localize)(47,null)},group:"1_settings",order:4}},{id:R.MenuId.GlobalActivity,item:{command:{id:C.VIEWLET_ID,title:(0,t.localize)(48,null)},group:"2_configuration",order:3}}])),this.registerExtensionAction({id:"workbench.extensions.action.installExtensions",title:{value:(0,t.localize)(49,null),original:"Install Extensions"},category:k.ExtensionsLocalizedLabel,menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(C.CONTEXT_HAS_GALLERY,L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},run:async Le=>{Le.get(y.IViewsService).openViewContainer(C.VIEWLET_ID,!0)}}),this.registerExtensionAction({id:"workbench.extensions.action.showRecommendedKeymapExtensions",title:{value:(0,t.localize)(50,null),original:"Keymaps"},category:k.PreferencesLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},{id:R.MenuId.MenubarPreferencesMenu,group:"2_keybindings",order:2},{id:R.MenuId.GlobalActivity,group:"2_keybindings",order:2}],menuTitles:{[R.MenuId.MenubarPreferencesMenu.id]:(0,t.localize)(51,null),[R.MenuId.GlobalActivity.id]:(0,t.localize)(52,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@recommended:keymaps "))}),this.registerExtensionAction({id:"workbench.extensions.action.showLanguageExtensions",title:{value:(0,t.localize)(53,null),original:"Language Extensions"},category:k.PreferencesLocalizedLabel,menu:{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@recommended:languages "))}),this.registerExtensionAction({id:"workbench.extensions.action.checkForUpdates",title:{value:(0,t.localize)(54,null),original:"Check for Extension Updates"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(C.CONTEXT_HAS_GALLERY,L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.and(L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),C.CONTEXT_HAS_GALLERY),group:"1_updates",order:1}],run:async()=>(await this.extensionsWorkbenchService.checkForUpdates(),this.extensionsWorkbenchService.outdated.length?De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@outdated ")):this.dialogService.show($.Severity.Info,(0,t.localize)(55,null)))});const ke=new R.MenuId("autoUpdateExtensionsSubMenu");R.MenuRegistry.appendMenuItem(R.MenuId.ViewContainerTitle,{submenu:ke,title:(0,t.localize)(56,null),when:L.ContextKeyExpr.and(L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),C.CONTEXT_HAS_GALLERY),group:"1_updates",order:5}),this.registerExtensionAction({id:"configureExtensionsAutoUpdate.all",title:(0,t.localize)(57,null),toggled:L.ContextKeyExpr.and(L.ContextKeyExpr.has(`config.${C.AutoUpdateConfigurationKey}`),L.ContextKeyExpr.notEquals(`config.${C.AutoUpdateConfigurationKey}`,"onlyEnabledExtensions")),menu:[{id:ke,order:1}],run:Le=>Le.get(re.IConfigurationService).updateValue(C.AutoUpdateConfigurationKey,!0)}),this.registerExtensionAction({id:"configureExtensionsAutoUpdate.enabled",title:(0,t.localize)(58,null),toggled:L.ContextKeyExpr.equals(`config.${C.AutoUpdateConfigurationKey}`,"onlyEnabledExtensions"),menu:[{id:ke,order:2}],run:Le=>Le.get(re.IConfigurationService).updateValue(C.AutoUpdateConfigurationKey,"onlyEnabledExtensions")}),this.registerExtensionAction({id:"configureExtensionsAutoUpdate.none",title:(0,t.localize)(59,null),toggled:L.ContextKeyExpr.equals(`config.${C.AutoUpdateConfigurationKey}`,!1),menu:[{id:ke,order:3}],run:Le=>Le.get(re.IConfigurationService).updateValue(C.AutoUpdateConfigurationKey,!1)}),this.registerExtensionAction({id:"workbench.extensions.action.updateAllExtensions",title:{value:(0,t.localize)(60,null),original:"Update All Extensions"},category:k.ExtensionsLocalizedLabel,precondition:C.HasOutdatedExtensionsContext,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(C.CONTEXT_HAS_GALLERY,L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.and(L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),L.ContextKeyExpr.or(L.ContextKeyExpr.has(`config.${C.AutoUpdateConfigurationKey}`).negate(),L.ContextKeyExpr.equals(`config.${C.AutoUpdateConfigurationKey}`,"onlyEnabledExtensions"))),group:"1_updates",order:2},{id:R.MenuId.ViewTitle,when:L.ContextKeyExpr.equals("view",C.OUTDATED_EXTENSIONS_VIEW_ID),group:"navigation",order:1}],icon:Y.installWorkspaceRecommendedIcon,run:()=>Promise.all(this.extensionsWorkbenchService.outdated.map(async Le=>{try{await this.extensionsWorkbenchService.install(Le,Le.local?.preRelease?{installPreReleaseVersion:!0}:void 0)}catch(Me){De(this.instantiationService.createInstance(r.PromptExtensionInstallFailureAction,Le,Le.latestVersion,3,void 0,Me))}}))}),this.registerExtensionAction({id:"workbench.extensions.action.disableAutoUpdate",title:{value:(0,t.localize)(61,null),original:"Disable Auto Update for all extensions"},category:k.ExtensionsLocalizedLabel,f1:!0,precondition:C.CONTEXT_HAS_GALLERY,run:Le=>Le.get(re.IConfigurationService).updateValue(C.AutoUpdateConfigurationKey,!1)}),this.registerExtensionAction({id:"workbench.extensions.action.enableAutoUpdate",title:{value:(0,t.localize)(62,null),original:"Enable Auto Update for all extensions"},category:k.ExtensionsLocalizedLabel,f1:!0,precondition:C.CONTEXT_HAS_GALLERY,run:Le=>Le.get(re.IConfigurationService).updateValue(C.AutoUpdateConfigurationKey,!0)}),this.registerExtensionAction({id:"workbench.extensions.action.enableAll",title:{value:(0,t.localize)(63,null),original:"Enable All Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER)},{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),group:"2_enablement",order:1}],run:async()=>{const Le=this.extensionsWorkbenchService.local.filter(Me=>!!Me.local&&this.extensionEnablementService.canChangeEnablement(Me.local)&&!this.extensionEnablementService.isEnabled(Me.local));Le.length&&await this.extensionsWorkbenchService.setEnablement(Le,8)}}),this.registerExtensionAction({id:"workbench.extensions.action.enableAllWorkspace",title:{value:(0,t.localize)(64,null),original:"Enable All Extensions for this Workspace"},category:k.ExtensionsLocalizedLabel,menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.notEqualsTo("empty"),L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},run:async()=>{const Le=this.extensionsWorkbenchService.local.filter(Me=>!!Me.local&&this.extensionEnablementService.canChangeEnablement(Me.local)&&!this.extensionEnablementService.isEnabled(Me.local));Le.length&&await this.extensionsWorkbenchService.setEnablement(Le,9)}}),this.registerExtensionAction({id:"workbench.extensions.action.disableAll",title:{value:(0,t.localize)(65,null),original:"Disable All Installed Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER)},{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),group:"2_enablement",order:2}],run:async()=>{const Le=this.extensionsWorkbenchService.local.filter(Me=>!Me.isBuiltin&&!!Me.local&&this.extensionEnablementService.isEnabled(Me.local)&&this.extensionEnablementService.canChangeEnablement(Me.local));Le.length&&await this.extensionsWorkbenchService.setEnablement(Le,6)}}),this.registerExtensionAction({id:"workbench.extensions.action.disableAllWorkspace",title:{value:(0,t.localize)(66,null),original:"Disable All Installed Extensions for this Workspace"},category:k.ExtensionsLocalizedLabel,menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.notEqualsTo("empty"),L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},run:async()=>{const Le=this.extensionsWorkbenchService.local.filter(Me=>!Me.isBuiltin&&!!Me.local&&this.extensionEnablementService.isEnabled(Me.local)&&this.extensionEnablementService.canChangeEnablement(Me.local));Le.length&&await this.extensionsWorkbenchService.setEnablement(Le,7)}}),this.registerExtensionAction({id:C.SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID,title:{value:(0,t.localize)(67,null),original:"Install from VSIX..."},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER)},{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.and(L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER)),group:"3_install",order:1}],run:async Le=>{const Me=Le.get(oe.IFileDialogService),Oe=Le.get(d.ICommandService),Ke=await Me.showOpenDialog({title:(0,t.localize)(68,null),filters:[{name:"VSIX Extensions",extensions:["vsix"]}],canSelectFiles:!0,canSelectMany:!0,openLabel:(0,se.mnemonicButtonLabel)((0,t.localize)(69,null))});Ke&&await Oe.executeCommand(C.INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID,Ke)}}),this.registerExtensionAction({id:C.INSTALL_EXTENSION_FROM_VSIX_COMMAND_ID,title:(0,t.localize)(70,null),menu:[{id:R.MenuId.ExplorerContext,group:"extensions",when:L.ContextKeyExpr.and(X.ResourceContextKey.Extension.isEqualTo(".vsix"),L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER))}],run:async(Le,Me)=>{const Oe=Le.get(U.IExtensionService),Ke=Le.get(C.IExtensionsWorkbenchService),We=Le.get(q.IHostService),Xe=Le.get($.INotificationService),Je=Array.isArray(Me)?Me:[Me];await Z.Promises.settled(Je.map(async rt=>await Ke.install(rt))).then(async rt=>{for(const je of rt){const Ue=!(je.local&&Oe.canAddExtension((0,U.toExtensionDescription)(je.local))),Fe=Ue?(0,t.localize)(71,null,je.displayName||je.name):(0,t.localize)(72,null,je.displayName||je.name),He=Ue?[{label:(0,t.localize)(73,null),run:()=>We.reload()}]:[];Xe.prompt($.Severity.Info,Fe,He)}})}}),this.registerExtensionAction({id:"workbench.extensions.action.installWebExtensionFromLocation",title:{value:(0,t.localize)(74,null),original:"Install Web Extension..."},category:x.Categories.Developer,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_WEB_SERVER)}],run:async Le=>{const Me=Le.get(he.IQuickInputService),Oe=Le.get(E.IWorkbenchExtensionManagementService),Ke=new ie.DisposableStore,We=Ke.add(Me.createQuickPick());We.title=(0,t.localize)(75,null),We.customButton=!0,We.customLabel=(0,t.localize)(76,null),We.placeholder=(0,t.localize)(77,null),We.ignoreFocusOut=!0,Ke.add(pe.Event.any(We.onDidAccept,We.onDidCustom)(()=>{We.hide(),We.value&&Oe.installWebExtension(h.URI.parse(We.value))})),Ke.add(We.onDidHide(()=>Ke.dispose())),We.show()}});const Ee=new R.MenuId("extensionsFilterSubMenu");R.MenuRegistry.appendMenuItem(R.MenuId.ViewContainerTitle,{submenu:Ee,title:(0,t.localize)(78,null),when:L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),group:"navigation",order:1,icon:Y.filterIcon});const Te="extensions.filter.featured";this.registerExtensionAction({id:Te,title:{value:(0,t.localize)(79,null),original:"Show Featured Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},{id:Ee,when:C.CONTEXT_HAS_GALLERY,group:"1_predefined",order:1}],menuTitles:{[Ee.id]:(0,t.localize)(80,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@featured "))}),this.registerExtensionAction({id:"workbench.extensions.action.showPopularExtensions",title:{value:(0,t.localize)(81,null),original:"Show Popular Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},{id:Ee,when:C.CONTEXT_HAS_GALLERY,group:"1_predefined",order:2}],menuTitles:{[Ee.id]:(0,t.localize)(82,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@popular "))}),this.registerExtensionAction({id:"workbench.extensions.action.showRecommendedExtensions",title:{value:(0,t.localize)(83,null),original:"Show Recommended Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},{id:Ee,when:C.CONTEXT_HAS_GALLERY,group:"1_predefined",order:2}],menuTitles:{[Ee.id]:(0,t.localize)(84,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@recommended "))}),this.registerExtensionAction({id:"workbench.extensions.action.recentlyPublishedExtensions",title:{value:(0,t.localize)(85,null),original:"Show Recently Published Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:C.CONTEXT_HAS_GALLERY},{id:Ee,when:C.CONTEXT_HAS_GALLERY,group:"1_predefined",order:2}],menuTitles:{[Ee.id]:(0,t.localize)(86,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@recentlyPublished "))});const _e=new R.MenuId("extensionsCategoryFilterSubMenu");R.MenuRegistry.appendMenuItem(Ee,{submenu:_e,title:(0,t.localize)(87,null),when:C.CONTEXT_HAS_GALLERY,group:"2_categories",order:1}),ee.EXTENSION_CATEGORIES.map((Le,Me)=>{this.registerExtensionAction({id:`extensions.actions.searchByCategory.${Le}`,title:Le,menu:[{id:_e,when:C.CONTEXT_HAS_GALLERY,order:Me}],run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,`@category:"${Le.toLowerCase()}"`))})}),this.registerExtensionAction({id:"workbench.extensions.action.listBuiltInExtensions",title:{value:(0,t.localize)(88,null),original:"Show Built-in Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER)},{id:Ee,group:"3_installed",order:2}],menuTitles:{[Ee.id]:(0,t.localize)(89,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@builtin "))}),this.registerExtensionAction({id:"workbench.extensions.action.extensionUpdates",title:{value:(0,t.localize)(90,null),original:"Show Extension Updates"},category:k.ExtensionsLocalizedLabel,precondition:C.CONTEXT_HAS_GALLERY,f1:!0,menu:[{id:Ee,group:"3_installed",when:C.CONTEXT_HAS_GALLERY,order:1}],menuTitles:{[Ee.id]:(0,t.localize)(91,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@updates"))}),this.registerExtensionAction({id:C.LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID,title:{value:(0,t.localize)(92,null),original:"Show Extensions Unsupported By Workspace"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER)},{id:Ee,group:"3_installed",order:5,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER)}],menuTitles:{[Ee.id]:(0,t.localize)(93,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@workspaceUnsupported"))}),this.registerExtensionAction({id:"workbench.extensions.action.showEnabledExtensions",title:{value:(0,t.localize)(94,null),original:"Show Enabled Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER)},{id:Ee,group:"3_installed",order:3}],menuTitles:{[Ee.id]:(0,t.localize)(95,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@enabled "))}),this.registerExtensionAction({id:"workbench.extensions.action.showDisabledExtensions",title:{value:(0,t.localize)(96,null),original:"Show Disabled Extensions"},category:k.ExtensionsLocalizedLabel,menu:[{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER)},{id:Ee,group:"3_installed",order:4}],menuTitles:{[Ee.id]:(0,t.localize)(97,null)},run:()=>De(this.instantiationService.createInstance(r.SearchExtensionsAction,"@disabled "))});const Re=new R.MenuId("extensionsSortSubMenu");R.MenuRegistry.appendMenuItem(Ee,{submenu:Re,title:(0,t.localize)(98,null),when:L.ContextKeyExpr.and(L.ContextKeyExpr.or(C.CONTEXT_HAS_GALLERY,f.DefaultViewsContext)),group:"4_sort",order:1}),[{id:"installs",title:(0,t.localize)(99,null),precondition:f.BuiltInExtensionsContext.negate()},{id:"rating",title:(0,t.localize)(100,null),precondition:f.BuiltInExtensionsContext.negate()},{id:"name",title:(0,t.localize)(101,null),precondition:f.BuiltInExtensionsContext.negate()},{id:"publishedDate",title:(0,t.localize)(102,null),precondition:f.BuiltInExtensionsContext.negate()},{id:"updateDate",title:(0,t.localize)(103,null),precondition:L.ContextKeyExpr.and(f.SearchMarketplaceExtensionsContext.negate(),f.RecommendedExtensionsContext.negate(),f.BuiltInExtensionsContext.negate())}].map(({id:Le,title:Me,precondition:Oe},Ke)=>{this.registerExtensionAction({id:`extensions.sort.${Le}`,title:Me,precondition:Oe,menu:[{id:Re,when:L.ContextKeyExpr.or(C.CONTEXT_HAS_GALLERY,f.DefaultViewsContext),order:Ke}],toggled:f.ExtensionsSortByContext.isEqualTo(Le),run:async()=>{const Xe=(await this.paneCompositeService.openPaneComposite(C.VIEWLET_ID,0,!0))?.getViewPaneContainer(),Je=te.Query.parse(Xe.searchValue||"");Xe.search(new te.Query(Je.value,Le,Je.groupBy).toString()),Xe.focus()}})}),this.registerExtensionAction({id:"workbench.extensions.action.clearExtensionsSearchResults",title:{value:(0,t.localize)(104,null),original:"Clear Extensions Search Results"},category:k.ExtensionsLocalizedLabel,icon:Y.clearSearchResultsIcon,f1:!0,precondition:f.SearchHasTextContext,menu:{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),group:"navigation",order:3},run:async Le=>{const Me=Le.get(y.IViewsService).getActiveViewPaneContainerWithId(C.VIEWLET_ID);if(Me){const Oe=Me;Oe.search(""),Oe.focus()}}}),this.registerExtensionAction({id:"workbench.extensions.action.refreshExtension",title:{value:(0,t.localize)(105,null),original:"Refresh"},category:k.ExtensionsLocalizedLabel,icon:Y.refreshIcon,f1:!0,menu:{id:R.MenuId.ViewContainerTitle,when:L.ContextKeyExpr.equals("viewContainer",C.VIEWLET_ID),group:"navigation",order:2},run:async Le=>{const Me=Le.get(y.IViewsService).getActiveViewPaneContainerWithId(C.VIEWLET_ID);Me&&await Me.refresh()}}),this.registerExtensionAction({id:"workbench.extensions.action.installWorkspaceRecommendedExtensions",title:(0,t.localize)(106,null),icon:Y.installWorkspaceRecommendedIcon,menu:{id:R.MenuId.ViewTitle,when:L.ContextKeyExpr.equals("view",C.WORKSPACE_RECOMMENDATIONS_VIEW_ID),group:"navigation",order:1},run:async Le=>Le.get(y.IViewsService).getActiveViewWithId(C.WORKSPACE_RECOMMENDATIONS_VIEW_ID).installWorkspaceRecommendations()}),this.registerExtensionAction({id:r.ConfigureWorkspaceFolderRecommendedExtensionsAction.ID,title:r.ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL,icon:Y.configureRecommendedIcon,menu:[{id:R.MenuId.CommandPalette,when:X.WorkbenchStateContext.notEqualsTo("empty")},{id:R.MenuId.ViewTitle,when:L.ContextKeyExpr.equals("view",C.WORKSPACE_RECOMMENDATIONS_VIEW_ID),group:"navigation",order:2}],run:()=>De(this.instantiationService.createInstance(r.ConfigureWorkspaceFolderRecommendedExtensionsAction,r.ConfigureWorkspaceFolderRecommendedExtensionsAction.ID,r.ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL))}),this.registerExtensionAction({id:r.InstallSpecificVersionOfExtensionAction.ID,title:{value:r.InstallSpecificVersionOfExtensionAction.LABEL,original:"Install Specific Version of Extension..."},category:k.ExtensionsLocalizedLabel,menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(C.CONTEXT_HAS_GALLERY,L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER,e.CONTEXT_HAS_WEB_SERVER))},run:()=>De(this.instantiationService.createInstance(r.InstallSpecificVersionOfExtensionAction,r.InstallSpecificVersionOfExtensionAction.ID,r.InstallSpecificVersionOfExtensionAction.LABEL))}),this.registerExtensionAction({id:r.ReinstallAction.ID,title:{value:r.ReinstallAction.LABEL,original:"Reinstall Extension..."},category:x.Categories.Developer,menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(C.CONTEXT_HAS_GALLERY,L.ContextKeyExpr.or(e.CONTEXT_HAS_LOCAL_SERVER,e.CONTEXT_HAS_REMOTE_SERVER))},run:()=>De(this.instantiationService.createInstance(r.ReinstallAction,r.ReinstallAction.ID,r.ReinstallAction.LABEL))})}registerContextMenuActions(){this.registerExtensionAction({id:r.SetColorThemeAction.ID,title:r.SetColorThemeAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.THEME_ACTIONS_GROUP,order:0,when:L.ContextKeyExpr.and(L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.has("extensionHasColorThemes"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=ke.get(n.IInstantiationService),Re=Te.local.find(Le=>(0,o.areSameExtensions)(Le.identifier,{id:Ee}));if(Re){const Le=_e.createInstance(r.SetColorThemeAction);return Le.extension=Re,Le.run()}}}),this.registerExtensionAction({id:r.SetFileIconThemeAction.ID,title:r.SetFileIconThemeAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.THEME_ACTIONS_GROUP,order:0,when:L.ContextKeyExpr.and(L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.has("extensionHasFileIconThemes"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=ke.get(n.IInstantiationService),Re=Te.local.find(Le=>(0,o.areSameExtensions)(Le.identifier,{id:Ee}));if(Re){const Le=_e.createInstance(r.SetFileIconThemeAction);return Le.extension=Re,Le.run()}}}),this.registerExtensionAction({id:r.SetProductIconThemeAction.ID,title:r.SetProductIconThemeAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.THEME_ACTIONS_GROUP,order:0,when:L.ContextKeyExpr.and(L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.has("extensionHasProductIconThemes"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=ke.get(n.IInstantiationService),Re=Te.local.find(Le=>(0,o.areSameExtensions)(Le.identifier,{id:Ee}));if(Re){const Le=_e.createInstance(r.SetProductIconThemeAction);return Le.extension=Re,Le.run()}}}),this.registerExtensionAction({id:"workbench.extensions.action.showPreReleaseVersion",title:{value:(0,t.localize)(107,null),original:"Show Pre-Release Version"},menu:{id:R.MenuId.ExtensionContext,group:C.INSTALL_ACTIONS_GROUP,order:0,when:L.ContextKeyExpr.and(L.ContextKeyExpr.has("inExtensionEditor"),L.ContextKeyExpr.has("extensionHasPreReleaseVersion"),L.ContextKeyExpr.not("showPreReleaseVersion"),L.ContextKeyExpr.not("isBuiltinExtension"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=(await Te.getExtensions([{id:Ee}],D.CancellationToken.None))[0];Te.open(_e,{showPreReleaseVersion:!0})}}),this.registerExtensionAction({id:"workbench.extensions.action.showReleasedVersion",title:{value:(0,t.localize)(108,null),original:"Show Release Version"},menu:{id:R.MenuId.ExtensionContext,group:C.INSTALL_ACTIONS_GROUP,order:1,when:L.ContextKeyExpr.and(L.ContextKeyExpr.has("inExtensionEditor"),L.ContextKeyExpr.has("extensionHasPreReleaseVersion"),L.ContextKeyExpr.has("extensionHasReleaseVersion"),L.ContextKeyExpr.has("showPreReleaseVersion"),L.ContextKeyExpr.not("isBuiltinExtension"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=(await Te.getExtensions([{id:Ee}],D.CancellationToken.None))[0];Te.open(_e,{showPreReleaseVersion:!1})}}),this.registerExtensionAction({id:r.SwitchToPreReleaseVersionAction.ID,title:r.SwitchToPreReleaseVersionAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.INSTALL_ACTIONS_GROUP,order:2,when:L.ContextKeyExpr.and(L.ContextKeyExpr.not("installedExtensionIsPreReleaseVersion"),L.ContextKeyExpr.has("extensionHasPreReleaseVersion"),L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.not("isBuiltinExtension"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=Te.local.find(Re=>(0,o.areSameExtensions)(Re.identifier,{id:Ee}));_e&&(Te.open(_e,{showPreReleaseVersion:!0}),await Te.install(_e,{installPreReleaseVersion:!0}))}}),this.registerExtensionAction({id:r.SwitchToReleasedVersionAction.ID,title:r.SwitchToReleasedVersionAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.INSTALL_ACTIONS_GROUP,order:3,when:L.ContextKeyExpr.and(L.ContextKeyExpr.has("installedExtensionIsPreReleaseVersion"),L.ContextKeyExpr.has("extensionHasPreReleaseVersion"),L.ContextKeyExpr.has("extensionHasReleaseVersion"),L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.not("isBuiltinExtension"))},run:async(ke,Ee)=>{const Te=ke.get(C.IExtensionsWorkbenchService),_e=Te.local.find(Re=>(0,o.areSameExtensions)(Re.identifier,{id:Ee}));_e&&(Te.open(_e,{showPreReleaseVersion:!1}),await Te.install(_e,{installPreReleaseVersion:!1}))}}),this.registerExtensionAction({id:r.ClearLanguageAction.ID,title:r.ClearLanguageAction.TITLE,menu:{id:R.MenuId.ExtensionContext,group:C.INSTALL_ACTIONS_GROUP,order:0,when:L.ContextKeyExpr.and(L.ContextKeyExpr.not("inExtensionEditor"),L.ContextKeyExpr.has("canSetLanguage"),L.ContextKeyExpr.has("isActiveLanguagePackExtension"))},run:async(ke,Ee)=>{const Te=ke.get(n.IInstantiationService),Re=(await ke.get(C.IExtensionsWorkbenchService).getExtensions([{id:Ee}],D.CancellationToken.None))[0],Le=Te.createInstance(r.ClearLanguageAction);return Le.extension=Re,Le.run()}}),this.registerExtensionAction({id:"workbench.extensions.action.copyExtension",title:{value:(0,t.localize)(109,null),original:"Copy"},menu:{id:R.MenuId.ExtensionContext,group:"1_copy"},run:async(ke,Ee)=>{const Te=ke.get(T.IClipboardService),_e=this.extensionsWorkbenchService.local.filter(Re=>(0,o.areSameExtensions)(Re.identifier,{id:Ee}))[0]||(await this.extensionsWorkbenchService.getExtensions([{id:Ee}],D.CancellationToken.None))[0];if(_e){const Re=(0,t.localize)(110,null,_e.displayName),Le=(0,t.localize)(111,null,Ee),Me=(0,t.localize)(112,null,_e.description),Oe=(0,t.localize)(113,null,_e.version),Ke=(0,t.localize)(114,null,_e.publisherDisplayName),We=_e.url?(0,t.localize)(115,null,`${_e.url}`):null,Xe=`${Re}
${Le}
${Me}
${Oe}
${Ke}${We?`
`+We:""}`;await Te.writeText(Xe)}}}),this.registerExtensionAction({id:"workbench.extensions.action.copyExtensionId",title:{value:(0,t.localize)(116,null),original:"Copy Extension ID"},menu:{id:R.MenuId.ExtensionContext,group:"1_copy"},run:async(ke,Ee)=>ke.get(T.IClipboardService).writeText(Ee)}),this.registerExtensionAction({id:"workbench.extensions.action.configure",title:{value:(0,t.localize)(117,null),original:"Extension Settings"},menu:{id:R.MenuId.ExtensionContext,group:"2_configure",when:L.ContextKeyExpr.and(L.ContextKeyExpr.equals("extensionStatus","installed"),L.ContextKeyExpr.has("extensionHasConfiguration"))},run:async(ke,Ee)=>ke.get(_.IPreferencesService).openSettings({jsonEditor:!1,query:`@ext:${Ee}`})}),this.registerExtensionAction({id:C.TOGGLE_IGNORE_EXTENSION_ACTION_ID,title:{value:(0,t.localize)(118,null),original:"Sync This Extension"},menu:{id:R.MenuId.ExtensionContext,group:"2_configure",when:L.ContextKeyExpr.and(P.CONTEXT_SYNC_ENABLEMENT,L.ContextKeyExpr.has("inExtensionEditor").negate())},run:async(ke,Ee)=>{const Te=this.extensionsWorkbenchService.local.find(_e=>(0,o.areSameExtensions)({id:Ee},_e.identifier));if(Te)return this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(Te)}}),this.registerExtensionAction({id:"workbench.extensions.action.ignoreRecommendation",title:{value:(0,t.localize)(119,null),original:"Ignore Recommendation"},menu:{id:R.MenuId.ExtensionContext,group:"3_recommendations",when:L.ContextKeyExpr.has("isExtensionRecommended"),order:1},run:async(ke,Ee)=>ke.get(I.IExtensionIgnoredRecommendationsService).toggleGlobalIgnoredRecommendation(Ee,!0)}),this.registerExtensionAction({id:"workbench.extensions.action.undoIgnoredRecommendation",title:{value:(0,t.localize)(120,null),original:"Undo Ignored Recommendation"},menu:{id:R.MenuId.ExtensionContext,group:"3_recommendations",when:L.ContextKeyExpr.has("isUserIgnoredRecommendation"),order:1},run:async(ke,Ee)=>ke.get(I.IExtensionIgnoredRecommendationsService).toggleGlobalIgnoredRecommendation(Ee,!1)}),this.registerExtensionAction({id:"workbench.extensions.action.addExtensionToWorkspaceRecommendations",title:{value:(0,t.localize)(121,null),original:"Add to Workspace Recommendations"},menu:{id:R.MenuId.ExtensionContext,group:"3_recommendations",when:L.ContextKeyExpr.and(X.WorkbenchStateContext.notEqualsTo("empty"),L.ContextKeyExpr.has("isBuiltinExtension").negate(),L.ContextKeyExpr.has("isExtensionWorkspaceRecommended").negate(),L.ContextKeyExpr.has("isUserIgnoredRecommendation").negate()),order:2},run:(ke,Ee)=>ke.get(G.IWorkspaceExtensionsConfigService).toggleRecommendation(Ee)}),this.registerExtensionAction({id:"workbench.extensions.action.removeExtensionFromWorkspaceRecommendations",title:{value:(0,t.localize)(122,null),original:"Remove from Workspace Recommendations"},menu:{id:R.MenuId.ExtensionContext,group:"3_recommendations",when:L.ContextKeyExpr.and(X.WorkbenchStateContext.notEqualsTo("empty"),L.ContextKeyExpr.has("isBuiltinExtension").negate(),L.ContextKeyExpr.has("isExtensionWorkspaceRecommended")),order:2},run:(ke,Ee)=>ke.get(G.IWorkspaceExtensionsConfigService).toggleRecommendation(Ee)}),this.registerExtensionAction({id:"workbench.extensions.action.addToWorkspaceRecommendations",title:{value:(0,t.localize)(123,null),original:"Add Extension to Workspace Recommendations"},category:(0,t.localize)(124,null),menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.isEqualTo("workspace"),L.ContextKeyExpr.equals("resourceScheme",Q.Schemas.extension))},async run(ke){const Ee=ke.get(V.IEditorService),Te=ke.get(G.IWorkspaceExtensionsConfigService);if(!(Ee.activeEditor instanceof u.ExtensionsInput))return;const _e=Ee.activeEditor.extension.identifier.id.toLowerCase();(await Te.getRecommendations()).includes(_e)||await Te.toggleRecommendation(_e)}}),this.registerExtensionAction({id:"workbench.extensions.action.addToWorkspaceFolderRecommendations",title:{value:(0,t.localize)(125,null),original:"Add Extension to Workspace Folder Recommendations"},category:(0,t.localize)(126,null),menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.isEqualTo("folder"),L.ContextKeyExpr.equals("resourceScheme",Q.Schemas.extension))},run:()=>this.commandService.executeCommand("workbench.extensions.action.addToWorkspaceRecommendations")}),this.registerExtensionAction({id:"workbench.extensions.action.addToWorkspaceIgnoredRecommendations",title:{value:(0,t.localize)(127,null),original:"Add Extension to Workspace Ignored Recommendations"},category:(0,t.localize)(128,null),menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.isEqualTo("workspace"),L.ContextKeyExpr.equals("resourceScheme",Q.Schemas.extension))},async run(ke){const Ee=ke.get(V.IEditorService),Te=ke.get(G.IWorkspaceExtensionsConfigService);if(!(Ee.activeEditor instanceof u.ExtensionsInput))return;const _e=Ee.activeEditor.extension.identifier.id.toLowerCase();(await Te.getUnwantedRecommendations()).includes(_e)||await Te.toggleUnwantedRecommendation(_e)}}),this.registerExtensionAction({id:"workbench.extensions.action.addToWorkspaceFolderIgnoredRecommendations",title:{value:(0,t.localize)(129,null),original:"Add Extension to Workspace Folder Ignored Recommendations"},category:(0,t.localize)(130,null),menu:{id:R.MenuId.CommandPalette,when:L.ContextKeyExpr.and(X.WorkbenchStateContext.isEqualTo("folder"),L.ContextKeyExpr.equals("resourceScheme",Q.Schemas.extension))},run:()=>this.commandService.executeCommand("workbench.extensions.action.addToWorkspaceIgnoredRecommendations")}),this.registerExtensionAction({id:r.ConfigureWorkspaceRecommendedExtensionsAction.ID,title:{value:r.ConfigureWorkspaceRecommendedExtensionsAction.LABEL,original:"Configure Recommended Extensions (Workspace)"},category:(0,t.localize)(131,null),menu:{id:R.MenuId.CommandPalette,when:X.WorkbenchStateContext.isEqualTo("workspace")},run:()=>De(this.instantiationService.createInstance(r.ConfigureWorkspaceRecommendedExtensionsAction,r.ConfigureWorkspaceRecommendedExtensionsAction.ID,r.ConfigureWorkspaceRecommendedExtensionsAction.LABEL))})}registerExtensionAction(ke){const Ee=ke.menu?Array.isArray(ke.menu)?ke.menu:[ke.menu]:[];let Te=[];const _e=[];if(ke.menuTitles)for(let Le=0;Le<Ee.length;Le++){const Me=Ee[Le],Oe=ke.menuTitles[Me.id.id];Oe?_e.push({id:Me.id,item:{...Me,command:{id:ke.id,title:Oe}}}):Te.push(Me)}else Te=Ee;const Re=new ie.DisposableStore;return Re.add((0,R.registerAction2)(class extends R.Action2{constructor(){super({...ke,menu:Te})}run(Le,...Me){return ke.run(Le,...Me)}})),_e.length&&Re.add(R.MenuRegistry.appendMenuItems(_e)),Re}};Ae=we([F(0,E.IExtensionManagementServerService),F(1,k.IExtensionGalleryService),F(2,L.IContextKeyService),F(3,me.IPaneCompositePartService),F(4,C.IExtensionsWorkbenchService),F(5,E.IWorkbenchExtensionEnablementService),F(6,n.IInstantiationService),F(7,oe.IDialogService),F(8,d.ICommandService)],Ae);let Pe=class{constructor(ke,Ee){ve.ExtensionStorageService.removeOutdatedExtensionVersions(ke,Ee)}};Pe=we([F(0,k.IExtensionManagementService),F(1,be.IStorageService)],Pe);const fe=p.Registry.as(b.Extensions.Workbench);fe.registerWorkbenchContribution(Ae,3),fe.registerWorkbenchContribution(f.StatusUpdater,3),fe.registerWorkbenchContribution(f.MaliciousExtensionChecker,4),fe.registerWorkbenchContribution(a.KeymapExtensions,3),fe.registerWorkbenchContribution(f.ExtensionsViewletViewsContribution,3),fe.registerWorkbenchContribution(v.ExtensionActivationProgress,4),fe.registerWorkbenchContribution(w.ExtensionDependencyChecker,4),fe.registerWorkbenchContribution(K.ExtensionEnablementWorkspaceTrustTransitionParticipant,3),fe.registerWorkbenchContribution(de.ExtensionsCompletionItemsProvider,3),fe.registerWorkbenchContribution(Se.UnsupportedExtensionsMigrationContrib,4),Ie.isWeb&&fe.registerWorkbenchContribution(Pe,4),(0,R.registerAction2)(j.ShowRuntimeExtensionsAction)}),define(ae[3024],le([1,0,32,81,82,100,19,5,151,25,148,23,57,103,841,436,95,441,260,120,233,104]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteExtensionsInitializerContribution=void 0;let o=class{constructor(v,m,w,D,y,T,_,L){this.extensionManagementServerService=v,this.storageService=m,this.remoteAgentService=w,this.userDataSyncStoreManagementService=D,this.instantiationService=y,this.logService=T,this.authenticationService=_,this.remoteAuthorityResolverService=L,this.initializeRemoteExtensions()}async initializeRemoteExtensions(){const v=this.remoteAgentService.getConnection(),m=this.extensionManagementServerService.localExtensionManagementServer,w=this.extensionManagementServerService.remoteExtensionManagementServer;if(!v||!w||!m||!this.userDataSyncStoreManagementService.userDataSyncStore)return;const D=`${C.IS_NEW_KEY}.${v.remoteAuthority}`;if(!this.storageService.getBoolean(D,-1,!0)){this.logService.trace("Skipping initializing remote extensions because the window with this remote authority was opened before.");return}if(this.storageService.store(D,!1,-1,1),!this.storageService.isNew(1)){this.logService.trace("Skipping initializing remote extensions because this workspace was opened before.");return}const y=await this.remoteAuthorityResolverService.resolveAuthority(v.remoteAuthority);if(!y.options?.authenticationSession)return;const _=(await this.authenticationService.getSessions(y.options?.authenticationSession.providerId)).find(B=>B.id===y.options?.authenticationSession?.id);if(!_){this.logService.info("Skipping initializing remote extensions because the account with given session id is not found",y.options.authenticationSession.id);return}const L=this.instantiationService.createInstance(l.UserDataSyncStoreClient,this.userDataSyncStoreManagementService.userDataSyncStore.url);L.setAuthToken(_.accessToken,y.options.authenticationSession.providerId);const M=await L.readResource("extensions",null),O=new I.ServiceCollection;O.set(R.IExtensionManagementService,w.extensionManagementService),await this.instantiationService.createChild(O).createInstance(g).initialize(M)}};o=we([F(0,d.IExtensionManagementServerService),F(1,C.IStorageService),F(2,a.IRemoteAgentService),F(3,c.IUserDataSyncStoreManagementService),F(4,E.IInstantiationService),F(5,b.ILogService),F(6,s.IAuthenticationService),F(7,S.IRemoteAuthorityResolverService)],o),e.RemoteExtensionsInitializerContribution=o;let g=class extends i.AbstractExtensionsInitializer{constructor(v,m,w,D,y,T,_,L,M){super(v,m,w,D,y,T,_),this.extensionGalleryService=L,this.extensionManifestPropertiesService=M}async doInitialize(v){const m=await this.parseExtensions(v);if(!m){this.logService.info("No synced extensions exist while initializing remote extensions.");return}const w=await this.extensionManagementService.getInstalled(),{newExtensions:D}=this.generatePreview(m,w);if(!D.length){this.logService.trace("No new remote extensions to install.");return}const y=await this.extensionManagementService.getTargetPlatform(),T=await this.extensionGalleryService.getExtensions(D,{targetPlatform:y,compatible:!0},t.CancellationToken.None);T.length&&await Promise.allSettled(T.map(async _=>{const L=await this.extensionGalleryService.getManifest(_,t.CancellationToken.None);if(L&&this.extensionManifestPropertiesService.canExecuteOnWorkspace(L)){const M=m.find(O=>(0,A.areSameExtensions)(O.identifier,O.identifier));await this.extensionManagementService.installFromGallery(_,{installPreReleaseVersion:M?.preRelease,donotIncludePackAndDependencies:!0})}}))}};g=we([F(0,R.IExtensionManagementService),F(1,f.IIgnoredExtensionsManagementService),F(2,k.IFileService),F(3,u.IUserDataProfilesService),F(4,p.IEnvironmentService),F(5,b.ILogService),F(6,r.IUriIdentityService),F(7,R.IExtensionGalleryService),F(8,n.IExtensionManifestPropertiesService)],g)}),define(ae[3025],le([1,0,1671,17,15,44,97,31,5,153,675,2499,43,71,524,7,2484,428,102,2081,29,3024,35,2742,2830]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(0,o.registerSingleton)(S.IExtensionHostProfileService,g.ExtensionHostProfileService,1),p.Registry.as(r.EditorExtensions.EditorPane).registerEditorPane(b.EditorPaneDescriptor.create(S.RuntimeExtensionsEditor,S.RuntimeExtensionsEditor.ID,(0,t.localize)(0,null)),[new k.SyncDescriptor(i.RuntimeExtensionsInput)]);class v{canSerialize(y){return!0}serialize(y){return""}deserialize(y){return i.RuntimeExtensionsInput.instance}}p.Registry.as(r.EditorExtensions.EditorFactory).registerEditorSerializer(i.RuntimeExtensionsInput.ID,v);let m=class{constructor(y,T){T.registerChannel("extensionRecommendationNotification",new d.ExtensionRecommendationNotificationServiceChannel(y)),(0,R.registerAction2)(c.OpenExtensionsFolderAction)}};m=we([F(0,l.IExtensionRecommendationNotificationService),F(1,s.ISharedProcessService)],m);const w=p.Registry.as(A.Extensions.Workbench);w.registerWorkbenchContribution(m,3),w.registerWorkbenchContribution(h.ExtensionsAutoProfiler,4),w.registerWorkbenchContribution(a.RemoteExtensionsInitializerContribution,3),E.CommandsRegistry.registerCommand(C.DebugExtensionHostAction.ID,D=>{D.get(I.IInstantiationService).createInstance(C.DebugExtensionHostAction).run()}),E.CommandsRegistry.registerCommand(S.StartExtensionHostProfileAction.ID,D=>{D.get(I.IInstantiationService).createInstance(S.StartExtensionHostProfileAction,S.StartExtensionHostProfileAction.ID,S.StartExtensionHostProfileAction.LABEL).run()}),E.CommandsRegistry.registerCommand(S.StopExtensionHostProfileAction.ID,D=>{D.get(I.IInstantiationService).createInstance(S.StopExtensionHostProfileAction,S.StopExtensionHostProfileAction.ID,S.StopExtensionHostProfileAction.LABEL).run()}),E.CommandsRegistry.registerCommand(S.SaveExtensionHostProfileAction.ID,D=>{D.get(I.IInstantiationService).createInstance(S.SaveExtensionHostProfileAction,S.SaveExtensionHostProfileAction.ID,S.SaveExtensionHostProfileAction.LABEL).run()}),R.MenuRegistry.appendMenuItem(R.MenuId.EditorTitle,{command:{id:C.DebugExtensionHostAction.ID,title:C.DebugExtensionHostAction.LABEL,icon:n.Codicon.debugStart},group:"navigation",when:u.ActiveEditorContext.isEqualTo(S.RuntimeExtensionsEditor.ID)}),R.MenuRegistry.appendMenuItem(R.MenuId.EditorTitle,{command:{id:S.StartExtensionHostProfileAction.ID,title:S.StartExtensionHostProfileAction.LABEL,icon:n.Codicon.circleFilled},group:"navigation",when:f.ContextKeyExpr.and(u.ActiveEditorContext.isEqualTo(S.RuntimeExtensionsEditor.ID),S.CONTEXT_PROFILE_SESSION_STATE.notEqualsTo("running"))}),R.MenuRegistry.appendMenuItem(R.MenuId.EditorTitle,{command:{id:S.StopExtensionHostProfileAction.ID,title:S.StopExtensionHostProfileAction.LABEL,icon:n.Codicon.debugStop},group:"navigation",when:f.ContextKeyExpr.and(u.ActiveEditorContext.isEqualTo(S.RuntimeExtensionsEditor.ID),S.CONTEXT_PROFILE_SESSION_STATE.isEqualTo("running"))}),R.MenuRegistry.appendMenuItem(R.MenuId.EditorTitle,{command:{id:S.SaveExtensionHostProfileAction.ID,title:S.SaveExtensionHostProfileAction.LABEL,icon:n.Codicon.saveAll,precondition:S.CONTEXT_EXTENSION_HOST_PROFILE_RECORDED},group:"navigation",when:f.ContextKeyExpr.and(u.ActiveEditorContext.isEqualTo(S.RuntimeExtensionsEditor.ID))})}),define(ae[1019],le([1,0,1892,134,8,127,68,26,6,53,82,5,320,46,14]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TerminalConfigHelper=void 0;const f=6,c=100;let l=class{get onConfigChanged(){return this._onConfigChanged.event}constructor(d,n,a,o,g){this._configurationService=d,this._extensionManagementService=n,this._notificationService=a,this._instantiationService=o,this._productService=g,this._linuxDistro=1,this._onConfigChanged=new I.Emitter,this._recommendationsShown=!1,this._updateConfig(),this._configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(A.TERMINAL_CONFIG_SECTION)&&this._updateConfig()}),i.isLinux&&(navigator.userAgent.includes("Ubuntu")?this._linuxDistro=3:navigator.userAgent.includes("Fedora")&&(this._linuxDistro=2))}_updateConfig(){const d=this._configurationService.getValue(A.TERMINAL_CONFIG_SECTION);d.fontWeight=this._normalizeFontWeight(d.fontWeight,A.DEFAULT_FONT_WEIGHT),d.fontWeightBold=this._normalizeFontWeight(d.fontWeightBold,A.DEFAULT_BOLD_FONT_WEIGHT),this.config=d,this._onConfigChanged.fire()}configFontIsMonospace(){const n=this.config.fontFamily||this._configurationService.getValue("editor").fontFamily||p.EDITOR_FONT_DEFAULTS.fontFamily,a=this._getBoundingRectFor("i",n,15),o=this._getBoundingRectFor("w",n,15);return!a||!o||!a.width||!o.width?!0:a.width===o.width}_createCharMeasureElementIfNecessary(){if(!this.panelContainer)throw new Error("Cannot measure element when terminal is not attached");return(!this._charMeasureElement||!this._charMeasureElement.parentElement)&&(this._charMeasureElement=document.createElement("div"),this.panelContainer.appendChild(this._charMeasureElement)),this._charMeasureElement}_getBoundingRectFor(d,n,a){let o;try{o=this._createCharMeasureElementIfNecessary()}catch{return}const g=o.style;g.display="inline-block",g.fontFamily=n,g.fontSize=a+"px",g.lineHeight="normal",o.innerText=d;const h=o.getBoundingClientRect();return g.display="none",h}_measureFont(d,n,a,o){const g=this._getBoundingRectFor("X",d,n);if(this._lastFontMeasurement&&(!g||!g.width||!g.height))return this._lastFontMeasurement;if(this._lastFontMeasurement={fontFamily:d,fontSize:n,letterSpacing:a,lineHeight:o,charWidth:0,charHeight:0},g&&g.width&&g.height)if(this._lastFontMeasurement.charHeight=Math.ceil(g.height),this.config.gpuAcceleration==="off")this._lastFontMeasurement.charWidth=g.width;else{const m=(Math.floor(g.width*window.devicePixelRatio)+Math.round(a))/window.devicePixelRatio;this._lastFontMeasurement.charWidth=m-Math.round(a)/window.devicePixelRatio}return this._lastFontMeasurement}getFont(d,n){const a=this._configurationService.getValue("editor");let o=this.config.fontFamily||a.fontFamily||p.EDITOR_FONT_DEFAULTS.fontFamily,g=this._clampInt(this.config.fontSize,f,c,p.EDITOR_FONT_DEFAULTS.fontSize);this.config.fontFamily||(this._linuxDistro===2&&(o="'DejaVu Sans Mono', monospace"),this._linuxDistro===3&&(o="'Ubuntu Mono', monospace",g=this._clampInt(g+2,f,c,p.EDITOR_FONT_DEFAULTS.fontSize)));const h=this.config.letterSpacing?Math.max(Math.floor(this.config.letterSpacing),A.MINIMUM_LETTER_SPACING):A.DEFAULT_LETTER_SPACING,v=this.config.lineHeight?Math.max(this.config.lineHeight,1):A.DEFAULT_LINE_HEIGHT;return n?{fontFamily:o,fontSize:g,letterSpacing:h,lineHeight:v}:d&&d._renderService&&d._renderService.dimensions?.css.cell.width&&d._renderService.dimensions?.css.cell.height?{fontFamily:o,fontSize:g,letterSpacing:h,lineHeight:v,charHeight:d._renderService.dimensions.css.cell.height/v,charWidth:d._renderService.dimensions.css.cell.width-Math.round(h)/window.devicePixelRatio}:this._measureFont(o,g,h,v)}_clampInt(d,n,a,o){let g=parseInt(d,10);return isNaN(g)?o:(typeof n=="number"&&(g=Math.max(n,g)),typeof a=="number"&&(g=Math.min(a,g)),g)}async showRecommendations(d){if(!this._recommendationsShown&&(this._recommendationsShown=!0,i.isWindows&&d.executable&&(0,b.basename)(d.executable).toLowerCase()==="wsl.exe")){const n=this._productService.exeBasedExtensionTips;if(!n||!n.wsl)return;const a=Object.keys(n.wsl.recommendations).find(o=>n.wsl.recommendations[o].important);a&&!await this._isExtensionInstalled(a)&&this._notificationService.prompt(k.default.Info,t.localize(0,null,n.wsl.friendlyName),[{label:t.localize(1,null),run:()=>{this._instantiationService.createInstance(r.InstallRecommendedExtensionAction,a).run()}}],{sticky:!0,neverShowAgain:{id:"terminalConfigHelper/launchRecommendationsIgnore",scope:E.NeverShowAgainScope.APPLICATION},onCancel:()=>{}})}}async _isExtensionInstalled(d){return(await this._extensionManagementService.getInstalled()).some(a=>a.identifier.id===d)}_normalizeFontWeight(d,n){return d==="normal"||d==="bold"?d:this._clampInt(d,A.MINIMUM_FONT_WEIGHT,A.MAXIMUM_FONT_WEIGHT,n)}};l=we([F(0,R.IConfigurationService),F(1,S.IExtensionManagementService),F(2,E.INotificationService),F(3,C.IInstantiationService),F(4,u.IProductService)],l),e.TerminalConfigHelper=l}),define(ae[3026],le([1,0,109,35,2,5,3002,7,1019,127,6,189,17,69]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TerminalInstanceService=void 0;let i=class extends R.Disposable{get onDidCreateInstance(){return this._onDidCreateInstance.event}constructor(c,l,s){super(),this._instantiationService=c,this._contextKeyService=l,this._lifecycleService=s,this._onDidCreateInstance=new S.Emitter,this._terminalShellTypeContextKey=C.TerminalContextKeys.shellType.bindTo(this._contextKeyService),this._terminalInRunCommandPicker=C.TerminalContextKeys.inTerminalRunCommandPicker.bindTo(this._contextKeyService),this._configHelper=c.createInstance(I.TerminalConfigHelper)}createInstance(c,l,s){const d=this.convertProfileToShellLaunchConfig(c),n=this._instantiationService.createInstance(k.TerminalInstance,this._terminalShellTypeContextKey,this._terminalInRunCommandPicker,this._configHelper,d,s);return n.target=l,this._onDidCreateInstance.fire(n),n}convertProfileToShellLaunchConfig(c,l){if(c&&"profileName"in c){const s=c;return s.path?{executable:s.path,args:s.args,env:s.env,icon:s.icon,color:s.color,name:s.overrideName?s.profileName:void 0,cwd:l}:c}return c?(l&&(c.cwd=l),c):{}}async getBackend(c){return await this._lifecycleService.when(3),r.Registry.as(b.TerminalExtensions.Backend).getTerminalBackend(c)}};i=we([F(0,A.IInstantiationService),F(1,E.IContextKeyService),F(2,u.ILifecycleService)],i),e.TerminalInstanceService=i,(0,p.registerSingleton)(t.ITerminalInstanceService,i,1)}),define(ae[3027],le([1,0,10,11,112,6,2,22,14,9,1905,31,8,7,47,5,25,26,23,185,507,33,63,126,12,34,71,45,109,475,1019,462,290,2408,453,127,189,273,58,24,51,39,69,104]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TerminalService=void 0;let $=class{get isProcessSupportRegistered(){return!!this._processSupportContextKey.get()}get connectionState(){return this._connectionState}get configHelper(){return this._configHelper}get instances(){return this._terminalGroupService.instances.concat(this._terminalEditorService.instances)}get primaryBackendRegistered(){return this._primaryBackendRegistered.wait().then(()=>{})}getReconnectedTerminals(G){return this._reconnectedTerminals.get(G)}get defaultLocation(){return this.configHelper.config.defaultLocation==="editor"?d.TerminalLocation.Editor:d.TerminalLocation.Panel}get activeInstance(){for(const G of this._hostActiveTerminals.values())if(G?.hasFocus)return G;return this._activeInstance}get onDidChangeActiveGroup(){return this._onDidChangeActiveGroup.event}get onDidCreateInstance(){return this._onDidCreateInstance.event}get onDidDisposeInstance(){return this._onDidDisposeInstance.event}get onDidFocusInstance(){return this._onDidFocusInstance.event}get onDidReceiveProcessId(){return this._onDidReceiveProcessId.event}get onDidReceiveInstanceLinks(){return this._onDidReceiveInstanceLinks.event}get onDidRequestStartExtensionTerminal(){return this._onDidRequestStartExtensionTerminal.event}get onDidChangeInstanceDimensions(){return this._onDidChangeInstanceDimensions.event}get onDidMaximumDimensionsChange(){return this._onDidMaxiumumDimensionsChange.event}get onDidChangeInstanceCapability(){return this._onDidChangeInstanceCapability.event}get onDidChangeInstances(){return this._onDidChangeInstances.event}get onDidChangeInstanceTitle(){return this._onDidChangeInstanceTitle.event}get onDidChangeInstanceIcon(){return this._onDidChangeInstanceIcon.event}get onDidChangeInstanceColor(){return this._onDidChangeInstanceColor.event}get onDidChangeActiveInstance(){return this._onDidChangeActiveInstance.event}get onDidChangeInstancePrimaryStatus(){return this._onDidChangeInstancePrimaryStatus.event}get onDidInputInstanceData(){return this._onDidInputInstanceData.event}get onDidDisposeGroup(){return this._onDidDisposeGroup.event}get onDidChangeGroups(){return this._onDidChangeGroups.event}get onDidRegisterProcessSupport(){return this._onDidRegisterProcessSupport.event}get onDidChangeConnectionState(){return this._onDidChangeConnectionState.event}constructor(G,Q,j,K,Y,ee,ie,re,oe,se,te,Z,ne,ce,de,he,pe,me,Se){if(this._contextKeyService=G,this._lifecycleService=Q,this._storageService=j,this._logService=K,this._dialogService=Y,this._instantiationService=ee,this._remoteAgentService=ie,this._viewsService=re,this._configurationService=oe,this._environmentService=se,this._terminalEditorService=te,this._terminalGroupService=Z,this._terminalInstanceService=ne,this._editorGroupsService=ce,this._terminalProfileService=de,this._extensionService=he,this._notificationService=pe,this._workspaceContextService=me,this._commandService=Se,this._hostActiveTerminals=new Map,this._escapeSequenceLoggingEnabled=!1,this._isShuttingDown=!1,this._backgroundedTerminalInstances=[],this._backgroundedTerminalDisposables=new Map,this._linkProviders=new Set,this._linkProviderDisposables=new Map,this._connectionState=0,this._primaryBackendRegistered=new p.Barrier,this._reconnectedTerminals=new Map,this._onDidChangeActiveGroup=new A.Emitter,this._onDidCreateInstance=new A.Emitter,this._onDidDisposeInstance=new A.Emitter,this._onDidFocusInstance=new A.Emitter,this._onDidReceiveProcessId=new A.Emitter,this._onDidReceiveInstanceLinks=new A.Emitter,this._onDidRequestStartExtensionTerminal=new A.Emitter,this._onDidChangeInstanceDimensions=new A.Emitter,this._onDidMaxiumumDimensionsChange=new A.Emitter,this._onDidChangeInstanceCapability=new A.Emitter,this._onDidChangeInstances=new A.Emitter,this._onDidChangeInstanceTitle=new A.Emitter,this._onDidChangeInstanceIcon=new A.Emitter,this._onDidChangeInstanceColor=new A.Emitter,this._onDidChangeActiveInstance=new A.Emitter,this._onDidChangeInstancePrimaryStatus=new A.Emitter,this._onDidInputInstanceData=new A.Emitter,this._onDidDisposeGroup=new A.Emitter,this._onDidChangeGroups=new A.Emitter,this._onDidRegisterProcessSupport=new A.Emitter,this._onDidChangeConnectionState=new A.Emitter,this._configHelper=this._instantiationService.createInstance(T.TerminalConfigHelper),this.onDidCreateInstance(()=>this._terminalProfileService.refreshAvailableProfiles()),this._forwardInstanceHostEvents(this._terminalGroupService),this._forwardInstanceHostEvents(this._terminalEditorService),this._terminalGroupService.onDidChangeActiveGroup(this._onDidChangeActiveGroup.fire,this._onDidChangeActiveGroup),this._terminalInstanceService.onDidCreateInstance(Ie=>{Ie.setEscapeSequenceLogging(this._escapeSequenceLoggingEnabled),this._initInstanceListeners(Ie),this._onDidCreateInstance.fire(Ie)}),this.onDidReceiveInstanceLinks(Ie=>this._setInstanceLinkProviders(Ie)),this._terminalGroupService.onDidChangeActiveInstance(Ie=>{!Ie&&!this._isShuttingDown&&this._terminalGroupService.hidePanel(),Ie?.shellType?this._terminalShellTypeContextKey.set(Ie.shellType.toString()):Ie||this._terminalShellTypeContextKey.reset()}),this._handleInstanceContextKeys(),this._terminalShellTypeContextKey=P.TerminalContextKeys.shellType.bindTo(this._contextKeyService),this._processSupportContextKey=P.TerminalContextKeys.processSupported.bindTo(this._contextKeyService),this._processSupportContextKey.set(!I.isWeb||this._remoteAgentService.getConnection()!==null),this._terminalHasBeenCreated=P.TerminalContextKeys.terminalHasBeenCreated.bindTo(this._contextKeyService),this._terminalCountContextKey=P.TerminalContextKeys.count.bindTo(this._contextKeyService),this._terminalEditorActive=P.TerminalContextKeys.terminalEditorActive.bindTo(this._contextKeyService),this.onDidChangeActiveInstance(Ie=>{this._terminalEditorActive.set(!!Ie?.target&&Ie.target===d.TerminalLocation.Editor)}),Q.onBeforeShutdown(async Ie=>Ie.veto(this._onBeforeShutdown(Ie.reason),"veto.terminal")),Q.onWillShutdown(Ie=>this._onWillShutdown(Ie)),this._configurationService.getValue("task.reconnection")){const Ie="reconnectToTasks";this._storageService.onWillSaveState(ve=>{ve.reason===s.WillSaveStateReason.SHUTDOWN&&this._storageService.store(Ie,this.instances.some(be=>be.shellLaunchConfig.type==="Task"),1,0)}),this._storageService.getBoolean(Ie,1)&&this._viewsService.openView(N.TERMINAL_VIEW_ID).then(()=>{this._storageService.store(Ie,!1,1,0)})}(0,p.timeout)(0).then(()=>this._instantiationService.createInstance(q,document.head))}async showProfileQuickPick(G,Q){const K=await this._instantiationService.createInstance(M.TerminalProfileQuickpick).showAndGetResult(G);if(!K||typeof K=="string")return;const Y=K.keyMods;if(G==="createInstance"){const ee=this.getDefaultInstanceHost().activeInstance;let ie;if(K.config&&"id"in K?.config){await this.createContributedTerminalProfile(K.config.extensionIdentifier,K.config.id,{icon:K.config.options?.icon,color:K.config.options?.color,location:Y?.alt&&ee?{splitActiveTerminal:!0}:this.defaultLocation});return}else K.config&&"profileName"in K.config&&(Y?.alt&&ee?ie=await this.createTerminal({location:{parentTerminal:ee},config:K.config,cwd:Q}):ie=await this.createTerminal({location:this.defaultLocation,config:K.config,cwd:Q}));if(ie&&this.defaultLocation!==d.TerminalLocation.Editor)return this._terminalGroupService.showPanel(!0),this.setActiveInstance(ie),ie}}handleNewRegisteredBackend(G){if(G.remoteAuthority===this._environmentService.remoteAuthority){this._primaryBackend=G;const Q=this.configHelper.config.enablePersistentSessions;this._connectionState=0,!!this._environmentService.remoteAuthority&&Q?this._remoteTerminalsInitPromise=this._reconnectToRemoteTerminals():Q?this._localTerminalsInitPromise=this._reconnectToLocalTerminals():this._connectionState=1,this._primaryBackendRegistered.open(),G.onDidRequestDetach(async K=>{const Y=this.getInstanceFromResource((0,O.getTerminalUri)(K.workspaceId,K.instanceId));if(Y){const ee=Y?.persistentProcessId;ee&&!Y.shellLaunchConfig.isFeatureTerminal&&!Y.shellLaunchConfig.customPtyImplementation?(Y.target===d.TerminalLocation.Editor?this._terminalEditorService.detachInstance(Y):this._terminalGroupService.getGroupForInstance(Y)?.removeInstance(Y),await Y.detachProcessAndDispose(d.TerminalExitReason.User),await this._primaryBackend?.acceptDetachInstanceReply(K.requestId,ee)):await this._primaryBackend?.acceptDetachInstanceReply(K.requestId,void 0)}})}}getPrimaryBackend(){return this._primaryBackend}_forwardInstanceHostEvents(G){G.onDidChangeInstances(this._onDidChangeInstances.fire,this._onDidChangeInstances),G.onDidDisposeInstance(this._onDidDisposeInstance.fire,this._onDidDisposeInstance),G.onDidChangeActiveInstance(Q=>this._evaluateActiveInstance(G,Q)),G.onDidFocusInstance(Q=>{this._onDidFocusInstance.fire(Q),this._evaluateActiveInstance(G,Q)}),G.onDidChangeInstanceCapability(Q=>{this._onDidChangeInstanceCapability.fire(Q)}),this._hostActiveTerminals.set(G,void 0)}_evaluateActiveInstance(G,Q){if(this._hostActiveTerminals.set(G,Q),Q===void 0)for(const j of this._hostActiveTerminals.values())j&&(Q=j);this._activeInstance=Q,this._onDidChangeActiveInstance.fire(Q)}setActiveInstance(G){G.shellLaunchConfig.hideFromUser&&this._showBackgroundTerminal(G),G.target===d.TerminalLocation.Editor?this._terminalEditorService.setActiveInstance(G):this._terminalGroupService.setActiveInstance(G)}async focusActiveInstance(){if(!!this._activeInstance)return this._activeInstance.target===d.TerminalLocation.Editor?this._terminalEditorService.focusActiveInstance():this._terminalGroupService.focusActiveInstance()}async createContributedTerminalProfile(G,Q,j){await this._extensionService.activateByEvent(`onTerminalProfile:${Q}`);const K=this._terminalProfileService.getContributedProfileProvider(G,Q);if(!K){this._notificationService.error(`No terminal profile provider registered for id "${Q}"`);return}try{await K.createContributedTerminalProfile(j),this._terminalGroupService.setActiveInstanceByIndex(this._terminalGroupService.instances.length-1),await this._terminalGroupService.activeInstance?.focusWhenReady()}catch(Y){this._notificationService.error(Y.message)}}async safeDisposeTerminal(G){if(!(G.target!==d.TerminalLocation.Editor&&G.hasChildProcesses&&(this.configHelper.config.confirmOnKill==="panel"||this.configHelper.config.confirmOnKill==="always")&&await this._showTerminalCloseConfirmation(!0)))return new Promise(Q=>{G.onExit(()=>Q()),G.dispose(d.TerminalExitReason.User)})}_setConnected(){this._connectionState=1,this._onDidChangeConnectionState.fire(),this._logService.trace("Reconnected to terminals")}async _reconnectToRemoteTerminals(){const G=this._environmentService.remoteAuthority;if(!G)return;const Q=await this._terminalInstanceService.getBackend(G);if(!Q)return;const j=await Q.getTerminalLayoutInfo();Q.reduceConnectionGraceTime(),await this._recreateTerminalGroups(j),this._attachProcessLayoutListeners()}async _reconnectToLocalTerminals(){const G=await this._terminalInstanceService.getBackend();if(!G)return;const Q=await G.getTerminalLayoutInfo();Q&&Q.tabs.length>0&&await this._recreateTerminalGroups(Q),this._attachProcessLayoutListeners()}async _recreateTerminalGroups(G){let Q=0,j;if(G){for(const K of G.tabs){const Y=K.terminals.filter(ee=>ee.terminal&&ee.terminal.isOrphan);if(Y.length){Q+=Y.length;let ee,ie;for(const oe of Y)this._lifecycleService.startupKind!==3&&oe.terminal?.type==="Task"||(ee?ee=await this.createTerminal({config:{attachPersistentProcess:oe.terminal},location:{parentTerminal:ee}}):(ee=await this.createTerminal({config:{attachPersistentProcess:oe.terminal},location:d.TerminalLocation.Panel}),ie=this._terminalGroupService.getGroupForInstance(ee),K.isActive&&(j=ie)));const re=this.instances.find(oe=>oe.shellLaunchConfig.attachPersistentProcess?.id===K.activePersistentProcessId);re&&this.setActiveInstance(re),ie?.resizePanes(K.terminals.map(oe=>oe.relativeSize))}}G.tabs.length&&(this._terminalGroupService.activeGroup=j)}return Q}async toggleEscapeSequenceLogging(){if(this.instances.length!==0){this._escapeSequenceLoggingEnabled=await this.instances[0].toggleEscapeSequenceLogging();for(let G=1;G<this.instances.length;G++)this.instances[G].setEscapeSequenceLogging(this._escapeSequenceLoggingEnabled);await this._toggleDevTools(this._escapeSequenceLoggingEnabled)}}_attachProcessLayoutListeners(){this.onDidChangeActiveGroup(()=>this._saveState()),this.onDidChangeActiveInstance(()=>this._saveState()),this.onDidChangeInstances(()=>this._saveState()),this.onDidReceiveProcessId(()=>this._saveState()),this.onDidChangeInstanceTitle(G=>this._updateTitle(G)),this.onDidChangeInstanceIcon(G=>this._updateIcon(G.instance,G.userInitiated))}_handleInstanceContextKeys(){const G=P.TerminalContextKeys.isOpen.bindTo(this._contextKeyService),Q=()=>{G.set(this.instances.length>0),this._terminalCountContextKey.set(this.instances.length)};this.onDidChangeInstances(()=>Q())}async getActiveOrCreateInstance(){return this.activeInstance||this.createTerminal()}setEditable(G,Q){Q?this._editable={instance:G,data:Q}:this._editable=void 0;const j=this._viewsService.getActiveViewWithId(N.TERMINAL_VIEW_ID),K=this.isEditable(G);j?.terminalTabbedView?.setEditable(K)}isEditable(G){return!!this._editable&&(this._editable.instance===G||!G)}getEditableData(G){return this._editable&&this._editable.instance===G?this._editable.data:void 0}requestStartExtensionTerminal(G,Q,j){return new Promise(K=>{this._onDidRequestStartExtensionTerminal.fire({proxy:G,cols:Q,rows:j,callback:K})})}_onBeforeShutdown(G){return I.isWeb?(this._isShuttingDown=!0,!1):this._onBeforeShutdownAsync(G)}async _onBeforeShutdownAsync(G){if(this.instances.length===0)return!1;try{if(this._shutdownWindowCount=await this._nativeDelegate?.getWindowCount(),this._shouldReviveProcesses(G)&&await Promise.race([this._primaryBackend?.persistTerminalState(),(0,p.timeout)(2e3)]),!(this._configHelper.config.enablePersistentSessions&&G===3)&&(this.configHelper.config.confirmOnExit==="always"&&this.instances.length>0||this.configHelper.config.confirmOnExit==="hasChildProcesses"&&this.instances.some(Y=>Y.hasChildProcesses)))return this._onBeforeShutdownConfirmation(G)}catch(Q){this._logService.warn("Exception occurred during terminal shutdown",Q)}return this._isShuttingDown=!0,!1}setNativeDelegate(G){this._nativeDelegate=G}async _toggleDevTools(G){G?this._nativeDelegate?.openDevTools():this._nativeDelegate?.toggleDevTools()}_shouldReviveProcesses(G){if(!this._configHelper.config.enablePersistentSessions)return!1;switch(this.configHelper.config.persistentSessionReviveProcess){case"onExit":return G===1&&this._shutdownWindowCount===1&&!I.isMacintosh?!0:G===4||G===2;case"onExitAndWindowClose":return G!==3;default:return!1}}async _onBeforeShutdownConfirmation(G){const Q=await this._showTerminalCloseConfirmation();return Q||(this._isShuttingDown=!0),Q}_onWillShutdown(G){if(this._configHelper.config.enablePersistentSessions&&G.reason===3){for(const K of this.instances)K.detachProcessAndDispose(d.TerminalExitReason.Shutdown);return}const j=this._shouldReviveProcesses(G.reason);for(const K of this.instances)j&&(K.shutdownPersistentProcessId=K.persistentProcessId),K.dispose(d.TerminalExitReason.Shutdown);this._shouldReviveProcesses(G.reason)||this._primaryBackend?.setTerminalLayoutInfo(void 0)}_saveState(){if(this._isShuttingDown||!this.configHelper.config.enablePersistentSessions)return;const Q={tabs:this._terminalGroupService.groups.map(j=>j.getLayoutInfo(j===this._terminalGroupService.activeGroup))};this._primaryBackend?.setTerminalLayoutInfo(Q)}_updateTitle(G){!this.configHelper.config.enablePersistentSessions||!G||!G.persistentProcessId||!G.title||G.isDisposed||(G.staticTitle?this._primaryBackend?.updateTitle(G.persistentProcessId,G.staticTitle,d.TitleEventSource.Api):this._primaryBackend?.updateTitle(G.persistentProcessId,G.title,G.titleSource))}_updateIcon(G,Q){!this.configHelper.config.enablePersistentSessions||!G||!G.persistentProcessId||!G.icon||G.isDisposed||this._primaryBackend?.updateIcon(G.persistentProcessId,Q,G.icon,G.color)}refreshActiveGroup(){this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup)}doWithActiveInstance(G){const Q=this.activeInstance;if(Q)return G(Q)}getInstanceFromId(G){let Q=-1;if(this._backgroundedTerminalInstances.forEach((j,K)=>{j.instanceId===G&&(Q=K)}),Q!==-1)return this._backgroundedTerminalInstances[Q];try{return this.instances[this._getIndexFromId(G)]}catch{return}}getInstanceFromIndex(G){return this.instances[G]}getInstanceFromResource(G){return(0,O.getInstanceFromResource)(this.instances,G)}isAttachedToTerminal(G){return this.instances.some(Q=>Q.processId===G.pid)}async initializeTerminals(){this._remoteTerminalsInitPromise?(await this._remoteTerminalsInitPromise,this._setConnected()):this._localTerminalsInitPromise&&(await this._localTerminalsInitPromise,this._setConnected()),this._terminalGroupService.groups.length===0&&this.isProcessSupportRegistered&&this.createTerminal({location:d.TerminalLocation.Panel})}moveToEditor(G){if(G.target===d.TerminalLocation.Editor)return;const Q=this._terminalGroupService.getGroupForInstance(G);!Q||(Q.removeInstance(G),this._terminalEditorService.openEditor(G))}async moveToTerminalView(G,Q,j){if(b.URI.isUri(G)&&(G=this.getInstanceFromResource(G)),G)this._terminalEditorService.detachInstance(G);else if(G=this._terminalEditorService.detachActiveEditorInstance(),!G)return;if(G.target!==d.TerminalLocation.Editor){await this._terminalGroupService.showPanel(!0);return}G.target=d.TerminalLocation.Panel;let K;if(Q&&(K=this._terminalGroupService.getGroupForInstance(Q)),K||(K=this._terminalGroupService.createGroup()),K.addInstance(G),this.setActiveInstance(G),await this._terminalGroupService.showPanel(!0),Q&&j){const Y=K.terminalInstances.indexOf(Q)+(j==="after"?1:0);K.moveInstance(G,Y)}this._onDidChangeInstances.fire(),this._onDidChangeActiveGroup.fire(this._terminalGroupService.activeGroup)}_initInstanceListeners(G){const Q=[G.onTitleChanged(this._onDidChangeInstanceTitle.fire,this._onDidChangeInstanceTitle),G.onIconChanged(this._onDidChangeInstanceIcon.fire,this._onDidChangeInstanceIcon),G.onIconChanged(this._onDidChangeInstanceColor.fire,this._onDidChangeInstanceColor),G.onProcessIdReady(this._onDidReceiveProcessId.fire,this._onDidReceiveProcessId),G.statusList.onDidChangePrimaryStatus(()=>this._onDidChangeInstancePrimaryStatus.fire(G)),G.onLinksReady(this._onDidReceiveInstanceLinks.fire,this._onDidReceiveInstanceLinks),G.onDimensionsChanged(()=>{this._onDidChangeInstanceDimensions.fire(G),this.configHelper.config.enablePersistentSessions&&this.isProcessSupportRegistered&&this._saveState()}),G.onMaximumDimensionsChanged(()=>this._onDidMaxiumumDimensionsChange.fire(G)),G.onDidInputData(this._onDidInputInstanceData.fire,this._onDidInputInstanceData),G.onDidFocus(this._onDidChangeActiveInstance.fire,this._onDidChangeActiveInstance),G.onRequestAddInstanceToGroup(async j=>await this._addInstanceToGroup(G,j))];G.onDisposed(()=>(0,k.dispose)(Q))}async _addInstanceToGroup(G,Q){const j=(0,O.parseTerminalUri)(Q.uri);if(j.instanceId===void 0)return;let K=this.getInstanceFromResource(Q.uri);if(!K){const Y=await this._primaryBackend?.requestDetachInstance(j.workspaceId,j.instanceId);if(Y){K=await this.createTerminal({config:{attachPersistentProcess:Y},resource:Q.uri}),this._terminalGroupService.moveInstance(K,G,Q.side);return}}if(K=this._terminalGroupService.getInstanceFromResource(Q.uri),K){this._terminalGroupService.moveInstance(K,G,Q.side);return}if(K=this._terminalEditorService.getInstanceFromResource(Q.uri),K){this.moveToTerminalView(K,G,Q.side);return}}registerProcessSupport(G){!G||(this._processSupportContextKey.set(G),this._onDidRegisterProcessSupport.fire())}registerLinkProvider(G){const Q=[];this._linkProviders.add(G);for(const j of this.instances)j.areLinksReady&&Q.push(j.registerLinkProvider(G));return this._linkProviderDisposables.set(G,Q),{dispose:()=>{const j=this._linkProviderDisposables.get(G)||[];for(const K of j)K.dispose();this._linkProviders.delete(G)}}}_setInstanceLinkProviders(G){for(const Q of this._linkProviders){const j=this._linkProviderDisposables.get(Q),K=G.registerLinkProvider(Q);j?.push(K)}}_getIndexFromId(G){let Q=-1;if(this.instances.forEach((j,K)=>{j.instanceId===G&&(Q=K)}),Q===-1)throw new Error(`Terminal with ID ${G} does not exist (has it already been disposed?)`);return Q}async _showTerminalCloseConfirmation(G){let Q;return this.instances.length===1||G?Q=S.localize(0,null):Q=S.localize(1,null,this.instances.length),!(await this._dialogService.confirm({message:Q,primaryButton:S.localize(2,null),type:"warning"})).confirmed}getDefaultInstanceHost(){return this.defaultLocation===d.TerminalLocation.Editor?this._terminalEditorService:this._terminalGroupService}getInstanceHost(G){if(G){if(G===d.TerminalLocation.Editor)return this._terminalEditorService;if(typeof G=="object"){if("viewColumn"in G)return this._terminalEditorService;if("parentTerminal"in G)return G.parentTerminal.target===d.TerminalLocation.Editor?this._terminalEditorService:this._terminalGroupService}else return this._terminalGroupService}return this}async createTerminal(G){if(this._terminalProfileService.availableProfiles.length===0){const re=G?.config&&"customPtyImplementation"in G.config,oe=this._remoteAgentService.getConnection()&&b.URI.isUri(G?.cwd)&&G?.cwd.scheme===E.Schemas.vscodeFileResource;!re&&!oe&&await this._terminalProfileService.profilesReady}const Q=G?.config||this._terminalProfileService.availableProfiles?.find(re=>re.profileName===this._terminalProfileService.getDefaultProfileName()),j=Q&&"extensionIdentifier"in Q?{}:this._terminalInstanceService.convertProfileToShellLaunchConfig(Q||{});let K=Q&&"extensionIdentifier"in Q?Q:void 0;!K&&(!G||!G.config)&&(K=await this._terminalProfileService.getContributedDefaultProfile(j));const Y=typeof G?.location=="object"&&"splitActiveTerminal"in G.location?G.location.splitActiveTerminal:typeof G?.location=="object"?"parentTerminal"in G.location:!1;if(await this._resolveCwd(j,Y,G),K){const re=this.resolveLocation(G?.location);let oe;Y?oe=re===d.TerminalLocation.Editor?{viewColumn:z.SIDE_GROUP}:{splitActiveTerminal:!0}:oe=typeof G?.location=="object"&&"viewColumn"in G.location?G.location:re,await this.createContributedTerminalProfile(K.extensionIdentifier,K.id,{icon:K.icon,color:K.color,location:oe});const se=re===d.TerminalLocation.Editor?this._terminalEditorService:this._terminalGroupService,te=se.instances[se.instances.length-1];return await te.focusWhenReady(),this._terminalHasBeenCreated.set(!0),te}if(!j.customPtyImplementation&&!this.isProcessSupportRegistered)throw new Error("Could not create terminal when process support is not registered");if(j.hideFromUser){const re=this._terminalInstanceService.createInstance(j,void 0,G?.resource);return this._backgroundedTerminalInstances.push(re),this._backgroundedTerminalDisposables.set(re.instanceId,[re.onDisposed(this._onDidDisposeInstance.fire,this._onDidDisposeInstance)]),this._terminalHasBeenCreated.set(!0),re}this._evaluateLocalCwd(j);const ee=this.resolveLocation(G?.location)||this.defaultLocation,ie=this._getSplitParent(G?.location);return this._terminalHasBeenCreated.set(!0),ie?this._splitTerminal(j,ee,ie):this._createTerminal(j,ee,G)}async _resolveCwd(G,Q,j){if(!G.cwd){if(j?.cwd)G.cwd=j.cwd;else if(Q&&j?.location){let Y=this.activeInstance;if(typeof j.location=="object"&&"parentTerminal"in j.location&&(Y=j.location.parentTerminal),!Y)throw new Error("Cannot split without an active instance");G.cwd=await(0,y.getCwdForSplit)(this.configHelper,Y,this._workspaceContextService.getWorkspace().folders,this._commandService)}}}_splitTerminal(G,Q,j){let K;if(typeof G.cwd!="object"&&typeof j.shellLaunchConfig.cwd=="object"&&(G.cwd=b.URI.from({scheme:j.shellLaunchConfig.cwd.scheme,authority:j.shellLaunchConfig.cwd.authority,path:G.cwd||j.shellLaunchConfig.cwd.path})),Q===d.TerminalLocation.Editor||j.target===d.TerminalLocation.Editor)K=this._terminalEditorService.splitInstance(j,G);else{const Y=this._terminalGroupService.getGroupForInstance(j);if(!Y)throw new Error(`Cannot split a terminal without a group ${j}`);G.parentTerminalId=j.instanceId,K=Y.split(G)}return this._addToReconnected(K),K}_addToReconnected(G){if(G.reconnectionProperties){const Q=this._reconnectedTerminals.get(G.reconnectionProperties.ownerId);Q?Q.push(G):this._reconnectedTerminals.set(G.reconnectionProperties.ownerId,[G])}}_createTerminal(G,Q,j){let K;const Y=this._getEditorOptions(j?.location);return Q===d.TerminalLocation.Editor?(K=this._terminalInstanceService.createInstance(G,void 0,j?.resource),K.target=d.TerminalLocation.Editor,this._terminalEditorService.openEditor(K,Y)):K=this._terminalGroupService.createGroup(G).terminalInstances[0],this._addToReconnected(K),K}resolveLocation(G){if(G&&typeof G=="object"){if("parentTerminal"in G)return G.parentTerminal.target?G.parentTerminal.target:d.TerminalLocation.Panel;if("viewColumn"in G)return d.TerminalLocation.Editor;if("splitActiveTerminal"in G)return this._activeInstance?.target?this._activeInstance?.target:d.TerminalLocation.Panel}return G}_getSplitParent(G){if(G&&typeof G=="object"&&"parentTerminal"in G)return G.parentTerminal;if(G&&typeof G=="object"&&"splitActiveTerminal"in G)return this.activeInstance}_getEditorOptions(G){if(G&&typeof G=="object"&&"viewColumn"in G)return G.viewColumn=(0,B.columnToEditorGroup)(this._editorGroupsService,this._configurationService,G.viewColumn),G}_evaluateLocalCwd(G){typeof G.cwd!="string"&&G.cwd?.scheme===E.Schemas.file&&(m.VirtualWorkspaceContext.getValue(this._contextKeyService)?(G.initialText=(0,n.formatMessageForTerminal)(S.localize(3,null,"\x1B[3m","\x1B[23m"),{excludeLeadingNewLine:!0,loudFormatting:!0}),G.type="Local"):this._remoteAgentService.getConnection()&&(G.initialText=(0,n.formatMessageForTerminal)(S.localize(4,null,"\x1B[3m","\x1B[23m"),{excludeLeadingNewLine:!0,loudFormatting:!0}),G.type="Local"))}_showBackgroundTerminal(G){this._backgroundedTerminalInstances.splice(this._backgroundedTerminalInstances.indexOf(G),1);const Q=this._backgroundedTerminalDisposables.get(G.instanceId);Q&&(0,k.dispose)(Q),this._backgroundedTerminalDisposables.delete(G.instanceId),G.shellLaunchConfig.hideFromUser=!1,this._terminalGroupService.createGroup(G),this.instances.length===1&&this._terminalGroupService.setActiveInstanceByIndex(0),this._onDidChangeInstances.fire(),this._onDidChangeGroups.fire()}async setContainers(G,Q){this._configHelper.panelContainer=G,this._terminalGroupService.setContainer(Q)}};we([(0,R.debounce)(500)],$.prototype,"_saveState",null),we([(0,R.debounce)(500)],$.prototype,"_updateTitle",null),we([(0,R.debounce)(500)],$.prototype,"_updateIcon",null),$=we([F(0,u.IContextKeyService),F(1,W.ILifecycleService),F(2,s.IStorageService),F(3,c.ILogService),F(4,i.IDialogService),F(5,f.IInstantiationService),F(6,U.IRemoteAgentService),F(7,w.IViewsService),F(8,r.IConfigurationService),F(9,x.IWorkbenchEnvironmentService),F(10,D.ITerminalEditorService),F(11,D.ITerminalGroupService),F(12,D.ITerminalInstanceService),F(13,V.IEditorGroupsService),F(14,N.ITerminalProfileService),F(15,H.IExtensionService),F(16,l.INotificationService),F(17,v.IWorkspaceContextService),F(18,C.ICommandService)],$),e.TerminalService=$;let q=class extends h.Themable{constructor(G,Q,j,K,Y){super(j),this._terminalService=Q,this._themeService=j,this._terminalProfileService=K,this._editorService=Y,this._registerListeners(),this._styleElement=document.createElement("style"),G.appendChild(this._styleElement),this._register((0,k.toDisposable)(()=>G.removeChild(this._styleElement))),this.updateStyles()}_registerListeners(){this._register(this._terminalService.onDidChangeInstanceIcon(()=>this.updateStyles())),this._register(this._terminalService.onDidChangeInstanceColor(()=>this.updateStyles())),this._register(this._terminalService.onDidCreateInstance(()=>this.updateStyles())),this._register(this._editorService.onDidActiveEditorChange(()=>{this._editorService.activeEditor instanceof _.TerminalEditorInput&&this.updateStyles()})),this._register(this._editorService.onDidCloseEditor(()=>{this._editorService.activeEditor instanceof _.TerminalEditorInput&&this.updateStyles()})),this._register(this._terminalProfileService.onDidChangeAvailableProfiles(()=>this.updateStyles()))}updateStyles(){super.updateStyles();const G=this._themeService.getColorTheme();let Q="";const j=this._themeService.getProductIconTheme();for(const Y of this._terminalService.instances){const ee=Y.icon;if(!ee)continue;let ie;ee instanceof b.URI?ie=ee:ee instanceof Object&&"light"in ee&&"dark"in ee&&(ie=G.type===g.ColorScheme.LIGHT?ee.light:ee.dark);const re=(0,L.getUriClasses)(Y,G.type);if(ie instanceof b.URI&&re&&re.length>1&&(Q+=`.monaco-workbench .terminal-tab.${re[0]}::before{background-image: ${t.asCSSUrl(ie)};}`),h.ThemeIcon.isThemeIcon(ee)){const se=(0,o.getIconRegistry)().getIcon(ee.id);if(se){const te=j.getIcon(se);te&&(Q+=`.monaco-workbench .terminal-tab.codicon-${ee.id}::before{content: '${te.fontCharacter}' !important; font-family: ${t.asCSSPropertyValue(te.font?.id??"codicon")} !important;}`)}}}const K=G.getColor(a.iconForeground);K&&(Q+=`.monaco-workbench .show-file-icons .file-icon.terminal-tab::before { color: ${K}; }`),Q+=(0,L.getColorStyleContent)(G,!0),this._styleElement.textContent=Q}};q=we([F(1,D.ITerminalService),F(2,h.IThemeService),F(3,N.ITerminalProfileService),F(4,z.IEditorService)],q)}),define(ae[3028],le([1,0,1890,9,31,7,98,17,336,45,253,475,1014,127,289,2397,3027,35,109,97,163,222,916,2410,111,452,14,670,3026,615,43,153,2595,462,345,2631,2398,3001,189,3003,44,2702,2663,22,1174,1175,1176,1177]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f,c,l,s,d,n,a,o,g,h,v,m,w,D,y,T,_,L,M,O,N,P,B,V,z,x,H,W,U){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(0,l.registerSingleton)(s.ITerminalService,c.TerminalService,1),(0,l.registerSingleton)(s.ITerminalEditorService,N.TerminalEditorService,1),(0,l.registerSingleton)(s.ITerminalGroupService,B.TerminalGroupService,1),(0,l.registerSingleton)(s.ITerminalInstanceService,D.TerminalInstanceService,1),(0,l.registerSingleton)(u.ITerminalProfileService,z.TerminalProfileService,1);const $=E.Registry.as(a.Extensions.Quickaccess),q="inTerminalPicker";$.registerQuickAccessProvider({ctor:o.TerminalQuickAccessProvider,prefix:o.TerminalQuickAccessProvider.PREFIX,contextKey:q,placeholder:t.localize(0,null),helpEntries:[{description:t.localize(1,null),commandId:"workbench.action.quickOpenTerm"}]});const X="workbench.action.quickOpenNavigateNextInTerminalPicker";R.CommandsRegistry.registerCommand({id:X,handler:(0,I.getQuickNavigateHandler)(X,!0)});const G="workbench.action.quickOpenNavigatePreviousInTerminalPicker";R.CommandsRegistry.registerCommand({id:G,handler:(0,I.getQuickNavigateHandler)(G,!1)});const Q=E.Registry.as(x.Extensions.Workbench);Q.registerWorkbenchContribution(W.TerminalMainContribution,3),Q.registerWorkbenchContribution(H.RemoteTerminalBackendContribution,3),(0,y.registerTerminalPlatformConfiguration)(),(0,g.registerTerminalConfiguration)(),E.Registry.as(T.EditorExtensions.EditorFactory).registerEditorSerializer(M.TerminalEditorInput.ID,P.TerminalInputSerializer),E.Registry.as(T.EditorExtensions.EditorPane).registerEditorPane(_.EditorPaneDescriptor.create(L.TerminalEditor,s.terminalEditorId,O.terminalStrings.terminal),[new d.SyncDescriptor(M.TerminalEditorInput)]),E.Registry.as(S.Extensions.DragAndDropContribution).register({dataFormatKey:"Terminals",getEditorInputs(ee){const ie=[];try{const re=JSON.parse(ee);for(const oe of re)ie.push({resource:p.URI.parse(oe)})}catch{}return ie},setData(ee,ie){const re=ee.filter(({resource:oe})=>oe.scheme===U.Schemas.vscodeTerminal);re.length&&ie.dataTransfer?.setData("Terminals",JSON.stringify(re.map(({resource:oe})=>oe.toString())))}});const j=E.Registry.as(b.Extensions.ViewContainersRegistry).registerViewContainer({id:u.TERMINAL_VIEW_ID,title:t.localize(2,null),icon:v.terminalViewIcon,ctorDescriptor:new d.SyncDescriptor(n.ViewPaneContainer,[u.TERMINAL_VIEW_ID,{mergeViewWithContainerWhenSingleView:!0}]),storageId:u.TERMINAL_VIEW_ID,hideIfEmpty:!0,order:3},1,{doNotRegisterOpenCommand:!0,isDefault:!0});E.Registry.as(b.Extensions.ViewsRegistry).registerViews([{id:u.TERMINAL_VIEW_ID,name:t.localize(3,null),containerIcon:v.terminalViewIcon,canToggleVisibility:!1,canMoveView:!0,ctorDescriptor:new d.SyncDescriptor(r.TerminalViewPane),openCommandActionDescriptor:{id:"workbench.action.terminal.toggleTerminal",mnemonicTitle:t.localize(4,null),keybindings:{primary:2134,mac:{primary:342}},order:3}}],j),(0,C.registerTerminalActions)();function K(ee,ie){k.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.action.terminal.sendSequence",weight:200,when:ie.when||V.TerminalContextKeys.focus,primary:ie.primary,mac:ie.mac,linux:ie.linux,win:ie.win,handler:C.terminalSendSequenceCommand,args:{text:ee}})}const Y=64;m.isWindows&&K(String.fromCharCode("V".charCodeAt(0)-Y),{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh"),h.CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),primary:2100}),K("\x1B[24~a",{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh"),V.TerminalContextKeys.terminalShellIntegrationEnabled,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),primary:2058,mac:{primary:266}}),K("\x1B[24~b",{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh"),V.TerminalContextKeys.terminalShellIntegrationEnabled,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),primary:522}),K("\x1B[24~c",{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh"),V.TerminalContextKeys.terminalShellIntegrationEnabled,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),primary:1027}),K("\x1B[24~d",{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh"),V.TerminalContextKeys.terminalShellIntegrationEnabled,h.CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),mac:{primary:3089}}),K("\x1B[1;2H",{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","pwsh")),mac:{primary:3087}}),m.isIOS&&K(String.fromCharCode("C".charCodeAt(0)-Y),{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus),primary:289}),K(String.fromCharCode("W".charCodeAt(0)-Y),{primary:2049,mac:{primary:513}}),m.isWindows&&K(String.fromCharCode("H".charCodeAt(0)-Y),{when:A.ContextKeyExpr.and(V.TerminalContextKeys.focus,A.ContextKeyExpr.equals("terminalShellType","cmd")),primary:2049}),K("\x1Bd",{primary:2068,mac:{primary:532}}),K("