astro-vscode 2.14.1 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,4 +43,4 @@ globstar while`,e,m,t,g,D),this.matchOne(e.slice(m),t.slice(g),r))return this.de
43
43
  `+t.data.toString():""}`}return e instanceof Error?Pn.string(e.stack)?e.stack:e.message:Pn.string(e)?e:e.toString()}debug(e,t,r=!0){this.logOutputMessage(j.MessageType.Debug,Jr.Debug,"Debug",e,t,r)}info(e,t,r=!0){this.logOutputMessage(j.MessageType.Info,Jr.Info,"Info",e,t,r)}warn(e,t,r=!0){this.logOutputMessage(j.MessageType.Warning,Jr.Warn,"Warn",e,t,r)}error(e,t,r=!0){this.logOutputMessage(j.MessageType.Error,Jr.Error,"Error",e,t,r)}logOutputMessage(e,t,r,i,s,o){this.outputChannel.appendLine(`[${r.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${i}`),s!=null&&this.outputChannel.appendLine(this.data2String(s)),(o==="force"||o&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,i)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===j.MessageType.Error?Te.window.showErrorMessage:e===j.MessageType.Warning?Te.window.showWarningMessage:Te.window.showInformationMessage)(t,"Go to output").then(i=>{i!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===ce.Initial||this.$state===ce.Stopping||this.$state===ce.Stopped}needsStop(){return this.$state===ce.Starting||this.$state===ce.Running}activeConnection(){return this.$state===ce.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===ce.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===ce.Stopping)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;let[e,t,r]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Te.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Te.languages.createDiagnosticCollection());for(let[i,s]of this._notificationHandlers)this._pendingNotificationHandlers.has(i)||this._pendingNotificationHandlers.set(i,s);for(let[i,s]of this._requestHandlers)this._pendingRequestHandlers.has(i)||this._pendingRequestHandlers.set(i,s);for(let[i,s]of this._progressHandlers)this._pendingProgressHandlers.has(i)||this._pendingProgressHandlers.set(i,s);this.$state=ce.Starting;try{let i=await this.createConnection();i.onNotification(j.LogMessageNotification.type,s=>{switch(s.type){case j.MessageType.Error:this.error(s.message,void 0,!1);break;case j.MessageType.Warning:this.warn(s.message,void 0,!1);break;case j.MessageType.Info:this.info(s.message,void 0,!1);break;case j.MessageType.Debug:this.debug(s.message,void 0,!1);break;default:this.outputChannel.appendLine(s.message)}}),i.onNotification(j.ShowMessageNotification.type,s=>{switch(s.type){case j.MessageType.Error:Te.window.showErrorMessage(s.message);break;case j.MessageType.Warning:Te.window.showWarningMessage(s.message);break;case j.MessageType.Info:Te.window.showInformationMessage(s.message);break;default:Te.window.showInformationMessage(s.message)}}),i.onRequest(j.ShowMessageRequest.type,s=>{let o;switch(s.type){case j.MessageType.Error:o=Te.window.showErrorMessage;break;case j.MessageType.Warning:o=Te.window.showWarningMessage;break;case j.MessageType.Info:o=Te.window.showInformationMessage;break;default:o=Te.window.showInformationMessage}let a=s.actions||[];return o(s.message,...a)}),i.onNotification(j.TelemetryEventNotification.type,s=>{this._telemetryEmitter.fire(s)}),i.onRequest(j.ShowDocumentRequest.type,async s=>{let o=async u=>{let l=this.protocol2CodeConverter.asUri(u.uri);try{if(u.external===!0)return{success:await Te.env.openExternal(l)};{let p={};return u.selection!==void 0&&(p.selection=this.protocol2CodeConverter.asRange(u.selection)),u.takeFocus===void 0||u.takeFocus===!1?p.preserveFocus=!0:u.takeFocus===!0&&(p.preserveFocus=!1),await Te.window.showTextDocument(l,p),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(s,o):o(s)}),i.listen(),await this.initialize(i),t()}catch(i){this.$state=ce.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,i,"force"),r(i)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((i,s)=>{e=i,t=s}),e,t]}async initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,[r,i]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],s={processId:null,clientInfo:{name:Te.env.appName,version:Te.version},locale:this.getLocale(),rootPath:r||null,rootUri:r?this._c2p.asUri(Te.Uri.file(r)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Pn.func(t)?t():t,trace:j.Trace.toString(this._trace),workspaceFolders:i};if(this.fillInitializeParams(s),this._clientOptions.progressOnInitialization){let o=yy.generateUuid(),a=new OD.ProgressPart(e,o);s.workDoneToken=o;try{let u=await this.doInitialize(e,s);return a.done(),u}catch(u){throw a.cancel(),u}}else return this.doInitialize(e,s)}async doInitialize(e,t){try{let r=await e.initialize(t);if(r.capabilities.positionEncoding!==void 0&&r.capabilities.positionEncoding!==j.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${r.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=r,this.$state=ce.Running;let i;Pn.number(r.capabilities.textDocumentSync)?r.capabilities.textDocumentSync===j.TextDocumentSyncKind.None?i={openClose:!1,change:j.TextDocumentSyncKind.None,save:void 0}:i={openClose:!0,change:r.capabilities.textDocumentSync,save:{includeText:!1}}:r.capabilities.textDocumentSync!==void 0&&r.capabilities.textDocumentSync!==null&&(i=r.capabilities.textDocumentSync),this._capabilities=Object.assign({},r.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(j.PublishDiagnosticsNotification.type,s=>this.handleDiagnostics(s)),e.onRequest(j.RegistrationRequest.type,s=>this.handleRegistrationRequest(s)),e.onRequest("client/registerFeature",s=>this.handleRegistrationRequest(s)),e.onRequest(j.UnregistrationRequest.type,s=>this.handleUnregistrationRequest(s)),e.onRequest("client/unregisterFeature",s=>this.handleUnregistrationRequest(s)),e.onRequest(j.ApplyWorkspaceEditRequest.type,s=>this.handleApplyWorkspaceEdit(s));for(let[s,o]of this._pendingNotificationHandlers)this._notificationDisposables.set(s,e.onNotification(s,o));this._pendingNotificationHandlers.clear();for(let[s,o]of this._pendingRequestHandlers)this._requestDisposables.set(s,e.onRequest(s,o));this._pendingRequestHandlers.clear();for(let[s,o]of this._pendingProgressHandlers)this._progressDisposables.set(s,e.onProgress(o.type,s,o.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(j.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),r}catch(r){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(r)?this.initialize(e):this.stop():r instanceof j.ResponseError&&r.data&&r.data.retry?Te.window.showErrorMessage(r.message,{title:"Retry",id:"retry"}).then(i=>{i&&i.id==="retry"?this.initialize(e):this.stop()}):(r&&r.message&&Te.window.showErrorMessage(r.message),this.error("Server initialization failed.",r),this.stop()),r}}_clientGetRootPath(){let e=Te.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t){if(this.$state===ce.Stopped||this.$state===ce.Initial)return;if(this.$state===ce.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}let r=this.activeConnection();if(r===void 0||this.$state!==ce.Running)throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=ce.Stopping,this.cleanUp(e);let i=new Promise(o=>{(0,j.RAL)().timer.setTimeout(o,t)}),s=(async o=>(await o.shutdown(),await o.exit(),o))(r);return this._onStop=Promise.race([i,s]).then(o=>{if(o!==void 0)o.end(),o.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},o=>{throw this.error("Stopping server failed",o,!1),o}).finally(()=>{this.$state=ce.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();let t=this._listeners.splice(0,this._listeners.length);for(let r of t)r.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let r of Array.from(this._features.entries()).map(i=>i[1]).reverse())r.clear();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){let t=this;async function r(s){return t._fileEvents.push(s),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(j.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,r):r(e)).catch(s=>{t.error("Notify file events failed.",s)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(let r of t){let i=this.code2ProtocolConverter.asChangeTextDocumentParams(r);await e.sendNotification(j.DidChangeTextDocumentNotification.type,i),this._didChangeTextDocumentFeature.notificationSent(r,j.DidChangeTextDocumentNotification.type,i)}}catch(t){throw this.error("Sending pending changes failed",t,!1),t}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{let e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error("Delivering pending changes failed",e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;let t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,j.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;let e=this._diagnosticQueue.entries().next();if(e.done===!0)return;let[t,r]=e.value;this._diagnosticQueue.delete(t);let i=new Te.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:i},this._p2c.asDiagnostics(r,i.token).then(s=>{if(!i.token.isCancellationRequested){let o=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(o,s,(u,l)=>this.setDiagnostics(u,l)):this.setDiagnostics(o,s)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Te.env.language}async $start(){if(this.$state===ce.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();let e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(i,s,o)=>{this.handleConnectionError(i,s,o).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(i=>this.error("Handling connection close failed",i))},r=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=lS(r.reader,r.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===ce.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:xr.DoNotRestart};if(this.$state!==ce.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===xr.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp("stop"),this.$state===ce.Starting?this.$state=ce.StartFailed:this.$state=ce.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===xr.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=ce.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,r){let i=await this._clientOptions.errorHandler.error(e,t,r);i.action===ws.Shutdown?(this.error(i.message??`Client ${this._name}: connection to server is erroring.
44
44
  ${e.message}
45
45
  Shutting down server.`,void 0,i.handled===!0?!1:"force"),this.stop().catch(s=>{this.error("Stopping server failed",s,!1)})):this.error(i.message??`Client ${this._name}: connection to server is erroring.
46
- ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Te.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let r=Te.workspace.getConfiguration(this._id),i=j.Trace.Off,s=j.TraceFormat.Text;if(r){let o=r.get("trace.server","off");typeof o=="string"?i=j.Trace.fromString(o):(i=j.Trace.fromString(r.get("trace.server.verbosity","off")),s=j.TraceFormat.fromString(r.get("trace.server.format","text")))}this._trace=i,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;Pn.array(t)?r=t:r=[t],r&&this._dynamicFeatures.get(j.DidChangeWatchedFilesNotification.type.method).registerRaw(yy.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Tn.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(j.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Cy.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new by.ConfigurationFeature(this)),this.registerFeature(new Fi.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new Fi.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new Fi.WillSaveFeature(this)),this.registerFeature(new Fi.WillSaveWaitUntilFeature(this)),this.registerFeature(new Fi.DidSaveTextDocumentFeature(this)),this.registerFeature(new Fi.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new GD.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new ND.CompletionItemFeature(this)),this.registerFeature(new MD.HoverFeature(this)),this.registerFeature(new AD.SignatureHelpFeature(this)),this.registerFeature(new LD.DefinitionFeature(this)),this.registerFeature(new WD.ReferencesFeature(this)),this.registerFeature(new jD.DocumentHighlightFeature(this)),this.registerFeature(new $D.DocumentSymbolFeature(this)),this.registerFeature(new HD.WorkspaceSymbolFeature(this)),this.registerFeature(new UD.CodeActionFeature(this)),this.registerFeature(new KD.CodeLensFeature(this)),this.registerFeature(new Gd.DocumentFormattingFeature(this)),this.registerFeature(new Gd.DocumentRangeFormattingFeature(this)),this.registerFeature(new Gd.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new zD.RenameFeature(this)),this.registerFeature(new VD.DocumentLinkFeature(this)),this.registerFeature(new BD.ExecuteCommandFeature(this)),this.registerFeature(new by.SyncConfigurationFeature(this)),this.registerFeature(new QD.TypeDefinitionFeature(this)),this.registerFeature(new JD.ImplementationFeature(this)),this.registerFeature(new XD.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new YD.WorkspaceFoldersFeature(this)),this.registerFeature(new ZD.FoldingRangeFeature(this)),this.registerFeature(new eS.DeclarationFeature(this)),this.registerFeature(new tS.SelectionRangeFeature(this)),this.registerFeature(new nS.ProgressFeature(this)),this.registerFeature(new rS.CallHierarchyFeature(this)),this.registerFeature(new iS.SemanticTokensFeature(this)),this.registerFeature(new sS.LinkedEditingFeature(this)),this.registerFeature(new Ni.DidCreateFilesFeature(this)),this.registerFeature(new Ni.DidRenameFilesFeature(this)),this.registerFeature(new Ni.DidDeleteFilesFeature(this)),this.registerFeature(new Ni.WillCreateFilesFeature(this)),this.registerFeature(new Ni.WillRenameFilesFeature(this)),this.registerFeature(new Ni.WillDeleteFilesFeature(this)),this.registerFeature(new oS.TypeHierarchyFeature(this)),this.registerFeature(new aS.InlineValueFeature(this)),this.registerFeature(new cS.InlayHintsFeature(this)),this.registerFeature(new FD.DiagnosticFeature(this)),this.registerFeature(new Cy.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(Yd.createAll(this))}fillInitializeParams(e){for(let t of this._features)Pn.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Tn.ensure)(e,"workspace").applyEdit=!0;let t=(0,Tn.ensure)((0,Tn.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[j.ResourceOperationKind.Create,j.ResourceOperationKind.Rename,j.ResourceOperationKind.Delete],t.failureHandling=j.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let r=(0,Tn.ensure)((0,Tn.ensure)(e,"textDocument"),"publishDiagnostics");r.relatedInformation=!0,r.versionSupport=!1,r.tagSupport={valueSet:[j.DiagnosticTag.Unnecessary,j.DiagnosticTag.Deprecated]},r.codeDescriptionSupport=!0,r.dataSupport=!0;let i=(0,Tn.ensure)(e,"window"),s=(0,Tn.ensure)(i,"showMessage");s.messageActionItem={additionalPropertiesSupport:!0};let o=(0,Tn.ensure)(i,"showDocument");o.support=!0;let a=(0,Tn.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(rr.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let u of this._features)u.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let r of this._features)Pn.func(r.preInitialize)&&r.preInitialize(this._capabilities,t);for(let r of this._features)r.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,r=>this.doRegisterCapability(r)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let r=this._dynamicFeatures.get(t.method);if(r===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let i=t.registerOptions??{};i.documentSelector=i.documentSelector??this._clientOptions.documentSelector;let s={id:t.id,registerOptions:i};try{r.register(s)}catch(o){return Promise.reject(o)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,r=>this.doUnregisterCapability(r)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let r=this._dynamicFeatures.get(t.method);if(!r)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));r.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,r=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),i=new Map;Te.workspace.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let s=!1;if(t.documentChanges){for(let o of t.documentChanges)if(j.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let a=this._p2c.asUri(o.textDocument.uri).toString(),u=i.get(a);if(u&&u.version!==o.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):Pn.asPromise(Te.workspace.applyEdit(r).then(o=>({applied:o})))}handleFailedRequest(e,t,r,i,s=!0){if(r instanceof j.ResponseError){if(r.code===j.ErrorCodes.PendingResponseRejected||r.code===j.ErrorCodes.ConnectionInactive)return i;if(r.code===j.LSPErrorCodes.RequestCancelled||r.code===j.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return i;throw r.data!==void 0?new Tn.LSPCancellationError(r.data):new Te.CancellationError}else if(r.code===j.LSPErrorCodes.ContentModified){if(rr.RequestsToCancelOnContentModified.has(e.method)||rr.CancellableResolveCalls.has(e.method))throw new Te.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,r,s),r}};ft.BaseLanguageClient=rr;rr.RequestsToCancelOnContentModified=new Set([j.SemanticTokensRequest.method,j.SemanticTokensRangeRequest.method,j.SemanticTokensDeltaRequest.method]);rr.CancellableResolveCalls=new Set([j.CompletionResolveRequest.method,j.CodeLensResolveRequest.method,j.CodeActionResolveRequest.method,j.InlayHintResolveRequest.method,j.DocumentLinkResolveRequest.method,j.WorkspaceSymbolResolveRequest.method]);var Qd=class{error(e){(0,j.RAL)().console.error(e)}warn(e){(0,j.RAL)().console.warn(e)}info(e){(0,j.RAL)().console.info(e)}log(e){(0,j.RAL)().console.log(e)}};function lS(n,e,t,r,i){let s=new Qd,o=(0,j.createProtocolConnection)(n,e,s,i);return o.onError(u=>{t(u[0],u[1],u[2])}),o.onClose(r),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(u,l,p)=>{let m={sendNotification:!1,traceFormat:j.TraceFormat.Text};return p===void 0?o.trace(u,l,m):(Pn.boolean(p),o.trace(u,l,p))},initialize:u=>o.sendRequest(j.InitializeRequest.type,u),shutdown:()=>o.sendRequest(j.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(j.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var Yd;(function(n){function e(t){return[new uS.InlineCompletionItemFeature(t)]}n.createAll=e})(Yd||(ft.ProposedFeatures=Yd={}))});var Sy=q(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.terminate=void 0;var Dy=require("child_process"),dS=require("path"),fS=process.platform==="win32",hS=process.platform==="darwin",pS=process.platform==="linux";function gS(n,e){if(fS)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),Dy.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],i),!0}catch{return!1}else if(pS||hS)try{var t=(0,dS.join)(__dirname,"terminateProcess.sh"),r=Dy.spawnSync(t,[n.pid.toString()]);return!r.error}catch{return!1}else return n.kill("SIGKILL"),!0}ga.terminate=gS});var ef=q((rq,Ry)=>{"use strict";Ry.exports=Y()});var Ds=q((iq,Ty)=>{var mS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};Ty.exports=mS});var ma=q((sq,Py)=>{var vS="2.0.0",yS=Number.MAX_SAFE_INTEGER||9007199254740991,CS=16,bS=256-6,_S=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Py.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:CS,MAX_SAFE_BUILD_LENGTH:bS,MAX_SAFE_INTEGER:yS,RELEASE_TYPES:_S,SEMVER_SPEC_VERSION:vS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var va=q((ir,qy)=>{var{MAX_SAFE_COMPONENT_LENGTH:tf,MAX_SAFE_BUILD_LENGTH:wS,MAX_LENGTH:DS}=ma(),SS=Ds();ir=qy.exports={};var RS=ir.re=[],TS=ir.safeRe=[],V=ir.src=[],B=ir.t={},PS=0,nf="[a-zA-Z0-9-]",qS=[["\\s",1],["\\d",DS],[nf,wS]],ES=n=>{for(let[e,t]of qS)n=n.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return n},oe=(n,e,t)=>{let r=ES(e),i=PS++;SS(n,i,e),B[n]=i,V[i]=e,RS[i]=new RegExp(e,t?"g":void 0),TS[i]=new RegExp(r,t?"g":void 0)};oe("NUMERICIDENTIFIER","0|[1-9]\\d*");oe("NUMERICIDENTIFIERLOOSE","\\d+");oe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${nf}*`);oe("MAINVERSION",`(${V[B.NUMERICIDENTIFIER]})\\.(${V[B.NUMERICIDENTIFIER]})\\.(${V[B.NUMERICIDENTIFIER]})`);oe("MAINVERSIONLOOSE",`(${V[B.NUMERICIDENTIFIERLOOSE]})\\.(${V[B.NUMERICIDENTIFIERLOOSE]})\\.(${V[B.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASEIDENTIFIER",`(?:${V[B.NUMERICIDENTIFIER]}|${V[B.NONNUMERICIDENTIFIER]})`);oe("PRERELEASEIDENTIFIERLOOSE",`(?:${V[B.NUMERICIDENTIFIERLOOSE]}|${V[B.NONNUMERICIDENTIFIER]})`);oe("PRERELEASE",`(?:-(${V[B.PRERELEASEIDENTIFIER]}(?:\\.${V[B.PRERELEASEIDENTIFIER]})*))`);oe("PRERELEASELOOSE",`(?:-?(${V[B.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${V[B.PRERELEASEIDENTIFIERLOOSE]})*))`);oe("BUILDIDENTIFIER",`${nf}+`);oe("BUILD",`(?:\\+(${V[B.BUILDIDENTIFIER]}(?:\\.${V[B.BUILDIDENTIFIER]})*))`);oe("FULLPLAIN",`v?${V[B.MAINVERSION]}${V[B.PRERELEASE]}?${V[B.BUILD]}?`);oe("FULL",`^${V[B.FULLPLAIN]}$`);oe("LOOSEPLAIN",`[v=\\s]*${V[B.MAINVERSIONLOOSE]}${V[B.PRERELEASELOOSE]}?${V[B.BUILD]}?`);oe("LOOSE",`^${V[B.LOOSEPLAIN]}$`);oe("GTLT","((?:<|>)?=?)");oe("XRANGEIDENTIFIERLOOSE",`${V[B.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);oe("XRANGEIDENTIFIER",`${V[B.NUMERICIDENTIFIER]}|x|X|\\*`);oe("XRANGEPLAIN",`[v=\\s]*(${V[B.XRANGEIDENTIFIER]})(?:\\.(${V[B.XRANGEIDENTIFIER]})(?:\\.(${V[B.XRANGEIDENTIFIER]})(?:${V[B.PRERELEASE]})?${V[B.BUILD]}?)?)?`);oe("XRANGEPLAINLOOSE",`[v=\\s]*(${V[B.XRANGEIDENTIFIERLOOSE]})(?:\\.(${V[B.XRANGEIDENTIFIERLOOSE]})(?:\\.(${V[B.XRANGEIDENTIFIERLOOSE]})(?:${V[B.PRERELEASELOOSE]})?${V[B.BUILD]}?)?)?`);oe("XRANGE",`^${V[B.GTLT]}\\s*${V[B.XRANGEPLAIN]}$`);oe("XRANGELOOSE",`^${V[B.GTLT]}\\s*${V[B.XRANGEPLAINLOOSE]}$`);oe("COERCE",`(^|[^\\d])(\\d{1,${tf}})(?:\\.(\\d{1,${tf}}))?(?:\\.(\\d{1,${tf}}))?(?:$|[^\\d])`);oe("COERCERTL",V[B.COERCE],!0);oe("LONETILDE","(?:~>?)");oe("TILDETRIM",`(\\s*)${V[B.LONETILDE]}\\s+`,!0);ir.tildeTrimReplace="$1~";oe("TILDE",`^${V[B.LONETILDE]}${V[B.XRANGEPLAIN]}$`);oe("TILDELOOSE",`^${V[B.LONETILDE]}${V[B.XRANGEPLAINLOOSE]}$`);oe("LONECARET","(?:\\^)");oe("CARETTRIM",`(\\s*)${V[B.LONECARET]}\\s+`,!0);ir.caretTrimReplace="$1^";oe("CARET",`^${V[B.LONECARET]}${V[B.XRANGEPLAIN]}$`);oe("CARETLOOSE",`^${V[B.LONECARET]}${V[B.XRANGEPLAINLOOSE]}$`);oe("COMPARATORLOOSE",`^${V[B.GTLT]}\\s*(${V[B.LOOSEPLAIN]})$|^$`);oe("COMPARATOR",`^${V[B.GTLT]}\\s*(${V[B.FULLPLAIN]})$|^$`);oe("COMPARATORTRIM",`(\\s*)${V[B.GTLT]}\\s*(${V[B.LOOSEPLAIN]}|${V[B.XRANGEPLAIN]})`,!0);ir.comparatorTrimReplace="$1$2$3";oe("HYPHENRANGE",`^\\s*(${V[B.XRANGEPLAIN]})\\s+-\\s+(${V[B.XRANGEPLAIN]})\\s*$`);oe("HYPHENRANGELOOSE",`^\\s*(${V[B.XRANGEPLAINLOOSE]})\\s+-\\s+(${V[B.XRANGEPLAINLOOSE]})\\s*$`);oe("STAR","(<|>)?=?\\s*\\*");oe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");oe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ya=q((oq,Ey)=>{var kS=Object.freeze({loose:!0}),xS=Object.freeze({}),IS=n=>n?typeof n!="object"?kS:n:xS;Ey.exports=IS});var Oy=q((aq,Iy)=>{var ky=/^[0-9]+$/,xy=(n,e)=>{let t=ky.test(n),r=ky.test(e);return t&&r&&(n=+n,e=+e),n===e?0:t&&!r?-1:r&&!t?1:n<e?-1:1},OS=(n,e)=>xy(e,n);Iy.exports={compareIdentifiers:xy,rcompareIdentifiers:OS}});var Ss=q((cq,Ly)=>{var Ca=Ds(),{MAX_LENGTH:Fy,MAX_SAFE_INTEGER:ba}=ma(),{safeRe:Ny,t:My}=va(),FS=ya(),{compareIdentifiers:Mi}=Oy(),nn=class{constructor(e,t){if(t=FS(t),e instanceof nn){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Fy)throw new TypeError(`version is longer than ${Fy} characters`);Ca("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Ny[My.LOOSE]:Ny[My.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ba||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ba||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ba||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ba)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ca("SemVer.compare",this.version,this.options,e),!(e instanceof nn)){if(typeof e=="string"&&e===this.version)return 0;e=new nn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof nn||(e=new nn(e,this.options)),Mi(this.major,e.major)||Mi(this.minor,e.minor)||Mi(this.patch,e.patch)}comparePre(e){if(e instanceof nn||(e=new nn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(Ca("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Mi(r,i)}while(++t)}compareBuild(e){e instanceof nn||(e=new nn(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(Ca("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Mi(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];r===!1&&(s=[t]),Mi(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ly.exports=nn});var $y=q((uq,jy)=>{var Ay=Ss(),NS=(n,e,t=!1)=>{if(n instanceof Ay)return n;try{return new Ay(n,e)}catch(r){if(!t)return null;throw r}};jy.exports=NS});var Wy=q((lq,Hy)=>{"use strict";Hy.exports=function(n){n.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Ky=q((dq,Uy)=>{"use strict";Uy.exports=we;we.Node=Qr;we.create=we;function we(n){var e=this;if(e instanceof we||(e=new we),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,r=arguments.length;t<r;t++)e.push(arguments[t]);return e}we.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var e=n.next,t=n.prev;return e&&(e.prev=t),t&&(t.next=e),n===this.head&&(this.head=e),n===this.tail&&(this.tail=t),n.list.length--,n.next=null,n.prev=null,n.list=null,e};we.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var e=this.head;n.list=this,n.next=e,e&&(e.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}};we.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var e=this.tail;n.list=this,n.prev=e,e&&(e.next=n),this.tail=n,this.head||(this.head=n),this.length++}};we.prototype.push=function(){for(var n=0,e=arguments.length;n<e;n++)LS(this,arguments[n]);return this.length};we.prototype.unshift=function(){for(var n=0,e=arguments.length;n<e;n++)AS(this,arguments[n]);return this.length};we.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}};we.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}};we.prototype.forEach=function(n,e){e=e||this;for(var t=this.head,r=0;t!==null;r++)n.call(e,t.value,r,this),t=t.next};we.prototype.forEachReverse=function(n,e){e=e||this;for(var t=this.tail,r=this.length-1;t!==null;r--)n.call(e,t.value,r,this),t=t.prev};we.prototype.get=function(n){for(var e=0,t=this.head;t!==null&&e<n;e++)t=t.next;if(e===n&&t!==null)return t.value};we.prototype.getReverse=function(n){for(var e=0,t=this.tail;t!==null&&e<n;e++)t=t.prev;if(e===n&&t!==null)return t.value};we.prototype.map=function(n,e){e=e||this;for(var t=new we,r=this.head;r!==null;)t.push(n.call(e,r.value,this)),r=r.next;return t};we.prototype.mapReverse=function(n,e){e=e||this;for(var t=new we,r=this.tail;r!==null;)t.push(n.call(e,r.value,this)),r=r.prev;return t};we.prototype.reduce=function(n,e){var t,r=this.head;if(arguments.length>1)t=e;else if(this.head)r=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)t=n(t,r.value,i),r=r.next;return t};we.prototype.reduceReverse=function(n,e){var t,r=this.tail;if(arguments.length>1)t=e;else if(this.tail)r=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)t=n(t,r.value,i),r=r.prev;return t};we.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n};we.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n};we.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new we;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<n;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)t.push(i.value);return t};we.prototype.sliceReverse=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new we;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>n;r--,i=i.prev)t.push(i.value);return t};we.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var r=0,i=this.head;i!==null&&r<n;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<t.length;r++)i=MS(this,i,t[r]);return s};we.prototype.reverse=function(){for(var n=this.head,e=this.tail,t=n;t!==null;t=t.prev){var r=t.prev;t.prev=t.next,t.next=r}return this.head=e,this.tail=n,this};function MS(n,e,t){var r=e===n.head?new Qr(t,null,e,n):new Qr(t,e,e.next,n);return r.next===null&&(n.tail=r),r.prev===null&&(n.head=r),n.length++,r}function LS(n,e){n.tail=new Qr(e,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function AS(n,e){n.head=new Qr(e,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function Qr(n,e,t,r){if(!(this instanceof Qr))return new Qr(n,e,t,r);this.list=r,this.value=n,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{Wy()(we)}catch{}});var Xy=q((fq,Gy)=>{"use strict";var jS=Ky(),Yr=Symbol("max"),or=Symbol("length"),Li=Symbol("lengthCalculator"),Ts=Symbol("allowStale"),Zr=Symbol("maxAge"),sr=Symbol("dispose"),zy=Symbol("noDisposeOnSet"),ht=Symbol("lruList"),qn=Symbol("cache"),By=Symbol("updateAgeOnGet"),rf=()=>1,of=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[Yr]=e.max||1/0,r=e.length||rf;if(this[Li]=typeof r!="function"?rf:r,this[Ts]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Zr]=e.maxAge||0,this[sr]=e.dispose,this[zy]=e.noDisposeOnSet||!1,this[By]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Yr]=e||1/0,Rs(this)}get max(){return this[Yr]}set allowStale(e){this[Ts]=!!e}get allowStale(){return this[Ts]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Zr]=e,Rs(this)}get maxAge(){return this[Zr]}set lengthCalculator(e){typeof e!="function"&&(e=rf),e!==this[Li]&&(this[Li]=e,this[or]=0,this[ht].forEach(t=>{t.length=this[Li](t.value,t.key),this[or]+=t.length})),Rs(this)}get lengthCalculator(){return this[Li]}get length(){return this[or]}get itemCount(){return this[ht].length}rforEach(e,t){t=t||this;for(let r=this[ht].tail;r!==null;){let i=r.prev;Vy(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[ht].head;r!==null;){let i=r.next;Vy(this,e,r,t),r=i}}keys(){return this[ht].toArray().map(e=>e.key)}values(){return this[ht].toArray().map(e=>e.value)}reset(){this[sr]&&this[ht]&&this[ht].length&&this[ht].forEach(e=>this[sr](e.key,e.value)),this[qn]=new Map,this[ht]=new jS,this[or]=0}dump(){return this[ht].map(e=>_a(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ht]}set(e,t,r){if(r=r||this[Zr],r&&typeof r!="number")throw new TypeError("maxAge must be a number");let i=r?Date.now():0,s=this[Li](t,e);if(this[qn].has(e)){if(s>this[Yr])return Ai(this,this[qn].get(e)),!1;let u=this[qn].get(e).value;return this[sr]&&(this[zy]||this[sr](e,u.value)),u.now=i,u.maxAge=r,u.value=t,this[or]+=s-u.length,u.length=s,this.get(e),Rs(this),!0}let o=new af(e,t,s,i,r);return o.length>this[Yr]?(this[sr]&&this[sr](e,t),!1):(this[or]+=o.length,this[ht].unshift(o),this[qn].set(e,this[ht].head),Rs(this),!0)}has(e){if(!this[qn].has(e))return!1;let t=this[qn].get(e).value;return!_a(this,t)}get(e){return sf(this,e,!0)}peek(e){return sf(this,e,!1)}pop(){let e=this[ht].tail;return e?(Ai(this,e),e.value):null}del(e){Ai(this,this[qn].get(e))}load(e){this.reset();let t=Date.now();for(let r=e.length-1;r>=0;r--){let i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{let o=s-t;o>0&&this.set(i.k,i.v,o)}}}prune(){this[qn].forEach((e,t)=>sf(this,t,!1))}},sf=(n,e,t)=>{let r=n[qn].get(e);if(r){let i=r.value;if(_a(n,i)){if(Ai(n,r),!n[Ts])return}else t&&(n[By]&&(r.value.now=Date.now()),n[ht].unshiftNode(r));return i.value}},_a=(n,e)=>{if(!e||!e.maxAge&&!n[Zr])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[Zr]&&t>n[Zr]},Rs=n=>{if(n[or]>n[Yr])for(let e=n[ht].tail;n[or]>n[Yr]&&e!==null;){let t=e.prev;Ai(n,e),e=t}},Ai=(n,e)=>{if(e){let t=e.value;n[sr]&&n[sr](t.key,t.value),n[or]-=t.length,n[qn].delete(t.key),n[ht].removeNode(e)}},af=class{constructor(e,t,r,i,s){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=s||0}},Vy=(n,e,t,r)=>{let i=t.value;_a(n,i)&&(Ai(n,t),n[Ts]||(i=void 0)),i&&e.call(r,i.value,i.key,n)};Gy.exports=of});var ei=q((hq,Qy)=>{var Jy=Ss(),$S=(n,e,t)=>new Jy(n,t).compare(new Jy(e,t));Qy.exports=$S});var Zy=q((pq,Yy)=>{var HS=ei(),WS=(n,e,t)=>HS(n,e,t)===0;Yy.exports=WS});var tC=q((gq,eC)=>{var US=ei(),KS=(n,e,t)=>US(n,e,t)!==0;eC.exports=KS});var rC=q((mq,nC)=>{var zS=ei(),VS=(n,e,t)=>zS(n,e,t)>0;nC.exports=VS});var sC=q((vq,iC)=>{var BS=ei(),GS=(n,e,t)=>BS(n,e,t)>=0;iC.exports=GS});var aC=q((yq,oC)=>{var XS=ei(),JS=(n,e,t)=>XS(n,e,t)<0;oC.exports=JS});var uC=q((Cq,cC)=>{var QS=ei(),YS=(n,e,t)=>QS(n,e,t)<=0;cC.exports=YS});var dC=q((bq,lC)=>{var ZS=Zy(),eR=tC(),tR=rC(),nR=sC(),rR=aC(),iR=uC(),sR=(n,e,t,r)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return ZS(n,t,r);case"!=":return eR(n,t,r);case">":return tR(n,t,r);case">=":return nR(n,t,r);case"<":return rR(n,t,r);case"<=":return iR(n,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};lC.exports=sR});var yC=q((_q,vC)=>{var Ps=Symbol("SemVer ANY"),ji=class{static get ANY(){return Ps}constructor(e,t){if(t=fC(t),e instanceof ji){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),uf("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ps?this.value="":this.value=this.operator+this.semver.version,uf("comp",this)}parse(e){let t=this.options.loose?hC[pC.COMPARATORLOOSE]:hC[pC.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new gC(r[2],this.options.loose):this.semver=Ps}toString(){return this.value}test(e){if(uf("Comparator.test",e,this.options.loose),this.semver===Ps||e===Ps)return!0;if(typeof e=="string")try{e=new gC(e,this.options)}catch{return!1}return cf(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ji))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new mC(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new mC(this.value,t).test(e.semver):(t=fC(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||cf(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||cf(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};vC.exports=ji;var fC=ya(),{safeRe:hC,t:pC}=va(),cf=dC(),uf=Ds(),gC=Ss(),mC=lf()});var lf=q((wq,wC)=>{var ti=class{constructor(e,t){if(t=aR(t),e instanceof ti)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ti(e.raw,t);if(e instanceof df)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!bC(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&pR(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&fR)|(this.options.loose&&hR))+":"+e,i=CC.get(r);if(i)return i;let s=this.options.loose,o=s?Ut[kt.HYPHENRANGELOOSE]:Ut[kt.HYPHENRANGE];e=e.replace(o,SR(this.options.includePrerelease)),Ae("hyphen replace",e),e=e.replace(Ut[kt.COMPARATORTRIM],uR),Ae("comparator trim",e),e=e.replace(Ut[kt.TILDETRIM],lR),Ae("tilde trim",e),e=e.replace(Ut[kt.CARETTRIM],dR),Ae("caret trim",e);let a=e.split(" ").map(m=>gR(m,this.options)).join(" ").split(/\s+/).map(m=>DR(m,this.options));s&&(a=a.filter(m=>(Ae("loose invalid filter",m,this.options),!!m.match(Ut[kt.COMPARATORLOOSE])))),Ae("range list",a);let u=new Map,l=a.map(m=>new df(m,this.options));for(let m of l){if(bC(m))return[m];u.set(m.value,m)}u.size>1&&u.has("")&&u.delete("");let p=[...u.values()];return CC.set(r,p),p}intersects(e,t){if(!(e instanceof ti))throw new TypeError("a Range is required");return this.set.some(r=>_C(r,t)&&e.set.some(i=>_C(i,t)&&r.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new cR(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(RR(this.set[t],e,this.options))return!0;return!1}};wC.exports=ti;var oR=Xy(),CC=new oR({max:1e3}),aR=ya(),df=yC(),Ae=Ds(),cR=Ss(),{safeRe:Ut,t:kt,comparatorTrimReplace:uR,tildeTrimReplace:lR,caretTrimReplace:dR}=va(),{FLAG_INCLUDE_PRERELEASE:fR,FLAG_LOOSE:hR}=ma(),bC=n=>n.value==="<0.0.0-0",pR=n=>n.value==="",_C=(n,e)=>{let t=!0,r=n.slice(),i=r.pop();for(;t&&r.length;)t=r.every(s=>i.intersects(s,e)),i=r.pop();return t},gR=(n,e)=>(Ae("comp",n,e),n=yR(n,e),Ae("caret",n),n=mR(n,e),Ae("tildes",n),n=bR(n,e),Ae("xrange",n),n=wR(n,e),Ae("stars",n),n),xt=n=>!n||n.toLowerCase()==="x"||n==="*",mR=(n,e)=>n.trim().split(/\s+/).map(t=>vR(t,e)).join(" "),vR=(n,e)=>{let t=e.loose?Ut[kt.TILDELOOSE]:Ut[kt.TILDE];return n.replace(t,(r,i,s,o,a)=>{Ae("tilde",n,r,i,s,o,a);let u;return xt(i)?u="":xt(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:xt(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Ae("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Ae("tilde return",u),u})},yR=(n,e)=>n.trim().split(/\s+/).map(t=>CR(t,e)).join(" "),CR=(n,e)=>{Ae("caret",n,e);let t=e.loose?Ut[kt.CARETLOOSE]:Ut[kt.CARET],r=e.includePrerelease?"-0":"";return n.replace(t,(i,s,o,a,u)=>{Ae("caret",n,i,s,o,a,u);let l;return xt(s)?l="":xt(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:xt(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:u?(Ae("replaceCaret pr",u),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Ae("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Ae("caret return",l),l})},bR=(n,e)=>(Ae("replaceXRanges",n,e),n.split(/\s+/).map(t=>_R(t,e)).join(" ")),_R=(n,e)=>{n=n.trim();let t=e.loose?Ut[kt.XRANGELOOSE]:Ut[kt.XRANGE];return n.replace(t,(r,i,s,o,a,u)=>{Ae("xRange",n,r,i,s,o,a,u);let l=xt(s),p=l||xt(o),m=p||xt(a),g=m;return i==="="&&g&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&g?(p&&(o=0),a=0,i===">"?(i=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",p?s=+s+1:o=+o+1),i==="<"&&(u="-0"),r=`${i+s}.${o}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Ae("xRange return",r),r})},wR=(n,e)=>(Ae("replaceStars",n,e),n.trim().replace(Ut[kt.STAR],"")),DR=(n,e)=>(Ae("replaceGTE0",n,e),n.trim().replace(Ut[e.includePrerelease?kt.GTE0PRE:kt.GTE0],"")),SR=n=>(e,t,r,i,s,o,a,u,l,p,m,g,D)=>(xt(r)?t="":xt(i)?t=`>=${r}.0.0${n?"-0":""}`:xt(s)?t=`>=${r}.${i}.0${n?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${n?"-0":""}`,xt(l)?u="":xt(p)?u=`<${+l+1}.0.0-0`:xt(m)?u=`<${l}.${+p+1}.0-0`:g?u=`<=${l}.${p}.${m}-${g}`:n?u=`<${l}.${p}.${+m+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),RR=(n,e,t)=>{for(let r=0;r<n.length;r++)if(!n[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<n.length;r++)if(Ae(n[r].semver),n[r].semver!==df.ANY&&n[r].semver.prerelease.length>0){let i=n[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var SC=q((Dq,DC)=>{var TR=lf(),PR=(n,e,t)=>{try{e=new TR(e,t)}catch{return!1}return e.test(n)};DC.exports=PR});var TC=q(rn=>{"use strict";var qR=rn&&rn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),ff=rn&&rn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qR(e,n,t)};Object.defineProperty(rn,"__esModule",{value:!0});rn.DiagnosticPullMode=rn.vsdiag=void 0;ff(Y(),rn);ff(ve(),rn);var RC=yl();Object.defineProperty(rn,"vsdiag",{enumerable:!0,get:function(){return RC.vsdiag}});Object.defineProperty(rn,"DiagnosticPullMode",{enumerable:!0,get:function(){return RC.DiagnosticPullMode}});ff(Zd(),rn)});var _f=q(Kt=>{"use strict";var ER=Kt&&Kt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),EC=Kt&&Kt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ER(e,n,t)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.SettingMonitor=Kt.LanguageClient=Kt.TransportKind=void 0;var ar=require("child_process"),hf=require("fs"),pf=require("path"),Or=require("vscode"),Ue=ln(),PC=Zd(),kR=Sy(),Ve=ef(),xR=$y(),IR=SC();EC(ef(),Kt);EC(TC(),Kt);var qC="^1.82.0",Be;(function(n){n[n.stdio=0]="stdio",n[n.ipc=1]="ipc",n[n.pipe=2]="pipe",n[n.socket=3]="socket"})(Be||(Kt.TransportKind=Be={}));var Ir;(function(n){function e(t){let r=t;return r&&r.kind===Be.socket&&Ue.number(r.port)}n.isSocket=e})(Ir||(Ir={}));var gf;(function(n){function e(t){return Ue.string(t.command)}n.is=e})(gf||(gf={}));var mf;(function(n){function e(t){return Ue.string(t.module)}n.is=e})(mf||(mf={}));var vf;(function(n){function e(t){let r=t;return r&&r.writer!==void 0&&r.reader!==void 0}n.is=e})(vf||(vf={}));var yf;(function(n){function e(t){let r=t;return r&&r.process!==void 0&&typeof r.detached=="boolean"}n.is=e})(yf||(yf={}));var Cf=class extends PC.BaseLanguageClient{constructor(e,t,r,i,s){let o,a,u,l,p;Ue.string(t)?(o=e,a=t,u=r,l=i,p=!!s):(o=e.toLowerCase(),a=e,u=t,l=r,p=i),p===void 0&&(p=!1),super(o,a,l),this._serverOptions=u,this._forceDebug=p,this._isInDebugMode=p;try{this.checkVersion()}catch(m){throw Ue.string(m.message)&&this.outputChannel.appendLine(m.message),m}}checkVersion(){let e=xR(Or.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${Or.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!IR(e,qC))throw new Error(`The language client requires VS Code version ${qC} but received version ${Or.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(e=>setTimeout(e,1e3)),await this.start()):await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let t=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(t),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,kR.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(p,m){if(!p&&!m)return;let g=Object.create(null);return Object.keys(process.env).forEach(D=>g[D]=process.env[D]),m&&(g.ELECTRON_RUN_AS_NODE="1",g.ELECTRON_NO_ASAR="1"),p&&Object.keys(p).forEach(D=>g[D]=p[D]),g}let r=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let p=process.execArgv;return p?p.some(m=>r.some(g=>m.startsWith(g))||i.some(g=>m===g)):!1}function o(p){if(p.stdin===null||p.stdout===null||p.stderr===null)throw new Error("Process created without stdio streams")}let a=this._serverOptions;if(Ue.func(a))return a().then(p=>{if(PC.MessageTransports.is(p))return this._isDetached=!!p.detached,p;if(vf.is(p))return this._isDetached=!!p.detached,{reader:new Ve.StreamMessageReader(p.reader),writer:new Ve.StreamMessageWriter(p.writer)};{let m;return yf.is(p)?(m=p.process,this._isDetached=p.detached):(m=p,this._isDetached=!1),m.stderr.on("data",g=>this.outputChannel.append(Ue.string(g)?g:g.toString(e))),{reader:new Ve.StreamMessageReader(m.stdout),writer:new Ve.StreamMessageWriter(m.stdin)}}});let u,l=a;return l.run||l.debug?this._forceDebug||s()?(u=l.debug,this._isInDebugMode=!0):(u=l.run,this._isInDebugMode=!1):u=a,this._getServerWorkingDir(u.options).then(p=>{if(mf.is(u)&&u.module){let m=u,g=m.transport||Be.stdio;if(m.runtime){let D=[],y=m.options??Object.create(null);y.execArgv&&y.execArgv.forEach(L=>D.push(L)),D.push(m.module),m.args&&m.args.forEach(L=>D.push(L));let P=Object.create(null);P.cwd=p,P.env=t(y.env,!1);let E=this._getRuntimePath(m.runtime,p),O;if(g===Be.ipc?(P.stdio=[null,null,null,"ipc"],D.push("--node-ipc")):g===Be.stdio?D.push("--stdio"):g===Be.pipe?(O=(0,Ve.generateRandomPipeName)(),D.push(`--pipe=${O}`)):Ir.isSocket(g)&&D.push(`--socket=${g.port}`),D.push(`--clientProcessId=${process.pid.toString()}`),g===Be.ipc||g===Be.stdio){let L=ar.spawn(E,D,P);return!L||!L.pid?$i(L,`Launching server using runtime ${E} failed.`):(this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),g===Be.ipc?(L.stdout.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),Promise.resolve({reader:new Ve.IPCMessageReader(L),writer:new Ve.IPCMessageWriter(L)})):Promise.resolve({reader:new Ve.StreamMessageReader(L.stdout),writer:new Ve.StreamMessageWriter(L.stdin)}))}else{if(g===Be.pipe)return(0,Ve.createClientPipeTransport)(O).then(L=>{let M=ar.spawn(E,D,P);return!M||!M.pid?$i(M,`Launching server using runtime ${E} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))});if(Ir.isSocket(g))return(0,Ve.createClientSocketTransport)(g.port).then(L=>{let M=ar.spawn(E,D,P);return!M||!M.pid?$i(M,`Launching server using runtime ${E} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))})}}else{let D;return new Promise((y,P)=>{let E=(m.args&&m.args.slice())??[];g===Be.ipc?E.push("--node-ipc"):g===Be.stdio?E.push("--stdio"):g===Be.pipe?(D=(0,Ve.generateRandomPipeName)(),E.push(`--pipe=${D}`)):Ir.isSocket(g)&&E.push(`--socket=${g.port}`),E.push(`--clientProcessId=${process.pid.toString()}`);let O=m.options??Object.create(null);if(O.env=t(O.env,!0),O.execArgv=O.execArgv||[],O.cwd=p,O.silent=!0,g===Be.ipc||g===Be.stdio){let L=ar.fork(m.module,E||[],O);o(L),this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),g===Be.ipc?(L.stdout.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),y({reader:new Ve.IPCMessageReader(this._serverProcess),writer:new Ve.IPCMessageWriter(this._serverProcess)})):y({reader:new Ve.StreamMessageReader(L.stdout),writer:new Ve.StreamMessageWriter(L.stdin)})}else g===Be.pipe?(0,Ve.createClientPipeTransport)(D).then(L=>{let M=ar.fork(m.module,E||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P):Ir.isSocket(g)&&(0,Ve.createClientSocketTransport)(g.port).then(L=>{let M=ar.fork(m.module,E||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P)})}}else if(gf.is(u)&&u.command){let m=u,g=u.args!==void 0?u.args.slice(0):[],D,y=u.transport;if(y===Be.stdio)g.push("--stdio");else if(y===Be.pipe)D=(0,Ve.generateRandomPipeName)(),g.push(`--pipe=${D}`);else if(Ir.isSocket(y))g.push(`--socket=${y.port}`);else if(y===Be.ipc)throw new Error("Transport kind ipc is not support for command executable");let P=Object.assign({},m.options);if(P.cwd=P.cwd||p,y===void 0||y===Be.stdio){let E=ar.spawn(m.command,g,P);return!E||!E.pid?$i(E,`Launching server using command ${m.command} failed.`):(E.stderr.on("data",O=>this.outputChannel.append(Ue.string(O)?O:O.toString(e))),this._serverProcess=E,this._isDetached=!!P.detached,Promise.resolve({reader:new Ve.StreamMessageReader(E.stdout),writer:new Ve.StreamMessageWriter(E.stdin)}))}else{if(y===Be.pipe)return(0,Ve.createClientPipeTransport)(D).then(E=>{let O=ar.spawn(m.command,g,P);return!O||!O.pid?$i(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),E.onConnected().then(L=>({reader:L[0],writer:L[1]})))});if(Ir.isSocket(y))return(0,Ve.createClientSocketTransport)(y.port).then(E=>{let O=ar.spawn(m.command,g,P);return!O||!O.pid?$i(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),E.onConnected().then(L=>({reader:L[0],writer:L[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(a,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(p,m)=>{p!==null&&this.error(`Server process exited with code ${p}.`,void 0,!1),m!==null&&this.error(`Server process exited with signal ${m}.`,void 0,!1)})})}_getRuntimePath(e,t){if(pf.isAbsolute(e))return e;let r=this._mainGetRootPath();if(r!==void 0){let i=pf.join(r,e);if(hf.existsSync(i))return i}if(t!==void 0){let i=pf.join(t,e);if(hf.existsSync(i))return i}return e}_mainGetRootPath(){let e=Or.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||(t=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath()),t?new Promise(r=>{hf.lstat(t,(i,s)=>{r(!i&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};Kt.LanguageClient=Cf;var bf=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return Or.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new Or.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,r=e>=0?this._setting.substr(e+1):void 0,i=r?Or.workspace.getConfiguration(t).get(r,!1):Or.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start().catch(s=>this._client.error("Start failed after configuration change",s,"force")):!i&&this._client.needsStop()&&this._client.stop().catch(s=>this._client.error("Stop failed after configuration change",s,"force"))}};Kt.SettingMonitor=bf;function $i(n,e){return n===null?Promise.reject(e):new Promise((t,r)=>{n.on("error",i=>{r(`${e} ${i}`)}),setImmediate(()=>r(e))})}});var xC=q(Pe=>{"use strict";var OR=Pe&&Pe.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),FR=Pe&&Pe.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&OR(e,n,t)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.currentLabsVersion=Pe.middleware=Pe.getTsdk=Pe.activateTsVersionStatusItem=Pe.activateTsConfigStatusItem=Pe.activateReloadProjects=Pe.activateFindFileReferences=Pe.activateWriteVirtualFiles=Pe.activateDocumentDropEdit=Pe.activateAutoInsertion=void 0;Pe.parseServerCommand=Hi;Pe.createLabsInfo=HR;var cr=require("vscode"),NR=gm();Object.defineProperty(Pe,"activateAutoInsertion",{enumerable:!0,get:function(){return NR.activate}});var MR=mm();Object.defineProperty(Pe,"activateDocumentDropEdit",{enumerable:!0,get:function(){return MR.activate}});var LR=vm();Object.defineProperty(Pe,"activateWriteVirtualFiles",{enumerable:!0,get:function(){return LR.activate}});var AR=Tm();Object.defineProperty(Pe,"activateFindFileReferences",{enumerable:!0,get:function(){return AR.activate}});var jR=Pm();Object.defineProperty(Pe,"activateReloadProjects",{enumerable:!0,get:function(){return jR.activate}});var $R=km();Object.defineProperty(Pe,"activateTsConfigStatusItem",{enumerable:!0,get:function(){return $R.activate}});var kC=Lm();Object.defineProperty(Pe,"activateTsVersionStatusItem",{enumerable:!0,get:function(){return kC.activate}});Object.defineProperty(Pe,"getTsdk",{enumerable:!0,get:function(){return kC.getTsdk}});FR(_f(),Pe);Pe.middleware={async provideCodeActions(n,e,t,r,i){let s=await i(n,e,t,r);return s=s?.map(o=>o instanceof cr.CodeAction?(o.command&&(o.command=Hi(o.command)),o):Hi(o)),s},async resolveCodeAction(n,e,t){let r=await t(n,e);return r?.command&&(r.command=Hi(r.command)),r},async provideCodeLenses(n,e,t){let r=await t(n,e);return r=r?.map(i=>(i.command&&(i.command=Hi(i.command)),i)),r},async resolveCodeLens(n,e,t){let r=await t(n,e);return r?.command&&(r.command=Hi(r.command)),r}};function Hi(n){return n.command==="editor.action.rename"&&n.arguments?{...n,arguments:[[cr.Uri.parse(n.arguments[0]),new cr.Position(n.arguments[1].line,n.arguments[1].character)]]}:n.command==="editor.action.showReferences"&&n.arguments?{...n,arguments:[cr.Uri.parse(n.arguments[0]),new cr.Position(n.arguments[1].line,n.arguments[1].character),n.arguments[2].map(e=>new cr.Location(cr.Uri.parse(e.uri),new cr.Range(e.range.start.line,e.range.start.character,e.range.end.line,e.range.end.character)))]}:n}Pe.currentLabsVersion="2.3.1";function HR(n){let e=new cr.EventEmitter,t={volarLabs:{version:Pe.currentLabsVersion,languageClients:[],languageServerProtocol:n,onDidAddLanguageClient:e.event}};return{extensionExports:t,addLanguageClient(r){t.volarLabs.languageClients.push(r),e.fire(r)}}}});var OC=q((Pq,IC)=>{"use strict";IC.exports=_f()});var VR={};$C(VR,{activate:()=>UR,deactivate:()=>KR});module.exports=HC(VR);var wa=Wi(require("node:path")),WR=Wi(Tr()),zt=Wi(xC()),ur=Wi(require("vscode")),qs=Wi(OC()),Fr;async function UR(n){let e=ur.workspace.getConfiguration("astro.language-server"),{workspaceFolders:t}=ur.workspace,r=t?.[0].uri.fsPath,i=await zR(n.workspaceState);typeof i=="string"&&i.trim()!==""&&typeof r=="string"?(i=wa.isAbsolute(i)?i:wa.join(r,i),console.info(`Using language server at ${i}`)):i=void 0;let s=i?require.resolve(i):ur.Uri.joinPath(n.extensionUri,"dist/node/server.js").fsPath,o={execArgv:[]},a={execArgv:["--nolazy","--inspect=6009"]},u={run:{module:s,transport:qs.TransportKind.ipc,options:o},debug:{module:s,transport:qs.TransportKind.ipc,options:a}},l=e.get("runtime");l&&(u.run.runtime=l,u.debug.runtime=l,console.info(`Using ${l} as runtime`));let p=ur.workspace.getConfiguration("astro").get("content-intellisense"),m={typescript:{tsdk:(await(0,zt.getTsdk)(n)).tsdk},contentIntellisense:p},g={documentSelector:[{language:"astro"},...p?[{language:"markdown"},{language:"mdx"},{language:"mdoc"}]:[]],initializationOptions:m};Fr=new qs.LanguageClient("astro","Astro Language Server",u,g),await Fr.start(),(0,zt.activateAutoInsertion)("astro",Fr),(0,zt.activateFindFileReferences)("astro.findFileReferences",Fr),(0,zt.activateReloadProjects)("astro.reloadProjects",Fr),(0,zt.activateTsConfigStatusItem)("astro","astro.openTsConfig",Fr),(0,zt.activateTsVersionStatusItem)("astro","astro.selectTypescriptVersion",n,y=>y);let D=(0,zt.createLabsInfo)(WR);return D.addLanguageClient(Fr),D.extensionExports}function KR(){return Fr?.stop()}async function zR(n){let e="astro.language-server",t=ur.workspace.getConfiguration(e).inspect("ls-path"),r=t?.globalLanguageValue||t?.defaultLanguageValue||t?.globalValue||t?.defaultValue,i=t?.workspaceFolderLanguageValue||t?.workspaceLanguageValue||t?.workspaceFolderValue||t?.workspaceValue,s=`${e}.useLocalLS`,o=n.get(s);if(o===void 0&&i!==void 0){let a="This workspace contains an Astro Language Server version. Would you like to use the workplace version?",u="Allow",l="Dismiss",p="Never in This Workspace",m=await ur.window.showInformationMessage(a,u,l,p);m===u?(await n.update(s,!0),o=!0):m===p&&await n.update(s,!1)}return o===!0&&i||r}0&&(module.exports={activate,deactivate});
46
+ ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Te.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let r=Te.workspace.getConfiguration(this._id),i=j.Trace.Off,s=j.TraceFormat.Text;if(r){let o=r.get("trace.server","off");typeof o=="string"?i=j.Trace.fromString(o):(i=j.Trace.fromString(r.get("trace.server.verbosity","off")),s=j.TraceFormat.fromString(r.get("trace.server.format","text")))}this._trace=i,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;Pn.array(t)?r=t:r=[t],r&&this._dynamicFeatures.get(j.DidChangeWatchedFilesNotification.type.method).registerRaw(yy.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Tn.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(j.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Cy.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new by.ConfigurationFeature(this)),this.registerFeature(new Fi.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new Fi.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new Fi.WillSaveFeature(this)),this.registerFeature(new Fi.WillSaveWaitUntilFeature(this)),this.registerFeature(new Fi.DidSaveTextDocumentFeature(this)),this.registerFeature(new Fi.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new GD.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new ND.CompletionItemFeature(this)),this.registerFeature(new MD.HoverFeature(this)),this.registerFeature(new AD.SignatureHelpFeature(this)),this.registerFeature(new LD.DefinitionFeature(this)),this.registerFeature(new WD.ReferencesFeature(this)),this.registerFeature(new jD.DocumentHighlightFeature(this)),this.registerFeature(new $D.DocumentSymbolFeature(this)),this.registerFeature(new HD.WorkspaceSymbolFeature(this)),this.registerFeature(new UD.CodeActionFeature(this)),this.registerFeature(new KD.CodeLensFeature(this)),this.registerFeature(new Gd.DocumentFormattingFeature(this)),this.registerFeature(new Gd.DocumentRangeFormattingFeature(this)),this.registerFeature(new Gd.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new zD.RenameFeature(this)),this.registerFeature(new VD.DocumentLinkFeature(this)),this.registerFeature(new BD.ExecuteCommandFeature(this)),this.registerFeature(new by.SyncConfigurationFeature(this)),this.registerFeature(new QD.TypeDefinitionFeature(this)),this.registerFeature(new JD.ImplementationFeature(this)),this.registerFeature(new XD.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new YD.WorkspaceFoldersFeature(this)),this.registerFeature(new ZD.FoldingRangeFeature(this)),this.registerFeature(new eS.DeclarationFeature(this)),this.registerFeature(new tS.SelectionRangeFeature(this)),this.registerFeature(new nS.ProgressFeature(this)),this.registerFeature(new rS.CallHierarchyFeature(this)),this.registerFeature(new iS.SemanticTokensFeature(this)),this.registerFeature(new sS.LinkedEditingFeature(this)),this.registerFeature(new Ni.DidCreateFilesFeature(this)),this.registerFeature(new Ni.DidRenameFilesFeature(this)),this.registerFeature(new Ni.DidDeleteFilesFeature(this)),this.registerFeature(new Ni.WillCreateFilesFeature(this)),this.registerFeature(new Ni.WillRenameFilesFeature(this)),this.registerFeature(new Ni.WillDeleteFilesFeature(this)),this.registerFeature(new oS.TypeHierarchyFeature(this)),this.registerFeature(new aS.InlineValueFeature(this)),this.registerFeature(new cS.InlayHintsFeature(this)),this.registerFeature(new FD.DiagnosticFeature(this)),this.registerFeature(new Cy.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(Yd.createAll(this))}fillInitializeParams(e){for(let t of this._features)Pn.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Tn.ensure)(e,"workspace").applyEdit=!0;let t=(0,Tn.ensure)((0,Tn.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[j.ResourceOperationKind.Create,j.ResourceOperationKind.Rename,j.ResourceOperationKind.Delete],t.failureHandling=j.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let r=(0,Tn.ensure)((0,Tn.ensure)(e,"textDocument"),"publishDiagnostics");r.relatedInformation=!0,r.versionSupport=!1,r.tagSupport={valueSet:[j.DiagnosticTag.Unnecessary,j.DiagnosticTag.Deprecated]},r.codeDescriptionSupport=!0,r.dataSupport=!0;let i=(0,Tn.ensure)(e,"window"),s=(0,Tn.ensure)(i,"showMessage");s.messageActionItem={additionalPropertiesSupport:!0};let o=(0,Tn.ensure)(i,"showDocument");o.support=!0;let a=(0,Tn.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(rr.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let u of this._features)u.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let r of this._features)Pn.func(r.preInitialize)&&r.preInitialize(this._capabilities,t);for(let r of this._features)r.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,r=>this.doRegisterCapability(r)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let r=this._dynamicFeatures.get(t.method);if(r===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let i=t.registerOptions??{};i.documentSelector=i.documentSelector??this._clientOptions.documentSelector;let s={id:t.id,registerOptions:i};try{r.register(s)}catch(o){return Promise.reject(o)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,r=>this.doUnregisterCapability(r)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let r=this._dynamicFeatures.get(t.method);if(!r)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));r.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,r=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),i=new Map;Te.workspace.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let s=!1;if(t.documentChanges){for(let o of t.documentChanges)if(j.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let a=this._p2c.asUri(o.textDocument.uri).toString(),u=i.get(a);if(u&&u.version!==o.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):Pn.asPromise(Te.workspace.applyEdit(r).then(o=>({applied:o})))}handleFailedRequest(e,t,r,i,s=!0){if(r instanceof j.ResponseError){if(r.code===j.ErrorCodes.PendingResponseRejected||r.code===j.ErrorCodes.ConnectionInactive)return i;if(r.code===j.LSPErrorCodes.RequestCancelled||r.code===j.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return i;throw r.data!==void 0?new Tn.LSPCancellationError(r.data):new Te.CancellationError}else if(r.code===j.LSPErrorCodes.ContentModified){if(rr.RequestsToCancelOnContentModified.has(e.method)||rr.CancellableResolveCalls.has(e.method))throw new Te.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,r,s),r}};ft.BaseLanguageClient=rr;rr.RequestsToCancelOnContentModified=new Set([j.SemanticTokensRequest.method,j.SemanticTokensRangeRequest.method,j.SemanticTokensDeltaRequest.method]);rr.CancellableResolveCalls=new Set([j.CompletionResolveRequest.method,j.CodeLensResolveRequest.method,j.CodeActionResolveRequest.method,j.InlayHintResolveRequest.method,j.DocumentLinkResolveRequest.method,j.WorkspaceSymbolResolveRequest.method]);var Qd=class{error(e){(0,j.RAL)().console.error(e)}warn(e){(0,j.RAL)().console.warn(e)}info(e){(0,j.RAL)().console.info(e)}log(e){(0,j.RAL)().console.log(e)}};function lS(n,e,t,r,i){let s=new Qd,o=(0,j.createProtocolConnection)(n,e,s,i);return o.onError(u=>{t(u[0],u[1],u[2])}),o.onClose(r),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(u,l,p)=>{let m={sendNotification:!1,traceFormat:j.TraceFormat.Text};return p===void 0?o.trace(u,l,m):(Pn.boolean(p),o.trace(u,l,p))},initialize:u=>o.sendRequest(j.InitializeRequest.type,u),shutdown:()=>o.sendRequest(j.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(j.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var Yd;(function(n){function e(t){return[new uS.InlineCompletionItemFeature(t)]}n.createAll=e})(Yd||(ft.ProposedFeatures=Yd={}))});var Sy=q(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.terminate=void 0;var Dy=require("child_process"),dS=require("path"),fS=process.platform==="win32",hS=process.platform==="darwin",pS=process.platform==="linux";function gS(n,e){if(fS)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),Dy.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],i),!0}catch{return!1}else if(pS||hS)try{var t=(0,dS.join)(__dirname,"terminateProcess.sh"),r=Dy.spawnSync(t,[n.pid.toString()]);return!r.error}catch{return!1}else return n.kill("SIGKILL"),!0}ga.terminate=gS});var ef=q((rq,Ry)=>{"use strict";Ry.exports=Y()});var Ds=q((iq,Ty)=>{var mS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};Ty.exports=mS});var ma=q((sq,Py)=>{var vS="2.0.0",yS=Number.MAX_SAFE_INTEGER||9007199254740991,CS=16,bS=256-6,_S=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Py.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:CS,MAX_SAFE_BUILD_LENGTH:bS,MAX_SAFE_INTEGER:yS,RELEASE_TYPES:_S,SEMVER_SPEC_VERSION:vS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var va=q((ir,qy)=>{var{MAX_SAFE_COMPONENT_LENGTH:tf,MAX_SAFE_BUILD_LENGTH:wS,MAX_LENGTH:DS}=ma(),SS=Ds();ir=qy.exports={};var RS=ir.re=[],TS=ir.safeRe=[],V=ir.src=[],B=ir.t={},PS=0,nf="[a-zA-Z0-9-]",qS=[["\\s",1],["\\d",DS],[nf,wS]],ES=n=>{for(let[e,t]of qS)n=n.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return n},oe=(n,e,t)=>{let r=ES(e),i=PS++;SS(n,i,e),B[n]=i,V[i]=e,RS[i]=new RegExp(e,t?"g":void 0),TS[i]=new RegExp(r,t?"g":void 0)};oe("NUMERICIDENTIFIER","0|[1-9]\\d*");oe("NUMERICIDENTIFIERLOOSE","\\d+");oe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${nf}*`);oe("MAINVERSION",`(${V[B.NUMERICIDENTIFIER]})\\.(${V[B.NUMERICIDENTIFIER]})\\.(${V[B.NUMERICIDENTIFIER]})`);oe("MAINVERSIONLOOSE",`(${V[B.NUMERICIDENTIFIERLOOSE]})\\.(${V[B.NUMERICIDENTIFIERLOOSE]})\\.(${V[B.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASEIDENTIFIER",`(?:${V[B.NUMERICIDENTIFIER]}|${V[B.NONNUMERICIDENTIFIER]})`);oe("PRERELEASEIDENTIFIERLOOSE",`(?:${V[B.NUMERICIDENTIFIERLOOSE]}|${V[B.NONNUMERICIDENTIFIER]})`);oe("PRERELEASE",`(?:-(${V[B.PRERELEASEIDENTIFIER]}(?:\\.${V[B.PRERELEASEIDENTIFIER]})*))`);oe("PRERELEASELOOSE",`(?:-?(${V[B.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${V[B.PRERELEASEIDENTIFIERLOOSE]})*))`);oe("BUILDIDENTIFIER",`${nf}+`);oe("BUILD",`(?:\\+(${V[B.BUILDIDENTIFIER]}(?:\\.${V[B.BUILDIDENTIFIER]})*))`);oe("FULLPLAIN",`v?${V[B.MAINVERSION]}${V[B.PRERELEASE]}?${V[B.BUILD]}?`);oe("FULL",`^${V[B.FULLPLAIN]}$`);oe("LOOSEPLAIN",`[v=\\s]*${V[B.MAINVERSIONLOOSE]}${V[B.PRERELEASELOOSE]}?${V[B.BUILD]}?`);oe("LOOSE",`^${V[B.LOOSEPLAIN]}$`);oe("GTLT","((?:<|>)?=?)");oe("XRANGEIDENTIFIERLOOSE",`${V[B.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);oe("XRANGEIDENTIFIER",`${V[B.NUMERICIDENTIFIER]}|x|X|\\*`);oe("XRANGEPLAIN",`[v=\\s]*(${V[B.XRANGEIDENTIFIER]})(?:\\.(${V[B.XRANGEIDENTIFIER]})(?:\\.(${V[B.XRANGEIDENTIFIER]})(?:${V[B.PRERELEASE]})?${V[B.BUILD]}?)?)?`);oe("XRANGEPLAINLOOSE",`[v=\\s]*(${V[B.XRANGEIDENTIFIERLOOSE]})(?:\\.(${V[B.XRANGEIDENTIFIERLOOSE]})(?:\\.(${V[B.XRANGEIDENTIFIERLOOSE]})(?:${V[B.PRERELEASELOOSE]})?${V[B.BUILD]}?)?)?`);oe("XRANGE",`^${V[B.GTLT]}\\s*${V[B.XRANGEPLAIN]}$`);oe("XRANGELOOSE",`^${V[B.GTLT]}\\s*${V[B.XRANGEPLAINLOOSE]}$`);oe("COERCE",`(^|[^\\d])(\\d{1,${tf}})(?:\\.(\\d{1,${tf}}))?(?:\\.(\\d{1,${tf}}))?(?:$|[^\\d])`);oe("COERCERTL",V[B.COERCE],!0);oe("LONETILDE","(?:~>?)");oe("TILDETRIM",`(\\s*)${V[B.LONETILDE]}\\s+`,!0);ir.tildeTrimReplace="$1~";oe("TILDE",`^${V[B.LONETILDE]}${V[B.XRANGEPLAIN]}$`);oe("TILDELOOSE",`^${V[B.LONETILDE]}${V[B.XRANGEPLAINLOOSE]}$`);oe("LONECARET","(?:\\^)");oe("CARETTRIM",`(\\s*)${V[B.LONECARET]}\\s+`,!0);ir.caretTrimReplace="$1^";oe("CARET",`^${V[B.LONECARET]}${V[B.XRANGEPLAIN]}$`);oe("CARETLOOSE",`^${V[B.LONECARET]}${V[B.XRANGEPLAINLOOSE]}$`);oe("COMPARATORLOOSE",`^${V[B.GTLT]}\\s*(${V[B.LOOSEPLAIN]})$|^$`);oe("COMPARATOR",`^${V[B.GTLT]}\\s*(${V[B.FULLPLAIN]})$|^$`);oe("COMPARATORTRIM",`(\\s*)${V[B.GTLT]}\\s*(${V[B.LOOSEPLAIN]}|${V[B.XRANGEPLAIN]})`,!0);ir.comparatorTrimReplace="$1$2$3";oe("HYPHENRANGE",`^\\s*(${V[B.XRANGEPLAIN]})\\s+-\\s+(${V[B.XRANGEPLAIN]})\\s*$`);oe("HYPHENRANGELOOSE",`^\\s*(${V[B.XRANGEPLAINLOOSE]})\\s+-\\s+(${V[B.XRANGEPLAINLOOSE]})\\s*$`);oe("STAR","(<|>)?=?\\s*\\*");oe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");oe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ya=q((oq,Ey)=>{var kS=Object.freeze({loose:!0}),xS=Object.freeze({}),IS=n=>n?typeof n!="object"?kS:n:xS;Ey.exports=IS});var Oy=q((aq,Iy)=>{var ky=/^[0-9]+$/,xy=(n,e)=>{let t=ky.test(n),r=ky.test(e);return t&&r&&(n=+n,e=+e),n===e?0:t&&!r?-1:r&&!t?1:n<e?-1:1},OS=(n,e)=>xy(e,n);Iy.exports={compareIdentifiers:xy,rcompareIdentifiers:OS}});var Ss=q((cq,Ly)=>{var Ca=Ds(),{MAX_LENGTH:Fy,MAX_SAFE_INTEGER:ba}=ma(),{safeRe:Ny,t:My}=va(),FS=ya(),{compareIdentifiers:Mi}=Oy(),nn=class{constructor(e,t){if(t=FS(t),e instanceof nn){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Fy)throw new TypeError(`version is longer than ${Fy} characters`);Ca("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Ny[My.LOOSE]:Ny[My.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ba||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ba||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ba||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ba)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ca("SemVer.compare",this.version,this.options,e),!(e instanceof nn)){if(typeof e=="string"&&e===this.version)return 0;e=new nn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof nn||(e=new nn(e,this.options)),Mi(this.major,e.major)||Mi(this.minor,e.minor)||Mi(this.patch,e.patch)}comparePre(e){if(e instanceof nn||(e=new nn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(Ca("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Mi(r,i)}while(++t)}compareBuild(e){e instanceof nn||(e=new nn(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(Ca("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Mi(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];r===!1&&(s=[t]),Mi(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ly.exports=nn});var $y=q((uq,jy)=>{var Ay=Ss(),NS=(n,e,t=!1)=>{if(n instanceof Ay)return n;try{return new Ay(n,e)}catch(r){if(!t)return null;throw r}};jy.exports=NS});var Wy=q((lq,Hy)=>{"use strict";Hy.exports=function(n){n.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Ky=q((dq,Uy)=>{"use strict";Uy.exports=we;we.Node=Qr;we.create=we;function we(n){var e=this;if(e instanceof we||(e=new we),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,r=arguments.length;t<r;t++)e.push(arguments[t]);return e}we.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var e=n.next,t=n.prev;return e&&(e.prev=t),t&&(t.next=e),n===this.head&&(this.head=e),n===this.tail&&(this.tail=t),n.list.length--,n.next=null,n.prev=null,n.list=null,e};we.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var e=this.head;n.list=this,n.next=e,e&&(e.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}};we.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var e=this.tail;n.list=this,n.prev=e,e&&(e.next=n),this.tail=n,this.head||(this.head=n),this.length++}};we.prototype.push=function(){for(var n=0,e=arguments.length;n<e;n++)LS(this,arguments[n]);return this.length};we.prototype.unshift=function(){for(var n=0,e=arguments.length;n<e;n++)AS(this,arguments[n]);return this.length};we.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}};we.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}};we.prototype.forEach=function(n,e){e=e||this;for(var t=this.head,r=0;t!==null;r++)n.call(e,t.value,r,this),t=t.next};we.prototype.forEachReverse=function(n,e){e=e||this;for(var t=this.tail,r=this.length-1;t!==null;r--)n.call(e,t.value,r,this),t=t.prev};we.prototype.get=function(n){for(var e=0,t=this.head;t!==null&&e<n;e++)t=t.next;if(e===n&&t!==null)return t.value};we.prototype.getReverse=function(n){for(var e=0,t=this.tail;t!==null&&e<n;e++)t=t.prev;if(e===n&&t!==null)return t.value};we.prototype.map=function(n,e){e=e||this;for(var t=new we,r=this.head;r!==null;)t.push(n.call(e,r.value,this)),r=r.next;return t};we.prototype.mapReverse=function(n,e){e=e||this;for(var t=new we,r=this.tail;r!==null;)t.push(n.call(e,r.value,this)),r=r.prev;return t};we.prototype.reduce=function(n,e){var t,r=this.head;if(arguments.length>1)t=e;else if(this.head)r=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)t=n(t,r.value,i),r=r.next;return t};we.prototype.reduceReverse=function(n,e){var t,r=this.tail;if(arguments.length>1)t=e;else if(this.tail)r=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)t=n(t,r.value,i),r=r.prev;return t};we.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n};we.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n};we.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new we;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<n;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)t.push(i.value);return t};we.prototype.sliceReverse=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new we;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>n;r--,i=i.prev)t.push(i.value);return t};we.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var r=0,i=this.head;i!==null&&r<n;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<t.length;r++)i=MS(this,i,t[r]);return s};we.prototype.reverse=function(){for(var n=this.head,e=this.tail,t=n;t!==null;t=t.prev){var r=t.prev;t.prev=t.next,t.next=r}return this.head=e,this.tail=n,this};function MS(n,e,t){var r=e===n.head?new Qr(t,null,e,n):new Qr(t,e,e.next,n);return r.next===null&&(n.tail=r),r.prev===null&&(n.head=r),n.length++,r}function LS(n,e){n.tail=new Qr(e,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function AS(n,e){n.head=new Qr(e,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function Qr(n,e,t,r){if(!(this instanceof Qr))return new Qr(n,e,t,r);this.list=r,this.value=n,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{Wy()(we)}catch{}});var Xy=q((fq,Gy)=>{"use strict";var jS=Ky(),Yr=Symbol("max"),or=Symbol("length"),Li=Symbol("lengthCalculator"),Ts=Symbol("allowStale"),Zr=Symbol("maxAge"),sr=Symbol("dispose"),zy=Symbol("noDisposeOnSet"),ht=Symbol("lruList"),qn=Symbol("cache"),By=Symbol("updateAgeOnGet"),rf=()=>1,of=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[Yr]=e.max||1/0,r=e.length||rf;if(this[Li]=typeof r!="function"?rf:r,this[Ts]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Zr]=e.maxAge||0,this[sr]=e.dispose,this[zy]=e.noDisposeOnSet||!1,this[By]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Yr]=e||1/0,Rs(this)}get max(){return this[Yr]}set allowStale(e){this[Ts]=!!e}get allowStale(){return this[Ts]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Zr]=e,Rs(this)}get maxAge(){return this[Zr]}set lengthCalculator(e){typeof e!="function"&&(e=rf),e!==this[Li]&&(this[Li]=e,this[or]=0,this[ht].forEach(t=>{t.length=this[Li](t.value,t.key),this[or]+=t.length})),Rs(this)}get lengthCalculator(){return this[Li]}get length(){return this[or]}get itemCount(){return this[ht].length}rforEach(e,t){t=t||this;for(let r=this[ht].tail;r!==null;){let i=r.prev;Vy(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[ht].head;r!==null;){let i=r.next;Vy(this,e,r,t),r=i}}keys(){return this[ht].toArray().map(e=>e.key)}values(){return this[ht].toArray().map(e=>e.value)}reset(){this[sr]&&this[ht]&&this[ht].length&&this[ht].forEach(e=>this[sr](e.key,e.value)),this[qn]=new Map,this[ht]=new jS,this[or]=0}dump(){return this[ht].map(e=>_a(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ht]}set(e,t,r){if(r=r||this[Zr],r&&typeof r!="number")throw new TypeError("maxAge must be a number");let i=r?Date.now():0,s=this[Li](t,e);if(this[qn].has(e)){if(s>this[Yr])return Ai(this,this[qn].get(e)),!1;let u=this[qn].get(e).value;return this[sr]&&(this[zy]||this[sr](e,u.value)),u.now=i,u.maxAge=r,u.value=t,this[or]+=s-u.length,u.length=s,this.get(e),Rs(this),!0}let o=new af(e,t,s,i,r);return o.length>this[Yr]?(this[sr]&&this[sr](e,t),!1):(this[or]+=o.length,this[ht].unshift(o),this[qn].set(e,this[ht].head),Rs(this),!0)}has(e){if(!this[qn].has(e))return!1;let t=this[qn].get(e).value;return!_a(this,t)}get(e){return sf(this,e,!0)}peek(e){return sf(this,e,!1)}pop(){let e=this[ht].tail;return e?(Ai(this,e),e.value):null}del(e){Ai(this,this[qn].get(e))}load(e){this.reset();let t=Date.now();for(let r=e.length-1;r>=0;r--){let i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{let o=s-t;o>0&&this.set(i.k,i.v,o)}}}prune(){this[qn].forEach((e,t)=>sf(this,t,!1))}},sf=(n,e,t)=>{let r=n[qn].get(e);if(r){let i=r.value;if(_a(n,i)){if(Ai(n,r),!n[Ts])return}else t&&(n[By]&&(r.value.now=Date.now()),n[ht].unshiftNode(r));return i.value}},_a=(n,e)=>{if(!e||!e.maxAge&&!n[Zr])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[Zr]&&t>n[Zr]},Rs=n=>{if(n[or]>n[Yr])for(let e=n[ht].tail;n[or]>n[Yr]&&e!==null;){let t=e.prev;Ai(n,e),e=t}},Ai=(n,e)=>{if(e){let t=e.value;n[sr]&&n[sr](t.key,t.value),n[or]-=t.length,n[qn].delete(t.key),n[ht].removeNode(e)}},af=class{constructor(e,t,r,i,s){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=s||0}},Vy=(n,e,t,r)=>{let i=t.value;_a(n,i)&&(Ai(n,t),n[Ts]||(i=void 0)),i&&e.call(r,i.value,i.key,n)};Gy.exports=of});var ei=q((hq,Qy)=>{var Jy=Ss(),$S=(n,e,t)=>new Jy(n,t).compare(new Jy(e,t));Qy.exports=$S});var Zy=q((pq,Yy)=>{var HS=ei(),WS=(n,e,t)=>HS(n,e,t)===0;Yy.exports=WS});var tC=q((gq,eC)=>{var US=ei(),KS=(n,e,t)=>US(n,e,t)!==0;eC.exports=KS});var rC=q((mq,nC)=>{var zS=ei(),VS=(n,e,t)=>zS(n,e,t)>0;nC.exports=VS});var sC=q((vq,iC)=>{var BS=ei(),GS=(n,e,t)=>BS(n,e,t)>=0;iC.exports=GS});var aC=q((yq,oC)=>{var XS=ei(),JS=(n,e,t)=>XS(n,e,t)<0;oC.exports=JS});var uC=q((Cq,cC)=>{var QS=ei(),YS=(n,e,t)=>QS(n,e,t)<=0;cC.exports=YS});var dC=q((bq,lC)=>{var ZS=Zy(),eR=tC(),tR=rC(),nR=sC(),rR=aC(),iR=uC(),sR=(n,e,t,r)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return ZS(n,t,r);case"!=":return eR(n,t,r);case">":return tR(n,t,r);case">=":return nR(n,t,r);case"<":return rR(n,t,r);case"<=":return iR(n,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};lC.exports=sR});var yC=q((_q,vC)=>{var Ps=Symbol("SemVer ANY"),ji=class{static get ANY(){return Ps}constructor(e,t){if(t=fC(t),e instanceof ji){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),uf("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ps?this.value="":this.value=this.operator+this.semver.version,uf("comp",this)}parse(e){let t=this.options.loose?hC[pC.COMPARATORLOOSE]:hC[pC.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new gC(r[2],this.options.loose):this.semver=Ps}toString(){return this.value}test(e){if(uf("Comparator.test",e,this.options.loose),this.semver===Ps||e===Ps)return!0;if(typeof e=="string")try{e=new gC(e,this.options)}catch{return!1}return cf(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ji))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new mC(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new mC(this.value,t).test(e.semver):(t=fC(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||cf(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||cf(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};vC.exports=ji;var fC=ya(),{safeRe:hC,t:pC}=va(),cf=dC(),uf=Ds(),gC=Ss(),mC=lf()});var lf=q((wq,wC)=>{var ti=class{constructor(e,t){if(t=aR(t),e instanceof ti)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ti(e.raw,t);if(e instanceof df)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!bC(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&pR(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&fR)|(this.options.loose&&hR))+":"+e,i=CC.get(r);if(i)return i;let s=this.options.loose,o=s?Ut[kt.HYPHENRANGELOOSE]:Ut[kt.HYPHENRANGE];e=e.replace(o,SR(this.options.includePrerelease)),Ae("hyphen replace",e),e=e.replace(Ut[kt.COMPARATORTRIM],uR),Ae("comparator trim",e),e=e.replace(Ut[kt.TILDETRIM],lR),Ae("tilde trim",e),e=e.replace(Ut[kt.CARETTRIM],dR),Ae("caret trim",e);let a=e.split(" ").map(m=>gR(m,this.options)).join(" ").split(/\s+/).map(m=>DR(m,this.options));s&&(a=a.filter(m=>(Ae("loose invalid filter",m,this.options),!!m.match(Ut[kt.COMPARATORLOOSE])))),Ae("range list",a);let u=new Map,l=a.map(m=>new df(m,this.options));for(let m of l){if(bC(m))return[m];u.set(m.value,m)}u.size>1&&u.has("")&&u.delete("");let p=[...u.values()];return CC.set(r,p),p}intersects(e,t){if(!(e instanceof ti))throw new TypeError("a Range is required");return this.set.some(r=>_C(r,t)&&e.set.some(i=>_C(i,t)&&r.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new cR(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(RR(this.set[t],e,this.options))return!0;return!1}};wC.exports=ti;var oR=Xy(),CC=new oR({max:1e3}),aR=ya(),df=yC(),Ae=Ds(),cR=Ss(),{safeRe:Ut,t:kt,comparatorTrimReplace:uR,tildeTrimReplace:lR,caretTrimReplace:dR}=va(),{FLAG_INCLUDE_PRERELEASE:fR,FLAG_LOOSE:hR}=ma(),bC=n=>n.value==="<0.0.0-0",pR=n=>n.value==="",_C=(n,e)=>{let t=!0,r=n.slice(),i=r.pop();for(;t&&r.length;)t=r.every(s=>i.intersects(s,e)),i=r.pop();return t},gR=(n,e)=>(Ae("comp",n,e),n=yR(n,e),Ae("caret",n),n=mR(n,e),Ae("tildes",n),n=bR(n,e),Ae("xrange",n),n=wR(n,e),Ae("stars",n),n),xt=n=>!n||n.toLowerCase()==="x"||n==="*",mR=(n,e)=>n.trim().split(/\s+/).map(t=>vR(t,e)).join(" "),vR=(n,e)=>{let t=e.loose?Ut[kt.TILDELOOSE]:Ut[kt.TILDE];return n.replace(t,(r,i,s,o,a)=>{Ae("tilde",n,r,i,s,o,a);let u;return xt(i)?u="":xt(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:xt(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Ae("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Ae("tilde return",u),u})},yR=(n,e)=>n.trim().split(/\s+/).map(t=>CR(t,e)).join(" "),CR=(n,e)=>{Ae("caret",n,e);let t=e.loose?Ut[kt.CARETLOOSE]:Ut[kt.CARET],r=e.includePrerelease?"-0":"";return n.replace(t,(i,s,o,a,u)=>{Ae("caret",n,i,s,o,a,u);let l;return xt(s)?l="":xt(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:xt(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:u?(Ae("replaceCaret pr",u),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Ae("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Ae("caret return",l),l})},bR=(n,e)=>(Ae("replaceXRanges",n,e),n.split(/\s+/).map(t=>_R(t,e)).join(" ")),_R=(n,e)=>{n=n.trim();let t=e.loose?Ut[kt.XRANGELOOSE]:Ut[kt.XRANGE];return n.replace(t,(r,i,s,o,a,u)=>{Ae("xRange",n,r,i,s,o,a,u);let l=xt(s),p=l||xt(o),m=p||xt(a),g=m;return i==="="&&g&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&g?(p&&(o=0),a=0,i===">"?(i=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",p?s=+s+1:o=+o+1),i==="<"&&(u="-0"),r=`${i+s}.${o}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Ae("xRange return",r),r})},wR=(n,e)=>(Ae("replaceStars",n,e),n.trim().replace(Ut[kt.STAR],"")),DR=(n,e)=>(Ae("replaceGTE0",n,e),n.trim().replace(Ut[e.includePrerelease?kt.GTE0PRE:kt.GTE0],"")),SR=n=>(e,t,r,i,s,o,a,u,l,p,m,g,D)=>(xt(r)?t="":xt(i)?t=`>=${r}.0.0${n?"-0":""}`:xt(s)?t=`>=${r}.${i}.0${n?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${n?"-0":""}`,xt(l)?u="":xt(p)?u=`<${+l+1}.0.0-0`:xt(m)?u=`<${l}.${+p+1}.0-0`:g?u=`<=${l}.${p}.${m}-${g}`:n?u=`<${l}.${p}.${+m+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),RR=(n,e,t)=>{for(let r=0;r<n.length;r++)if(!n[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<n.length;r++)if(Ae(n[r].semver),n[r].semver!==df.ANY&&n[r].semver.prerelease.length>0){let i=n[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var SC=q((Dq,DC)=>{var TR=lf(),PR=(n,e,t)=>{try{e=new TR(e,t)}catch{return!1}return e.test(n)};DC.exports=PR});var TC=q(rn=>{"use strict";var qR=rn&&rn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),ff=rn&&rn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qR(e,n,t)};Object.defineProperty(rn,"__esModule",{value:!0});rn.DiagnosticPullMode=rn.vsdiag=void 0;ff(Y(),rn);ff(ve(),rn);var RC=yl();Object.defineProperty(rn,"vsdiag",{enumerable:!0,get:function(){return RC.vsdiag}});Object.defineProperty(rn,"DiagnosticPullMode",{enumerable:!0,get:function(){return RC.DiagnosticPullMode}});ff(Zd(),rn)});var _f=q(Kt=>{"use strict";var ER=Kt&&Kt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),EC=Kt&&Kt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ER(e,n,t)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.SettingMonitor=Kt.LanguageClient=Kt.TransportKind=void 0;var ar=require("child_process"),hf=require("fs"),pf=require("path"),Or=require("vscode"),Ue=ln(),PC=Zd(),kR=Sy(),Ve=ef(),xR=$y(),IR=SC();EC(ef(),Kt);EC(TC(),Kt);var qC="^1.82.0",Be;(function(n){n[n.stdio=0]="stdio",n[n.ipc=1]="ipc",n[n.pipe=2]="pipe",n[n.socket=3]="socket"})(Be||(Kt.TransportKind=Be={}));var Ir;(function(n){function e(t){let r=t;return r&&r.kind===Be.socket&&Ue.number(r.port)}n.isSocket=e})(Ir||(Ir={}));var gf;(function(n){function e(t){return Ue.string(t.command)}n.is=e})(gf||(gf={}));var mf;(function(n){function e(t){return Ue.string(t.module)}n.is=e})(mf||(mf={}));var vf;(function(n){function e(t){let r=t;return r&&r.writer!==void 0&&r.reader!==void 0}n.is=e})(vf||(vf={}));var yf;(function(n){function e(t){let r=t;return r&&r.process!==void 0&&typeof r.detached=="boolean"}n.is=e})(yf||(yf={}));var Cf=class extends PC.BaseLanguageClient{constructor(e,t,r,i,s){let o,a,u,l,p;Ue.string(t)?(o=e,a=t,u=r,l=i,p=!!s):(o=e.toLowerCase(),a=e,u=t,l=r,p=i),p===void 0&&(p=!1),super(o,a,l),this._serverOptions=u,this._forceDebug=p,this._isInDebugMode=p;try{this.checkVersion()}catch(m){throw Ue.string(m.message)&&this.outputChannel.appendLine(m.message),m}}checkVersion(){let e=xR(Or.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${Or.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!IR(e,qC))throw new Error(`The language client requires VS Code version ${qC} but received version ${Or.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(e=>setTimeout(e,1e3)),await this.start()):await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let t=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(t),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,kR.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(p,m){if(!p&&!m)return;let g=Object.create(null);return Object.keys(process.env).forEach(D=>g[D]=process.env[D]),m&&(g.ELECTRON_RUN_AS_NODE="1",g.ELECTRON_NO_ASAR="1"),p&&Object.keys(p).forEach(D=>g[D]=p[D]),g}let r=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let p=process.execArgv;return p?p.some(m=>r.some(g=>m.startsWith(g))||i.some(g=>m===g)):!1}function o(p){if(p.stdin===null||p.stdout===null||p.stderr===null)throw new Error("Process created without stdio streams")}let a=this._serverOptions;if(Ue.func(a))return a().then(p=>{if(PC.MessageTransports.is(p))return this._isDetached=!!p.detached,p;if(vf.is(p))return this._isDetached=!!p.detached,{reader:new Ve.StreamMessageReader(p.reader),writer:new Ve.StreamMessageWriter(p.writer)};{let m;return yf.is(p)?(m=p.process,this._isDetached=p.detached):(m=p,this._isDetached=!1),m.stderr.on("data",g=>this.outputChannel.append(Ue.string(g)?g:g.toString(e))),{reader:new Ve.StreamMessageReader(m.stdout),writer:new Ve.StreamMessageWriter(m.stdin)}}});let u,l=a;return l.run||l.debug?this._forceDebug||s()?(u=l.debug,this._isInDebugMode=!0):(u=l.run,this._isInDebugMode=!1):u=a,this._getServerWorkingDir(u.options).then(p=>{if(mf.is(u)&&u.module){let m=u,g=m.transport||Be.stdio;if(m.runtime){let D=[],y=m.options??Object.create(null);y.execArgv&&y.execArgv.forEach(L=>D.push(L)),D.push(m.module),m.args&&m.args.forEach(L=>D.push(L));let P=Object.create(null);P.cwd=p,P.env=t(y.env,!1);let E=this._getRuntimePath(m.runtime,p),O;if(g===Be.ipc?(P.stdio=[null,null,null,"ipc"],D.push("--node-ipc")):g===Be.stdio?D.push("--stdio"):g===Be.pipe?(O=(0,Ve.generateRandomPipeName)(),D.push(`--pipe=${O}`)):Ir.isSocket(g)&&D.push(`--socket=${g.port}`),D.push(`--clientProcessId=${process.pid.toString()}`),g===Be.ipc||g===Be.stdio){let L=ar.spawn(E,D,P);return!L||!L.pid?$i(L,`Launching server using runtime ${E} failed.`):(this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),g===Be.ipc?(L.stdout.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),Promise.resolve({reader:new Ve.IPCMessageReader(L),writer:new Ve.IPCMessageWriter(L)})):Promise.resolve({reader:new Ve.StreamMessageReader(L.stdout),writer:new Ve.StreamMessageWriter(L.stdin)}))}else{if(g===Be.pipe)return(0,Ve.createClientPipeTransport)(O).then(L=>{let M=ar.spawn(E,D,P);return!M||!M.pid?$i(M,`Launching server using runtime ${E} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))});if(Ir.isSocket(g))return(0,Ve.createClientSocketTransport)(g.port).then(L=>{let M=ar.spawn(E,D,P);return!M||!M.pid?$i(M,`Launching server using runtime ${E} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))})}}else{let D;return new Promise((y,P)=>{let E=(m.args&&m.args.slice())??[];g===Be.ipc?E.push("--node-ipc"):g===Be.stdio?E.push("--stdio"):g===Be.pipe?(D=(0,Ve.generateRandomPipeName)(),E.push(`--pipe=${D}`)):Ir.isSocket(g)&&E.push(`--socket=${g.port}`),E.push(`--clientProcessId=${process.pid.toString()}`);let O=m.options??Object.create(null);if(O.env=t(O.env,!0),O.execArgv=O.execArgv||[],O.cwd=p,O.silent=!0,g===Be.ipc||g===Be.stdio){let L=ar.fork(m.module,E||[],O);o(L),this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),g===Be.ipc?(L.stdout.on("data",M=>this.outputChannel.append(Ue.string(M)?M:M.toString(e))),y({reader:new Ve.IPCMessageReader(this._serverProcess),writer:new Ve.IPCMessageWriter(this._serverProcess)})):y({reader:new Ve.StreamMessageReader(L.stdout),writer:new Ve.StreamMessageWriter(L.stdin)})}else g===Be.pipe?(0,Ve.createClientPipeTransport)(D).then(L=>{let M=ar.fork(m.module,E||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P):Ir.isSocket(g)&&(0,Ve.createClientSocketTransport)(g.port).then(L=>{let M=ar.fork(m.module,E||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(Ue.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P)})}}else if(gf.is(u)&&u.command){let m=u,g=u.args!==void 0?u.args.slice(0):[],D,y=u.transport;if(y===Be.stdio)g.push("--stdio");else if(y===Be.pipe)D=(0,Ve.generateRandomPipeName)(),g.push(`--pipe=${D}`);else if(Ir.isSocket(y))g.push(`--socket=${y.port}`);else if(y===Be.ipc)throw new Error("Transport kind ipc is not support for command executable");let P=Object.assign({},m.options);if(P.cwd=P.cwd||p,y===void 0||y===Be.stdio){let E=ar.spawn(m.command,g,P);return!E||!E.pid?$i(E,`Launching server using command ${m.command} failed.`):(E.stderr.on("data",O=>this.outputChannel.append(Ue.string(O)?O:O.toString(e))),this._serverProcess=E,this._isDetached=!!P.detached,Promise.resolve({reader:new Ve.StreamMessageReader(E.stdout),writer:new Ve.StreamMessageWriter(E.stdin)}))}else{if(y===Be.pipe)return(0,Ve.createClientPipeTransport)(D).then(E=>{let O=ar.spawn(m.command,g,P);return!O||!O.pid?$i(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),E.onConnected().then(L=>({reader:L[0],writer:L[1]})))});if(Ir.isSocket(y))return(0,Ve.createClientSocketTransport)(y.port).then(E=>{let O=ar.spawn(m.command,g,P);return!O||!O.pid?$i(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(Ue.string(L)?L:L.toString(e))),E.onConnected().then(L=>({reader:L[0],writer:L[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(a,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(p,m)=>{p!==null&&this.error(`Server process exited with code ${p}.`,void 0,!1),m!==null&&this.error(`Server process exited with signal ${m}.`,void 0,!1)})})}_getRuntimePath(e,t){if(pf.isAbsolute(e))return e;let r=this._mainGetRootPath();if(r!==void 0){let i=pf.join(r,e);if(hf.existsSync(i))return i}if(t!==void 0){let i=pf.join(t,e);if(hf.existsSync(i))return i}return e}_mainGetRootPath(){let e=Or.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||(t=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath()),t?new Promise(r=>{hf.lstat(t,(i,s)=>{r(!i&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};Kt.LanguageClient=Cf;var bf=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return Or.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new Or.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,r=e>=0?this._setting.substr(e+1):void 0,i=r?Or.workspace.getConfiguration(t).get(r,!1):Or.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start().catch(s=>this._client.error("Start failed after configuration change",s,"force")):!i&&this._client.needsStop()&&this._client.stop().catch(s=>this._client.error("Stop failed after configuration change",s,"force"))}};Kt.SettingMonitor=bf;function $i(n,e){return n===null?Promise.reject(e):new Promise((t,r)=>{n.on("error",i=>{r(`${e} ${i}`)}),setImmediate(()=>r(e))})}});var xC=q(Pe=>{"use strict";var OR=Pe&&Pe.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),FR=Pe&&Pe.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&OR(e,n,t)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.currentLabsVersion=Pe.middleware=Pe.getTsdk=Pe.activateTsVersionStatusItem=Pe.activateTsConfigStatusItem=Pe.activateReloadProjects=Pe.activateFindFileReferences=Pe.activateWriteVirtualFiles=Pe.activateDocumentDropEdit=Pe.activateAutoInsertion=void 0;Pe.parseServerCommand=Hi;Pe.createLabsInfo=HR;var cr=require("vscode"),NR=gm();Object.defineProperty(Pe,"activateAutoInsertion",{enumerable:!0,get:function(){return NR.activate}});var MR=mm();Object.defineProperty(Pe,"activateDocumentDropEdit",{enumerable:!0,get:function(){return MR.activate}});var LR=vm();Object.defineProperty(Pe,"activateWriteVirtualFiles",{enumerable:!0,get:function(){return LR.activate}});var AR=Tm();Object.defineProperty(Pe,"activateFindFileReferences",{enumerable:!0,get:function(){return AR.activate}});var jR=Pm();Object.defineProperty(Pe,"activateReloadProjects",{enumerable:!0,get:function(){return jR.activate}});var $R=km();Object.defineProperty(Pe,"activateTsConfigStatusItem",{enumerable:!0,get:function(){return $R.activate}});var kC=Lm();Object.defineProperty(Pe,"activateTsVersionStatusItem",{enumerable:!0,get:function(){return kC.activate}});Object.defineProperty(Pe,"getTsdk",{enumerable:!0,get:function(){return kC.getTsdk}});FR(_f(),Pe);Pe.middleware={async provideCodeActions(n,e,t,r,i){let s=await i(n,e,t,r);return s=s?.map(o=>o instanceof cr.CodeAction?(o.command&&(o.command=Hi(o.command)),o):Hi(o)),s},async resolveCodeAction(n,e,t){let r=await t(n,e);return r?.command&&(r.command=Hi(r.command)),r},async provideCodeLenses(n,e,t){let r=await t(n,e);return r=r?.map(i=>(i.command&&(i.command=Hi(i.command)),i)),r},async resolveCodeLens(n,e,t){let r=await t(n,e);return r?.command&&(r.command=Hi(r.command)),r}};function Hi(n){return n.command==="editor.action.rename"&&n.arguments?{...n,arguments:[[cr.Uri.parse(n.arguments[0]),new cr.Position(n.arguments[1].line,n.arguments[1].character)]]}:n.command==="editor.action.showReferences"&&n.arguments?{...n,arguments:[cr.Uri.parse(n.arguments[0]),new cr.Position(n.arguments[1].line,n.arguments[1].character),n.arguments[2].map(e=>new cr.Location(cr.Uri.parse(e.uri),new cr.Range(e.range.start.line,e.range.start.character,e.range.end.line,e.range.end.character)))]}:n}Pe.currentLabsVersion="2.3.1";function HR(n){let e=new cr.EventEmitter,t={volarLabs:{version:Pe.currentLabsVersion,languageClients:[],languageServerProtocol:n,onDidAddLanguageClient:e.event}};return{extensionExports:t,addLanguageClient(r){t.volarLabs.languageClients.push(r),e.fire(r)}}}});var OC=q((Pq,IC)=>{"use strict";IC.exports=_f()});var VR={};$C(VR,{activate:()=>UR,deactivate:()=>KR});module.exports=HC(VR);var wa=Wi(require("node:path")),WR=Wi(Tr()),zt=Wi(xC()),ur=Wi(require("vscode")),qs=Wi(OC()),Fr;async function UR(n){let e=ur.workspace.getConfiguration("astro.language-server"),{workspaceFolders:t}=ur.workspace,r=t?.[0].uri.fsPath,i=await zR(n.workspaceState);typeof i=="string"&&i.trim()!==""&&typeof r=="string"?(i=wa.isAbsolute(i)?i:wa.join(r,i),console.info(`Using language server at ${i}`)):i=void 0;let s=i?require.resolve(i):ur.Uri.joinPath(n.extensionUri,"dist/node/server.js").fsPath,o={execArgv:[]},a={execArgv:["--nolazy","--inspect=6009"]},u={run:{module:s,transport:qs.TransportKind.ipc,options:o},debug:{module:s,transport:qs.TransportKind.ipc,options:a}},l=e.get("runtime");l&&(u.run.runtime=l,u.debug.runtime=l,console.info(`Using ${l} as runtime`));let p=ur.workspace.getConfiguration("astro").get("content-intellisense"),m={typescript:{tsdk:(await(0,zt.getTsdk)(n)).tsdk},contentIntellisense:p},g={documentSelector:[{language:"astro"},...p?[{language:"markdown"},{language:"mdx"},{language:"markdoc"}]:[]],initializationOptions:m};Fr=new qs.LanguageClient("astro","Astro Language Server",u,g),await Fr.start(),(0,zt.activateAutoInsertion)("astro",Fr),(0,zt.activateFindFileReferences)("astro.findFileReferences",Fr),(0,zt.activateReloadProjects)("astro.reloadProjects",Fr),(0,zt.activateTsConfigStatusItem)("astro","astro.openTsConfig",Fr),(0,zt.activateTsVersionStatusItem)("astro","astro.selectTypescriptVersion",n,y=>y);let D=(0,zt.createLabsInfo)(WR);return D.addLanguageClient(Fr),D.extensionExports}function KR(){return Fr?.stop()}async function zR(n){let e="astro.language-server",t=ur.workspace.getConfiguration(e).inspect("ls-path"),r=t?.globalLanguageValue||t?.defaultLanguageValue||t?.globalValue||t?.defaultValue,i=t?.workspaceFolderLanguageValue||t?.workspaceLanguageValue||t?.workspaceFolderValue||t?.workspaceValue,s=`${e}.useLocalLS`,o=n.get(s);if(o===void 0&&i!==void 0){let a="This workspace contains an Astro Language Server version. Would you like to use the workplace version?",u="Allow",l="Dismiss",p="Never in This Workspace",m=await ur.window.showInformationMessage(a,u,l,p);m===u?(await n.update(s,!0),o=!0):m===p&&await n.update(s,!1)}return o===!0&&i||r}0&&(module.exports={activate,deactivate});