t=g.localize(8,null);for(let ot=0;ot<Math.min(He.length,Be);ot++){const at=He[ot];nt+=`
${at.length>ze?`${at.slice(0,ze)}\u2026`:at}`}He.length>Be&&(nt+=`
\u2026`);const ut=await this._dialogService.confirm({type:"question",message:g.localize(9,null,He.length),detail:nt,primaryButton:g.localize(10,null),checkbox:{label:g.localize(11,null)}});return ut.confirmed&&ut.checkboxChecked&&await this._configurationService.updateValue("terminal.integrated.enableMultiLinePasteWarning",!1),ut.confirmed}dispose(Fe){if(!this._isDisposed){this._isDisposed=!0,this._logService.trace(`terminalInstance#dispose (instanceId: ${this.instanceId})`),(0,f.dispose)(this._linkManager),this._linkManager=void 0,(0,f.dispose)(this._widgetManager),(0,f.dispose)(this.findWidget.rawValue),this.xterm?.raw.element&&(this._hadFocusOnExit=this.hasFocus),this._wrapperElement.xterm&&(this._wrapperElement.xterm=void 0),this._horizontalScrollbar&&(this._horizontalScrollbar.dispose(),this._horizontalScrollbar=void 0);try{this.xterm?.dispose()}catch(He){this._logService.error("Exception occurred during xterm disposal",He)}t.isFirefox&&(this.resetFocusContextKey(),this._terminalHasTextContextKey.reset(),this._onDidBlur.fire(this)),this._pressAnyKeyToCloseListener&&(this._pressAnyKeyToCloseListener.dispose(),this._pressAnyKeyToCloseListener=void 0),this._exitReason===void 0&&(this._exitReason=Fe??W.TerminalExitReason.Unknown),this._processManager.dispose(),this._onProcessExit(void 0),this._onDisposed.fire(this),super.dispose()}}async detachProcessAndDispose(Fe){await this._processManager.detachFromProcess(Fe===W.TerminalExitReason.User),this.dispose(Fe)}focus(Fe){this._refreshAltBufferContextKey(),!!this.xterm&&(Fe||!window.getSelection()?.toString())&&this.xterm.raw.focus()}async focusWhenReady(Fe){await this._xtermReadyPromise,await this._attachBarrier.wait(),this.focus(Fe)}async paste(){if(!this.xterm)return;const Fe=await this._clipboardService.readText();!await this._shouldPasteText(Fe)||(this.focus(),this.xterm.raw.paste(Fe))}async pasteSelection(){if(!this.xterm)return;const Fe=await this._clipboardService.readText("selection");!await this._shouldPasteText(Fe)||(this.focus(),this.xterm.raw.paste(Fe))}async sendText(Fe,He,Be){Be&&this.xterm?.raw.modes.bracketedPasteMode&&(Fe=`\x1B[200~${Fe}\x1B[201~`),Fe=Fe.replace(/\r?\n/g,"\r"),He&&Fe[Fe.length-1]!=="\r"&&(Fe+="\r"),await this._processManager.write(Fe),this._onDidInputData.fire(this),this.xterm?.scrollToBottom()}async sendPath(Fe,He){return this.sendText(await this.preparePathForShell(Fe),He)}preparePathForShell(Fe){return je(Fe,this.shellLaunchConfig.executable,this.title,this.shellType,this._processManager.backend,this._processManager.os)}setVisible(Fe){this._isVisible=Fe,this._wrapperElement.classList.toggle("active",Fe),Fe&&this.xterm&&(this._open(),this._resize(),this.xterm.forceRefresh())}scrollDownLine(){this.xterm?.scrollDownLine()}scrollDownPage(){this.xterm?.scrollDownPage()}scrollToBottom(){this.xterm?.scrollToBottom()}scrollUpLine(){this.xterm?.scrollUpLine()}scrollUpPage(){this.xterm?.scrollUpPage()}scrollToTop(){this.xterm?.scrollToTop()}clearBuffer(){this.xterm?.clearBuffer()}_refreshSelectionContextKey(){const Fe=!!this._viewsService.getActiveViewWithId(De.TERMINAL_VIEW_ID);let He=!1;const Be=this._editorService.activeEditor;Be&&(He=Be instanceof se.TerminalEditorInput),this._terminalHasTextContextKey.set((Fe||He)&&this.hasSelection())}_createProcessManager(){let Fe;this.shellLaunchConfig.attachPersistentProcess?.environmentVariableCollections&&(Fe=(0,ue.deserializeEnvironmentVariableCollections)(this.shellLaunchConfig.attachPersistentProcess.environmentVariableCollections));const He=this._scopedInstantiationService.createInstance(ne.TerminalProcessManager,this._instanceId,this._configHelper,this.shellLaunchConfig?.cwd,Fe);return this.capabilities.add(He.capabilities),He.onProcessReady(async Be=>{this._onProcessIdReady.fire(this),this._initialCwd=await this.getInitialCwd(),this._labelComputer||(this._labelComputer=this._register(new Je(this._configHelper,this,this._workspaceContextService)),this._labelComputer.onDidChangeLabel(ze=>{this._title=ze.title,this._description=ze.description,this._onTitleChanged.fire(this)})),this._shellLaunchConfig.name?this._setTitle(this._shellLaunchConfig.name,W.TitleEventSource.Api):(setTimeout(()=>{this._xtermReadyPromise.then(ze=>{this._messageTitleDisposable=ze.raw.onTitleChange(nt=>this._onTitleChange(nt))})}),this._setTitle(this._shellLaunchConfig.executable,W.TitleEventSource.Process))}),He.onProcessExit(Be=>this._onProcessExit(Be)),He.onDidChangeProperty(({type:Be,value:ze})=>{switch(Be){case"cwd":this._cwd=ze,this._labelComputer?.refreshLabel();break;case"initialCwd":this._initialCwd=ze,this._cwd=this._initialCwd,this._setTitle(this.title,W.TitleEventSource.Config);break;case"title":this._setTitle(ze??"",W.TitleEventSource.Process);break;case"overrideDimensions":this.setOverrideDimensions(ze,!0);break;case"resolvedShellLaunchConfig":this._setResolvedShellLaunchConfig(ze);break;case"shellType":this.setShellType(ze);break;case"hasChildProcesses":this._onDidChangeHasChildProcesses.fire(ze);break;case"usedShellIntegrationInjection":this._usedShellIntegrationInjection=!0;break}}),He.onProcessData(Be=>{this._initialDataEvents?.push(Be.data),this._onData.fire(Be.data)}),He.onEnvironmentVariableInfoChanged(Be=>this._onEnvironmentVariableInfoChanged(Be)),He.onPtyDisconnect(()=>{this.xterm&&(this.xterm.raw.options.disableStdin=!0),this.statusList.add({id:"disconnected",severity:N.Severity.Error,icon:b.Codicon.debugDisconnect,tooltip:g.localize(12,null)})}),He.onPtyReconnect(()=>{this.xterm&&(this.xterm.raw.options.disableStdin=!1),this.statusList.remove("disconnected")}),He}async _createProcess(){if(this._isDisposed)return;this._historyService.getLastActiveWorkspaceRoot(c.Schemas.file)?await this._trust()||this._onProcessExit({message:g.localize(13,null)}):this._cwd&&this._userHome&&this._cwd!==this._userHome&&this._onProcessExit({message:g.localize(14,null,this._cwd,this._userHome)}),this._container&&this._cols===0&&this._rows===0&&(this._initDimensions(),this.xterm?.raw.resize(this._cols||80,this._rows||30));const He=this.shellLaunchConfig.icon;await this._processManager.createProcess(this._shellLaunchConfig,this._cols||80,this._rows||30,this._accessibilityService.isScreenReaderOptimized()).then(Be=>{Be&&this._onProcessExit(Be)}),this.xterm?.shellIntegration&&this.capabilities.add(this.xterm?.shellIntegration.capabilities),(He!==this.shellLaunchConfig.icon||this.shellLaunchConfig.color)&&(this._icon=this._shellLaunchConfig.attachPersistentProcess?.icon||this._shellLaunchConfig.icon,this._onIconChanged.fire({instance:this,userInitiated:!1}))}registerMarker(){return this.xterm?.raw.registerMarker()}addBufferMarker(Fe){this.capabilities.get(4)?.addMark(Fe)}scrollToMark(Fe,He,Be){this.xterm?.markTracker.scrollToClosestMarker(Fe,He,Be)}async freePortKillProcess(Fe,He){await this._processManager?.freePortKillProcess(Fe),this.runCommand(He,!1)}_onProcessData(Fe){const He=++this._latestXtermWriteData;Fe.trackCommit?Fe.writePromise=new Promise(Be=>{this.xterm?.raw.write(Fe.data,()=>{this._latestXtermParseData=He,this._processManager.acknowledgeDataEvent(Fe.data.length),Be()})}):this.xterm?.raw.write(Fe.data,()=>{this._latestXtermParseData=He,this._processManager.acknowledgeDataEvent(Fe.data.length)})}async _onProcessExit(Fe){if(this._isExiting)return;const He=rt(Fe,this.shellLaunchConfig,this._processManager.processState,this._initialCwd);if(this._usedShellIntegrationInjection&&this._processManager.processState===4&&He?.code!==0){this._relaunchWithShellIntegrationDisabled(He?.message),this._onExit.fire(Fe);return}this._isExiting=!0,await this._flushXtermData(),this._logService.debug(`Terminal process exit (instanceId: ${this.instanceId}) with code ${this._exitCode}`),this._exitCode=He?.code;const Be=He?.message;this._logService.debug(`Terminal process exit (instanceId: ${this.instanceId}) state ${this._processManager.processState}`);const ze=this.waitOnExit;ze&&this._processManager.processState!==5?this._xtermReadyPromise.then(nt=>{switch(Be&&nt.raw.write((0,$.formatMessageForTerminal)(Be)),typeof ze){case"string":nt.raw.write((0,$.formatMessageForTerminal)(ze,{excludeLeadingNewLine:!0}));break;case"function":this.exitCode!==void 0&&nt.raw.write((0,$.formatMessageForTerminal)(ze(this.exitCode),{excludeLeadingNewLine:!0}));break}nt.raw.options.disableStdin=!0,nt.raw.textarea&&this._attachPressAnyKeyToCloseListener(nt.raw)}):(this.dispose(W.TerminalExitReason.Process),Be&&(this._processManager.processState===4||this._configHelper.config.showExitAlert?this._notificationService.notify({message:Be,severity:N.Severity.Error,actions:{primary:[this._scopedInstantiationService.createInstance(re.TerminalLaunchHelpAction)]}}):this._logService.warn(Be))),this._onExit.fire(Fe),this._isDisposed&&this._onExit.dispose()}_relaunchWithShellIntegrationDisabled(Fe){this._shellLaunchConfig.ignoreShellIntegration=!0,this.relaunch(),this.statusList.add({id:"shell-integration-attention-needed",severity:N.Severity.Warning,icon:b.Codicon.warning,tooltip:(`${Fe} `??"")+g.localize(15,null),hoverActions:[{commandId:"workbench.action.terminal.learnMore",label:g.localize(16,null),run:()=>{this._openerService.open("https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration")}},{commandId:"workbench.action.openSettings",label:g.localize(17,null),run:()=>{this._commandService.executeCommand("workbench.action.openSettings","terminal.integrated.shellIntegration.enabled")}}]}),this._telemetryService.publicLog2("terminal/shellIntegrationFailureProcessExit")}_flushXtermData(){if(this._latestXtermWriteData===this._latestXtermParseData)return Promise.resolve();let Fe=0;return new Promise(He=>{const Be=setInterval(()=>{(this._latestXtermWriteData===this._latestXtermParseData||++Fe===5)&&(clearInterval(Be),He())},20)})}_attachPressAnyKeyToCloseListener(Fe){Fe.textarea&&!this._pressAnyKeyToCloseListener&&(this._pressAnyKeyToCloseListener=A.addDisposableListener(Fe.textarea,"keypress",He=>{this._pressAnyKeyToCloseListener&&(this._pressAnyKeyToCloseListener.dispose(),this._pressAnyKeyToCloseListener=void 0,this.dispose(W.TerminalExitReason.Process),He.preventDefault())}))}_writeInitialText(Fe,He){if(!this._shellLaunchConfig.initialText){He?.();return}const Be=typeof this._shellLaunchConfig.initialText=="string"?this._shellLaunchConfig.initialText:this._shellLaunchConfig.initialText?.text;typeof this._shellLaunchConfig.initialText=="string"||this._shellLaunchConfig.initialText.trailingNewLine?Fe.raw.writeln(Be,He):Fe.raw.write(Be,He)}async reuseTerminal(Fe,He=!1){this._pressAnyKeyToCloseListener?.dispose(),this._pressAnyKeyToCloseListener=void 0;const Be=this.xterm;Be&&(He||await new Promise(ze=>Be.raw.write(`
\x1B[G`,ze)),Fe.initialText&&(this._shellLaunchConfig.initialText=Fe.initialText,await new Promise(ze=>this._writeInitialText(Be,ze))),this._isExiting&&this._shellLaunchConfig.waitOnExit&&(Be.raw.options.disableStdin=!1,this._isExiting=!1),He&&Be.clearDecorations()),this.statusList.remove("relaunch-needed"),this._environmentInfo?.disposable.dispose(),this._environmentInfo=void 0,He||(Fe.initialText=" "),this._shellLaunchConfig=Fe,await this._processManager.relaunch(this._shellLaunchConfig,this._cols||80,this._rows||30,this._accessibilityService.isScreenReaderOptimized(),He).then(ze=>{ze&&this._onProcessExit(ze)}),this._xtermTypeAheadAddon?.reset()}async setEscapeSequenceLogging(Fe){const He=await this._xtermReadyPromise;He.raw.options.logLevel=Fe?"debug":"info"}relaunch(){this.reuseTerminal(this._shellLaunchConfig,!0)}_onTitleChange(Fe){this.isTitleSetByProcess&&this._setTitle(Fe,W.TitleEventSource.Sequence)}async _trust(){return await this._workspaceTrustRequestService.requestWorkspaceTrust({message:g.localize(18,null)})===!0}_onKey(Fe,He){new k.StandardKeyboardEvent(He).equals(3)&&this._updateProcessCwd()}async _onSelectionChange(){this._configurationService.getValue("terminal.integrated.copyOnSelection")&&this.hasSelection()&&await this.copySelection()}async _updateProcessCwd(){if(!(this._isDisposed||this.shellLaunchConfig.customPtyImplementation))try{const Fe=await this._refreshProperty("cwd");if(typeof Fe!="string")throw new Error(`cwd is not a string ${Fe}`)}catch(Fe){if(Fe instanceof Error&&Fe.message==="Cannot refresh property when process is not set")return;throw Fe}}updateConfig(){this._setCommandsToSkipShell(this._configHelper.config.commandsToSkipShell),this._refreshEnvironmentVariableInfoWidgetState(this._processManager.environmentVariableInfo)}async _updateUnicodeVersion(){this._processManager.setUnicodeVersion(this._configHelper.config.unicodeVersion)}updateAccessibilitySupport(){const Fe=this._accessibilityService.isScreenReaderOptimized();Fe?(this._navigationModeAddon=new be.NavigationModeAddon(this._terminalA11yTreeFocusContextKey,this._navigationModeActiveContextKey),this.xterm.raw.loadAddon(this._navigationModeAddon)):(this._navigationModeAddon?.dispose(),this._navigationModeAddon=void 0),this.xterm.raw.options.screenReaderMode=Fe}_setCommandsToSkipShell(Fe){const He=Fe.filter(Be=>Be[0]==="-").map(Be=>Be.slice(1));this._skipTerminalCommands=De.DEFAULT_COMMANDS_TO_SKIP_SHELL.filter(Be=>He.indexOf(Be)===-1).concat(Fe)}layout(Fe){this._lastLayoutDimensions=Fe,!(this.disableLayout||Fe.width<=0||Fe.height<=0||!this._evaluateColsAndRows(Fe.width,Fe.height))&&(this._resize(),this.findWidget.rawValue?.layout(Fe.width),this._containerReadyBarrier.open())}async _resize(){this._resizeNow(!1)}async _resizeNow(Fe){let He=this.cols,Be=this.rows;if(this.xterm){if(this._isVisible&&this._layoutSettingsChanged){const ze=this.xterm.getFont(),nt=this._configHelper.config;this.xterm.raw.options.letterSpacing=ze.letterSpacing,this.xterm.raw.options.lineHeight=ze.lineHeight,this.xterm.raw.options.fontSize=ze.fontSize,this.xterm.raw.options.fontFamily=ze.fontFamily,this.xterm.raw.options.fontWeight=nt.fontWeight,this.xterm.raw.options.fontWeightBold=nt.fontWeightBold,this._initDimensions(),He=this.cols,Be=this.rows,this._layoutSettingsChanged=!1}if(isNaN(He)||isNaN(Be))return;(He!==this.xterm.raw.cols||Be!==this.xterm.raw.rows)&&((this._fixedRows||this._fixedCols)&&await this._updateProperty("fixedDimensions",{cols:this._fixedCols,rows:this._fixedRows}),this._onDimensionsChanged.fire()),this.xterm.raw.resize(He,Be),Hi._lastKnownGridDimensions={cols:He,rows:Be},this._isVisible&&this.xterm.forceUnpause()}Fe?this._processManager.setDimensions(He,Be,!0):await this._processManager.setDimensions(He,Be)}setShellType(Fe){this._shellType=Fe,Fe&&this._terminalShellTypeContextKey.set(Fe?.toString())}_setAriaLabel(Fe,He,Be){if(Fe&&Fe.textarea){let ze;Be&&Be.length>0?ze=g.localize(19,null,He,Be):ze=g.localize(20,null,He);const nt=this._keybindingService.lookupKeybinding("workbench.action.terminal.navigationModeFocusPrevious")?.getLabel(),ut=this._keybindingService.lookupKeybinding("workbench.action.terminal.navigationModeFocusNext")?.getLabel();nt&&ut&&(ze+=`
${g.localize(21,null,nt,ut)}`),Fe.textarea.setAttribute("aria-label",ze)}}_updateTitleProperties(Fe,He){if(!Fe)return this._processName;switch(He){case W.TitleEventSource.Process:if(this._processManager.os===1)Fe=l.win32.parse(Fe).name;else{const Be=Fe.indexOf(" ");Fe.startsWith("/")?Fe=l.basename(Fe):Be>-1&&(Fe=Fe.substring(0,Be))}this._processName=Fe;break;case W.TitleEventSource.Api:this._staticTitle=Fe,(0,f.dispose)(this._messageTitleDisposable),this._messageTitleDisposable=void 0;break;case W.TitleEventSource.Sequence:this._sequence=Fe,this._processManager.os===1&&(Fe.match(/^[a-zA-Z]:\\.+\.[a-zA-Z]{1,3}/)?(Fe=l.win32.parse(Fe).name,this._sequence=Fe):this._sequence=void 0);break}return this._titleSource=He,Fe}setOverrideDimensions(Fe,He=!1){this._dimensionsOverride&&this._dimensionsOverride.forceExactSize&&!Fe&&this._rows===0&&this._cols===0&&(this._cols=this._dimensionsOverride.cols,this._rows=this._dimensionsOverride.rows),this._dimensionsOverride=Fe,He?this._resizeNow(!0):this._resize()}async setFixedDimensions(){const Fe=await this._quickInputService.input({title:g.localize(22,null),placeHolder:"Enter a number of columns or leave empty for automatic width",validateInput:async Be=>Be.length>0&&!Be.match(/^\d+$/)?{content:"Enter a number or leave empty size automatically",severity:N.Severity.Error}:void 0});if(Fe===void 0)return;this._fixedCols=this._parseFixedDimension(Fe),this._labelComputer?.refreshLabel(),this._terminalHasFixedWidth.set(!!this._fixedCols);const He=await this._quickInputService.input({title:g.localize(23,null),placeHolder:"Enter a number of rows or leave empty for automatic height",validateInput:async Be=>Be.length>0&&!Be.match(/^\d+$/)?{content:"Enter a number or leave empty size automatically",severity:N.Severity.Error}:void 0});He!==void 0&&(this._fixedRows=this._parseFixedDimension(He),this._labelComputer?.refreshLabel(),await this._refreshScrollbar(),this._resize(),this.focus())}_parseFixedDimension(Fe){if(Fe==="")return;const He=parseInt(Fe);if(He<=0)throw new Error(`Could not parse dimension "${Fe}"`);return He}async toggleSizeToContentWidth(){if(!!this.xterm?.raw.buffer.active){if(this._hasScrollBar)this._terminalHasFixedWidth.set(!1),this._fixedCols=void 0,this._fixedRows=void 0,this._hasScrollBar=!1,this._initDimensions(),await this._resize();else{const Fe=Math.max(this.maxCols,Math.min(this.xterm.getLongestViewportWrappedLineLength(),5e3));Fe>this.xterm.raw.cols&&(this._fixedCols=Fe)}await this._refreshScrollbar(),this._labelComputer?.refreshLabel(),this.focus()}}_refreshScrollbar(){return this._fixedCols||this._fixedRows?this._addScrollbar():this._removeScrollbar()}async _addScrollbar(){const Fe=(this.xterm?this.xterm.getFont():this._configHelper.getFont()).charWidth;if(!(!this.xterm?.raw.element||!this._container||!Fe||!this._fixedCols)&&(this._wrapperElement.classList.add("fixed-dims"),this._hasScrollBar=!0,this._initDimensions(),this._fixedRows=this._rows-1,await this._resize(),this._terminalHasFixedWidth.set(!0),this._horizontalScrollbar||(this._horizontalScrollbar=this._register(new E.DomScrollableElement(this._wrapperElement,{vertical:2,horizontal:1,useShadows:!1,scrollYToX:!1,consumeMouseWheelIfScrollbarIsNeeded:!1})),this._container.appendChild(this._horizontalScrollbar.getDomNode())),this._horizontalScrollbar.setScrollDimensions({width:this.xterm.raw.element.clientWidth,scrollWidth:this._fixedCols*Fe+40}),this._horizontalScrollbar.getDomNode().style.paddingBottom="16px",s.isWindows))for(let He=this.xterm.raw.buffer.active.viewportY;He<this.xterm.raw.buffer.active.length;He++){const Be=this.xterm.raw.buffer.active.getLine(He);Be._line.isWrapped=!1}}async _removeScrollbar(){!this._container||!this._horizontalScrollbar||(this._horizontalScrollbar.getDomNode().remove(),this._horizontalScrollbar.dispose(),this._horizontalScrollbar=void 0,this._wrapperElement.remove(),this._wrapperElement.classList.remove("fixed-dims"),this._container.appendChild(this._wrapperElement))}_setResolvedShellLaunchConfig(Fe){this._shellLaunchConfig.args=Fe.args,this._shellLaunchConfig.cwd=Fe.cwd,this._shellLaunchConfig.executable=Fe.executable,this._shellLaunchConfig.env=Fe.env}showEnvironmentInfoHover(){this._environmentInfo&&this._environmentInfo.widget.focus()}_onEnvironmentVariableInfoChanged(Fe){Fe.requiresAction&&this.xterm?.raw.textarea?.setAttribute("aria-label",g.localize(24,null,this._instanceId)),this._refreshEnvironmentVariableInfoWidgetState(Fe)}_refreshEnvironmentVariableInfoWidgetState(Fe){if(!Fe||this._configHelper.config.environmentChangesIndicator==="off"||this._configHelper.config.environmentChangesIndicator==="warnonly"&&!Fe.requiresAction||this._configHelper.config.environmentChangesIndicator==="on"&&!Fe.requiresAction){this.statusList.remove("relaunch-needed"),this._environmentInfo?.disposable.dispose(),this._environmentInfo=void 0;return}if(Fe.requiresAction&&this._configHelper.config.environmentChangesRelaunch&&!this._processManager.hasWrittenData&&(!this._shellLaunchConfig.isFeatureTerminal||this.reconnectionProperties&&this._configurationService.getValue("task.reconnection")===!0)&&!this._shellLaunchConfig.customPtyImplementation&&!this._shellLaunchConfig.isExtensionOwnedTerminal&&!this._shellLaunchConfig.attachPersistentProcess){this.relaunch();return}this._environmentInfo?.disposable.dispose();const He=this._scopedInstantiationService.createInstance(me.EnvironmentVariableInfoWidget,Fe),Be=this._widgetManager.attachWidget(He);Fe.requiresAction&&this.statusList.add({id:"relaunch-needed",severity:N.Severity.Warning,icon:b.Codicon.warning,tooltip:Fe.getInfo(),hoverActions:Fe.getActions?Fe.getActions():void 0}),Be&&(this._environmentInfo={widget:He,disposable:Be})}async toggleEscapeSequenceLogging(){const Fe=await this._xtermReadyPromise;return Fe.raw.options.logLevel=Fe.raw.options.logLevel==="debug"?"info":"debug",Fe.raw.options.logLevel==="debug"}async getInitialCwd(){return this._initialCwd||(this._initialCwd=await this._processManager.getInitialCwd()),this._initialCwd}async getCwd(){return this.capabilities.has(0)?this.capabilities.get(0).getCwd():this.capabilities.has(1)?this.capabilities.get(1).getCwd():await this._processManager.getInitialCwd()}async _refreshProperty(Fe){return await this.processReady,this._processManager.refreshProperty(Fe)}async _updateProperty(Fe,He){return this._processManager.updateProperty(Fe,He)}registerLinkProvider(Fe){if(!this._linkManager)throw new Error("TerminalInstance.registerLinkProvider before link manager was ready");return this._linkManager.registerExternalLinkProvider(Fe.provideLinks.bind(Fe,this))}async rename(Fe){this._setTitle(Fe,W.TitleEventSource.Api)}_setTitle(Fe,He){const Be=!Fe;Fe=this._updateTitleProperties(Fe,He);const ze=Fe!==this._title;this._title=Fe,this._labelComputer?.refreshLabel(Be),this._setAriaLabel(this.xterm?.raw,this._instanceId,this._title),ze&&this._onTitleChanged.fire(this)}async changeIcon(){const Fe=[];for(const Be of b.Codicon.getAll())Fe.push({label:`$(${Be.id})`,description:`${Be.id}`,icon:Be});const He=await this._quickInputService.pick(Fe,{matchOnDescription:!0});He&&(this._icon=He.icon,this._onIconChanged.fire({instance:this,userInitiated:!0}))}async changeColor(){if(!this._getIcon())return;const He=this._themeService.getColorTheme(),Be=(0,Z.getStandardColors)(He),ze=(0,Z.getColorStyleElement)(He),nt=[];for(const It of Be){const _t=(0,Z.getColorClass)(It);nt.push({label:`$(${b.Codicon.circleFilled.id}) ${It.replace("terminal.ansi","")}`,id:It,description:It,iconClasses:[_t]})}nt.push({type:"separator"});const ut={label:"Reset to default"};nt.push(ut),document.body.appendChild(ze);const ot=this._quickInputService.createQuickPick();ot.items=nt,ot.matchOnDescription=!0,ot.show();const at=[],wt=await new Promise(It=>{at.push(ot.onDidHide(()=>It(void 0))),at.push(ot.onDidAccept(()=>It(ot.selectedItems[0])))});(0,f.dispose)(at),wt&&(this.shellLaunchConfig.color=wt.id,this._onIconChanged.fire({instance:this,userInitiated:!0})),ot.hide(),document.body.removeChild(ze)}};Ke._instanceIdCounter=1,we([(0,S.debounce)(50)],Ke.prototype,"_fireMaximumDimensionsChanged",null),we([(0,S.debounce)(1e3)],Ke.prototype,"relaunch",null),we([(0,S.debounce)(2e3)],Ke.prototype,"_updateProcessCwd",null),we([(0,S.debounce)(50)],Ke.prototype,"_resize",null),Ke=we([F(5,D.IContextKeyService),F(6,_.IInstantiationService),F(7,De.ITerminalProfileResolverService),F(8,Ee.IPathService),F(9,M.IKeybindingService),F(10,N.INotificationService),F(11,Te.IPreferencesService),F(12,K.IViewsService),F(13,v.IClipboardService),F(14,G.IThemeService),F(15,w.IConfigurationService),F(16,O.ILogService),F(17,y.IDialogService),F(18,z.IStorageService),F(19,h.IAccessibilityService),F(20,B.IProductService),F(21,V.IQuickInputService),F(22,fe.IWorkbenchEnvironmentService),F(23,Q.IWorkspaceContextService),F(24,Pe.IEditorService),F(25,j.IWorkspaceTrustRequestService),F(26,ye.IHistoryService),F(27,x.ITelemetryService),F(28,P.IOpenerService),F(29,m.ICommandService),F(30,Y.IAudioCueService)],Ke),e.TerminalInstance=Ke;let We=class extends f.Disposable{get onDropFile(){return this._onDropFile.event}get onDropTerminal(){return this._onDropTerminal.event}constructor(Fe,He,Be){super(),this._container=Fe,this._layoutService=He,this._viewDescriptorService=Be,this._onDropFile=new r.Emitter,this._onDropTerminal=new r.Emitter,this._register((0,f.toDisposable)(()=>this._clearDropOverlay()))}_clearDropOverlay(){this._dropOverlay&&this._dropOverlay.parentElement&&this._dropOverlay.parentElement.removeChild(this._dropOverlay),this._dropOverlay=void 0}onDragEnter(Fe){if(!!(0,T.containsDragType)(Fe,R.DataTransfers.FILES,R.DataTransfers.RESOURCES,"Terminals",T.CodeDataTransfers.FILES)){if(this._dropOverlay||(this._dropOverlay=document.createElement("div"),this._dropOverlay.classList.add("terminal-drop-overlay")),(0,T.containsDragType)(Fe,"Terminals")){const He=this._getDropSide(Fe);this._dropOverlay.classList.toggle("drop-before",He==="before"),this._dropOverlay.classList.toggle("drop-after",He==="after")}this._dropOverlay.parentElement||this._container.appendChild(this._dropOverlay)}}onDragLeave(Fe){this._clearDropOverlay()}onDragEnd(Fe){this._clearDropOverlay()}onDragOver(Fe){if(!(!Fe.dataTransfer||!this._dropOverlay)){if((0,T.containsDragType)(Fe,"Terminals")){const He=this._getDropSide(Fe);this._dropOverlay.classList.toggle("drop-before",He==="before"),this._dropOverlay.classList.toggle("drop-after",He==="after")}this._dropOverlay.style.opacity="1"}}async onDrop(Fe){if(this._clearDropOverlay(),!Fe.dataTransfer)return;const He=(0,pe.getTerminalResourcesFromDragEvent)(Fe);if(He){for(const ut of He){const ot=this._getDropSide(Fe);this._onDropTerminal.fire({uri:ut,side:ot})}return}let Be;const ze=Fe.dataTransfer.getData(R.DataTransfers.RESOURCES);ze&&(Be=n.URI.parse(JSON.parse(ze)[0]).fsPath);const nt=Fe.dataTransfer.getData(T.CodeDataTransfers.FILES);!Be&&nt&&(Be=n.URI.file(JSON.parse(nt)[0]).fsPath),!Be&&Fe.dataTransfer.files.length>0&&Fe.dataTransfer.files[0].path&&(Be=n.URI.file(Fe.dataTransfer.files[0].path).fsPath),Be&&this._onDropFile.fire(Be)}_getDropSide(Fe){const He=this._container;if(!He)return"after";const Be=He.getBoundingClientRect();return this._getViewOrientation()===1?Fe.clientX-Be.left<Be.width/2?"before":"after":Fe.clientY-Be.top<Be.height/2?"before":"after"}_getViewOrientation(){const Fe=this._layoutService.getPanelPosition();return this._viewDescriptorService.getViewLocationById(De.TERMINAL_VIEW_ID)===1&&Fe===2?1:0}};We=we([F(1,ke.IWorkbenchLayoutService),F(2,K.IViewDescriptorService)],We),(0,G.registerThemingParticipant)((Ue,Fe)=>{const He=Ue.getColor(q.activeContrastBorder);He&&Fe.addRule(`
			.monaco-workbench.hc-black .editor-instance .xterm.focus::before,
			.monaco-workbench.hc-black .pane-body.integrated-terminal .xterm.focus::before,
			.monaco-workbench.hc-black .editor-instance .xterm:focus::before,
			.monaco-workbench.hc-black .pane-body.integrated-terminal .xterm:focus::before,
			.monaco-workbench.hc-light .editor-instance .xterm.focus::before,
			.monaco-workbench.hc-light .pane-body.integrated-terminal .xterm.focus::before,
			.monaco-workbench.hc-light .editor-instance .xterm:focus::before,
			.monaco-workbench.hc-light .pane-body.integrated-terminal .xterm:focus::before { border-color: ${He}; }`);const Be=Ue.getColor(q.scrollbarSliderBackground);Be&&Fe.addRule(`
			.monaco-workbench .editor-instance .find-focused .xterm .xterm-viewport,
			.monaco-workbench .pane-body.integrated-terminal .find-focused .xterm .xterm-viewport,
			.monaco-workbench .editor-instance .xterm.focus .xterm-viewport,
			.monaco-workbench .pane-body.integrated-terminal .xterm.focus .xterm-viewport,
			.monaco-workbench .editor-instance .xterm:focus .xterm-viewport,
			.monaco-workbench .pane-body.integrated-terminal .xterm:focus .xterm-viewport,
			.monaco-workbench .editor-instance .xterm:hover .xterm-viewport,
			.monaco-workbench .pane-body.integrated-terminal .xterm:hover .xterm-viewport { background-color: ${Be} !important; }
			.monaco-workbench .editor-instance .xterm-viewport,
			.monaco-workbench .pane-body.integrated-terminal .xterm-viewport { scrollbar-color: ${Be} transparent; }
		`);const ze=Ue.getColor(q.scrollbarSliderHoverBackground);ze&&Fe.addRule(`
			.monaco-workbench .editor-instance .xterm .xterm-viewport::-webkit-scrollbar-thumb:hover,
			.monaco-workbench .pane-body.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:hover { background-color: ${ze}; }
			.monaco-workbench .editor-instance .xterm-viewport:hover,
			.monaco-workbench .pane-body.integrated-terminal .xterm-viewport:hover { scrollbar-color: ${ze} transparent; }
		`);const nt=Ue.getColor(q.scrollbarSliderActiveBackground);nt&&Fe.addRule(`
			.monaco-workbench .editor-instance .xterm .xterm-viewport::-webkit-scrollbar-thumb:active,
			.monaco-workbench .pane-body.integrated-terminal .xterm .xterm-viewport::-webkit-scrollbar-thumb:active { background-color: ${nt}; }
		`)});var Xe;(function(Ue){Ue.Title="title",Ue.Description="description"})(Xe||(Xe={}));let Je=class extends f.Disposable{get title(){return this._title}get description(){return this._description}constructor(Fe,He,Be){super(),this._configHelper=Fe,this._instance=He,this._workspaceContextService=Be,this._title="",this._description="",this._onDidChangeLabel=this._register(new r.Emitter),this.onDidChangeLabel=this._onDidChangeLabel.event}refreshLabel(Fe){this._title=this.computeLabel(this._configHelper.config.tabs.title,"title",Fe),this._description=this.computeLabel(this._configHelper.config.tabs.description,"description"),(this._title!==this._instance.title||this._description!==this._instance.description||Fe)&&this._onDidChangeLabel.fire({title:this._title,description:this._description})}computeLabel(Fe,He,Be){const ze=this._instance.shellLaunchConfig.attachPersistentProcess?.type||this._instance.shellLaunchConfig.type,nt={cwd:this._instance.cwd||this._instance.initialCwd||"",cwdFolder:"",workspaceFolder:this._instance.workspaceFolder?l.basename(this._instance.workspaceFolder.uri.fsPath):void 0,local:ze==="Local"?ze:void 0,process:this._instance.processName,sequence:this._instance.sequence,task:ze==="Task"?ze:void 0,fixedDimensions:this._instance.fixedCols?this._instance.fixedRows?`\u2194${this._instance.fixedCols} \u2195${this._instance.fixedRows}`:`\u2194${this._instance.fixedCols}`:this._instance.fixedRows?`\u2195${this._instance.fixedRows}`:"",separator:{label:this._configHelper.config.tabs.separator}};if(Fe=Fe.trim(),!Fe)return He==="title"&&this._instance.processName||"";if(!Be&&this._instance.staticTitle&&He==="title")return this._instance.staticTitle.replace(/[\n\r\t]/g,"")||nt.process?.replace(/[\n\r\t]/g,"")||"";const ut=this._instance.capabilities.has(0)||this._instance.capabilities.has(1),at=this._workspaceContextService.getWorkspace().folders.length>1;if(nt.cwd&&ut&&(!this._instance.shellLaunchConfig.isFeatureTerminal||He==="title")){const It=n.URI.from({scheme:this._instance.workspaceFolder?.uri.scheme||c.Schemas.file,path:this._instance.cwd});(at||It.fsPath!==this._instance.workspaceFolder?.uri.fsPath)&&(nt.cwdFolder=l.basename(nt.cwd))}const wt=(0,u.template)(Fe,nt).replace(/[\n\r\t]/g,"").trim();return wt===""&&He==="title"?this._instance.processName||"":wt}};Je=we([F(2,Q.IWorkspaceContextService)],Je),e.TerminalLabelComputer=Je;function rt(Ue,Fe,He,Be){if(Ue===void 0||Ue===0)return{code:Ue,message:void 0};const ze=typeof Ue=="number"?Ue:Ue.code;let nt;switch(typeof Ue){case"number":{let ut;Fe.executable&&(ut=Fe.executable,typeof Fe.args=="string"?ut+=` ${Fe.args}`:Fe.args&&Fe.args.length&&(ut+=Fe.args.map(ot=>` '${ot}'`).join())),He===4?ut?nt=g.localize(25,null,ut,ze):nt=g.localize(26,null,ze):ut?nt=g.localize(27,null,ut,ze):nt=g.localize(28,null,ze);break}case"object":{if(Ue.message.toString().includes("Could not find pty with id"))break;let ut=Ue.message;const ot=Ue.message.match(/.*error code:\s*(\d+).*$/);if(ot)switch(ot.length>1?parseInt(ot[1]):void 0){case 5:ut=`Access was denied to the path containing your executable "${Fe.executable}". Manage and change your permissions to get this to work`;break;case 267:ut=`Invalid starting directory "${Be}", review your terminal.integrated.cwd setting`;break;case 1260:ut="Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system Administrator";break}nt=g.localize(29,null,ut);break}}return{code:ze,message:nt}}e.parseExitResult=rt;async function je(Ue,Fe,He,Be,ze,nt){return new Promise(ut=>{if(!Fe){ut(Ue);return}const ot=Ue.indexOf(" ")!==-1,at=Ue.indexOf("(")!==-1||Ue.indexOf(")")!==-1,wt=l.basename(Fe,".exe"),It=wt==="pwsh"||He==="pwsh"||wt==="powershell"||He==="powershell";if(It&&(ot||Ue.indexOf("'")!==-1)){ut(`& '${Ue.replace(/'/g,"''")}'`);return}if(at&&It){ut(`& '${Ue}'`);return}if(nt===1){if(Be!==void 0)ut(Be==="gitbash"?Ue.replace(/\\/g,"/"):Be==="wsl"?ze?.getWslPath(Ue)||Ue:ot?'"'+Ue+'"':Ue);else{const _t=Fe.toLowerCase();_t.indexOf("wsl")!==-1||_t.indexOf("bash.exe")!==-1&&_t.toLowerCase().indexOf("git")===-1?ut(ze?.getWslPath(Ue)||Ue):ut(ot?'"'+Ue+'"':Ue)}return}ut((0,U.escapeNonWindowsPath)(Ue))})}}),define(ae[3003],le([1,0,16,11,112,6,2,14,8,7,615,509,109,475,189,672,51,39,104]),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.TerminalProfileService=void 0;let d=class{get onDidChangeAvailableProfiles(){return this._onDidChangeAvailableProfiles.event}get profilesReady(){return this._profilesReadyBarrier.wait().then(()=>{})}get availableProfiles(){return this._platformConfigJustRefreshed||this.refreshAvailableProfiles(),this._availableProfiles||[]}get contributedProfiles(){return this._contributedProfiles||[]}constructor(g,h,v,m,w,D,y){this._contextKeyService=g,this._configurationService=h,this._terminalContributionService=v,this._extensionService=m,this._remoteAgentService=w,this._environmentService=D,this._terminalInstanceService=y,this._contributedProfiles=[],this._platformConfigJustRefreshed=!1,this._profileProviders=new Map,this._onDidChangeAvailableProfiles=new A.Emitter,this._extensionService.onDidChangeExtensions(()=>this.refreshAvailableProfiles()),this._webExtensionContributedProfileContextKey=i.TerminalContextKeys.webExtensionContributedProfile.bindTo(this._contextKeyService),this._updateWebContextKey(),this._profilesReadyBarrier=new p.AutoOpenBarrier(2e4),this.refreshAvailableProfiles(),this._setupConfigListener()}async _setupConfigListener(){const g=await this.getPlatformKey();this._configurationService.onDidChangeConfiguration(async h=>{(h.affectsConfiguration("terminal.integrated.defaultProfile."+g)||h.affectsConfiguration("terminal.integrated.profiles."+g)||h.affectsConfiguration("terminal.integrated.useWslProfiles"))&&(h.source!==7?(this.refreshAvailableProfiles(),this._platformConfigJustRefreshed=!1):this._platformConfigJustRefreshed=!0)})}getDefaultProfileName(){return this._defaultProfileName}refreshAvailableProfiles(){this._refreshAvailableProfilesNow()}async _refreshAvailableProfilesNow(){const g=await this._detectProfiles(!0),h=!(0,t.equals)(g,this._availableProfiles,n),v=await this._updateContributedProfiles();(h||v)&&(this._availableProfiles=g,this._onDidChangeAvailableProfiles.fire(this._availableProfiles),this._profilesReadyBarrier.open(),this._updateWebContextKey(),await this._refreshPlatformConfig(this._availableProfiles))}async _updateContributedProfiles(){const g=await this.getPlatformKey(),h=[],v=this._configurationService.getValue("terminal.integrated.profiles."+g);for(const[D,y]of Object.entries(v))y===null&&h.push(D);const m=Array.from(this._terminalContributionService.terminalProfiles.filter(D=>!h.includes(D.title))),w=!(0,t.equals)(m,this._contributedProfiles,a);return this._contributedProfiles=m,w}getContributedProfileProvider(g,h){return this._profileProviders.get(g)?.get(h)}async _detectProfiles(g){const h=await this._terminalInstanceService.getBackend(this._environmentService.remoteAuthority);if(!h)return this._availableProfiles||[];const v=await this.getPlatformKey();return this._defaultProfileName=this._configurationService.getValue(`terminal.integrated.defaultProfile.${v}`)??void 0,h.getProfiles(this._configurationService.getValue(`terminal.integrated.profiles.${v}`),this._defaultProfileName,g)}_updateWebContextKey(){this._webExtensionContributedProfileContextKey.set(E.isWeb&&this._contributedProfiles.length>0)}async _refreshPlatformConfig(g){const h=await this._remoteAgentService.getEnvironment();(0,S.registerTerminalDefaultProfileConfiguration)({os:h?.os||E.OS,profiles:g},this._contributedProfiles),(0,u.refreshTerminalActions)(g)}async getPlatformKey(){const g=await this._remoteAgentService.getEnvironment();return g?g.os===1?"windows":g.os===2?"osx":"linux":E.isWindows?"windows":E.isMacintosh?"osx":"linux"}registerTerminalProfileProvider(g,h,v){let m=this._profileProviders.get(g);return m||(m=new Map,this._profileProviders.set(g,m)),m.set(h,v),(0,k.toDisposable)(()=>this._profileProviders.delete(h))}async registerContributedProfile(g){const h=await this.getPlatformKey(),v=await this._configurationService.getValue(`terminal.integrated.profiles.${h}`);if(typeof v=="object"){const m={extensionIdentifier:g.extensionIdentifier,icon:g.options.icon,id:g.id,title:g.title,color:g.options.color};v[g.title]=m}await this._configurationService.updateValue(`terminal.integrated.profiles.${h}`,v,2)}async getContributedDefaultProfile(g){if(g&&!g.extHostTerminalId&&!("executable"in g)){const h=await this.getPlatformKey(),v=this._configurationService.getValue(`terminal.integrated.defaultProfile.${h}`);return this.contributedProfiles.find(w=>w.title===v)}}};we([(0,R.throttle)(2e3)],d.prototype,"refreshAvailableProfiles",null),d=we([F(0,b.IContextKeyService),F(1,I.IConfigurationService),F(2,f.ITerminalContributionService),F(3,l.IExtensionService),F(4,s.IRemoteAgentService),F(5,c.IWorkbenchEnvironmentService),F(6,r.ITerminalInstanceService)],d),e.TerminalProfileService=d;function n(o,g){return o.profileName===g.profileName&&(0,C.terminalProfileArgsMatch)(o.args,g.args)&&o.color===g.color&&(0,C.terminalIconsEqual)(o.icon,g.icon)&&o.isAutoDetected===g.isAutoDetected&&o.isDefault===g.isDefault&&o.overrideName===g.overrideName&&o.path===g.path}function a(o,g){return o.extensionIdentifier===g.extensionIdentifier&&o.color===g.color&&o.icon===g.icon&&o.id===g.id&&o.title===g.title}}),define(ae[1014],le([1,0,1909,10,36,8,37,5,27,12,475,289,26,109,129,38,7,45,41,80,15,127,185,137,73,33,2803,31,143,652,84,440,2,9,126,290,13,670,189,891]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TerminalViewPane=void 0;let x=class extends i.ViewPane{get terminalTabbedView(){return this._terminalTabbedView}constructor(j,K,Y,ee,ie,re,oe,se,te,Z,ne,ce,de,he,pe,me,Se,Ie){super(j,K,re,ie,Y,ee,oe,he,Z,ne),this._contextKeyService=Y,this._configurationService=ie,this._contextMenuService=re,this._instantiationService=oe,this._terminalService=se,this._terminalGroupService=te,this._notificationService=ce,this._keybindingService=de,this._menuService=pe,this._terminalProfileService=me,this._terminalProfileResolverService=Se,this._themeService=Ie,this._terminalsInitialized=!1,this._isWelcomeShowing=!1,this._register(this._terminalService.onDidRegisterProcessSupport(()=>{if(this._actions)for(const ve of this._actions)ve.enabled=!0;this._onDidChangeViewWelcomeState.fire()})),this._register(this._terminalService.onDidChangeInstances(()=>{!this._isWelcomeShowing||(this._isWelcomeShowing=!0,this._onDidChangeViewWelcomeState.fire(),!this._terminalTabbedView&&this._parentDomElement&&(this._createTabsView(),this.layoutBody(this._parentDomElement.offsetHeight,this._parentDomElement.offsetWidth)))})),this._dropdownMenu=this._register(this._menuService.createMenu(n.MenuId.TerminalNewDropdownContext,this._contextKeyService)),this._singleTabMenu=this._register(this._menuService.createMenu(n.MenuId.TerminalInlineTabContext,this._contextKeyService)),this._register(this._terminalProfileService.onDidChangeAvailableProfiles(ve=>this._updateTabActionBar(ve))),this._viewShowing=V.TerminalContextKeys.viewShowing.bindTo(this._contextKeyService),this._register(this.onDidChangeBodyVisibility(ve=>{ve&&this._terminalTabbedView?.rerenderTabs()})),this._register(this._configurationService.onDidChangeConfiguration(ve=>{this._parentDomElement&&(ve.affectsConfiguration("terminal.integrated.shellIntegration.decorationsEnabled")||ve.affectsConfiguration("terminal.integrated.shellIntegration.enabled"))&&this._updateForShellIntegration(this._parentDomElement)})),this._register(this._terminalService.onDidCreateInstance(ve=>{ve.capabilities.onDidAddCapability(be=>{be===2&&this._gutterDecorationsEnabled()&&this._parentDomElement?.classList.add("shell-integration")})}))}_updateForShellIntegration(j){j.classList.toggle("shell-integration",this._gutterDecorationsEnabled())}_gutterDecorationsEnabled(){const j=this._configurationService.getValue("terminal.integrated.shellIntegration.decorationsEnabled");return(j==="both"||j==="gutter")&&this._configurationService.getValue("terminal.integrated.shellIntegration.enabled")}renderBody(j){super.renderBody(j),this._parentDomElement||this._updateForShellIntegration(j),this._parentDomElement=j,this._parentDomElement.classList.add("integrated-terminal"),this._fontStyleElement=document.createElement("style"),this._instantiationService.createInstance(G,this._parentDomElement),this.shouldShowWelcome()||this._createTabsView(),this._parentDomElement.appendChild(this._fontStyleElement),this._register(this.configurationService.onDidChangeConfiguration(K=>{if((K.affectsConfiguration("terminal.integrated.fontFamily")||K.affectsConfiguration("editor.fontFamily"))&&!this._terminalService.configHelper.configFontIsMonospace()){const ee=[{label:t.localize(0,null),run:()=>this.configurationService.updateValue("terminal.integrated.fontFamily","monospace")}];this._notificationService.prompt(r.Severity.Warning,t.localize(1,null),ee)}})),this._register(this.onDidChangeBodyVisibility(async K=>{if(this._viewShowing.set(K),K){const Y=!!this._terminalGroupService.groups.length;await this._terminalService.primaryBackendRegistered,this._terminalService.isProcessSupportRegistered?this._terminalsInitialized?Y||this._terminalService.createTerminal({location:o.TerminalLocation.Panel}):(this._terminalsInitialized=!0,this._terminalService.initializeTerminals()):this._onDidChangeViewWelcomeState.fire(),this._terminalGroupService.showPanel(!1)}else for(const Y of this._terminalGroupService.instances)Y.resetFocusContextKey();this._terminalGroupService.updateVisibility()})),this.layoutBody(this._parentDomElement.offsetHeight,this._parentDomElement.offsetWidth)}_createTabsView(){!this._parentDomElement||(this._terminalTabbedView=this.instantiationService.createInstance(m.TerminalTabbedView,this._parentDomElement))}layoutBody(j,K){super.layoutBody(j,K),this._terminalTabbedView?.layout(K,j)}getActionViewItem(j){switch(j.id){case"workbench.action.terminal.split":{const K=this,Y=new class extends R.Action{constructor(){super(j.id,j.label,j.class,j.enabled),this.checked=j.checked,this.tooltip=j.tooltip}dispose(){j.dispose()}async run(){const ee=K._terminalGroupService.activeInstance;if(ee)return(await K._terminalService.createTerminal({location:{parentTerminal:ee}}))?.focusWhenReady()}};return new g.ActionViewItem(j,Y,{icon:!0,label:!1,keybinding:this._getKeybindingLabel(j)})}case"workbench.action.terminal.switchTerminal":return this._instantiationService.createInstance(H,j);case"workbench.action.terminal.focus":if(j instanceof n.MenuItemAction){const K=[];return(0,T.createAndFillInContextMenuActions)(this._singleTabMenu,void 0,K),this._instantiationService.createInstance(U,j,K)}case"workbench.action.terminal.new":if(j instanceof n.MenuItemAction){const K=(0,B.getTerminalActionBarArgs)(o.TerminalLocation.Panel,this._terminalProfileService.availableProfiles,this._getDefaultProfileName(),this._terminalProfileService.contributedProfiles,this._terminalService,this._dropdownMenu);return this._newDropdown?.dispose(),this._newDropdown=new _.DropdownWithPrimaryActionViewItem(j,K.dropdownAction,K.dropdownMenuActions,K.className,this._contextMenuService,{},this._keybindingService,this._notificationService,this._contextKeyService,this._themeService),this._updateTabActionBar(this._terminalProfileService.availableProfiles),this._newDropdown}}return super.getActionViewItem(j)}_getDefaultProfileName(){let j;try{j=this._terminalProfileService.getDefaultProfileName()}catch{j=this._terminalProfileResolverService.defaultProfileName}return j}_getKeybindingLabel(j){return(0,P.withNullAsUndefined)(this._keybindingService.lookupKeybinding(j.id)?.getLabel())}_updateTabActionBar(j){const K=(0,B.getTerminalActionBarArgs)(o.TerminalLocation.Panel,j,this._getDefaultProfileName(),this._terminalProfileService.contributedProfiles,this._terminalService,this._dropdownMenu);this._newDropdown?.update(K.dropdownAction,K.dropdownMenuActions)}focus(){if(this._terminalService.connectionState===0){const j=document.activeElement;this._register(this._terminalService.onDidChangeConnectionState(()=>{document.activeElement===j&&this._terminalGroupService.showPanel(!0)}));return}this._terminalGroupService.showPanel(!0)}shouldShowWelcome(){return this._isWelcomeShowing=!this._terminalService.isProcessSupportRegistered&&this._terminalService.instances.length===0,this._isWelcomeShowing}};x=we([F(1,f.IKeybindingService),F(2,c.IContextKeyService),F(3,l.IViewDescriptorService),F(4,A.IConfigurationService),F(5,k.IContextMenuService),F(6,E.IInstantiationService),F(7,u.ITerminalService),F(8,u.ITerminalGroupService),F(9,b.IThemeService),F(10,I.ITelemetryService),F(11,r.INotificationService),F(12,f.IKeybindingService),F(13,s.IOpenerService),F(14,n.IMenuService),F(15,a.ITerminalProfileService),F(16,a.ITerminalProfileResolverService),F(17,b.IThemeService)],x),e.TerminalViewPane=x,(0,b.registerThemingParticipant)((Q,j)=>{const K=Q.getColor(C.TERMINAL_BACKGROUND_COLOR)||Q.getColor(d.PANEL_BACKGROUND);K&&j.addRule(`.monaco-workbench .part.panel .pane-body.integrated-terminal .terminal-outer-container { background-color: ${K.toString()}; }`);const Y=Q.getColor(C.TERMINAL_BACKGROUND_COLOR)||Q.getColor(d.SIDE_BAR_BACKGROUND);Y&&(j.addRule(`.monaco-workbench .part.sidebar .pane-body.integrated-terminal .terminal-outer-container { background-color: ${Y.toString()}; }`),j.addRule(`.monaco-workbench .part.auxiliarybar .pane-body.integrated-terminal .terminal-outer-container { background-color: ${Y.toString()}; }`));const ee=Q.getColor(C.TERMINAL_BORDER_COLOR);ee&&(j.addRule(`.monaco-workbench .pane-body.integrated-terminal .split-view-view:not(:first-child) { border-color: ${ee.toString()}; }`),j.addRule(`.monaco-workbench .pane-body.integrated-terminal .tabs-container { border-color: ${ee.toString()}; }`));const ie=Q.getColor(C.TERMINAL_DRAG_AND_DROP_BACKGROUND)||Q.getColor(d.EDITOR_DRAG_AND_DROP_BACKGROUND);ie&&j.addRule(`.monaco-workbench .pane-body.integrated-terminal .terminal-drop-overlay { background-color: ${ie.toString()}; }`);const re=Q.getColor(C.TERMINAL_TAB_ACTIVE_BORDER);re&&j.addRule(`.monaco-workbench .pane-body.integrated-terminal .terminal-tabs-entry.is-active::before { background-color: ${re.toString()}; }`)});let H=class extends g.SelectActionViewItem{constructor(j,K,Y,ee,ie,re){super(null,j,W(K,Y),Y.activeGroupIndex,ie,{ariaLabel:t.localize(2,null),optionsAsChildren:!0}),this._terminalService=K,this._terminalGroupService=Y,this._themeService=ee,this._register(K.onDidChangeInstances(()=>this._updateItems(),this)),this._register(K.onDidChangeActiveGroup(()=>this._updateItems(),this)),this._register(K.onDidChangeActiveInstance(()=>this._updateItems(),this)),this._register(K.onDidChangeInstanceTitle(()=>this._updateItems(),this)),this._register(Y.onDidChangeGroups(()=>this._updateItems(),this)),this._register(K.onDidChangeConnectionState(()=>this._updateItems(),this)),this._register(re.onDidChangeAvailableProfiles(()=>this._updateItems(),this)),this._register(K.onDidChangeInstancePrimaryStatus(()=>this._updateItems(),this)),this._register((0,h.attachSelectBoxStyler)(this.selectBox,this._themeService))}render(j){super.render(j),j.classList.add("switch-terminal"),this._register((0,h.attachStylerCallback)(this._themeService,{selectBorder:v.selectBorder},K=>{j.style.borderColor=K.selectBorder?`${K.selectBorder}`:""}))}_updateItems(){const j=W(this._terminalService,this._terminalGroupService);this.setOptions(j,this._terminalGroupService.activeGroupIndex)}};H=we([F(1,u.ITerminalService),F(2,u.ITerminalGroupService),F(3,b.IThemeService),F(4,k.IContextViewService),F(5,a.ITerminalProfileService)],H);function W(Q,j){let K;return Q.connectionState===1?K=j.getGroupLabels().map(Y=>({text:Y})):K=[{text:t.localize(3,null)}],K.push({text:S.switchTerminalActionViewItemSeparator,isDisabled:!0}),K.push({text:S.switchTerminalShowTabsTitle}),K}let U=class extends T.MenuEntryActionViewItem{constructor(j,K,Y,ee,ie,re,oe,se,te,Z,ne){super(j,{draggable:!0},Y,ee,ie,re,te),this._actions=K,this._terminalService=oe,this._terminalGroupService=se,this._commandService=Z,this._instantiationService=ne,this._elementDisposables=[],this._register(this._terminalService.onDidChangeInstancePrimaryStatus(ce=>this.updateLabel(ce))),this._register(this._terminalGroupService.onDidChangeActiveInstance(()=>this.updateLabel())),this._register(this._terminalService.onDidChangeInstanceIcon(ce=>this.updateLabel(ce.instance))),this._register(this._terminalService.onDidChangeInstanceColor(ce=>this.updateLabel(ce.instance))),this._register(this._terminalService.onDidChangeInstanceTitle(ce=>{ce===this._terminalGroupService.activeInstance&&(this._action.tooltip=q(ce,this._terminalService.configHelper.config.tabs.separator),this.updateLabel())})),this._register(this._terminalService.onDidChangeInstanceCapability(ce=>{this._action.tooltip=q(ce,this._terminalService.configHelper.config.tabs.separator),this.updateLabel(ce)})),this._register((0,L.toDisposable)(()=>(0,L.dispose)(this._elementDisposables)))}async onClick(j){j.altKey&&this._menuItemAction.alt?this._commandService.executeCommand(this._menuItemAction.alt.id,{target:o.TerminalLocation.Panel}):this._openContextMenu()}updateLabel(j){if(!(j&&j!==this._terminalGroupService.activeInstance)&&(this._elementDisposables.length===0&&this.element&&this.label&&(this._elementDisposables.push(p.addDisposableListener(this.element,p.EventType.CONTEXT_MENU,K=>{K.button===2&&(this._openContextMenu(),K.preventDefault())})),this._elementDisposables.push(p.addDisposableListener(this.element,p.EventType.AUXCLICK,K=>{if(K.button===1){const Y=this._terminalGroupService.activeInstance;Y&&this._terminalService.safeDisposeTerminal(Y),K.preventDefault()}})),this._elementDisposables.push(p.addDisposableListener(this.element,p.EventType.DRAG_START,K=>{const Y=this._terminalGroupService.activeInstance;K.dataTransfer&&Y&&K.dataTransfer.setData("Terminals",JSON.stringify([Y.resource.toString()]))}))),this.label)){const K=this.label,Y=this._terminalGroupService.activeInstance;if(!Y){p.reset(K,"");return}K.classList.add("single-terminal-tab");let ee="";const ie=Y.statusList.primary;if(ie){const se=(0,y.getColorForSeverity)(ie.severity);this._themeService.getColorTheme();const te=this._themeService.getColorTheme().getColor(se);te&&(ee=te.toString())}K.style.color=ee,p.reset(K,...(0,D.renderLabelWithIcons)(this._instantiationService.invokeFunction($,Y,this._terminalService.configHelper.config.tabs.separator,b.ThemeIcon.isThemeIcon(this._commandAction.item.icon)?this._commandAction.item.icon:void 0))),this._altCommand&&(K.classList.remove(this._altCommand),this._altCommand=void 0),this._color&&(K.classList.remove(this._color),this._color=void 0),this._class&&(K.classList.remove(this._class),K.classList.remove("terminal-uri-icon"),this._class=void 0);const re=(0,N.getColorClass)(Y);re&&(this._color=re,K.classList.add(re));const oe=(0,N.getUriClasses)(Y,this._themeService.getColorTheme().type);oe&&(this._class=oe?.[0],K.classList.add(...oe)),this._commandAction.item.icon&&(this._altCommand="alt-command",K.classList.add(this._altCommand)),this.updateTooltip()}}_openContextMenu(){this._contextMenuService.showContextMenu({getAnchor:()=>this.element,getActions:()=>this._actions,getActionsContext:()=>this.label})}};U=we([F(2,f.IKeybindingService),F(3,r.INotificationService),F(4,c.IContextKeyService),F(5,b.IThemeService),F(6,u.ITerminalService),F(7,u.ITerminalGroupService),F(8,k.IContextMenuService),F(9,w.ICommandService),F(10,E.IInstantiationService)],U);function $(Q,j,K,Y){if(!j||!j.title)return"";const ee=b.ThemeIcon.isThemeIcon(j.icon)?j.icon.id:Q.get(a.ITerminalProfileResolverService).getDefaultIcon(),ie=`$(${Y?.id||ee}) ${X(j,K)}`,re=j.statusList.primary;return re?.icon?`${ie} $(${re.icon.id})`:ie}function q(Q,j){if(!Q)return"";const K=(0,z.getShellIntegrationTooltip)(Q,!1),Y=X(Q,j);return K?Y+K:Y}function X(Q,j){return Q?Q.description?`${Q.title} ${j} ${Q.description}`:Q.title:""}let G=class extends b.Themable{constructor(j,K,Y,ee){super(K),this._themeService=K,this._terminalService=Y,this._terminalGroupService=ee,this._registerListeners(),this._styleElement=document.createElement("style"),j.appendChild(this._styleElement),this._register((0,L.toDisposable)(()=>j.removeChild(this._styleElement))),this.updateStyles()}_registerListeners(){this._register(this._terminalService.onDidChangeInstanceIcon(()=>this.updateStyles())),this._register(this._terminalService.onDidChangeInstanceColor(()=>this.updateStyles())),this._register(this._terminalService.onDidChangeInstances(()=>this.updateStyles())),this._register(this._terminalGroupService.onDidChangeGroups(()=>this.updateStyles()))}updateStyles(){super.updateStyles();const j=this._themeService.getColorTheme();let K="";for(const Y of this._terminalService.instances){const ee=Y.icon;if(!ee)continue;let ie;ee instanceof M.URI?ie=ee:ee instanceof Object&&"light"in ee&&"dark"in ee&&(ie=j.type===O.ColorScheme.LIGHT?ee.light:ee.dark);const re=(0,N.getUriClasses)(Y,j.type);ie instanceof M.URI&&re&&re.length>1&&(K+=`.monaco-workbench .${re[0]} .monaco-highlighted-label .codicon, .monaco-action-bar .terminal-uri-icon.single-terminal-tab.action-label:not(.alt-command) .codicon{background-image: ${p.asCSSUrl(ie)};}`)}for(const Y of this._terminalService.instances){const ee=(0,N.getColorClass)(Y);if(!ee||!Y.color)continue;const ie=j.getColor(Y.color);ie&&(K+=`.monaco-workbench .${ee} .codicon:first-child:not(.codicon-split-horizontal):not(.codicon-trashcan):not(.file-icon){ color: ${ie} !important; }`)}this._styleElement.textContent=K}};G=we([F(1,b.IThemeService),F(2,u.ITerminalService),F(3,u.ITerminalGroupService)],G)}),define(ae[3004],le([1,0,1930,8,37,5,23,27,12,34,163,45,39,83]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TestingViewPaneContainer=void 0;let i=class extends S.ViewPaneContainer{constructor(c,l,s,d,n,a,o,g,h,v){super("workbench.view.extension.test",{mergeViewWithContainerWhenSingleView:!0},s,o,c,d,l,g,n,a,h,v)}create(c){super.create(c),c.classList.add("testing-view-pane")}getOptimalWidth(){return 400}getTitle(){return(0,t.localize)(0,null)}};i=we([F(0,u.IWorkbenchLayoutService),F(1,E.ITelemetryService),F(2,A.IInstantiationService),F(3,R.IContextMenuService),F(4,I.IThemeService),F(5,k.IStorageService),F(6,p.IConfigurationService),F(7,r.IExtensionService),F(8,b.IWorkspaceContextService),F(9,C.IViewDescriptorService)],i),e.TestingViewPaneContainer=i}),define(ae[3005],le([1,0,40,1922,15,31,55,7,19,97,35,41,66,17,44,45,312,313,2421,2863,2469,656,951,3004,346,536,229,2422,315,896,537,271,247,898,291,2470,2693,2419]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(0,S.registerSingleton)(O.ITestService,N.TestService,1),(0,S.registerSingleton)(M.ITestResultStorage,M.TestResultStorage,1),(0,S.registerSingleton)(_.ITestProfileService,_.TestProfileService,1),(0,S.registerSingleton)(L.ITestResultService,L.TestResultService,1),(0,S.registerSingleton)(v.ITestExplorerFilterState,v.TestExplorerFilterState,1),(0,S.registerSingleton)(a.ITestingOutputTerminalService,a.TestingOutputTerminalService,1),(0,S.registerSingleton)(T.ITestingPeekOpener,n.TestingPeekOpener,1),(0,S.registerSingleton)(o.ITestingProgressUiService,o.TestingProgressUiService,1),(0,S.registerSingleton)(y.ITestingDecorationsService,s.TestingDecorationService,1);const B=u.Registry.as(f.Extensions.ViewContainersRegistry).registerViewContainer({id:"workbench.view.extension.test",title:(0,p.localize)(0,null),ctorDescriptor:new b.SyncDescriptor(g.TestingViewPaneContainer),icon:l.testingViewIcon,alwaysUseContainerInfo:!0,order:6,openCommandActionDescriptor:{id:"workbench.view.extension.test",mnemonicTitle:(0,p.localize)(1,null),order:4},hideIfEmpty:!0},0),V=u.Registry.as(f.Extensions.ViewsRegistry);V.registerViewWelcomeContent("workbench.view.testing",{content:(0,p.localize)(2,null)}),V.registerViewWelcomeContent("workbench.view.testing",{content:"["+(0,p.localize)(3,null)+"](command:testing.searchForTestExtension)",order:10}),V.registerViews([{id:"workbench.view.testing",name:(0,p.localize)(4,null),ctorDescriptor:new b.SyncDescriptor(d.TestingExplorerView),canToggleVisibility:!0,canMoveView:!0,weight:80,order:-999,containerIcon:l.testingViewIcon,when:E.ContextKeyExpr.greater(D.TestingContextKeys.providerCount.key,0)}],B),P.allTestActions.forEach(R.registerAction2),(0,R.registerAction2)(n.OpenMessageInEditorAction),(0,R.registerAction2)(n.GoToPreviousMessageAction),(0,R.registerAction2)(n.GoToNextMessageAction),(0,R.registerAction2)(n.CloseTestPeek),(0,R.registerAction2)(n.ToggleTestingPeekHistory),u.Registry.as(i.Extensions.Workbench).registerWorkbenchContribution(w.TestingContentProvider,3),u.Registry.as(i.Extensions.Workbench).registerWorkbenchContribution(n.TestingPeekOpener,4),u.Registry.as(i.Extensions.Workbench).registerWorkbenchContribution(o.TestingProgressTrigger,4),(0,t.registerEditorContribution)("editor.contrib.testingOutputPeek",n.TestingOutputPeekController),(0,t.registerEditorContribution)("editor.contrib.testingDecorations",s.TestingDecorations),A.CommandsRegistry.registerCommand({id:"_revealTestInExplorer",handler:async(z,x,H)=>{z.get(v.ITestExplorerFilterState).reveal.value=typeof x=="string"?x:x.extId,z.get(f.IViewsService).openView("workbench.view.testing",H)}}),A.CommandsRegistry.registerCommand({id:"vscode.peekTestError",handler:async(z,x)=>{const H=z.get(L.ITestResultService).getStateById(x);if(!H)return!1;const[W,U]=H,$=z.get(T.ITestingPeekOpener);if($.tryPeekFirstError(W,U))return!0;for(const q of W.tests)if(m.TestId.compare(U.item.extId,q.item.extId)===2&&$.tryPeekFirstError(W,q))return!0;return!1}}),A.CommandsRegistry.registerCommand({id:"vscode.revealTest",handler:async(z,x)=>{const H=z.get(O.ITestService).collection.getNodeById(x);if(!H)return;const W=z.get(A.ICommandService),U=z.get(I.IFileService),$=z.get(C.IOpenerService);let{range:q,uri:X}=H.item;if(!X)return;q=z.get(y.ITestingDecorationsService).getDecoratedRangeForTest(X,x)||q,z.get(v.ITestExplorerFilterState).reveal.value=x,z.get(T.ITestingPeekOpener).closeAllPeeks();let G=!0;try{(await U.stat(X)).isFile||(G=!1)}catch{}if(!G){await W.executeCommand(c.REVEAL_IN_EXPLORER_COMMAND_ID,X);return}await $.open(q?X.with({fragment:`L${q.startLineNumber}:${q.startColumn}`}):X)}}),A.CommandsRegistry.registerCommand({id:"vscode.runTestsById",handler:async(z,x,...H)=>{const W=z.get(O.ITestService);await(0,P.discoverAndRunTests)(z.get(O.ITestService).collection,z.get(r.IProgressService),H,U=>W.runTests({group:x,tests:U}))}}),u.Registry.as(k.Extensions.Configuration).registerConfiguration(h.testingConfiguation)}),define(ae[3006],le([1,0,1938,97,35,17,45,562,457,2423,2925,55,7,15,31,150,71,29,63]),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.TimelinePaneDescriptor=void 0;const d=(0,s.registerIcon)("timeline-view-icon",l.Codicon.history,(0,t.localize)(0,null)),n=(0,s.registerIcon)("timeline-open",l.Codicon.history,(0,t.localize)(1,null));class a{constructor(){this.id=I.TimelinePaneId,this.name=S.TimelinePane.TITLE,this.containerIcon=d,this.ctorDescriptor=new p.SyncDescriptor(S.TimelinePane),this.order=2,this.weight=30,this.collapsed=!0,this.canToggleVisibility=!0,this.hideByDefault=!1,this.canMoveView=!0,this.when=b.TimelineHasProviderContext,this.focusCommand={id:"timeline.focus"}}}e.TimelinePaneDescriptor=a,A.Registry.as(C.Extensions.Configuration).registerConfiguration({id:"timeline",order:1001,title:(0,t.localize)(2,null),type:"object",properties:{"timeline.pageSize":{type:["number","null"],default:null,markdownDescription:(0,t.localize)(3,null)},"timeline.pageOnScroll":{type:"boolean",default:!1,description:(0,t.localize)(4,null)}}}),A.Registry.as(k.Extensions.ViewsRegistry).registerViews([new a],E.VIEW_CONTAINER);var g;(function(v){v.ID="files.openTimeline",v.LABEL=(0,t.localize)(5,null);function m(){return(w,D)=>w.get(I.ITimelineService).setUri(D)}v.handler=m})(g||(g={})),i.CommandsRegistry.registerCommand(g.ID,g.handler()),u.MenuRegistry.appendMenuItem(u.MenuId.ExplorerContext,{group:"4_timeline",order:1,command:{id:g.ID,title:g.LABEL,icon:n},when:r.ContextKeyExpr.and(f.ExplorerFolderContext.toNegated(),c.ResourceContextKey.HasResource,b.TimelineHasProviderContext)});const h=(0,s.registerIcon)("timeline-filter",l.Codicon.filter,(0,t.localize)(6,null));u.MenuRegistry.appendMenuItem(u.MenuId.TimelineTitle,{submenu:u.MenuId.TimelineFilterSubMenu,title:(0,t.localize)(7,null),group:"navigation",order:100,icon:h}),(0,R.registerSingleton)(I.ITimelineService,b.TimelineService,1)}),define(ae[3007],le([1,0,45,1953,560,5,95,15,7,9,6,24,276,18,10,38,37,8,41,12,27,26,29,103,2,348,40,43,1182]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncConflictsViewPane=void 0;let D=class extends R.TreeViewPane{constructor(_,L,M,O,N,P,B,V,z,x,H,W,U,$,q,X){super(_,M,O,N,P,B,V,z,x,H,W),this.editorService=L,this.userDataSyncService=U,this.userDataSyncWorkbenchService=$,this.userDataSyncEnablementService=q,this.userDataProfilesService=X,this._register(this.userDataSyncService.onDidChangeConflicts(()=>this.treeView.refresh())),this.registerActions()}renderTreeView(_){super.renderTreeView(i.append(_,i.$("")));const L=this;this.treeView.message=(0,p.localize)(0,null),this.treeView.dataProvider={getChildren(){return L.getTreeItems()}}}async getTreeItems(){const _=[],L=this.userDataSyncService.conflicts.map(O=>O.conflicts.map(N=>({...N,syncResource:O.syncResource,profile:O.profile}))).flat().sort((O,N)=>O.profile.id===N.profile.id?0:O.profile.isDefault?-1:N.profile.isDefault?1:O.profile.name.localeCompare(N.profile.name)),M=[];for(const O of L){let N=M[M.length-1]?.[0].id===O.profile.id?M[M.length-1][1]:void 0;N||M.push([O.profile,N=[]]),N.push(O)}for(const[O,N]of M){const P=[];for(const B of N){const V=JSON.stringify(B),z={handle:V,resourceUri:B.remoteResource,label:{label:(0,u.basename)(B.remoteResource),strikethrough:B.mergeState==="accepted"&&(B.localChange===3||B.remoteChange===3)},description:(0,r.getSyncAreaLabel)(B.syncResource),collapsibleState:t.TreeItemCollapsibleState.None,command:{id:"workbench.actions.sync.openConflicts",title:"",arguments:[{$treeViewId:"",$treeItemHandle:V}]},contextValue:"sync-conflict-resource"};P.push(z)}_.push({handle:O.id,label:{label:O.name},collapsibleState:t.TreeItemCollapsibleState.Expanded,children:P})}return M.length===1&&M[0][0].isDefault?_[0].children??[]:_}parseHandle(_){const L=JSON.parse(_);return{syncResource:L.syncResource,profile:(0,g.reviveProfile)(L.profile,this.userDataProfilesService.profilesHome.scheme),localResource:b.URI.revive(L.localResource),remoteResource:b.URI.revive(L.remoteResource),baseResource:b.URI.revive(L.baseResource),previewResource:b.URI.revive(L.previewResource),acceptedResource:b.URI.revive(L.acceptedResource),localChange:L.localChange,remoteChange:L.remoteChange,mergeState:L.mergeState}}registerActions(){const _=this;this._register((0,E.registerAction2)(class extends E.Action2{constructor(){super({id:"workbench.actions.sync.openConflicts",title:(0,p.localize)(1,null)})}async run(M,O){const N=_.parseHandle(O.$treeItemHandle);return _.open(N)}})),this._register((0,E.registerAction2)(class extends E.Action2{constructor(){super({id:"workbench.actions.sync.acceptRemote",title:(0,p.localize)(2,null),icon:o.Codicon.cloudDownload,menu:{id:E.MenuId.ViewItemContext,when:I.ContextKeyExpr.and(I.ContextKeyExpr.equals("view",r.SYNC_CONFLICTS_VIEW_ID),I.ContextKeyExpr.equals("viewItem","sync-conflict-resource")),group:"inline",order:1}})}async run(M,O){const N=_.parseHandle(O.$treeItemHandle);await _.userDataSyncWorkbenchService.accept({syncResource:N.syncResource,profile:N.profile},N.remoteResource,void 0,_.userDataSyncEnablementService.isEnabled())}})),this._register((0,E.registerAction2)(class extends E.Action2{constructor(){super({id:"workbench.actions.sync.acceptLocal",title:(0,p.localize)(3,null),icon:o.Codicon.cloudUpload,menu:{id:E.MenuId.ViewItemContext,when:I.ContextKeyExpr.and(I.ContextKeyExpr.equals("view",r.SYNC_CONFLICTS_VIEW_ID),I.ContextKeyExpr.equals("viewItem","sync-conflict-resource")),group:"inline",order:2}})}async run(M,O){const N=_.parseHandle(O.$treeItemHandle);await _.userDataSyncWorkbenchService.accept({syncResource:N.syncResource,profile:N.profile},N.localResource,void 0,_.userDataSyncEnablementService.isEnabled())}}))}async open(_){if(!!this.userDataSyncService.conflicts.some(({conflicts:L})=>L.some(({localResource:M})=>(0,u.isEqual)(M,_.localResource))))if(this.userDataSyncEnablementService.isEnabled()){const L=(0,p.localize)(4,null,(0,u.basename)(_.remoteResource)),M=(0,p.localize)(5,null,(0,u.basename)(_.remoteResource));await this.editorService.openEditor({input1:{resource:_.remoteResource,label:(0,p.localize)(6,null),description:L},input2:{resource:_.localResource,label:(0,p.localize)(7,null),description:M},base:{resource:_.baseResource},result:{resource:_.previewResource}});return}else{const L=_.remoteResource,M=_.localResource,O=(0,p.localize)(8,null,(0,u.basename)(L)),N=(0,p.localize)(9,null,(0,u.basename)(M));await this.editorService.openEditor({original:{resource:L},modified:{resource:M},label:(0,p.localize)(10,null,O,N),description:(0,p.localize)(11,null),options:{preserveFocus:!0,revealIfVisible:!0,pinned:!0,override:w.DEFAULT_EDITOR_ASSOCIATION.id}})}}};D=we([F(1,C.IEditorService),F(2,f.IKeybindingService),F(3,c.IContextMenuService),F(4,l.IConfigurationService),F(5,I.IContextKeyService),F(6,t.IViewDescriptorService),F(7,A.IInstantiationService),F(8,s.IOpenerService),F(9,d.IThemeService),F(10,n.ITelemetryService),F(11,a.INotificationService),F(12,k.IUserDataSyncService),F(13,r.IUserDataSyncWorkbenchService),F(14,k.IUserDataSyncEnablementService),F(15,g.IUserDataProfilesService)],D),e.UserDataSyncConflictsViewPane=D;let y=class Nc extends h.Disposable{static get(_){return _.getContribution(Nc.ID)}constructor(_,L,M,O,N){super(),this.editor=_,this.instantiationService=L,this.userDataSyncService=M,this.configurationService=O,this.userDataSyncWorkbenchService=N,this.update(),this.registerListeners()}registerListeners(){this._register(this.editor.onDidChangeModel(()=>this.update())),this._register(this.userDataSyncService.onDidChangeConflicts(()=>this.update())),this._register(S.Event.filter(this.configurationService.onDidChangeConfiguration,_=>_.affectsConfiguration("diffEditor.renderSideBySide"))(()=>this.update()))}update(){if(!this.shouldShowButton(this.editor)){this.disposeAcceptChangesWidgetRenderer();return}this.createAcceptChangesWidgetRenderer()}shouldShowButton(_){const L=_.getModel();if(!L)return!1;const M=this.getUserDataSyncResource(L.uri);return M?this.configurationService.getValue("diffEditor.renderSideBySide")?!0:(0,u.isEqual)(M.localResource,L.uri):!1}createAcceptChangesWidgetRenderer(){if(!this.acceptChangesButton){const _=this.editor.getModel().uri,L=this.getUserDataSyncResource(_),O=(0,u.isEqual)(L.remoteResource,_)?(0,p.localize)(12,null):(0,p.localize)(13,null);this.acceptChangesButton=this.instantiationService.createInstance(v.FloatingClickWidget,this.editor,O,null),this._register(this.acceptChangesButton.onClick(async()=>{const N=this.editor.getModel();N&&await this.userDataSyncWorkbenchService.accept({syncResource:L.syncResource,profile:L.profile},N.uri,N.getValue(),!1)})),this.acceptChangesButton.render()}}getUserDataSyncResource(_){for(const L of this.userDataSyncService.conflicts)for(const M of L.conflicts)if((0,u.isEqual)(M.remoteResource,_)||(0,u.isEqual)(M.localResource,_))return{syncResource:L.syncResource,profile:L.profile,...M}}disposeAcceptChangesWidgetRenderer(){(0,h.dispose)(this.acceptChangesButton),this.acceptChangesButton=void 0}dispose(){this.disposeAcceptChangesWidgetRenderer(),super.dispose()}};y.ID="editor.contrib.acceptChangesButton2",y=we([F(1,A.IInstantiationService),F(2,k.IUserDataSyncService),F(3,l.IConfigurationService),F(4,r.IUserDataSyncWorkbenchService)],y),(0,m.registerEditorContribution)(y.ID,y)}),define(ae[3008],le([1,0,17,45,1954,97,560,5,95,15,7,9,24,12,208,47,6,2,29,36,276,625,48,26,18,204,19,81,57,31,103,3007]),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,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncDataViews=void 0;let L=class extends l.Disposable{constructor(z,x,H,W,U){super(),this.instantiationService=x,this.userDataSyncEnablementService=H,this.userDataSyncMachinesService=W,this.userDataSyncService=U,this.registerViews(z)}registerViews(z){this.registerConflictsView(z),this.registerActivityView(z,!0),this.registerMachinesView(z),this.registerActivityView(z,!1),this.registerTroubleShootView(z)}registerConflictsView(z){const x=t.Registry.as(p.Extensions.ViewsRegistry),H=(0,R.localize)(0,null);x.registerViews([{id:n.SYNC_CONFLICTS_VIEW_ID,name:H,ctorDescriptor:new A.SyncDescriptor(_.UserDataSyncConflictsViewPane),when:S.ContextKeyExpr.and(n.CONTEXT_ENABLE_SYNC_CONFLICTS_VIEW,n.CONTEXT_HAS_CONFLICTS),canToggleVisibility:!1,canMoveView:!1,treeView:this.instantiationService.createInstance(k.TreeView,n.SYNC_CONFLICTS_VIEW_ID,H),collapsed:!1,order:100}],z)}registerMachinesView(z){const x="workbench.views.sync.machines",H=(0,R.localize)(1,null),W=this.instantiationService.createInstance(k.TreeView,x,H),U=this.instantiationService.createInstance(P,W);W.showRefreshAction=!0,W.canSelectMany=!0;const $=W.onDidChangeVisibility(X=>{X&&!W.dataProvider&&($.dispose(),W.dataProvider=U)});this._register(c.Event.any(this.userDataSyncMachinesService.onDidChange,this.userDataSyncService.onDidResetRemote)(()=>W.refresh())),t.Registry.as(p.Extensions.ViewsRegistry).registerViews([{id:x,name:H,ctorDescriptor:new A.SyncDescriptor(k.TreeViewPane),when:S.ContextKeyExpr.and(n.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),n.CONTEXT_ACCOUNT_STATE.isEqualTo("available"),n.CONTEXT_ENABLE_ACTIVITY_VIEWS),canToggleVisibility:!0,canMoveView:!1,treeView:W,collapsed:!1,order:300}],z),(0,b.registerAction2)(class extends b.Action2{constructor(){super({id:"workbench.actions.sync.editMachineName",title:(0,R.localize)(2,null),icon:s.Codicon.edit,menu:{id:b.MenuId.ViewItemContext,when:S.ContextKeyExpr.and(S.ContextKeyExpr.equals("view",x)),group:"inline"}})}async run(X,G){await U.rename(G.$treeItemHandle)&&await W.refresh()}}),(0,b.registerAction2)(class extends b.Action2{constructor(){super({id:"workbench.actions.sync.turnOffSyncOnMachine",title:(0,R.localize)(3,null),menu:{id:b.MenuId.ViewItemContext,when:S.ContextKeyExpr.and(S.ContextKeyExpr.equals("view",x),S.ContextKeyExpr.equals("viewItem","sync-machine"))}})}async run(X,G,Q){await U.disable((Q||[G]).map(j=>j.$treeItemHandle))&&await W.refresh()}})}registerActivityView(z,x){const H=`workbench.views.sync.${x?"remote":"local"}Activity`,W=x?(0,R.localize)(4,null):(0,R.localize)(5,null),U=this.instantiationService.createInstance(k.TreeView,H,W);U.showCollapseAllAction=!0,U.showRefreshAction=!0;const $=U.onDidChangeVisibility(X=>{X&&!U.dataProvider&&($.dispose(),U.dataProvider=x?this.instantiationService.createInstance(N):this.instantiationService.createInstance(O))});this._register(c.Event.any(this.userDataSyncEnablementService.onDidChangeResourceEnablement,this.userDataSyncEnablementService.onDidChangeEnablement,this.userDataSyncService.onDidResetLocal,this.userDataSyncService.onDidResetRemote)(()=>U.refresh())),t.Registry.as(p.Extensions.ViewsRegistry).registerViews([{id:H,name:W,ctorDescriptor:new A.SyncDescriptor(k.TreeViewPane),when:S.ContextKeyExpr.and(n.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),n.CONTEXT_ACCOUNT_STATE.isEqualTo("available"),n.CONTEXT_ENABLE_ACTIVITY_VIEWS),canToggleVisibility:!0,canMoveView:!1,treeView:U,collapsed:!1,order:x?200:400,hideByDefault:!x}],z),this.registerDataViewActions(H)}registerDataViewActions(z){(0,b.registerAction2)(class extends b.Action2{constructor(){super({id:"workbench.actions.sync.resolveResource",title:(0,R.localize)(6,null),menu:{id:b.MenuId.ViewItemContext,when:S.ContextKeyExpr.and(S.ContextKeyExpr.equals("view",z),S.ContextKeyExpr.regex("viewItem",/sync-resource-.*/i))}})}async run(x,H){const{resource:W}=JSON.parse(H.$treeItemHandle);await x.get(r.IEditorService).openEditor({resource:C.URI.parse(W),options:{pinned:!0}})}}),(0,b.registerAction2)(class extends b.Action2{constructor(){super({id:"workbench.actions.sync.compareWithLocal",title:(0,R.localize)(7,null),menu:{id:b.MenuId.ViewItemContext,when:S.ContextKeyExpr.and(S.ContextKeyExpr.equals("view",z),S.ContextKeyExpr.regex("viewItem",/sync-associatedResource-.*/i))}})}async run(x,H){const W=x.get(y.ICommandService),{resource:U,comparableResource:$}=JSON.parse(H.$treeItemHandle),q=C.URI.parse(U),X=C.URI.parse($);return W.executeCommand(v.API_OPEN_DIFF_EDITOR_COMMAND_ID,q,X,(0,R.localize)(8,null,(0,R.localize)(9,null,(0,h.basename)(q)),(0,R.localize)(10,null,(0,h.basename)(X))),void 0)}}),(0,b.registerAction2)(class extends b.Action2{constructor(){super({id:"workbench.actions.sync.replaceCurrent",title:(0,R.localize)(11,null),icon:s.Codicon.discard,menu:{id:b.MenuId.ViewItemContext,when:S.ContextKeyExpr.and(S.ContextKeyExpr.equals("view",z),S.ContextKeyExpr.regex("viewItem",/sync-resource-.*/i)),group:"inline"}})}async run(x,H){const W=x.get(f.IDialogService),U=x.get(I.IUserDataSyncService),{syncResourceHandle:$,syncResource:q}=JSON.parse(H.$treeItemHandle);if((await W.confirm({message:(0,R.localize)(12,null,(0,n.getSyncAreaLabel)(q)),type:"info",title:n.SYNC_TITLE})).confirmed)return U.replace({created:$.created,uri:C.URI.revive($.uri)})}})}registerTroubleShootView(z){const x="workbench.views.sync.troubleshoot",H=(0,R.localize)(13,null),W=this.instantiationService.createInstance(k.TreeView,x,H),U=this.instantiationService.createInstance(B);W.showRefreshAction=!0;const $=W.onDidChangeVisibility(X=>{X&&!W.dataProvider&&($.dispose(),W.dataProvider=U)});t.Registry.as(p.Extensions.ViewsRegistry).registerViews([{id:x,name:H,ctorDescriptor:new A.SyncDescriptor(k.TreeViewPane),when:n.CONTEXT_ENABLE_ACTIVITY_VIEWS,canToggleVisibility:!0,canMoveView:!1,treeView:W,collapsed:!1,order:500,hideByDefault:!0}],z)}};L=we([F(1,E.IInstantiationService),F(2,I.IUserDataSyncEnablementService),F(3,a.IUserDataSyncMachinesService),F(4,I.IUserDataSyncService)],L),e.UserDataSyncDataViews=L;let M=class{constructor(z,x,H,W,U){this.userDataSyncService=z,this.userDataAutoSyncService=x,this.userDataSyncWorkbenchService=H,this.notificationService=W,this.userDataProfilesService=U,this.syncResourceHandlesByProfile=new Map}async getChildren(z){try{if(!z)return await this.getRoots();if(z.profile||z.handle===this.userDataProfilesService.defaultProfile.id){let x=this.syncResourceHandlesByProfile.get(z.handle);return x||this.syncResourceHandlesByProfile.set(z.handle,x=this.getSyncResourceHandles(z.profile)),await x}return z.syncResourceHandle?await this.getChildrenForSyncResourceTreeItem(z):[]}catch(x){throw x instanceof I.UserDataSyncError||(x=I.UserDataSyncError.toUserDataSyncError(x)),x instanceof I.UserDataSyncError&&x.code==="IncompatibleRemoteContent"?this.notificationService.notify({severity:g.Severity.Error,message:x.message,actions:{primary:[new d.Action("reset",(0,R.localize)(14,null),void 0,!0,()=>this.userDataSyncWorkbenchService.resetSyncedData())]}}):this.notificationService.error(x),x}}async getRoots(){this.syncResourceHandlesByProfile.clear();const z=[],x=await this.getProfiles();if(x.length){const H={handle:this.userDataProfilesService.defaultProfile.id,label:{label:this.userDataProfilesService.defaultProfile.name},collapsibleState:p.TreeItemCollapsibleState.Expanded};z.push(H)}else{const H=await this.getSyncResourceHandles();z.push(...H)}for(const H of x){const W={handle:H.id,label:{label:H.name},collapsibleState:p.TreeItemCollapsibleState.Collapsed,profile:H};z.push(W)}return z}async getChildrenForSyncResourceTreeItem(z){const x=z.syncResourceHandle,H=await this.userDataSyncService.getAssociatedResources(x),W=x.previous?await this.userDataSyncService.getAssociatedResources(x.previous):[];return H.map(({resource:U,comparableResource:$})=>{const q=JSON.stringify({resource:U.toString(),comparableResource:$.toString()}),X=W.find(G=>(0,h.basename)(G.resource)===(0,h.basename)(U))?.resource;return{handle:q,collapsibleState:p.TreeItemCollapsibleState.None,resourceUri:U,command:X?{id:v.API_OPEN_DIFF_EDITOR_COMMAND_ID,title:"",arguments:[X,U,(0,R.localize)(15,null,`${(0,h.basename)(U)} (${(0,i.fromNow)(x.previous.created,!0)})`,`${(0,h.basename)(U)} (${(0,i.fromNow)(x.created,!0)})`),void 0]}:{id:v.API_OPEN_EDITOR_COMMAND_ID,title:"",arguments:[U,void 0,void 0]},contextValue:`sync-associatedResource-${x.syncResource}`}})}async getSyncResourceHandles(z){const x=[],W=(await Promise.all(I.ALL_SYNC_RESOURCES.map(async U=>{const $=await this.getResourceHandles(U,z);return $.map((q,X)=>({...q,syncResource:U,previous:$[X+1]}))}))).flat().sort((U,$)=>$.created-U.created);for(const U of W){const $=JSON.stringify({syncResourceHandle:U,syncResource:U.syncResource});x.push({handle:$,collapsibleState:p.TreeItemCollapsibleState.Collapsed,label:{label:(0,n.getSyncAreaLabel)(U.syncResource)},description:(0,i.fromNow)(U.created,!0),themeIcon:u.FolderThemeIcon,syncResourceHandle:U,contextValue:`sync-resource-${U.syncResource}`})}return x}};M=we([F(0,I.IUserDataSyncService),F(1,I.IUserDataAutoSyncService),F(2,n.IUserDataSyncWorkbenchService),F(3,g.INotificationService),F(4,T.IUserDataProfilesService)],M);class O extends M{getResourceHandles(z,x){return this.userDataSyncService.getLocalSyncResourceHandles(z,x)}async getProfiles(){return this.userDataProfilesService.profiles.filter(z=>!z.isDefault)}}let N=class extends M{constructor(z,x,H,W,U,$){super(z,x,W,U,$),this.userDataSyncMachinesService=H}async getChildren(z){return z||(this.machinesPromise=void 0),super.getChildren(z)}getMachines(){return this.machinesPromise===void 0&&(this.machinesPromise=this.userDataSyncMachinesService.getMachines()),this.machinesPromise}getResourceHandles(z,x){return this.userDataSyncService.getRemoteSyncResourceHandles(z,x)}getProfiles(){return this.userDataSyncService.getRemoteProfiles()}async getChildrenForSyncResourceTreeItem(z){const x=await super.getChildrenForSyncResourceTreeItem(z);if(x.length){const H=await this.userDataSyncService.getMachineId(z.syncResourceHandle);if(H){const U=(await this.getMachines()).find(({id:$})=>$===H);x[0].description=U?.isCurrent?(0,R.localize)(16,null):U?.name}}return x}};N=we([F(0,I.IUserDataSyncService),F(1,I.IUserDataAutoSyncService),F(2,a.IUserDataSyncMachinesService),F(3,n.IUserDataSyncWorkbenchService),F(4,g.INotificationService),F(5,T.IUserDataProfilesService)],N);let P=class{constructor(z,x,H,W,U,$){this.treeView=z,this.userDataSyncMachinesService=x,this.quickInputService=H,this.notificationService=W,this.dialogService=U,this.userDataSyncWorkbenchService=$}async getChildren(z){z||(this.machinesPromise=void 0);try{let x=await this.getMachines();return x=x.filter(H=>!H.disabled).sort((H,W)=>H.isCurrent?-1:1),this.treeView.message=x.length?void 0:(0,R.localize)(17,null),x.map(({id:H,name:W,isCurrent:U,platform:$})=>({handle:H,collapsibleState:p.TreeItemCollapsibleState.None,label:{label:W},description:U?(0,R.localize)(18,null):void 0,themeIcon:$&&(0,a.isWebPlatform)($)?s.Codicon.globe:s.Codicon.vm,contextValue:"sync-machine"}))}catch(x){return this.notificationService.error(x),[]}}getMachines(){return this.machinesPromise===void 0&&(this.machinesPromise=this.userDataSyncMachinesService.getMachines()),this.machinesPromise}async disable(z){const H=(await this.getMachines()).filter(({id:$})=>z.includes($));if(!H.length)throw new Error((0,R.localize)(19,null,z.join(",")));if(!(await this.dialogService.confirm({type:"info",message:H.length>1?(0,R.localize)(20,null):(0,R.localize)(21,null,H[0].name),primaryButton:(0,R.localize)(22,null)})).confirmed)return!1;H.some($=>$.isCurrent)&&await this.userDataSyncWorkbenchService.turnoff(!1);const U=H.filter($=>!$.isCurrent).map($=>[$.id,!1]);return U.length&&await this.userDataSyncMachinesService.setEnablements(U),!0}async rename(z){const x=new l.DisposableStore,H=x.add(this.quickInputService.createInputBox());H.placeholder=(0,R.localize)(23,null),H.busy=!0,H.show();const W=await this.getMachines(),U=W.find(({id:q})=>q===z);if(!U)throw H.hide(),x.dispose(),new Error((0,R.localize)(24,null,z));H.busy=!1,H.value=U.name;const $=q=>(q=q.trim(),q&&!W.some(X=>X.id!==z&&X.name===q)?q:null);return x.add(H.onDidChangeValue(()=>H.validationMessage=$(H.value)?"":(0,R.localize)(25,null))),new Promise((q,X)=>{x.add(H.onDidAccept(async()=>{const G=$(H.value);if(x.dispose(),G&&G!==U.name)try{await this.userDataSyncMachinesService.renameMachine(z,G),q(!0)}catch(Q){X(Q)}else q(!1)}))})}};P=we([F(1,a.IUserDataSyncMachinesService),F(2,o.IQuickInputService),F(3,g.INotificationService),F(4,f.IDialogService),F(5,n.IUserDataSyncWorkbenchService)],P);let B=class{constructor(z,x,H){this.fileService=z,this.environmentService=x,this.uriIdentityService=H}async getChildren(z){return z?z.handle==="LAST_SYNC_STATES"?this.getLastSyncStates():z.handle==="SYNC_LOGS"?this.getSyncLogs():[]:[{handle:"SYNC_LOGS",collapsibleState:p.TreeItemCollapsibleState.Collapsed,label:{label:(0,R.localize)(26,null)},themeIcon:s.Codicon.folder},{handle:"LAST_SYNC_STATES",collapsibleState:p.TreeItemCollapsibleState.Collapsed,label:{label:(0,R.localize)(27,null)},themeIcon:s.Codicon.folder}]}async getLastSyncStates(){const z=[];for(const x of I.ALL_SYNC_RESOURCES){const H=(0,I.getLastSyncResourceUri)(void 0,x,this.environmentService,this.uriIdentityService.extUri);await this.fileService.exists(H)&&z.push({handle:H.toString(),label:{label:(0,n.getSyncAreaLabel)(x)},collapsibleState:p.TreeItemCollapsibleState.None,resourceUri:H,command:{id:v.API_OPEN_EDITOR_COMMAND_ID,title:"",arguments:[H,void 0,void 0]}})}return z}async getSyncLogs(){const z=[],x=await this.fileService.resolve(this.uriIdentityService.extUri.dirname(this.uriIdentityService.extUri.dirname(this.environmentService.userDataSyncLogResource)));x.children&&z.push(...x.children.filter(W=>W.isDirectory&&/^\d{8}T\d{6}$/.test(W.name)).sort().reverse().map(W=>W.resource));const H=[];for(const W of z){const U=this.uriIdentityService.extUri.joinPath(W,this.uriIdentityService.extUri.basename(this.environmentService.userDataSyncLogResource));await this.fileService.exists(U)&&H.push({handle:U.toString(),collapsibleState:p.TreeItemCollapsibleState.None,resourceUri:U,label:{label:this.uriIdentityService.extUri.basename(W)},description:this.uriIdentityService.extUri.isEqual(U,this.environmentService.userDataSyncLogResource)?(0,R.localize)(28,null):void 0,command:{id:v.API_OPEN_EDITOR_COMMAND_ID,title:"",arguments:[U,void 0,void 0]}})}return H}};B=we([F(0,m.IFileService),F(1,w.IEnvironmentService),F(2,D.IUriIdentityService)],B)}),define(ae[3009],le([1,0,36,21,6,2,18,9,54,42,62,1951,15,31,8,7,47,5,26,48,27,95,43,256,132,190,24,106,514,208,46,41,260,17,97,45,3008,276,29,163,70,74,103,78,445,81]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncWorkbenchContribution=void 0;const X={id:"workbench.userDataSync.actions.turnOn",title:(0,C.localize)(0,null,B.SYNC_TITLE)},G={id:"workbench.userDataSync.actions.turnOff",title:(0,C.localize)(1,null,B.SYNC_TITLE)},Q={id:B.CONFIGURE_SYNC_COMMAND_ID,title:(0,C.localize)(2,null,B.SYNC_TITLE)},j={id:"workbench.userDataSync.actions.showConflicts",title:(0,C.localize)(3,null,B.SYNC_TITLE)},K={id:"workbench.userDataSync.actions.syncNow",title:(0,C.localize)(4,null,B.SYNC_TITLE),description(se){if(se.status==="syncing")return(0,C.localize)(5,null);if(se.lastSyncTime)return(0,C.localize)(6,null,(0,y.fromNow)(se.lastSyncTime,!0))}},Y={id:"workbench.userDataSync.actions.settings",title:(0,C.localize)(7,null,B.SYNC_TITLE)},ee={id:"workbench.userDataSync.actions.showSyncedData",title:(0,C.localize)(8,null,B.SYNC_TITLE)},ie=new f.RawContextKey("userDataSyncTurningOn",!1);let re=class extends A.Disposable{constructor(te,Z,ne,ce,de,he,pe,me,Se,Ie,ve,be,ge,ue,Ce,De,Ae,Pe,fe,ye,ke,Ee,Te,_e){super(),this.userDataSyncEnablementService=te,this.userDataSyncService=Z,this.userDataSyncWorkbenchService=ne,this.activityService=de,this.notificationService=he,this.editorService=pe,this.userDataProfilesService=me,this.dialogService=Se,this.quickInputService=Ie,this.instantiationService=ve,this.outputService=be,this.authTokenService=ge,this.preferencesService=De,this.telemetryService=Ae,this.productService=Pe,this.openerService=fe,this.authenticationService=ye,this.userDataSyncStoreManagementService=ke,this.configurationService=Ee,this.environmentService=Te,this.hostService=_e,this.globalActivityBadgeDisposable=this._register(new A.MutableDisposable),this.accountBadgeDisposable=this._register(new A.MutableDisposable),this.conflictsDisposables=new Map,this.invalidContentErrorDisposables=new Map,this.turningOnSyncContext=ie.bindTo(ce),ne.enabled&&((0,a.registerConfiguration)(),this.updateAccountBadge(),this.updateGlobalActivityBadge(),this.onDidChangeConflicts(this.userDataSyncService.conflicts),this._register(R.Event.any(R.Event.debounce(Z.onDidChangeStatus,()=>{},500),this.userDataSyncEnablementService.onDidChangeEnablement,this.userDataSyncWorkbenchService.onDidChangeAccountStatus)(()=>{this.updateAccountBadge(),this.updateGlobalActivityBadge()})),this._register(Z.onDidChangeConflicts(()=>this.onDidChangeConflicts(this.userDataSyncService.conflicts))),this._register(te.onDidChangeEnablement(()=>this.onDidChangeConflicts(this.userDataSyncService.conflicts))),this._register(Z.onSyncErrors(Re=>this.onSynchronizerErrors(Re))),this._register(ue.onError(Re=>this.onAutoSyncError(Re))),this.registerActions(),this.registerViews(),Ce.registerTextModelContentProvider(a.USER_DATA_SYNC_SCHEME,ve.createInstance(oe)),this._register(R.Event.any(Z.onDidChangeStatus,te.onDidChangeEnablement)(()=>this.turningOnSync=!te.isEnabled()&&Z.status!=="idle")))}get turningOnSync(){return!!this.turningOnSyncContext.get()}set turningOnSync(te){this.turningOnSyncContext.set(te),this.updateGlobalActivityBadge()}toKey({syncResource:te,profile:Z}){return`${Z.id}:${te}`}onDidChangeConflicts(te){if(!!this.userDataSyncEnablementService.isEnabled())if(this.updateGlobalActivityBadge(),te.length){for(const[Z,ne]of this.conflictsDisposables.entries())te.some(ce=>this.toKey(ce)===Z)||(ne.dispose(),this.conflictsDisposables.delete(Z));for(const Z of this.userDataSyncService.conflicts){const ne=this.toKey(Z);if(!this.conflictsDisposables.has(ne)){const ce=(0,B.getSyncAreaLabel)(Z.syncResource),de=this.notificationService.prompt(s.Severity.Warning,(0,C.localize)(9,null,ce.toLowerCase()),[{label:(0,C.localize)(10,null),run:()=>{this.telemetryService.publicLog2("sync/handleConflicts",{source:Z.syncResource,action:"acceptLocal"}),this.acceptLocal(Z,Z.conflicts[0])}},{label:(0,C.localize)(11,null),run:()=>{this.telemetryService.publicLog2("sync/handleConflicts",{source:Z.syncResource,action:"acceptRemote"}),this.acceptRemote(Z,Z.conflicts[0])}},{label:(0,C.localize)(12,null),run:()=>{this.telemetryService.publicLog2("sync/showConflicts",{source:Z.syncResource}),this.userDataSyncWorkbenchService.showConflicts(Z.conflicts[0])}}],{sticky:!0});this.conflictsDisposables.set(ne,(0,A.toDisposable)(()=>{de.close(),this.conflictsDisposables.delete(ne)}))}}}else this.conflictsDisposables.forEach(Z=>Z.dispose()),this.conflictsDisposables.clear()}async acceptRemote(te,Z){try{await this.userDataSyncService.accept(te,Z.remoteResource,void 0,this.userDataSyncEnablementService.isEnabled())}catch{this.notificationService.error((0,C.localize)(13,null,`command:${B.SHOW_SYNC_LOG_COMMAND_ID}`))}}async acceptLocal(te,Z){try{await this.userDataSyncService.accept(te,Z.localResource,void 0,this.userDataSyncEnablementService.isEnabled())}catch{this.notificationService.error((0,C.localize)(14,null,`command:${B.SHOW_SYNC_LOG_COMMAND_ID}`))}}onAutoSyncError(te){switch(te.code){case"SessionExpired":this.notificationService.notify({severity:s.Severity.Info,message:(0,C.localize)(15,null),actions:{primary:[new t.Action("turn on sync",(0,C.localize)(16,null),void 0,!0,()=>this.turnOn())]}});break;case"TurnedOff":this.notificationService.notify({severity:s.Severity.Info,message:(0,C.localize)(17,null),actions:{primary:[new t.Action("turn on sync",(0,C.localize)(18,null),void 0,!0,()=>this.turnOn())]}});break;case"TooLarge":if(te.resource==="keybindings"||te.resource==="settings"||te.resource==="tasks"){this.disableSync(te.resource);const Z=(0,B.getSyncAreaLabel)(te.resource);this.handleTooLargeError(te.resource,(0,C.localize)(19,null,Z.toLowerCase(),Z.toLowerCase(),"100kb"),te)}break;case"IncompatibleLocalContent":case"Gone":case"UpgradeRequired":{const Z=(0,C.localize)(20,null,this.productService.version,this.productService.commit),ne=te.operationId?(0,C.localize)(21,null,te.operationId):void 0;this.notificationService.notify({severity:s.Severity.Error,message:ne?`${Z} ${ne}`:Z});break}case"IncompatibleRemoteContent":this.notificationService.notify({severity:s.Severity.Error,message:(0,C.localize)(22,null),actions:{primary:[new t.Action("reset",(0,C.localize)(23,null),void 0,!0,()=>this.userDataSyncWorkbenchService.resetSyncedData()),new t.Action("show synced data",(0,C.localize)(24,null),void 0,!0,()=>this.userDataSyncWorkbenchService.showSyncActivity())]}});return;case"ServiceChanged":this.notificationService.notify({severity:s.Severity.Info,message:this.userDataSyncStoreManagementService.userDataSyncStore?.type==="insiders"?(0,C.localize)(25,null):(0,C.localize)(26,null)});return;case"DefaultServiceChanged":this.userDataSyncEnablementService.isEnabled()?this.notificationService.notify({severity:s.Severity.Info,message:(0,C.localize)(27,null)}):this.notificationService.notify({severity:s.Severity.Info,message:(0,C.localize)(28,null,this.productService.nameLong),actions:{primary:[new t.Action("turn on sync",(0,C.localize)(29,null),void 0,!0,()=>this.turnOn())]}});return}}handleTooLargeError(te,Z,ne){const ce=ne.operationId?(0,C.localize)(30,null,ne.operationId):void 0;this.notificationService.notify({severity:s.Severity.Error,message:ce?`${Z} ${ce}`:Z,actions:{primary:[new t.Action("open sync file",(0,C.localize)(31,null,(0,B.getSyncAreaLabel)(te)),void 0,!0,()=>te==="settings"?this.preferencesService.openUserSettings({jsonEditor:!0}):this.preferencesService.openGlobalKeybindingSettings(!0))]}})}onSynchronizerErrors(te){if(te.length)for(const{profile:Z,syncResource:ne,error:ce}of te)switch(ce.code){case"LocalInvalidContent":this.handleInvalidContentError({profile:Z,syncResource:ne});break;default:{const de=`${Z.id}:${ne}`,he=this.invalidContentErrorDisposables.get(de);he&&(he.dispose(),this.invalidContentErrorDisposables.delete(de))}}else this.invalidContentErrorDisposables.forEach(Z=>Z.dispose()),this.invalidContentErrorDisposables.clear()}handleInvalidContentError({profile:te,syncResource:Z}){const ne=`${te.id}:${Z}`;if(this.invalidContentErrorDisposables.has(ne)||Z!=="settings"&&Z!=="keybindings"&&Z!=="tasks"||!this.hostService.hasFocus)return;const ce=Z==="settings"?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfilesService.defaultProfile.keybindingsResource;if((0,k.isEqual)(ce,o.EditorResourceAccessor.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:o.SideBySideEditor.PRIMARY})))return;const de=(0,B.getSyncAreaLabel)(Z),he=this.notificationService.notify({severity:s.Severity.Error,message:(0,C.localize)(32,null,de.toLowerCase()),actions:{primary:[new t.Action("open sync file",(0,C.localize)(33,null,de),void 0,!0,()=>Z==="settings"?this.preferencesService.openUserSettings({jsonEditor:!0}):this.preferencesService.openGlobalKeybindingSettings(!0))]}});this.invalidContentErrorDisposables.set(ne,(0,A.toDisposable)(()=>{he.close(),this.invalidContentErrorDisposables.delete(ne)}))}getConflictsCount(){return this.userDataSyncService.conflicts.reduce((te,{conflicts:Z})=>te+Z.length,0)}async updateGlobalActivityBadge(){this.globalActivityBadgeDisposable.clear();let te,Z,ne;this.userDataSyncService.conflicts.length&&this.userDataSyncEnablementService.isEnabled()?te=new v.NumberBadge(this.getConflictsCount(),()=>(0,C.localize)(34,null,B.SYNC_TITLE)):this.turningOnSync&&(te=new v.ProgressBadge(()=>(0,C.localize)(35,null)),Z="progress-badge",ne=1),te&&(this.globalActivityBadgeDisposable.value=this.activityService.showGlobalActivity({badge:te,clazz:Z,priority:ne}))}async updateAccountBadge(){this.accountBadgeDisposable.clear();let te;this.userDataSyncService.status!=="uninitialized"&&this.userDataSyncEnablementService.isEnabled()&&this.userDataSyncWorkbenchService.accountStatus==="unavailable"&&(te=new v.NumberBadge(1,()=>(0,C.localize)(36,null))),te&&(this.accountBadgeDisposable.value=this.activityService.showAccountsActivity({badge:te,clazz:void 0,priority:void 0}))}async turnOn(){try{if(!this.userDataSyncWorkbenchService.authenticationProviders.length)throw new Error((0,C.localize)(37,null));if(!await this.askToConfigure())return;this.userDataSyncStoreManagementService.userDataSyncStore?.canSwitch&&await this.selectSettingsSyncService(this.userDataSyncStoreManagementService.userDataSyncStore),await this.userDataSyncWorkbenchService.turnOn()}catch(te){if((0,p.isCancellationError)(te))return;if(te instanceof a.UserDataSyncError){switch(te.code){case"TooLarge":if(te.resource==="keybindings"||te.resource==="settings"||te.resource==="tasks"){this.handleTooLargeError(te.resource,(0,C.localize)(38,null,(0,B.getSyncAreaLabel)(te.resource).toLowerCase(),"100kb"),te);return}break;case"IncompatibleLocalContent":case"Gone":case"UpgradeRequired":{const Z=(0,C.localize)(39,null,this.productService.version,this.productService.commit),ne=te.operationId?(0,C.localize)(40,null,te.operationId):void 0;this.notificationService.notify({severity:s.Severity.Error,message:ne?`${Z} ${ne}`:Z});return}case"IncompatibleRemoteContent":this.notificationService.notify({severity:s.Severity.Error,message:(0,C.localize)(41,null),actions:{primary:[new t.Action("reset",(0,C.localize)(42,null),void 0,!0,()=>this.userDataSyncWorkbenchService.resetSyncedData()),new t.Action("show synced data",(0,C.localize)(43,null),void 0,!0,()=>this.userDataSyncWorkbenchService.showSyncActivity())]}});return;case"Unauthorized":this.notificationService.error((0,C.localize)(44,null));return}this.notificationService.error((0,C.localize)(45,null,`command:${B.SHOW_SYNC_LOG_COMMAND_ID}`))}else this.notificationService.error((0,C.localize)(46,null,(0,p.getErrorMessage)(te)))}}async askToConfigure(){return new Promise((te,Z)=>{const ne=new A.DisposableStore,ce=this.quickInputService.createQuickPick();ne.add(ce),ce.title=B.SYNC_TITLE,ce.ok=!1,ce.customButton=!0,ce.customLabel=(0,C.localize)(47,null),ce.description=(0,C.localize)(48,null),ce.canSelectMany=!0,ce.ignoreFocusOut=!0,ce.hideInput=!0,ce.hideCheckAll=!0;const de=this.getConfigureSyncQuickPickItems();ce.items=de,ce.selectedItems=de.filter(pe=>this.userDataSyncEnablementService.isResourceEnabled(pe.id));let he=!1;ne.add(R.Event.any(ce.onDidAccept,ce.onDidCustom)(()=>{he=!0,ce.hide()})),ne.add(ce.onDidHide(()=>{try{he&&this.updateConfiguration(de,ce.selectedItems),te(he)}catch(pe){Z(pe)}finally{ne.dispose()}})),ce.show()})}getConfigureSyncQuickPickItems(){const te=[{id:"settings",label:(0,B.getSyncAreaLabel)("settings")},{id:"keybindings",label:(0,B.getSyncAreaLabel)("keybindings"),description:this.configurationService.getValue("settingsSync.keybindingsPerPlatform")?(0,C.localize)(49,null):void 0},{id:"snippets",label:(0,B.getSyncAreaLabel)("snippets")},{id:"tasks",label:(0,B.getSyncAreaLabel)("tasks")},{id:"extensions",label:(0,B.getSyncAreaLabel)("extensions")},{id:"globalState",label:(0,B.getSyncAreaLabel)("globalState")}];return this.userDataProfilesService.isEnabled()&&(!this.environmentService.isBuilt||this.productService.enableSyncingProfiles)&&te.push({id:"profiles",label:(0,B.getSyncAreaLabel)("profiles")}),te}updateConfiguration(te,Z){for(const ne of te){const ce=this.userDataSyncEnablementService.isResourceEnabled(ne.id),de=!!Z.filter(he=>he.id===ne.id)[0];ce!==de&&this.userDataSyncEnablementService.setResourceEnablement(ne.id,de)}}async configureSyncOptions(){return new Promise((te,Z)=>{const ne=new A.DisposableStore,ce=this.quickInputService.createQuickPick();ne.add(ce),ce.title=(0,C.localize)(50,null,B.SYNC_TITLE),ce.placeholder=(0,C.localize)(51,null),ce.canSelectMany=!0,ce.ignoreFocusOut=!0,ce.ok=!0;const de=this.getConfigureSyncQuickPickItems();ce.items=de,ce.selectedItems=de.filter(he=>this.userDataSyncEnablementService.isResourceEnabled(he.id)),ne.add(ce.onDidAccept(async()=>{ce.selectedItems.length&&(this.updateConfiguration(de,ce.selectedItems),ce.hide())})),ne.add(ce.onDidHide(()=>{ne.dispose(),te()})),ce.show()})}async turnOff(){const te=await this.dialogService.confirm({type:"info",message:(0,C.localize)(52,null),detail:(0,C.localize)(53,null),primaryButton:(0,C.localize)(54,null),checkbox:this.userDataSyncWorkbenchService.accountStatus==="available"?{label:(0,C.localize)(55,null)}:void 0});if(te.confirmed)return this.userDataSyncWorkbenchService.turnoff(!!te.checkboxChecked)}disableSync(te){switch(te){case"settings":return this.userDataSyncEnablementService.setResourceEnablement("settings",!1);case"keybindings":return this.userDataSyncEnablementService.setResourceEnablement("keybindings",!1);case"snippets":return this.userDataSyncEnablementService.setResourceEnablement("snippets",!1);case"tasks":return this.userDataSyncEnablementService.setResourceEnablement("tasks",!1);case"extensions":return this.userDataSyncEnablementService.setResourceEnablement("extensions",!1);case"globalState":return this.userDataSyncEnablementService.setResourceEnablement("globalState",!1)}}showSyncActivity(){return this.outputService.showChannel(g.userDataSyncLogChannelId)}async selectSettingsSyncService(te){return new Promise((Z,ne)=>{const ce=new A.DisposableStore,de=ce.add(this.quickInputService.createQuickPick());de.title=(0,C.localize)(56,null,B.SYNC_TITLE),de.description=(0,C.localize)(57,null),de.hideInput=!0,de.ignoreFocusOut=!0;const he=pe=>{if((0,k.isEqual)(pe,te.defaultUrl))return(0,C.localize)(58,null)};de.items=[{id:"insiders",label:(0,C.localize)(59,null),description:he(te.insidersUrl)},{id:"stable",label:(0,C.localize)(60,null),description:he(te.stableUrl)}],ce.add(de.onDidAccept(async()=>{try{await this.userDataSyncStoreManagementService.switch(de.selectedItems[0].id),Z()}catch(pe){ne(pe)}finally{de.hide()}})),ce.add(de.onDidHide(()=>ce.dispose())),de.show()})}registerActions(){this.userDataSyncEnablementService.canToggleEnablement()&&(this.registerTurnOnSyncAction(),this.registerTurnOffSyncAction()),this.registerTurningOnSyncAction(),this.registerCancelTurnOnSyncAction(),this.registerSignInAction(),this.registerShowConflictsAction(),this.registerEnableSyncViewsAction(),this.registerManageSyncAction(),this.registerSyncNowAction(),this.registerConfigureSyncAction(),this.registerShowSettingsAction(),this.registerHelpAction(),this.registerShowLogAction(),this.registerResetSyncDataAction(),this.registerAcceptMergesAction()}registerTurnOnSyncAction(){const te=f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),B.CONTEXT_SYNC_ENABLEMENT.toNegated(),B.CONTEXT_ACCOUNT_STATE.notEqualsTo("uninitialized"),ie.negate());u.CommandsRegistry.registerCommand(X.id,()=>this.turnOn()),r.MenuRegistry.appendMenuItem(r.MenuId.GlobalActivity,{group:"5_settings",command:{id:X.id,title:(0,C.localize)(61,null)},when:f.ContextKeyExpr.and(te),order:3}),r.MenuRegistry.appendMenuItem(r.MenuId.CommandPalette,{command:X,when:te}),r.MenuRegistry.appendMenuItem(r.MenuId.MenubarPreferencesMenu,{group:"5_settings",command:{id:X.id,title:(0,C.localize)(62,null)},when:te,order:3}),r.MenuRegistry.appendMenuItem(r.MenuId.AccountsContext,{group:"1_settings",command:{id:X.id,title:(0,C.localize)(63,null)},when:te,order:2})}registerTurningOnSyncAction(){const te=f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),B.CONTEXT_SYNC_ENABLEMENT.toNegated(),B.CONTEXT_ACCOUNT_STATE.notEqualsTo("uninitialized"),ie);this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userData.actions.turningOn",title:(0,C.localize)(64,null),precondition:f.ContextKeyExpr.false(),menu:[{group:"5_settings",id:r.MenuId.GlobalActivity,when:te,order:3},{group:"1_settings",id:r.MenuId.AccountsContext,when:te}]})}async run(){}}))}registerCancelTurnOnSyncAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userData.actions.cancelTurnOn",title:(0,C.localize)(65,null),icon:V.Codicon.stopCircle,menu:{id:r.MenuId.ViewContainerTitle,when:f.ContextKeyExpr.and(ie,f.ContextKeyExpr.equals("viewContainer",B.SYNC_VIEW_CONTAINER_ID)),group:"navigation",order:1}})}async run(){return te.userDataSyncWorkbenchService.turnoff(!1)}}))}registerSignInAction(){const te=this,Z="workbench.userData.actions.signin",ne=f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),B.CONTEXT_SYNC_ENABLEMENT,B.CONTEXT_ACCOUNT_STATE.isEqualTo("unavailable"));this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userData.actions.signin",title:(0,C.localize)(66,null),menu:{group:"5_settings",id:r.MenuId.GlobalActivity,when:ne,order:3}})}async run(){try{await te.userDataSyncWorkbenchService.signIn()}catch(de){te.notificationService.error(de)}}})),this._register(r.MenuRegistry.appendMenuItem(r.MenuId.AccountsContext,{group:"1_settings",command:{id:Z,title:(0,C.localize)(67,null)},when:ne}))}registerShowConflictsAction(){u.CommandsRegistry.registerCommand(j.id,()=>this.userDataSyncWorkbenchService.showConflicts());const te=()=>(0,C.localize)(68,null,B.SYNC_TITLE,this.getConflictsCount());r.MenuRegistry.appendMenuItem(r.MenuId.GlobalActivity,{group:"5_settings",command:{id:j.id,get title(){return te()}},when:B.CONTEXT_HAS_CONFLICTS,order:2}),r.MenuRegistry.appendMenuItem(r.MenuId.MenubarPreferencesMenu,{group:"5_settings",command:{id:j.id,get title(){return te()}},when:B.CONTEXT_HAS_CONFLICTS,order:2}),r.MenuRegistry.appendMenuItem(r.MenuId.CommandPalette,{command:j,when:B.CONTEXT_HAS_CONFLICTS})}registerManageSyncAction(){const te=this,Z=f.ContextKeyExpr.and(B.CONTEXT_SYNC_ENABLEMENT,B.CONTEXT_ACCOUNT_STATE.isEqualTo("available"),B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"));this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userDataSync.actions.manage",title:(0,C.localize)(69,null),menu:[{id:r.MenuId.GlobalActivity,group:"5_settings",when:Z,order:3},{id:r.MenuId.MenubarPreferencesMenu,group:"5_settings",when:Z,order:3},{id:r.MenuId.AccountsContext,group:"1_settings",when:Z}]})}run(ce){return new Promise((de,he)=>{const pe=ce.get(d.IQuickInputService),me=ce.get(u.ICommandService),Se=new A.DisposableStore,Ie=pe.createQuickPick();Se.add(Ie);const ve=[];if(te.userDataSyncService.conflicts.length&&(ve.push({id:j.id,label:j.title}),ve.push({type:"separator"})),ve.push({id:Q.id,label:Q.title}),ve.push({id:Y.id,label:Y.title}),ve.push({id:ee.id,label:ee.title}),ve.push({type:"separator"}),ve.push({id:K.id,label:K.title,description:K.description(te.userDataSyncService)}),te.userDataSyncEnablementService.canToggleEnablement()){const be=te.userDataSyncWorkbenchService.current;ve.push({id:G.id,label:G.title,description:be?`${be.accountName} (${te.authenticationService.getLabel(be.authenticationProviderId)})`:void 0})}Ie.items=ve,Se.add(Ie.onDidAccept(()=>{Ie.selectedItems[0]&&Ie.selectedItems[0].id&&me.executeCommand(Ie.selectedItems[0].id),Ie.hide()})),Se.add(Ie.onDidHide(()=>{Se.dispose(),de()})),Ie.show()})}}))}registerEnableSyncViewsAction(){const te=this,Z=f.ContextKeyExpr.and(B.CONTEXT_ACCOUNT_STATE.isEqualTo("available"),B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"));this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:ee.id,title:{value:(0,C.localize)(70,null),original:"Show Synced Data"},category:{value:B.SYNC_TITLE,original:"Settings Sync"},precondition:Z,menu:{id:r.MenuId.CommandPalette,when:Z}})}run(ce){return te.userDataSyncWorkbenchService.showSyncActivity()}}))}registerSyncNowAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:K.id,title:K.title,menu:{id:r.MenuId.CommandPalette,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_ENABLEMENT,B.CONTEXT_ACCOUNT_STATE.isEqualTo("available"),B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"))}})}run(ne){return te.userDataSyncWorkbenchService.syncNow()}}))}registerTurnOffSyncAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:G.id,title:G.title,menu:{id:r.MenuId.CommandPalette,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),B.CONTEXT_SYNC_ENABLEMENT)}})}async run(){try{await te.turnOff()}catch(ne){(0,p.isCancellationError)(ne)||te.notificationService.error((0,C.localize)(71,null,`command:${B.SHOW_SYNC_LOG_COMMAND_ID}`))}}}))}registerConfigureSyncAction(){const te=this,Z=f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"),B.CONTEXT_SYNC_ENABLEMENT);this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:Q.id,title:Q.title,icon:V.Codicon.settingsGear,tooltip:(0,C.localize)(72,null),menu:[{id:r.MenuId.CommandPalette,when:Z},{id:r.MenuId.ViewContainerTitle,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_ENABLEMENT,f.ContextKeyExpr.equals("viewContainer",B.SYNC_VIEW_CONTAINER_ID)),group:"navigation",order:2}]})}run(){return te.configureSyncOptions()}}))}registerShowLogAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:B.SHOW_SYNC_LOG_COMMAND_ID,title:(0,C.localize)(73,null,B.SYNC_TITLE),tooltip:(0,C.localize)(74,null),icon:V.Codicon.output,menu:[{id:r.MenuId.CommandPalette,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"))},{id:r.MenuId.ViewContainerTitle,when:f.ContextKeyExpr.equals("viewContainer",B.SYNC_VIEW_CONTAINER_ID),group:"navigation",order:1}]})}run(){return te.showSyncActivity()}}))}registerShowSettingsAction(){this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:Y.id,title:Y.title,menu:{id:r.MenuId.CommandPalette,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"))}})}run(Z){Z.get(w.IPreferencesService).openUserSettings({jsonEditor:!1,query:"@tag:sync"})}}))}registerHelpAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userDataSync.actions.help",title:{value:B.SYNC_TITLE,original:"Settings Sync"},category:x.Categories.Help,menu:[{id:r.MenuId.CommandPalette,when:f.ContextKeyExpr.and(B.CONTEXT_SYNC_STATE.notEqualsTo("uninitialized"))}]})}run(){return te.openerService.open(E.URI.parse("https://aka.ms/vscode-settings-sync-help"))}})),r.MenuRegistry.appendMenuItem(r.MenuId.ViewContainerTitle,{command:{id:"workbench.userDataSync.actions.help",title:x.Categories.Help.value},when:f.ContextKeyExpr.equals("viewContainer",B.SYNC_VIEW_CONTAINER_ID),group:"1_help"})}registerAcceptMergesAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.userDataSync.actions.acceptMerges",title:(0,C.localize)(75,null),menu:[{id:r.MenuId.EditorContent,when:f.ContextKeyExpr.and($.ctxIsMergeResultEditor,f.ContextKeyExpr.regex($.ctxMergeBaseUri.key,new RegExp(`^${a.USER_DATA_SYNC_SCHEME}:`)))}]})}async run(ne,ce){const de=ne.get(U.ITextFileService);await de.save(ce);const he=await de.read(ce);await te.userDataSyncService.accept(this.getSyncResource(ce),ce,he.value,!0)}getSyncResource(ne){const ce=te.userDataSyncService.conflicts.find(({conflicts:de})=>de.some(he=>(0,k.isEqual)(he.previewResource,ne)));if(ce)return ce;throw new Error(`Unknown resource: ${ne.toString()}`)}}))}registerViews(){const te=this.registerViewContainer();this.registerDataViews(te)}registerViewContainer(){return M.Registry.as(N.Extensions.ViewContainersRegistry).registerViewContainer({id:B.SYNC_VIEW_CONTAINER_ID,title:B.SYNC_TITLE,ctorDescriptor:new O.SyncDescriptor(z.ViewPaneContainer,[B.SYNC_VIEW_CONTAINER_ID,{mergeViewWithContainerWhenSingleView:!0}]),icon:B.SYNC_VIEW_ICON,hideIfEmpty:!0},0)}registerResetSyncDataAction(){const te=this;this._register((0,r.registerAction2)(class extends r.Action2{constructor(){super({id:"workbench.actions.syncData.reset",title:(0,C.localize)(76,null),menu:[{id:r.MenuId.ViewContainerTitle,when:f.ContextKeyExpr.equals("viewContainer",B.SYNC_VIEW_CONTAINER_ID),group:"0_configure"}]})}run(){return te.userDataSyncWorkbenchService.resetSyncedData()}}))}registerDataViews(te){this._register(this.instantiationService.createInstance(P.UserDataSyncDataViews,te))}};re=we([F(0,a.IUserDataSyncEnablementService),F(1,a.IUserDataSyncService),F(2,B.IUserDataSyncWorkbenchService),F(3,f.IContextKeyService),F(4,v.IActivityService),F(5,s.INotificationService),F(6,m.IEditorService),F(7,W.IUserDataProfilesService),F(8,c.IDialogService),F(9,d.IQuickInputService),F(10,l.IInstantiationService),F(11,h.IOutputService),F(12,D.IUserDataSyncAccountService),F(13,a.IUserDataAutoSyncService),F(14,S.ITextModelService),F(15,w.IPreferencesService),F(16,n.ITelemetryService),F(17,T.IProductService),F(18,_.IOpenerService),F(19,L.IAuthenticationService),F(20,a.IUserDataSyncStoreManagementService),F(21,i.IConfigurationService),F(22,q.IEnvironmentService),F(23,H.IHostService)],re),e.UserDataSyncWorkbenchContribution=re;let oe=class{constructor(te,Z,ne){this.userDataSyncService=te,this.modelService=Z,this.languageService=ne}provideTextContent(te){return te.scheme===a.USER_DATA_SYNC_SCHEME?this.userDataSyncService.resolveContent(te).then(Z=>this.modelService.createModel(Z||"",this.languageService.createById("jsonc"),te)):null}};oe=we([F(0,a.IUserDataSyncService),F(1,I.IModelService),F(2,b.ILanguageService)],oe)}),define(ae[3010],le([1,0,44,17,3009,95,26,2,1952,14,2688,36,46,31,74,276]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let c=class extends E.Disposable{constructor(d,n,a,o,g){super(),this.notificationService=n,this.productService=a,this.commandService=o,this.hostService=g,this._register(d.onError(h=>this.onAutoSyncError(h)))}onAutoSyncError(d){switch(d.code){case"LocalTooManyRequests":{const n=b.isWeb?(0,I.localize)(0,null,this.productService.nameLong):(0,I.localize)(1,null,this.productService.nameLong);this.notificationService.notify({severity:k.Severity.Error,message:n,actions:{primary:[new C.Action("Show Sync Logs",(0,I.localize)(2,null),void 0,!0,()=>this.commandService.executeCommand(f.SHOW_SYNC_LOG_COMMAND_ID)),new C.Action("Restart",b.isWeb?(0,I.localize)(3,null):(0,I.localize)(4,null),void 0,!0,()=>this.hostService.restart())]}});return}case"RemoteTooManyRequests":{const n=d.operationId?(0,I.localize)(5,null,d.operationId):void 0,a=(0,I.localize)(6,null);this.notificationService.notify({severity:k.Severity.Error,message:n?`${a} ${n}`:a,source:d.operationId?(0,I.localize)(7,null,d.operationId):void 0,actions:{primary:[new C.Action("Show Sync Logs",(0,I.localize)(8,null),void 0,!0,()=>this.commandService.executeCommand(f.SHOW_SYNC_LOG_COMMAND_ID))]}});return}}}};c=we([F(0,A.IUserDataAutoSyncService),F(1,k.INotificationService),F(2,r.IProductService),F(3,u.ICommandService),F(4,i.IHostService)],c);const l=p.Registry.as(t.Extensions.Workbench);l.registerWorkbenchContribution(R.UserDataSyncWorkbenchContribution,3),l.registerWorkbenchContribution(S.UserDataSyncTrigger,4),l.registerWorkbenchContribution(c,4)}),define(ae[3011],le([1,0,2,14,38,27,1956,17,55,34,44,69,8,404,319,550,83,341,10,368,58,31,13,214,312,249,12,73,7,189,1183]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WatermarkContribution=void 0;const T=s.$,_={text:k.localize(0,null),id:f.ShowAllCommandsAction.ID},L={text:k.localize(1,null),id:"workbench.action.quickOpen"},M={text:k.localize(2,null),id:u.OpenFileAction.ID,mac:!1},O={text:k.localize(3,null),id:u.OpenFolderAction.ID,mac:!1},N={text:k.localize(4,null),id:u.OpenFileFolderAction.ID,mac:!0},P={text:k.localize(5,null),id:i.OpenRecentAction.ID},B={text:k.localize(6,null),id:h.NEW_UNTITLED_FILE_COMMAND_ID},V=Object.assign({mac:!0},B),z={text:k.localize(7,null),id:l.FindInFilesActionId},x={text:k.localize(8,null),id:"workbench.action.terminal.toggleTerminal",when:y.TerminalContextKeys.processSupported},H={text:k.localize(9,null),id:v.DEBUG_START_COMMAND_ID,when:y.TerminalContextKeys.processSupported},W={text:k.localize(10,null),id:"workbench.action.toggleFullScreen",when:y.TerminalContextKeys.processSupported.toNegated()},U={text:k.localize(11,null),id:"workbench.action.openSettings",when:y.TerminalContextKeys.processSupported.toNegated()},$=[_,M,O,N,P,V],q=[_,L,z,H,x,W,U],X="workbench.tips.enabled";let G=class extends t.Disposable{constructor(j,K,Y,ee,ie,re,oe,se,te){super(),this.lifecycleService=j,this.layoutService=K,this.keybindingService=Y,this.contextService=ee,this.contextKeyService=ie,this.configurationService=re,this.editorGroupsService=oe,this.themeService=se,this.telemetryService=te,this.watermarkDisposable=this._register(new t.DisposableStore),this.workbenchState=ee.getWorkbenchState(),this.enabled=this.configurationService.getValue(X),this.registerListeners(),this.enabled&&this.create()}registerListeners(){this.lifecycleService.onDidShutdown(()=>this.dispose()),this._register(this.configurationService.onDidChangeConfiguration(Y=>{if(Y.affectsConfiguration(X)){const ee=this.configurationService.getValue(X);ee!==this.enabled&&(this.enabled=ee,this.enabled?this.create():this.destroy())}})),this._register(this.contextService.onDidChangeWorkbenchState(Y=>{const ee=this.workbenchState;this.workbenchState=this.contextService.getWorkbenchState(),this.enabled&&this.workbenchState!==ee&&this.recreate()}));const j=[...$,...q].filter(Y=>Y.when!==void 0).map(Y=>Y.when),K=new Set;j.forEach(Y=>Y.keys().forEach(ee=>K.add(ee))),this._register(this.contextKeyService.onDidChangeContext(Y=>{Y.affectsSome(K)&&this.recreate()}))}create(){const j=(0,o.assertIsDefined)(this.layoutService.getContainer("workbench.parts.editor"));j.classList.add("has-watermark"),this.watermark=T(".watermark");const K=s.append(this.watermark,T(".watermark-box")),ee=(this.workbenchState!==1?q:$).filter(oe=>!("when"in oe)||this.contextKeyService.contextMatchesRules(oe.when)).filter(oe=>!("mac"in oe)||oe.mac===(p.isMacintosh&&!p.isWeb)).filter(oe=>!!a.CommandsRegistry.getCommand(oe.id)),ie=this.watermarkDisposable.add(new t.DisposableStore),re=()=>{s.clearNode(K),ie.clear(),ee.map(oe=>{const se=s.append(K,T("dl")),te=s.append(se,T("dt"));te.textContent=oe.text;const Z=s.append(se,T("dd")),ne=new d.KeybindingLabel(Z,p.OS,{renderUnboundKeybindings:!0});ie.add((0,w.attachKeybindingLabelStyler)(ne,this.themeService)),ne.set(this.keybindingService.lookupKeybinding(oe.id))})};re(),s.prepend(j.firstElementChild,this.watermark),this.watermarkDisposable.add(this.keybindingService.onDidUpdateKeybindings(re)),this.watermarkDisposable.add(this.editorGroupsService.onDidLayout(oe=>this.handleEditorPartSize(j,oe))),this.handleEditorPartSize(j,this.editorGroupsService.contentDimension),this.telemetryService.publicLog("watermark:open")}handleEditorPartSize(j,K){j.classList.toggle("max-height-478px",K.height<=478)}destroy(){this.watermark&&(this.watermark.remove(),this.layoutService.getContainer("workbench.parts.editor")?.classList.remove("has-watermark"),this.watermarkDisposable.clear())}recreate(){this.destroy(),this.create()}};G=we([F(0,C.ILifecycleService),F(1,c.IWorkbenchLayoutService),F(2,R.IKeybindingService),F(3,b.IWorkspaceContextService),F(4,D.IContextKeyService),F(5,r.IConfigurationService),F(6,n.IEditorGroupsService),F(7,m.IThemeService),F(8,A.ITelemetryService)],G),e.WatermarkContribution=G,E.Registry.as(S.Extensions.Workbench).registerWorkbenchContribution(G,3),E.Registry.as(I.Extensions.Configuration).registerConfiguration({...g.workbenchConfigurationNodeBase,properties:{"workbench.tips.enabled":{type:"boolean",default:!0,description:k.localize(12,null)}}})}),define(ae[3012],le([1,0,1963,5,2,13,10,31,46,959,12,2431,33,38,27,147,902,41,9,188,23,8,7,200,34,21,49,130,74,14,11,661,58,48,182,73,254,367,202,42,39,72,19,165,26,22,16,193,80,903,184,2432,90,213,71,404,319,197,29,987,2505,111,143,723]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GettingStartedInputSerializer=e.GettingStartedPage=e.embedderIdentifierContext=e.inWelcomeContext=e.allWalkthroughsHiddenContext=void 0;const pe=250,me="workbench.startupEditor";e.allWalkthroughsHiddenContext=new o.RawContextKey("allWalkthroughsHidden",!1),e.inWelcomeContext=new o.RawContextKey("inWelcome",!1),e.embedderIdentifierContext=new o.RawContextKey("embedderIdentifier",void 0);const Se=j.startEntries.map((ge,ue)=>({command:ge.content.command,description:ge.description,icon:{type:"icon",icon:ge.icon},id:ge.id,order:ue,title:ge.title,when:o.ContextKeyExpr.deserialize(ge.when)??o.ContextKeyExpr.true()})),Ie="workbench.welcomePage.preferReducedMotion";let ve=class xc extends d.EditorPane{constructor(ue,Ce,De,Ae,Pe,fe,ye,ke,Ee,Te,_e,Re,Le,Me,Oe,Ke,We,Xe,Je,rt,je,Ue,Fe){super(xc.ID,fe,Te,_e),this.commandService=ue,this.productService=Ce,this.keybindingService=De,this.gettingStartedService=Ae,this.configurationService=Pe,this.languageService=ye,this.fileService=ke,this.openerService=Ee,this.storageService=_e,this.extensionService=Re,this.instantiationService=Le,this.notificationService=Me,this.groupsService=Oe,this.quickInputService=We,this.labelService=Je,this.hostService=rt,this.webviewService=je,this.workspaceContextService=Ue,this.accessibilityService=Fe,this.inProgressScroll=Promise.resolve(),this.dispatchListeners=new R.DisposableStore,this.stepDisposables=new R.DisposableStore,this.detailsPageDisposables=new R.DisposableStore,this.buildSlideThrottle=new T.Throttler,this.hasScrolledToFirstCategory=!1,this.webviewID=(0,H.generateUuid)(),this.currentMediaComponent=void 0,this.container=(0,k.$)(".gettingStartedContainer",{role:"document",tabindex:0,"aria-label":(0,t.localize)(0,null)}),this.stepMediaComponent=(0,k.$)(".getting-started-media"),this.stepMediaComponent.id=(0,H.generateUuid)(),this.categoriesSlideDisposables=this._register(new R.DisposableStore),this.detailsRenderer=new ce.GettingStartedDetailsRenderer(this.fileService,this.notificationService,this.extensionService,this.languageService),this.contextService=this._register(Ke.createScoped(this.container)),e.inWelcomeContext.bindTo(this.contextService).set(!0),e.embedderIdentifierContext.bindTo(this.contextService).set(Ce.embedderIdentifier),this.gettingStartedCategories=this.gettingStartedService.getWalkthroughs(),this._register(this.dispatchListeners),this.buildSlideThrottle=new T.Throttler;const He=()=>{if(this.gettingStartedCategories=this.gettingStartedService.getWalkthroughs(),this.currentWalkthrough){const Be=this.currentWalkthrough.steps.map(nt=>nt.id),ze=this.gettingStartedCategories.find(nt=>this.currentWalkthrough?.id===nt.id);if(ze){const nt=ze.steps.map(ut=>ut.id);(0,X.equals)(nt,Be)||this.buildSlideThrottle.queue(()=>this.buildCategoriesSlide())}}else this.buildSlideThrottle.queue(()=>this.buildCategoriesSlide())};this._register(this.gettingStartedService.onDidAddWalkthrough(He)),this._register(this.gettingStartedService.onDidRemoveWalkthrough(He)),this._register(this.gettingStartedService.onDidChangeWalkthrough(Be=>{const ze=this.gettingStartedCategories.find(nt=>nt.id===Be.id);!ze||(ze.title=Be.title,ze.description=Be.description,this.container.querySelectorAll(`[x-category-title-for="${Be.id}"]`).forEach(nt=>nt.innerText=ze.title),this.container.querySelectorAll(`[x-category-description-for="${Be.id}"]`).forEach(nt=>nt.innerText=ze.description))})),this._register(this.gettingStartedService.onDidProgressStep(Be=>{const ze=this.gettingStartedCategories.find(ot=>ot.id===Be.category);if(!ze)throw Error("Could not find category with ID: "+Be.category);const nt=ze.steps.find(ot=>ot.id===Be.id);if(!nt)throw Error("Could not find step with ID: "+Be.id);const ut=this.getWalkthroughCompletionStats(ze);!nt.done&&ut.stepsComplete===ut.stepsTotal-1&&this.hideCategory(ze.id),this._register(this.configurationService.onDidChangeConfiguration(ot=>{ot.affectsConfiguration(Ie)&&this.container.classList.toggle("animatable",this.shouldAnimate())})),nt.done=Be.done,ze.id===this.currentWalkthrough?.id&&(0,A.assertIsDefined)(document.querySelectorAll(`[data-done-step-id="${Be.id}"]`)).forEach(at=>{Be.done?(at.parentElement?.setAttribute("aria-checked","true"),at.classList.remove(...S.ThemeIcon.asClassNameArray(c.gettingStartedUncheckedCodicon)),at.classList.add("complete",...S.ThemeIcon.asClassNameArray(c.gettingStartedCheckedCodicon))):(at.parentElement?.setAttribute("aria-checked","false"),at.classList.remove("complete",...S.ThemeIcon.asClassNameArray(c.gettingStartedCheckedCodicon)),at.classList.add(...S.ThemeIcon.asClassNameArray(c.gettingStartedUncheckedCodicon)))}),this.updateCategoryProgress()})),this.recentlyOpened=Xe.getRecentlyOpened(),this._register(Xe.onDidChangeRecentlyOpened(()=>{this.recentlyOpened=Xe.getRecentlyOpened(),He()}))}shouldAnimate(){return!(this.configurationService.getValue(Ie)||this.accessibilityService.isMotionReduced())}getWalkthroughCompletionStats(ue){const Ce=ue.steps.filter(De=>this.contextService.contextMatchesRules(De.when));return{stepsComplete:Ce.filter(De=>De.done).length,stepsTotal:Ce.length}}async setInput(ue,Ce,De,Ae){this.container.classList.remove("animatable"),this.editorInput=ue,await super.setInput(ue,Ce,De,Ae),await this.buildCategoriesSlide(),this.shouldAnimate()&&setTimeout(()=>this.container.classList.add("animatable"),0)}async makeCategoryVisibleWhenAvailable(ue,Ce){if(this.gettingStartedCategories.some(Ae=>Ae.id===ue)||(await this.gettingStartedService.installedExtensionsRegistered,this.gettingStartedCategories=this.gettingStartedService.getWalkthroughs()),!this.gettingStartedCategories.find(Ae=>Ae.id===ue))throw Error("Could not find category with ID: "+ue);this.scrollToCategory(ue,Ce)}registerDispatchListeners(){this.dispatchListeners.clear(),this.container.querySelectorAll("[x-dispatch]").forEach(ue=>{const[Ce,De]=(ue.getAttribute("x-dispatch")??"").split(":");Ce&&(this.dispatchListeners.add((0,k.addDisposableListener)(ue,"click",Ae=>{Ae.stopPropagation(),this.runDispatchCommand(Ce,De)})),this.dispatchListeners.add((0,k.addDisposableListener)(ue,"keyup",Ae=>{const Pe=new ee.StandardKeyboardEvent(Ae);switch(Ae.stopPropagation(),Pe.keyCode){case 3:case 10:this.runDispatchCommand(Ce,De);return}})))})}async runDispatchCommand(ue,Ce){switch(this.commandService.executeCommand("workbench.action.keepEditor"),this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:ue,argument:Ce,walkthroughId:this.currentWalkthrough?.id}),ue){case"scrollPrev":{this.scrollPrev();break}case"skip":{this.runSkip();break}case"showMoreRecents":{this.commandService.executeCommand(se.OpenRecentAction.ID);break}case"seeAllWalkthroughs":{await this.openWalkthroughSelector();break}case"openFolder":{this.contextService.contextMatchesRules(o.ContextKeyExpr.and(re.WorkbenchStateContext.isEqualTo("workspace")))?this.commandService.executeCommand(oe.OpenFolderViaWorkspaceAction.ID):this.commandService.executeCommand(y.isMacintosh?"workbench.action.files.openFileFolder":"workbench.action.files.openFolder");break}case"selectCategory":{if(!this.gettingStartedCategories.find(Ae=>Ae.id===Ce))throw Error("Could not find category with ID "+Ce);this.gettingStartedService.markWalkthroughOpened(Ce),this.gettingStartedList?.setEntries(this.gettingStartedService.getWalkthroughs()),this.scrollToCategory(Ce);break}case"selectStartEntry":{const De=j.startEntries.find(Ae=>Ae.id===Ce);if(De)this.runStepCommand(De.content.command);else throw Error("could not find start entry with id: "+Ce);break}case"hideCategory":{this.hideCategory(Ce);break}case"selectTask":{this.selectStep(Ce);break}case"toggleStepCompletion":{this.toggleStepCompletion(Ce);break}case"allDone":{this.markAllStepsComplete();break}case"nextSection":{const De=this.currentWalkthrough?.next;De?this.scrollToCategory(De):console.error("Error scrolling to next section of",this.currentWalkthrough);break}default:{console.error("Dispatch to",ue,Ce,"not defined");break}}}hideCategory(ue){if(!this.gettingStartedCategories.find(De=>De.id===ue))throw Error("Could not find category with ID "+ue);this.setHiddenCategories([...this.getHiddenCategories().add(ue)]),this.gettingStartedList?.rerender()}markAllStepsComplete(){if(this.currentWalkthrough)this.currentWalkthrough?.steps.forEach(ue=>{ue.done||this.gettingStartedService.progressStep(ue.id)}),this.hideCategory(this.currentWalkthrough?.id),this.scrollPrev();else throw Error("No walkthrough opened")}toggleStepCompletion(ue){(0,A.assertIsDefined)(this.currentWalkthrough?.steps.find(De=>De.id===ue)).done?this.gettingStartedService.deprogressStep(ue):this.gettingStartedService.progressStep(ue)}async openWalkthroughSelector(){const ue=await this.quickInputService.pick(this.gettingStartedCategories.filter(Ce=>this.contextService.contextMatchesRules(Ce.when)).map(Ce=>({id:Ce.id,label:Ce.title,detail:Ce.description,description:Ce.source})),{canPickMany:!1,matchOnDescription:!0,matchOnDetail:!0,title:(0,t.localize)(1,null)});ue&&this.runDispatchCommand("selectCategory",ue.id)}getHiddenCategories(){return new Set(JSON.parse(this.storageService.get(b.hiddenEntriesConfigurationKey,0,"[]")))}setHiddenCategories(ue){this.storageService.store(b.hiddenEntriesConfigurationKey,JSON.stringify(ue),0,0)}async buildMediaComponent(ue){if(!this.currentWalkthrough)throw Error("no walkthrough selected");const Ce=(0,A.assertIsDefined)(this.currentWalkthrough.steps.find(De=>De.id===ue));if(this.currentMediaComponent!==ue){if(this.currentMediaComponent=ue,this.stepDisposables.clear(),this.stepDisposables.add({dispose:()=>{(0,k.clearNode)(this.stepMediaComponent),this.currentMediaComponent=void 0}}),Ce.media.type==="image"){this.stepsContent.classList.add("image"),this.stepsContent.classList.remove("markdown");const De=Ce.media,Ae=(0,k.$)("img");this.stepMediaComponent.appendChild(Ae),Ae.setAttribute("alt",De.altText),this.updateMediaSourceForColorMode(Ae,De.path),this.stepDisposables.add((0,k.addDisposableListener)(this.stepMediaComponent,"click",()=>{const Pe=(0,X.flatten)(Ce.description.map(fe=>fe.nodes.filter(ye=>typeof ye!="string").map(ye=>ye.href)));if(Pe.length===1){const fe=Pe[0];fe.startsWith("http")&&(this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"runStepAction",argument:fe,walkthroughId:this.currentWalkthrough?.id}),this.openerService.open(fe))}})),this.stepDisposables.add(this.themeService.onDidColorThemeChange(()=>this.updateMediaSourceForColorMode(Ae,De.path)))}else if(Ce.media.type==="svg"){this.stepsContent.classList.add("image"),this.stepsContent.classList.remove("markdown");const De=Ce.media,Ae=this.stepDisposables.add(this.webviewService.createWebviewElement({id:this.webviewID,options:{},contentOptions:{},extension:void 0}));Ae.mountTo(this.stepMediaComponent),Ae.html=await this.detailsRenderer.renderSVG(De.path);let Pe=!1;this.stepDisposables.add((0,R.toDisposable)(()=>{Pe=!0})),this.stepDisposables.add(this.themeService.onDidColorThemeChange(async()=>{const fe=await this.detailsRenderer.renderSVG(De.path);Pe||(Ae.html=fe)})),this.stepDisposables.add((0,k.addDisposableListener)(this.stepMediaComponent,"click",()=>{const fe=(0,X.flatten)(Ce.description.map(ye=>ye.nodes.filter(ke=>typeof ke!="string").map(ke=>ke.href)));if(fe.length===1){const ye=fe[0];ye.startsWith("http")&&(this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"runStepAction",argument:ye,walkthroughId:this.currentWalkthrough?.id}),this.openerService.open(ye))}})),this.stepDisposables.add(Ae.onDidClickLink(fe=>{((0,l.matchesScheme)(fe,q.Schemas.https)||(0,l.matchesScheme)(fe,q.Schemas.http)||(0,l.matchesScheme)(fe,q.Schemas.command))&&this.openerService.open(fe,{allowCommands:!0})}))}else if(Ce.media.type==="markdown"){this.stepsContent.classList.remove("image"),this.stepsContent.classList.add("markdown");const De=Ce.media,Ae=this.stepDisposables.add(this.webviewService.createWebviewElement({id:this.webviewID,options:{},contentOptions:{localResourceRoots:[De.root],allowScripts:!0},extension:void 0}));Ae.mountTo(this.stepMediaComponent);const Pe=await this.detailsRenderer.renderMarkdown(De.path,De.base);Ae.html=Pe;const fe=Pe.match(/checked-on=\"([^'][^"]*)\"/g)?.map(Te=>Te.slice(12,-1).replace(/&#39;/g,"'").replace(/&amp;/g,"&")),ye=()=>{const Te=fe?.filter(_e=>this.contextService.contextMatchesRules(o.ContextKeyExpr.deserialize(_e)));Te&&Ae.postMessage({enabledContextKeys:Te})};if(fe){const Te=(0,X.coalesce)(fe.map(Re=>o.ContextKeyExpr.deserialize(Re))),_e=new Set((0,X.flatten)(Te.map(Re=>Re.keys())));this.stepDisposables.add(this.contextService.onDidChangeContext(Re=>{Re.affectsSome(_e)&&ye()}))}let ke=!1;this.stepDisposables.add((0,R.toDisposable)(()=>{ke=!0})),this.stepDisposables.add(Ae.onDidClickLink(Te=>{((0,l.matchesScheme)(Te,q.Schemas.https)||(0,l.matchesScheme)(Te,q.Schemas.http)||(0,l.matchesScheme)(Te,q.Schemas.command))&&this.openerService.open(Te,{allowCommands:!0})})),this.stepDisposables.add(this.themeService.onDidColorThemeChange(async()=>{const Te=await this.detailsRenderer.renderMarkdown(De.path,De.base);ke||(Ae.html=Te,ye())}));const Ee=new T.Delayer(50);this.layoutMarkdown=()=>{Ee.trigger(()=>{Ae.postMessage({layoutMeNow:!0})})},this.stepDisposables.add(Ee),this.stepDisposables.add({dispose:()=>this.layoutMarkdown=void 0}),ye(),this.stepDisposables.add(Ae.onMessage(Te=>{const _e=Te.message;_e.startsWith("command:")?this.openerService.open(_e,{allowCommands:!0}):_e.startsWith("setTheme:")?this.configurationService.updateValue(G.ThemeSettings.COLOR_THEME,_e.slice(9),2):console.error("Unexpected message",_e)}))}}}async selectStepLoose(ue){if(ue.startsWith(`${this.editorInput.selectedCategory}#`))this.selectStep(ue);else{const Ce=this.editorInput.selectedCategory+"#"+ue;this.selectStep(Ce)}}async selectStep(ue,Ce=!0,De=!1){if(!(ue&&this.editorInput.selectedStep===ue&&!De)){if(ue){let Ae=this.container.querySelector(`[data-step-id="${ue}"]`);if(!Ae){if(Ae=this.container.querySelector("[data-step-id]"),!Ae)return;ue=(0,A.assertIsDefined)(Ae.getAttribute("data-step-id"))}Ae.parentElement?.querySelectorAll(".expanded").forEach(Pe=>{Pe.getAttribute("data-step-id")!==ue&&(Pe.classList.remove("expanded"),Pe.setAttribute("aria-expanded","false"))}),setTimeout(()=>Ae.focus(),Ce&&this.shouldAnimate()?pe:0),this.editorInput.selectedStep=ue,Ae.classList.add("expanded"),Ae.setAttribute("aria-expanded","true"),this.buildMediaComponent(ue),this.gettingStartedService.progressByEvent("stepSelected:"+ue)}else this.editorInput.selectedStep=void 0;this.detailsPageScrollbar?.scanDomNode(),this.detailsScrollbar?.scanDomNode()}}updateMediaSourceForColorMode(ue,Ce){const De=this.themeService.getColorTheme().type,Ae=Ce[De].toString(!0).replace(/ /g,"%20");ue.srcset=Ae.toLowerCase().endsWith(".svg")?Ae:Ae+" 1.5x"}createEditor(ue){this.detailsPageScrollbar&&this.detailsPageScrollbar.dispose(),this.categoriesPageScrollbar&&this.categoriesPageScrollbar.dispose(),this.categoriesSlide=(0,k.$)(".gettingStartedSlideCategories.gettingStartedSlide");const Ce=(0,k.$)("button.prev-button.button-link",{"x-dispatch":"scrollPrev"},(0,k.$)("span.scroll-button.codicon.codicon-chevron-left"),(0,k.$)("span.moreText",{},(0,t.localize)(2,null)));this.stepsSlide=(0,k.$)(".gettingStartedSlideDetails.gettingStartedSlide",{},Ce),this.stepsContent=(0,k.$)(".gettingStartedDetailsContent",{}),this.detailsPageScrollbar=this._register(new f.DomScrollableElement(this.stepsContent,{className:"full-height-scrollable"})),this.categoriesPageScrollbar=this._register(new f.DomScrollableElement(this.categoriesSlide,{className:"full-height-scrollable categoriesScrollbar"})),this.stepsSlide.appendChild(this.detailsPageScrollbar.getDomNode());const De=(0,k.$)(".gettingStarted",{},this.categoriesPageScrollbar.getDomNode(),this.stepsSlide);this.container.appendChild(De),this.categoriesPageScrollbar.scanDomNode(),this.detailsPageScrollbar.scanDomNode(),ue.appendChild(this.container)}async buildCategoriesSlide(){this.categoriesSlideDisposables.clear();const ue=new te.Toggle({icon:Z.Codicon.check,actionClassName:"getting-started-checkbox",isChecked:this.configurationService.getValue(me)==="welcomePage",title:(0,t.localize)(3,null)});ue.domNode.id="showOnStartup";const Ce=(0,k.$)("label.caption",{for:"showOnStartup"},(0,t.localize)(4,null)),De=()=>{ue.checked?(this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"showOnStartupChecked",argument:void 0,walkthroughId:this.currentWalkthrough?.id}),this.configurationService.updateValue(me,"welcomePage")):(this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"showOnStartupUnchecked",argument:void 0,walkthroughId:this.currentWalkthrough?.id}),this.configurationService.updateValue(me,"none"))};this.categoriesSlideDisposables.add(ue),this.categoriesSlideDisposables.add(ue.onChange(()=>{De()})),this.categoriesSlideDisposables.add((0,k.addDisposableListener)(Ce,"click",()=>{ue.checked=!ue.checked,De()}));const Ae=(0,k.$)(".header",{},(0,k.$)("h1.product-name.caption",{},this.productService.nameLong),(0,k.$)("p.subtitle.description",{},(0,t.localize)(5,null))),Pe=(0,k.$)(".categories-column.categories-column-left",{}),fe=(0,k.$)(".categories-column.categories-column-right",{}),ye=this.buildStartList(),ke=this.buildRecentlyOpenedList(),Ee=this.buildGettingStartedWalkthroughsList(),Te=(0,k.$)(".footer",{},(0,k.$)("p.showOnStartup",{},ue.domNode,Ce)),_e=()=>{Ee.itemCount?(this.container.classList.remove("noWalkthroughs"),(0,k.reset)(Pe,ye.getDomElement(),ke.getDomElement()),(0,k.reset)(fe,Ee.getDomElement()),ke.setLimit(5)):(this.container.classList.add("noWalkthroughs"),(0,k.reset)(Pe,ye.getDomElement()),(0,k.reset)(fe,ke.getDomElement()),ke.setLimit(10)),setTimeout(()=>this.categoriesPageScrollbar?.scanDomNode(),50)};if(Ee.onDidChange(_e),_e(),(0,k.reset)(this.categoriesSlide,(0,k.$)(".gettingStartedCategoriesContainer",{},Ae,Pe,fe,Te)),this.categoriesPageScrollbar?.scanDomNode(),this.updateCategoryProgress(),this.registerDispatchListeners(),this.editorInput.selectedCategory)if(this.currentWalkthrough=this.gettingStartedCategories.find(Le=>Le.id===this.editorInput.selectedCategory),this.currentWalkthrough||(this.container.classList.add("loading"),await this.gettingStartedService.installedExtensionsRegistered,this.container.classList.remove("loading"),this.gettingStartedCategories=this.gettingStartedService.getWalkthroughs(),this.currentWalkthrough=this.gettingStartedCategories.find(Le=>Le.id===this.editorInput.selectedCategory)),!this.currentWalkthrough)console.error("Could not restore to category "+this.editorInput.selectedCategory+" as it was not found"),this.editorInput.selectedCategory=void 0,this.editorInput.selectedStep=void 0;else{this.buildCategorySlide(this.editorInput.selectedCategory,this.editorInput.selectedStep),this.setSlide("details");return}const Re=this.gettingStartedCategories.some(Le=>Le.steps.find(Me=>Me.done));if(this.editorInput.showTelemetryNotice&&this.productService.openToWelcomeMainPage){const Le=(0,k.$)("p.telemetry-notice");this.buildTelemetryFooter(Le),Te.appendChild(Le)}else if(!this.productService.openToWelcomeMainPage&&!Re&&!this.hasScrolledToFirstCategory){const Le=this.storageService.get(i.firstSessionDateStorageKey,-1)||new Date().toUTCString();if(((+new Date-+new Date(Le))/1e3/60/60/24<1?"openToFirstCategory":"index")==="openToFirstCategory"){const Ke=this.gettingStartedCategories.filter(We=>!We.when||this.contextService.contextMatchesRules(We.when))[0];if(this.hasScrolledToFirstCategory=!0,Ke){this.currentWalkthrough=Ke,this.editorInput.selectedCategory=this.currentWalkthrough?.id,this.buildCategorySlide(this.editorInput.selectedCategory,void 0),this.setSlide("details");return}}}this.setSlide("categories")}buildRecentlyOpenedList(){const ue=De=>{let Ae,Pe;(0,g.isRecentFolder)(De)?(Pe={folderUri:De.folderUri},Ae=De.label||this.labelService.getWorkspaceLabel(De.folderUri,{verbose:!0})):(Ae=De.label||this.labelService.getWorkspaceLabel(De.workspace,{verbose:!0}),Pe={workspaceUri:De.workspace.configPath});const{name:fe,parentPath:ye}=(0,w.splitName)(Ae),ke=(0,k.$)("li"),Ee=(0,k.$)("button.button-link");Ee.innerText=fe,Ee.title=Ae,Ee.setAttribute("aria-label",(0,t.localize)(6,null,fe,ye)),Ee.addEventListener("click",_e=>{this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"openRecent",argument:void 0,walkthroughId:this.currentWalkthrough?.id}),this.hostService.openWindow([Pe],{forceNewWindow:_e.ctrlKey||_e.metaKey,remoteAuthority:De.remoteAuthority||null}),_e.preventDefault(),_e.stopPropagation()}),ke.appendChild(Ee);const Te=(0,k.$)("span");return Te.classList.add("path"),Te.classList.add("detail"),Te.innerText=ye,Te.title=Ae,ke.appendChild(Te),ke};this.recentlyOpenedList&&this.recentlyOpenedList.dispose();const Ce=this.recentlyOpenedList=new Y.GettingStartedIndexList({title:(0,t.localize)(7,null),klass:"recently-opened",limit:5,empty:(0,k.$)(".empty-recent",{},(0,t.localize)(8,null),(0,k.$)("button.button-link",{"x-dispatch":"openFolder"},(0,t.localize)(9,null)),(0,t.localize)(10,null)),more:(0,k.$)(".more",{},(0,k.$)("button.button-link",{"x-dispatch":"showMoreRecents",title:(0,t.localize)(11,null,this.getKeybindingLabel(se.OpenRecentAction.ID))},"More...")),renderElement:ue,contextService:this.contextService});return Ce.onDidChange(()=>this.registerDispatchListeners()),this.recentlyOpened.then(({workspaces:De})=>{const Ae=De.filter(fe=>!this.workspaceContextService.isCurrentWorkspace((0,g.isRecentWorkspace)(fe)?fe.workspace:fe.folderUri)).map(fe=>({...fe,id:(0,g.isRecentWorkspace)(fe)?fe.workspace.id:fe.folderUri.toString()})),Pe=()=>{Ce.setEntries(Ae)};Pe(),Ce.register(this.labelService.onDidChangeFormatters(()=>Pe()))}).catch(v.onUnexpectedError),Ce}buildStartList(){const ue=De=>(0,k.$)("li",{},(0,k.$)("button.button-link",{"x-dispatch":"selectStartEntry:"+De.id,title:De.description+" "+this.getKeybindingLabel(De.command)},this.iconWidgetFor(De),(0,k.$)("span",{},De.title)));this.startList&&this.startList.dispose();const Ce=this.startList=new Y.GettingStartedIndexList({title:(0,t.localize)(12,null),klass:"start-container",limit:10,renderElement:ue,rankElement:De=>-De.order,contextService:this.contextService});return Ce.setEntries(Se),Ce.onDidChange(()=>this.registerDispatchListeners()),Ce}buildGettingStartedWalkthroughsList(){const ue=Ae=>{const Pe=(Ae.newItems||Ae.newEntry)&&!Ae.isFeatured,fe=(0,k.$)(".new-badge",{});Ae.newEntry?(0,k.reset)(fe,(0,k.$)(".new-category",{},(0,t.localize)(13,null))):Ae.newItems&&(0,k.reset)(fe,(0,k.$)(".new-items",{},(0,t.localize)(14,null)));const ye=(0,k.$)(".featured-badge",{}),ke=(0,k.$)(".description-content",{});Ae.isFeatured&&((0,k.reset)(ye,(0,k.$)(".featured",{},(0,k.$)("span.featured-icon.codicon.codicon-star-empty"))),(0,k.reset)(ke,...(0,he.renderLabelWithIcons)(Ae.description)));const Ee=(0,k.$)("h3.category-title.max-lines-3",{"x-category-title-for":Ae.id});return(0,k.reset)(Ee,...(0,he.renderLabelWithIcons)(Ae.title)),(0,k.$)("button.getting-started-category"+(Ae.isFeatured?".featured":""),{"x-dispatch":"selectCategory:"+Ae.id,title:Ae.description},ye,(0,k.$)(".main-content",{},this.iconWidgetFor(Ae),Ee,Pe?fe:(0,k.$)(".no-badge"),(0,k.$)("a.codicon.codicon-close.hide-category-button",{tabindex:0,"x-dispatch":"hideCategory:"+Ae.id,title:(0,t.localize)(15,null)})),ke,(0,k.$)(".category-progress",{"x-data-category-id":Ae.id},(0,k.$)(".progress-bar-outer",{role:"progressbar"},(0,k.$)(".progress-bar-inner"))))};this.gettingStartedList&&this.gettingStartedList.dispose();const Ce=Ae=>{let Pe=Ae.order;return Ae.isFeatured&&(Pe+=7),Ae.newEntry&&(Pe+=3),Ae.newItems&&(Pe+=2),Ae.recencyBonus&&(Pe+=4*Ae.recencyBonus),this.getHiddenCategories().has(Ae.id)&&(Pe=null),Pe},De=this.gettingStartedList=new Y.GettingStartedIndexList({title:(0,t.localize)(16,null),klass:"getting-started",limit:5,footer:(0,k.$)("span.button-link.see-all-walkthroughs",{"x-dispatch":"seeAllWalkthroughs",tabindex:0},(0,t.localize)(17,null)),renderElement:ue,rankElement:Ce,contextService:this.contextService});return De.onDidChange(()=>{const Pe=this.getHiddenCategories().size||De.itemCount<this.gettingStartedCategories.filter(fe=>this.contextService.contextMatchesRules(fe.when)).length;this.container.classList.toggle("someWalkthroughsHidden",!!Pe),this.registerDispatchListeners(),e.allWalkthroughsHiddenContext.bindTo(this.contextService).set(De.itemCount===0),this.updateCategoryProgress()}),De.setEntries(this.gettingStartedCategories),e.allWalkthroughsHiddenContext.bindTo(this.contextService).set(De.itemCount===0),De}layout(ue){this.detailsScrollbar?.scanDomNode(),this.categoriesPageScrollbar?.scanDomNode(),this.detailsPageScrollbar?.scanDomNode(),this.startList?.layout(ue),this.gettingStartedList?.layout(ue),this.recentlyOpenedList?.layout(ue),this.layoutMarkdown?.(),this.container.classList.toggle("height-constrained",ue.height<=600),this.container.classList.toggle("width-constrained",ue.width<=400),this.container.classList.toggle("width-semi-constrained",ue.width<=800)}updateCategoryProgress(){document.querySelectorAll(".category-progress").forEach(ue=>{const Ce=ue.getAttribute("x-data-category-id"),De=this.gettingStartedCategories.find(ye=>ye.id===Ce);if(!De)throw Error("Could not find category with ID "+Ce);const Ae=this.getWalkthroughCompletionStats(De),Pe=(0,A.assertIsDefined)(ue.querySelector(".progress-bar-inner"));Pe.setAttribute("aria-valuemin","0"),Pe.setAttribute("aria-valuenow",""+Ae.stepsComplete),Pe.setAttribute("aria-valuemax",""+Ae.stepsTotal);const fe=Ae.stepsComplete/Ae.stepsTotal*100;Pe.style.width=`${fe}%`,ue.parentElement.classList.toggle("no-progress",Ae.stepsComplete===0),Ae.stepsTotal===Ae.stepsComplete?Pe.title=(0,t.localize)(18,null,Ae.stepsComplete):Pe.title=(0,t.localize)(19,null,Ae.stepsComplete,Ae.stepsTotal)})}async scrollToCategory(ue,Ce){this.inProgressScroll=this.inProgressScroll.then(async()=>{(0,k.reset)(this.stepsContent),this.editorInput.selectedCategory=ue,this.editorInput.selectedStep=Ce,this.currentWalkthrough=this.gettingStartedCategories.find(De=>De.id===ue),this.buildCategorySlide(ue),this.setSlide("details")})}iconWidgetFor(ue){const Ce=ue.icon.type==="icon"?(0,k.$)(S.ThemeIcon.asCSSSelector(ue.icon.icon)):(0,k.$)("img.category-icon",{src:ue.icon.path});return Ce.classList.add("icon-widget"),Ce}runStepCommand(ue){const Ce=ue.startsWith("command:"),De=ue.startsWith("command:toSide:"),Ae=ue.replace(/command:(toSide:)?/,"command:");this.telemetryService.publicLog2("gettingStarted.ActionExecuted",{command:"runStepAction",argument:ue,walkthroughId:this.currentWalkthrough?.id});const Pe=this.groupsService.contentDimension;if(De&&Pe.width>700){if(this.groupsService.count===1){this.groupsService.addGroup(this.groupsService.groups[0],2,{activate:!0});let ye;Pe.width>1600?ye=800:Pe.width>800?ye=400:ye=350;const ke=this.groupsService.getGroups(1).find(Ee=>Ee.activeEditor instanceof _.GettingStartedInput);this.groupsService.setSize((0,A.assertIsDefined)(ke),{width:ye,height:Pe.height})}const fe=this.groupsService.getGroups(1).find(ye=>!(ye.activeEditor instanceof _.GettingStartedInput));fe&&(this.groupsService.activateGroup(fe),fe.focus())}if(Ce){const fe=s.URI.parse(Ae);let ye=[];try{ye=(0,U.parse)(decodeURIComponent(fe.query))}catch{try{ye=(0,U.parse)(fe.query)}catch{}}Array.isArray(ye)||(ye=[ye]),this.commandService.executeCommand(fe.path,...ye).then(ke=>{const Ee=ke?.openFolder;if(Ee){if(!s.URI.isUri(Ee)){console.warn("Warn: Running walkthrough command",ue,"yielded non-URI `openFolder` result",Ee,". It will be disregarded.");return}const Te={folder:Ee.toString(),category:this.editorInput.selectedCategory,step:this.editorInput.selectedStep};this.storageService.store(ne.restoreWalkthroughsConfigurationKey,JSON.stringify(Te),0,1),this.hostService.openWindow([{folderUri:Ee}])}})}else this.openerService.open(Ae,{allowCommands:!0});!Ce&&(ue.startsWith("https://")||ue.startsWith("http://"))&&this.gettingStartedService.progressByEvent("onLink:"+ue)}buildStepMarkdownDescription(ue,Ce){for(;ue.firstChild;)ue.removeChild(ue.firstChild);for(const De of Ce)if(De.nodes.length===1&&typeof De.nodes[0]!="string"){const Ae=De.nodes[0],Pe=(0,k.append)(ue,(0,k.$)(".button-container")),fe=new O.Button(Pe,{title:Ae.title,supportIcons:!0}),ye=Ae.href.startsWith("command:"),ke=Ae.href.replace(/command:(toSide:)?/,"command:");if(fe.label=Ae.label,fe.onDidClick(Ee=>{Ee.stopPropagation(),Ee.preventDefault(),this.runStepCommand(Ae.href)},null,this.detailsPageDisposables),ye){const Ee=this.getKeybindingLabel(ke);Ee&&ue.appendChild((0,k.$)("span.shortcut-message",{},(0,t.localize)(20,null),(0,k.$)("span.keybinding",{},Ee)))}this.detailsPageDisposables.add(fe),this.detailsPageDisposables.add((0,N.attachButtonStyler)(fe,this.themeService))}else{const Ae=(0,k.append)(ue,(0,k.$)("p"));for(const Pe of De.nodes)if(typeof Pe=="string"){const fe=(0,he.renderLabelWithIcons)(Pe);for(const ye of fe)typeof ye=="string"?Ae.appendChild((0,B.renderFormattedText)(ye,{inline:!0,renderCodeSegments:!0})):Ae.appendChild(ye)}else{const fe=this.instantiationService.createInstance(P.Link,Ae,Pe,{opener:ye=>this.runStepCommand(ye)});this.detailsPageDisposables.add(fe)}}return ue}clearInput(){this.stepDisposables.clear(),super.clearInput()}buildCategorySlide(ue,Ce){this.detailsScrollbar&&this.detailsScrollbar.dispose(),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{this.extensionService.activateByEvent(`onWalkthrough:${ue.replace(/[^#]+#/,"")}`)}),this.detailsPageDisposables.clear();const De=this.gettingStartedCategories.find(Me=>Me.id===ue);if(!De)throw Error("could not find category with ID "+ue);const Ae=(0,k.$)(".getting-started-category",{},this.iconWidgetFor(De),(0,k.$)(".category-description-container",{},(0,k.$)("h2.category-title.max-lines-3",{"x-category-title-for":De.id},...(0,he.renderLabelWithIcons)(De.title)),(0,k.$)(".category-description.description.max-lines-3",{"x-category-description-for":De.id},...(0,he.renderLabelWithIcons)(De.description)))),Pe=(0,k.$)(".step-list-container");this.detailsPageDisposables.add((0,k.addDisposableListener)(Pe,"keydown",Me=>{const Oe=new ee.StandardKeyboardEvent(Me),Ke=()=>De.steps.findIndex(We=>We.id===this.editorInput.selectedStep);if(Oe.keyCode===16){const We=De.steps.filter((Xe,Je)=>Je<Ke()&&this.contextService.contextMatchesRules(Xe.when));We.length&&this.selectStep(We[We.length-1].id,!1,!1)}if(Oe.keyCode===18){const We=De.steps.find((Xe,Je)=>Je>Ke()&&this.contextService.contextMatchesRules(Xe.when));We&&this.selectStep(We.id,!1,!1)}}));let fe;const ye=new Set(De.steps.flatMap(Me=>Me.when.keys())),ke=()=>{const Me=De.steps.filter(Oe=>this.contextService.contextMatchesRules(Oe.when));(0,X.equals)(fe,Me,(Oe,Ke)=>Oe.id===Ke.id)||(fe=Me,(0,k.reset)(Pe,...fe.map(Oe=>{const Ke=(0,k.$)(".codicon"+(Oe.done?".complete"+S.ThemeIcon.asCSSSelector(c.gettingStartedCheckedCodicon):S.ThemeIcon.asCSSSelector(c.gettingStartedUncheckedCodicon)),{"data-done-step-id":Oe.id,"x-dispatch":"toggleStepCompletion:"+Oe.id}),We=(0,k.$)(".step-description-container",{"x-step-description-for":Oe.id});this.buildStepMarkdownDescription(We,Oe.description);const Xe=(0,k.$)("h3.step-title.max-lines-3",{"x-step-title-for":Oe.id});(0,k.reset)(Xe,...(0,he.renderLabelWithIcons)(Oe.title));const Je=(0,k.$)(".step-container",{},Xe,We);return Oe.media.type==="image"&&Je.appendChild((0,k.$)(".image-description",{"aria-label":(0,t.localize)(21,null,Oe.media.altText)})),(0,k.$)("button.getting-started-step",{"x-dispatch":"selectTask:"+Oe.id,"data-step-id":Oe.id,"aria-expanded":"false","aria-checked":""+Oe.done,role:"button"},Ke,Je)})))};ke(),this.detailsPageDisposables.add(this.contextService.onDidChangeContext(Me=>{Me.affectsSome(ye)&&(ke(),this.registerDispatchListeners(),this.selectStep(this.editorInput.selectedStep,!1,!0))}));const Ee=this.gettingStartedCategories.find(Me=>Me.id===De.next),Te=(0,k.$)(".getting-started-detail-container",{role:"list"},Pe,(0,k.$)(".done-next-container",{},(0,k.$)("button.button-link.all-done",{"x-dispatch":"allDone"},(0,k.$)("span.codicon.codicon-check-all"),(0,t.localize)(22,null)),...Ee?[(0,k.$)("button.button-link.next",{"x-dispatch":"nextSection"},(0,t.localize)(23,null),(0,k.$)("span.codicon.codicon-arrow-small-right"))]:[]));this.detailsScrollbar=this._register(new f.DomScrollableElement(Te,{className:"steps-container"}));const _e=this.detailsScrollbar.getDomNode(),Re=(0,k.$)(".getting-started-footer");this.editorInput.showTelemetryNotice&&(0,ie.getTelemetryLevel)(this.configurationService)!==0&&this.productService.enableTelemetry&&this.buildTelemetryFooter(Re),(0,k.reset)(this.stepsContent,Ae,_e,this.stepMediaComponent,Re);const Le=De.steps.find(Me=>this.contextService.contextMatchesRules(Me.when)&&!Me.done)??De.steps[0];this.selectStep(Ce??Le.id,!Ce,!0),this.detailsScrollbar.scanDomNode(),this.detailsPageScrollbar?.scanDomNode(),this.registerDispatchListeners()}buildTelemetryFooter(ue){const Ce=this.instantiationService.createInstance(K.MarkdownRenderer,{}),Ae=`[${(0,t.localize)(24,null)}](command:workbench.action.openPrivacyStatementUrl)`,fe=`[${(0,t.localize)(25,null)}](command:settings.filterByTelemetry)`,ye=(0,t.localize)(26,null,this.productService.nameShort,Ae,fe);ue.append(Ce.render({value:ye,isTrusted:!0}).element),Ce.dispose()}getKeybindingLabel(ue){ue=ue.replace(/^command:/,"");const Ce=this.keybindingService.lookupKeybinding(ue)?.getLabel();return Ce?`(${Ce})`:""}async scrollPrev(){this.inProgressScroll=this.inProgressScroll.then(async()=>{this.currentWalkthrough=void 0,this.editorInput.selectedCategory=void 0,this.editorInput.selectedStep=void 0,this.editorInput.showTelemetryNotice=!1,this.selectStep(void 0),this.setSlide("categories"),this.container.focus()})}runSkip(){this.commandService.executeCommand("workbench.action.closeActiveEditor")}escape(){this.editorInput.selectedCategory?this.scrollPrev():this.runSkip()}setSlide(ue){const Ce=(0,A.assertIsDefined)(this.container.querySelector(".gettingStarted"));ue==="categories"?(Ce.classList.remove("showDetails"),Ce.classList.add("showCategories"),this.container.querySelector(".gettingStartedSlideDetails").querySelectorAll("button").forEach(De=>De.disabled=!0),this.container.querySelector(".gettingStartedSlideCategories").querySelectorAll("button").forEach(De=>De.disabled=!1),this.container.querySelector(".gettingStartedSlideCategories").querySelectorAll("input").forEach(De=>De.disabled=!1)):(Ce.classList.add("showDetails"),Ce.classList.remove("showCategories"),this.container.querySelector(".gettingStartedSlideDetails").querySelectorAll("button").forEach(De=>De.disabled=!1),this.container.querySelector(".gettingStartedSlideCategories").querySelectorAll("button").forEach(De=>De.disabled=!0),this.container.querySelector(".gettingStartedSlideCategories").querySelectorAll("input").forEach(De=>De.disabled=!0))}focus(){this.container.focus()}};ve.ID="gettingStartedPage",ve=we([F(0,E.ICommandService),F(1,I.IProductService),F(2,u.IKeybindingService),F(3,b.IWalkthroughsService),F(4,a.IConfigurationService),F(5,i.ITelemetryService),F(6,z.ILanguageService),F(7,W.IFileService),F(8,l.IOpenerService),F(9,S.IThemeService),F(10,n.IStorageService),F(11,x.IExtensionService),F(12,p.IInstantiationService),F(13,$.INotificationService),F(14,L.IEditorGroupsService),F(15,o.IContextKeyService),F(16,M.IQuickInputService),F(17,g.IWorkspacesService),F(18,m.ILabelService),F(19,D.IHostService),F(20,V.IWebviewService),F(21,h.IWorkspaceContextService),F(22,de.IAccessibilityService)],ve),e.GettingStartedPage=ve;class be{canSerialize(ue){return!0}serialize(ue){return JSON.stringify({selectedCategory:ue.selectedCategory,selectedStep:ue.selectedStep})}deserialize(ue,Ce){try{const{selectedCategory:De,selectedStep:Ae}=JSON.parse(Ce);return new _.GettingStartedInput({selectedCategory:De,selectedStep:Ae})}catch{}return new _.GettingStartedInput({})}}e.GettingStartedInputSerializer=be,(0,S.registerThemingParticipant)((ge,ue)=>{const Ce=ge.getColor(C.welcomePageBackground);Ce&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer { background-color: ${Ce}; }`);const De=ge.getColor(r.foreground);De&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer { color: ${De}; }`);const Ae=ge.getColor(r.descriptionForeground);Ae&&(ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .description { color: ${Ae}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .category-progress .message { color: ${Ae}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .gettingStartedDetailsContent > .getting-started-footer { color: ${Ae}; }`));const Pe=ge.getColor(r.textLinkForeground);Pe&&(ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .icon-widget { color: ${Pe} }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step .codicon-getting-started-step-checked { color: ${Pe} } `),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step.expanded .codicon-getting-started-step-unchecked { color: ${Pe} } `));const fe=ge.getColor(C.welcomePageTileBackground);fe&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button { background: ${fe}; }`),ge.getColor(C.welcomePageTileShadow)&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .getting-started-category { filter: drop-shadow(2px 2px 2px ${fe}); }`);const ke=ge.getColor(C.welcomePageTileHoverBackground);ke&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button:hover { background: ${ke}; }`),fe&&ke&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.expanded:hover { background: ${fe}; }`);const Ee=ge.getColor(r.buttonForeground);Ee&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis { color: ${Ee}; }`);const Te=ge.getColor(r.buttonBackground);Te&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis { background: ${Te}; }`);const _e=ge.getColor(r.descriptionForeground);_e&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideDetails .getting-started-step .codicon-getting-started-step-unchecked { color: ${_e} } `);const Re=ge.getColor(r.buttonHoverBackground);Re&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.emphasis:hover { background: ${Re}; }`);const Le=ge.getColor(r.textLinkForeground);Le&&(ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button) { color: ${Le}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link { color: ${Le}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .button-link .codicon { color: ${Le}; }`));const Me=ge.getColor(r.textLinkActiveForeground);Me&&(ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button):hover { color: ${Me}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.hide-category-button):active { color: ${Me}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link:hover { color: ${Me}; }`),ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link:hover .codicon { color: ${Me}; }`));const Oe=ge.getColor(r.focusBorder);Oe&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer a:not(.codicon-close):focus { outline-color: ${Oe}; }`);const Ke=ge.getColor(r.contrastBorder);Ke&&(ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button { border: 1px solid ${Ke}; }`),ue.addRule(".monaco-workbench .part.editor > .content .gettingStartedContainer button.button-link { border: inherit; }"));const We=ge.getColor(r.activeContrastBorder);We&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer button:hover { outline-color: ${We}; }`);const Xe=ge.getColor(C.welcomePageProgressBackground);Xe&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .progress-bar-outer { background-color: ${Xe}; }`);const Je=ge.getColor(C.welcomePageProgressForeground);Je&&ue.addRule(`.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .progress-bar-inner { background-color: ${Je}; }`);const rt=ge.getColor(Q.ACTIVITY_BAR_BADGE_FOREGROUND);rt&&(ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { color: ${rt}; }`),ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured .featured-icon { color: ${rt}; }`));const je=ge.getColor(Q.ACTIVITY_BAR_BADGE_BACKGROUND);je&&(ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { background-color: ${je}; }`),ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured { border-top-color: ${je}; }`));const Ue=ge.getColor(r.checkboxBackground);Ue&&ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { background-color: ${Ue} !important; }`);const Fe=ge.getColor(r.checkboxForeground);Fe&&ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { color: ${Fe} !important; }`);const He=ge.getColor(r.checkboxBorder);He&&ue.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { border-color: ${He} !important; }`)})}),define(ae[3013],le([1,0,1964,3012,17,43,15,5,7,24,153,97,959,661,44,55,214,58,31,48,104,14,120,39,987,523,70,902]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspacePlatform=e.icons=void 0,e.icons=w,(0,k.registerAction2)(class extends k.Action2{constructor(){super({id:"workbench.action.openWalkthrough",title:{value:(0,t.localize)(0,null),original:"Get Started"},category:m.Categories.Help,f1:!0,menu:{id:k.MenuId.MenubarHelpMenu,group:"1_welcome",order:1}})}run(_,L,M){const O=_.get(l.IEditorGroupsService),N=_.get(E.IInstantiationService),P=_.get(b.IEditorService),B=_.get(s.ICommandService);if(L){const V=typeof L=="string"?L:L.category,z=typeof L=="string"?void 0:L.step;for(const U of O.groups)if(U.activeEditor instanceof u.GettingStartedInput&&!U.activeEditor.selectedCategory){U.activeEditorPane.makeCategoryVisibleWhenAvailable(V,z);return}const x=P.findEditors({typeId:u.GettingStartedInput.ID,editorId:void 0,resource:u.GettingStartedInput.RESOURCE});for(const{editor:U,groupId:$}of x)if(U instanceof u.GettingStartedInput){const q=O.getGroup($);if(!U.selectedCategory&&q){U.selectedCategory=V,U.selectedStep=z,q.openEditor(U,{revealIfOpened:!0});return}}const H=P.activeEditor;if(z&&H instanceof u.GettingStartedInput&&H.selectedCategory===V){B.executeCommand("walkthroughs.selectStep",z);return}const W=N.createInstance(u.GettingStartedInput,{selectedCategory:V,selectedStep:z});H instanceof v.ExtensionsInput?O.activeGroup.replaceEditors([{editor:H,replacement:W}]):P.openEditor(W,{preserveFocus:M??!1},M?b.SIDE_GROUP:void 0)}else P.openEditor(new u.GettingStartedInput({}),{})}}),R.Registry.as(A.EditorExtensions.EditorFactory).registerEditorSerializer(u.GettingStartedInput.ID,p.GettingStartedInputSerializer),R.Registry.as(A.EditorExtensions.EditorPane).registerEditorPane(S.EditorPaneDescriptor.create(p.GettingStartedPage,p.GettingStartedPage.ID,(0,t.localize)(1,null)),[new C.SyncDescriptor(u.GettingStartedInput)]);const D={value:(0,t.localize)(2,null),original:"Get Started"};(0,k.registerAction2)(class extends k.Action2{constructor(){super({id:"welcome.goBack",title:{value:(0,t.localize)(3,null),original:"Go Back"},category:D,keybinding:{weight:100,primary:9,when:p.inWelcomeContext},precondition:I.ContextKeyExpr.equals("activeEditor","gettingStartedPage"),f1:!0})}run(_){const M=_.get(b.IEditorService).activeEditorPane;M instanceof p.GettingStartedPage&&M.escape()}}),s.CommandsRegistry.registerCommand({id:"walkthroughs.selectStep",handler:(_,L)=>{const O=_.get(b.IEditorService).activeEditorPane;O instanceof p.GettingStartedPage?O.selectStepLoose(L):console.error("Cannot run walkthroughs.selectStep outside of walkthrough context")}}),(0,k.registerAction2)(class extends k.Action2{constructor(){super({id:"welcome.markStepComplete",title:(0,t.localize)(4,null),category:D})}run(_,L){if(!L)return;_.get(r.IWalkthroughsService).progressStep(L)}}),(0,k.registerAction2)(class extends k.Action2{constructor(){super({id:"welcome.markStepIncomplete",title:(0,t.localize)(5,null),category:D})}run(_,L){if(!L)return;_.get(r.IWalkthroughsService).deprogressStep(L)}}),(0,k.registerAction2)(class extends k.Action2{constructor(){super({id:"welcome.showAllWalkthroughs",title:{value:(0,t.localize)(6,null),original:"Open Walkthrough..."},category:D,f1:!0})}getQuickPickItems(_,L){return L.getWalkthroughs().filter(O=>_.contextMatchesRules(O.when)).map(O=>({id:O.id,label:O.title,detail:O.description,description:O.source}))}async run(_){const L=_.get(s.ICommandService),M=_.get(I.IContextKeyService),O=_.get(d.IQuickInputService),N=_.get(r.IWalkthroughsService),P=_.get(g.IExtensionService),B=O.createQuickPick();B.canSelectMany=!1,B.matchOnDescription=!0,B.matchOnDetail=!0,B.title=(0,t.localize)(7,null),B.items=this.getQuickPickItems(M,N),B.busy=!0,B.onDidAccept(()=>{const V=B.selectedItems[0];V&&L.executeCommand("workbench.action.openWalkthrough",V.id),B.hide()}),B.onDidHide(()=>B.dispose()),B.show(),await P.whenInstalledExtensionsRegistered(),B.busy=!1,await N.installedExtensionsRegistered,B.items=this.getQuickPickItems(M,N)}}),e.WorkspacePlatform=new I.RawContextKey("workspacePlatform",void 0,(0,t.localize)(8,null));let y=class{constructor(L,M,O){this.extensionManagementServerService=L,this.remoteAgentService=M,this.contextService=O,this.remoteAgentService.getEnvironment().then(N=>{const P=N?.os,B=P===2?"mac":P===1?"windows":P===3?"linux":void 0;B?e.WorkspacePlatform.bindTo(this.contextService).set(B):this.extensionManagementServerService.localExtensionManagementServer?a.isMacintosh?e.WorkspacePlatform.bindTo(this.contextService).set("mac"):a.isLinux?e.WorkspacePlatform.bindTo(this.contextService).set("linux"):a.isWindows&&e.WorkspacePlatform.bindTo(this.contextService).set("windows"):this.extensionManagementServerService.webExtensionManagementServer?e.WorkspacePlatform.bindTo(this.contextService).set("webworker"):console.error("Error: Unable to detect workspace platform")})}};y=we([F(0,o.IExtensionManagementServerService),F(1,n.IRemoteAgentService),F(2,I.IContextKeyService)],y),R.Registry.as(i.Extensions.Workbench).registerWorkbenchContribution(y,3),R.Registry.as(f.Extensions.Configuration).registerConfiguration({...c.workbenchConfigurationNodeBase,properties:{"workbench.welcomePage.walkthroughs.openOnInstall":{scope:2,type:"boolean",default:!0,description:(0,t.localize)(9,null)},"workbench.welcomePage.experimental.videoTutorials":{scope:2,type:"string",enum:["off","on","experimental"],tags:["experimental"],default:"off",description:(0,t.localize)(10,null)},"workbench.startupEditor":{scope:4,type:"string",enum:["none","welcomePage","readme","newUntitledFile","welcomePageInEmptyWorkbench"],enumDescriptions:[(0,t.localize)(11,null),(0,t.localize)(12,null),(0,t.localize)(13,null),(0,t.localize)(14,null),(0,t.localize)(15,null)],default:"welcomePage",description:(0,t.localize)(16,null)},"workbench.welcomePage.preferReducedMotion":{scope:1,type:"boolean",default:!1,deprecationMessage:(0,t.localize)(17,null),description:(0,t.localize)(18,null)}}}),R.Registry.as(i.Extensions.Workbench).registerWorkbenchContribution(h.StartupPageContribution,3)}),define(ae[1015],le([1,0,1990,9,21,52,10,36,19,43,24,27,243,554,193,829,86,31,166,296,15,84,11,2,69,542,14,46,26,38,128,111,34,16,8,23,13,41,22,89,53,225,83,136,157,6,148,58,47,25,5,153,102,66,117,2102,49,18,538,29,57]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeWindow=void 0;let de=class Fc extends g.Disposable{constructor(pe,me,Se,Ie,ve,be,ge,ue,Ce,De,Ae,Pe,fe,ye,ke,Ee,Te,_e,Re,Le,Me,Oe,Ke,We,Xe,Je,rt,je,Ue,Fe,He,Be,ze,nt){super(),this.editorService=pe,this.editorGroupService=me,this.configurationService=Se,this.titleService=Ie,this.themeService=ve,this.notificationService=be,this.commandService=ge,this.keybindingService=ue,this.telemetryService=Ce,this.workspaceEditingService=De,this.fileService=Ae,this.menuService=Pe,this.lifecycleService=fe,this.integrityService=ye,this.environmentService=ke,this.accessibilityService=Ee,this.contextService=Te,this.openerService=_e,this.nativeHostService=Re,this.tunnelService=Le,this.layoutService=Me,this.workingCopyService=Oe,this.filesConfigurationService=Ke,this.productService=We,this.remoteAuthorityResolverService=Xe,this.dialogService=Je,this.storageService=rt,this.logService=je,this.instantiationService=Ue,this.sharedProcessService=Fe,this.progressService=He,this.labelService=Be,this.bannerService=ze,this.uriIdentityService=nt,this.touchBarDisposables=this._register(new g.DisposableStore),this.customTitleContextMenuDisposable=this._register(new g.DisposableStore),this.addFoldersScheduler=this._register(new o.RunOnceScheduler(()=>this.doAddFolders(),100)),this.pendingFoldersToAdd=[],this.closeEmptyWindowScheduler=this._register(new o.RunOnceScheduler(()=>this.onDidAllEditorsClose(),50)),this.isDocumentedEdited=!1,this.registerListeners(),this.create()}registerListeners(){this._register((0,k.addDisposableListener)(window,k.EventType.RESIZE,me=>this.onWindowResize(me,!0))),this._register(this.editorService.onDidActiveEditorChange(()=>this.updateTouchbarMenu()));for(const me of[k.EventType.DRAG_OVER,k.EventType.DROP])window.document.body.addEventListener(me,Se=>{k.EventHelper.stop(Se)});s.ipcRenderer.on("vscode:runAction",async(me,Se)=>{const Ie=Se.args||[];if(Se.from==="touchbar"){const ve=this.editorService.activeEditor;if(ve){const be=b.EditorResourceAccessor.getOriginalUri(ve,{supportSideBySide:b.SideBySideEditor.PRIMARY});be&&Ie.push(be)}}else Ie.push({from:Se.from});try{await this.commandService.executeCommand(Se.id,...Ie),this.telemetryService.publicLog2("workbenchActionExecuted",{id:Se.id,from:Se.from})}catch(ve){this.notificationService.error(ve)}}),s.ipcRenderer.on("vscode:runKeybinding",(me,Se)=>{document.activeElement&&this.keybindingService.dispatchByUserSettingsLabel(Se.userSettingsLabel,document.activeElement)}),s.ipcRenderer.on("vscode:reportError",(me,Se)=>{Se&&(0,R.onUnexpectedError)(JSON.parse(Se))}),s.ipcRenderer.on("vscode:openFiles",(me,Se)=>{this.onOpenFiles(Se)}),s.ipcRenderer.on("vscode:addFolders",(me,Se)=>{this.onAddFoldersRequest(Se)}),s.ipcRenderer.on("vscode:showInfoMessage",(me,Se)=>{this.notificationService.info(Se)}),s.ipcRenderer.on("vscode:showResolveShellEnvError",(me,Se)=>{this.notificationService.prompt(D.Severity.Error,Se,[{label:(0,t.localize)(0,null),run:()=>this.openerService.open("https://go.microsoft.com/fwlink/?linkid=2149667")}])}),s.ipcRenderer.on("vscode:showCredentialsError",(me,Se)=>{this.notificationService.prompt(D.Severity.Error,(0,t.localize)(1,null,Se),[{label:(0,t.localize)(2,null),run:()=>this.openerService.open("https://go.microsoft.com/fwlink/?linkid=2190713")}])}),s.ipcRenderer.on("vscode:enterFullScreen",async()=>{(0,c.setFullscreen)(!0)}),s.ipcRenderer.on("vscode:leaveFullScreen",async()=>{(0,c.setFullscreen)(!1)}),s.ipcRenderer.on("vscode:openProxyAuthenticationDialog",async(me,Se)=>{const Ie="window.rememberProxyCredentials",ve=this.storageService.getBoolean(Ie,-1),be=await this.dialogService.input(D.Severity.Warning,(0,t.localize)(3,null),[(0,t.localize)(4,null),(0,t.localize)(5,null)],[{placeholder:(0,t.localize)(6,null),value:Se.username},{placeholder:(0,t.localize)(7,null),type:"password",value:Se.password}],{cancelId:1,detail:(0,t.localize)(8,null,`${Se.authInfo.host}:${Se.authInfo.port}`),checkbox:{label:(0,t.localize)(9,null),checked:ve}});if(be.choice!==0||!be.values)s.ipcRenderer.send(Se.replyChannel);else{be.checkboxChecked?this.storageService.store(Ie,!0,-1,1):this.storageService.remove(Ie,-1);const[ge,ue]=be.values;s.ipcRenderer.send(Se.replyChannel,{username:ge,password:ue,remember:!!be.checkboxChecked})}}),s.ipcRenderer.on("vscode:accessibilitySupportChanged",(me,Se)=>{this.accessibilityService.setAccessibilitySupport(Se?2:1)}),this.updateWindowZoomLevel(),this._register(this.configurationService.onDidChangeConfiguration(me=>{me.affectsConfiguration("window.zoomLevel")?this.updateWindowZoomLevel():(me.affectsConfiguration("keyboard.touchbar.enabled")||me.affectsConfiguration("keyboard.touchbar.ignored"))&&this.updateTouchbarMenu()})),this._register(this.editorService.onDidVisibleEditorsChange(()=>this.onDidChangeVisibleEditors()));const pe=this.environmentService.filesToWait;if(pe&&this.trackClosedWaitFiles(pe.waitMarkerFileUri,(0,M.coalesce)(pe.paths.map(me=>me.fileUri))),m.isMacintosh&&this._register(this.editorService.onDidActiveEditorChange(()=>{const me=b.EditorResourceAccessor.getOriginalUri(this.editorService.activeEditor,{supportSideBySide:b.SideBySideEditor.PRIMARY,filterByScheme:V.Schemas.file});this.nativeHostService.setRepresentedFilename(me?.fsPath??""),this.provideCustomTitleContextMenu(me?.fsPath)})),m.isMacintosh&&(0,r.getTitleBarStyle)(this.configurationService)==="custom"){const me=(0,P.assertIsDefined)(this.layoutService.getContainer("workbench.parts.titlebar"));this._register((0,k.addDisposableListener)(me,k.EventType.DBLCLICK,Se=>{k.EventHelper.stop(Se),this.nativeHostService.handleTitleDoubleClick()}))}this._register(this.workingCopyService.onDidChangeDirty(me=>{const Se=me.isDirty();Se&&!(me.capabilities&2)&&this.filesConfigurationService.getAutoSaveMode()===1||this.updateDocumentEdited(Se)})),this.updateDocumentEdited(),this._register(q.Event.any(q.Event.map(q.Event.filter(this.nativeHostService.onDidMaximizeWindow,me=>me===this.nativeHostService.windowId),()=>!0),q.Event.map(q.Event.filter(this.nativeHostService.onDidUnmaximizeWindow,me=>me===this.nativeHostService.windowId),()=>!1))(me=>this.onDidChangeWindowMaximized(me))),this.onDidChangeWindowMaximized(this.environmentService.window.maximized??!1),this._register(this.layoutService.onDidChangePanelPosition(me=>this.onDidChangePanelPosition((0,W.positionFromString)(me)))),this.onDidChangePanelPosition(this.layoutService.getPanelPosition()),this._register(this.lifecycleService.onBeforeShutdown(me=>this.onBeforeShutdown(me))),this._register(this.lifecycleService.onBeforeShutdownError(me=>this.onBeforeShutdownError(me))),this._register(this.lifecycleService.onWillShutdown(me=>this.onWillShutdown(me)))}onBeforeShutdown({veto:pe,reason:me}){if(me===1){const Se=this.configurationService.getValue("window.confirmBeforeClose"),Ie=Se==="always"||Se==="keyboardOnly"&&k.ModifierKeyEmitter.getInstance().isModifierPressed;if(Ie)return pe((async()=>{let ve=me;me===1&&!m.isMacintosh&&await this.nativeHostService.getWindowCount()===1&&(ve=2);let be=!0;return Ie&&(be=await this.instantiationService.invokeFunction(ge=>Fc.confirmOnShutdown(ge,ve))),be&&this.progressOnBeforeShutdown(me),!be})(),"veto.confirmBeforeClose")}this.progressOnBeforeShutdown(me)}progressOnBeforeShutdown(pe){this.progressService.withProgress({location:10,delay:800,title:this.toShutdownLabel(pe,!1)},()=>q.Event.toPromise(q.Event.any(this.lifecycleService.onWillShutdown,this.lifecycleService.onShutdownVeto,this.dialogService.onWillShowDialog)))}static async confirmOnShutdown(pe,me){const Se=pe.get(Q.IDialogService),Ie=pe.get(O.IConfigurationService),ve=me===2?m.isMacintosh?(0,t.localize)(10,null):(0,t.localize)(11,null):(0,t.localize)(12,null),be=me===2?m.isMacintosh?(0,t.localize)(13,null):(0,t.localize)(14,null):(0,t.localize)(15,null),ge=await Se.confirm({type:"question",message:ve,primaryButton:be,checkbox:{label:(0,t.localize)(16,null)}});return ge.checkboxChecked&&await Ie.updateValue("window.confirmBeforeClose","never"),ge.confirmed}onBeforeShutdownError({error:pe,reason:me}){this.dialogService.show(D.Severity.Error,this.toShutdownLabel(me,!0),void 0,{detail:(0,t.localize)(17,null,(0,re.toErrorMessage)(pe))})}onWillShutdown({reason:pe,force:me,joiners:Se}){const Ie=new o.RunOnceScheduler(()=>{const ve=Se();this.progressService.withProgress({location:20,buttons:[this.toForceShutdownLabel(pe)],cancellable:!1,sticky:!0,title:this.toShutdownLabel(pe,!1),detail:ve.length>0?(0,t.localize)(18,null,ve.map(be=>`- ${be.label}`).join(`
`)):void 0},()=>q.Event.toPromise(this.lifecycleService.onDidShutdown),()=>{me()})},1200);Ie.schedule(),q.Event.once(this.lifecycleService.onDidShutdown)(()=>Ie.dispose())}toShutdownLabel(pe,me){if(me)switch(pe){case 1:return(0,t.localize)(19,null);case 2:return(0,t.localize)(20,null);case 3:return(0,t.localize)(21,null);case 4:return(0,t.localize)(22,null)}switch(pe){case 1:return(0,t.localize)(23,null);case 2:return(0,t.localize)(24,null);case 3:return(0,t.localize)(25,null);case 4:return(0,t.localize)(26,null)}}toForceShutdownLabel(pe){switch(pe){case 1:return(0,t.localize)(27,null);case 2:return(0,t.localize)(28,null);case 3:return(0,t.localize)(29,null);case 4:return(0,t.localize)(30,null)}}onWindowResize(pe,me){if(pe.target===window){if(window.document&&window.document.body&&window.document.body.clientWidth===0){me&&(0,k.scheduleAtNextAnimationFrame)(()=>this.onWindowResize(pe,!1));return}this.layoutService.layout()}}updateDocumentEdited(pe=this.workingCopyService.hasDirty){(!this.isDocumentedEdited&&pe||this.isDocumentedEdited&&!pe)&&(this.isDocumentedEdited=pe,this.nativeHostService.setDocumentEdited(pe))}onDidChangeWindowMaximized(pe){this.layoutService.updateWindowMaximizedState(pe)}getWindowMinimumWidth(pe=this.layoutService.getPanelPosition()){return pe===0||pe===1?r.WindowMinimumSize.WIDTH_WITH_VERTICAL_PANEL:r.WindowMinimumSize.WIDTH}onDidChangePanelPosition(pe){const me=this.getWindowMinimumWidth(pe);this.nativeHostService.setMinimumSize(me,void 0)}onDidChangeVisibleEditors(){this.editorService.visibleEditorPanes.length===0&&this.contextService.getWorkbenchState()===1&&!this.environmentService.isExtensionDevelopment&&(this.configurationService.getValue("window.closeWhenEmpty")||this.environmentService.args.wait)&&this.closeEmptyWindowScheduler.schedule()}onDidAllEditorsClose(){this.editorService.visibleEditorPanes.length===0&&this.nativeHostService.closeWindow()}updateWindowZoomLevel(){const pe=this.configurationService.getValue();let me=0;if(pe.window&&typeof pe.window.zoomLevel=="number"){if(me=pe.window.zoomLevel,this.previousConfiguredZoomLevel===me)return;this.previousConfiguredZoomLevel=me}(0,c.getZoomLevel)()!==me&&(0,f.applyZoom)(me)}provideCustomTitleContextMenu(pe){if(this.customTitleContextMenuDisposable.clear(),!pe||(0,r.getTitleBarStyle)(this.configurationService)!=="custom")return;const me=pe.split(x.posix.sep);for(let Se=me.length;Se>0;Se--){const Ie=Se===me.length;let ve=Se;Ie||ve++;const be=p.URI.file(me.slice(0,ve).join(x.posix.sep));let ge;Ie?ge=this.labelService.getUriBasenameLabel(be):ge=this.labelService.getUriBasenameLabel((0,te.dirname)(be));const ue=`workbench.action.revealPathInFinder${Se}`;this.customTitleContextMenuDisposable.add(l.CommandsRegistry.registerCommand(ue,()=>this.nativeHostService.showItemInFolder(be.fsPath))),this.customTitleContextMenuDisposable.add(n.MenuRegistry.appendMenuItem(n.MenuId.TitleBarTitleContext,{command:{id:ue,title:ge||x.posix.sep},order:-Se}))}}create(){this.setupOpenHandlers(),this.lifecycleService.when(2).then(()=>this.nativeHostService.notifyReady()),this.lifecycleService.when(3).then(()=>this.sharedProcessService.notifyRestored()),this.handleWarnings(),this.updateTouchbarMenu(),this.environmentService.enableSmokeTestDriver&&this.setupDriver()}async handleWarnings(){if(J.hasDependencyCycle()&&(m.isCI?(this.logService.error("Error: There is a dependency cycle in the AMD modules that needs to be resolved!"),this.nativeHostService.exit(37)):(this.dialogService.show(D.Severity.Error,(0,t.localize)(31,null)),this.nativeHostService.openDevTools())),await this.lifecycleService.when(3),(async()=>{const pe=await this.nativeHostService.isAdmin(),{isPure:me}=await this.integrityService.isPure();this.titleService.updateProperties({isPure:me,isAdmin:pe}),pe&&!m.isWindows&&this.notificationService.warn((0,t.localize)(32,null,this.productService.nameShort))})(),this.environmentService.isBuilt){let pe;m.isMacintosh?pe=(0,te.dirname)((0,te.dirname)((0,te.dirname)(p.URI.file(this.environmentService.appRoot)))):pe=(0,te.dirname)((0,te.dirname)(p.URI.file(this.environmentService.appRoot)));for(const me of this.contextService.getWorkspace().folders)if(this.uriIdentityService.extUri.isEqualOrParent(me.uri,pe)){this.bannerService.show({id:"appRootWarning.banner",message:(0,t.localize)(33,null,this.labelService.getUriLabel(pe)),icon:ne.Codicon.warning});break}}if(m.isWindows){const pe=this.environmentService.os.release.split(".");if(parseInt(pe[0])===6&&parseInt(pe[1])===1){const me=(0,t.localize)(34,null,this.productService.nameLong);this.notificationService.prompt(D.Severity.Warning,me,[{label:(0,t.localize)(35,null),run:()=>this.openerService.open(p.URI.parse("https://aka.ms/vscode-faq-win7"))}],{neverShowAgain:{id:"windows7eol",isSecondary:!0,scope:D.NeverShowAgainScope.APPLICATION}})}}}setupDriver(){const pe=this;let me=!1;(0,oe.registerWindowDriver)({async exitApplication(){if(me){pe.logService.info("[driver] not handling exitApplication() due to pending quit() call");return}return pe.logService.info("[driver] handling exitApplication()"),me=!0,pe.nativeHostService.quit()}})}setupOpenHandlers(){window.open=function(){throw new Error("Prevented call to window.open(). Use IOpenerService instead!")},this.openerService.setDefaultExternalOpener({openExternal:async pe=>{if(!await this.nativeHostService.openExternal(pe)){const Se=p.URI.parse(pe);Se.scheme===V.Schemas.file&&await this.nativeHostService.showItemInFolder(Se.fsPath)}return!0}}),this.openerService.registerExternalUriResolver({resolveExternalUri:async(pe,me)=>{if(me?.allowTunneling){const Se=(0,H.extractLocalHostUriMetaDataForPortMapping)(pe);if(Se){const Ie=this.environmentService.remoteAuthority,ve=Ie?{getAddress:async()=>(await this.remoteAuthorityResolverService.resolveAuthority(Ie)).authority}:void 0;let be=await this.tunnelService.getExistingTunnel(Se.address,Se.port);if(be||(be=await this.tunnelService.openTunnel(ve,Se.address,Se.port)),be){const ge=p.URI.parse(be.localAddress);return{resolved:ge.scheme.startsWith(pe.scheme)?ge:pe.with({authority:be.localAddress}),dispose:()=>be?.dispose()}}}}if(!me?.openExternal&&await this.fileService.canHandleResource(pe))return{resolved:p.URI.from({scheme:this.productService.urlProtocol,path:"workspace",query:pe.toString()}),dispose(){}}}})}updateTouchbarMenu(){if(!m.isMacintosh)return;this.touchBarDisposables.clear(),this.touchBarMenu=void 0;const pe=this.touchBarDisposables.add(new o.RunOnceScheduler(()=>this.doUpdateTouchbarMenu(pe),300));pe.schedule()}doUpdateTouchbarMenu(pe){if(!this.touchBarMenu){const ue=this.editorService.activeEditorPane?.scopedContextKeyService||this.editorGroupService.activeGroup.scopedContextKeyService;this.touchBarMenu=this.menuService.createMenu(n.MenuId.TouchBarContext,ue),this.touchBarDisposables.add(this.touchBarMenu),this.touchBarDisposables.add(this.touchBarMenu.onDidChange(()=>pe.schedule()))}const me=[],Se=this.configurationService.getValue("keyboard.touchbar.enabled")===!1,Ie=this.configurationService.getValue("keyboard.touchbar.ignored"),ve=Array.isArray(Ie)?Ie:[];(0,a.createAndFillInActionBarActions)(this.touchBarMenu,void 0,me);const be=[];let ge=[];if(!Se){for(const ue of me)if(ue instanceof n.MenuItemAction){if(ve.indexOf(ue.item.id)>=0)continue;ge.push(ue.item)}else ue instanceof E.Separator&&(ge.length&&be.push(ge),ge=[]);ge.length&&be.push(ge)}(0,A.equals)(this.lastInstalledTouchedBar,be)||(this.lastInstalledTouchedBar=be,this.nativeHostService.updateTouchBar(be))}onAddFoldersRequest(pe){this.pendingFoldersToAdd.push(...pe.foldersToAdd.map(me=>p.URI.revive(me))),this.addFoldersScheduler.isScheduled()||this.addFoldersScheduler.schedule()}doAddFolders(){const pe=[];for(const me of this.pendingFoldersToAdd)pe.push({uri:me});this.pendingFoldersToAdd=[],this.workspaceEditingService.addFolders(pe)}async onOpenFiles(pe){const me=!!(pe.filesToDiff&&pe.filesToDiff.length===2),Se=!!(pe.filesToMerge&&pe.filesToMerge.length===4),Ie=(0,M.coalesce)(await(0,b.pathsToEditors)(Se?pe.filesToMerge:me?pe.filesToDiff:pe.filesToOpenOrCreate,this.fileService,this.logService));if(Ie.length){const ve=await this.openResources(Ie,me,Se);if(pe.filesToWait)return ve.length?this.trackClosedWaitFiles(p.URI.revive(pe.filesToWait.waitMarkerFileUri),(0,M.coalesce)(pe.filesToWait.paths.map(be=>p.URI.revive(be.fileUri)))):this.fileService.del(p.URI.revive(pe.filesToWait.waitMarkerFileUri))}}async trackClosedWaitFiles(pe,me){await this.instantiationService.invokeFunction(Se=>(0,Y.whenEditorClosed)(Se,me)),await this.fileService.del(pe)}async openResources(pe,me,Se){const Ie=[];if(Se&&(0,b.isResourceEditorInput)(pe[0])&&(0,b.isResourceEditorInput)(pe[1])&&(0,b.isResourceEditorInput)(pe[2])&&(0,b.isResourceEditorInput)(pe[3])){const ve={input1:{resource:pe[0].resource},input2:{resource:pe[1].resource},base:{resource:pe[2].resource},result:{resource:pe[3].resource},options:{pinned:!0}};Ie.push(ve)}else if(me&&(0,b.isResourceEditorInput)(pe[0])&&(0,b.isResourceEditorInput)(pe[1])){const ve={original:{resource:pe[0].resource},modified:{resource:pe[1].resource},options:{pinned:!0}};Ie.push(ve)}else Ie.push(...pe);return this.editorService.openEditors(Ie,void 0,{validateTrust:!0})}};de=we([F(0,S.IEditorService),F(1,G.IEditorGroupsService),F(2,O.IConfigurationService),F(3,u.ITitleService),F(4,i.IWorkbenchThemeService),F(5,D.INotificationService),F(6,l.ICommandService),F(7,y.IKeybindingService),F(8,C.ITelemetryService),F(9,d.IWorkspaceEditingService),F(10,I.IFileService),F(11,n.IMenuService),F(12,h.ILifecycleService),F(13,v.IIntegrityService),F(14,T.INativeWorkbenchEnvironmentService),F(15,_.IAccessibilityService),F(16,L.IWorkspaceContextService),F(17,B.IOpenerService),F(18,z.INativeHostService),F(19,H.ITunnelService),F(20,W.IWorkbenchLayoutService),F(21,U.IWorkingCopyService),F(22,$.IFilesConfigurationService),F(23,w.IProductService),F(24,X.IRemoteAuthorityResolverService),F(25,Q.IDialogService),F(26,N.IStorageService),F(27,j.ILogService),F(28,K.IInstantiationService),F(29,ee.ISharedProcessService),F(30,ie.IProgressService),F(31,se.ILabelService),F(32,Z.IBannerService),F(33,ce.IUriIdentityService)],de),e.NativeWindow=de}),define(ae[3014],le([1,0,17,1987,15,55,14,2482,2437,7,98,31,141,89,155,2436,71,27,8,1015,10,307]),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}),function(){if((0,R.registerAction2)(I.ZoomInAction),(0,R.registerAction2)(I.ZoomOutAction),(0,R.registerAction2)(I.ZoomResetAction),(0,R.registerAction2)(I.SwitchWindowAction),(0,R.registerAction2)(I.QuickSwitchWindowAction),(0,R.registerAction2)(I.CloseWindowAction),k.isMacintosh&&S.KeybindingsRegistry.registerKeybindingRule({id:I.CloseWindowAction.ID,weight:200,when:b.ContextKeyExpr.and(c.EditorsVisibleContext.toNegated(),c.SingleEditorGroupsContext),primary:2101}),k.isMacintosh&&((0,R.registerAction2)(f.InstallShellScriptAction),(0,R.registerAction2)(f.UninstallShellScriptAction)),S.KeybindingsRegistry.registerCommandAndKeybindingRule({id:"workbench.action.quit",weight:200,async handler(g){const h=g.get(u.INativeHostService),m=g.get(s.IConfigurationService).getValue("window.confirmBeforeClose");(m==="always"||m==="keyboardOnly"&&n.ModifierKeyEmitter.getInstance().isModifierPressed)&&!await d.NativeWindow.confirmOnShutdown(g,2)||h.quit()},when:void 0,mac:{primary:2095},linux:{primary:2095}}),k.isMacintosh)for(const g of[{handler:I.NewWindowTabHandler,id:"workbench.action.newWindowTab",title:{value:(0,p.localize)(0,null),original:"New Window Tab"}},{handler:I.ShowPreviousWindowTabHandler,id:"workbench.action.showPreviousWindowTab",title:{value:(0,p.localize)(1,null),original:"Show Previous Window Tab"}},{handler:I.ShowNextWindowTabHandler,id:"workbench.action.showNextWindowTab",title:{value:(0,p.localize)(2,null),original:"Show Next Window Tab"}},{handler:I.MoveWindowTabToNewWindowHandler,id:"workbench.action.moveWindowTabToNewWindow",title:{value:(0,p.localize)(3,null),original:"Move Window Tab to New Window"}},{handler:I.MergeWindowTabsHandlerHandler,id:"workbench.action.mergeAllWindowTabs",title:{value:(0,p.localize)(4,null),original:"Merge All Windows"}},{handler:I.ToggleWindowTabsBarHandler,id:"workbench.action.toggleWindowTabsBar",title:{value:(0,p.localize)(5,null),original:"Toggle Window Tabs Bar"}}])C.CommandsRegistry.registerCommand(g.id,g.handler),R.MenuRegistry.appendMenuItem(R.MenuId.CommandPalette,{command:g,when:b.ContextKeyExpr.equals("config.window.nativeTabs",!0)});(0,R.registerAction2)(E.ReloadWindowWithExtensionsDisabledAction),(0,R.registerAction2)(E.ConfigureRuntimeArgumentsAction),(0,R.registerAction2)(E.ToggleSharedProcessAction),(0,R.registerAction2)(E.ToggleDevToolsAction)}(),function(){R.MenuRegistry.appendMenuItem(R.MenuId.MenubarFileMenu,{group:"z_Exit",command:{id:"workbench.action.quit",title:(0,p.localize)(6,null)},order:1,when:r.IsMacContext.toNegated()})}(),function(){const g=t.Registry.as(A.Extensions.Configuration);g.registerConfiguration({id:"window",order:8,title:(0,p.localize)(7,null),type:"object",properties:{"window.openWithoutArgumentsInNewWindow":{type:"string",enum:["on","off"],enumDescriptions:[(0,p.localize)(8,null),(0,p.localize)(9,null)],default:k.isMacintosh?"off":"on",scope:1,markdownDescription:(0,p.localize)(10,null)},"window.restoreWindows":{type:"string",enum:["preserve","all","folders","one","none"],enumDescriptions:[(0,p.localize)(11,null),(0,p.localize)(12,null),(0,p.localize)(13,null),(0,p.localize)(14,null),(0,p.localize)(15,null)],default:"all",scope:1,description:(0,p.localize)(16,null)},"window.restoreFullscreen":{type:"boolean",default:!1,scope:1,description:(0,p.localize)(17,null)},"window.zoomLevel":{type:"number",default:0,description:(0,p.localize)(18,null),ignoreSync:!0,tags:["accessibility"]},"window.newWindowDimensions":{type:"string",enum:["default","inherit","offset","maximized","fullscreen"],enumDescriptions:[(0,p.localize)(19,null),(0,p.localize)(20,null),(0,p.localize)(21,null),(0,p.localize)(22,null),(0,p.localize)(23,null)],default:"default",scope:1,description:(0,p.localize)(24,null)},"window.closeWhenEmpty":{type:"boolean",default:!1,description:(0,p.localize)(25,null)},"window.doubleClickIconToClose":{type:"boolean",default:!1,scope:1,markdownDescription:(0,p.localize)(26,null)},"window.titleBarStyle":{type:"string",enum:["native","custom"],default:k.isLinux?"native":"custom",scope:1,description:(0,p.localize)(27,null)},"window.experimental.windowControlsOverlay.enabled":{type:"boolean",default:!1,scope:1,description:(0,p.localize)(28,null),included:k.isWindows},"window.dialogStyle":{type:"string",enum:["native","custom"],default:"native",scope:1,description:(0,p.localize)(29,null)},"window.nativeTabs":{type:"boolean",default:!1,scope:1,description:(0,p.localize)(30,null),included:k.isMacintosh},"window.nativeFullScreen":{type:"boolean",default:!0,description:(0,p.localize)(31,null),scope:1,included:k.isMacintosh},"window.clickThroughInactive":{type:"boolean",default:!0,scope:1,description:(0,p.localize)(32,null),included:k.isMacintosh},"window.experimental.useSandbox":{type:"boolean",description:(0,p.localize)(33,null),default:typeof a.default.quality=="string"&&a.default.quality!=="stable",scope:1,ignoreSync:!0}}}),g.registerConfiguration({id:"telemetry",order:110,title:(0,p.localize)(34,null),type:"object",properties:{"telemetry.enableCrashReporter":{type:"boolean",description:(0,p.localize)(35,null),default:!0,tags:["usesOnlineServices","telemetry"],markdownDeprecationMessage:(0,p.localize)(36,null,`\`#${l.TELEMETRY_SETTING_ID}#\``)}}}),g.registerConfiguration({id:"keyboard",order:15,type:"object",title:(0,p.localize)(37,null),properties:{"keyboard.touchbar.enabled":{type:"boolean",default:!0,description:(0,p.localize)(38,null),included:k.isMacintosh},"keyboard.touchbar.ignored":{type:"array",items:{type:"string"},default:[],markdownDescription:(0,p.localize)(39,null),included:k.isMacintosh}}})}(),function(){const g="vscode://schemas/argv",h=t.Registry.as(i.Extensions.JSONContribution),v={id:g,allowComments:!0,allowTrailingCommas:!0,description:"VSCode static command line definition file",type:"object",additionalProperties:!1,properties:{locale:{type:"string",description:(0,p.localize)(40,null)},"disable-hardware-acceleration":{type:"boolean",description:(0,p.localize)(41,null)},"force-color-profile":{type:"string",markdownDescription:(0,p.localize)(42,null)},"enable-crash-reporter":{type:"boolean",markdownDescription:(0,p.localize)(43,null)},"crash-reporter-id":{type:"string",markdownDescription:(0,p.localize)(44,null)},"enable-proposed-api":{type:"array",description:(0,p.localize)(45,null),items:{type:"string"}},"log-level":{type:"string",description:(0,p.localize)(46,null)}}};k.isLinux&&(v.properties["force-renderer-accessibility"]={type:"boolean",description:(0,p.localize)(47,null)}),h.registerSchema(g,v)}()}),define(ae[3015],le([1,0,45,7,23,39,17,2,163,97,35,6,27,72,5,2892,15,2063,399]),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.ViewDescriptorService=void 0;function d(a){return`${a}.state`}let n=class yi extends E.Disposable{get viewContainers(){return this.viewContainersRegistry.all}constructor(o,g,h,v,m){super(),this.instantiationService=o,this.contextKeyService=g,this.storageService=h,this.extensionService=v,this.telemetryService=m,this._onDidChangeContainer=this._register(new C.Emitter),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeLocation=this._register(new C.Emitter),this.onDidChangeLocation=this._onDidChangeLocation.event,this._onDidChangeContainerLocation=this._register(new C.Emitter),this.onDidChangeContainerLocation=this._onDidChangeContainerLocation.event,this._onDidChangeViewContainers=this._register(new C.Emitter),this.onDidChangeViewContainers=this._onDidChangeViewContainers.event,this.viewContainerModels=new Map,this.viewsVisibilityActionDisposables=new Map,this.activeViewContextKeys=new Map,this.movableViewContextKeys=new Map,this.defaultViewLocationContextKeys=new Map,this.defaultViewContainerLocationContextKeys=new Map,this.viewContainersRegistry=k.Registry.as(t.Extensions.ViewContainersRegistry),this.viewsRegistry=k.Registry.as(t.Extensions.ViewsRegistry),this.migrateToViewsCustomizationsStorage(),this.viewContainersCustomLocations=new Map(Object.entries(this.viewCustomizations.viewContainerLocations)),this.viewDescriptorsCustomLocations=new Map(Object.entries(this.viewCustomizations.viewLocations)),this.viewContainers.forEach(w=>this.onDidRegisterViewContainer(w)),this._register(this.viewsRegistry.onViewsRegistered(w=>this.onDidRegisterViews(w))),this._register(this.viewsRegistry.onViewsDeregistered(({views:w,viewContainer:D})=>this.onDidDeregisterViews(w,D))),this._register(this.viewsRegistry.onDidChangeContainer(({views:w,from:D,to:y})=>this.onDidChangeDefaultContainer(w,D,y))),this._register(this.viewContainersRegistry.onDidRegister(({viewContainer:w})=>{this.onDidRegisterViewContainer(w),this._onDidChangeViewContainers.fire({added:[{container:w,location:this.getViewContainerLocation(w)}],removed:[]})})),this._register(this.viewContainersRegistry.onDidDeregister(({viewContainer:w})=>{this.onDidDeregisterViewContainer(w),this._onDidChangeViewContainers.fire({removed:[{container:w,location:this.getViewContainerLocation(w)}],added:[]})})),this._register((0,E.toDisposable)(()=>{this.viewContainerModels.forEach(({disposable:w})=>w.dispose()),this.viewContainerModels.clear(),this.viewsVisibilityActionDisposables.forEach(w=>w.dispose()),this.viewsVisibilityActionDisposables.clear()})),this._register(this.storageService.onDidChangeValue(w=>{this.onDidStorageChange(w)})),this._register(this.extensionService.onDidRegisterExtensions(()=>this.onDidRegisterExtensions())),k.Registry.as(s.Extensions.ProfileStorageRegistry).registerKeys([{key:yi.VIEWS_CUSTOMIZATIONS,description:(0,l.localize)(0,null)}])}migrateToViewsCustomizationsStorage(){if(this.storageService.get(yi.VIEWS_CUSTOMIZATIONS,0))return;const o=this.storageService.get("views.cachedViewContainerLocations",0),g=this.storageService.get("views.cachedViewPositions",0);if(!o&&!g)return;const h=o?JSON.parse(o):[],v=g?JSON.parse(g):[],m={viewContainerLocations:h.reduce((w,[D,y])=>(w[D]=y,w),{}),viewLocations:v.reduce((w,[D,{containerId:y}])=>(w[D]=y,w),{})};this.storageService.store(yi.VIEWS_CUSTOMIZATIONS,JSON.stringify(m),0,0),this.storageService.remove("views.cachedViewContainerLocations",0),this.storageService.remove("views.cachedViewPositions",0)}registerGroupedViews(o){for(const[g,h]of o.entries()){const v=this.viewContainersRegistry.get(g);if(!v||!this.viewContainerModels.has(v)){if(this.isGeneratedContainerId(g)){const w=this.viewContainersCustomLocations.get(g);w!==void 0&&this.registerGeneratedViewContainer(w,g)}continue}const m=h.filter(w=>this.getViewContainerModel(v).allViewDescriptors.filter(D=>D.id===w.id).length===0);this.addViews(v,m)}}deregisterGroupedViews(o){for(const[g,h]of o.entries()){const v=this.viewContainersRegistry.get(g);!v||!this.viewContainerModels.has(v)||this.removeViews(v,h)}}moveOrphanViewsToDefaultLocation(){for(const[o,g]of this.viewDescriptorsCustomLocations.entries()){if(this.viewContainersRegistry.get(g))continue;const h=this.viewsRegistry.getViewContainer(o),v=this.getViewDescriptorById(o);h&&v&&this.addViews(h,[v])}}onDidRegisterExtensions(){this.moveOrphanViewsToDefaultLocation();for(const o of[...this.viewContainersCustomLocations.keys()])this.cleanUpGeneratedViewContainer(o);this.saveViewCustomizations()}onDidRegisterViews(o){this.contextKeyService.bufferChangeEvents(()=>{o.forEach(({views:g,viewContainer:h})=>{const v=this.regroupViews(h.id,g);this.registerGroupedViews(v),g.forEach(m=>this.getOrCreateMovableViewContextKey(m).set(!!m.canMoveView))})})}isGeneratedContainerId(o){return o.startsWith(yi.COMMON_CONTAINER_ID_PREFIX)}onDidDeregisterViews(o,g){const h=this.regroupViews(g.id,o);this.deregisterGroupedViews(h),this.contextKeyService.bufferChangeEvents(()=>{o.forEach(v=>this.getOrCreateMovableViewContextKey(v).set(!1))})}regroupViews(o,g){const h=new Map;for(const v of g){const m=this.viewDescriptorsCustomLocations.get(v.id)??o;let w=h.get(m);w||h.set(m,w=[]),w.push(v)}return h}getViewDescriptorById(o){return this.viewsRegistry.getView(o)}getViewLocationById(o){const g=this.getViewContainerByViewId(o);return g===null?null:this.getViewContainerLocation(g)}getViewContainerByViewId(o){const g=this.viewDescriptorsCustomLocations.get(o);return g?this.viewContainersRegistry.get(g)??null:this.getDefaultContainerById(o)}getViewContainerLocation(o){return this.viewContainersCustomLocations.get(o.id)??this.getDefaultViewContainerLocation(o)}getDefaultViewContainerLocation(o){return this.viewContainersRegistry.getViewContainerLocation(o)}getDefaultContainerById(o){return this.viewsRegistry.getViewContainer(o)??null}getViewContainerModel(o){return this.getOrRegisterViewContainerModel(o)}getViewContainerById(o){return this.viewContainersRegistry.get(o)||null}getViewContainersByLocation(o){return this.viewContainers.filter(g=>this.getViewContainerLocation(g)===o)}getDefaultViewContainer(o){return this.viewContainersRegistry.getDefaultViewContainer(o)}moveViewContainerToLocation(o,g,h){this.moveViewContainerToLocationWithoutSaving(o,g,h),this.saveViewCustomizations()}moveViewToLocation(o,g){const h=this.registerGeneratedViewContainer(g);this.moveViewsToContainer([o],h)}moveViewsToContainer(o,g,h){if(!o.length)return;const v=this.getViewContainerByViewId(o[0].id),m=g;v&&m&&v!==m&&(this.moveViewsWithoutSaving(o,v,m,h),this.cleanUpGeneratedViewContainer(v.id),this.saveViewCustomizations(),this.reportMovedViews(o,v,m))}reset(){for(const o of this.viewContainers){const g=this.getViewContainerModel(o);for(const m of g.allViewDescriptors){const w=this.getDefaultContainerById(m.id),D=this.getViewContainerByViewId(m.id);D&&w&&D!==w&&this.moveViewsWithoutSaving([m],D,w)}const h=this.getDefaultViewContainerLocation(o),v=this.getViewContainerLocation(o);h!==null&&v!==h&&this.moveViewContainerToLocationWithoutSaving(o,h),this.cleanUpGeneratedViewContainer(o.id)}this.viewContainersCustomLocations.clear(),this.viewDescriptorsCustomLocations.clear(),this.saveViewCustomizations()}isViewContainerRemovedPermanently(o){return this.isGeneratedContainerId(o)&&!this.viewContainersCustomLocations.has(o)}onDidChangeDefaultContainer(o,g,h){const v=o.filter(m=>!this.viewDescriptorsCustomLocations.has(m.id)||!this.viewContainers.includes(g)&&this.viewDescriptorsCustomLocations.get(m.id)===g.id);v.length&&this.moveViewsWithoutSaving(v,g,h)}reportMovedViews(o,g,h){const v=M=>M.id.startsWith(yi.COMMON_CONTAINER_ID_PREFIX)?"custom":M.extensionId?"extension":M.id,m=this.getViewContainerLocation(g),w=this.getViewContainerLocation(h),D=o.length,y=v(g),T=v(h),_=m===1?"panel":"sidebar",L=w===1?"panel":"sidebar";this.telemetryService.publicLog2("viewDescriptorService.moveViews",{viewCount:D,fromContainer:y,toContainer:T,fromLocation:_,toLocation:L})}moveViewsWithoutSaving(o,g,h,v=t.ViewVisibilityState.Expand){this.removeViews(g,o),this.addViews(h,o,v);const m=this.getViewContainerLocation(g),w=this.getViewContainerLocation(h);m!==w&&this._onDidChangeLocation.fire({views:o,from:m,to:w}),this._onDidChangeContainer.fire({views:o,from:g,to:h})}moveViewContainerToLocationWithoutSaving(o,g,h){const v=this.getViewContainerLocation(o),m=g;if(v!==m){const w=this.isGeneratedContainerId(o.id),D=m===this.getDefaultViewContainerLocation(o);w||!D?this.viewContainersCustomLocations.set(o.id,m):this.viewContainersCustomLocations.delete(o.id),this.getOrCreateDefaultViewContainerLocationContextKey(o).set(w||D),o.requestedIndex=h,this._onDidChangeContainerLocation.fire({viewContainer:o,from:v,to:m});const y=this.getViewsByContainer(o);this._onDidChangeLocation.fire({views:y,from:v,to:m})}}cleanUpGeneratedViewContainer(o){if(!this.isGeneratedContainerId(o))return;const g=this.getViewContainerById(o);g&&this.getViewContainerModel(g)?.allViewDescriptors.length||[...this.viewDescriptorsCustomLocations.values()].includes(o)||(g&&this.viewContainersRegistry.deregisterViewContainer(g),this.viewContainersCustomLocations.delete(o),this.storageService.remove((0,f.getViewsStateStorageId)(g?.storageId||d(o)),0))}registerGeneratedViewContainer(o,g){const h=g||this.generateContainerId(o),v=this.viewContainersRegistry.registerViewContainer({id:h,ctorDescriptor:new b.SyncDescriptor(I.ViewPaneContainer,[h,{mergeViewWithContainerWhenSingleView:!0}]),title:h,icon:o===0?t.defaultViewIcon:void 0,storageId:d(h),hideIfEmpty:!0},o,{doNotRegisterOpenCommand:!0});return this.viewContainersCustomLocations.get(v.id)!==o&&this.viewContainersCustomLocations.set(v.id,o),this.getOrCreateDefaultViewContainerLocationContextKey(v).set(!0),v}onDidStorageChange(o){o.key===yi.VIEWS_CUSTOMIZATIONS&&o.scope===0&&JSON.stringify(this.viewCustomizations)!==this.getStoredViewCustomizationsValue()&&this.onDidViewCustomizationsStorageChange()}onDidViewCustomizationsStorageChange(){this._viewCustomizations=void 0;const o=new Map(Object.entries(this.viewCustomizations.viewContainerLocations)),g=new Map(Object.entries(this.viewCustomizations.viewLocations)),h=[],v=[];for(const[m,w]of o.entries()){const D=this.getViewContainerById(m);D?w!==this.getViewContainerLocation(D)&&h.push([D,w]):this.isGeneratedContainerId(m)&&this.registerGeneratedViewContainer(w,m)}for(const m of this.viewContainers)if(!o.has(m.id)){const w=this.getViewContainerLocation(m),D=this.getDefaultViewContainerLocation(m);w!==D&&h.push([m,D])}for(const[m,w]of g.entries()){const D=this.getViewDescriptorById(m);if(D){const y=this.getViewContainerByViewId(m),T=this.viewContainersRegistry.get(w);y&&T&&T!==y&&v.push({views:[D],from:y,to:T})}}for(const m of this.viewContainers){const w=this.getViewContainerModel(m);for(const D of w.allViewDescriptors)if(!g.has(D.id)){const y=this.getViewContainerByViewId(D.id),T=this.getDefaultContainerById(D.id);y&&T&&y!==T&&v.push({views:[D],from:y,to:T})}}for(const[m,w]of h)this.moveViewContainerToLocationWithoutSaving(m,w);for(const{views:m,from:w,to:D}of v)this.moveViewsWithoutSaving(m,w,D)}generateContainerId(o){return`${yi.COMMON_CONTAINER_ID_PREFIX}.${(0,t.ViewContainerLocationToString)(o)}.${(0,u.generateUuid)()}`}saveViewCustomizations(){const o={viewContainerLocations:{},viewLocations:{}};for(const[g,h]of this.viewContainersCustomLocations){const v=this.getViewContainerById(g);v&&!this.isGeneratedContainerId(g)&&h===this.getDefaultViewContainerLocation(v)||(o.viewContainerLocations[g]=h)}for(const[g,h]of this.viewDescriptorsCustomLocations){const v=this.getViewContainerById(h);v&&this.getDefaultContainerById(g)?.id===v.id||(o.viewLocations[g]=h)}this.viewCustomizations=o}get viewCustomizations(){return this._viewCustomizations||(this._viewCustomizations=JSON.parse(this.getStoredViewCustomizationsValue()),this._viewCustomizations.viewContainerLocations=this._viewCustomizations.viewContainerLocations??{},this._viewCustomizations.viewLocations=this._viewCustomizations.viewLocations??{}),this._viewCustomizations}set viewCustomizations(o){const g=JSON.stringify(o);JSON.stringify(this.viewCustomizations)!==g&&(this._viewCustomizations=o,this.setStoredViewCustomizationsValue(g))}getStoredViewCustomizationsValue(){return this.storageService.get(yi.VIEWS_CUSTOMIZATIONS,0,"{}")}setStoredViewCustomizationsValue(o){this.storageService.store(yi.VIEWS_CUSTOMIZATIONS,o,0,0)}getViewsByContainer(o){const g=this.viewsRegistry.getViews(o).filter(h=>(this.viewDescriptorsCustomLocations.get(h.id)??o.id)===o.id);for(const[h,v]of this.viewDescriptorsCustomLocations.entries()){if(v!==o.id||this.viewsRegistry.getViewContainer(h)===o)continue;const m=this.getViewDescriptorById(h);m&&g.push(m)}return g}onDidRegisterViewContainer(o){const g=this.isGeneratedContainerId(o.id)?!0:this.getViewContainerLocation(o)===this.getDefaultViewContainerLocation(o);this.getOrCreateDefaultViewContainerLocationContextKey(o).set(g),this.getOrRegisterViewContainerModel(o)}getOrRegisterViewContainerModel(o){let g=this.viewContainerModels.get(o)?.viewContainerModel;if(!g){const h=new E.DisposableStore;g=h.add(this.instantiationService.createInstance(f.ViewContainerModel,o)),this.onDidChangeActiveViews({added:g.activeViewDescriptors,removed:[]}),g.onDidChangeActiveViewDescriptors(m=>this.onDidChangeActiveViews(m),this,h),this.onDidChangeVisibleViews({added:[...g.visibleViewDescriptors],removed:[]}),g.onDidAddVisibleViewDescriptors(m=>this.onDidChangeVisibleViews({added:m.map(({viewDescriptor:w})=>w),removed:[]}),this,h),g.onDidRemoveVisibleViewDescriptors(m=>this.onDidChangeVisibleViews({added:[],removed:m.map(({viewDescriptor:w})=>w)}),this,h),this.registerViewsVisibilityActions(g),h.add(C.Event.any(g.onDidChangeActiveViewDescriptors,g.onDidAddVisibleViewDescriptors,g.onDidRemoveVisibleViewDescriptors,g.onDidMoveVisibleViewDescriptors)(m=>this.registerViewsVisibilityActions(g))),h.add((0,E.toDisposable)(()=>{this.viewsVisibilityActionDisposables.get(o)?.dispose(),this.viewsVisibilityActionDisposables.delete(o)})),h.add(this.registerResetViewContainerAction(o)),this.viewContainerModels.set(o,{viewContainerModel:g,disposable:h}),this.onDidRegisterViews([{views:this.viewsRegistry.getViews(o),viewContainer:o}]);const v=this.getViewsByContainer(o).filter(m=>this.getDefaultContainerById(m.id)!==o);v.length&&(this.addViews(o,v),this.contextKeyService.bufferChangeEvents(()=>{v.forEach(m=>this.getOrCreateMovableViewContextKey(m).set(!!m.canMoveView))}))}return g}onDidDeregisterViewContainer(o){const g=this.viewContainerModels.get(o);g&&(g.disposable.dispose(),this.viewContainerModels.delete(o))}onDidChangeActiveViews({added:o,removed:g}){this.contextKeyService.bufferChangeEvents(()=>{o.forEach(h=>this.getOrCreateActiveViewContextKey(h).set(!0)),g.forEach(h=>this.getOrCreateActiveViewContextKey(h).set(!1))})}onDidChangeVisibleViews({added:o,removed:g}){this.contextKeyService.bufferChangeEvents(()=>{o.forEach(h=>this.getOrCreateVisibleViewContextKey(h).set(!0)),g.forEach(h=>this.getOrCreateVisibleViewContextKey(h).set(!1))})}registerViewsVisibilityActions(o){let g=this.viewsVisibilityActionDisposables.get(o.viewContainer);g||(g=new E.DisposableStore,this.viewsVisibilityActionDisposables.set(o.viewContainer,g)),g.clear(),o.activeViewDescriptors.forEach((h,v)=>{h.remoteAuthority||(g?.add((0,c.registerAction2)(class extends I.ViewPaneContainerAction{constructor(){super({id:`${h.id}.toggleVisibility`,viewPaneContainerId:o.viewContainer.id,precondition:h.canToggleVisibility&&(!o.isVisible(h.id)||o.visibleViewDescriptors.length>1)?p.ContextKeyExpr.true():p.ContextKeyExpr.false(),toggled:p.ContextKeyExpr.has(`${h.id}.visible`),title:h.name,menu:[{id:I.ViewsSubMenu,group:"1_toggleViews",when:p.ContextKeyExpr.and(p.ContextKeyExpr.equals("viewContainer",o.viewContainer.id),p.ContextKeyExpr.equals("viewContainerLocation",(0,t.ViewContainerLocationToString)(0))),order:v},{id:c.MenuId.ViewContainerTitleContext,when:p.ContextKeyExpr.and(p.ContextKeyExpr.equals("viewContainer",o.viewContainer.id)),order:v,group:"1_toggleVisibility"},{id:c.MenuId.ViewTitleContext,when:p.ContextKeyExpr.and(o.visibleViewDescriptors.length>1?p.ContextKeyExpr.or(...o.visibleViewDescriptors.map(m=>p.ContextKeyExpr.equals("view",m.id))):p.ContextKeyExpr.false()),order:v,group:"2_toggleVisibility"}]})}async runInViewPaneContainer(m,w){w.toggleViewVisibility(h.id)}})),g?.add((0,c.registerAction2)(class extends I.ViewPaneContainerAction{constructor(){super({id:`${h.id}.removeView`,viewPaneContainerId:o.viewContainer.id,title:(0,l.localize)(1,null,h.name),precondition:h.canToggleVisibility&&(!o.isVisible(h.id)||o.visibleViewDescriptors.length>1)?p.ContextKeyExpr.true():p.ContextKeyExpr.false(),menu:[{id:c.MenuId.ViewTitleContext,when:p.ContextKeyExpr.and(p.ContextKeyExpr.equals("view",h.id),p.ContextKeyExpr.has(`${h.id}.visible`)),group:"1_hide",order:1}]})}async runInViewPaneContainer(m,w){w.toggleViewVisibility(h.id)}})))})}registerResetViewContainerAction(o){const g=this;return(0,c.registerAction2)(class extends c.Action2{constructor(){super({id:`${o.id}.resetViewContainerLocation`,title:{original:"Reset Location",value:(0,l.localize)(2,null)},menu:[{id:c.MenuId.ViewContainerTitleContext,when:p.ContextKeyExpr.or(p.ContextKeyExpr.and(p.ContextKeyExpr.equals("viewContainer",o.id),p.ContextKeyExpr.equals(`${o.id}.defaultViewContainerLocation`,!1)))}]})}run(){g.moveViewContainerToLocation(o,g.getDefaultViewContainerLocation(o))}})}addViews(o,g,h=t.ViewVisibilityState.Default){this.contextKeyService.bufferChangeEvents(()=>{g.forEach(v=>{const m=this.getDefaultContainerById(v.id)===o;this.getOrCreateDefaultViewLocationContextKey(v).set(m),m?this.viewDescriptorsCustomLocations.delete(v.id):this.viewDescriptorsCustomLocations.set(v.id,o.id)})}),this.getViewContainerModel(o).add(g.map(v=>({viewDescriptor:v,collapsed:h===t.ViewVisibilityState.Default?void 0:!1,visible:h===t.ViewVisibilityState.Default?void 0:!0})))}removeViews(o,g){this.contextKeyService.bufferChangeEvents(()=>{g.forEach(h=>{this.viewDescriptorsCustomLocations.get(h.id)===o.id&&this.viewDescriptorsCustomLocations.delete(h.id),this.getOrCreateDefaultViewLocationContextKey(h).set(!1)})}),this.getViewContainerModel(o).remove(g)}getOrCreateActiveViewContextKey(o){const g=`${o.id}.active`;let h=this.activeViewContextKeys.get(g);return h||(h=new p.RawContextKey(g,!1).bindTo(this.contextKeyService),this.activeViewContextKeys.set(g,h)),h}getOrCreateVisibleViewContextKey(o){const g=`${o.id}.visible`;let h=this.activeViewContextKeys.get(g);return h||(h=new p.RawContextKey(g,!1).bindTo(this.contextKeyService),this.activeViewContextKeys.set(g,h)),h}getOrCreateMovableViewContextKey(o){const g=`${o.id}.canMove`;let h=this.movableViewContextKeys.get(g);return h||(h=new p.RawContextKey(g,!1).bindTo(this.contextKeyService),this.movableViewContextKeys.set(g,h)),h}getOrCreateDefaultViewLocationContextKey(o){const g=`${o.id}.defaultViewLocation`;let h=this.defaultViewLocationContextKeys.get(g);return h||(h=new p.RawContextKey(g,!1).bindTo(this.contextKeyService),this.defaultViewLocationContextKeys.set(g,h)),h}getOrCreateDefaultViewContainerLocationContextKey(o){const g=`${o.id}.defaultViewContainerLocation`;let h=this.defaultViewContainerLocationContextKeys.get(g);return h||(h=new p.RawContextKey(g,!1).bindTo(this.contextKeyService),this.defaultViewContainerLocationContextKeys.set(g,h)),h}};n.VIEWS_CUSTOMIZATIONS="views.customizations",n.COMMON_CONTAINER_ID_PREFIX="workbench.views.service",n=we([F(0,i.IInstantiationService),F(1,p.IContextKeyService),F(2,R.IStorageService),F(3,A.IExtensionService),F(4,r.ITelemetryService)],n),e.ViewDescriptorService=n,(0,S.registerSingleton)(t.IViewDescriptorService,n,1)}),define(ae[564],le([1,0,6,2,158,22,9,8,35,148,223,227,23,34,118,187,51,57,18,14]),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.WorkspaceTrustRequestService=e.WorkspaceTrustManagementService=e.WorkspaceTrustEnablementService=e.CanonicalWorkspace=e.WORKSPACE_TRUST_STORAGE_KEY=e.WORKSPACE_TRUST_EXTENSION_SUPPORT=e.WORKSPACE_TRUST_EMPTY_WINDOW=e.WORKSPACE_TRUST_UNTRUSTED_FILES=e.WORKSPACE_TRUST_BANNER=e.WORKSPACE_TRUST_STARTUP_PROMPT=e.WORKSPACE_TRUST_ENABLED=void 0,e.WORKSPACE_TRUST_ENABLED="security.workspace.trust.enabled",e.WORKSPACE_TRUST_STARTUP_PROMPT="security.workspace.trust.startupPrompt",e.WORKSPACE_TRUST_BANNER="security.workspace.trust.banner",e.WORKSPACE_TRUST_UNTRUSTED_FILES="security.workspace.trust.untrustedFiles",e.WORKSPACE_TRUST_EMPTY_WINDOW="security.workspace.trust.emptyWindow",e.WORKSPACE_TRUST_EXTENSION_SUPPORT="extensions.supportUntrustedWorkspaces",e.WORKSPACE_TRUST_STORAGE_KEY="content.trust.model.key";class n{constructor(w,D,y){this.originalWorkspace=w,this.canonicalFolderUris=D,this.canonicalConfiguration=y}get folders(){return this.originalWorkspace.folders.map((w,D)=>({index:w.index,name:w.name,toResource:w.toResource,uri:this.canonicalFolderUris[D]}))}get transient(){return this.originalWorkspace.transient}get configuration(){return this.canonicalConfiguration??this.originalWorkspace.configuration}get id(){return this.originalWorkspace.id}}e.CanonicalWorkspace=n;let a=class extends p.Disposable{constructor(w,D){super(),this.configurationService=w,this.environmentService=D}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(e.WORKSPACE_TRUST_ENABLED)}};a=we([F(0,E.IConfigurationService),F(1,c.IWorkbenchEnvironmentService)],a),e.WorkspaceTrustEnablementService=a;let o=class extends p.Disposable{constructor(w,D,y,T,_,L,M){super(),this.configurationService=w,this.remoteAuthorityResolverService=D,this.storageService=y,this.uriIdentityService=T,this.environmentService=_,this.workspaceService=L,this.workspaceTrustEnablementService=M,this.storageKey=e.WORKSPACE_TRUST_STORAGE_KEY,this._onDidChangeTrust=this._register(new t.Emitter),this.onDidChangeTrust=this._onDidChangeTrust.event,this._onDidChangeTrustedFolders=this._register(new t.Emitter),this.onDidChangeTrustedFolders=this._onDidChangeTrustedFolders.event,this._canonicalStartupFiles=[],this._canonicalUrisResolved=!1,this._canonicalWorkspace=this.workspaceService.getWorkspace(),this._workspaceResolvedPromise=new Promise(O=>{this._workspaceResolvedPromiseResolve=O}),this._workspaceTrustInitializedPromise=new Promise(O=>{this._workspaceTrustInitializedPromiseResolve=O}),this._storedTrustState=new v(d.isWeb&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new h),this._trustStateInfo=this.loadTrustInfo(),this._isTrusted=this.calculateWorkspaceTrust(),this.initializeWorkspaceTrust(),this.registerListeners()}initializeWorkspaceTrust(){this.resolveCanonicalUris().then(async()=>{this._canonicalUrisResolved=!0,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceResolvedPromiseResolve(),this.environmentService.remoteAuthority||this._workspaceTrustInitializedPromiseResolve()}),this.environmentService.remoteAuthority&&this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority).then(async w=>{this._remoteAuthority=w,await this.updateWorkspaceTrust()}).finally(()=>{this._workspaceTrustInitializedPromiseResolve()}),this.isEmptyWorkspace()&&this._workspaceTrustInitializedPromise.then(()=>{this._storedTrustState.isEmptyWorkspaceTrusted===void 0&&(this._storedTrustState.isEmptyWorkspaceTrusted=this.isWorkspaceTrusted())})}registerListeners(){this._register(this.workspaceService.onDidChangeWorkspaceFolders(async()=>await this.updateWorkspaceTrust())),this._register(this.storageService.onDidChangeValue(async w=>{w.key===this.storageKey&&JSON.stringify(this._trustStateInfo)!==JSON.stringify(this.loadTrustInfo())&&(this._trustStateInfo=this.loadTrustInfo(),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust())}))}async getCanonicalUri(w){let D=w;if(this.environmentService.remoteAuthority&&w.scheme===A.Schemas.vscodeRemote)D=await this.remoteAuthorityResolverService.getCanonicalURI(w);else if(w.scheme==="vscode-vfs"){const y=w.authority.indexOf("+");y!==-1&&(D=w.with({authority:w.authority.substr(0,y)}))}return D.with({query:null,fragment:null})}async resolveCanonicalUris(){const w=[];if(this.environmentService.filesToOpenOrCreate&&w.push(...this.environmentService.filesToOpenOrCreate),this.environmentService.filesToDiff&&w.push(...this.environmentService.filesToDiff),this.environmentService.filesToMerge&&w.push(...this.environmentService.filesToMerge),w.length){const _=w.filter(M=>!!M.fileUri).map(M=>M.fileUri),L=await Promise.all(_.map(M=>this.getCanonicalUri(M)));this._canonicalStartupFiles.push(...L.filter(M=>this._canonicalStartupFiles.every(O=>!this.uriIdentityService.extUri.isEqual(M,O))))}const D=this.workspaceService.getWorkspace().folders.map(_=>_.uri),y=await Promise.all(D.map(_=>this.getCanonicalUri(_)));let T=this.workspaceService.getWorkspace().configuration;T&&(0,u.isSavedWorkspace)(T,this.environmentService)&&(T=await this.getCanonicalUri(T)),this._canonicalWorkspace=new n(this.workspaceService.getWorkspace(),y,T)}loadTrustInfo(){const w=this.storageService.get(this.storageKey,-1);let D;try{w&&(D=JSON.parse(w))}catch{}return D||(D={uriTrustInfo:[]}),D.uriTrustInfo||(D.uriTrustInfo=[]),D.uriTrustInfo=D.uriTrustInfo.map(y=>({uri:k.URI.revive(y.uri),trusted:y.trusted})),D.uriTrustInfo=D.uriTrustInfo.filter(y=>y.trusted),D}async saveTrustInfo(){this.storageService.store(this.storageKey,JSON.stringify(this._trustStateInfo),-1,1),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const w=this._canonicalWorkspace.folders.map(y=>y.uri),D=this._canonicalWorkspace.configuration;return D&&(0,u.isSavedWorkspace)(D,this.environmentService)&&w.push(D),w}calculateWorkspaceTrust(){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this._canonicalUrisResolved?this.environmentService.remoteAuthority&&this._remoteAuthority?.options?.isTrusted?this._remoteAuthority.options.isTrusted:this.isEmptyWorkspace()?this._storedTrustState.isEmptyWorkspaceTrusted!==void 0?this._storedTrustState.isEmptyWorkspaceTrusted:this._canonicalStartupFiles.length?this.getUrisTrust(this._canonicalStartupFiles):!!this.configurationService.getValue(e.WORKSPACE_TRUST_EMPTY_WINDOW):this.getUrisTrust(this.getWorkspaceUris()):!1:!0}async updateWorkspaceTrust(w){!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||(w===void 0&&(await this.resolveCanonicalUris(),w=this.calculateWorkspaceTrust()),this.isWorkspaceTrusted()!==w&&(this.isTrusted=w,await this._trustTransitionManager.participate(w),this._onDidChangeTrust.fire(w)))}getUrisTrust(w){let D=!0;for(const y of w){const{trusted:T}=this.doGetUriTrustInfo(y);if(!T)return D=T,D}return D}doGetUriTrustInfo(w){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled())return{trusted:!0,uri:w};if(this.isTrustedVirtualResource(w))return{trusted:!0,uri:w};if(this.isTrustedByRemote(w))return{trusted:!0,uri:w};let D=!1,y=-1,T=w;for(const _ of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqualOrParent(w,_.uri)){const L=_.uri.fsPath;L.length>y&&(y=L.length,D=_.trusted,T=_.uri)}return{trusted:D,uri:T}}async doSetUrisTrust(w,D){let y=!1;for(const T of w)if(D){if(this.isTrustedVirtualResource(T)||this.isTrustedByRemote(T))continue;this._trustStateInfo.uriTrustInfo.find(L=>this.uriIdentityService.extUri.isEqual(L.uri,T))||(this._trustStateInfo.uriTrustInfo.push({uri:T,trusted:!0}),y=!0)}else{const _=this._trustStateInfo.uriTrustInfo.length;this._trustStateInfo.uriTrustInfo=this._trustStateInfo.uriTrustInfo.filter(L=>!this.uriIdentityService.extUri.isEqual(L.uri,T)),_!==this._trustStateInfo.uriTrustInfo.length&&(y=!0)}y&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===1)return!0;const w=this.workspaceService.getWorkspace();return w?(0,u.isTemporaryWorkspace)(this.workspaceService.getWorkspace())&&w.folders.length===0:!1}isTrustedVirtualResource(w){return(0,C.isVirtualResource)(w)&&w.scheme!=="vscode-vfs"}isTrustedByRemote(w){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:(0,s.isEqualAuthority)((0,S.getRemoteAuthority)(w),this._remoteAuthority.authority.authority)&&!!this._remoteAuthority.options?.isTrusted}set isTrusted(w){this._isTrusted=w,w||(this._storedTrustState.acceptsOutOfWorkspaceFiles=!1),this.isEmptyWorkspace()&&(this._storedTrustState.isEmptyWorkspaceTrusted=w)}get workspaceResolved(){return this._workspaceResolvedPromise}get workspaceTrustInitialized(){return this._workspaceTrustInitializedPromise}get acceptsOutOfWorkspaceFiles(){return this._storedTrustState.acceptsOutOfWorkspaceFiles}set acceptsOutOfWorkspaceFiles(w){this._storedTrustState.acceptsOutOfWorkspaceFiles=w}isWorkspaceTrusted(){return this._isTrusted}isWorkspaceTrustForced(){return!!(this.environmentService.remoteAuthority&&this._remoteAuthority&&this._remoteAuthority.options?.isTrusted!==void 0||this.getWorkspaceUris().filter(D=>!this.isTrustedVirtualResource(D)).length===0)}canSetParentFolderTrust(){const w=(0,u.toWorkspaceIdentifier)(this._canonicalWorkspace);if(!(0,u.isSingleFolderWorkspaceIdentifier)(w)||w.uri.scheme!==A.Schemas.file&&w.uri.scheme!==A.Schemas.vscodeRemote)return!1;const D=this.uriIdentityService.extUri.dirname(w.uri);return!this.uriIdentityService.extUri.isEqual(w.uri,D)}async setParentFolderTrust(w){if(this.canSetParentFolderTrust()){const D=(0,u.toWorkspaceIdentifier)(this._canonicalWorkspace).uri,y=this.uriIdentityService.extUri.dirname(D);await this.setUrisTrust([y],w)}}canSetWorkspaceTrust(){if(this.environmentService.remoteAuthority&&(!this._remoteAuthority||this._remoteAuthority.options?.isTrusted!==void 0))return!1;if(this.isEmptyWorkspace())return!0;if(this.getWorkspaceUris().filter(T=>!this.isTrustedVirtualResource(T)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const D=(0,u.toWorkspaceIdentifier)(this._canonicalWorkspace);if(!(0,u.isSingleFolderWorkspaceIdentifier)(D)||D.uri.scheme!==A.Schemas.file&&D.uri.scheme!=="vscode-vfs")return!1;const y=this.doGetUriTrustInfo(D.uri);if(!y.trusted||!this.uriIdentityService.extUri.isEqual(D.uri,y.uri))return!1;if(this.canSetParentFolderTrust()){const T=this.uriIdentityService.extUri.dirname(D.uri);if(this.doGetUriTrustInfo(T).trusted)return!1}return!0}async setWorkspaceTrust(w){if(this.isEmptyWorkspace()){await this.updateWorkspaceTrust(w);return}const D=this.getWorkspaceUris();await this.setUrisTrust(D,w)}async getUriTrustInfo(w){return this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()?this.isTrustedByRemote(w)?{trusted:!0,uri:w}:this.doGetUriTrustInfo(await this.getCanonicalUri(w)):{trusted:!0,uri:w}}async setUrisTrust(w,D){this.doSetUrisTrust(await Promise.all(w.map(y=>this.getCanonicalUri(y))),D)}getTrustedUris(){return this._trustStateInfo.uriTrustInfo.map(w=>w.uri)}async setTrustedUris(w){this._trustStateInfo.uriTrustInfo=[];for(const D of w){const y=await this.getCanonicalUri(D),T=this.uriIdentityService.extUri.removeTrailingPathSeparator(y);let _=!1;for(const L of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(L.uri,T)){_=!0;break}_||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:T})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(w){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(w)}};o=we([F(0,E.IConfigurationService),F(1,b.IRemoteAuthorityResolverService),F(2,r.IStorageService),F(3,l.IUriIdentityService),F(4,c.IWorkbenchEnvironmentService),F(5,u.IWorkspaceContextService),F(6,i.IWorkspaceTrustEnablementService)],o),e.WorkspaceTrustManagementService=o;let g=class extends p.Disposable{constructor(w,D){super(),this.configurationService=w,this.workspaceTrustManagementService=D,this._onDidInitiateOpenFilesTrustRequest=this._register(new t.Emitter),this.onDidInitiateOpenFilesTrustRequest=this._onDidInitiateOpenFilesTrustRequest.event,this._onDidInitiateWorkspaceTrustRequest=this._register(new t.Emitter),this.onDidInitiateWorkspaceTrustRequest=this._onDidInitiateWorkspaceTrustRequest.event,this._onDidInitiateWorkspaceTrustRequestOnStartup=this._register(new t.Emitter),this.onDidInitiateWorkspaceTrustRequestOnStartup=this._onDidInitiateWorkspaceTrustRequestOnStartup.event}get untrustedFilesSetting(){return this.configurationService.getValue(e.WORKSPACE_TRUST_UNTRUSTED_FILES)}set untrustedFilesSetting(w){this.configurationService.updateValue(e.WORKSPACE_TRUST_UNTRUSTED_FILES,w)}async completeOpenFilesTrustRequest(w,D){!this._openFilesTrustRequestResolver||(w===1&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),D&&(w===1&&(this.untrustedFilesSetting="open"),w===2&&(this.untrustedFilesSetting="newWindow")),this._openFilesTrustRequestResolver(w),this._openFilesTrustRequestResolver=void 0,this._openFilesTrustRequestPromise=void 0)}async requestOpenFilesTrust(w){if(!this.workspaceTrustManagementService.isWorkspaceTrusted()||(await Promise.all(w.map(y=>this.workspaceTrustManagementService.getUriTrustInfo(y)))).map(y=>y.trusted).every(y=>y))return 1;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return 2;if(this.untrustedFilesSetting==="open")return 1}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return 1;if(!this._openFilesTrustRequestPromise)this._openFilesTrustRequestPromise=new Promise(y=>{this._openFilesTrustRequestResolver=y});else return this._openFilesTrustRequestPromise;return this._onDidInitiateOpenFilesTrustRequest.fire(),this._openFilesTrustRequestPromise}resolveWorkspaceTrustRequest(w){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(w??this.workspaceTrustManagementService.isWorkspaceTrusted()),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}cancelWorkspaceTrustRequest(){this._workspaceTrustRequestResolver&&(this._workspaceTrustRequestResolver(void 0),this._workspaceTrustRequestResolver=void 0,this._workspaceTrustRequestPromise=void 0)}async completeWorkspaceTrustRequest(w){if(w===void 0||w===this.workspaceTrustManagementService.isWorkspaceTrusted()){this.resolveWorkspaceTrustRequest(w);return}t.Event.once(this.workspaceTrustManagementService.onDidChangeTrust)(D=>this.resolveWorkspaceTrustRequest(D)),await this.workspaceTrustManagementService.setWorkspaceTrust(w)}async requestWorkspaceTrust(w){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return this.workspaceTrustManagementService.isWorkspaceTrusted();if(!this._workspaceTrustRequestPromise)this._workspaceTrustRequestPromise=new Promise(D=>{this._workspaceTrustRequestResolver=D});else return this._workspaceTrustRequestPromise;return this._onDidInitiateWorkspaceTrustRequest.fire(w),this._workspaceTrustRequestPromise}requestWorkspaceTrustOnStartup(){this._workspaceTrustRequestPromise||(this._workspaceTrustRequestPromise=new Promise(w=>{this._workspaceTrustRequestResolver=w})),this._onDidInitiateWorkspaceTrustRequestOnStartup.fire()}};g=we([F(0,E.IConfigurationService),F(1,i.IWorkspaceTrustManagementService)],g),e.WorkspaceTrustRequestService=g;class h extends p.Disposable{constructor(){super(...arguments),this.participants=new R.LinkedList}addWorkspaceTrustTransitionParticipant(w){const D=this.participants.push(w);return(0,p.toDisposable)(()=>D())}async participate(w){for(const D of this.participants)await D.participate(w)}dispose(){this.participants.clear()}}class v{constructor(w){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",w?(this._memento=new f.Memento("workspaceTrust",w),this._mementoObject=this._memento.getMemento(1,1)):this._mementoObject={}}get acceptsOutOfWorkspaceFiles(){return this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]??!1}set acceptsOutOfWorkspaceFiles(w){this._mementoObject[this._acceptsOutOfWorkspaceFilesKey]=w,this._memento?.saveMemento()}get isEmptyWorkspaceTrusted(){return this._mementoObject[this._isEmptyWorkspaceTrustedKey]}set isEmptyWorkspaceTrusted(w){this._mementoObject[this._isEmptyWorkspaceTrustedKey]=w,this._memento?.saveMemento()}}(0,I.registerSingleton)(i.IWorkspaceTrustRequestService,g,1)}),define(ae[3016],le([1,0,1988,307,243,2976,1015,86,10,21,9,2867,128,151,25,2752,34,176,23,2,102,2734,2122,148,2724,104,2107,674,2723,2441,505,46,57,2220,2584,603,2092,499,183,2647,564,118,52,2735,14,22,2563,2223,103,2258,2111,501,2874,135,166]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.main=e.DesktopMain=void 0;class oe extends d.Disposable{constructor(Z){super(),this.configuration=Z,this.init()}init(){this.reviveUris();const Z=this.configuration.zoomLevel||0;(0,E.setZoomFactor)((0,R.zoomLevelToZoomFactor)(Z)),(0,E.setZoomLevel)(Z,!0),(0,E.setFullscreen)(!!this.configuration.fullscreen)}reviveUris(){const Z=(0,c.reviveIdentifier)(this.configuration.workspace);((0,c.isWorkspaceIdentifier)(Z)||(0,c.isSingleFolderWorkspaceIdentifier)(Z))&&(this.configuration.workspace=Z);const ne=this.configuration.filesToWait,ce=ne?.paths;for(const de of[ce,this.configuration.filesToOpenOrCreate,this.configuration.filesToDiff,this.configuration.filesToMerge])if(Array.isArray(de))for(const he of de)he.fileUri&&(he.fileUri=S.URI.revive(he.fileUri));ne&&(ne.waitMarkerFileUri=S.URI.revive(ne.waitMarkerFileUri))}async open(){const[Z]=await Promise.all([this.initServices(),(0,I.domContentLoaded)()]),ne=new A.Workbench(document.body,{extraClasses:this.getExtraClasses()},Z.serviceCollection,Z.logService);this.registerListeners(ne,Z.storageService);const ce=ne.startup();this._register(ce.createInstance(k.NativeWindow))}getExtraClasses(){return $.isMacintosh&&this.configuration.os.release>"20.0.0"?["macos-bigsur-or-newer"]:[]}registerListeners(Z,ne){this._register(Z.onWillShutdown(ce=>ce.join(ne.close(),{id:"join.closeStorage",label:(0,t.localize)(0,null)}))),this._register(Z.onDidShutdown(()=>this.dispose()))}async initServices(){const Z=new u.ServiceCollection,ne=this._register(new P.ElectronIPCMainProcessService(this.configuration.windowId));Z.set(n.IMainProcessService,ne);const ce=this.configuration.policiesData?new K.PolicyChannelClient(this.configuration.policiesData,ne.getChannel("policy")):new Y.NullPolicyService;Z.set(Y.IPolicyService,ce);const de={_serviceBrand:void 0,...p.default};Z.set(_.IProductService,de);const he=new r.NativeWorkbenchEnvironmentService(this.configuration,de);Z.set(r.INativeWorkbenchEnvironmentService,he);const pe=new B.LogLevelChannelClient(ne.getChannel("logLevel")),me=new B.LoggerChannelClient(this.configuration.logLevel,pe.onDidChangeLogLevel,ne.getChannel("logger"));Z.set(i.ILoggerService,me);const Se=this._register(new z.NativeLogService(`renderer${this.configuration.windowId}`,this.configuration.logLevel,me,pe,he));Z.set(i.ILogService,Se),$.isCI&&Se.info("workbench#open()"),Se.getLevel()===i.LogLevel.Trace&&Se.trace("workbench#open(): with configuration",(0,W.safeStringify)(this.configuration)),re.process.sandboxed&&Se.info("Electron sandbox mode is enabled!");const Ie=new a.SharedProcessService(this.configuration.windowId,Se);Z.set(n.ISharedProcessService,Ie);const ve=new U.SharedProcessWorkerWorkbenchService(this.configuration.windowId,Se,Ie);Z.set(U.ISharedProcessWorkerWorkbenchService,ve);const be=new o.RemoteAuthorityResolverService(de);Z.set(g.IRemoteAuthorityResolverService,be);const ge=V.ProxyChannel.toService(ne.getChannel("sign"));Z.set(T.ISignService,ge);const ue=this._register(new h.RemoteAgentService(he,de,be,ge,Se));Z.set(v.IRemoteAgentService,ue);const Ce=this._register(new m.FileService(Se));Z.set(w.IWorkbenchFileService,Ce);const De=this._register(new X.DiskFileSystemProvider(ne,ve,Se));Ce.registerProvider(q.Schemas.file,De),this._register(D.RemoteFileSystemProviderClient.register(ue,Ce,Se)),Ce.registerProvider(q.Schemas.vscodeUserData,this._register(new G.FileUserDataProvider(q.Schemas.file,De,q.Schemas.vscodeUserData,Se)));const Ae=new M.UriIdentityService(Ce);Z.set(L.IUriIdentityService,Ae);const Pe=new j.UserDataProfilesNativeService(this.configuration.profiles.all,ne,he);Z.set(Q.IUserDataProfilesService,Pe);const fe=new ee.UserDataProfileService((0,Q.reviveProfile)(this.configuration.profiles.profile,Pe.profilesHome.scheme),Pe);Z.set(ie.IUserDataProfileService,fe);const ye=this.resolveWorkspaceIdentifier(he),[ke,Ee]=await Promise.all([this.createWorkspaceService(ye,he,fe,Pe,Ce,ue,Ae,Se,ce).then(Re=>(Z.set(c.IWorkspaceContextService,Re),Z.set(l.IWorkbenchConfigurationService,Re),Re)),this.createStorageService(ye,he,fe,Pe,ne).then(Re=>(Z.set(s.IStorageService,Re),Re)),this.createKeyboardLayoutService(ne).then(Re=>(Z.set(N.IKeyboardLayoutService,Re),Re))]);Pe.setEnablement(de.quality!=="stable"||ke.getValue(Q.PROFILES_ENABLEMENT_CONFIG));const Te=new x.WorkspaceTrustEnablementService(ke,he);Z.set(H.IWorkspaceTrustEnablementService,Te);const _e=new x.WorkspaceTrustManagementService(ke,be,Ee,Ae,he,ke,Te);return Z.set(H.IWorkspaceTrustManagementService,_e),ke.updateWorkspaceTrust(_e.isWorkspaceTrusted()),this._register(_e.onDidChangeTrust(()=>ke.updateWorkspaceTrust(_e.isWorkspaceTrusted()))),{serviceCollection:Z,logService:Se,storageService:Ee}}resolveWorkspaceIdentifier(Z){if(this.configuration.workspace)return this.configuration.workspace;const ne=(0,c.toWorkspaceIdentifier)(this.configuration.backupPath,Z.isExtensionDevelopment);if(!ne)throw new Error("Unable to resolve an empty workspace identifier from the environment");return ne}async createWorkspaceService(Z,ne,ce,de,he,pe,me,Se,Ie){const ve=new y.ConfigurationCache([q.Schemas.file,q.Schemas.vscodeUserData],ne,he),be=new C.WorkspaceService({remoteAuthority:ne.remoteAuthority,configurationCache:ve},ne,ce,de,he,pe,me,Se,Ie);try{return await be.initialize(Z),be}catch(ge){return(0,b.onUnexpectedError)(ge),be}}async createStorageService(Z,ne,ce,de,he){const pe=new f.NativeWorkbenchStorageService(Z,ce,de,he,ne);try{return await pe.initialize(),pe}catch(me){return(0,b.onUnexpectedError)(me),pe}}async createKeyboardLayoutService(Z){const ne=new O.KeyboardLayoutService(Z);try{return await ne.initialize(),ne}catch(ce){return(0,b.onUnexpectedError)(ce),ne}}}e.DesktopMain=oe;function se(te){return new oe(te).open()}e.main=se}),define(ae[233],le([1,0,8,115,131,100,16,46,5,35,2,564,13,118,25,14]),function(J,e,t,p,R,A,k,E,I,b,S,C,r,u,i,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionManifestPropertiesService=e.IExtensionManifestPropertiesService=void 0,e.IExtensionManifestPropertiesService=(0,I.createDecorator)("extensionManifestPropertiesService");let c=class extends S.Disposable{constructor(s,d,n,a){super(),this.productService=s,this.configurationService=d,this.workspaceTrustEnablementService=n,this.logService=a,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new Map;const o=d.inspect(C.WORKSPACE_TRUST_EXTENSION_SUPPORT).userValue||{};for(const g of Object.keys(o))this._configuredExtensionWorkspaceTrustRequestMap.set(p.ExtensionIdentifier.toKey(g),o[g]);if(this._productExtensionWorkspaceTrustRequestMap=new Map,s.extensionUntrustedWorkspaceSupport)for(const g of Object.keys(s.extensionUntrustedWorkspaceSupport))this._productExtensionWorkspaceTrustRequestMap.set(p.ExtensionIdentifier.toKey(g),s.extensionUntrustedWorkspaceSupport[g])}prefersExecuteOnUI(s){const d=this.getExtensionKind(s);return d.length>0&&d[0]==="ui"}prefersExecuteOnWorkspace(s){const d=this.getExtensionKind(s);return d.length>0&&d[0]==="workspace"}prefersExecuteOnWeb(s){const d=this.getExtensionKind(s);return d.length>0&&d[0]==="web"}canExecuteOnUI(s){return this.getExtensionKind(s).some(n=>n==="ui")}canExecuteOnWorkspace(s){return this.getExtensionKind(s).some(n=>n==="workspace")}canExecuteOnWeb(s){return this.getExtensionKind(s).some(n=>n==="web")}getExtensionKind(s){const d=this.deduceExtensionKind(s),n=this.getConfiguredExtensionKind(s);if(n&&n.length>0){const a=[];for(const o of n)o!=="-web"&&a.push(o);return n.includes("-web")&&!a.length&&(a.push("ui"),a.push("workspace")),f.isWeb&&!n.includes("-web")&&!n.includes("web")&&d.includes("web")&&a.push("web"),a}return d}getUserConfiguredExtensionKind(s){if(this._configuredExtensionKindsMap===null){const n=new Map,a=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(a))n.set(p.ExtensionIdentifier.toKey(o),a[o]);this._configuredExtensionKindsMap=n}const d=this._configuredExtensionKindsMap.get(p.ExtensionIdentifier.toKey(s.id));return d?this.toArray(d):void 0}getExtensionUntrustedWorkspaceSupportType(s){if(!this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()||!s.main)return!0;const d=this.getConfiguredExtensionWorkspaceTrustRequest(s),n=this.getProductExtensionWorkspaceTrustRequest(s);return d!==void 0?d:n?.override!==void 0?n.override:s.capabilities?.untrustedWorkspaces?.supported!==void 0?s.capabilities.untrustedWorkspaces.supported:n?.default!==void 0?n.default:!1}getExtensionVirtualWorkspaceSupportType(s){const d=this.getConfiguredVirtualWorkspaceSupport(s);if(d!==void 0)return d;const n=this.getProductVirtualWorkspaceSupport(s);if(n?.override!==void 0)return n.override;const a=s.capabilities?.virtualWorkspaces;if((0,r.isBoolean)(a))return a;if(a){const o=a.supported;if((0,r.isBoolean)(o)||o==="limited")return o}return n?.default!==void 0?n.default:!0}deduceExtensionKind(s){if(s.main)return s.browser?f.isWeb?["workspace","web"]:["workspace"]:["workspace"];if(s.browser)return["web"];let d=[...p.ALL_EXTENSION_KINDS];if(((0,k.isNonEmptyArray)(s.extensionPack)||(0,k.isNonEmptyArray)(s.extensionDependencies))&&(d=f.isWeb?["workspace","web"]:["workspace"]),s.contributes)for(const n of Object.keys(s.contributes)){const a=this.getSupportedExtensionKindsForExtensionPoint(n);a.length&&(d=d.filter(o=>a.includes(o)))}return d.length||this.logService.warn("Cannot deduce extensionKind for extension",(0,A.getGalleryExtensionId)(s.publisher,s.name)),d}getSupportedExtensionKindsForExtensionPoint(s){if(this._extensionPointExtensionKindsMap===null){const n=new Map;R.ExtensionsRegistry.getExtensionPoints().forEach(a=>n.set(a.name,a.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=n}let d=this._extensionPointExtensionKindsMap.get(s);return d||(d=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[s]:void 0,d)?d:f.isWeb?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(s){const d={id:(0,A.getGalleryExtensionId)(s.publisher,s.name)};let n=this.getUserConfiguredExtensionKind(d);return typeof n<"u"?this.toArray(n):(n=this.getProductExtensionKind(s),typeof n<"u"?n:(n=s.extensionKind,typeof n<"u"?(n=this.toArray(n),n.filter(a=>["ui","workspace"].includes(a))):null))}getProductExtensionKind(s){if(this._productExtensionKindsMap===null){const n=new Map;if(this.productService.extensionKind)for(const a of Object.keys(this.productService.extensionKind))n.set(p.ExtensionIdentifier.toKey(a),this.productService.extensionKind[a]);this._productExtensionKindsMap=n}const d=(0,A.getGalleryExtensionId)(s.publisher,s.name);return this._productExtensionKindsMap.get(p.ExtensionIdentifier.toKey(d))}getProductVirtualWorkspaceSupport(s){if(this._productVirtualWorkspaceSupportMap===null){const n=new Map;if(this.productService.extensionVirtualWorkspacesSupport)for(const a of Object.keys(this.productService.extensionVirtualWorkspacesSupport))n.set(p.ExtensionIdentifier.toKey(a),this.productService.extensionVirtualWorkspacesSupport[a]);this._productVirtualWorkspaceSupportMap=n}const d=(0,A.getGalleryExtensionId)(s.publisher,s.name);return this._productVirtualWorkspaceSupportMap.get(p.ExtensionIdentifier.toKey(d))}getConfiguredVirtualWorkspaceSupport(s){if(this._configuredVirtualWorkspaceSupportMap===null){const n=new Map,a=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(a))a[o]!==void 0&&n.set(p.ExtensionIdentifier.toKey(o),a[o]);this._configuredVirtualWorkspaceSupportMap=n}const d=(0,A.getGalleryExtensionId)(s.publisher,s.name);return this._configuredVirtualWorkspaceSupportMap.get(p.ExtensionIdentifier.toKey(d))}getConfiguredExtensionWorkspaceTrustRequest(s){const d=(0,A.getGalleryExtensionId)(s.publisher,s.name),n=this._configuredExtensionWorkspaceTrustRequestMap.get(p.ExtensionIdentifier.toKey(d));if(n&&(n.version===void 0||n.version===s.version))return n.supported}getProductExtensionWorkspaceTrustRequest(s){const d=(0,A.getGalleryExtensionId)(s.publisher,s.name);return this._productExtensionWorkspaceTrustRequestMap.get(p.ExtensionIdentifier.toKey(d))}toArray(s){return Array.isArray(s)?s:s==="ui"?["ui","workspace"]:[s]}};c=we([F(0,E.IProductService),F(1,t.IConfigurationService),F(2,u.IWorkspaceTrustEnablementService),F(3,i.ILogService)],c),e.ExtensionManifestPropertiesService=c,(0,b.registerSingleton)(e.IExtensionManifestPropertiesService,c,1)}),define(ae[3017],le([1,0,22,14,13,9,1447,31,8,82,2120,100,5,151,49,41,46,51,120,233]),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.CommandsRegistry.registerCommand("_remoteCLI.openExternal",function(a,o){return a.get(f.IOpenerService).open((0,R.isString)(o)?o:A.URI.revive(o),{openExternal:!0,allowTunneling:!0})}),E.CommandsRegistry.registerCommand("_remoteCLI.windowOpen",function(a,o,g){const h=a.get(E.ICommandService);return o.length?h.executeCommand("_files.windowOpen",o,g):h.executeCommand("_files.newWindow",g)}),E.CommandsRegistry.registerCommand("_remoteCLI.getSystemStatus",function(a){return a.get(E.ICommandService).executeCommand("_issues.getSystemStatus")}),E.CommandsRegistry.registerCommand("_remoteCLI.manageExtensions",async function(a,o){const g=a.get(r.IInstantiationService),v=a.get(s.IExtensionManagementServerService).remoteExtensionManagementServer?.extensionManagementService;if(!v)return;const m=g.createChild(new u.ServiceCollection([b.IExtensionManagementService,v])).createInstance(n),w=[],D={log:w.push.bind(w),error:w.push.bind(w)};if(o.list)await m.listExtensions(!!o.list.showVersions,o.list.category,void 0,D);else{const y=T=>T.map(_=>(0,R.isString)(_)?_:A.URI.revive(_));if(Array.isArray(o.install)&&o.install.length)try{await m.installExtensions(y(o.install),[],{isMachineScoped:!0},!!o.force,D)}catch(T){w.push(T.message)}if(Array.isArray(o.uninstall)&&o.uninstall.length)try{await m.uninstallExtensions(y(o.uninstall),!!o.force,void 0,D)}catch(T){w.push(T.message)}}return w.join(`
`)});let n=class extends S.ExtensionManagementCLI{constructor(o,g,h,v,m,w,D){super(o,v),this._extensionManifestPropertiesService=D;const y=w.remoteAuthority;this._location=y?m.getHostLabel(t.Schemas.vscodeRemote,y):void 0}get location(){return this._location}validateExtensionKind(o,g){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(o)&&!(p.isWeb&&this._extensionManifestPropertiesService.canExecuteOnWeb(o))?(g.log((0,k.localize)(0,null,(0,C.getExtensionId)(o.publisher,o.name))),!1):!0}};n=we([F(0,b.IExtensionManagementService),F(1,c.IProductService),F(2,I.IConfigurationService),F(3,b.IExtensionGalleryService),F(4,i.ILabelService),F(5,l.IWorkbenchEnvironmentService),F(6,d.IExtensionManifestPropertiesService)],n)}),define(ae[3018],le([1,0,44,17,5,2511,2810,2811,2816,2755,2535,673,2553,3017,2521,2522,2523,2556,2524,2525,2526,2527,2528,703,2942,933,990,2929,2530,2829,2560,2943,2532,2534,2592,2656,2536,2654,2541,2542,2543,2765,2544,2728,2736,2546,2548,2698,2550,2552,2529,2642,2679,2566,2946,2964,2973,2537,2539,2945,2540,2531,2547,2533,2719,2708,2551,2549,2545]),function(J,e,t,p,R,A,k,E,I,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionPoints=void 0;let S=class{constructor(r){this.instantiationService=r,this.instantiationService.createInstance(A.JSONValidationExtensionPoint),this.instantiationService.createInstance(k.ColorExtensionPoint),this.instantiationService.createInstance(E.IconExtensionPoint),this.instantiationService.createInstance(I.TokenClassificationExtensionPoints),this.instantiationService.createInstance(b.LanguageConfigurationFileHandler)}};S=we([F(0,R.IInstantiationService)],S),e.ExtensionPoints=S,p.Registry.as(t.Extensions.Workbench).registerWorkbenchContribution(S,1)}),define(ae[320],le([1,0,1650,36,11,10,6,123,37,2,119,861,82,120,274,100,115,5,19,34,74,39,9,31,8,12,33,272,62,7,15,403,26,41,24,48,32,110,193,49,78,46,47,66,137,458,21,95,279,25,256,338,14,233,118,227,113,91,16,208,106,374,526,1140]),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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extensionButtonProminentBackground=e.InstallRemoteExtensionsInLocalAction=e.InstallLocalExtensionsInRemoteAction=e.AbstractInstallExtensionsInServerAction=e.InstallSpecificVersionOfExtensionAction=e.ReinstallAction=e.ExtensionStatusAction=e.ToggleSyncExtensionAction=e.ExtensionStatusLabelAction=e.ConfigureWorkspaceFolderRecommendedExtensionsAction=e.ConfigureWorkspaceRecommendedExtensionsAction=e.AbstractConfigureRecommendedExtensionsAction=e.SearchExtensionsAction=e.UndoIgnoreExtensionRecommendationAction=e.IgnoreExtensionRecommendationAction=e.InstallRecommendedExtensionAction=e.ShowRecommendedExtensionAction=e.ClearLanguageAction=e.SetLanguageAction=e.SetProductIconThemeAction=e.SetFileIconThemeAction=e.SetColorThemeAction=e.ReloadAction=e.DisableDropDownAction=e.EnableDropDownAction=e.DisableGloballyAction=e.DisableForWorkspaceAction=e.EnableGloballyAction=e.EnableForWorkspaceAction=e.InstallAnotherVersionAction=e.SwitchToReleasedVersionAction=e.SwitchToPreReleaseVersionAction=e.MenuItemExtensionAction=e.ExtensionEditorManageExtensionAction=e.ManageExtensionAction=e.getContextMenuActions=e.DropDownMenuActionViewItem=e.ExtensionDropDownAction=e.ExtensionActionWithDropdownActionViewItem=e.MigrateDeprecatedExtensionAction=e.SkipUpdateAction=e.UpdateAction=e.UninstallAction=e.WebInstallAction=e.LocalInstallAction=e.RemoteInstallAction=e.InstallInOtherServerAction=e.InstallingLabelAction=e.InstallDropdownAction=e.InstallAndSyncAction=e.InstallAction=e.AbstractInstallAction=e.ActionWithDropDownAction=e.ExtensionAction=e.PromptExtensionInstallFailureAction=void 0;let pe=class extends p.Action{constructor($e,Qe,tt,Ct,bt,Rt,Mt,Ft,zt,Bt,qt,Xt,Yt){super("extension.promptExtensionInstallFailure"),this.extension=$e,this.version=Qe,this.installOperation=tt,this.installOptions=Ct,this.error=bt,this.productService=Rt,this.openerService=Mt,this.notificationService=Ft,this.dialogService=zt,this.commandService=Bt,this.logService=qt,this.extensionManagementServerService=Xt,this.instantiationService=Yt}async run(){if((0,X.isCancellationError)(this.error))return;if(this.logService.error(this.error),this.error.name===r.ExtensionManagementErrorCode.Unsupported){const bt=ee.isWeb?(0,t.localize)(0,null,this.productService.nameLong):this.productService.nameLong,Rt=(0,t.localize)(1,null,this.extension.displayName||this.extension.identifier.id,bt);(await this.dialogService.show(L.Severity.Info,Rt,[(0,t.localize)(2,null),(0,t.localize)(3,null)],{cancelId:0})).choice===1&&this.openerService.open(ee.isWeb?o.URI.parse("https://aka.ms/vscode-web-extensions-guide"):o.URI.parse("https://aka.ms/vscode-remote"));return}if([r.ExtensionManagementErrorCode.Incompatible,r.ExtensionManagementErrorCode.IncompatibleTargetPlatform,r.ExtensionManagementErrorCode.Malicious,r.ExtensionManagementErrorCode.ReleaseVersionNotFound,r.ExtensionManagementErrorCode.Deprecated].includes(this.error.name)){await this.dialogService.show(L.Severity.Info,(0,X.getErrorMessage)(this.error));return}let $e=this.installOperation===3?(0,t.localize)(4,null,this.extension.displayName||this.extension.identifier.id):(0,t.localize)(5,null,this.extension.displayName||this.extension.identifier.id),Qe;const tt=[];r.ExtensionManagementErrorCode.IncompatiblePreRelease===this.error.name?($e=(0,X.getErrorMessage)(this.error),Qe=(0,t.localize)(6,null),tt.push({label:(0,t.localize)(7,null),run:()=>{const bt=this.installOptions?.isMachineScoped?this.instantiationService.createInstance(ve,!!this.installOptions.installPreReleaseVersion):this.instantiationService.createInstance(be,!!this.installOptions?.installPreReleaseVersion);return bt.extension=this.extension,bt.run()}})):this.extension.gallery&&this.productService.extensionsGallery&&(this.extensionManagementServerService.localExtensionManagementServer||this.extensionManagementServerService.remoteExtensionManagementServer)&&!ee.isIOS&&(Qe=(0,t.localize)(8,null,`command:${K.showWindowLogActionId}`),tt.push({label:(0,t.localize)(9,null),run:()=>this.openerService.open(o.URI.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage`)).then(()=>{this.notificationService.prompt(L.Severity.Info,(0,t.localize)(10,null,this.extension.identifier.id),[{label:(0,t.localize)(11,null),run:()=>this.commandService.executeCommand(S.SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID)}])})}));const Ct=`${$e}${Qe?` ${Qe}`:""}`;this.notificationService.prompt(L.Severity.Error,Ct,tt)}};pe=we([F(5,H.IProductService),F(6,M.IOpenerService),F(7,L.INotificationService),F(8,W.IDialogService),F(9,g.ICommandService),F(10,j.ILogService),F(11,u.IExtensionManagementServerService),F(12,l.IInstantiationService)],pe),e.PromptExtensionInstallFailureAction=pe;class me extends p.Action{constructor(){super(...arguments),this._extension=null}get extension(){return this._extension}set extension($e){this._extension=$e,this.update()}}e.ExtensionAction=me,me.EXTENSION_ACTION_CLASS="extension-action",me.TEXT_ACTION_CLASS=`${me.EXTENSION_ACTION_CLASS} text`,me.LABEL_ACTION_CLASS=`${me.EXTENSION_ACTION_CLASS} label`,me.ICON_ACTION_CLASS=`${me.EXTENSION_ACTION_CLASS} icon`;class Se extends me{get menuActions(){return[...this._menuActions]}get extension(){return super.extension}set extension($e){this.extensionActions.forEach(Qe=>Qe.extension=$e),super.extension=$e}constructor($e,Qe,tt){super($e,Qe),this.actionsGroups=tt,this._menuActions=[],this.extensionActions=(0,Z.flatten)(tt),this.update(),this._register(k.Event.any(...this.extensionActions.map(Ct=>Ct.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(Ct=>this._register(Ct))}update($e){$e||this.extensionActions.forEach(bt=>bt.update());const Qe=this.actionsGroups.map(bt=>bt.filter(Rt=>Rt.enabled));let tt=[];for(const bt of Qe)bt.length&&(tt=[...tt,...bt,new p.Separator]);tt=tt.length?tt.slice(0,tt.length-1):tt,this.action=tt[0],this._menuActions=tt.length>1?tt:[],this.enabled=!!this.action,this.action&&(this.label=this.getLabel(this.action),this.tooltip=this.action.tooltip);let Ct=(this.action||this.extensionActions[0])?.class||"";Ct=Ct?`${Ct} action-dropdown`:"action-dropdown",this._menuActions.length===0&&(Ct+=" action-dropdown"),this.class=Ct}run(){return this.extensionActions.filter(Qe=>Qe.enabled)[0].run()}getLabel($e){return $e.label}}e.ActionWithDropDownAction=Se;let Ie=class extends