factoriomod-debug 2.0.13 → 2.1.2

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.
@@ -2,21 +2,37 @@
2
2
  import {createRequire} from 'module'
3
3
  const require = createRequire(import.meta.url)
4
4
 
5
- import{H as Ra,I as Sr,J as xa,L as an,M as br,N as _r,O as Fa,P as qa,a as I,c as F,e as sn,h as Qn,k as lt,l as Pe,m as on,n as wr,o as L,p as Pa,q as Dr,r as qd,s as Id,t as Ed}from"./chunk-S7WJEOJD.js";var Ie=F(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.asPromise=oe.thenable=oe.typedArray=oe.stringArray=oe.array=oe.func=oe.error=oe.number=oe.string=oe.boolean=void 0;function Nd(a){return a===!0||a===!1}oe.boolean=Nd;function Ua(a){return typeof a=="string"||a instanceof String}oe.string=Ua;function Hd(a){return typeof a=="number"||a instanceof Number}oe.number=Hd;function Kd(a){return a instanceof Error}oe.error=Kd;function Na(a){return typeof a=="function"}oe.func=Na;function Ha(a){return Array.isArray(a)}oe.array=Ha;function jd(a){return Ha(a)&&a.every(e=>Ua(e))}oe.stringArray=jd;function Wd(a,e){return Array.isArray(a)&&a.every(e)}oe.typedArray=Wd;function Ka(a){return a&&Na(a.then)}oe.thenable=Ka;function $d(a){return a instanceof Promise?a:Ka(a)?new Promise((e,t)=>{a.then(n=>e(n),n=>t(n))}):Promise.resolve(a)}oe.asPromise=$d});var oi=F(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.forEach=Ce.mapAsync=Ce.map=Ce.clearTestMode=Ce.setTestMode=Ce.Semaphore=Ce.Delayer=void 0;var dn=L(),Ar=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(n=>{this.onSuccess=n}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var n=this.task();return this.task=void 0,n})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,dn.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}};Ce.Delayer=Ar;var Or=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,dn.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Ce.Semaphore=Or;var Lr=!1;function zd(){Lr=!0}Ce.setTestMode=zd;function Vd(){Lr=!1}Ce.clearTestMode=Vd;var ja=15,cn=class{constructor(e=ja){this.yieldAfter=Lr===!0?Math.max(e,2):Math.max(e,ja),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){let e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}};async function Bd(a,e,t,n){if(a.length===0)return[];let i=new Array(a.length),r=new cn(n?.yieldAfter);function s(d){r.start();for(let l=d;l<a.length;l++)if(i[l]=e(a[l]),r.shouldYield())return n?.yieldCallback&&n.yieldCallback(),l+1;return-1}let c=s(0);for(;c!==-1&&!(t!==void 0&&t.isCancellationRequested);)c=await new Promise(d=>{(0,dn.RAL)().timer.setImmediate(()=>{d(s(c))})});return i}Ce.map=Bd;async function Yd(a,e,t,n){if(a.length===0)return[];let i=new Array(a.length),r=new cn(n?.yieldAfter);async function s(d){r.start();for(let l=d;l<a.length;l++)if(i[l]=await e(a[l],t),r.shouldYield())return n?.yieldCallback&&n.yieldCallback(),l+1;return-1}let c=await s(0);for(;c!==-1&&!(t!==void 0&&t.isCancellationRequested);)c=await new Promise(d=>{(0,dn.RAL)().timer.setImmediate(()=>{d(s(c))})});return i}Ce.mapAsync=Yd;async function Jd(a,e,t,n){if(a.length===0)return;let i=new cn(n?.yieldAfter);function r(c){i.start();for(let d=c;d<a.length;d++)if(e(a[d]),i.shouldYield())return n?.yieldCallback&&n.yieldCallback(),d+1;return-1}let s=r(0);for(;s!==-1&&!(t!==void 0&&t.isCancellationRequested);)s=await new Promise(c=>{(0,dn.RAL)().timer.setImmediate(()=>{c(r(s))})})}Ce.forEach=Jd});var Hr=F(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});var Qd=I("vscode"),Ur=class extends Qd.CompletionItem{constructor(e){super(e)}};Nr.default=Ur});var Wr=F(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});var Gd=I("vscode"),Kr=class extends Gd.CodeLens{constructor(e){super(e)}};jr.default=Kr});var Vr=F(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});var Zd=I("vscode"),$r=class extends Zd.DocumentLink{constructor(e,t){super(e,t)}};zr.default=$r});var Jr=F(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});var Xd=I("vscode"),Br=class extends Xd.CodeAction{constructor(e,t){super(e),this.data=t}};Yr.default=Br});var Zr=F(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ProtocolDiagnostic=Ht.DiagnosticCode=void 0;var eu=I("vscode"),Qr=Ie(),Wa;(function(a){function e(t){let n=t;return n!=null&&(Qr.number(n.value)||Qr.string(n.value))&&Qr.string(n.target)}a.is=e})(Wa||(Ht.DiagnosticCode=Wa={}));var Gr=class extends eu.Diagnostic{constructor(e,t,n,i){super(e,t,n),this.data=i,this.hasDiagnosticCode=!1}};Ht.ProtocolDiagnostic=Gr});var ts=F(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var tu=I("vscode"),Xr=class extends tu.CallHierarchyItem{constructor(e,t,n,i,r,s,c){super(e,t,n,i,r,s),c!==void 0&&(this.data=c)}};es.default=Xr});var rs=F(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var nu=I("vscode"),ns=class extends nu.TypeHierarchyItem{constructor(e,t,n,i,r,s,c){super(e,t,n,i,r,s),c!==void 0&&(this.data=c)}};is.default=ns});var as=F(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var ai=I("vscode"),ss=class extends ai.SymbolInformation{constructor(e,t,n,i,r){let s=!(i instanceof ai.Uri);super(e,t,n,s?i:new ai.Location(i,new ai.Range(0,0,0,0))),this.hasRange=s,r!==void 0&&(this.data=r)}};os.default=ss});var us=F(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var iu=I("vscode"),cs=class extends iu.InlayHint{constructor(e,t,n){super(e,t,n)}};ds.default=cs});var Ba=F(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.createConverter=void 0;var de=I("vscode"),O=L(),St=Ie(),$a=oi(),ru=Hr(),su=Wr(),ou=Vr(),za=Jr(),Va=Zr(),au=ts(),cu=rs(),du=as(),uu=us(),ls;(function(a){function e(t){let n=t;return n&&!!n.inserting&&!!n.replacing}a.is=e})(ls||(ls={}));function lu(a){let t=a||(u=>u.toString());function n(u){return t(u)}function i(u){return{uri:t(u.uri)}}function r(u){return{uri:t(u.uri),languageId:u.languageId,version:u.version,text:u.getText()}}function s(u){return{uri:t(u.uri),version:u.version}}function c(u){return{textDocument:r(u)}}function d(u){let w=u;return!!w.document&&!!w.contentChanges}function l(u){let w=u;return!!w.uri&&!!w.version}function g(u,w,R){if(l(u))return{textDocument:{uri:t(u.uri),version:u.version},contentChanges:[{text:u.getText()}]};if(d(u)){let B=w,Q=R;return{textDocument:{uri:t(B),version:Q},contentChanges:u.contentChanges.map(ke=>{let We=ke.range;return{range:{start:{line:We.start.line,character:We.start.character},end:{line:We.end.line,character:We.end.character}},rangeLength:ke.rangeLength,text:ke.text}})}}else throw Error("Unsupported text document change parameter")}function h(u){return{textDocument:i(u)}}function f(u,w=!1){let R={textDocument:i(u)};return w&&(R.text=u.getText()),R}function v(u){switch(u){case de.TextDocumentSaveReason.Manual:return O.TextDocumentSaveReason.Manual;case de.TextDocumentSaveReason.AfterDelay:return O.TextDocumentSaveReason.AfterDelay;case de.TextDocumentSaveReason.FocusOut:return O.TextDocumentSaveReason.FocusOut}return O.TextDocumentSaveReason.Manual}function p(u){return{textDocument:i(u.document),reason:v(u.reason)}}function y(u){return{files:u.files.map(w=>({uri:t(w)}))}}function C(u){return{files:u.files.map(w=>({oldUri:t(w.oldUri),newUri:t(w.newUri)}))}}function b(u){return{files:u.files.map(w=>({uri:t(w)}))}}function T(u){return{files:u.files.map(w=>({uri:t(w)}))}}function P(u){return{files:u.files.map(w=>({oldUri:t(w.oldUri),newUri:t(w.newUri)}))}}function q(u){return{files:u.files.map(w=>({uri:t(w)}))}}function ce(u,w){return{textDocument:i(u),position:at(w)}}function V(u){switch(u){case de.CompletionTriggerKind.TriggerCharacter:return O.CompletionTriggerKind.TriggerCharacter;case de.CompletionTriggerKind.TriggerForIncompleteCompletions:return O.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return O.CompletionTriggerKind.Invoked}}function X(u,w,R){return{textDocument:i(u),position:at(w),context:{triggerKind:V(R.triggerKind),triggerCharacter:R.triggerCharacter}}}function Je(u){switch(u){case de.SignatureHelpTriggerKind.Invoke:return O.SignatureHelpTriggerKind.Invoked;case de.SignatureHelpTriggerKind.TriggerCharacter:return O.SignatureHelpTriggerKind.TriggerCharacter;case de.SignatureHelpTriggerKind.ContentChange:return O.SignatureHelpTriggerKind.ContentChange}}function rt(u){return{label:u.label}}function Qe(u){return u.map(rt)}function st(u){return{label:u.label,parameters:Qe(u.parameters)}}function It(u){return u.map(st)}function Et(u){return u===void 0?u:{signatures:It(u.signatures),activeSignature:u.activeSignature,activeParameter:u.activeParameter}}function ot(u,w,R){return{textDocument:i(u),position:at(w),context:{isRetrigger:R.isRetrigger,triggerCharacter:R.triggerCharacter,triggerKind:Je(R.triggerKind),activeSignatureHelp:Et(R.activeSignatureHelp)}}}function at(u){return{line:u.line,character:u.character}}function Le(u){return u==null?u:{line:u.line>O.uinteger.MAX_VALUE?O.uinteger.MAX_VALUE:u.line,character:u.character>O.uinteger.MAX_VALUE?O.uinteger.MAX_VALUE:u.character}}function rr(u,w){return $a.map(u,Le,w)}function En(u){return u.map(Le)}function pe(u){return u==null?u:{start:Le(u.start),end:Le(u.end)}}function Mn(u){return u.map(pe)}function ct(u){return u==null?u:O.Location.create(n(u.uri),pe(u.range))}function Ge(u){switch(u){case de.DiagnosticSeverity.Error:return O.DiagnosticSeverity.Error;case de.DiagnosticSeverity.Warning:return O.DiagnosticSeverity.Warning;case de.DiagnosticSeverity.Information:return O.DiagnosticSeverity.Information;case de.DiagnosticSeverity.Hint:return O.DiagnosticSeverity.Hint}}function sr(u){if(!u)return;let w=[];for(let R of u){let B=An(R);B!==void 0&&w.push(B)}return w.length>0?w:void 0}function An(u){switch(u){case de.DiagnosticTag.Unnecessary:return O.DiagnosticTag.Unnecessary;case de.DiagnosticTag.Deprecated:return O.DiagnosticTag.Deprecated;default:return}}function On(u){return{message:u.message,location:ct(u.location)}}function Ln(u){return u.map(On)}function or(u){if(u!=null)return St.number(u)||St.string(u)?u:{value:u.value,target:n(u.target)}}function Zt(u){let w=O.Diagnostic.create(pe(u.range),u.message),R=u instanceof Va.ProtocolDiagnostic?u:void 0;R!==void 0&&R.data!==void 0&&(w.data=R.data);let B=or(u.code);return Va.DiagnosticCode.is(B)?R!==void 0&&R.hasDiagnosticCode?w.code=B:(w.code=B.value,w.codeDescription={href:B.target}):w.code=B,St.number(u.severity)&&(w.severity=Ge(u.severity)),Array.isArray(u.tags)&&(w.tags=sr(u.tags)),u.relatedInformation&&(w.relatedInformation=Ln(u.relatedInformation)),u.source&&(w.source=u.source),w}function Mt(u,w){return u==null?u:$a.map(u,Zt,w)}function At(u){return u==null?u:u.map(Zt)}function ar(u,w){switch(u){case"$string":return w;case O.MarkupKind.PlainText:return{kind:u,value:w};case O.MarkupKind.Markdown:return{kind:u,value:w.value};default:return`Unsupported Markup content received. Kind is: ${u}`}}function dt(u){if(u===de.CompletionItemTag.Deprecated)return O.CompletionItemTag.Deprecated}function Un(u){if(u===void 0)return u;let w=[];for(let R of u){let B=dt(R);B!==void 0&&w.push(B)}return w}function Ot(u,w){return w!==void 0?w:u+1}function Nn(u,w=!1){let R,B;St.string(u.label)?R=u.label:(R=u.label.label,w&&(u.label.detail!==void 0||u.label.description!==void 0)&&(B={detail:u.label.detail,description:u.label.description}));let Q={label:R};B!==void 0&&(Q.labelDetails=B);let fe=u instanceof ru.default?u:void 0;u.detail&&(Q.detail=u.detail),u.documentation&&(!fe||fe.documentationFormat==="$string"?Q.documentation=u.documentation:Q.documentation=ar(fe.documentationFormat,u.documentation)),u.filterText&&(Q.filterText=u.filterText),cr(Q,u),St.number(u.kind)&&(Q.kind=Ot(u.kind,fe&&fe.originalItemKind)),u.sortText&&(Q.sortText=u.sortText),u.additionalTextEdits&&(Q.additionalTextEdits=Ue(u.additionalTextEdits)),u.commitCharacters&&(Q.commitCharacters=u.commitCharacters.slice()),u.command&&(Q.command=Ze(u.command)),(u.preselect===!0||u.preselect===!1)&&(Q.preselect=u.preselect);let ke=Un(u.tags);if(fe){if(fe.data!==void 0&&(Q.data=fe.data),fe.deprecated===!0||fe.deprecated===!1){if(fe.deprecated===!0&&ke!==void 0&&ke.length>0){let We=ke.indexOf(de.CompletionItemTag.Deprecated);We!==-1&&ke.splice(We,1)}Q.deprecated=fe.deprecated}fe.insertTextMode!==void 0&&(Q.insertTextMode=fe.insertTextMode)}return ke!==void 0&&ke.length>0&&(Q.tags=ke),Q.insertTextMode===void 0&&u.keepWhitespace===!0&&(Q.insertTextMode=O.InsertTextMode.adjustIndentation),Q}function cr(u,w){let R=O.InsertTextFormat.PlainText,B,Q;w.textEdit?(B=w.textEdit.newText,Q=w.textEdit.range):w.insertText instanceof de.SnippetString?(R=O.InsertTextFormat.Snippet,B=w.insertText.value):B=w.insertText,w.range&&(Q=w.range),u.insertTextFormat=R,w.fromEdit&&B!==void 0&&Q!==void 0?u.textEdit=Xt(B,Q):u.insertText=B}function Xt(u,w){return ls.is(w)?O.InsertReplaceEdit.create(u,pe(w.inserting),pe(w.replacing)):{newText:u,range:pe(w)}}function en(u){return{range:pe(u.range),newText:u.newText}}function Ue(u){return u==null?u:u.map(en)}function wt(u){return u<=de.SymbolKind.TypeParameter?u+1:O.SymbolKind.Property}function qe(u){return u}function ut(u){return u.map(qe)}function dr(u,w,R){return{textDocument:i(u),position:at(w),context:{includeDeclaration:R.includeDeclaration}}}async function Hn(u,w){let R=O.CodeAction.create(u.title);if(u instanceof za.default&&u.data!==void 0&&(R.data=u.data),u.kind!==void 0&&(R.kind=jn(u.kind)),u.diagnostics!==void 0&&(R.diagnostics=await Mt(u.diagnostics,w)),u.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return u.command!==void 0&&(R.command=Ze(u.command)),u.isPreferred!==void 0&&(R.isPreferred=u.isPreferred),u.disabled!==void 0&&(R.disabled={reason:u.disabled.reason}),R}function ur(u){let w=O.CodeAction.create(u.title);if(u instanceof za.default&&u.data!==void 0&&(w.data=u.data),u.kind!==void 0&&(w.kind=jn(u.kind)),u.diagnostics!==void 0&&(w.diagnostics=At(u.diagnostics)),u.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return u.command!==void 0&&(w.command=Ze(u.command)),u.isPreferred!==void 0&&(w.isPreferred=u.isPreferred),u.disabled!==void 0&&(w.disabled={reason:u.disabled.reason}),w}async function Kn(u,w){if(u==null)return u;let R;return u.only&&St.string(u.only.value)&&(R=[u.only.value]),O.CodeActionContext.create(await Mt(u.diagnostics,w),R,tn(u.triggerKind))}function lr(u){if(u==null)return u;let w;return u.only&&St.string(u.only.value)&&(w=[u.only.value]),O.CodeActionContext.create(At(u.diagnostics),w,tn(u.triggerKind))}function tn(u){switch(u){case de.CodeActionTriggerKind.Invoke:return O.CodeActionTriggerKind.Invoked;case de.CodeActionTriggerKind.Automatic:return O.CodeActionTriggerKind.Automatic;default:return}}function jn(u){if(u!=null)return u.value}function Wn(u){return u==null?u:O.InlineValueContext.create(u.frameId,pe(u.stoppedLocation))}function pr(u,w,R){return{context:O.InlineCompletionContext.create(R.triggerKind,R.selectedCompletionInfo),textDocument:i(u),position:Le(w)}}function Ze(u){let w=O.Command.create(u.title,u.command);return u.arguments&&(w.arguments=u.arguments),w}function $n(u){let w=O.CodeLens.create(pe(u.range));return u.command&&(w.command=Ze(u.command)),u instanceof su.default&&u.data&&(w.data=u.data),w}function fr(u,w){let R={tabSize:u.tabSize,insertSpaces:u.insertSpaces};return w.trimTrailingWhitespace&&(R.trimTrailingWhitespace=!0),w.trimFinalNewlines&&(R.trimFinalNewlines=!0),w.insertFinalNewline&&(R.insertFinalNewline=!0),R}function zn(u){return{textDocument:i(u)}}function hr(u){return{textDocument:i(u)}}function Vn(u){let w=O.DocumentLink.create(pe(u.range));u.target&&(w.target=n(u.target)),u.tooltip!==void 0&&(w.tooltip=u.tooltip);let R=u instanceof ou.default?u:void 0;return R&&R.data&&(w.data=R.data),w}function Bn(u){return{textDocument:i(u)}}function gr(u){let w={name:u.name,kind:wt(u.kind),uri:n(u.uri),range:pe(u.range),selectionRange:pe(u.selectionRange)};return u.detail!==void 0&&u.detail.length>0&&(w.detail=u.detail),u.tags!==void 0&&(w.tags=ut(u.tags)),u instanceof au.default&&u.data!==void 0&&(w.data=u.data),w}function nn(u){let w={name:u.name,kind:wt(u.kind),uri:n(u.uri),range:pe(u.range),selectionRange:pe(u.selectionRange)};return u.detail!==void 0&&u.detail.length>0&&(w.detail=u.detail),u.tags!==void 0&&(w.tags=ut(u.tags)),u instanceof cu.default&&u.data!==void 0&&(w.data=u.data),w}function mr(u){let w=u instanceof du.default?{name:u.name,kind:wt(u.kind),location:u.hasRange?ct(u.location):{uri:t(u.location.uri)},data:u.data}:{name:u.name,kind:wt(u.kind),location:ct(u.location)};return u.tags!==void 0&&(w.tags=ut(u.tags)),u.containerName!==""&&(w.containerName=u.containerName),w}function Yn(u){let w=typeof u.label=="string"?u.label:u.label.map(vr),R=O.InlayHint.create(Le(u.position),w);return u.kind!==void 0&&(R.kind=u.kind),u.textEdits!==void 0&&(R.textEdits=Ue(u.textEdits)),u.tooltip!==void 0&&(R.tooltip=rn(u.tooltip)),u.paddingLeft!==void 0&&(R.paddingLeft=u.paddingLeft),u.paddingRight!==void 0&&(R.paddingRight=u.paddingRight),u instanceof uu.default&&u.data!==void 0&&(R.data=u.data),R}function vr(u){let w=O.InlayHintLabelPart.create(u.value);return u.location!==void 0&&(w.location=ct(u.location)),u.command!==void 0&&(w.command=Ze(u.command)),u.tooltip!==void 0&&(w.tooltip=rn(u.tooltip)),w}function rn(u){return typeof u=="string"?u:{kind:O.MarkupKind.Markdown,value:u.value}}return{asUri:n,asTextDocumentIdentifier:i,asTextDocumentItem:r,asVersionedTextDocumentIdentifier:s,asOpenTextDocumentParams:c,asChangeTextDocumentParams:g,asCloseTextDocumentParams:h,asSaveTextDocumentParams:f,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:y,asDidRenameFilesParams:C,asDidDeleteFilesParams:b,asWillCreateFilesParams:T,asWillRenameFilesParams:P,asWillDeleteFilesParams:q,asTextDocumentPositionParams:ce,asCompletionParams:X,asSignatureHelpParams:ot,asWorkerPosition:at,asRange:pe,asRanges:Mn,asPosition:Le,asPositions:rr,asPositionsSync:En,asLocation:ct,asDiagnosticSeverity:Ge,asDiagnosticTag:An,asDiagnostic:Zt,asDiagnostics:Mt,asDiagnosticsSync:At,asCompletionItem:Nn,asTextEdit:en,asSymbolKind:wt,asSymbolTag:qe,asSymbolTags:ut,asReferenceParams:dr,asCodeAction:Hn,asCodeActionSync:ur,asCodeActionContext:Kn,asCodeActionContextSync:lr,asInlineValueContext:Wn,asCommand:Ze,asCodeLens:$n,asFormattingOptions:fr,asDocumentSymbolParams:zn,asCodeLensParams:hr,asDocumentLink:Vn,asDocumentLinkParams:Bn,asCallHierarchyItem:gr,asTypeHierarchyItem:nn,asInlayHint:Yn,asWorkspaceSymbol:mr,asInlineCompletionParams:pr}}ci.createConverter=lu});var Qa=F(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.createConverter=void 0;var k=I("vscode"),M=L(),Ee=Ie(),$=oi(),pu=Hr(),fu=Wr(),hu=Vr(),gu=Jr(),Ya=Zr(),mu=ts(),vu=rs(),yu=as(),Cu=us(),Ja=L(),di;(function(a){function e(t){let n=t;return n&&Ee.string(n.language)&&Ee.string(n.value)}a.is=e})(di||(di={}));function wu(a,e,t){let i=a||(o=>k.Uri.parse(o));function r(o){return i(o)}function s(o){let m=[];for(let D of o)if(typeof D=="string")m.push(D);else if(Ja.NotebookCellTextDocumentFilter.is(D))if(typeof D.notebook=="string")m.push({notebookType:D.notebook,language:D.language});else{let x=D.notebook.notebookType??"*";m.push({notebookType:x,scheme:D.notebook.scheme,pattern:D.notebook.pattern,language:D.language})}else Ja.TextDocumentFilter.is(D)&&m.push({language:D.language,scheme:D.scheme,pattern:D.pattern});return m}async function c(o,m){return $.map(o,l,m)}function d(o){let m=new Array(o.length);for(let D=0;D<o.length;D++)m[D]=l(o[D]);return m}function l(o){let m=new Ya.ProtocolDiagnostic(p(o.range),o.message,C(o.severity),o.data);if(o.code!==void 0){if(typeof o.code=="string"||typeof o.code=="number")M.CodeDescription.is(o.codeDescription)?m.code={value:o.code,target:r(o.codeDescription.href)}:m.code=o.code;else if(Ya.DiagnosticCode.is(o.code)){m.hasDiagnosticCode=!0;let D=o.code;m.code={value:D.value,target:r(D.target)}}}return o.source&&(m.source=o.source),o.relatedInformation&&(m.relatedInformation=g(o.relatedInformation)),Array.isArray(o.tags)&&(m.tags=h(o.tags)),m}function g(o){let m=new Array(o.length);for(let D=0;D<o.length;D++){let x=o[D];m[D]=new k.DiagnosticRelatedInformation(Ge(x.location),x.message)}return m}function h(o){if(!o)return;let m=[];for(let D of o){let x=f(D);x!==void 0&&m.push(x)}return m.length>0?m:void 0}function f(o){switch(o){case M.DiagnosticTag.Unnecessary:return k.DiagnosticTag.Unnecessary;case M.DiagnosticTag.Deprecated:return k.DiagnosticTag.Deprecated;default:return}}function v(o){return o?new k.Position(o.line,o.character):void 0}function p(o){return o?new k.Range(o.start.line,o.start.character,o.end.line,o.end.character):void 0}async function y(o,m){return $.map(o,D=>new k.Range(D.start.line,D.start.character,D.end.line,D.end.character),m)}function C(o){if(o==null)return k.DiagnosticSeverity.Error;switch(o){case M.DiagnosticSeverity.Error:return k.DiagnosticSeverity.Error;case M.DiagnosticSeverity.Warning:return k.DiagnosticSeverity.Warning;case M.DiagnosticSeverity.Information:return k.DiagnosticSeverity.Information;case M.DiagnosticSeverity.Hint:return k.DiagnosticSeverity.Hint}return k.DiagnosticSeverity.Error}function b(o){if(Ee.string(o))return P(o);if(di.is(o))return P().appendCodeblock(o.value,o.language);if(Array.isArray(o)){let m=[];for(let D of o){let x=P();di.is(D)?x.appendCodeblock(D.value,D.language):x.appendMarkdown(D),m.push(x)}return m}else return P(o)}function T(o){if(Ee.string(o))return o;switch(o.kind){case M.MarkupKind.Markdown:return P(o.value);case M.MarkupKind.PlainText:return o.value;default:return`Unsupported Markup content received. Kind is: ${o.kind}`}}function P(o){let m;if(o===void 0||typeof o=="string")m=new k.MarkdownString(o);else switch(o.kind){case M.MarkupKind.Markdown:m=new k.MarkdownString(o.value);break;case M.MarkupKind.PlainText:m=new k.MarkdownString,m.appendText(o.value);break;default:m=new k.MarkdownString,m.appendText(`Unsupported Markup content received. Kind is: ${o.kind}`);break}return m.isTrusted=e,m.supportHtml=t,m}function q(o){if(o)return new k.Hover(b(o.contents),p(o.range))}async function ce(o,m,D){if(!o)return;if(Array.isArray(o))return $.map(o,$e=>Qe($e,m),D);let x=o,{defaultRange:he,commitCharacters:ye}=V(x,m),J=await $.map(x.items,$e=>Qe($e,ye,he,x.itemDefaults?.insertTextMode,x.itemDefaults?.insertTextFormat,x.itemDefaults?.data),D);return new k.CompletionList(J,x.isIncomplete)}function V(o,m){let D=o.itemDefaults?.editRange,x=o.itemDefaults?.commitCharacters??m;return M.Range.is(D)?{defaultRange:p(D),commitCharacters:x}:D!==void 0?{defaultRange:{inserting:p(D.insert),replacing:p(D.replace)},commitCharacters:x}:{defaultRange:void 0,commitCharacters:x}}function X(o){return M.CompletionItemKind.Text<=o&&o<=M.CompletionItemKind.TypeParameter?[o-1,void 0]:[k.CompletionItemKind.Text,o]}function Je(o){if(o===M.CompletionItemTag.Deprecated)return k.CompletionItemTag.Deprecated}function rt(o){if(o==null)return[];let m=[];for(let D of o){let x=Je(D);x!==void 0&&m.push(x)}return m}function Qe(o,m,D,x,he,ye){let J=rt(o.tags),$e=st(o),G=new pu.default($e);o.detail&&(G.detail=o.detail),o.documentation&&(G.documentation=T(o.documentation),G.documentationFormat=Ee.string(o.documentation)?"$string":o.documentation.kind),o.filterText&&(G.filterText=o.filterText);let Jn=It(o,D,he);if(Jn&&(G.insertText=Jn.text,G.range=Jn.range,G.fromEdit=Jn.fromEdit),Ee.number(o.kind)){let[Fd,ka]=X(o.kind);G.kind=Fd,ka&&(G.originalItemKind=ka)}o.sortText&&(G.sortText=o.sortText),o.additionalTextEdits&&(G.additionalTextEdits=Le(o.additionalTextEdits));let _a=o.commitCharacters!==void 0?Ee.stringArray(o.commitCharacters)?o.commitCharacters:void 0:m;_a&&(G.commitCharacters=_a.slice()),o.command&&(G.command=Ue(o.command)),(o.deprecated===!0||o.deprecated===!1)&&(G.deprecated=o.deprecated,o.deprecated===!0&&J.push(k.CompletionItemTag.Deprecated)),(o.preselect===!0||o.preselect===!1)&&(G.preselect=o.preselect);let Ta=o.data??ye;Ta!==void 0&&(G.data=Ta),J.length>0&&(G.tags=J);let Cr=o.insertTextMode??x;return Cr!==void 0&&(G.insertTextMode=Cr,Cr===M.InsertTextMode.asIs&&(G.keepWhitespace=!0)),G}function st(o){return M.CompletionItemLabelDetails.is(o.labelDetails)?{label:o.label,detail:o.labelDetails.detail,description:o.labelDetails.description}:o.label}function It(o,m,D){let x=o.insertTextFormat??D;if(o.textEdit!==void 0||m!==void 0){let[he,ye]=o.textEdit!==void 0?Et(o.textEdit):[m,o.textEditText??o.label];return x===M.InsertTextFormat.Snippet?{text:new k.SnippetString(ye),range:he,fromEdit:!0}:{text:ye,range:he,fromEdit:!0}}else return o.insertText?x===M.InsertTextFormat.Snippet?{text:new k.SnippetString(o.insertText),fromEdit:!1}:{text:o.insertText,fromEdit:!1}:void 0}function Et(o){return M.InsertReplaceEdit.is(o)?[{inserting:p(o.insert),replacing:p(o.replace)},o.newText]:[p(o.range),o.newText]}function ot(o){if(o)return new k.TextEdit(p(o.range),o.newText)}async function at(o,m){if(o)return $.map(o,ot,m)}function Le(o){if(!o)return;let m=new Array(o.length);for(let D=0;D<o.length;D++)m[D]=ot(o[D]);return m}async function rr(o,m){if(!o)return;let D=new k.SignatureHelp;return Ee.number(o.activeSignature)?D.activeSignature=o.activeSignature:D.activeSignature=0,Ee.number(o.activeParameter)?D.activeParameter=o.activeParameter:D.activeParameter=0,o.signatures&&(D.signatures=await En(o.signatures,m)),D}async function En(o,m){return $.mapAsync(o,pe,m)}async function pe(o,m){let D=new k.SignatureInformation(o.label);return o.documentation!==void 0&&(D.documentation=T(o.documentation)),o.parameters!==void 0&&(D.parameters=await Mn(o.parameters,m)),o.activeParameter!==void 0&&(D.activeParameter=o.activeParameter),D}function Mn(o,m){return $.map(o,ct,m)}function ct(o){let m=new k.ParameterInformation(o.label);return o.documentation&&(m.documentation=T(o.documentation)),m}function Ge(o){return o?new k.Location(i(o.uri),p(o.range)):void 0}async function sr(o,m){if(o)return Ln(o,m)}async function An(o,m){if(o)return Ln(o,m)}function On(o){if(!o)return;let m={targetUri:i(o.targetUri),targetRange:p(o.targetRange),originSelectionRange:p(o.originSelectionRange),targetSelectionRange:p(o.targetSelectionRange)};if(!m.targetSelectionRange)throw new Error("targetSelectionRange must not be undefined or null");return m}async function Ln(o,m){if(o)if(Ee.array(o)){if(o.length===0)return[];if(M.LocationLink.is(o[0])){let D=o;return $.map(D,On,m)}else{let D=o;return $.map(D,Ge,m)}}else return M.LocationLink.is(o)?[On(o)]:Ge(o)}async function or(o,m){if(o)return $.map(o,Ge,m)}async function Zt(o,m){if(o)return $.map(o,Mt,m)}function Mt(o){let m=new k.DocumentHighlight(p(o.range));return Ee.number(o.kind)&&(m.kind=At(o.kind)),m}function At(o){switch(o){case M.DocumentHighlightKind.Text:return k.DocumentHighlightKind.Text;case M.DocumentHighlightKind.Read:return k.DocumentHighlightKind.Read;case M.DocumentHighlightKind.Write:return k.DocumentHighlightKind.Write}return k.DocumentHighlightKind.Text}async function ar(o,m){if(o)return $.map(o,Nn,m)}function dt(o){return o<=M.SymbolKind.TypeParameter?o-1:k.SymbolKind.Property}function Un(o){if(o===M.SymbolTag.Deprecated)return k.SymbolTag.Deprecated}function Ot(o){if(o==null)return;let m=[];for(let D of o){let x=Un(D);x!==void 0&&m.push(x)}return m.length===0?void 0:m}function Nn(o){let m=o.data,D=o.location,x=D.range===void 0||m!==void 0?new yu.default(o.name,dt(o.kind),o.containerName??"",D.range===void 0?i(D.uri):new k.Location(i(o.location.uri),p(D.range)),m):new k.SymbolInformation(o.name,dt(o.kind),o.containerName??"",new k.Location(i(o.location.uri),p(D.range)));return en(x,o),x}async function cr(o,m){if(o!=null)return $.map(o,Xt,m)}function Xt(o){let m=new k.DocumentSymbol(o.name,o.detail||"",dt(o.kind),p(o.range),p(o.selectionRange));if(en(m,o),o.children!==void 0&&o.children.length>0){let D=[];for(let x of o.children)D.push(Xt(x));m.children=D}return m}function en(o,m){o.tags=Ot(m.tags),m.deprecated&&(o.tags?o.tags.includes(k.SymbolTag.Deprecated)||(o.tags=o.tags.concat(k.SymbolTag.Deprecated)):o.tags=[k.SymbolTag.Deprecated])}function Ue(o){let m={title:o.title,command:o.command};return o.arguments&&(m.arguments=o.arguments),m}async function wt(o,m){if(o)return $.map(o,Ue,m)}let qe=new Map;qe.set(M.CodeActionKind.Empty,k.CodeActionKind.Empty),qe.set(M.CodeActionKind.QuickFix,k.CodeActionKind.QuickFix),qe.set(M.CodeActionKind.Refactor,k.CodeActionKind.Refactor),qe.set(M.CodeActionKind.RefactorExtract,k.CodeActionKind.RefactorExtract),qe.set(M.CodeActionKind.RefactorInline,k.CodeActionKind.RefactorInline),qe.set(M.CodeActionKind.RefactorRewrite,k.CodeActionKind.RefactorRewrite),qe.set(M.CodeActionKind.Source,k.CodeActionKind.Source),qe.set(M.CodeActionKind.SourceOrganizeImports,k.CodeActionKind.SourceOrganizeImports);function ut(o){if(o==null)return;let m=qe.get(o);if(m)return m;let D=o.split(".");m=k.CodeActionKind.Empty;for(let x of D)m=m.append(x);return m}function dr(o){if(o!=null)return o.map(m=>ut(m))}async function Hn(o,m){if(o==null)return;let D=new gu.default(o.title,o.data);return o.kind!==void 0&&(D.kind=ut(o.kind)),o.diagnostics!==void 0&&(D.diagnostics=d(o.diagnostics)),o.edit!==void 0&&(D.edit=await tn(o.edit,m)),o.command!==void 0&&(D.command=Ue(o.command)),o.isPreferred!==void 0&&(D.isPreferred=o.isPreferred),o.disabled!==void 0&&(D.disabled={reason:o.disabled.reason}),D}function ur(o,m){return $.mapAsync(o,async D=>M.Command.is(D)?Ue(D):Hn(D,m),m)}function Kn(o){if(!o)return;let m=new fu.default(p(o.range));return o.command&&(m.command=Ue(o.command)),o.data!==void 0&&o.data!==null&&(m.data=o.data),m}async function lr(o,m){if(o)return $.map(o,Kn,m)}async function tn(o,m){if(!o)return;let D=new Map;if(o.changeAnnotations!==void 0){let ye=o.changeAnnotations;await $.forEach(Object.keys(ye),J=>{let $e=jn(ye[J]);D.set(J,$e)},m)}let x=ye=>{if(ye!==void 0)return D.get(ye)},he=new k.WorkspaceEdit;if(o.documentChanges){let ye=o.documentChanges;await $.forEach(ye,J=>{if(M.CreateFile.is(J))he.createFile(i(J.uri),J.options,x(J.annotationId));else if(M.RenameFile.is(J))he.renameFile(i(J.oldUri),i(J.newUri),J.options,x(J.annotationId));else if(M.DeleteFile.is(J))he.deleteFile(i(J.uri),J.options,x(J.annotationId));else if(M.TextDocumentEdit.is(J)){let $e=i(J.textDocument.uri);for(let G of J.edits)M.AnnotatedTextEdit.is(G)?he.replace($e,p(G.range),G.newText,x(G.annotationId)):he.replace($e,p(G.range),G.newText)}else throw new Error(`Unknown workspace edit change received:
6
- ${JSON.stringify(J,void 0,4)}`)},m)}else if(o.changes){let ye=o.changes;await $.forEach(Object.keys(ye),J=>{he.set(i(J),Le(ye[J]))},m)}return he}function jn(o){if(o!==void 0)return{label:o.label,needsConfirmation:!!o.needsConfirmation,description:o.description}}function Wn(o){let m=p(o.range),D=o.target?r(o.target):void 0,x=new hu.default(m,D);return o.tooltip!==void 0&&(x.tooltip=o.tooltip),o.data!==void 0&&o.data!==null&&(x.data=o.data),x}async function pr(o,m){if(o)return $.map(o,Wn,m)}function Ze(o){return new k.Color(o.red,o.green,o.blue,o.alpha)}function $n(o){return new k.ColorInformation(p(o.range),Ze(o.color))}async function fr(o,m){if(o)return $.map(o,$n,m)}function zn(o){let m=new k.ColorPresentation(o.label);return m.additionalTextEdits=Le(o.additionalTextEdits),o.textEdit&&(m.textEdit=ot(o.textEdit)),m}async function hr(o,m){if(o)return $.map(o,zn,m)}function Vn(o){if(o)switch(o){case M.FoldingRangeKind.Comment:return k.FoldingRangeKind.Comment;case M.FoldingRangeKind.Imports:return k.FoldingRangeKind.Imports;case M.FoldingRangeKind.Region:return k.FoldingRangeKind.Region}}function Bn(o){return new k.FoldingRange(o.startLine,o.endLine,Vn(o.kind))}async function gr(o,m){if(o)return $.map(o,Bn,m)}function nn(o){return new k.SelectionRange(p(o.range),o.parent?nn(o.parent):void 0)}async function mr(o,m){return Array.isArray(o)?$.map(o,nn,m):[]}function Yn(o){return M.InlineValueText.is(o)?new k.InlineValueText(p(o.range),o.text):M.InlineValueVariableLookup.is(o)?new k.InlineValueVariableLookup(p(o.range),o.variableName,o.caseSensitiveLookup):new k.InlineValueEvaluatableExpression(p(o.range),o.expression)}async function vr(o,m){return Array.isArray(o)?$.map(o,Yn,m):[]}async function rn(o,m){let D=typeof o.label=="string"?o.label:await $.map(o.label,u,m),x=new Cu.default(v(o.position),D);return o.kind!==void 0&&(x.kind=o.kind),o.textEdits!==void 0&&(x.textEdits=await at(o.textEdits,m)),o.tooltip!==void 0&&(x.tooltip=w(o.tooltip)),o.paddingLeft!==void 0&&(x.paddingLeft=o.paddingLeft),o.paddingRight!==void 0&&(x.paddingRight=o.paddingRight),o.data!==void 0&&(x.data=o.data),x}function u(o){let m=new k.InlayHintLabelPart(o.value);return o.location!==void 0&&(m.location=Ge(o.location)),o.tooltip!==void 0&&(m.tooltip=w(o.tooltip)),o.command!==void 0&&(m.command=Ue(o.command)),m}function w(o){return typeof o=="string"?o:P(o)}async function R(o,m){if(Array.isArray(o))return $.mapAsync(o,rn,m)}function B(o){if(o===null)return;let m=new mu.default(dt(o.kind),o.name,o.detail||"",r(o.uri),p(o.range),p(o.selectionRange),o.data);return o.tags!==void 0&&(m.tags=Ot(o.tags)),m}async function Q(o,m){if(o!==null)return $.map(o,B,m)}async function fe(o,m){return new k.CallHierarchyIncomingCall(B(o.from),await y(o.fromRanges,m))}async function ke(o,m){if(o!==null)return $.mapAsync(o,fe,m)}async function We(o,m){return new k.CallHierarchyOutgoingCall(B(o.to),await y(o.fromRanges,m))}async function Dd(o,m){if(o!==null)return $.mapAsync(o,We,m)}async function Sd(o,m){if(o!=null)return new k.SemanticTokens(new Uint32Array(o.data),o.resultId)}function Sa(o){return new k.SemanticTokensEdit(o.start,o.deleteCount,o.data!==void 0?new Uint32Array(o.data):void 0)}async function bd(o,m){if(o!=null)return new k.SemanticTokensEdits(o.edits.map(Sa),o.resultId)}function _d(o){return o}async function Td(o,m){if(o!=null)return new k.LinkedEditingRanges(await y(o.ranges,m),kd(o.wordPattern))}function kd(o){if(o!=null)return new RegExp(o)}function ba(o){if(o===null)return;let m=new vu.default(dt(o.kind),o.name,o.detail||"",r(o.uri),p(o.range),p(o.selectionRange),o.data);return o.tags!==void 0&&(m.tags=Ot(o.tags)),m}async function Pd(o,m){if(o!==null)return $.map(o,ba,m)}function Rd(o){if(Ee.string(o))return o;if(M.RelativePattern.is(o)){if(M.URI.is(o.baseUri))return new k.RelativePattern(r(o.baseUri),o.pattern);if(M.WorkspaceFolder.is(o.baseUri)){let m=k.workspace.getWorkspaceFolder(r(o.baseUri.uri));return m!==void 0?new k.RelativePattern(m,o.pattern):void 0}}}async function xd(o,m){if(!o)return;if(Array.isArray(o))return $.map(o,he=>yr(he),m);let D=o,x=await $.map(D.items,he=>yr(he),m);return new k.InlineCompletionList(x)}function yr(o){let m;typeof o.insertText=="string"?m=o.insertText:m=new k.SnippetString(o.insertText.value);let D;o.command&&(D=Ue(o.command));let x=new k.InlineCompletionItem(m,p(o.range),D);return o.filterText&&(x.filterText=o.filterText),x}return{asUri:r,asDocumentSelector:s,asDiagnostics:c,asDiagnostic:l,asRange:p,asRanges:y,asPosition:v,asDiagnosticSeverity:C,asDiagnosticTag:f,asHover:q,asCompletionResult:ce,asCompletionItem:Qe,asTextEdit:ot,asTextEdits:at,asSignatureHelp:rr,asSignatureInformations:En,asSignatureInformation:pe,asParameterInformations:Mn,asParameterInformation:ct,asDeclarationResult:sr,asDefinitionResult:An,asLocation:Ge,asReferences:or,asDocumentHighlights:Zt,asDocumentHighlight:Mt,asDocumentHighlightKind:At,asSymbolKind:dt,asSymbolTag:Un,asSymbolTags:Ot,asSymbolInformations:ar,asSymbolInformation:Nn,asDocumentSymbols:cr,asDocumentSymbol:Xt,asCommand:Ue,asCommands:wt,asCodeAction:Hn,asCodeActionKind:ut,asCodeActionKinds:dr,asCodeActionResult:ur,asCodeLens:Kn,asCodeLenses:lr,asWorkspaceEdit:tn,asDocumentLink:Wn,asDocumentLinks:pr,asFoldingRangeKind:Vn,asFoldingRange:Bn,asFoldingRanges:gr,asColor:Ze,asColorInformation:$n,asColorInformations:fr,asColorPresentation:zn,asColorPresentations:hr,asSelectionRange:nn,asSelectionRanges:mr,asInlineValue:Yn,asInlineValues:vr,asInlayHint:rn,asInlayHints:R,asSemanticTokensLegend:_d,asSemanticTokens:Sd,asSemanticTokensEdit:Sa,asSemanticTokensEdits:bd,asCallHierarchyItem:B,asCallHierarchyItems:Q,asCallHierarchyIncomingCall:fe,asCallHierarchyIncomingCalls:ke,asCallHierarchyOutgoingCall:We,asCallHierarchyOutgoingCalls:Dd,asLinkedEditingRanges:Td,asTypeHierarchyItem:ba,asTypeHierarchyItems:Pd,asGlobPattern:Rd,asInlineCompletionResult:xd,asInlineCompletionItem:yr}}ui.createConverter=wu});var te=F(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.generateUuid=Me.parse=Me.isUUID=Me.v4=Me.empty=void 0;var un=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ln=class a extends un{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return a._oneOf(a._chars)}constructor(){super([a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),"-",a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),"-","4",a._randomHex(),a._randomHex(),a._randomHex(),"-",a._oneOf(a._timeHighBits),a._randomHex(),a._randomHex(),a._randomHex(),"-",a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex(),a._randomHex()].join(""))}};ln._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ln._timeHighBits=["8","9","a","b"];Me.empty=new un("00000000-0000-0000-0000-000000000000");function Ga(){return new ln}Me.v4=Ga;var Du=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Za(a){return Du.test(a)}Me.isUUID=Za;function Su(a){if(!Za(a))throw new Error("invalid uuid");return new un(a)}Me.parse=Su;function bu(){return Ga().asHex()}Me.generateUuid=bu});var fs=F(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.ProgressPart=void 0;var Xa=I("vscode"),ec=L(),tc=Ie(),ps=class{constructor(e,t,n){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(ec.WorkDoneProgress.type,this._token,i=>{switch(i.kind){case"begin":this.begin(i);break;case"report":this.report(i);break;case"end":this.done(),n&&n(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&Xa.window.withProgress({location:Xa.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,n)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=n,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(ec.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((i,r)=>{this._resolve=i,this._reject=r})})}report(e){if(this._infinite&&tc.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(tc.number(e.percentage)){let t=Math.max(0,Math.min(e.percentage,100)),n=Math.max(0,t-this._reported);this._reported+=n,this._progress!==void 0&&this._progress.report({message:e.message,increment:n})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}};li.ProgressPart=ps});var W=F(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.WorkspaceFeature=ge.TextDocumentLanguageFeature=ge.TextDocumentEventFeature=ge.DynamicDocumentFeature=ge.DynamicFeature=ge.StaticFeature=ge.ensure=ge.LSPCancellationError=void 0;var bt=I("vscode"),hs=L(),Se=Ie(),nc=te(),gs=class extends bt.CancellationError{constructor(e){super(),this.data=e}};ge.LSPCancellationError=gs;function _u(a,e){return a[e]===void 0&&(a[e]={}),a[e]}ge.ensure=_u;var ic;(function(a){function e(t){let n=t;return n!=null&&Se.func(n.fillClientCapabilities)&&Se.func(n.initialize)&&Se.func(n.getState)&&Se.func(n.clear)&&(n.fillInitializeParams===void 0||Se.func(n.fillInitializeParams))}a.is=e})(ic||(ge.StaticFeature=ic={}));var rc;(function(a){function e(t){let n=t;return n!=null&&Se.func(n.fillClientCapabilities)&&Se.func(n.initialize)&&Se.func(n.getState)&&Se.func(n.clear)&&(n.fillInitializeParams===void 0||Se.func(n.fillInitializeParams))&&Se.func(n.register)&&Se.func(n.unregister)&&n.registrationType!==void 0}a.is=e})(rc||(ge.DynamicFeature=rc={}));var pn=class{constructor(e){this._client=e}getState(){let e=this.getDocumentSelectors(),t=0;for(let i of e){t++;for(let r of bt.workspace.textDocuments)if(bt.languages.match(i,r)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}let n=t>0;return{kind:"document",id:this.registrationType.method,registrations:n,matches:!1}}};ge.DynamicDocumentFeature=pn;var ms=class extends pn{static textDocumentFilter(e,t){for(let n of e)if(bt.languages.match(n,t)>0)return!0;return!1}constructor(e,t,n,i,r,s,c){super(e),this._event=t,this._type=n,this._middleware=i,this._createParams=r,this._textDocument=s,this._selectorFilter=c,this._selectors=new Map,this._onNotificationSent=new bt.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(n=>{this._client.error(`Sending document notification ${this._type.method} failed.`,n)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){let t=async n=>{let i=this._createParams(n);await this._client.sendNotification(this._type,i),this.notificationSent(this.getTextDocument(n),this._type,i)};if(this.matches(e)){let n=this._middleware();return n?n(e,i=>t(i)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._selectors.values())if(bt.languages.match(t,e)>0)return{send:n=>this.callback(n)}}};ge.TextDocumentEventFeature=ms;var vs=class extends pn{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(let e of this._registrations.values()){let t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(hs.TextDocumentRegistrationOptions.is(t)){let n=hs.StaticRegistrationOptions.hasId(t)?t.id:nc.generateUuid(),i=t.documentSelector??e;if(i)return[n,Object.assign({},t,{documentSelector:i})]}else if(Se.boolean(t)&&t===!0||hs.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let n=Se.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[nc.generateUuid(),n]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Se.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(let t of this._registrations.values()){let n=t.data.registerOptions.documentSelector;if(n!==null&&bt.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(n),e)>0)return t.provider}}getAllProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}};ge.TextDocumentLanguageFeature=vs;var ys=class{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){let e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){let t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}};ge.WorkspaceFeature=ys});var ks=F(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.DiagnosticFeature=ft.DiagnosticPullMode=ft.vsdiag=void 0;var Tu=Dr(),H=I("vscode"),ae=L(),ku=te(),Cs=W();function pi(a,e){return a[e]===void 0&&(a[e]={}),a[e]}var Ae;(function(a){let e;(function(t){t.full="full",t.unChanged="unChanged"})(e=a.DocumentDiagnosticReportKind||(a.DocumentDiagnosticReportKind={}))})(Ae||(ft.vsdiag=Ae={}));var fi;(function(a){a.onType="onType",a.onSave="onSave"})(fi||(ft.DiagnosticPullMode=fi={}));var we;(function(a){a.active="open",a.reschedule="reschedule",a.outDated="drop"})(we||(we={}));var ws=class a{constructor(){this.open=new Set,this._onOpen=new H.EventEmitter,this._onClose=new H.EventEmitter,a.fillTabResources(this.open);let e=t=>{if(t.closed.length===0&&t.opened.length===0)return;let n=this.open,i=new Set;a.fillTabResources(i);let r=new Set,s=new Set(i);for(let c of n.values())i.has(c)?s.delete(c):r.add(c);if(this.open=i,r.size>0){let c=new Set;for(let d of r)c.add(H.Uri.parse(d));this._onClose.fire(c)}if(s.size>0){let c=new Set;for(let d of s)c.add(H.Uri.parse(d));this._onOpen.fire(c)}};H.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=H.window.tabGroups.onDidChangeTabs(e):this.disposable={dispose:()=>{}}}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof H.Uri?H.window.activeTextEditor?.document.uri===e:H.window.activeTextEditor?.document===e}isVisible(e){let t=e instanceof H.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){let e=new Set;return a.fillTabResources(new Set,e),e}static fillTabResources(e,t){let n=e??new Set;for(let i of H.window.tabGroups.all)for(let r of i.tabs){let s=r.input,c;s instanceof H.TabInputText?c=s.uri:s instanceof H.TabInputTextDiff?c=s.modified:s instanceof H.TabInputCustom&&(c=s.uri),c!==void 0&&!n.has(c.toString())&&(n.add(c.toString()),t!==void 0&&t.add(c))}}},le;(function(a){a[a.document=1]="document",a[a.workspace=2]="workspace"})(le||(le={}));var Xe;(function(a){function e(t){return t instanceof H.Uri?t.toString():t.uri.toString()}a.asKey=e})(Xe||(Xe={}));var Ds=class{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,n){let i=e===le.document?this.documentPullStates:this.workspacePullStates,[r,s,c]=t instanceof H.Uri?[t.toString(),t,n]:[t.uri.toString(),t.uri,t.version],d=i.get(r);return d===void 0&&(d={document:s,pulledVersion:c,resultId:void 0},i.set(r,d)),d}update(e,t,n,i){let r=e===le.document?this.documentPullStates:this.workspacePullStates,[s,c,d,l]=t instanceof H.Uri?[t.toString(),t,n,i]:[t.uri.toString(),t.uri,t.version,n],g=r.get(s);g===void 0?(g={document:c,pulledVersion:d,resultId:l},r.set(s,g)):(g.pulledVersion=d,g.resultId=l)}unTrack(e,t){let n=Xe.asKey(t);(e===le.document?this.documentPullStates:this.workspacePullStates).delete(n)}tracks(e,t){let n=Xe.asKey(t);return(e===le.document?this.documentPullStates:this.workspacePullStates).has(n)}getResultId(e,t){let n=Xe.asKey(t);return(e===le.document?this.documentPullStates:this.workspacePullStates).get(n)?.resultId}getAllResultIds(){let e=[];for(let[t,n]of this.workspacePullStates)this.documentPullStates.has(t)&&(n=this.documentPullStates.get(t)),n.resultId!==void 0&&e.push({uri:t,value:n.resultId});return e}},Ss=class{constructor(e,t,n){this.client=e,this.tabs=t,this.options=n,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new H.EventEmitter,this.provider=this.createProvider(),this.diagnostics=H.languages.createDiagnosticCollection(n.identifier),this.openRequests=new Map,this.documentStates=new Ds,this.workspaceErrorCounter=0}knows(e,t){let n=t instanceof H.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(n.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;let n=e instanceof H.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},i=>{this.client.error(`Document pull failed for text document ${n.toString()}`,i,!1)})}async pullAsync(e,t){if(this.isDisposed)return;let n=e instanceof H.Uri,i=n?e:e.uri,r=i.toString();t=n?t:e.version;let s=this.openRequests.get(r),c=n?this.documentStates.track(le.document,e,t):this.documentStates.track(le.document,e);if(s===void 0){let d=new H.CancellationTokenSource;this.openRequests.set(r,{state:we.active,document:e,version:t,tokenSource:d});let l,g;try{l=await this.provider.provideDiagnostics(e,c.resultId,d.token)??{kind:Ae.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof Cs.LSPCancellationError&&ae.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(g={state:we.outDated,document:e}),g===void 0&&h instanceof H.CancellationError)g={state:we.reschedule,document:e};else throw h}if(g=g??this.openRequests.get(r),g===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${r}`),this.diagnostics.delete(i);return}if(this.openRequests.delete(r),!this.tabs.isVisible(e)){this.documentStates.unTrack(le.document,e);return}if(g.state===we.outDated)return;l!==void 0&&(l.kind===Ae.DocumentDiagnosticReportKind.full&&this.diagnostics.set(i,l.items),c.pulledVersion=t,c.resultId=l.resultId),g.state===we.reschedule&&this.pull(e)}else s.state===we.active?(s.tokenSource.cancel(),this.openRequests.set(r,{state:we.reschedule,document:s.document})):s.state===we.outDated&&this.openRequests.set(r,{state:we.reschedule,document:s.document})}forgetDocument(e){let t=e instanceof H.Uri?e:e.uri,n=t.toString(),i=this.openRequests.get(n);this.options.workspaceDiagnostics?i!==void 0?this.openRequests.set(n,{state:we.reschedule,document:e}):this.pull(e,()=>{this.forget(le.document,e)}):(i!==void 0&&(i.state===we.active&&i.tokenSource.cancel(),this.openRequests.set(n,{state:we.outDated,document:e})),this.diagnostics.delete(t),this.forget(le.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,ae.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof Cs.LSPCancellationError)&&!ae.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,ae.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new H.CancellationTokenSource;let e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(let n of t.items)n.kind===Ae.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(le.document,n.uri)||this.diagnostics.set(n.uri,n.items)),this.documentStates.update(le.workspace,n.uri,n.version??void 0,n.resultId)})}createProvider(){let e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,n,i)=>{let r=(c,d,l)=>{let g={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(c instanceof H.Uri?c:c.uri)},previousResultId:d};return this.isDisposed===!0||!this.client.isRunning()?{kind:Ae.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(ae.DocumentDiagnosticRequest.type,g,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Ae.DocumentDiagnosticReportKind.full,items:[]}:h.kind===ae.DocumentDiagnosticReportKind.Full?{kind:Ae.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Ae.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(ae.DocumentDiagnosticRequest.type,l,h,{kind:Ae.DocumentDiagnosticReportKind.full,items:[]}))},s=this.client.middleware;return s.provideDiagnostics?s.provideDiagnostics(t,n,i,r):r(t,n,i)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,n,i)=>{let r=async l=>l.kind===ae.DocumentDiagnosticReportKind.Full?{kind:Ae.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,n)}:{kind:Ae.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},s=l=>{let g=[];for(let h of l)g.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return g},c=(l,g)=>{let h=(0,ku.generateUuid)(),f=this.client.onProgress(ae.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){i(null);return}let y={items:[]};for(let C of p.items)try{y.items.push(await r(C))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}i(y)}),v={identifier:this.options.identifier,previousResultIds:s(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(ae.WorkspaceDiagnosticRequest.type,v,g).then(async p=>{if(g.isCancellationRequested)return{items:[]};let y={items:[]};for(let C of p.items)y.items.push(await r(C));return f.dispose(),i(y),{items:[]}},p=>(f.dispose(),this.client.handleFailedRequest(ae.DocumentDiagnosticRequest.type,g,p,{items:[]})))},d=this.client.middleware;return d.provideWorkspaceDiagnostics?d.provideWorkspaceDiagnostics(t,n,i,c):c(t,n,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(let[e,t]of this.openRequests)t.state===we.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:we.outDated,document:t.document});this.diagnostics.dispose()}},bs=class{constructor(e){this.diagnosticRequestor=e,this.documents=new ae.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;let t=Xe.asKey(e);this.documents.has(t)||(this.documents.set(t,e,ae.Touch.Last),this.trigger())}remove(e){let t=Xe.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,ae.RAL)().timer.setInterval(()=>{let e=this.documents.first;if(e!==void 0){let t=Xe.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,ae.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument!==void 0?Xe.asKey(this.endDocument):void 0}},_s=class{constructor(e,t,n){let i=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},r=e.protocol2CodeConverter.asDocumentSelector(n.documentSelector),s=[],c=p=>{let y=n.documentSelector;if(i.match!==void 0)return i.match(y,p);for(let C of y)if(ae.TextDocumentFilter.is(C)){if(typeof C=="string"||C.language!==void 0&&C.language!=="*"||C.scheme!==void 0&&C.scheme!=="*"&&C.scheme!==p.scheme)return!1;if(C.pattern!==void 0){let b=new Tu.Minimatch(C.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},d=p=>p instanceof H.Uri?c(p):H.languages.match(r,p)>0&&t.isVisible(p),l=p=>p instanceof H.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new Ss(e,t,n),this.backgroundScheduler=new bs(this.diagnosticRequestor);let g=p=>{!d(p)||!n.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=H.window.activeTextEditor?.document,H.window.onDidChangeActiveTextEditor(p=>{let y=this.activeTextDocument;this.activeTextDocument=p?.document,y!==void 0&&g(y),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});let h=e.getFeature(ae.DidOpenTextDocumentNotification.method);s.push(h.onNotificationSent(p=>{let y=p.textDocument;this.diagnosticRequestor.knows(le.document,y)||d(y)&&this.diagnosticRequestor.pull(y,()=>{g(y)})})),s.push(t.onOpen(p=>{for(let y of p){if(this.diagnosticRequestor.knows(le.document,y))continue;let C=y.toString(),b;for(let T of H.workspace.textDocuments)if(C===T.uri.toString()){b=T;break}b!==void 0&&d(b)&&this.diagnosticRequestor.pull(b,()=>{g(b)})}}));let f=new Set;for(let p of H.workspace.textDocuments)d(p)&&(this.diagnosticRequestor.pull(p,()=>{g(p)}),f.add(p.uri.toString()));if(i.onTabs===!0)for(let p of t.getTabResources())!f.has(p.toString())&&d(p)&&this.diagnosticRequestor.pull(p,()=>{g(p)});if(i.onChange===!0){let p=e.getFeature(ae.DidChangeTextDocumentNotification.method);s.push(p.onNotificationSent(async y=>{let C=y.textDocument;(i.filter===void 0||!i.filter(C,fi.onType))&&this.diagnosticRequestor.knows(le.document,C)&&this.diagnosticRequestor.pull(C,()=>{this.backgroundScheduler.trigger()})}))}if(i.onSave===!0){let p=e.getFeature(ae.DidSaveTextDocumentNotification.method);s.push(p.onNotificationSent(y=>{let C=y.textDocument;(i.filter===void 0||!i.filter(C,fi.onSave))&&this.diagnosticRequestor.knows(le.document,C)&&this.diagnosticRequestor.pull(y.textDocument,()=>{this.backgroundScheduler.trigger()})}))}let v=e.getFeature(ae.DidCloseTextDocumentNotification.method);s.push(v.onNotificationSent(p=>{this.cleanUpDocument(p.textDocument)})),t.onClose(p=>{for(let y of p)this.cleanUpDocument(y)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(let p of H.workspace.textDocuments)d(p)&&this.diagnosticRequestor.pull(p)}),n.workspaceDiagnostics===!0&&n.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=H.Disposable.from(...s,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(le.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}},Ts=class extends Cs.TextDocumentLanguageFeature{constructor(e){super(e,ae.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=pi(pi(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,pi(pi(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(ae.DiagnosticRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeDiagnosticsEmitter.fire()});let[i,r]=this.getRegistration(t,e.diagnosticProvider);!i||!r||this.register({id:i,registerOptions:r})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new ws);let t=new _s(this._client,this.tabs,e);return[t.disposable,t]}};ft.DiagnosticFeature=Ts});var ac=F(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.NotebookDocumentSyncFeature=void 0;var De=I("vscode"),Pu=Dr(),et=L(),Ru=te(),sc=Ie();function oc(a,e){return a[e]===void 0&&(a[e]={}),a[e]}var Kt;(function(a){let e;(function(t){function n(f,v){return{version:f.version,uri:v.asUri(f.uri)}}t.asVersionedNotebookDocumentIdentifier=n;function i(f,v,p){let y=et.NotebookDocument.create(p.asUri(f.uri),f.notebookType,f.version,r(v,p));return Object.keys(f.metadata).length>0&&(y.metadata=s(f.metadata)),y}t.asNotebookDocument=i;function r(f,v){return f.map(p=>c(p,v))}t.asNotebookCells=r;function s(f){return l(new Set,f)}t.asMetadata=s;function c(f,v){let p=et.NotebookCell.create(d(f.kind),v.asUri(f.document.uri));return Object.keys(f.metadata).length>0&&(p.metadata=s(f.metadata)),f.executionSummary!==void 0&&sc.number(f.executionSummary.executionOrder)&&sc.boolean(f.executionSummary.success)&&(p.executionSummary={executionOrder:f.executionSummary.executionOrder,success:f.executionSummary.success}),p}t.asNotebookCell=c;function d(f){switch(f){case De.NotebookCellKind.Markup:return et.NotebookCellKind.Markup;case De.NotebookCellKind.Code:return et.NotebookCellKind.Code}}function l(f,v){if(f.has(v))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(v)){let p=[];for(let y of v)if(y!==null&&typeof y=="object"||Array.isArray(y))p.push(l(f,y));else{if(y instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");p.push(y)}return p}else{let p=Object.keys(v),y=Object.create(null);for(let C of p){let b=v[C];if(b!==null&&typeof b=="object"||Array.isArray(b))y[C]=l(f,b);else{if(b instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");y[C]=b}}return y}}function g(f,v){let p=v.asChangeTextDocumentParams(f,f.document.uri,f.document.version);return{document:p.textDocument,changes:p.contentChanges}}t.asTextContentChange=g;function h(f,v){let p=Object.create(null);if(f.metadata&&(p.metadata=a.c2p.asMetadata(f.metadata)),f.cells!==void 0){let y=Object.create(null),C=f.cells;C.structure&&(y.structure={array:{start:C.structure.array.start,deleteCount:C.structure.array.deleteCount,cells:C.structure.array.cells!==void 0?C.structure.array.cells.map(b=>a.c2p.asNotebookCell(b,v)):void 0},didOpen:C.structure.didOpen!==void 0?C.structure.didOpen.map(b=>v.asOpenTextDocumentParams(b.document).textDocument):void 0,didClose:C.structure.didClose!==void 0?C.structure.didClose.map(b=>v.asCloseTextDocumentParams(b.document).textDocument):void 0}),C.data!==void 0&&(y.data=C.data.map(b=>a.c2p.asNotebookCell(b,v))),C.textContent!==void 0&&(y.textContent=C.textContent.map(b=>a.c2p.asTextContentChange(b,v))),Object.keys(y).length>0&&(p.cells=y)}return p}t.asNotebookDocumentChangeEvent=h})(e=a.c2p||(a.c2p={}))})(Kt||(Kt={}));var Ps;(function(a){function e(c,d,l){let g=c.length,h=d.length,f=0;for(;f<h&&f<g&&t(c[f],d[f],l);)f++;if(f<h&&f<g){let v=g-1,p=h-1;for(;v>=0&&p>=0&&t(c[v],d[p],l);)v--,p--;let y=v+1-f,C=f===p+1?void 0:d.slice(f,p+1);return C!==void 0?{start:f,deleteCount:y,cells:C}:{start:f,deleteCount:y}}else return f<h?{start:f,deleteCount:0,cells:d.slice(f)}:f<g?{start:f,deleteCount:g-f}:void 0}a.computeDiff=e;function t(c,d,l=!0){return c.kind!==d.kind||c.document.uri.toString()!==d.document.uri.toString()||c.document.languageId!==d.document.languageId||!n(c.executionSummary,d.executionSummary)?!1:!l||l&&r(c.metadata,d.metadata)}function n(c,d){return c===d?!0:c===void 0||d===void 0?!1:c.executionOrder===d.executionOrder&&c.success===d.success&&i(c.timing,d.timing)}function i(c,d){return c===d?!0:c===void 0||d===void 0?!1:c.startTime===d.startTime&&c.endTime===d.endTime}function r(c,d){if(c===d)return!0;if(c==null||d===null||d===void 0||typeof c!=typeof d||typeof c!="object")return!1;let l=Array.isArray(c),g=Array.isArray(d);if(l!==g)return!1;if(l&&g){if(c.length!==d.length)return!1;for(let h=0;h<c.length;h++)if(!r(c[h],d[h]))return!1}if(s(c)&&s(d)){let h=Object.keys(c),f=Object.keys(d);if(h.length!==f.length||(h.sort(),f.sort(),!r(h,f)))return!1;for(let v=0;v<h.length;v++){let p=h[v];if(!r(c[p],d[p]))return!1}return!0}return!1}function s(c){return c!==null&&typeof c=="object"}a.isObjectLiteral=s})(Ps||(Ps={}));var Rs;(function(a){function e(t,n){if(typeof t=="string")return t==="*"||n.notebookType===t;if(t.notebookType!==void 0&&t.notebookType!=="*"&&n.notebookType!==t.notebookType)return!1;let i=n.uri;if(t.scheme!==void 0&&t.scheme!=="*"&&i.scheme!==t.scheme)return!1;if(t.pattern!==void 0){let r=new Pu.Minimatch(t.pattern,{noext:!0});if(!r.makeRe()||!r.match(i.fsPath))return!1}return!0}a.matchNotebook=e})(Rs||(Rs={}));var hi;(function(a){function e(n){let i=n.notebookSelector,r=[];for(let s of i){let c=(typeof s.notebook=="string"?s.notebook:s.notebook?.notebookType)??"*",d=typeof s.notebook=="string"?void 0:s.notebook?.scheme,l=typeof s.notebook=="string"?void 0:s.notebook?.pattern;if(s.cells!==void 0)for(let g of s.cells)r.push(t(c,d,l,g.language));else r.push(t(c,d,l,void 0))}return r}a.asDocumentSelector=e;function t(n,i,r,s){return i===void 0&&r===void 0?{notebook:n,language:s}:{notebook:{notebookType:n,scheme:i,pattern:r},language:s}}})(hi||(hi={}));var gi;(function(a){function e(t){return{cells:t,uris:new Set(t.map(n=>n.document.uri.toString()))}}a.create=e})(gi||(gi={}));var jt=class{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(hi.asDocumentSelector(t)),De.workspace.onDidOpenNotebookDocument(n=>{this.notebookDidOpen.add(n.uri.toString()),this.didOpen(n)},void 0,this.disposables);for(let n of De.workspace.notebookDocuments)this.notebookDidOpen.add(n.uri.toString()),this.didOpen(n);De.workspace.onDidChangeNotebookDocument(n=>this.didChangeNotebookDocument(n),void 0,this.disposables),this.options.save===!0&&De.workspace.onDidSaveNotebookDocument(n=>this.didSave(n),void 0,this.disposables),De.workspace.onDidCloseNotebookDocument(n=>{this.didClose(n),this.notebookDidOpen.delete(n.uri.toString())},void 0,this.disposables)}getState(){for(let e of De.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return De.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(De.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;let n=this.notebookSyncInfo.get(e.uri.toString()),i=this.cellMatches(e,t);if(n!==void 0){let r=n.uris.has(t.document.uri.toString());if(i&&r||!i&&!r)return;if(i){let s=this.getMatchingCells(e);if(s!==void 0){let c=this.asNotebookDocumentChangeEvent(e,void 0,n,s);c!==void 0&&this.doSendChange(c,s).catch(()=>{})}}}else i&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){De.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){let n=this.notebookSyncInfo.get(e.uri.toString());if(n===void 0)return;let i=t.document.uri,r=n.cells.findIndex(s=>s.document.uri.toString()===i.toString());if(r!==-1)if(r===0&&n.cells.length===1)this.doSendClose(e,n.cells).catch(()=>{});else{let s=n.cells.slice(),c=s.splice(r,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:r,deleteCount:1},didClose:c}}},s).catch(()=>{})}}dispose(){for(let e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),n=this.notebookSyncInfo.get(e.uri.toString())){if(n!==void 0)if(t!==void 0){let i=this.asNotebookDocumentChangeEvent(e,void 0,n,t);i!==void 0&&this.doSendChange(i,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){let t=e.notebook,n=this.notebookSyncInfo.get(t.uri.toString());if(n===void 0){if(e.contentChanges.length===0)return;let i=this.getMatchingCells(t);if(i===void 0)return;this.didOpen(t,i,n)}else{let i=this.getMatchingCells(t);if(i===void 0){this.didClose(t,n);return}let r=this.asNotebookDocumentChangeEvent(e.notebook,e,n,i);r!==void 0&&this.doSendChange(r,i).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;let n=e.getCells().filter(i=>t.uris.has(i.document.uri.toString()));this.doSendClose(e,n).catch(()=>{})}async sendDidOpenNotebookDocument(e){let t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){let n=async(r,s)=>{let c=Kt.c2p.asNotebookDocument(r,s,this.client.code2ProtocolConverter),d=s.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(et.DidOpenNotebookDocumentNotification.type,{notebookDocument:c,cellTextDocuments:d})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),gi.create(t)),i?.didOpen!==void 0?i.didOpen(e,t,n):n(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){let n=async r=>{try{await this.client.sendNotification(et.DidChangeNotebookDocumentNotification.type,{notebookDocument:Kt.c2p.asVersionedNotebookDocumentIdentifier(r.notebook,this.client.code2ProtocolConverter),change:Kt.c2p.asNotebookDocumentChangeEvent(r,this.client.code2ProtocolConverter)})}catch(s){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",s),s}},i=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),gi.create(t??[])),i?.didChange!==void 0?i?.didChange(e,n):n(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){let t=async i=>{try{await this.client.sendNotification(et.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(i.uri)}})}catch(r){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",r),r}},n=this.client.middleware?.notebooks;return n?.didSave!==void 0?n.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){let n=async(r,s)=>{try{await this.client.sendNotification(et.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(r.uri)},cellTextDocuments:s.map(c=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(c.document))})}catch(c){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",c),c}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),i?.didClose!==void 0?i.didClose(e,t,n):n(e,t)}asNotebookDocumentChangeEvent(e,t,n,i){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");let r={notebook:e};t?.metadata!==void 0&&(r.metadata=Kt.c2p.asMetadata(t.metadata));let s;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){let c=[];s=new Set(i.map(d=>d.document.uri.toString()));for(let d of t.cellChanges)s.has(d.cell.document.uri.toString())&&(d.executionSummary!==void 0||d.metadata!==void 0)&&c.push(d.cell);c.length>0&&(r.cells=r.cells??{},r.cells.data=c)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&n!==void 0&&i!==void 0){let c=n.cells,d=i,l=Ps.computeDiff(c,d,!1),g,h;if(l!==void 0){g=l.cells===void 0?new Map:new Map(l.cells.map(p=>[p.document.uri.toString(),p])),h=l.deleteCount===0?new Map:new Map(c.slice(l.start,l.start+l.deleteCount).map(p=>[p.document.uri.toString(),p]));for(let p of Array.from(h.keys()))g.has(p)&&(h.delete(p),g.delete(p));r.cells=r.cells??{};let f=[],v=[];if(g.size>0||h.size>0){for(let p of g.values())f.push(p);for(let p of h.values())v.push(p)}r.cells.structure={array:l,didOpen:f,didClose:v}}}return Object.keys(r).length>1?r:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(let n of this.options.notebookSelector)if(n.notebook===void 0||Rs.matchNotebook(n.notebook,e)){let i=this.filterCells(e,t,n.cells);return i.length===0?void 0:i}}}cellMatches(e,t){let n=this.getMatchingCells(e,[t]);return n!==void 0&&n[0]===t}filterCells(e,t,n){let i=n!==void 0?t.filter(r=>{let s=r.document.languageId;return n.some((c=>c.language==="*"||s===c.language))}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,i):i}},mi=class a{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=et.NotebookDocumentSyncRegistrationType.type,De.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==a.CellScheme)return;let[n,i]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||i===void 0))for(let r of this.registrations.values())r instanceof jt&&r.didOpenNotebookCellTextDocument(n,i)}),De.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;let n=t.document;if(n.uri.scheme!==a.CellScheme)return;let[i]=this.findNotebookDocumentAndCell(n);if(i!==void 0)for(let r of this.registrations.values())r instanceof jt&&r.didChangeNotebookCellTextDocument(i,t)}),De.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==a.CellScheme)return;let[n,i]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||i===void 0))for(let r of this.registrations.values())r instanceof jt&&r.didCloseNotebookCellTextDocument(n,i)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(let e of this.registrations.values()){let t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){let t=oc(oc(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){let t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(hi.asDocumentSelector(t)))}initialize(e){let t=e.notebookDocumentSync;if(t===void 0)return;let n=t.id??Ru.generateUuid();this.register({id:n,registerOptions:t})}register(e){let t=new jt(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){let t=this.registrations.get(e);t&&t.dispose()}clear(){for(let e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==a.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&De.languages.match(this.dedicatedChannel,e)>0)return!0;for(let t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(let t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){let t=e.uri.toString();for(let n of De.workspace.notebookDocuments)for(let i of n.getCells())if(i.document.uri.toString()===t)return[n,i];return[void 0,void 0]}};vi.NotebookDocumentSyncFeature=mi;mi.CellScheme="vscode-notebook-cell"});var dc=F(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.SyncConfigurationFeature=ht.toJSONObject=ht.ConfigurationFeature=void 0;var Wt=I("vscode"),fn=L(),xu=Ie(),Fu=te(),cc=W(),xs=class{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(fn.ConfigurationRequest.type,(t,n)=>{let i=s=>{let c=[];for(let d of s.items){let l=d.scopeUri!==void 0&&d.scopeUri!==null?this._client.protocol2CodeConverter.asUri(d.scopeUri):void 0;c.push(this.getConfiguration(l,d.section!==null?d.section:void 0))}return c},r=e.middleware.workspace;return r&&r.configuration?r.configuration(t,n,i):i(t,n)})}getConfiguration(e,t){let n=null;if(t){let i=t.lastIndexOf(".");if(i===-1)n=_t(Wt.workspace.getConfiguration(void 0,e).get(t));else{let r=Wt.workspace.getConfiguration(t.substr(0,i),e);r&&(n=_t(r.get(t.substr(i+1))))}}else{let i=Wt.workspace.getConfiguration(void 0,e);n={};for(let r of Object.keys(i))i.has(r)&&(n[r]=_t(i.get(r)))}return n===void 0&&(n=null),n}clear(){}};ht.ConfigurationFeature=xs;function _t(a){if(a){if(Array.isArray(a))return a.map(_t);if(typeof a=="object"){let e=Object.create(null);for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=_t(a[t]));return e}}return a}ht.toJSONObject=_t;var Fs=class{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return fn.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,cc.ensure)((0,cc.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Fu.generateUuid(),registerOptions:{section:e}})}register(e){let t=Wt.workspace.onDidChangeConfiguration(n=>{this.onDidChangeConfiguration(e.registerOptions.section,n)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let n;if(xu.string(e)?n=[e]:n=e,n!==void 0&&t!==void 0&&!n.some(c=>t.affectsConfiguration(c)))return;let i=async s=>s===void 0?this._client.sendNotification(fn.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(fn.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(s)}),r=this._client.middleware.workspace?.didChangeConfiguration;(r?r(n,i):i(n)).catch(s=>{this._client.error(`Sending notification ${fn.DidChangeConfigurationNotification.type.method} failed`,s)})}extractSettingsInformation(e){function t(r,s){let c=r;for(let d=0;d<s.length-1;d++){let l=c[s[d]];l||(l=Object.create(null),c[s[d]]=l),c=l}return c}let n=this._client.clientOptions.workspaceFolder?this._client.clientOptions.workspaceFolder.uri:void 0,i=Object.create(null);for(let r=0;r<e.length;r++){let s=e[r],c=s.indexOf("."),d=null;if(c>=0?d=Wt.workspace.getConfiguration(s.substr(0,c),n).get(s.substr(c+1)):d=Wt.workspace.getConfiguration(void 0,n).get(s),d){let l=e[r].split(".");t(i,l)[l[l.length-1]]=_t(d)}}return i}};ht.SyncConfigurationFeature=Fs});var uc=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.DidSaveTextDocumentFeature=be.WillSaveWaitUntilFeature=be.WillSaveFeature=be.DidChangeTextDocumentFeature=be.DidCloseTextDocumentFeature=be.DidOpenTextDocumentFeature=void 0;var Re=I("vscode"),Z=L(),ie=W(),$t=te(),qs=class extends ie.TextDocumentEventFeature{constructor(e,t){super(e,Re.workspace.onDidOpenTextDocument,Z.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,n=>e.code2ProtocolConverter.asOpenTextDocumentParams(n),n=>n,ie.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:$t.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return Z.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;let t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);Re.workspace.textDocuments.forEach(n=>{let i=n.uri.toString();if(!this._syncedDocuments.has(i)&&Re.languages.match(t,n)>0&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let r=this._client.middleware,s=c=>this._client.sendNotification(this._type,this._createParams(c));(r.didOpen?r.didOpen(n,s):s(n)).catch(c=>{this._client.error(`Sending document notification ${this._type.method} failed`,c)}),this._syncedDocuments.set(i,n)}})}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,n)}};be.DidOpenTextDocumentFeature=qs;var Is=class extends ie.TextDocumentEventFeature{constructor(e,t,n){super(e,Re.workspace.onDidCloseTextDocument,Z.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,i=>e.code2ProtocolConverter.asCloseTextDocumentParams(i),i=>i,ie.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=n}get registrationType(){return Z.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:$t.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,n)}unregister(e){let t=this._selectors.get(e);super.unregister(e);let n=this._selectors.values();this._syncedDocuments.forEach(i=>{if(Re.languages.match(t,i)>0&&!this._selectorFilter(n,i)&&!this._client.hasDedicatedTextSynchronizationFeature(i)){let r=this._client.middleware,s=c=>this._client.sendNotification(this._type,this._createParams(c));this._syncedDocuments.delete(i.uri.toString()),(r.didClose?r.didClose(i,s):s(i)).catch(c=>{this._client.error(`Sending document notification ${this._type.method} failed`,c)})}})}};be.DidCloseTextDocumentFeature=Is;var Es=class extends ie.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new Re.EventEmitter,this._onPendingChangeAdded=new Re.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=Z.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return Z.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.change!==void 0&&n.change!==Z.TextDocumentSyncKind.None&&this.register({id:$t.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:n.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Re.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(let e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;let t=e.document.uri,n=e.document.version,i=[];for(let r of this._changeData.values())if(Re.languages.match(r.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let s=this._client.middleware;if(r.syncKind===Z.TextDocumentSyncKind.Incremental){let c=async d=>{let l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(d,t,n);await this._client.sendNotification(Z.DidChangeTextDocumentNotification.type,l),this.notificationSent(d.document,Z.DidChangeTextDocumentNotification.type,l)};i.push(s.didChange?s.didChange(e,d=>c(d)):c(e))}else if(r.syncKind===Z.TextDocumentSyncKind.Full){let c=async d=>{let l=d.document.uri.toString();this._pendingTextDocumentChanges.set(l,d.document),this._onPendingChangeAdded.fire()};i.push(s.didChange?s.didChange(e,d=>c(d)):c(e))}}return Promise.all(i).then(void 0,r=>{throw this._client.error(`Sending document notification ${Z.DidChangeTextDocumentNotification.type.method} failed`,r),r})}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=Z.TextDocumentSyncKind.None;else{this._syncKind=Z.TextDocumentSyncKind.None;for(let t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===Z.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=Z.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(let n of this._pendingTextDocumentChanges)e.has(n[0])||(t.push(n[1]),this._pendingTextDocumentChanges.delete(n[0]))}return t}getProvider(e){for(let t of this._changeData.values())if(Re.languages.match(t.documentSelector,e)>0)return{send:n=>this.callback(n)}}updateSyncKind(e){if(this._syncKind!==Z.TextDocumentSyncKind.Full)switch(e){case Z.TextDocumentSyncKind.Full:this._syncKind=e;break;case Z.TextDocumentSyncKind.Incremental:this._syncKind===Z.TextDocumentSyncKind.None&&(this._syncKind=Z.TextDocumentSyncKind.Incremental);break}}};be.DidChangeTextDocumentFeature=Es;var Ms=class extends ie.TextDocumentEventFeature{constructor(e){super(e,Re.workspace.onWillSaveTextDocument,Z.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,n)=>ie.TextDocumentEventFeature.textDocumentFilter(t,n.document))}get registrationType(){return Z.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSave&&this.register({id:$t.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}};be.WillSaveFeature=Ms;var As=class extends ie.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return Z.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSaveWaitUntil&&this.register({id:$t.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Re.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(ie.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,n=i=>this._client.sendRequest(Z.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(i)).then(async r=>{let s=await this._client.protocol2CodeConverter.asTextEdits(r);return s===void 0?[]:s});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,n):n(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}};be.WillSaveWaitUntilFeature=As;var Os=class extends ie.TextDocumentEventFeature{constructor(e){super(e,Re.workspace.onDidSaveTextDocument,Z.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,ie.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return Z.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,ie.ensure)((0,ie.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;if(t&&n&&n.save){let i=typeof n.save=="boolean"?{includeText:!1}:{includeText:!!n.save.includeText};this.register({id:$t.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},i)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}};be.DidSaveTextDocumentFeature=Os});var lc=F(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.CompletionItemFeature=void 0;var qu=I("vscode"),K=L(),Ls=W(),Iu=te(),Eu=[K.CompletionItemKind.Text,K.CompletionItemKind.Method,K.CompletionItemKind.Function,K.CompletionItemKind.Constructor,K.CompletionItemKind.Field,K.CompletionItemKind.Variable,K.CompletionItemKind.Class,K.CompletionItemKind.Interface,K.CompletionItemKind.Module,K.CompletionItemKind.Property,K.CompletionItemKind.Unit,K.CompletionItemKind.Value,K.CompletionItemKind.Enum,K.CompletionItemKind.Keyword,K.CompletionItemKind.Snippet,K.CompletionItemKind.Color,K.CompletionItemKind.File,K.CompletionItemKind.Reference,K.CompletionItemKind.Folder,K.CompletionItemKind.EnumMember,K.CompletionItemKind.Constant,K.CompletionItemKind.Struct,K.CompletionItemKind.Event,K.CompletionItemKind.Operator,K.CompletionItemKind.TypeParameter],Us=class extends Ls.TextDocumentLanguageFeature{constructor(e){super(e,K.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Ls.ensure)((0,Ls.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[K.MarkupKind.Markdown,K.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[K.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[K.InsertTextMode.asIs,K.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=K.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Eu},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){let n=this.getRegistrationOptions(t,e.completionProvider);n&&this.register({id:Iu.generateUuid(),registerOptions:n})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);let n=e.triggerCharacters??[],i=e.allCommitCharacters,r=e.documentSelector,s={provideCompletionItems:(c,d,l,g)=>{let h=this._client,f=this._client.middleware,v=(p,y,C,b)=>h.sendRequest(K.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,y,C),b).then(T=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(T,i,b),T=>h.handleFailedRequest(K.CompletionRequest.type,b,T,null));return f.provideCompletionItem?f.provideCompletionItem(c,d,g,l,v):v(c,d,g,l)},resolveCompletionItem:e.resolveProvider?(c,d)=>{let l=this._client,g=this._client.middleware,h=(f,v)=>l.sendRequest(K.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(f,!!this.labelDetailsSupport.get(t)),v).then(p=>v.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(K.CompletionResolveRequest.type,v,p,f));return g.resolveCompletionItem?g.resolveCompletionItem(c,d,h):h(c,d)}:void 0};return[qu.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),s,...n),s]}};yi.CompletionItemFeature=Us});var pc=F(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.HoverFeature=void 0;var Mu=I("vscode"),hn=L(),Ns=W(),Au=te(),Hs=class extends Ns.TextDocumentLanguageFeature{constructor(e){super(e,hn.HoverRequest.type)}fillClientCapabilities(e){let t=(0,Ns.ensure)((0,Ns.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[hn.MarkupKind.Markdown,hn.MarkupKind.PlainText]}initialize(e,t){let n=this.getRegistrationOptions(t,e.hoverProvider);n&&this.register({id:Au.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideHover:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(hn.HoverRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asHover(v),v=>c.handleFailedRequest(hn.HoverRequest.type,f,v,null)),l=c.middleware;return l.provideHover?l.provideHover(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Mu.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Ci.HoverFeature=Hs});var fc=F(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.DefinitionFeature=void 0;var Ou=I("vscode"),Ks=L(),js=W(),Lu=te(),Ws=class extends js.TextDocumentLanguageFeature{constructor(e){super(e,Ks.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,js.ensure)((0,js.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.definitionProvider);n&&this.register({id:Lu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDefinition:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(Ks.DefinitionRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(v,f),v=>c.handleFailedRequest(Ks.DefinitionRequest.type,f,v,null)),l=c.middleware;return l.provideDefinition?l.provideDefinition(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Ou.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};wi.DefinitionFeature=Ws});var gc=F(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.SignatureHelpFeature=void 0;var hc=I("vscode"),gn=L(),$s=W(),Uu=te(),zs=class extends $s.TextDocumentLanguageFeature{constructor(e){super(e,gn.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,$s.ensure)((0,$s.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[gn.MarkupKind.Markdown,gn.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.signatureHelpProvider);n&&this.register({id:Uu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t={provideSignatureHelp:(n,i,r,s)=>{let c=this._client,d=(g,h,f,v)=>c.sendRequest(gn.SignatureHelpRequest.type,c.code2ProtocolConverter.asSignatureHelpParams(g,h,f),v).then(p=>v.isCancellationRequested?null:c.protocol2CodeConverter.asSignatureHelp(p,v),p=>c.handleFailedRequest(gn.SignatureHelpRequest.type,v,p,null)),l=c.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(n,i,s,r,d):d(n,i,s,r)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){let n=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){let i=e.triggerCharacters||[];return hc.languages.registerSignatureHelpProvider(n,t,...i)}else{let i={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return hc.languages.registerSignatureHelpProvider(n,t,i)}}};Di.SignatureHelpFeature=zs});var mc=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.DocumentHighlightFeature=void 0;var Nu=I("vscode"),Vs=L(),Bs=W(),Hu=te(),Ys=class extends Bs.TextDocumentLanguageFeature{constructor(e){super(e,Vs.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Bs.ensure)((0,Bs.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentHighlightProvider);n&&this.register({id:Hu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentHighlights:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(Vs.DocumentHighlightRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asDocumentHighlights(v,f),v=>c.handleFailedRequest(Vs.DocumentHighlightRequest.type,f,v,null)),l=c.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(i,r,s,d):d(i,r,s)}};return[Nu.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Si.DocumentHighlightFeature=Ys});var Gs=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.DocumentSymbolFeature=Ye.SupportedSymbolTags=Ye.SupportedSymbolKinds=void 0;var Ku=I("vscode"),z=L(),Js=W(),ju=te();Ye.SupportedSymbolKinds=[z.SymbolKind.File,z.SymbolKind.Module,z.SymbolKind.Namespace,z.SymbolKind.Package,z.SymbolKind.Class,z.SymbolKind.Method,z.SymbolKind.Property,z.SymbolKind.Field,z.SymbolKind.Constructor,z.SymbolKind.Enum,z.SymbolKind.Interface,z.SymbolKind.Function,z.SymbolKind.Variable,z.SymbolKind.Constant,z.SymbolKind.String,z.SymbolKind.Number,z.SymbolKind.Boolean,z.SymbolKind.Array,z.SymbolKind.Object,z.SymbolKind.Key,z.SymbolKind.Null,z.SymbolKind.EnumMember,z.SymbolKind.Struct,z.SymbolKind.Event,z.SymbolKind.Operator,z.SymbolKind.TypeParameter];Ye.SupportedSymbolTags=[z.SymbolTag.Deprecated];var Qs=class extends Js.TextDocumentLanguageFeature{constructor(e){super(e,z.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Js.ensure)((0,Js.ensure)(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:Ye.SupportedSymbolKinds},t.hierarchicalDocumentSymbolSupport=!0,t.tagSupport={valueSet:Ye.SupportedSymbolTags},t.labelSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentSymbolProvider);n&&this.register({id:ju.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentSymbols:(r,s)=>{let c=this._client,d=async(g,h)=>{try{let f=await c.sendRequest(z.DocumentSymbolRequest.type,c.code2ProtocolConverter.asDocumentSymbolParams(g),h);if(h.isCancellationRequested||f===void 0||f===null)return null;if(f.length===0)return[];{let v=f[0];return z.DocumentSymbol.is(v)?await c.protocol2CodeConverter.asDocumentSymbols(f,h):await c.protocol2CodeConverter.asSymbolInformations(f,h)}}catch(f){return c.handleFailedRequest(z.DocumentSymbolRequest.type,h,f,null)}},l=c.middleware;return l.provideDocumentSymbols?l.provideDocumentSymbols(r,s,d):d(r,s)}},i=e.label!==void 0?{label:e.label}:void 0;return[Ku.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,i),n]}};Ye.DocumentSymbolFeature=Qs});var yc=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.WorkspaceSymbolFeature=void 0;var Wu=I("vscode"),mn=L(),Zs=W(),vc=Gs(),$u=te(),Xs=class extends Zs.WorkspaceFeature{constructor(e){super(e,mn.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Zs.ensure)((0,Zs.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:vc.SupportedSymbolKinds},t.tagSupport={valueSet:vc.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:$u.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let t={provideWorkspaceSymbols:(n,i)=>{let r=this._client,s=(d,l)=>r.sendRequest(mn.WorkspaceSymbolRequest.type,{query:d},l).then(g=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformations(g,l),g=>r.handleFailedRequest(mn.WorkspaceSymbolRequest.type,l,g,null)),c=r.middleware;return c.provideWorkspaceSymbols?c.provideWorkspaceSymbols(n,i,s):s(n,i)},resolveWorkspaceSymbol:e.resolveProvider===!0?(n,i)=>{let r=this._client,s=(d,l)=>r.sendRequest(mn.WorkspaceSymbolResolveRequest.type,r.code2ProtocolConverter.asWorkspaceSymbol(d),l).then(g=>l.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformation(g),g=>r.handleFailedRequest(mn.WorkspaceSymbolResolveRequest.type,l,g,null)),c=r.middleware;return c.resolveWorkspaceSymbol?c.resolveWorkspaceSymbol(n,i,s):s(n,i)}:void 0};return[Wu.languages.registerWorkspaceSymbolProvider(t),t]}};bi.WorkspaceSymbolFeature=Xs});var Cc=F(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.ReferencesFeature=void 0;var zu=I("vscode"),eo=L(),to=W(),Vu=te(),no=class extends to.TextDocumentLanguageFeature{constructor(e){super(e,eo.ReferencesRequest.type)}fillClientCapabilities(e){(0,to.ensure)((0,to.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.referencesProvider);n&&this.register({id:Vu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideReferences:(i,r,s,c)=>{let d=this._client,l=(h,f,v,p)=>d.sendRequest(eo.ReferencesRequest.type,d.code2ProtocolConverter.asReferenceParams(h,f,v),p).then(y=>p.isCancellationRequested?null:d.protocol2CodeConverter.asReferences(y,p),y=>d.handleFailedRequest(eo.ReferencesRequest.type,p,y,null)),g=d.middleware;return g.provideReferences?g.provideReferences(i,r,s,c,l):l(i,r,s,c)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return zu.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};_i.ReferencesFeature=no});var wc=F(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CodeActionFeature=void 0;var Bu=I("vscode"),xe=L(),Yu=te(),io=W(),ro=class extends io.TextDocumentLanguageFeature{constructor(e){super(e,xe.CodeActionRequest.type)}fillClientCapabilities(e){let t=(0,io.ensure)((0,io.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[xe.CodeActionKind.Empty,xe.CodeActionKind.QuickFix,xe.CodeActionKind.Refactor,xe.CodeActionKind.RefactorExtract,xe.CodeActionKind.RefactorInline,xe.CodeActionKind.RefactorRewrite,xe.CodeActionKind.Source,xe.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.codeActionProvider);n&&this.register({id:Yu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideCodeActions:(i,r,s,c)=>{let d=this._client,l=async(h,f,v,p)=>{let y={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h),range:d.code2ProtocolConverter.asRange(f),context:d.code2ProtocolConverter.asCodeActionContextSync(v)};return d.sendRequest(xe.CodeActionRequest.type,y,p).then(C=>p.isCancellationRequested||C===null||C===void 0?null:d.protocol2CodeConverter.asCodeActionResult(C,p),C=>d.handleFailedRequest(xe.CodeActionRequest.type,p,C,null))},g=d.middleware;return g.provideCodeActions?g.provideCodeActions(i,r,s,c,l):l(i,r,s,c)},resolveCodeAction:e.resolveProvider?(i,r)=>{let s=this._client,c=this._client.middleware,d=async(l,g)=>s.sendRequest(xe.CodeActionResolveRequest.type,s.code2ProtocolConverter.asCodeActionSync(l),g).then(h=>g.isCancellationRequested?l:s.protocol2CodeConverter.asCodeAction(h,g),h=>s.handleFailedRequest(xe.CodeActionResolveRequest.type,g,h,l));return c.resolveCodeAction?c.resolveCodeAction(i,r,d):d(i,r)}:void 0};return[Bu.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),n]}};Ti.CodeActionFeature=ro});var Sc=F(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.CodeLensFeature=void 0;var Dc=I("vscode"),zt=L(),Ju=te(),vn=W(),so=class extends vn.TextDocumentLanguageFeature{constructor(e){super(e,zt.CodeLensRequest.type)}fillClientCapabilities(e){(0,vn.ensure)((0,vn.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,vn.ensure)((0,vn.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(zt.CodeLensRefreshRequest.type,async()=>{for(let r of this.getAllProviders())r.onDidChangeCodeLensEmitter.fire()});let i=this.getRegistrationOptions(t,e.codeLensProvider);i&&this.register({id:Ju.generateUuid(),registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new Dc.EventEmitter,i={onDidChangeCodeLenses:n.event,provideCodeLenses:(r,s)=>{let c=this._client,d=(g,h)=>c.sendRequest(zt.CodeLensRequest.type,c.code2ProtocolConverter.asCodeLensParams(g),h).then(f=>h.isCancellationRequested?null:c.protocol2CodeConverter.asCodeLenses(f,h),f=>c.handleFailedRequest(zt.CodeLensRequest.type,h,f,null)),l=c.middleware;return l.provideCodeLenses?l.provideCodeLenses(r,s,d):d(r,s)},resolveCodeLens:e.resolveProvider?(r,s)=>{let c=this._client,d=(g,h)=>c.sendRequest(zt.CodeLensResolveRequest.type,c.code2ProtocolConverter.asCodeLens(g),h).then(f=>h.isCancellationRequested?g:c.protocol2CodeConverter.asCodeLens(f),f=>c.handleFailedRequest(zt.CodeLensResolveRequest.type,h,f,g)),l=c.middleware;return l.resolveCodeLens?l.resolveCodeLens(r,s,d):d(r,s)}:void 0};return[Dc.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),{provider:i,onDidChangeCodeLensEmitter:n}]}};ki.CodeLensFeature=so});var bc=F(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.DocumentOnTypeFormattingFeature=gt.DocumentRangeFormattingFeature=gt.DocumentFormattingFeature=void 0;var Pi=I("vscode"),He=L(),uo=te(),tt=W(),Vt;(function(a){function e(t){let n=Pi.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:n.get("trimTrailingWhitespace"),trimFinalNewlines:n.get("trimFinalNewlines"),insertFinalNewline:n.get("insertFinalNewline")}}a.fromConfiguration=e})(Vt||(Vt={}));var oo=class extends tt.TextDocumentLanguageFeature{constructor(e){super(e,He.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,tt.ensure)((0,tt.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentFormattingProvider);n&&this.register({id:uo.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentFormattingEdits:(i,r,s)=>{let c=this._client,d=(g,h,f)=>{let v={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(g),options:c.code2ProtocolConverter.asFormattingOptions(h,Vt.fromConfiguration(g))};return c.sendRequest(He.DocumentFormattingRequest.type,v,f).then(p=>f.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(p,f),p=>c.handleFailedRequest(He.DocumentFormattingRequest.type,f,p,null))},l=c.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(i,r,s,d):d(i,r,s)}};return[Pi.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};gt.DocumentFormattingFeature=oo;var ao=class extends tt.TextDocumentLanguageFeature{constructor(e){super(e,He.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){let t=(0,tt.ensure)((0,tt.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);n&&this.register({id:uo.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentRangeFormattingEdits:(i,r,s,c)=>{let d=this._client,l=(h,f,v,p)=>{let y={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h),range:d.code2ProtocolConverter.asRange(f),options:d.code2ProtocolConverter.asFormattingOptions(v,Vt.fromConfiguration(h))};return d.sendRequest(He.DocumentRangeFormattingRequest.type,y,p).then(C=>p.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(C,p),C=>d.handleFailedRequest(He.DocumentRangeFormattingRequest.type,p,C,null))},g=d.middleware;return g.provideDocumentRangeFormattingEdits?g.provideDocumentRangeFormattingEdits(i,r,s,c,l):l(i,r,s,c)}};return e.rangesSupport&&(n.provideDocumentRangesFormattingEdits=(i,r,s,c)=>{let d=this._client,l=(h,f,v,p)=>{let y={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:d.code2ProtocolConverter.asRanges(f),options:d.code2ProtocolConverter.asFormattingOptions(v,Vt.fromConfiguration(h))};return d.sendRequest(He.DocumentRangesFormattingRequest.type,y,p).then(C=>p.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(C,p),C=>d.handleFailedRequest(He.DocumentRangesFormattingRequest.type,p,C,null))},g=d.middleware;return g.provideDocumentRangesFormattingEdits?g.provideDocumentRangesFormattingEdits(i,r,s,c,l):l(i,r,s,c)}),[Pi.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};gt.DocumentRangeFormattingFeature=ao;var co=class extends tt.TextDocumentLanguageFeature{constructor(e){super(e,He.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,tt.ensure)((0,tt.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);n&&this.register({id:uo.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideOnTypeFormattingEdits:(r,s,c,d,l)=>{let g=this._client,h=(v,p,y,C,b)=>{let T={textDocument:g.code2ProtocolConverter.asTextDocumentIdentifier(v),position:g.code2ProtocolConverter.asPosition(p),ch:y,options:g.code2ProtocolConverter.asFormattingOptions(C,Vt.fromConfiguration(v))};return g.sendRequest(He.DocumentOnTypeFormattingRequest.type,T,b).then(P=>b.isCancellationRequested?null:g.protocol2CodeConverter.asTextEdits(P,b),P=>g.handleFailedRequest(He.DocumentOnTypeFormattingRequest.type,b,P,null))},f=g.middleware;return f.provideOnTypeFormattingEdits?f.provideOnTypeFormattingEdits(r,s,c,d,l,h):h(r,s,c,d,l)}},i=e.moreTriggerCharacter||[];return[Pi.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,e.firstTriggerCharacter,...i),n]}};gt.DocumentOnTypeFormattingFeature=co});var Tc=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.RenameFeature=void 0;var Qu=I("vscode"),Tt=L(),Gu=te(),_c=Ie(),lo=W(),po=class extends lo.TextDocumentLanguageFeature{constructor(e){super(e,Tt.RenameRequest.type)}fillClientCapabilities(e){let t=(0,lo.ensure)((0,lo.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=Tt.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.renameProvider);n&&(_c.boolean(e.renameProvider)&&(n.prepareProvider=!1),this.register({id:Gu.generateUuid(),registerOptions:n}))}registerLanguageProvider(e){let t=e.documentSelector,n={provideRenameEdits:(i,r,s,c)=>{let d=this._client,l=(h,f,v,p)=>{let y={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h),position:d.code2ProtocolConverter.asPosition(f),newName:v};return d.sendRequest(Tt.RenameRequest.type,y,p).then(C=>p.isCancellationRequested?null:d.protocol2CodeConverter.asWorkspaceEdit(C,p),C=>d.handleFailedRequest(Tt.RenameRequest.type,p,C,null,!1))},g=d.middleware;return g.provideRenameEdits?g.provideRenameEdits(i,r,s,c,l):l(i,r,s,c)},prepareRename:e.prepareProvider?(i,r,s)=>{let c=this._client,d=(g,h,f)=>{let v={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(g),position:c.code2ProtocolConverter.asPosition(h)};return c.sendRequest(Tt.PrepareRenameRequest.type,v,f).then(p=>f.isCancellationRequested?null:Tt.Range.is(p)?c.protocol2CodeConverter.asRange(p):this.isDefaultBehavior(p)?p.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):p&&Tt.Range.is(p.range)?{range:c.protocol2CodeConverter.asRange(p.range),placeholder:p.placeholder}:Promise.reject(new Error("The element can't be renamed.")),p=>{throw typeof p.message=="string"?new Error(p.message):new Error("The element can't be renamed.")})},l=c.middleware;return l.prepareRename?l.prepareRename(i,r,s,d):d(i,r,s)}:void 0};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Qu.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){let t=e;return t&&_c.boolean(t.defaultBehavior)}};Ri.RenameFeature=po});var kc=F(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.DocumentLinkFeature=void 0;var Zu=I("vscode"),yn=L(),fo=W(),Xu=te(),ho=class extends fo.TextDocumentLanguageFeature{constructor(e){super(e,yn.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=(0,fo.ensure)((0,fo.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentLinkProvider);n&&this.register({id:Xu.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentLinks:(i,r)=>{let s=this._client,c=(l,g)=>s.sendRequest(yn.DocumentLinkRequest.type,s.code2ProtocolConverter.asDocumentLinkParams(l),g).then(h=>g.isCancellationRequested?null:s.protocol2CodeConverter.asDocumentLinks(h,g),h=>s.handleFailedRequest(yn.DocumentLinkRequest.type,g,h,null)),d=s.middleware;return d.provideDocumentLinks?d.provideDocumentLinks(i,r,c):c(i,r)},resolveDocumentLink:e.resolveProvider?(i,r)=>{let s=this._client,c=(l,g)=>s.sendRequest(yn.DocumentLinkResolveRequest.type,s.code2ProtocolConverter.asDocumentLink(l),g).then(h=>g.isCancellationRequested?l:s.protocol2CodeConverter.asDocumentLink(h),h=>s.handleFailedRequest(yn.DocumentLinkResolveRequest.type,g,h,l)),d=s.middleware;return d.resolveDocumentLink?d.resolveDocumentLink(i,r,c):c(i,r)}:void 0};return[Zu.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};xi.DocumentLinkFeature=ho});var Rc=F(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ExecuteCommandFeature=void 0;var el=I("vscode"),go=L(),tl=te(),Pc=W(),mo=class{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return go.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Pc.ensure)((0,Pc.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:tl.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){let t=this._client,n=t.middleware,i=(r,s)=>{let c={command:r,arguments:s};return t.sendRequest(go.ExecuteCommandRequest.type,c).then(void 0,d=>t.handleFailedRequest(go.ExecuteCommandRequest.type,void 0,d,void 0))};if(e.registerOptions.commands){let r=[];for(let s of e.registerOptions.commands)r.push(el.commands.registerCommand(s,(...c)=>n.executeCommand?n.executeCommand(s,c,i):i(s,c)));this._commands.set(e.id,r)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(n=>n.dispose())}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}};Fi.ExecuteCommandFeature=mo});var xc=F(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.FileSystemWatcherFeature=void 0;var nl=I("vscode"),kt=L(),qi=W(),vo=class{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return kt.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,qi.ensure)((0,qi.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,qi.ensure)((0,qi.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;let t=[];for(let n of e.registerOptions.watchers){let i=this._client.protocol2CodeConverter.asGlobPattern(n.globPattern);if(i===void 0)continue;let r=!0,s=!0,c=!0;n.kind!==void 0&&n.kind!==null&&(r=(n.kind&kt.WatchKind.Create)!==0,s=(n.kind&kt.WatchKind.Change)!==0,c=(n.kind&kt.WatchKind.Delete)!==0);let d=nl.workspace.createFileSystemWatcher(i,!r,!s,!c);this.hookListeners(d,r,s,c,t),t.push(d)}this._watchers.set(e.id,t)}registerRaw(e,t){let n=[];for(let i of t)this.hookListeners(i,!0,!0,!0,n);this._watchers.set(e,n)}hookListeners(e,t,n,i,r){t&&e.onDidCreate(s=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(s),type:kt.FileChangeType.Created}),null,r),n&&e.onDidChange(s=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(s),type:kt.FileChangeType.Changed}),null,r),i&&e.onDidDelete(s=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(s),type:kt.FileChangeType.Deleted}),null,r)}unregister(e){let t=this._watchers.get(e);if(t)for(let n of t)n.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}};Ii.FileSystemWatcherFeature=vo});var Fc=F(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ColorProviderFeature=void 0;var il=I("vscode"),Cn=L(),yo=W(),Co=class extends yo.TextDocumentLanguageFeature{constructor(e){super(e,Cn.DocumentColorRequest.type)}fillClientCapabilities(e){(0,yo.ensure)((0,yo.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.colorProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideColorPresentations:(i,r,s)=>{let c=this._client,d=(g,h,f)=>{let v={color:g,textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:c.code2ProtocolConverter.asRange(h.range)};return c.sendRequest(Cn.ColorPresentationRequest.type,v,f).then(p=>f.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,f),p=>c.handleFailedRequest(Cn.ColorPresentationRequest.type,f,p,null))},l=c.middleware;return l.provideColorPresentations?l.provideColorPresentations(i,r,s,d):d(i,r,s)},provideDocumentColors:(i,r)=>{let s=this._client,c=(l,g)=>{let h={textDocument:s.code2ProtocolConverter.asTextDocumentIdentifier(l)};return s.sendRequest(Cn.DocumentColorRequest.type,h,g).then(f=>g.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(f,g),f=>s.handleFailedRequest(Cn.DocumentColorRequest.type,g,f,null))},d=s.middleware;return d.provideDocumentColors?d.provideDocumentColors(i,r,c):c(i,r)}};return[il.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Ei.ColorProviderFeature=Co});var qc=F(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ImplementationFeature=void 0;var rl=I("vscode"),wo=L(),Do=W(),So=class extends Do.TextDocumentLanguageFeature{constructor(e){super(e,wo.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Do.ensure)((0,Do.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.implementationProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideImplementation:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(wo.ImplementationRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(v,f),v=>c.handleFailedRequest(wo.ImplementationRequest.type,f,v,null)),l=c.middleware;return l.provideImplementation?l.provideImplementation(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return rl.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Mi.ImplementationFeature=So});var Ic=F(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.TypeDefinitionFeature=void 0;var sl=I("vscode"),bo=L(),wn=W(),_o=class extends wn.TextDocumentLanguageFeature{constructor(e){super(e,bo.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,wn.ensure)((0,wn.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,wn.ensure)((0,wn.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.typeDefinitionProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideTypeDefinition:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(bo.TypeDefinitionRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(v,f),v=>c.handleFailedRequest(bo.TypeDefinitionRequest.type,f,v,null)),l=c.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return sl.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Ai.TypeDefinitionFeature=_o});var Ec=F(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.WorkspaceFoldersFeature=Bt.arrayDiff=void 0;var ol=te(),Oi=I("vscode"),Dn=L();function To(a,e){if(a!=null)return a[e]}function ko(a,e){return a.filter(t=>e.indexOf(t)<0)}Bt.arrayDiff=ko;var Po=class{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return Dn.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){let t=Oi.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(n=>this.asProtocol(n))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(Dn.WorkspaceFoldersRequest.type,r=>{let s=()=>{let d=Oi.workspace.workspaceFolders;return d===void 0?null:d.map(g=>this.asProtocol(g))},c=t.middleware.workspace;return c&&c.workspaceFolders?c.workspaceFolders(r,s):s(r)});let n=To(To(To(e,"workspace"),"workspaceFolders"),"changeNotifications"),i;typeof n=="string"?i=n:n===!0&&(i=ol.generateUuid()),i&&this.register({id:i,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){let n=ko(this._initialFolders,e),i=ko(e,this._initialFolders);(i.length>0||n.length>0)&&(t=this.doSendEvent(i,n))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(n=>{this._client.error(`Sending notification ${Dn.DidChangeWorkspaceFoldersNotification.type.method} failed`,n)})}doSendEvent(e,t){let n={event:{added:e.map(i=>this.asProtocol(i)),removed:t.map(i=>this.asProtocol(i))}};return this._client.sendNotification(Dn.DidChangeWorkspaceFoldersNotification.type,n)}register(e){let t=e.id,n=this._client,i=Oi.workspace.onDidChangeWorkspaceFolders(r=>{let s=l=>this.doSendEvent(l.added,l.removed),c=n.middleware.workspace;(c&&c.didChangeWorkspaceFolders?c.didChangeWorkspaceFolders(r,s):s(r)).catch(l=>{this._client.error(`Sending notification ${Dn.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,i),this.sendInitialEvent(Oi.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}};Bt.WorkspaceFoldersFeature=Po});var Ac=F(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.FoldingRangeFeature=void 0;var Mc=I("vscode"),Pt=L(),Sn=W(),Ro=class extends Sn.TextDocumentLanguageFeature{constructor(e){super(e,Pt.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,Sn.ensure)((0,Sn.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[Pt.FoldingRangeKind.Comment,Pt.FoldingRangeKind.Imports,Pt.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,Sn.ensure)((0,Sn.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(Pt.FoldingRangeRefreshRequest.type,async()=>{for(let r of this.getAllProviders())r.onDidChangeFoldingRange.fire()});let[n,i]=this.getRegistration(t,e.foldingRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new Mc.EventEmitter,i={onDidChangeFoldingRanges:n.event,provideFoldingRanges:(r,s,c)=>{let d=this._client,l=(h,f,v)=>{let p={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h)};return d.sendRequest(Pt.FoldingRangeRequest.type,p,v).then(y=>v.isCancellationRequested?null:d.protocol2CodeConverter.asFoldingRanges(y,v),y=>d.handleFailedRequest(Pt.FoldingRangeRequest.type,v,y,null))},g=d.middleware;return g.provideFoldingRanges?g.provideFoldingRanges(r,s,c,l):l(r,s,c)}};return[Mc.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),{provider:i,onDidChangeFoldingRange:n}]}};Li.FoldingRangeFeature=Ro});var Oc=F(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.DeclarationFeature=void 0;var al=I("vscode"),xo=L(),Fo=W(),qo=class extends Fo.TextDocumentLanguageFeature{constructor(e){super(e,xo.DeclarationRequest.type)}fillClientCapabilities(e){let t=(0,Fo.ensure)((0,Fo.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.declarationProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDeclaration:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(xo.DeclarationRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asDeclarationResult(v,f),v=>c.handleFailedRequest(xo.DeclarationRequest.type,f,v,null)),l=c.middleware;return l.provideDeclaration?l.provideDeclaration(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return al.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Ui.DeclarationFeature=qo});var Lc=F(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.SelectionRangeFeature=void 0;var cl=I("vscode"),Io=L(),Eo=W(),Mo=class extends Eo.TextDocumentLanguageFeature{constructor(e){super(e,Io.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=(0,Eo.ensure)((0,Eo.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.selectionRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideSelectionRanges:(i,r,s)=>{let c=this._client,d=async(g,h,f)=>{let v={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(g),positions:c.code2ProtocolConverter.asPositionsSync(h,f)};return c.sendRequest(Io.SelectionRangeRequest.type,v,f).then(p=>f.isCancellationRequested?null:c.protocol2CodeConverter.asSelectionRanges(p,f),p=>c.handleFailedRequest(Io.SelectionRangeRequest.type,f,p,null))},l=c.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return cl.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Ni.SelectionRangeFeature=Mo});var Nc=F(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ProgressFeature=void 0;var Uc=L(),dl=fs();function ul(a,e){return a[e]===void 0&&(a[e]=Object.create(null)),a[e]}var Ao=class{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:Uc.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){ul(e,"window").workDoneProgress=!0}initialize(){let e=this._client,t=i=>{this.activeParts.delete(i)},n=i=>{this.activeParts.add(new dl.ProgressPart(this._client,i.token,t))};e.onRequest(Uc.WorkDoneProgressCreateRequest.type,n)}clear(){for(let e of this.activeParts)e.done();this.activeParts.clear()}};Hi.ProgressFeature=Ao});var Hc=F(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.CallHierarchyFeature=void 0;var ll=I("vscode"),Rt=L(),Oo=W(),Lo=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,n){let i=this.client,r=this.middleware,s=(c,d,l)=>{let g=i.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return i.sendRequest(Rt.CallHierarchyPrepareRequest.type,g,l).then(h=>l.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>i.handleFailedRequest(Rt.CallHierarchyPrepareRequest.type,l,h,null))};return r.prepareCallHierarchy?r.prepareCallHierarchy(e,t,n,s):s(e,t,n)}provideCallHierarchyIncomingCalls(e,t){let n=this.client,i=this.middleware,r=(s,c)=>{let d={item:n.code2ProtocolConverter.asCallHierarchyItem(s)};return n.sendRequest(Rt.CallHierarchyIncomingCallsRequest.type,d,c).then(l=>c.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,c),l=>n.handleFailedRequest(Rt.CallHierarchyIncomingCallsRequest.type,c,l,null))};return i.provideCallHierarchyIncomingCalls?i.provideCallHierarchyIncomingCalls(e,t,r):r(e,t)}provideCallHierarchyOutgoingCalls(e,t){let n=this.client,i=this.middleware,r=(s,c)=>{let d={item:n.code2ProtocolConverter.asCallHierarchyItem(s)};return n.sendRequest(Rt.CallHierarchyOutgoingCallsRequest.type,d,c).then(l=>c.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,c),l=>n.handleFailedRequest(Rt.CallHierarchyOutgoingCallsRequest.type,c,l,null))};return i.provideCallHierarchyOutgoingCalls?i.provideCallHierarchyOutgoingCalls(e,t,r):r(e,t)}},Uo=class extends Oo.TextDocumentLanguageFeature{constructor(e){super(e,Rt.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=e,n=(0,Oo.ensure)((0,Oo.ensure)(t,"textDocument"),"callHierarchy");n.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.callHierarchyProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=this._client,n=new Lo(t);return[ll.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};Ki.CallHierarchyFeature=Uo});var Kc=F(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.SemanticTokensFeature=void 0;var ji=I("vscode"),U=L(),bn=W(),pl=Ie(),No=class extends bn.TextDocumentLanguageFeature{constructor(e){super(e,U.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){let t=(0,bn.ensure)((0,bn.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[U.SemanticTokenTypes.namespace,U.SemanticTokenTypes.type,U.SemanticTokenTypes.class,U.SemanticTokenTypes.enum,U.SemanticTokenTypes.interface,U.SemanticTokenTypes.struct,U.SemanticTokenTypes.typeParameter,U.SemanticTokenTypes.parameter,U.SemanticTokenTypes.variable,U.SemanticTokenTypes.property,U.SemanticTokenTypes.enumMember,U.SemanticTokenTypes.event,U.SemanticTokenTypes.function,U.SemanticTokenTypes.method,U.SemanticTokenTypes.macro,U.SemanticTokenTypes.keyword,U.SemanticTokenTypes.modifier,U.SemanticTokenTypes.comment,U.SemanticTokenTypes.string,U.SemanticTokenTypes.number,U.SemanticTokenTypes.regexp,U.SemanticTokenTypes.operator,U.SemanticTokenTypes.decorator],t.tokenModifiers=[U.SemanticTokenModifiers.declaration,U.SemanticTokenModifiers.definition,U.SemanticTokenModifiers.readonly,U.SemanticTokenModifiers.static,U.SemanticTokenModifiers.deprecated,U.SemanticTokenModifiers.abstract,U.SemanticTokenModifiers.async,U.SemanticTokenModifiers.modification,U.SemanticTokenModifiers.documentation,U.SemanticTokenModifiers.defaultLibrary],t.formats=[U.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,bn.ensure)((0,bn.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(U.SemanticTokensRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeSemanticTokensEmitter.fire()});let[i,r]=this.getRegistration(t,e.semanticTokensProvider);!i||!r||this.register({id:i,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n=pl.boolean(e.full)?e.full:e.full!==void 0,i=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,r=new ji.EventEmitter,s=n?{onDidChangeSemanticTokens:r.event,provideDocumentSemanticTokens:(v,p)=>{let y=this._client,C=y.middleware,b=(T,P)=>{let q={textDocument:y.code2ProtocolConverter.asTextDocumentIdentifier(T)};return y.sendRequest(U.SemanticTokensRequest.type,q,P).then(ce=>P.isCancellationRequested?null:y.protocol2CodeConverter.asSemanticTokens(ce,P),ce=>y.handleFailedRequest(U.SemanticTokensRequest.type,P,ce,null))};return C.provideDocumentSemanticTokens?C.provideDocumentSemanticTokens(v,p,b):b(v,p)},provideDocumentSemanticTokensEdits:i?(v,p,y)=>{let C=this._client,b=C.middleware,T=(P,q,ce)=>{let V={textDocument:C.code2ProtocolConverter.asTextDocumentIdentifier(P),previousResultId:q};return C.sendRequest(U.SemanticTokensDeltaRequest.type,V,ce).then(async X=>ce.isCancellationRequested?null:U.SemanticTokens.is(X)?await C.protocol2CodeConverter.asSemanticTokens(X,ce):await C.protocol2CodeConverter.asSemanticTokensEdits(X,ce),X=>C.handleFailedRequest(U.SemanticTokensDeltaRequest.type,ce,X,null))};return b.provideDocumentSemanticTokensEdits?b.provideDocumentSemanticTokensEdits(v,p,y,T):T(v,p,y)}:void 0}:void 0,d=e.range===!0?{provideDocumentRangeSemanticTokens:(v,p,y)=>{let C=this._client,b=C.middleware,T=(P,q,ce)=>{let V={textDocument:C.code2ProtocolConverter.asTextDocumentIdentifier(P),range:C.code2ProtocolConverter.asRange(q)};return C.sendRequest(U.SemanticTokensRangeRequest.type,V,ce).then(X=>ce.isCancellationRequested?null:C.protocol2CodeConverter.asSemanticTokens(X,ce),X=>C.handleFailedRequest(U.SemanticTokensRangeRequest.type,ce,X,null))};return b.provideDocumentRangeSemanticTokens?b.provideDocumentRangeSemanticTokens(v,p,y,T):T(v,p,y)}}:void 0,l=[],g=this._client,h=g.protocol2CodeConverter.asSemanticTokensLegend(e.legend),f=g.protocol2CodeConverter.asDocumentSelector(t);return s!==void 0&&l.push(ji.languages.registerDocumentSemanticTokensProvider(f,s,h)),d!==void 0&&l.push(ji.languages.registerDocumentRangeSemanticTokensProvider(f,d,h)),[new ji.Disposable(()=>l.forEach(v=>v.dispose())),{range:d,full:s,onDidChangeSemanticTokensEmitter:r}]}};Wi.SemanticTokensFeature=No});var $c=F(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.WillDeleteFilesFeature=_e.WillRenameFilesFeature=_e.WillCreateFilesFeature=_e.DidDeleteFilesFeature=_e.DidRenameFilesFeature=_e.DidCreateFilesFeature=void 0;var Oe=I("vscode"),fl=Dr(),nt=L(),hl=te();function jc(a,e){return a[e]===void 0&&(a[e]={}),a[e]}function gl(a,e){return a[e]}function Wc(a,e,t){a[e]=t}var _n=class a{constructor(e,t,n,i,r){this._client=e,this._event=t,this._registrationType=n,this._clientCapability=i,this._serverCapability=r,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){let t=jc(jc(e,"workspace"),"fileOperations");Wc(t,"dynamicRegistration",!0),Wc(t,this._clientCapability,!0)}initialize(e){let t=e.workspace?.fileOperations,n=t!==void 0?gl(t,this._serverCapability):void 0;if(n?.filters!==void 0)try{this.register({id:hl.generateUuid(),registerOptions:{filters:n.filters}})}catch(i){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${i}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));let t=e.registerOptions.filters.map(n=>{let i=new fl.Minimatch(n.pattern.glob,a.asMinimatchOptions(n.pattern.options));if(!i.makeRe())throw new Error(`Invalid pattern ${n.pattern.glob}!`);return{scheme:n.scheme,matcher:i,kind:n.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return a.getFileType(e)}async filter(e,t){let n=await Promise.all(e.files.map(async r=>{let s=t(r),c=s.fsPath.replace(/\\/g,"/");for(let d of this._filters.values())for(let l of d)if(!(l.scheme!==void 0&&l.scheme!==s.scheme)){if(l.matcher.match(c)){if(l.kind===void 0)return!0;let g=await this.getFileType(s);if(g===void 0)return this._client.error(`Failed to determine file type for ${s.toString()}.`),!0;if(g===Oe.FileType.File&&l.kind===nt.FileOperationPatternKind.file||g===Oe.FileType.Directory&&l.kind===nt.FileOperationPatternKind.folder)return!0}else if(l.kind===nt.FileOperationPatternKind.folder&&await a.getFileType(s)===Oe.FileType.Directory&&l.matcher.match(`${c}/`))return!0}return!1})),i=e.files.filter((r,s)=>n[s]);return{...e,files:i}}static async getFileType(e){try{return(await Oe.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){let t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}},$i=class extends _n{constructor(e,t,n,i,r,s,c){super(e,t,n,i,r),this._notificationType=n,this._accessUri=s,this._createParams=c}async send(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=async i=>this._client.sendNotification(this._notificationType,this._createParams(i));return this.doSend(t,n)}}},zi=class extends $i{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){let t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);let n=await _n.getFileType(e);return n&&this._fsPathFileTypes.set(t,n),n}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}},Ho=class extends $i{constructor(e){super(e,Oe.workspace.onDidCreateFiles,nt.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.didCreateFiles?n.didCreateFiles(e,t):t(e)}};_e.DidCreateFilesFeature=Ho;var Ko=class extends zi{constructor(e){super(e,Oe.workspace.onDidRenameFiles,nt.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=Oe.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didRenameFiles?n.didRenameFiles(e,t):t(e)}};_e.DidRenameFilesFeature=Ko;var jo=class extends zi{constructor(e){super(e,Oe.workspace.onDidDeleteFiles,nt.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=Oe.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didDeleteFiles?n.didDeleteFiles(e,t):t(e)}};_e.DidDeleteFilesFeature=jo;var Tn=class extends _n{constructor(e,t,n,i,r,s,c){super(e,t,n,i,r),this._requestType=n,this._accessUri=s,this._createParams=c}async send(e){let t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=i=>this._client.sendRequest(this._requestType,this._createParams(i),i.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,n)}else return}},Wo=class extends Tn{constructor(e){super(e,Oe.workspace.onWillCreateFiles,nt.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willCreateFiles?n.willCreateFiles(e,t):t(e)}};_e.WillCreateFilesFeature=Wo;var $o=class extends Tn{constructor(e){super(e,Oe.workspace.onWillRenameFiles,nt.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willRenameFiles?n.willRenameFiles(e,t):t(e)}};_e.WillRenameFilesFeature=$o;var zo=class extends Tn{constructor(e){super(e,Oe.workspace.onWillDeleteFiles,nt.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willDeleteFiles?n.willDeleteFiles(e,t):t(e)}};_e.WillDeleteFilesFeature=zo});var zc=F(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.LinkedEditingFeature=void 0;var ml=I("vscode"),Vo=L(),Bo=W(),Yo=class extends Bo.TextDocumentLanguageFeature{constructor(e){super(e,Vo.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){let t=(0,Bo.ensure)((0,Bo.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.linkedEditingRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideLinkedEditingRanges:(i,r,s)=>{let c=this._client,d=(g,h,f)=>c.sendRequest(Vo.LinkedEditingRangeRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(g,h),f).then(v=>f.isCancellationRequested?null:c.protocol2CodeConverter.asLinkedEditingRanges(v,f),v=>c.handleFailedRequest(Vo.LinkedEditingRangeRequest.type,f,v,null)),l=c.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(i,r,s,d):d(i,r,s)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return ml.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Vi.LinkedEditingFeature=Yo});var Vc=F(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.TypeHierarchyFeature=void 0;var vl=I("vscode"),xt=L(),Jo=W(),Qo=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,n){let i=this.client,r=this.middleware,s=(c,d,l)=>{let g=i.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return i.sendRequest(xt.TypeHierarchyPrepareRequest.type,g,l).then(h=>l.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>i.handleFailedRequest(xt.TypeHierarchyPrepareRequest.type,l,h,null))};return r.prepareTypeHierarchy?r.prepareTypeHierarchy(e,t,n,s):s(e,t,n)}provideTypeHierarchySupertypes(e,t){let n=this.client,i=this.middleware,r=(s,c)=>{let d={item:n.code2ProtocolConverter.asTypeHierarchyItem(s)};return n.sendRequest(xt.TypeHierarchySupertypesRequest.type,d,c).then(l=>c.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(l,c),l=>n.handleFailedRequest(xt.TypeHierarchySupertypesRequest.type,c,l,null))};return i.provideTypeHierarchySupertypes?i.provideTypeHierarchySupertypes(e,t,r):r(e,t)}provideTypeHierarchySubtypes(e,t){let n=this.client,i=this.middleware,r=(s,c)=>{let d={item:n.code2ProtocolConverter.asTypeHierarchyItem(s)};return n.sendRequest(xt.TypeHierarchySubtypesRequest.type,d,c).then(l=>c.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(l,c),l=>n.handleFailedRequest(xt.TypeHierarchySubtypesRequest.type,c,l,null))};return i.provideTypeHierarchySubtypes?i.provideTypeHierarchySubtypes(e,t,r):r(e,t)}},Go=class extends Jo.TextDocumentLanguageFeature{constructor(e){super(e,xt.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=(0,Jo.ensure)((0,Jo.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.typeHierarchyProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=this._client,n=new Qo(t);return[vl.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};Bi.TypeHierarchyFeature=Go});var Yc=F(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.InlineValueFeature=void 0;var Bc=I("vscode"),Yi=L(),kn=W(),Zo=class extends kn.TextDocumentLanguageFeature{constructor(e){super(e,Yi.InlineValueRequest.type)}fillClientCapabilities(e){(0,kn.ensure)((0,kn.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,kn.ensure)((0,kn.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(Yi.InlineValueRefreshRequest.type,async()=>{for(let r of this.getAllProviders())r.onDidChangeInlineValues.fire()});let[n,i]=this.getRegistration(t,e.inlineValueProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new Bc.EventEmitter,i={onDidChangeInlineValues:n.event,provideInlineValues:(r,s,c,d)=>{let l=this._client,g=(f,v,p,y)=>{let C={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(f),range:l.code2ProtocolConverter.asRange(v),context:l.code2ProtocolConverter.asInlineValueContext(p)};return l.sendRequest(Yi.InlineValueRequest.type,C,y).then(b=>y.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,y),b=>l.handleFailedRequest(Yi.InlineValueRequest.type,y,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(r,s,c,d,g):g(r,s,c,d)}};return[this.registerProvider(t,i),{provider:i,onDidChangeInlineValues:n}]}registerProvider(e,t){return Bc.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Ji.InlineValueFeature=Zo});var Qc=F(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.InlayHintsFeature=void 0;var Jc=I("vscode"),Yt=L(),Pn=W(),Xo=class extends Pn.TextDocumentLanguageFeature{constructor(e){super(e,Yt.InlayHintRequest.type)}fillClientCapabilities(e){let t=(0,Pn.ensure)((0,Pn.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,Pn.ensure)((0,Pn.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(Yt.InlayHintRefreshRequest.type,async()=>{for(let r of this.getAllProviders())r.onDidChangeInlayHints.fire()});let[n,i]=this.getRegistration(t,e.inlayHintProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new Jc.EventEmitter,i={onDidChangeInlayHints:n.event,provideInlayHints:(r,s,c)=>{let d=this._client,l=async(h,f,v)=>{let p={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(h),range:d.code2ProtocolConverter.asRange(f)};try{let y=await d.sendRequest(Yt.InlayHintRequest.type,p,v);return v.isCancellationRequested?null:d.protocol2CodeConverter.asInlayHints(y,v)}catch(y){return d.handleFailedRequest(Yt.InlayHintRequest.type,v,y,null)}},g=d.middleware;return g.provideInlayHints?g.provideInlayHints(r,s,c,l):l(r,s,c)}};return i.resolveInlayHint=e.resolveProvider===!0?(r,s)=>{let c=this._client,d=async(g,h)=>{try{let f=await c.sendRequest(Yt.InlayHintResolveRequest.type,c.code2ProtocolConverter.asInlayHint(g),h);if(h.isCancellationRequested)return null;let v=c.protocol2CodeConverter.asInlayHint(f,h);return h.isCancellationRequested?null:v}catch(f){return c.handleFailedRequest(Yt.InlayHintResolveRequest.type,h,f,null)}},l=c.middleware;return l.resolveInlayHint?l.resolveInlayHint(r,s,d):d(r,s)}:void 0,[this.registerProvider(t,i),{provider:i,onDidChangeInlayHints:n}]}registerProvider(e,t){return Jc.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Qi.InlayHintsFeature=Xo});var Gc=F(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.InlineCompletionItemFeature=void 0;var yl=I("vscode"),ea=L(),ta=W(),Cl=te(),na=class extends ta.TextDocumentLanguageFeature{constructor(e){super(e,ea.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,ta.ensure)((0,ta.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.inlineCompletionProvider);n&&this.register({id:Cl.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideInlineCompletionItems:(i,r,s,c)=>{let d=this._client,l=this._client.middleware,g=(h,f,v,p)=>d.sendRequest(ea.InlineCompletionRequest.type,d.code2ProtocolConverter.asInlineCompletionParams(h,f,v),p).then(y=>p.isCancellationRequested?null:d.protocol2CodeConverter.asInlineCompletionResult(y,p),y=>d.handleFailedRequest(ea.InlineCompletionRequest.type,p,y,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(i,r,s,c,g):g(i,r,s,c)}};return[yl.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Gi.InlineCompletionItemFeature=na});var ca=F(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.ProposedFeatures=me.BaseLanguageClient=me.MessageTransports=me.SuspendMode=me.State=me.CloseAction=me.ErrorAction=me.RevealOutputChannelOn=void 0;var Y=I("vscode"),_=L(),wl=Ba(),Dl=Qa(),je=Ie(),Zi=oi(),Zc=te(),Sl=fs(),Ke=W(),bl=ks(),Xc=ac(),ed=dc(),Jt=uc(),_l=lc(),Tl=pc(),kl=fc(),Pl=gc(),Rl=mc(),xl=Gs(),Fl=yc(),ql=Cc(),Il=wc(),El=Sc(),ia=bc(),Ml=Tc(),Al=kc(),Ol=Rc(),Ll=xc(),Ul=Fc(),Nl=qc(),Hl=Ic(),Kl=Ec(),jl=Ac(),Wl=Oc(),$l=Lc(),zl=Nc(),Vl=Hc(),Bl=Kc(),Qt=$c(),Yl=zc(),Jl=Vc(),Ql=Yc(),Gl=Qc(),Zl=Gc(),Ft;(function(a){a[a.Debug=0]="Debug",a[a.Info=1]="Info",a[a.Warn=2]="Warn",a[a.Error=3]="Error",a[a.Never=4]="Never"})(Ft||(me.RevealOutputChannelOn=Ft={}));var xn;(function(a){a[a.Continue=1]="Continue",a[a.Shutdown=2]="Shutdown"})(xn||(me.ErrorAction=xn={}));var mt;(function(a){a[a.DoNotRestart=1]="DoNotRestart",a[a.Restart=2]="Restart"})(mt||(me.CloseAction=mt={}));var Rn;(function(a){a[a.Stopped=1]="Stopped",a[a.Starting=3]="Starting",a[a.Running=2]="Running"})(Rn||(me.State=Rn={}));var td;(function(a){a.off="off",a.on="on"})(td||(me.SuspendMode=td={}));var ra;(function(a){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&je.stringArray(t.enabledCommands)?t:!1}a.sanitizeIsTrusted=e})(ra||(ra={}));var sa=class{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,n){return n&&n<=3?{action:xn.Continue}:{action:xn.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:mt.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=180*1e3?{action:mt.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:mt.Restart})}},N;(function(a){a.Initial="initial",a.Starting="starting",a.StartFailed="startFailed",a.Running="running",a.Stopping="stopping",a.Stopped="stopped"})(N||(N={}));var nd;(function(a){function e(t){return t&&_.MessageReader.is(t.reader)&&_.MessageWriter.is(t.writer)}a.is=e})(nd||(me.MessageTransports=nd={}));var Fn=class a{constructor(e,t,n){this._traceFormat=_.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new Zi.Semaphore(1),this._id=e,this._name=t,n=n||{};let i={isTrusted:!1,supportHtml:!1};n.markdown!==void 0&&(i.isTrusted=ra.sanitizeIsTrusted(n.markdown.isTrusted),i.supportHtml=n.markdown.supportHtml===!0),this._clientOptions={documentSelector:n.documentSelector??[],synchronize:n.synchronize??{},diagnosticCollectionName:n.diagnosticCollectionName,outputChannelName:n.outputChannelName??this._name,revealOutputChannelOn:n.revealOutputChannelOn??Ft.Error,stdioEncoding:n.stdioEncoding??"utf8",initializationOptions:n.initializationOptions,initializationFailedHandler:n.initializationFailedHandler,progressOnInitialization:!!n.progressOnInitialization,errorHandler:n.errorHandler??this.createDefaultErrorHandler(n.connectionOptions?.maxRestartCount),middleware:n.middleware??{},uriConverters:n.uriConverters,workspaceFolder:n.workspaceFolder,connectionOptions:n.connectionOptions,markdown:i,diagnosticPullOptions:n.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:n.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=N.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,n.outputChannel?(this._outputChannel=n.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=n.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new Zi.Semaphore(1),this._pendingChangeDelayer=new Zi.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new Zi.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new _.Emitter,this._stateChangeEmitter=new _.Emitter,this._trace=_.Trace.Off,this._tracer={log:(r,s)=>{je.string(r)?this.logTrace(r,s):this.logObjectTrace(r)}},this._c2p=wl.createConverter(n.uriConverters?n.uriConverters.code2Protocol:void 0),this._p2c=Dl.createConverter(n.uriConverters?n.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=Y.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let n=this.getPublicState();n!==t&&this._stateChangeEmitter.fire({oldState:t,newState:n})}getPublicState(){switch(this.$state){case N.Starting:return Rn.Starting;case N.Running:return Rn.Running;default:return Rn.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===N.StartFailed||this.$state===N.Stopping||this.$state===N.Stopped)return Promise.reject(new _.ResponseError(_.ErrorCodes.ConnectionInactive,"Client is not running"));let n=await this.$start();this._didChangeTextDocumentFeature.syncKind===_.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(n);let i=this._clientOptions.middleware?.sendRequest;if(i!==void 0){let r,s;return t.length===1?_.CancellationToken.is(t[0])?s=t[0]:r=t[0]:t.length===2&&(r=t[0],s=t[1]),i(e,r,s,(c,d,l)=>{let g=[];return d!==void 0&&g.push(d),l!==void 0&&g.push(l),n.sendRequest(c,...g)})}else return n.sendRequest(e,...t)}onRequest(e,t){let n=typeof e=="string"?e:e.method;this._requestHandlers.set(n,t);let i=this.activeConnection(),r;return i!==void 0?(this._requestDisposables.set(n,i.onRequest(e,t)),r={dispose:()=>{let s=this._requestDisposables.get(n);s!==void 0&&(s.dispose(),this._requestDisposables.delete(n))}}):(this._pendingRequestHandlers.set(n,t),r={dispose:()=>{this._pendingRequestHandlers.delete(n);let s=this._requestDisposables.get(n);s!==void 0&&(s.dispose(),this._requestDisposables.delete(n))}}),{dispose:()=>{this._requestHandlers.delete(n),r.dispose()}}}async sendNotification(e,t){if(this.$state===N.StartFailed||this.$state===N.Stopping||this.$state===N.Stopped)return Promise.reject(new _.ResponseError(_.ErrorCodes.ConnectionInactive,"Client is not running"));let n=this._didChangeTextDocumentFeature.syncKind===_.TextDocumentSyncKind.Full,i;n&&typeof e!="string"&&e.method===_.DidOpenTextDocumentNotification.method&&(i=t?.textDocument.uri,this._pendingOpenNotifications.add(i));let r=await this.$start();n&&await this.sendPendingFullTextDocumentChanges(r),i!==void 0&&this._pendingOpenNotifications.delete(i);let s=this._clientOptions.middleware?.sendNotification;return s?s(e,r.sendNotification.bind(r),t):r.sendNotification(e,t)}onNotification(e,t){let n=typeof e=="string"?e:e.method;this._notificationHandlers.set(n,t);let i=this.activeConnection(),r;return i!==void 0?(this._notificationDisposables.set(n,i.onNotification(e,t)),r={dispose:()=>{let s=this._notificationDisposables.get(n);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(n))}}):(this._pendingNotificationHandlers.set(n,t),r={dispose:()=>{this._pendingNotificationHandlers.delete(n);let s=this._notificationDisposables.get(n);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(n))}}),{dispose:()=>{this._notificationHandlers.delete(n),r.dispose()}}}async sendProgress(e,t,n){if(this.$state===N.StartFailed||this.$state===N.Stopping||this.$state===N.Stopped)return Promise.reject(new _.ResponseError(_.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,n)}catch(i){throw this.error(`Sending progress for token ${t} failed.`,i),i}}onProgress(e,t,n){this._progressHandlers.set(t,{type:e,handler:n});let i=this.activeConnection(),r,s=this._clientOptions.middleware?.handleWorkDoneProgress,c=_.WorkDoneProgress.is(e)&&s!==void 0?d=>{s(t,d,()=>n(d))}:n;return i!==void 0?(this._progressDisposables.set(t,i.onProgress(e,t,c)),r={dispose:()=>{let d=this._progressDisposables.get(t);d!==void 0&&(d.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:n}),r={dispose:()=>{this._pendingProgressHandlers.delete(t);let d=this._progressDisposables.get(t);d!==void 0&&(d.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),r.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new sa(this,e??4)}async setTrace(e){this._trace=e;let t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof _.ResponseError){let t=e;return` Message: ${t.message}
5
+ import{H as bc,I as Sc,J as fs,L as Dc,M as Pc,a as I,b as M,d as Yn,e as td,g as $i,h as Re,i as _e,j as Qn,k as ds,l as N,m as Sn,n as Dn,o as nd,p as id,q as rd,s as sd,t as od}from"./chunk-W6FPGVXO.js";var Mc=M((Cv,xc)=>{"use strict";var{hasOwnProperty:ys}=Object.prototype,_s=(r,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process<"u"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r
6
+ `:`
7
+ `,n=e.whitespace?" = ":"=",i=[],s=e.sort?Object.keys(r).sort():Object.keys(r),o=0;e.align&&(o=Pt(s.filter(l=>r[l]===null||Array.isArray(r[l])||typeof r[l]!="object").map(l=>Array.isArray(r[l])?`${l}[]`:l).concat([""]).reduce((l,p)=>Pt(l).length>=Pt(p).length?l:p)).length);let a="",u=e.bracketedArray?"[]":"";for(let l of s){let p=r[l];if(p&&Array.isArray(p))for(let h of p)a+=Pt(`${l}${u}`).padEnd(o," ")+n+Pt(h)+t;else p&&typeof p=="object"?i.push(l):a+=Pt(l).padEnd(o," ")+n+Pt(p)+t}e.section&&a.length&&(a="["+Pt(e.section)+"]"+(e.newline?t+t:t)+a);for(let l of i){let p=Oc(l,".").join("\\."),h=(e.section?e.section+".":"")+p,f=_s(r[l],{...e,section:h});a.length&&f.length&&(a+=t),a+=f}return a};function Oc(r,e){var t=0,n=0,i=0,s=[];do if(i=r.indexOf(e,t),i!==-1){if(t=i+e.length,i>0&&r[i-1]==="\\")continue;s.push(r.slice(n,i)),n=i+e.length}while(i!==-1);return s.push(r.slice(n)),s}var Rc=(r,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),n=t,i=null,s=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=r.split(/[\r\n]+/g),a={};for(let l of o){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;let p=l.match(s);if(!p)continue;if(p[1]!==void 0){if(i=Vi(p[1]),i==="__proto__"){n=Object.create(null);continue}n=t[i]=t[i]||Object.create(null);continue}let h=Vi(p[2]),f;e.bracketedArray?f=h.length>2&&h.slice(-2)==="[]":(a[h]=(a?.[h]||0)+1,f=a[h]>1);let m=f&&h.endsWith("[]")?h.slice(0,-2):h;if(m==="__proto__")continue;let g=p[3]?Vi(p[4]):!0,v=g==="true"||g==="false"||g==="null"?JSON.parse(g):g;f&&(ys.call(n,m)?Array.isArray(n[m])||(n[m]=[n[m]]):n[m]=[]),Array.isArray(n[m])?n[m].push(v):n[m]=v}let u=[];for(let l of Object.keys(t)){if(!ys.call(t,l)||typeof t[l]!="object"||Array.isArray(t[l]))continue;let p=Oc(l,".");n=t;let h=p.pop(),f=h.replace(/\\\./g,".");for(let m of p)m!=="__proto__"&&((!ys.call(n,m)||typeof n[m]!="object")&&(n[m]=Object.create(null)),n=n[m]);n===t&&f===h||(n[f]=t[l],u.push(l))}for(let l of u)delete t[l];return t},Fc=r=>r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"),Pt=r=>typeof r!="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&Fc(r)||r!==r.trim()?JSON.stringify(r):r.split(";").join("\\;").split("#").join("\\#"),Vi=r=>{if(r=(r||"").trim(),Fc(r)){r.charAt(0)==="'"&&(r=r.slice(1,-1));try{r=JSON.parse(r)}catch{}}else{let e=!1,t="";for(let n=0,i=r.length;n<i;n++){let s=r.charAt(n);if(e)"\\;#".indexOf(s)!==-1?t+=s:t+="\\"+s,e=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?e=!0:t+=s}}return e&&(t+="\\"),t.trim()}return r};xc.exports={parse:Rc,decode:Rc,stringify:_s,encode:_s,safe:Pt,unsafe:Vi}});var He=M(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.boolean=pd;Ke.string=Ec;Ke.number=gd;Ke.error=md;Ke.func=qc;Ke.array=Ic;Ke.stringArray=vd;Ke.typedArray=yd;Ke.thenable=Ac;Ke.asPromise=_d;function pd(r){return r===!0||r===!1}function Ec(r){return typeof r=="string"||r instanceof String}function gd(r){return typeof r=="number"||r instanceof Number}function md(r){return r instanceof Error}function qc(r){return typeof r=="function"}function Ic(r){return Array.isArray(r)}function vd(r){return Ic(r)&&r.every(e=>Ec(e))}function yd(r,e){return Array.isArray(r)&&r.every(e)}function Ac(r){return r&&qc(r.then)}function _d(r){return r instanceof Promise?r:Ac(r)?new Promise((e,t)=>{r.then(n=>e(n),n=>t(n))}):Promise.resolve(r)}});var Qi=M(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.Semaphore=Je.Delayer=void 0;Je.setTestMode=wd;Je.clearTestMode=Cd;Je.map=bd;Je.mapAsync=Sd;Je.forEach=Dd;var ni=N(),Ds=class{defaultDelay;timeout;completionPromise;onSuccess;task;constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(n=>{this.onSuccess=n}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;let n=this.task();return this.task=void 0,n})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,ni.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}};Je.Delayer=Ds;var Ps=class{_capacity;_active;_waiting;constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,ni.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Je.Semaphore=Ps;var Ts=!1;function wd(){Ts=!0}function Cd(){Ts=!1}var jc=15,ti=class{yieldAfter;startTime;counter;total;counterInterval;constructor(e=jc){this.yieldAfter=Ts===!0?Math.max(e,2):Math.max(e,jc),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){let e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}};async function bd(r,e,t,n){if(r.length===0)return[];let i=new Array(r.length),s=new ti(n?.yieldAfter);function o(u){s.start();for(let l=u;l<r.length;l++)if(i[l]=e(r[l]),s.shouldYield())return n?.yieldCallback&&n.yieldCallback(),l+1;return-1}let a=o(0);for(;a!==-1&&!(t!==void 0&&t.isCancellationRequested);)a=await new Promise(u=>{(0,ni.RAL)().timer.setImmediate(()=>{t!==void 0&&t.isCancellationRequested?u(-1):u(o(a))})});return i}async function Sd(r,e,t,n){if(r.length===0)return[];let i=new Array(r.length),s=new ti(n?.yieldAfter);async function o(u){s.start();for(let l=u;l<r.length;l++)if(i[l]=await e(r[l],t),s.shouldYield())return n?.yieldCallback&&n.yieldCallback(),l+1;return-1}let a=await o(0);for(;a!==-1&&!(t!==void 0&&t.isCancellationRequested);)a=await new Promise(u=>{(0,ni.RAL)().timer.setImmediate(()=>{t!==void 0&&t.isCancellationRequested?u(-1):u(o(a))})});return i}async function Dd(r,e,t,n){if(r.length===0)return;let i=new ti(n?.yieldAfter);function s(a){i.start();for(let u=a;u<r.length;u++)if(e(r[u]),i.shouldYield())return n?.yieldCallback&&n.yieldCallback(),u+1;return-1}let o=s(0);for(;o!==-1&&!(t!==void 0&&t.isCancellationRequested);)o=await new Promise(a=>{(0,ni.RAL)().timer.setImmediate(()=>{t!==void 0&&t.isCancellationRequested?a(-1):a(s(o))})})}});var Os=M(Tt=>{"use strict";var Pd=Tt&&Tt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Td=Tt&&Tt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Rd=Tt&&Tt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Pd(t,e,n[i]);return Td(t,e),t}})();Object.defineProperty(Tt,"__esModule",{value:!0});var Od=Rd(I("vscode")),Rs=class extends Od.CompletionItem{data;fromEdit;documentationFormat;originalItemKind;deprecated;insertTextMode;constructor(e){super(e)}};Tt.default=Rs});var xs=M(Rt=>{"use strict";var Fd=Rt&&Rt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),xd=Rt&&Rt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Md=Rt&&Rt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Fd(t,e,n[i]);return xd(t,e),t}})();Object.defineProperty(Rt,"__esModule",{value:!0});var kd=Md(I("vscode")),Fs=class extends kd.CodeLens{data;constructor(e){super(e)}};Rt.default=Fs});var ks=M(Ot=>{"use strict";var Ed=Ot&&Ot.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),qd=Ot&&Ot.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Id=Ot&&Ot.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Ed(t,e,n[i]);return qd(t,e),t}})();Object.defineProperty(Ot,"__esModule",{value:!0});var Ad=Id(I("vscode")),Ms=class extends Ad.DocumentLink{data;constructor(e,t){super(e,t)}};Ot.default=Ms});var qs=M(Ft=>{"use strict";var jd=Ft&&Ft.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Ld=Ft&&Ft.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nd=Ft&&Ft.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&jd(t,e,n[i]);return Ld(t,e),t}})();Object.defineProperty(Ft,"__esModule",{value:!0});var Ud=Nd(I("vscode")),Es=class extends Ud.CodeAction{data;constructor(e,t){super(e),this.data=t}};Ft.default=Es});var js=M(We=>{"use strict";var Kd=We&&We.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Hd=We&&We.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nc=We&&We.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Kd(t,e,n[i]);return Hd(t,e),t}})();Object.defineProperty(We,"__esModule",{value:!0});We.ProtocolDiagnostic=We.DiagnosticCode=void 0;var Wd=Nc(I("vscode")),Is=Nc(He()),Lc;(function(r){function e(t){let n=t;return n!=null&&(Is.number(n.value)||Is.string(n.value))&&Is.string(n.target)}r.is=e})(Lc||(We.DiagnosticCode=Lc={}));var As=class extends Wd.Diagnostic{data;hasDiagnosticCode;constructor(e,t,n,i){super(e,t,n),this.data=i,this.hasDiagnosticCode=!1}};We.ProtocolDiagnostic=As});var Ns=M(xt=>{"use strict";var $d=xt&&xt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Bd=xt&&xt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),zd=xt&&xt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&$d(t,e,n[i]);return Bd(t,e),t}})();Object.defineProperty(xt,"__esModule",{value:!0});var Vd=zd(I("vscode")),Ls=class extends Vd.CallHierarchyItem{data;constructor(e,t,n,i,s,o,a){super(e,t,n,i,s,o),a!==void 0&&(this.data=a)}};xt.default=Ls});var Ks=M(Mt=>{"use strict";var Gd=Mt&&Mt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Jd=Mt&&Mt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Yd=Mt&&Mt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Gd(t,e,n[i]);return Jd(t,e),t}})();Object.defineProperty(Mt,"__esModule",{value:!0});var Qd=Yd(I("vscode")),Us=class extends Qd.TypeHierarchyItem{data;constructor(e,t,n,i,s,o,a){super(e,t,n,i,s,o),a!==void 0&&(this.data=a)}};Mt.default=Us});var Ws=M(kt=>{"use strict";var Zd=kt&&kt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Xd=kt&&kt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),ef=kt&&kt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Zd(t,e,n[i]);return Xd(t,e),t}})();Object.defineProperty(kt,"__esModule",{value:!0});var Zi=ef(I("vscode")),Hs=class extends Zi.SymbolInformation{data;hasRange;constructor(e,t,n,i,s){let o=!(i instanceof Zi.Uri);super(e,t,n,o?i:new Zi.Location(i,new Zi.Range(0,0,0,0))),this.hasRange=o,s!==void 0&&(this.data=s)}};kt.default=Hs});var Bs=M(Et=>{"use strict";var tf=Et&&Et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),nf=Et&&Et.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),rf=Et&&Et.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&tf(t,e,n[i]);return nf(t,e),t}})();Object.defineProperty(Et,"__esModule",{value:!0});var sf=rf(I("vscode")),$s=class extends sf.InlayHint{data;constructor(e,t,n){super(e,t,n)}};Et.default=$s});var Wc=M(Ye=>{"use strict";var of=Ye&&Ye.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),af=Ye&&Ye.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Xi=Ye&&Ye.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&of(t,e,n[i]);return af(t,e),t}})(),Vt=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConverter=gf;var de=Xi(I("vscode")),L=Xi(N()),an=Xi(He()),Uc=Xi(Qi()),cf=Vt(Os()),uf=Vt(xs()),lf=Vt(ks()),Kc=Vt(qs()),Hc=js(),df=Vt(Ns()),ff=Vt(Ks()),hf=Vt(Ws()),pf=Vt(Bs()),zs;(function(r){function e(t){let n=t;return n&&!!n.inserting&&!!n.replacing}r.is=e})(zs||(zs={}));function gf(r){let t=r||(d=>d.toString());function n(d){return t(d)}function i(d){return{uri:t(d.uri)}}function s(d){return{uri:t(d.uri),languageId:d.languageId,version:d.version,text:d.getText()}}function o(d){return{uri:t(d.uri),version:d.version}}function a(d){return{textDocument:s(d)}}function u(d){let w=d;return!!w.document&&!!w.contentChanges}function l(d){let w=d;return!!w.uri&&!!w.version}function p(d,w,x){if(l(d))return{textDocument:{uri:t(d.uri),version:d.version},contentChanges:[{text:d.getText()}]};if(u(d)){let Z=w,V=x;return{textDocument:{uri:t(Z),version:V},contentChanges:d.contentChanges.map(ke=>{let St=ke.range;return{range:{start:{line:St.start.line,character:St.start.character},end:{line:St.end.line,character:St.end.character}},rangeLength:ke.rangeLength,text:ke.text}})}}else throw Error("Unsupported text document change parameter")}function h(d){return{textDocument:i(d)}}function f(d,w=!1){let x={textDocument:i(d)};return w&&(x.text=d.getText()),x}function m(d){switch(d){case de.TextDocumentSaveReason.Manual:return L.TextDocumentSaveReason.Manual;case de.TextDocumentSaveReason.AfterDelay:return L.TextDocumentSaveReason.AfterDelay;case de.TextDocumentSaveReason.FocusOut:return L.TextDocumentSaveReason.FocusOut}return L.TextDocumentSaveReason.Manual}function g(d){return{textDocument:i(d.document),reason:m(d.reason)}}function v(d){return{files:d.files.map(w=>({uri:t(w)}))}}function _(d){return{files:d.files.map(w=>({oldUri:t(w.oldUri),newUri:t(w.newUri)}))}}function T(d){return{files:d.files.map(w=>({uri:t(w)}))}}function C(d){return{files:d.files.map(w=>({uri:t(w)}))}}function D(d){return{files:d.files.map(w=>({oldUri:t(w.oldUri),newUri:t(w.newUri)}))}}function F(d){return{files:d.files.map(w=>({uri:t(w)}))}}function E(d,w){return{textDocument:i(d),position:rn(w)}}function Q(d){switch(d){case de.CompletionTriggerKind.TriggerCharacter:return L.CompletionTriggerKind.TriggerCharacter;case de.CompletionTriggerKind.TriggerForIncompleteCompletions:return L.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return L.CompletionTriggerKind.Invoked}}function we(d,w,x){return{textDocument:i(d),position:rn(w),context:{triggerKind:Q(x.triggerKind),triggerCharacter:x.triggerCharacter}}}function xe(d){switch(d){case de.SignatureHelpTriggerKind.Invoke:return L.SignatureHelpTriggerKind.Invoked;case de.SignatureHelpTriggerKind.TriggerCharacter:return L.SignatureHelpTriggerKind.TriggerCharacter;case de.SignatureHelpTriggerKind.ContentChange:return L.SignatureHelpTriggerKind.ContentChange}}function Un(d){return{label:d.label}}function $r(d){return d.map(Un)}function Kn(d){return{label:d.label,parameters:$r(d.parameters)}}function Br(d){return d.map(Kn)}function zr(d){return d===void 0?d:{signatures:Br(d.signatures),activeSignature:d.activeSignature,activeParameter:d.activeParameter}}function Vr(d,w,x){return{textDocument:i(d),position:rn(w),context:{isRetrigger:x.isRetrigger,triggerCharacter:x.triggerCharacter,triggerKind:xe(x.triggerKind),activeSignatureHelp:zr(x.activeSignatureHelp)}}}function rn(d){return{line:d.line,character:d.character}}function Ct(d){return d==null?d:{line:d.line>L.uinteger.MAX_VALUE?L.uinteger.MAX_VALUE:d.line,character:d.character>L.uinteger.MAX_VALUE?L.uinteger.MAX_VALUE:d.character}}function yn(d,w){return Uc.map(d,Ct,w)}function Ri(d){return d.map(Ct)}function he(d){return d==null?d:{start:Ct(d.start),end:Ct(d.end)}}function Gr(d){return d.map(he)}function Kt(d){return d==null?d:L.Location.create(n(d.uri),he(d.range))}function Hn(d){switch(d){case de.DiagnosticSeverity.Error:return L.DiagnosticSeverity.Error;case de.DiagnosticSeverity.Warning:return L.DiagnosticSeverity.Warning;case de.DiagnosticSeverity.Information:return L.DiagnosticSeverity.Information;case de.DiagnosticSeverity.Hint:return L.DiagnosticSeverity.Hint}}function Oi(d){if(!d)return;let w=[];for(let x of d){let Z=Wn(x);Z!==void 0&&w.push(Z)}return w.length>0?w:void 0}function Wn(d){switch(d){case de.DiagnosticTag.Unnecessary:return L.DiagnosticTag.Unnecessary;case de.DiagnosticTag.Deprecated:return L.DiagnosticTag.Deprecated;default:return}}function Ht(d){return{message:d.message,location:Kt(d.location)}}function Jr(d){return d.map(Ht)}function Yr(d){if(d!=null)return an.number(d)||an.string(d)?d:{value:d.value,target:n(d.target)}}function _n(d){let w=L.Diagnostic.create(he(d.range),d.message),x=d instanceof Hc.ProtocolDiagnostic?d:void 0;x!==void 0&&x.data!==void 0&&(w.data=x.data);let Z=Yr(d.code);return Hc.DiagnosticCode.is(Z)?x!==void 0&&x.hasDiagnosticCode?w.code=Z:(w.code=Z.value,w.codeDescription={href:Z.target}):w.code=Z,an.number(d.severity)&&(w.severity=Hn(d.severity)),Array.isArray(d.tags)&&(w.tags=Oi(d.tags)),d.relatedInformation&&(w.relatedInformation=Jr(d.relatedInformation)),d.source&&(w.source=d.source),w}function wn(d,w){return d==null?d:Uc.map(d,_n,w)}function $n(d){return d==null?d:d.map(_n)}function Qr(d,w){switch(d){case"$string":return w;case L.MarkupKind.PlainText:return{kind:d,value:w};case L.MarkupKind.Markdown:return{kind:d,value:w.value};default:return`Unsupported Markup content received. Kind is: ${d}`}}function Fi(d){if(d===de.CompletionItemTag.Deprecated)return L.CompletionItemTag.Deprecated}function xi(d){if(d===void 0)return d;let w=[];for(let x of d){let Z=Fi(x);Z!==void 0&&w.push(Z)}return w}function Zr(d,w){return w!==void 0?w:d+1}function Wt(d,w=!1){let x,Z;an.string(d.label)?x=d.label:(x=d.label.label,w&&(d.label.detail!==void 0||d.label.description!==void 0)&&(Z={detail:d.label.detail,description:d.label.description}));let V={label:x};Z!==void 0&&(V.labelDetails=Z);let De=d instanceof cf.default?d:void 0;d.detail&&(V.detail=d.detail),d.documentation&&(!De||De.documentationFormat==="$string"?V.documentation=d.documentation:V.documentation=Qr(De.documentationFormat,d.documentation)),d.filterText&&(V.filterText=d.filterText),Mi(V,d),an.number(d.kind)&&(V.kind=Zr(d.kind,De&&De.originalItemKind)),d.sortText&&(V.sortText=d.sortText),d.additionalTextEdits&&(V.additionalTextEdits=ki(d.additionalTextEdits)),d.commitCharacters&&(V.commitCharacters=d.commitCharacters.slice()),d.command&&(V.command=$t(d.command)),(d.preselect===!0||d.preselect===!1)&&(V.preselect=d.preselect);let ke=xi(d.tags);if(De){if(De.data!==void 0&&(V.data=De.data),De.deprecated===!0||De.deprecated===!1){if(De.deprecated===!0&&ke!==void 0&&ke.length>0){let St=ke.indexOf(de.CompletionItemTag.Deprecated);St!==-1&&ke.splice(St,1)}V.deprecated=De.deprecated}De.insertTextMode!==void 0&&(V.insertTextMode=De.insertTextMode)}return ke!==void 0&&ke.length>0&&(V.tags=ke),V.insertTextMode===void 0&&d.keepWhitespace===!0&&(V.insertTextMode=L.InsertTextMode.adjustIndentation),V}function Mi(d,w){let x=L.InsertTextFormat.PlainText,Z,V;w.textEdit?(Z=w.textEdit.newText,V=w.textEdit.range):w.insertText instanceof de.SnippetString?(x=L.InsertTextFormat.Snippet,Z=w.insertText.value):Z=w.insertText,w.range&&(V=w.range),d.insertTextFormat=x,w.fromEdit&&Z!==void 0&&V!==void 0?d.textEdit=Cn(Z,V):d.insertText=Z}function Cn(d,w){return zs.is(w)?L.InsertReplaceEdit.create(d,he(w.inserting),he(w.replacing)):{newText:d,range:he(w)}}function Bn(d){return{range:he(d.range),newText:d.newText}}function ki(d){return d==null?d:d.map(Bn)}function bt(d){return d<=de.SymbolKind.TypeParameter?d+1:L.SymbolKind.Property}function zn(d){return d}function Me(d){return d.map(zn)}function Xr(d,w,x){return{textDocument:i(d),position:rn(w),context:{includeDeclaration:x.includeDeclaration}}}async function Ve(d,w){let x=L.CodeAction.create(d.title);if(d instanceof Kc.default&&d.data!==void 0&&(x.data=d.data),d.kind!==void 0&&(x.kind=Ei(d.kind)),d.diagnostics!==void 0&&(x.diagnostics=await wn(d.diagnostics,w)),d.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return d.command!==void 0&&(x.command=$t(d.command)),d.isPreferred!==void 0&&(x.isPreferred=d.isPreferred),d.disabled!==void 0&&(x.disabled={reason:d.disabled.reason}),d.isAI&&(x.tags??=[],x.tags.push(L.CodeActionTag.LLMGenerated)),x}function bn(d){let w=L.CodeAction.create(d.title);if(d instanceof Kc.default&&d.data!==void 0&&(w.data=d.data),d.kind!==void 0&&(w.kind=Ei(d.kind)),d.diagnostics!==void 0&&(w.diagnostics=$n(d.diagnostics)),d.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return d.command!==void 0&&(w.command=$t(d.command)),d.isPreferred!==void 0&&(w.isPreferred=d.isPreferred),d.disabled!==void 0&&(w.disabled={reason:d.disabled.reason}),d.isAI&&(w.tags??=[],w.tags.push(L.CodeActionTag.LLMGenerated)),w}async function es(d,w){if(d==null)return d;let x;return d.only&&an.string(d.only.value)&&(x=[d.only.value]),L.CodeActionContext.create(await wn(d.diagnostics,w),x,Vn(d.triggerKind))}function ts(d){if(d==null)return d;let w;return d.only&&an.string(d.only.value)&&(w=[d.only.value]),L.CodeActionContext.create($n(d.diagnostics),w,Vn(d.triggerKind))}function Vn(d){switch(d){case de.CodeActionTriggerKind.Invoke:return L.CodeActionTriggerKind.Invoked;case de.CodeActionTriggerKind.Automatic:return L.CodeActionTriggerKind.Automatic;default:return}}function Ei(d){if(d!=null)return d.value}function qi(d){return L.InlineValueContext.create(d.frameId,he(d.stoppedLocation))}function ns(d,w,x){return{textDocument:i(d),position:Ct(w),context:Gn(x)}}function Gn(d){return{triggerKind:is(d.triggerKind),selectedCompletionInfo:Ii(d.selectedCompletionInfo)}}function is(d){switch(d){case de.InlineCompletionTriggerKind.Invoke:return L.InlineCompletionTriggerKind.Invoked;case de.InlineCompletionTriggerKind.Automatic:return L.InlineCompletionTriggerKind.Automatic}}function Ii(d){if(d!=null)return{range:he(d.range),text:d.text}}function $t(d){let w=L.Command.create(d.title,d.command);return d.tooltip&&(w.tooltip=d.tooltip),d.arguments&&(w.arguments=d.arguments),w}function Ai(d){let w=L.CodeLens.create(he(d.range));return d.command&&(w.command=$t(d.command)),d instanceof uf.default&&d.data&&(w.data=d.data),w}function ji(d,w){let x={tabSize:d.tabSize,insertSpaces:d.insertSpaces};return w.trimTrailingWhitespace&&(x.trimTrailingWhitespace=!0),w.trimFinalNewlines&&(x.trimFinalNewlines=!0),w.insertFinalNewline&&(x.insertFinalNewline=!0),x}function rs(d){return{textDocument:i(d)}}function Li(d){return{textDocument:i(d)}}function ss(d){let w=L.DocumentLink.create(he(d.range));d.target&&(w.target=n(d.target)),d.tooltip!==void 0&&(w.tooltip=d.tooltip);let x=d instanceof lf.default?d:void 0;return x&&x.data&&(w.data=x.data),w}function Ni(d){return{textDocument:i(d)}}function Ui(d){let w={name:d.name,kind:bt(d.kind),uri:n(d.uri),range:he(d.range),selectionRange:he(d.selectionRange)};return d.detail!==void 0&&d.detail.length>0&&(w.detail=d.detail),d.tags!==void 0&&(w.tags=Me(d.tags)),d instanceof df.default&&d.data!==void 0&&(w.data=d.data),w}function os(d){let w={name:d.name,kind:bt(d.kind),uri:n(d.uri),range:he(d.range),selectionRange:he(d.selectionRange)};return d.detail!==void 0&&d.detail.length>0&&(w.detail=d.detail),d.tags!==void 0&&(w.tags=Me(d.tags)),d instanceof ff.default&&d.data!==void 0&&(w.data=d.data),w}function Jn(d){let w=d instanceof hf.default?{name:d.name,kind:bt(d.kind),location:d.hasRange?Kt(d.location):{uri:t(d.location.uri)},data:d.data}:{name:d.name,kind:bt(d.kind),location:Kt(d.location)};return d.tags!==void 0&&(w.tags=Me(d.tags)),d.containerName!==""&&(w.containerName=d.containerName),w}function as(d){let w=typeof d.label=="string"?d.label:d.label.map(Ki),x=L.InlayHint.create(Ct(d.position),w);return d.kind!==void 0&&(x.kind=d.kind),d.textEdits!==void 0&&(x.textEdits=ki(d.textEdits)),d.tooltip!==void 0&&(x.tooltip=Hi(d.tooltip)),d.paddingLeft!==void 0&&(x.paddingLeft=d.paddingLeft),d.paddingRight!==void 0&&(x.paddingRight=d.paddingRight),d instanceof pf.default&&d.data!==void 0&&(x.data=d.data),x}function Ki(d){let w=L.InlayHintLabelPart.create(d.value);return d.location!==void 0&&(w.location=Kt(d.location)),d.command!==void 0&&(w.command=$t(d.command)),d.tooltip!==void 0&&(w.tooltip=Hi(d.tooltip)),w}function Hi(d){return typeof d=="string"?d:{kind:L.MarkupKind.Markdown,value:d.value}}return{asUri:n,asTextDocumentIdentifier:i,asTextDocumentItem:s,asVersionedTextDocumentIdentifier:o,asOpenTextDocumentParams:a,asChangeTextDocumentParams:p,asCloseTextDocumentParams:h,asSaveTextDocumentParams:f,asWillSaveTextDocumentParams:g,asDidCreateFilesParams:v,asDidRenameFilesParams:_,asDidDeleteFilesParams:T,asWillCreateFilesParams:C,asWillRenameFilesParams:D,asWillDeleteFilesParams:F,asTextDocumentPositionParams:E,asCompletionParams:we,asSignatureHelpParams:Vr,asWorkerPosition:rn,asRange:he,asRanges:Gr,asPosition:Ct,asPositions:yn,asPositionsSync:Ri,asLocation:Kt,asDiagnosticSeverity:Hn,asDiagnosticTag:Wn,asDiagnostic:_n,asDiagnostics:wn,asDiagnosticsSync:$n,asCompletionItem:Wt,asTextEdit:Bn,asSymbolKind:bt,asSymbolTag:zn,asSymbolTags:Me,asReferenceParams:Xr,asCodeAction:Ve,asCodeActionSync:bn,asCodeActionContext:es,asCodeActionContextSync:ts,asInlineValueContext:qi,asCommand:$t,asCodeLens:Ai,asFormattingOptions:ji,asDocumentSymbolParams:rs,asCodeLensParams:Li,asDocumentLink:ss,asDocumentLinkParams:Ni,asCallHierarchyItem:Ui,asTypeHierarchyItem:os,asInlayHint:as,asWorkspaceSymbol:Jn,asInlineCompletionParams:ns,asInlineCompletionContext:Gn}}});var zc=M(Qe=>{"use strict";var mf=Qe&&Qe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),vf=Qe&&Qe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),tr=Qe&&Qe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&mf(t,e,n[i]);return vf(t,e),t}})(),Gt=Qe&&Qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createConverter=Tf;var R=tr(I("vscode")),A=tr(N()),Ae=tr(He()),z=tr(Qi()),yf=Gt(Os()),_f=Gt(xs()),wf=Gt(ks()),Cf=Gt(qs()),$c=js(),bf=Gt(Ns()),Sf=Gt(Ks()),Df=Gt(Ws()),Pf=Gt(Bs()),Bc=N(),er;(function(r){function e(t){let n=t;return n&&Ae.string(n.language)&&Ae.string(n.value)}r.is=e})(er||(er={}));function Tf(r,e,t,n){let s=r||(c=>R.Uri.parse(c));function o(c){return s(c)}function a(c){let y=[];for(let b of c)if(typeof b=="string")y.push(b);else if(Bc.NotebookCellTextDocumentFilter.is(b))if(typeof b.notebook=="string")y.push({notebookType:b.notebook,language:b.language});else{let O=b.notebook.notebookType??"*";y.push({notebookType:O,scheme:b.notebook.scheme,pattern:cs(b.notebook.pattern),language:b.language})}else Bc.TextDocumentFilter.is(b)&&y.push({language:b.language,scheme:b.scheme,pattern:cs(b.pattern)});return y}async function u(c,y){return z.map(c,p,y)}function l(c){let y=new Array(c.length);for(let b=0;b<c.length;b++)y[b]=p(c[b]);return y}function p(c){let y=typeof c.message=="string"?c.message:c.message.kind==="plaintext"?c.message.value:"Received a markup diagnostic message but the client does not support it.",b=new $c.ProtocolDiagnostic(v(c.range),y,T(c.severity),c.data);if(c.code!==void 0){if(typeof c.code=="string"||typeof c.code=="number")A.CodeDescription.is(c.codeDescription)?b.code={value:c.code,target:o(c.codeDescription.href)}:b.code=c.code;else if($c.DiagnosticCode.is(c.code)){b.hasDiagnosticCode=!0;let O=c.code;b.code={value:O.value,target:o(O.target)}}}return c.source&&(b.source=c.source),c.relatedInformation&&(b.relatedInformation=h(c.relatedInformation)),Array.isArray(c.tags)&&(b.tags=f(c.tags)),b}function h(c){let y=new Array(c.length);for(let b=0;b<c.length;b++){let O=c[b];y[b]=new R.DiagnosticRelatedInformation(Ht(O.location),O.message)}return y}function f(c){if(!c)return;let y=[];for(let b of c){let O=m(b);O!==void 0&&y.push(O)}return y.length>0?y:void 0}function m(c){switch(c){case A.DiagnosticTag.Unnecessary:return R.DiagnosticTag.Unnecessary;case A.DiagnosticTag.Deprecated:return R.DiagnosticTag.Deprecated;default:return}}function g(c){return c?new R.Position(c.line,c.character):void 0}function v(c){return c?new R.Range(c.start.line,c.start.character,c.end.line,c.end.character):void 0}async function _(c,y){return z.map(c,b=>new R.Range(b.start.line,b.start.character,b.end.line,b.end.character),y)}function T(c){if(c==null)return R.DiagnosticSeverity.Error;switch(c){case A.DiagnosticSeverity.Error:return R.DiagnosticSeverity.Error;case A.DiagnosticSeverity.Warning:return R.DiagnosticSeverity.Warning;case A.DiagnosticSeverity.Information:return R.DiagnosticSeverity.Information;case A.DiagnosticSeverity.Hint:return R.DiagnosticSeverity.Hint}return R.DiagnosticSeverity.Error}function C(c){if(Ae.string(c))return F(c);if(er.is(c))return F().appendCodeblock(c.value,c.language);if(Array.isArray(c)){let y=[];for(let b of c){let O=F();er.is(b)?O.appendCodeblock(b.value,b.language):O.appendMarkdown(b),y.push(O)}return y}else return F(c)}function D(c){if(Ae.string(c))return c;switch(c.kind){case A.MarkupKind.Markdown:return F(c.value);case A.MarkupKind.PlainText:return c.value;default:return`Unsupported Markup content received. Kind is: ${c.kind}`}}function F(c){let y;if(c===void 0||typeof c=="string")y=new R.MarkdownString(c);else switch(c.kind){case A.MarkupKind.Markdown:y=new R.MarkdownString(c.value);break;case A.MarkupKind.PlainText:y=new R.MarkdownString,y.appendText(c.value);break;default:y=new R.MarkdownString,y.appendText(`Unsupported Markup content received. Kind is: ${c.kind}`);break}return y.isTrusted=e,y.supportHtml=t,y.supportThemeIcons=n,y}function E(c){if(c)return new R.Hover(C(c.contents),v(c.range))}async function Q(c,y,b){if(!c)return;if(Array.isArray(c))return z.map(c,Dt=>Kn(Dt,y),b);let O=c,{defaultRange:oe,commitCharacters:fe}=we(O,y),X=await z.map(O.items,Dt=>Kn(Dt,fe,O.applyKind?.commitCharacters,oe,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data,O.applyKind?.data),b);return new R.CompletionList(X,O.isIncomplete)}function we(c,y){let b=c.itemDefaults?.editRange,O=c.itemDefaults?.commitCharacters??y;return A.Range.is(b)?{defaultRange:v(b),commitCharacters:O}:b!==void 0?{defaultRange:{inserting:v(b.insert),replacing:v(b.replace)},commitCharacters:O}:{defaultRange:void 0,commitCharacters:O}}function xe(c){return A.CompletionItemKind.Text<=c&&c<=A.CompletionItemKind.TypeParameter?[c-1,void 0]:[R.CompletionItemKind.Text,c]}function Un(c){if(c===A.CompletionItemTag.Deprecated)return R.CompletionItemTag.Deprecated}function $r(c){if(c==null)return[];let y=[];for(let b of c){let O=Un(b);O!==void 0&&y.push(O)}return y}function Kn(c,y,b,O,oe,fe,X,Dt){let Bt=$r(c.tags),Ue=Vr(c),pe=new yf.default(Ue);c.detail&&(pe.detail=c.detail),c.documentation&&(pe.documentation=D(c.documentation),pe.documentationFormat=Ae.string(c.documentation)?"$string":c.documentation.kind),c.filterText&&(pe.filterText=c.filterText);let Wi=rn(c,O,fe);if(Wi&&(pe.insertText=Wi.text,pe.range=Wi.range,pe.fromEdit=Wi.fromEdit),Ae.number(c.kind)){let[ed,Cc]=xe(c.kind);pe.kind=ed,Cc&&(pe.originalItemKind=Cc)}c.sortText&&(pe.sortText=c.sortText),c.additionalTextEdits&&(pe.additionalTextEdits=he(c.additionalTextEdits));let _c=Br(c,y,b);_c&&(pe.commitCharacters=_c.slice()),c.command&&(pe.command=Me(c.command)),(c.deprecated===!0||c.deprecated===!1)&&(pe.deprecated=c.deprecated,c.deprecated===!0&&Bt.push(R.CompletionItemTag.Deprecated)),(c.preselect===!0||c.preselect===!1)&&(pe.preselect=c.preselect);let wc=zr(c,X,Dt);wc!==void 0&&(pe.data=wc),Bt.length>0&&(pe.tags=Bt);let ls=c.insertTextMode??oe;return ls!==void 0&&(pe.insertTextMode=ls,ls===A.InsertTextMode.asIs&&(pe.keepWhitespace=!0)),pe}function Br(c,y,b){if(b===A.ApplyKind.Merge){if(!y&&!c.commitCharacters)return;let O=new Set;if(y)for(let oe of y)O.add(oe);if(Ae.stringArray(c.commitCharacters))for(let oe of c.commitCharacters)O.add(oe);return Array.from(O)}return c.commitCharacters!==void 0?Ae.stringArray(c.commitCharacters)?c.commitCharacters:void 0:y}function zr(c,y,b){if(b===A.ApplyKind.Merge){let O={...y};return c.data&&Object.entries(c.data).forEach(([oe,fe])=>{fe!=null&&(O[oe]=fe)}),O}return c.data??y}function Vr(c){return A.CompletionItemLabelDetails.is(c.labelDetails)?{label:c.label,detail:c.labelDetails.detail,description:c.labelDetails.description}:c.label}function rn(c,y,b){let O=c.insertTextFormat??b;if(c.textEdit!==void 0||y!==void 0){let[oe,fe]=c.textEdit!==void 0?Ct(c.textEdit):[y,c.textEditText??c.label];return O===A.InsertTextFormat.Snippet?{text:new R.SnippetString(fe),range:oe,fromEdit:!0}:{text:fe,range:oe,fromEdit:!0}}else return c.insertText?O===A.InsertTextFormat.Snippet?{text:new R.SnippetString(c.insertText),fromEdit:!1}:{text:c.insertText,fromEdit:!1}:void 0}function Ct(c){return A.InsertReplaceEdit.is(c)?[{inserting:v(c.insert),replacing:v(c.replace)},c.newText]:[v(c.range),c.newText]}function yn(c){if(c)return new R.TextEdit(v(c.range),c.newText)}async function Ri(c,y){if(c)return z.map(c,yn,y)}function he(c){if(!c)return;let y=new Array(c.length);for(let b=0;b<c.length;b++)y[b]=yn(c[b]);return y}async function Gr(c,y){if(!c)return;let b=new R.SignatureHelp;return Ae.number(c.activeSignature)?b.activeSignature=c.activeSignature:b.activeSignature=0,Ae.number(c.activeParameter)?b.activeParameter=c.activeParameter:c.activeParameter===null?b.activeParameter=-1:b.activeParameter=0,c.signatures&&(b.signatures=await Kt(c.signatures,y)),b}async function Kt(c,y){return z.mapAsync(c,Hn,y)}async function Hn(c,y){let b=new R.SignatureInformation(c.label);return c.documentation!==void 0&&(b.documentation=D(c.documentation)),c.parameters!==void 0&&(b.parameters=await Oi(c.parameters,y)),c.activeParameter!==void 0&&(b.activeParameter=c.activeParameter??-1),b}function Oi(c,y){return z.map(c,Wn,y)}function Wn(c){let y=new R.ParameterInformation(c.label);return c.documentation&&(y.documentation=D(c.documentation)),y}function Ht(c){return c?new R.Location(s(c.uri),v(c.range)):void 0}async function Jr(c,y){if(c)return wn(c,y)}async function Yr(c,y){if(c)return wn(c,y)}function _n(c){if(!c)return;let y={targetUri:s(c.targetUri),targetRange:v(c.targetRange),originSelectionRange:v(c.originSelectionRange),targetSelectionRange:v(c.targetSelectionRange)};if(!y.targetSelectionRange)throw new Error("targetSelectionRange must not be undefined or null");return y}async function wn(c,y){if(c)if(Ae.array(c)){if(c.length===0)return[];if(A.LocationLink.is(c[0])){let b=c;return z.map(b,_n,y)}else{let b=c;return z.map(b,Ht,y)}}else return A.LocationLink.is(c)?[_n(c)]:Ht(c)}async function $n(c,y){if(c)return z.map(c,Ht,y)}async function Qr(c,y){if(c)return z.map(c,Fi,y)}function Fi(c){let y=new R.DocumentHighlight(v(c.range));return Ae.number(c.kind)&&(y.kind=xi(c.kind)),y}function xi(c){switch(c){case A.DocumentHighlightKind.Text:return R.DocumentHighlightKind.Text;case A.DocumentHighlightKind.Read:return R.DocumentHighlightKind.Read;case A.DocumentHighlightKind.Write:return R.DocumentHighlightKind.Write}return R.DocumentHighlightKind.Text}async function Zr(c,y){if(c)return z.map(c,Bn,y)}function Wt(c){return c<=A.SymbolKind.TypeParameter?c-1:R.SymbolKind.Property}function Mi(c){if(c===A.SymbolTag.Deprecated)return R.SymbolTag.Deprecated}function Cn(c){if(c==null)return;let y=[];for(let b of c){let O=Mi(b);O!==void 0&&y.push(O)}return y.length===0?void 0:y}function Bn(c){let y=c.data,b=c.location,O=b.range===void 0||y!==void 0?new Df.default(c.name,Wt(c.kind),c.containerName??"",b.range===void 0?s(b.uri):new R.Location(s(c.location.uri),v(b.range)),y):new R.SymbolInformation(c.name,Wt(c.kind),c.containerName??"",new R.Location(s(c.location.uri),v(b.range)));return zn(O,c),O}async function ki(c,y){if(c!=null)return z.map(c,bt,y)}function bt(c){let y=new R.DocumentSymbol(c.name,c.detail||"",Wt(c.kind),v(c.range),v(c.selectionRange));if(zn(y,c),c.children!==void 0&&c.children.length>0){let b=[];for(let O of c.children)b.push(bt(O));y.children=b}return y}function zn(c,y){c.tags=Cn(y.tags),y.deprecated&&(c.tags?c.tags.includes(R.SymbolTag.Deprecated)||(c.tags=c.tags.concat(R.SymbolTag.Deprecated)):c.tags=[R.SymbolTag.Deprecated])}function Me(c){let y={title:c.title,command:c.command};return c.tooltip&&(y.tooltip=c.tooltip),c.arguments&&(y.arguments=c.arguments),y}async function Xr(c,y){if(c)return z.map(c,Me,y)}let Ve=new Map;Ve.set(A.CodeActionKind.Empty,R.CodeActionKind.Empty),Ve.set(A.CodeActionKind.QuickFix,R.CodeActionKind.QuickFix),Ve.set(A.CodeActionKind.Refactor,R.CodeActionKind.Refactor),Ve.set(A.CodeActionKind.RefactorExtract,R.CodeActionKind.RefactorExtract),Ve.set(A.CodeActionKind.RefactorInline,R.CodeActionKind.RefactorInline),Ve.set(A.CodeActionKind.RefactorRewrite,R.CodeActionKind.RefactorRewrite),Ve.set(A.CodeActionKind.Source,R.CodeActionKind.Source),Ve.set(A.CodeActionKind.SourceOrganizeImports,R.CodeActionKind.SourceOrganizeImports);function bn(c){if(c==null)return;let y=Ve.get(c);if(y)return y;let b=c.split(".");y=R.CodeActionKind.Empty;for(let O of b)y=y.append(O);return y}function es(c){if(c!=null)return c.map(y=>bn(y))}function ts(c){if(c!=null)return c.map(y=>({kind:bn(y.kind),command:Me(y.command)}))}async function Vn(c,y){if(c==null)return;let b=new Cf.default(c.title,c.data);return c.kind!==void 0&&(b.kind=bn(c.kind)),c.diagnostics!==void 0&&(b.diagnostics=l(c.diagnostics)),c.edit!==void 0&&(b.edit=await Gn(c.edit,y)),c.command!==void 0&&(b.command=Me(c.command)),c.isPreferred!==void 0&&(b.isPreferred=c.isPreferred),c.disabled!==void 0&&(b.disabled={reason:c.disabled.reason}),c.tags?.includes(A.CodeActionTag.LLMGenerated)&&(b.isAI=!0),b}function Ei(c,y){return z.mapAsync(c,async b=>A.Command.is(b)?Me(b):Vn(b,y),y)}function qi(c){if(!c)return;let y=new _f.default(v(c.range));return c.command&&(y.command=Me(c.command)),c.data!==void 0&&c.data!==null&&(y.data=c.data),y}async function ns(c,y){if(c)return z.map(c,qi,y)}async function Gn(c,y){if(!c)return;let b=new Map;if(c.changeAnnotations!==void 0){let fe=c.changeAnnotations;await z.forEach(Object.keys(fe),X=>{let Dt=is(fe[X]);b.set(X,Dt)},y)}let O=fe=>{if(fe!==void 0)return b.get(fe)},oe=new R.WorkspaceEdit;if(c.documentChanges){let fe=c.documentChanges;await z.forEach(fe,X=>{if(A.CreateFile.is(X))oe.createFile(s(X.uri),X.options,O(X.annotationId));else if(A.RenameFile.is(X))oe.renameFile(s(X.oldUri),s(X.newUri),X.options,O(X.annotationId));else if(A.DeleteFile.is(X))oe.deleteFile(s(X.uri),X.options,O(X.annotationId));else if(A.TextDocumentEdit.is(X)){let Dt=s(X.textDocument.uri),Bt=[];for(let Ue of X.edits)A.AnnotatedTextEdit.is(Ue)?Bt.push([new R.TextEdit(v(Ue.range),Ue.newText),O(Ue.annotationId)]):A.SnippetTextEdit.is(Ue)?Bt.push([new R.SnippetTextEdit(v(Ue.range),new R.SnippetString(Ue.snippet.value)),O(Ue.annotationId)]):Bt.push([new R.TextEdit(v(Ue.range),Ue.newText),void 0]);oe.set(Dt,Bt)}else throw new Error(`Unknown workspace edit change received:
8
+ ${JSON.stringify(X,void 0,4)}`)},y)}else if(c.changes){let fe=c.changes;await z.forEach(Object.keys(fe),X=>{oe.set(s(X),he(fe[X]))},y)}return oe}function is(c){if(c!==void 0)return{label:c.label,needsConfirmation:!!c.needsConfirmation,description:c.description}}function Ii(c){let y=v(c.range),b=c.target?o(c.target):void 0,O=new wf.default(y,b);return c.tooltip!==void 0&&(O.tooltip=c.tooltip),c.data!==void 0&&c.data!==null&&(O.data=c.data),O}async function $t(c,y){if(c)return z.map(c,Ii,y)}function Ai(c){return new R.Color(c.red,c.green,c.blue,c.alpha)}function ji(c){return new R.ColorInformation(v(c.range),Ai(c.color))}async function rs(c,y){if(c)return z.map(c,ji,y)}function Li(c){let y=new R.ColorPresentation(c.label);return y.additionalTextEdits=he(c.additionalTextEdits),c.textEdit&&(y.textEdit=yn(c.textEdit)),y}async function ss(c,y){if(c)return z.map(c,Li,y)}function Ni(c){if(c)switch(c){case A.FoldingRangeKind.Comment:return R.FoldingRangeKind.Comment;case A.FoldingRangeKind.Imports:return R.FoldingRangeKind.Imports;case A.FoldingRangeKind.Region:return R.FoldingRangeKind.Region}}function Ui(c){return new R.FoldingRange(c.startLine,c.endLine,Ni(c.kind))}async function os(c,y){if(c)return z.map(c,Ui,y)}function Jn(c){return new R.SelectionRange(v(c.range),c.parent?Jn(c.parent):void 0)}async function as(c,y){return Array.isArray(c)?z.map(c,Jn,y):[]}function Ki(c){return A.InlineValueText.is(c)?new R.InlineValueText(v(c.range),c.text):A.InlineValueVariableLookup.is(c)?new R.InlineValueVariableLookup(v(c.range),c.variableName,c.caseSensitiveLookup):new R.InlineValueEvaluatableExpression(v(c.range),c.expression)}async function Hi(c,y){return Array.isArray(c)?z.map(c,Ki,y):[]}async function d(c,y){let b=typeof c.label=="string"?c.label:await z.map(c.label,w,y),O=new Pf.default(g(c.position),b);return c.kind!==void 0&&(O.kind=c.kind),c.textEdits!==void 0&&(O.textEdits=await Ri(c.textEdits,y)),c.tooltip!==void 0&&(O.tooltip=x(c.tooltip)),c.paddingLeft!==void 0&&(O.paddingLeft=c.paddingLeft),c.paddingRight!==void 0&&(O.paddingRight=c.paddingRight),c.data!==void 0&&(O.data=c.data),O}function w(c){let y=new R.InlayHintLabelPart(c.value);return c.location!==void 0&&(y.location=Ht(c.location)),c.tooltip!==void 0&&(y.tooltip=x(c.tooltip)),c.command!==void 0&&(y.command=Me(c.command)),y}function x(c){return typeof c=="string"?c:F(c)}async function Z(c,y){if(Array.isArray(c))return z.mapAsync(c,d,y)}function V(c){if(c===null)return;let y=new bf.default(Wt(c.kind),c.name,c.detail||"",o(c.uri),v(c.range),v(c.selectionRange),c.data);return c.tags!==void 0&&(y.tags=Cn(c.tags)),y}async function De(c,y){if(c!==null)return z.map(c,V,y)}async function ke(c,y){return new R.CallHierarchyIncomingCall(V(c.from),await _(c.fromRanges,y))}async function St(c,y){if(c!==null)return z.mapAsync(c,ke,y)}async function mc(c,y){return new R.CallHierarchyOutgoingCall(V(c.to),await _(c.fromRanges,y))}async function zl(c,y){if(c!==null)return z.mapAsync(c,mc,y)}async function Vl(c,y){if(c!=null)return new R.SemanticTokens(new Uint32Array(c.data),c.resultId)}function vc(c){return new R.SemanticTokensEdit(c.start,c.deleteCount,c.data!==void 0?new Uint32Array(c.data):void 0)}async function Gl(c,y){if(c!=null)return new R.SemanticTokensEdits(c.edits.map(vc),c.resultId)}function Jl(c){return c}async function Yl(c,y){if(c!=null)return new R.LinkedEditingRanges(await _(c.ranges,y),Ql(c.wordPattern))}function Ql(c){if(c!=null)return new RegExp(c)}function yc(c){if(c===null)return;let y=new Sf.default(Wt(c.kind),c.name,c.detail||"",o(c.uri),v(c.range),v(c.selectionRange),c.data);return c.tags!==void 0&&(y.tags=Cn(c.tags)),y}async function Zl(c,y){if(c!==null)return z.map(c,yc,y)}function cs(c){if(Ae.string(c))return c;if(A.RelativePattern.is(c)){if(A.URI.is(c.baseUri))return new R.RelativePattern(o(c.baseUri),c.pattern);if(A.WorkspaceFolder.is(c.baseUri)){let y=R.workspace.getWorkspaceFolder(o(c.baseUri.uri));return y!==void 0?new R.RelativePattern(y,c.pattern):void 0}}}async function Xl(c,y){if(!c)return;if(Array.isArray(c))return z.map(c,oe=>us(oe),y);let b=c,O=await z.map(b.items,oe=>us(oe),y);return new R.InlineCompletionList(O)}function us(c){let y;typeof c.insertText=="string"?y=c.insertText:y=new R.SnippetString(c.insertText.value);let b;c.command&&(b=Me(c.command));let O=new R.InlineCompletionItem(y,v(c.range),b);return c.filterText&&(O.filterText=c.filterText),O}return{asUri:o,asDocumentSelector:a,asDiagnostics:u,asDiagnostic:p,asRange:v,asRanges:_,asPosition:g,asDiagnosticSeverity:T,asDiagnosticTag:m,asHover:E,asCompletionResult:Q,asCompletionItem:Kn,asTextEdit:yn,asTextEdits:Ri,asSignatureHelp:Gr,asSignatureInformations:Kt,asSignatureInformation:Hn,asParameterInformations:Oi,asParameterInformation:Wn,asDeclarationResult:Jr,asDefinitionResult:Yr,asLocation:Ht,asReferences:$n,asDocumentHighlights:Qr,asDocumentHighlight:Fi,asDocumentHighlightKind:xi,asSymbolKind:Wt,asSymbolTag:Mi,asSymbolTags:Cn,asSymbolInformations:Zr,asSymbolInformation:Bn,asDocumentSymbols:ki,asDocumentSymbol:bt,asCommand:Me,asCommands:Xr,asCodeAction:Vn,asCodeActionKind:bn,asCodeActionKinds:es,asCodeActionDocumentations:ts,asCodeActionResult:Ei,asCodeLens:qi,asCodeLenses:ns,asWorkspaceEdit:Gn,asDocumentLink:Ii,asDocumentLinks:$t,asFoldingRangeKind:Ni,asFoldingRange:Ui,asFoldingRanges:os,asColor:Ai,asColorInformation:ji,asColorInformations:rs,asColorPresentation:Li,asColorPresentations:ss,asSelectionRange:Jn,asSelectionRanges:as,asInlineValue:Ki,asInlineValues:Hi,asInlayHint:d,asInlayHints:Z,asSemanticTokensLegend:Jl,asSemanticTokens:Vl,asSemanticTokensEdit:vc,asSemanticTokensEdits:Gl,asCallHierarchyItem:V,asCallHierarchyItems:De,asCallHierarchyIncomingCall:ke,asCallHierarchyIncomingCalls:St,asCallHierarchyOutgoingCall:mc,asCallHierarchyOutgoingCalls:zl,asLinkedEditingRanges:Yl,asTypeHierarchyItem:yc,asTypeHierarchyItems:Zl,asGlobPattern:cs,asInlineCompletionResult:Xl,asInlineCompletionItem:us}}});var ne=M(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.empty=void 0;Jt.v4=Vc;Jt.isUUID=Gc;Jt.parse=Of;Jt.generateUuid=Ff;var ii=class{_value;constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Vs=class r extends ii{static _chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];static _timeHighBits=["8","9","a","b"];static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}};Jt.empty=new ii("00000000-0000-0000-0000-000000000000");function Vc(){return new Vs}var Rf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Gc(r){return Rf.test(r)}function Of(r){if(!Gc(r))throw new Error("invalid uuid");return new ii(r)}function Ff(){return Vc().asHex()}});var Js=M(it=>{"use strict";var xf=it&&it.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Mf=it&&it.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),kf=it&&it.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&xf(t,e,n[i]);return Mf(t,e),t}})();Object.defineProperty(it,"__esModule",{value:!0});it.ProgressPart=void 0;var Jc=I("vscode"),Yc=N(),Qc=kf(He()),Gs=class{_client;_token;_infinite;_reported;_lspProgressDisposable;_progress;_cancellationToken;_tokenDisposable;_resolve;_reject;constructor(e,t,n){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(Yc.WorkDoneProgress.type,this._token,i=>{switch(i.kind){case"begin":this.begin(i);break;case"report":this.report(i);break;case"end":this.done(),n&&n(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&Jc.window.withProgress({location:Jc.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,n)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=n,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(Yc.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((i,s)=>{this._resolve=i,this._reject=s})})}report(e){if(this._infinite&&Qc.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(Qc.number(e.percentage)){let t=Math.max(0,Math.min(e.percentage,100)),n=Math.max(0,t-this._reported);this._reported+=n,this._progress!==void 0&&this._progress.report({message:e.message,increment:n})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}};it.ProgressPart=Gs});var B=M(ae=>{"use strict";var Ef=ae&&ae.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),qf=ae&&ae.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),tu=ae&&ae.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Ef(t,e,n[i]);return qf(t,e),t}})();Object.defineProperty(ae,"__esModule",{value:!0});ae.WorkspaceFeature=ae.TextDocumentLanguageFeature=ae.TextDocumentEventFeature=ae.DynamicDocumentFeature=ae.DynamicFeature=ae.StaticFeature=ae.LSPCancellationError=void 0;ae.ensure=If;var Yt=I("vscode"),Ys=N(),Fe=tu(He()),Zc=tu(ne()),Qs=class extends Yt.CancellationError{data;constructor(e){super(),this.data=e}};ae.LSPCancellationError=Qs;function If(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var Xc;(function(r){function e(t){let n=t;return n!=null&&Fe.func(n.fillClientCapabilities)&&Fe.func(n.initialize)&&Fe.func(n.getState)&&Fe.func(n.clear)&&(n.fillInitializeParams===void 0||Fe.func(n.fillInitializeParams))}r.is=e})(Xc||(ae.StaticFeature=Xc={}));var eu;(function(r){function e(t){let n=t;return n!=null&&Fe.func(n.fillClientCapabilities)&&Fe.func(n.initialize)&&Fe.func(n.getState)&&Fe.func(n.clear)&&(n.fillInitializeParams===void 0||Fe.func(n.fillInitializeParams))&&Fe.func(n.register)&&Fe.func(n.unregister)&&n.registrationType!==void 0}r.is=e})(eu||(ae.DynamicFeature=eu={}));var ri=class{_client;constructor(e){this._client=e}getState(){let e=this.getDocumentSelectors(),t=0;for(let i of e){t++;for(let s of Yt.workspace.textDocuments)if(Yt.languages.match(i,s)>0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}let n=t>0;return{kind:"document",id:this.registrationType.method,registrations:n,matches:!1}}};ae.DynamicDocumentFeature=ri;var Zs=class extends ri{_event;_type;_middleware;_createParams;_textDocument;_selectorFilter;_listener;_selectors;_onNotificationSent;static textDocumentFilter(e,t){for(let n of e)if(Yt.languages.match(n,t)>0)return!0;return!1}constructor(e,t,n,i,s,o,a){super(e),this._event=t,this._type=n,this._middleware=i,this._createParams=s,this._textDocument=o,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new Yt.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(t=>{this.callback(t).catch(n=>{this._client.error(`Sending document notification ${this._type.method} failed.`,n)})})),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){let t=async n=>{let i=this._createParams(n);await this._client.sendNotification(this._type,i),this.notificationSent(this.getTextDocument(n),this._type,i)};if(this.matches(e)){let n=this._middleware();return n?n(e,i=>t(i)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._onNotificationSent=new Yt.EventEmitter,this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._selectors.values())if(Yt.languages.match(t,e)>0)return{send:n=>this.callback(n)}}};ae.TextDocumentEventFeature=Zs;var Xs=class extends ri{_registrationType;_registrations;constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(let e of this._registrations.values()){let t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&(this._registrations.delete(e),t.disposable.dispose())}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(Ys.TextDocumentRegistrationOptions.is(t)){let n=Ys.StaticRegistrationOptions.hasId(t)?t.id:Zc.generateUuid(),i=t.documentSelector??e;if(i)return[n,Object.assign({},t,{documentSelector:i})]}else if(Fe.boolean(t)&&t===!0||Ys.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let n=Fe.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[Zc.generateUuid(),n]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Fe.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(let t of this._registrations.values()){let n=t.data.registerOptions.documentSelector;if(n!==null&&Yt.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(n),e)>0)return t.provider}}getAllProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}};ae.TextDocumentLanguageFeature=Xs;var eo=class{_client;_registrationType;_registrations;constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){let e=this._registrations.size>0;return{kind:"workspace",id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){let t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&(this._registrations.delete(e),t.disposable.dispose())}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}};ae.WorkspaceFeature=eo});var iu=M(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.range=cn.balanced=void 0;var Af=(r,e,t)=>{let n=r instanceof RegExp?nu(r,t):r,i=e instanceof RegExp?nu(e,t):e,s=n!==null&&i!=null&&(0,cn.range)(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}};cn.balanced=Af;var nu=(r,e)=>{let t=e.match(r);return t?t[0]:null},jf=(r,e,t)=>{let n,i,s,o,a,u=t.indexOf(r),l=t.indexOf(e,u+1),p=u;if(u>=0&&l>0){if(r===e)return[u,l];for(n=[],s=t.length;p>=0&&!a;){if(p===u)n.push(p),u=t.indexOf(r,p+1);else if(n.length===1){let h=n.pop();h!==void 0&&(a=[h,l])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=l),l=t.indexOf(e,p+1);p=u<l&&u>=0?u:l}n.length&&o!==void 0&&(a=[s,o])}return a};cn.range=jf});var lu=M(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.EXPANSION_MAX=void 0;Tn.expand=Yf;var ru=iu(),su="\0SLASH"+Math.random()+"\0",ou="\0OPEN"+Math.random()+"\0",no="\0CLOSE"+Math.random()+"\0",au="\0COMMA"+Math.random()+"\0",cu="\0PERIOD"+Math.random()+"\0",Lf=new RegExp(su,"g"),Nf=new RegExp(ou,"g"),Uf=new RegExp(no,"g"),Kf=new RegExp(au,"g"),Hf=new RegExp(cu,"g"),Wf=/\\\\/g,$f=/\\{/g,Bf=/\\}/g,zf=/\\,/g,Vf=/\\\./g;Tn.EXPANSION_MAX=1e5;function to(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function Gf(r){return r.replace(Wf,su).replace($f,ou).replace(Bf,no).replace(zf,au).replace(Vf,cu)}function Jf(r){return r.replace(Lf,"\\").replace(Nf,"{").replace(Uf,"}").replace(Kf,",").replace(Hf,".")}function uu(r){if(!r)return[""];let e=[],t=(0,ru.balanced)("{","}",r);if(!t)return r.split(",");let{pre:n,body:i,post:s}=t,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=uu(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Yf(r,e={}){if(!r)return[];let{max:t=Tn.EXPANSION_MAX}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),si(Gf(r),t,!0).map(Jf)}function Qf(r){return"{"+r+"}"}function Zf(r){return/^-?0\d/.test(r)}function Xf(r,e){return r<=e}function eh(r,e){return r>=e}function si(r,e,t){let n=[],i=(0,ru.balanced)("{","}",r);if(!i)return[r];let s=i.pre,o=i.post.length?si(i.post,e,!1):[""];if(/\$$/.test(i.pre))for(let a=0;a<o.length&&a<e;a++){let u=s+"{"+i.body+"}"+o[a];n.push(u)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=a||u,p=i.body.indexOf(",")>=0;if(!l&&!p)return i.post.match(/,(?!,).*\}/)?(r=i.pre+"{"+i.body+no+i.post,si(r,e,!0)):[r];let h;if(l)h=i.body.split(/\.\./);else if(h=uu(i.body),h.length===1&&h[0]!==void 0&&(h=si(h[0],e,!1).map(Qf),h.length===1))return o.map(m=>i.pre+h[0]+m);let f;if(l&&h[0]!==void 0&&h[1]!==void 0){let m=to(h[0]),g=to(h[1]),v=Math.max(h[0].length,h[1].length),_=h.length===3&&h[2]!==void 0?Math.max(Math.abs(to(h[2])),1):1,T=Xf;g<m&&(_*=-1,T=eh);let D=h.some(Zf);f=[];for(let F=m;T(F,g)&&f.length<e;F+=_){let E;if(u)E=String.fromCharCode(F),E==="\\"&&(E="");else if(E=String(F),D){let Q=v-E.length;if(Q>0){let we=new Array(Q+1).join("0");F<0?E="-"+we+E.slice(1):E=we+E}}f.push(E)}}else{f=[];for(let m=0;m<h.length;m++)f.push.apply(f,si(h[m],e,!1))}for(let m=0;m<f.length;m++)for(let g=0;g<o.length&&n.length<e;g++){let v=s+f[m]+o[g];(!t||l||v)&&n.push(v)}}return n}});var du=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.assertValidPattern=void 0;var th=1024*64,nh=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>th)throw new TypeError("pattern is too long")};nr.assertValidPattern=nh});var hu=M(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.parseClass=void 0;var ih={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},oi=r=>r.replace(/[[\]\\-]/g,"\\$&"),rh=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fu=r=>r.join(""),sh=(r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,a=!1,u=!1,l=!1,p=t,h="";e:for(;s<r.length;){let v=r.charAt(s);if((v==="!"||v==="^")&&s===t+1){l=!0,s++;continue}if(v==="]"&&o&&!u){p=s+1;break}if(o=!0,v==="\\"&&!u){u=!0,s++;continue}if(v==="["&&!u){for(let[_,[T,C,D]]of Object.entries(ih))if(r.startsWith(_,s)){if(h)return["$.",!1,r.length-t,!0];s+=_.length,D?i.push(T):n.push(T),a=a||C;continue e}}if(u=!1,h){v>h?n.push(oi(h)+"-"+oi(v)):v===h&&n.push(oi(v)),h="",s++;continue}if(r.startsWith("-]",s+1)){n.push(oi(v+"-")),s+=2;continue}if(r.startsWith("-",s+1)){h=v,s+=2;continue}n.push(oi(v)),s++}if(p<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let v=n[0].length===2?n[0].slice(-1):n[0];return[rh(v),!1,p-t,!1]}let f="["+(l?"^":"")+fu(n)+"]",m="["+(l?"":"^")+fu(i)+"]";return[n.length&&i.length?"("+f+"|"+m+")":n.length?f:m,a,p-t,!0]};ir.parseClass=sh});var sr=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.unescape=void 0;var oh=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");rr.unescape=oh});var so=M(ur=>{"use strict";var Ee;Object.defineProperty(ur,"__esModule",{value:!0});ur.AST=void 0;var ah=hu(),or=sr(),ch=new Set(["!","?","+","*","@"]),io=r=>ch.has(r),pu=r=>io(r.type),uh=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),lh=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),dh=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),gu=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),fh="(?!(?:^|/)\\.\\.?(?:$|/))",ar="(?!\\.)",hh=new Set(["[","."]),ph=new Set(["..","."]),gh=new Set("().*{}+?[]^$\\!"),mh=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ro="[^/]",mu=ro+"*?",vu=ro+"+?",vh=0,cr=class{type;#n;#i;#r=!1;#e=[];#t;#a;#u;#c=!1;#s;#o;#l=!1;id=++vh;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#i=!0),this.#t=t,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?n:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#o=this.#e.map(e=>String(e)).join("")}#v(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let t=e,n=t.#t;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#t}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Ee&&t.#t===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Ee&&n.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Ee(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#d(e,t,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,u=!1,l=-1,p=!1;if(t.type===null){let v=n,_="";for(;v<e.length;){let T=e.charAt(v++);if(a||T==="\\"){a=!a,_+=T;continue}if(u){v===l+1?(T==="^"||T==="!")&&(p=!0):T==="]"&&!(v===l+2&&p)&&(u=!1),_+=T;continue}else if(T==="["){u=!0,l=v,p=!1,_+=T;continue}if(!i.noext&&io(T)&&e.charAt(v)==="("&&s<=o){t.push(_),_="";let D=new Ee(T,t);v=Ee.#d(e,D,v,i,s+1),t.push(D);continue}_+=T}return t.push(_),v}let h=n+1,f=new Ee(null,t),m=[],g="";for(;h<e.length;){let v=e.charAt(h++);if(a||v==="\\"){a=!a,g+=v;continue}if(u){h===l+1?(v==="^"||v==="!")&&(p=!0):v==="]"&&!(h===l+2&&p)&&(u=!1),g+=v;continue}else if(v==="["){u=!0,l=h,p=!1,g+=v;continue}if(!i.noext&&io(v)&&e.charAt(h)==="("&&(s<=o||t&&t.#f(v))){let T=t&&t.#f(v)?0:1;f.push(g),g="";let C=new Ee(v,f);f.push(C),h=Ee.#d(e,C,h,i,s+T);continue}if(v==="|"){f.push(g),g="",m.push(f),f=new Ee(null,t);continue}if(v===")")return g===""&&t.#e.length===0&&(t.#l=!0),f.push(g),g="",t.push(...m,f),h;g+=v}return t.type=null,t.#i=void 0,t.#e=[e.substring(n-1)],h}#y(e){return this.#p(e,lh)}#p(e,t=uh){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#f(n.type,t)}#f(e,t=dh){return!!t.get(this.type)?.includes(e)}#_(e,t){let n=e.#e[0],i=new Ee(null,n,this.options);i.#e.push(""),n.push(i),this.#g(e,t)}#g(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#t=this);this.#o=void 0}#w(e){return!!gu.get(this.type)?.has(e)}#C(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#w(t.type)}#b(e){let t=gu.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=i,this.#o=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Ee(null,void 0,t);return Ee.#d(e,n,0,t,0),n}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#i||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#n===this&&(this.#h(),this.#v()),!pu(this)){let u=this.isStart()&&this.isEnd()&&!this.#e.some(m=>typeof m!="string"),l=this.#e.map(m=>{let[g,v,_,T]=typeof m=="string"?Ee.#S(m,this.#i,u):m.toRegExpSource(e);return this.#i=this.#i||_,this.#r=this.#r||T,g}).join(""),p="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ph.has(this.#e[0]))){let g=hh,v=t&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),_=!t&&!e&&g.has(l.charAt(0));p=v?fh:_?ar:""}let h="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(h="(?:$|\\/)"),[p+l+h,(0,or.unescape)(l),this.#i=!!this.#i,this.#r]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#m(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),l=this;return l.#e=[u],l.type=null,l.#i=void 0,[u,(0,or.unescape)(this.toString()),!1,!1]}let o=!n||e||t||!ar?"":this.#m(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!t?ar:"")+vu;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ar:"")+mu+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,or.unescape)(s),this.#i=!!this.#i,this.#r]}#h(){if(pu(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#h(),this.#p(i)?(t=!1,this.#g(i,n)):this.#y(i)?(t=!1,this.#_(i,n)):this.#C(i)&&(t=!1,this.#b(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#h();this.#o=void 0}#m(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#S(e,t,n=!1){let i=!1,s="",o=!1,a=!1;for(let u=0;u<e.length;u++){let l=e.charAt(u);if(i){i=!1,s+=(gh.has(l)?"\\":"")+l;continue}if(l==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(e)?vu:mu,t=!0;continue}else a=!1;if(l==="\\"){u===e.length-1?s+="\\\\":i=!0;continue}if(l==="["){let[p,h,f,m]=(0,ah.parseClass)(e,u);if(f){s+=p,o=o||h,u+=f-1,t=t||m;continue}}if(l==="?"){s+=ro,t=!0;continue}s+=mh(l)}return[s,(0,or.unescape)(e),!!t,o]}};ur.AST=cr;Ee=cr});var oo=M(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.escape=void 0;var yh=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");lr.escape=yh});var ao=M(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.unescape=k.escape=k.AST=k.Minimatch=k.match=k.makeRe=k.braceExpand=k.defaults=k.filter=k.GLOBSTAR=k.sep=k.minimatch=void 0;var _h=lu(),dr=du(),wu=so(),wh=oo(),Ch=sr(),bh=(r,e,t={})=>((0,dr.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new un(e,t).match(r));k.minimatch=bh;var Sh=/^\*+([^+@!?*[(]*)$/,Dh=r=>e=>!e.startsWith(".")&&e.endsWith(r),Ph=r=>e=>e.endsWith(r),Th=r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),Rh=r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),Oh=/^\*+\.\*+$/,Fh=r=>!r.startsWith(".")&&r.includes("."),xh=r=>r!=="."&&r!==".."&&r.includes("."),Mh=/^\.\*+$/,kh=r=>r!=="."&&r!==".."&&r.startsWith("."),Eh=/^\*+$/,qh=r=>r.length!==0&&!r.startsWith("."),Ih=r=>r.length!==0&&r!=="."&&r!=="..",Ah=/^\?+([^+@!?*[(]*)?$/,jh=([r,e=""])=>{let t=Cu([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Lh=([r,e=""])=>{let t=bu([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Nh=([r,e=""])=>{let t=bu([r]);return e?n=>t(n)&&n.endsWith(e):t},Uh=([r,e=""])=>{let t=Cu([r]);return e?n=>t(n)&&n.endsWith(e):t},Cu=([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},bu=([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},Su=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yu={win32:{sep:"\\"},posix:{sep:"/"}};k.sep=Su==="win32"?yu.win32.sep:yu.posix.sep;k.minimatch.sep=k.sep;k.GLOBSTAR=Symbol("globstar **");k.minimatch.GLOBSTAR=k.GLOBSTAR;var Kh="[^/]",Hh=Kh+"*?",Wh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$h="(?:(?!(?:\\/|^)\\.).)*?",Bh=(r,e={})=>t=>(0,k.minimatch)(t,r,e);k.filter=Bh;k.minimatch.filter=k.filter;var $e=(r,e={})=>Object.assign({},r,e),zh=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return k.minimatch;let e=k.minimatch;return Object.assign((n,i,s={})=>e(n,i,$e(r,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,$e(r,s))}static defaults(i){return e.defaults($e(r,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,$e(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,$e(r,s))}},unescape:(n,i={})=>e.unescape(n,$e(r,i)),escape:(n,i={})=>e.escape(n,$e(r,i)),filter:(n,i={})=>e.filter(n,$e(r,i)),defaults:n=>e.defaults($e(r,n)),makeRe:(n,i={})=>e.makeRe(n,$e(r,i)),braceExpand:(n,i={})=>e.braceExpand(n,$e(r,i)),match:(n,i,s={})=>e.match(n,i,$e(r,s)),sep:e.sep,GLOBSTAR:k.GLOBSTAR})};k.defaults=zh;k.minimatch.defaults=k.defaults;var Vh=(r,e={})=>((0,dr.assertValidPattern)(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,_h.expand)(r,{max:e.braceExpandMax}));k.braceExpand=Vh;k.minimatch.braceExpand=k.braceExpand;var Gh=(r,e={})=>new un(r,e).makeRe();k.makeRe=Gh;k.minimatch.makeRe=k.makeRe;var Jh=(r,e,t={})=>{let n=new un(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r};k.match=Jh;k.minimatch.match=k.match;var _u=/[?*]|[+@!]\(.*?\)|\[|\]/,Yh=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),un=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){(0,dr.assertValidPattern)(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Su,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!_u.test(s[2]))&&!_u.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(p=>this.parse(p))];if(l)return[s[0],...s.slice(1).map(p=>this.parse(p))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],u=n[i+2],l=n[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(i,1);let p=n.slice(0);p[i]="**",e.push(p),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let u=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...u),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(a==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),p=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),h=u?3:a?0:void 0,f=p?3:l?0:void 0;if(typeof h=="number"&&typeof f=="number"){let[m,g]=[e[h],t[f]];m.toLowerCase()===g.toLowerCase()&&(t[f]=m,s=f,i=h)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(k.GLOBSTAR)?this.#n(e,t,n,i,s):this.#r(e,t,n,i,s)}#n(e,t,n,i,s){let o=t.indexOf(k.GLOBSTAR,s),a=t.lastIndexOf(k.GLOBSTAR),[u,l,p]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,a),t.slice(a+1)];if(u.length){let C=e.slice(i,i+u.length);if(!this.#r(C,u,n,0,0))return!1;i+=u.length,s+=u.length}let h=0;if(p.length){if(p.length+i>e.length)return!1;let C=e.length-p.length;if(this.#r(e,p,n,C,0))h=p.length;else{if(e[e.length-1]!==""||i+p.length===e.length||(C--,!this.#r(e,p,n,C,0)))return!1;h=p.length+1}}if(!l.length){let C=!!h;for(let D=i;D<e.length-h;D++){let F=String(e[D]);if(C=!0,F==="."||F===".."||!this.options.dot&&F.startsWith("."))return!1}return n||C}let f=[[[],0]],m=f[0],g=0,v=[0];for(let C of l)C===k.GLOBSTAR?(v.push(g),m=[[],0],f.push(m)):(m[0].push(C),g++);let _=f.length-1,T=e.length-h;for(let C of f)C[1]=T-(v[_--]+C[0].length);return!!this.#i(e,f,i,0,n,0,!!h)}#i(e,t,n,i,s,o,a){let u=t[i];if(!u){for(let h=n;h<e.length;h++){a=!0;let f=e[h];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[l,p]=u;for(;n<=p;){if(this.#r(e.slice(0,n+l.length),l,s,n,0)&&o<this.maxGlobstarRecursion){let m=this.#i(e,t,n+l.length,i+1,s,o+1,a);if(m!==!1)return m}let f=e[n];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;n++}return s||null}#r(e,t,n,i,s){let o,a,u,l;for(o=i,a=s,l=e.length,u=t.length;o<l&&a<u;o++,a++){this.debug("matchOne loop");let p=t[a],h=e[o];if(this.debug(t,p,h),p===!1||p===k.GLOBSTAR)return!1;let f;if(typeof p=="string"?(f=h===p,this.debug("string match",p,h,f)):(f=p.test(h),this.debug("pattern match",p,h,f)),!f)return!1}if(o===l&&a===u)return!0;if(o===l)return n;if(a===u)return o===l-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,k.braceExpand)(this.pattern,this.options)}parse(e){(0,dr.assertValidPattern)(e);let t=this.options;if(e==="**")return k.GLOBSTAR;if(e==="")return"";let n,i=null;(n=e.match(Eh))?i=t.dot?Ih:qh:(n=e.match(Sh))?i=(t.nocase?t.dot?Rh:Th:t.dot?Ph:Dh)(n[1]):(n=e.match(Ah))?i=(t.nocase?t.dot?Lh:jh:t.dot?Nh:Uh)(n):(n=e.match(Oh))?i=t.dot?xh:Fh:(n=e.match(Mh))&&(i=kh);let s=wu.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Hh:t.dot?Wh:$h,i=new Set(t.nocase?["i"]:[]),s=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))i.add(f);return typeof h=="string"?Yh(h):h===k.GLOBSTAR?k.GLOBSTAR:h._src});l.forEach((h,f)=>{let m=l[f+1],g=l[f-1];h!==k.GLOBSTAR||g===k.GLOBSTAR||(g===void 0?m!==void 0&&m!==k.GLOBSTAR?l[f+1]="(?:\\/|"+n+"\\/)?"+m:l[f]=n:m===void 0?l[f-1]=g+"(?:\\/|\\/"+n+")?":m!==k.GLOBSTAR&&(l[f-1]=g+"(?:\\/|\\/"+n+"\\/)"+m,l[f+1]=k.GLOBSTAR))});let p=l.filter(h=>h!==k.GLOBSTAR);if(this.partial&&p.length>=1){let h=[];for(let f=1;f<=p.length;f++)h.push(p.slice(0,f).join("/"));return"(?:"+h.join("|")+")"}return p.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let u=i;if(n.matchBase&&a.length===1&&(u=[o]),this.matchOne(u,a,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return k.minimatch.defaults(e).Minimatch}};k.Minimatch=un;var Qh=so();Object.defineProperty(k,"AST",{enumerable:!0,get:function(){return Qh.AST}});var Zh=oo();Object.defineProperty(k,"escape",{enumerable:!0,get:function(){return Zh.escape}});var Xh=sr();Object.defineProperty(k,"unescape",{enumerable:!0,get:function(){return Xh.unescape}});k.minimatch.AST=wu.AST;k.minimatch.Minimatch=un;k.minimatch.escape=wh.escape;k.minimatch.unescape=Ch.unescape});var co=M(qt=>{"use strict";var ep=qt&&qt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),tp=qt&&qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),np=qt&&qt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&ep(t,e,n[i]);return tp(t,e),t}})();Object.defineProperty(qt,"__esModule",{value:!0});qt.matchGlobPattern=sp;var ip=np(ao()),rp=I("vscode");function sp(r,e){let t;if(typeof r=="string")t=r.replace(/\\/g,"/");else try{let i=rp.Uri.parse(typeof r.baseUri=="string"?r.baseUri:r.baseUri.uri);t=i.with({path:i.path+"/"+r.pattern}).fsPath.replace(/\\/g,"/")}catch{return!1}let n=new ip.Minimatch(t,{noext:!0});return n.makeRe()?n.match(e.fsPath):!1}});var mo=M(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.DiagnosticFeature=Qt.DiagnosticPullMode=Qt.vsdiag=void 0;var re=I("vscode"),ie=N(),op=ne(),ap=co(),uo=B();function fr(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var Be;(function(r){let e;(function(t){t.full="full",t.unChanged="unChanged"})(e=r.DocumentDiagnosticReportKind||(r.DocumentDiagnosticReportKind={}))})(Be||(Qt.vsdiag=Be={}));var ai;(function(r){r.onType="onType",r.onSave="onSave",r.onFocus="onFocus"})(ai||(Qt.DiagnosticPullMode=ai={}));var Ce;(function(r){r.active="open",r.reschedule="reschedule",r.outDated="drop"})(Ce||(Ce={}));var ge;(function(r){r[r.document=1]="document",r[r.workspace=2]="workspace"})(ge||(ge={}));var It;(function(r){function e(t){return t instanceof re.Uri?t.toString():t.uri.toString()}r.asKey=e})(It||(It={}));var lo=class{documentPullStates;workspacePullStates;constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,n){let i=e===ge.document?this.documentPullStates:this.workspacePullStates,[s,o,a]=t instanceof re.Uri?[t.toString(),t,n]:[t.uri.toString(),t.uri,t.version],u=i.get(s);return u===void 0&&(u={document:o,pulledVersion:a,resultId:void 0},i.set(s,u)),u}update(e,t,n,i){let s=e===ge.document?this.documentPullStates:this.workspacePullStates,[o,a,u,l]=t instanceof re.Uri?[t.toString(),t,n,i]:[t.uri.toString(),t.uri,t.version,n],p=s.get(o);p===void 0?(p={document:a,pulledVersion:u,resultId:l},s.set(o,p)):(p.pulledVersion=u,p.resultId=l)}unTrack(e,t){let n=It.asKey(t);(e===ge.document?this.documentPullStates:this.workspacePullStates).delete(n)}tracks(e,t){let n=It.asKey(t);return(e===ge.document?this.documentPullStates:this.workspacePullStates).has(n)}tracksSameVersion(e,t){let n=t.uri.toString(),s=(e===ge.document?this.documentPullStates:this.workspacePullStates).get(n);return s!==void 0&&s.pulledVersion===t.version}getResultId(e,t){let n=It.asKey(t);return(e===ge.document?this.documentPullStates:this.workspacePullStates).get(n)?.resultId}getAllResultIds(){let e=[];for(let[t,n]of this.workspacePullStates)this.documentPullStates.has(t)&&(n=this.documentPullStates.get(t)),n.resultId!==void 0&&e.push({uri:t,value:n.resultId});return e}},fo=class{isDisposed;client;visibleDocuments;options;onDidChangeDiagnosticsEmitter;provider;diagnostics;openRequests;documentStates;workspaceErrorCounter;workspaceCancellation;workspaceTimeout;constructor(e,t,n){this.client=e,this.visibleDocuments=t,this.options=n,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new re.EventEmitter,this.provider=this.createProvider(),this.diagnostics=re.languages.createDiagnosticCollection(n.identifier),this.openRequests=new Map,this.documentStates=new lo,this.workspaceErrorCounter=0}knows(e,t){let n=t instanceof re.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(n.toString())}knowsSameVersion(e,t){let n=this.openRequests.get(t.uri.toString());return n===void 0?this.documentStates.tracksSameVersion(e,t):n.state===Ce.reschedule?!0:n.state===Ce.outDated?!1:n.version===t.version}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;let n=e instanceof re.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},i=>{this.client.error(`Document pull failed for text document ${n.toString()}`,i,!1)})}async pullAsync(e,t){if(this.isDisposed)return;let n=e instanceof re.Uri,i=n?e:e.uri,s=i.toString();t=n?t:e.version;let o=this.openRequests.get(s),a=n?this.documentStates.track(ge.document,e,t):this.documentStates.track(ge.document,e);if(o===void 0){let u=new re.CancellationTokenSource;this.openRequests.set(s,{state:Ce.active,document:e,version:t,tokenSource:u});let l,p;try{l=await this.provider.provideDiagnostics(e,a.resultId,u.token)??{kind:Be.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof uo.LSPCancellationError&&ie.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(p={state:Ce.outDated,document:e}),p===void 0&&h instanceof re.CancellationError)p={state:Ce.reschedule,document:e};else throw h}if(p=p??this.openRequests.get(s),p===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${s}`),this.diagnostics.delete(i);return}if(this.openRequests.delete(s),!this.visibleDocuments.isVisible(e)){this.documentStates.unTrack(ge.document,e);return}if(p.state===Ce.outDated)return;l!==void 0&&(l.kind===Be.DocumentDiagnosticReportKind.full&&this.diagnostics.set(i,l.items),a.pulledVersion=t,a.resultId=l.resultId),p.state===Ce.reschedule&&this.pull(e)}else o.state===Ce.active?(o.tokenSource.cancel(),this.openRequests.set(s,{state:Ce.reschedule,document:o.document})):o.state===Ce.outDated&&this.openRequests.set(s,{state:Ce.reschedule,document:o.document})}forgetDocument(e){if(this.isDisposed)return;let t=e instanceof re.Uri?e:e.uri,n=t.toString(),i=this.openRequests.get(n);this.options.workspaceDiagnostics&&t.scheme!=="untitled"?(i!==void 0?this.openRequests.set(n,{state:Ce.reschedule,document:e}):this.pull(e,()=>{this.forget(ge.document,e)}),this.forget(ge.workspace,e)):(i!==void 0&&(i.state===Ce.active&&i.tokenSource.cancel(),this.openRequests.set(n,{state:Ce.outDated,document:e})),this.diagnostics.delete(t),this.forget(ge.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,ie.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof uo.LSPCancellationError)&&!ie.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,ie.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new re.CancellationTokenSource;let e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(let n of t.items)n.kind===Be.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(ge.document,n.uri)||this.diagnostics.set(n.uri,n.items)),this.documentStates.update(ge.workspace,n.uri,n.version??void 0,n.resultId)})}createProvider(){let e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,n,i)=>{let s=(a,u,l)=>{let p={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof re.Uri?a:a.uri)},previousResultId:u};return this.isDisposed===!0||!this.client.isRunning()?{kind:Be.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(ie.DocumentDiagnosticRequest.type,p,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Be.DocumentDiagnosticReportKind.full,items:[]}:h.kind===ie.DocumentDiagnosticReportKind.Full?{kind:Be.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Be.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(ie.DocumentDiagnosticRequest.type,l,h,{kind:Be.DocumentDiagnosticReportKind.full,items:[]},!0,!0))},o=this.client.middleware;return o.provideDiagnostics?o.provideDiagnostics(t,n,i,s):s(t,n,i)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,n,i)=>{let s=async l=>l.kind===ie.DocumentDiagnosticReportKind.Full?{kind:Be.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version,items:await this.client.protocol2CodeConverter.asDiagnostics(l.items,n)}:{kind:Be.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(l.uri),resultId:l.resultId,version:l.version},o=l=>{let p=[];for(let h of l)p.push({uri:this.client.code2ProtocolConverter.asUri(h.uri),value:h.value});return p},a=(l,p,h)=>{let f=(0,op.generateUuid)(),m=this.client.onProgress(ie.WorkspaceDiagnosticRequest.partialResult,f,async v=>{if(v==null){h(null);return}let _={items:[]};for(let T of v.items)try{_.items.push(await s(T))}catch(C){this.client.error("Converting workspace diagnostics failed.",C)}h(_)}),g={identifier:this.options.identifier,previousResultIds:o(l),partialResultToken:f};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(ie.WorkspaceDiagnosticRequest.type,g,p).then(async v=>{if(p.isCancellationRequested)return{items:[]};let _={items:[]};for(let T of v.items)_.items.push(await s(T));return m.dispose(),h(_),{items:[]}},v=>(m.dispose(),this.client.handleFailedRequest(ie.DocumentDiagnosticRequest.type,p,v,{items:[]})))},u=this.client.middleware;return u.provideWorkspaceDiagnostics?u.provideWorkspaceDiagnostics(t,n,i,a):a(t,n,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(let[e,t]of this.openRequests)t.state===Ce.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:Ce.outDated,document:t.document});this.diagnostics.dispose()}},ho=class{client;diagnosticRequestor;lastDocumentToPull;documents;timeoutHandle;isDisposed;constructor(e,t){this.client=e,this.diagnosticRequestor=t,this.documents=new ie.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;let t=It.asKey(e);this.documents.has(t)||(this.documents.set(t,e,ie.Touch.Last),this.lastDocumentToPull=e)}remove(e){let t=It.asKey(e);if(this.documents.delete(t),this.documents.size===0){this.stop();return}else if(t===this.lastDocumentToPullKey()){let n=this.documents.before(t);n===void 0?this.stop():this.lastDocumentToPull=n}}trigger(){this.lastDocumentToPull=this.documents.last,this.runLoop()}runLoop(){if(this.isDisposed!==!0){if(this.documents.size===0){this.stop();return}this.lastDocumentToPull!==void 0&&this.timeoutHandle===void 0&&(this.timeoutHandle=(0,ie.RAL)().timer.setTimeout(()=>{let e=this.documents.first;if(e===void 0)return;let t=It.asKey(e);this.diagnosticRequestor.pullAsync(e).catch(n=>{this.client.error(`Document pull failed for text document ${t}`,n,!1)}).finally(()=>{this.timeoutHandle=void 0,this.documents.set(t,e,ie.Touch.Last),t!==this.lastDocumentToPullKey()&&this.runLoop()})},500))}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear(),this.lastDocumentToPull=void 0}stop(){this.timeoutHandle?.dispose(),this.timeoutHandle=void 0,this.lastDocumentToPull=void 0}lastDocumentToPullKey(){return this.lastDocumentToPull!==void 0?It.asKey(this.lastDocumentToPull):void 0}},po=class{disposable;diagnosticRequestor;activeTextDocument;backgroundScheduler;constructor(e,t,n){let i=Object.assign({onChange:!1,onSave:!1,onFocus:!1},e.clientOptions.diagnosticPullOptions),s=e.protocol2CodeConverter.asDocumentSelector(n.documentSelector),o=[],a=(C,D)=>!(typeof C=="string"||C.language!==void 0&&C.language!=="*"||C.scheme!==void 0&&C.scheme!=="*"&&C.scheme!==D.scheme||C.pattern!==void 0&&!(0,ap.matchGlobPattern)(C.pattern,D)),u=C=>{let D=n.documentSelector;if(i.match!==void 0)return i.match(D,C);for(let F of D)if(ie.TextDocumentFilter.is(F)&&a(F,C))return!0;return!1},l=C=>C instanceof re.Uri?u(C):re.languages.match(s,C)>0&&t.isVisible(C),p=C=>re.languages.match(s,C.document)>0&&t.isVisible(C.notebook.uri),h=C=>C instanceof re.Uri?this.activeTextDocument?.uri.toString()===C.toString():this.activeTextDocument===C;this.diagnosticRequestor=new fo(e,t,n),this.backgroundScheduler=new ho(e,this.diagnosticRequestor);let f=C=>{!l(C)||!n.interFileDependencies||h(C)||i.onChange===!1||this.backgroundScheduler.add(C)},m=(C,D)=>(i.filter===void 0||!i.filter(C,D))&&this.diagnosticRequestor.knows(ge.document,C);this.activeTextDocument=re.window.activeTextEditor?.document,o.push(re.window.onDidChangeActiveTextEditor(C=>{let D=this.activeTextDocument;this.activeTextDocument=C?.document,D!==void 0&&f(D),this.activeTextDocument!==void 0&&(this.backgroundScheduler.remove(this.activeTextDocument),i.onFocus===!0&&l(this.activeTextDocument)&&m(this.activeTextDocument,ai.onFocus)&&this.diagnosticRequestor.pull(this.activeTextDocument))}));let g=e.getFeature(ie.DidOpenTextDocumentNotification.method);o.push(g.onNotificationSent(C=>{let D=C.textDocument;this.diagnosticRequestor.knowsSameVersion(ge.document,D)||l(D)&&this.diagnosticRequestor.pull(D,()=>{f(D)})}));let v=e.getFeature(ie.NotebookDocumentSyncRegistrationType.method);o.push(v.onOpenNotificationSent(C=>{for(let D of C.getCells())p(D)&&this.diagnosticRequestor.pull(D.document,()=>{f(D.document)})})),o.push(t.onOpen(C=>{for(let D of C){if(this.diagnosticRequestor.knows(ge.document,D))continue;let F=D.toString(),E;for(let Q of re.workspace.textDocuments)if(F===Q.uri.toString()){E=Q;break}E!==void 0&&l(E)&&this.diagnosticRequestor.pull(E,()=>{f(E)})}}));let _=new Set;for(let C of re.workspace.textDocuments)l(C)&&(this.diagnosticRequestor.pull(C,()=>{f(C)}),_.add(C.uri.toString()));for(let C of re.workspace.notebookDocuments)for(let D of C.getCells())p(D)&&(this.diagnosticRequestor.pull(D.document,()=>{f(D.document)}),_.add(D.document.uri.toString()));if(i.onTabs===!0)for(let C of t.getResources())!_.has(C.toString())&&l(C)&&this.diagnosticRequestor.pull(C,()=>{f(C)});if(i.onChange===!0){let C=e.getFeature(ie.DidChangeTextDocumentNotification.method);o.push(C.onNotificationSent(async D=>{let F=D.textDocument;m(F,ai.onType)&&this.diagnosticRequestor.pull(F,()=>{this.backgroundScheduler.trigger()})})),o.push(v.onChangeNotificationSent(async D=>{let E=(D.cells?.textContent||[]).map(xe=>D.notebook.getCells().find(Un=>Un.document.uri.toString()===xe.document.uri.toString()));for(let xe of E)xe&&p(xe)&&this.diagnosticRequestor.pull(xe.document,()=>{this.backgroundScheduler.trigger()});let Q=D.cells?.structure?.didClose||[];for(let xe of Q)this.diagnosticRequestor.forgetDocument(xe.document);let we=D.cells?.structure?.didOpen||[];for(let xe of we)p(xe)&&this.diagnosticRequestor.pull(xe.document,()=>{this.backgroundScheduler.trigger()})}))}if(i.onSave===!0){let C=e.getFeature(ie.DidSaveTextDocumentNotification.method);o.push(C.onNotificationSent(D=>{let F=D.textDocument;m(F,ai.onSave)&&this.diagnosticRequestor.pull(D.textDocument)})),o.push(v.onSaveNotificationSent(D=>{for(let F of D.getCells())p(F)&&this.diagnosticRequestor.pull(F.document)}))}let T=e.getFeature(ie.DidCloseTextDocumentNotification.method);o.push(T.onNotificationSent(C=>{this.cleanUpDocument(C.textDocument)})),o.push(v.onCloseNotificationSent(C=>{for(let D of C.getCells())this.cleanUpDocument(D.document)})),o.push(t.onClose(C=>{for(let D of C)this.cleanUpDocument(D)})),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(let C of re.workspace.textDocuments)l(C)&&this.diagnosticRequestor.pull(C)}),n.workspaceDiagnostics===!0&&n.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=re.Disposable.from(...o,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}forget(e){this.cleanUpDocument(e)}cleanUpDocument(e){this.backgroundScheduler.remove(e),this.diagnosticRequestor.knows(ge.document,e)&&this.diagnosticRequestor.forgetDocument(e)}},go=class extends uo.TextDocumentLanguageFeature{constructor(e){super(e,ie.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=fr(fr(e,"textDocument"),"diagnostic");t.relatedInformation=!0,t.tagSupport={valueSet:[ie.DiagnosticTag.Unnecessary,ie.DiagnosticTag.Deprecated]},t.codeDescriptionSupport=!0,t.dataSupport=!0,t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,t.markupMessageSupport=!1,fr(fr(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(ie.DiagnosticRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeDiagnosticsEmitter.fire()});let[i,s]=this.getRegistration(t,e.diagnosticProvider);!i||!s||this.register({id:i,registerOptions:s})}clear(){super.clear()}refresh(){for(let e of this.getAllProviders())e.onDidChangeDiagnosticsEmitter.fire()}registerLanguageProvider(e){let t=new po(this._client,this._client.visibleDocuments,e);return[t.disposable,t]}};Qt.DiagnosticFeature=go});var Tu=M(rt=>{"use strict";var cp=rt&&rt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),up=rt&&rt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),mr=rt&&rt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&cp(t,e,n[i]);return up(t,e),t}})();Object.defineProperty(rt,"__esModule",{value:!0});rt.NotebookDocumentSyncFeature=void 0;var se=mr(I("vscode")),At=mr(N()),lp=mr(ne()),Du=mr(He()),dp=co();function Pu(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var Rn;(function(r){let e;(function(t){function n(f,m){return{version:f.version,uri:m.asUri(f.uri)}}t.asVersionedNotebookDocumentIdentifier=n;function i(f,m,g){let v=At.NotebookDocument.create(g.asUri(f.uri),f.notebookType,f.version,s(m,g));return Object.keys(f.metadata).length>0&&(v.metadata=o(f.metadata)),v}t.asNotebookDocument=i;function s(f,m){return f.map(g=>a(g,m))}t.asNotebookCells=s;function o(f){return l(new Set,f)}t.asMetadata=o;function a(f,m){let g=At.NotebookCell.create(u(f.kind),m.asUri(f.document.uri));return Object.keys(f.metadata).length>0&&(g.metadata=o(f.metadata)),f.executionSummary!==void 0&&Du.number(f.executionSummary.executionOrder)&&Du.boolean(f.executionSummary.success)&&(g.executionSummary={executionOrder:f.executionSummary.executionOrder,success:f.executionSummary.success}),g}t.asNotebookCell=a;function u(f){switch(f){case se.NotebookCellKind.Markup:return At.NotebookCellKind.Markup;case se.NotebookCellKind.Code:return At.NotebookCellKind.Code}}function l(f,m){if(f.has(m))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(m)){let g=[];for(let v of m)if(v!==null&&typeof v=="object"||Array.isArray(v))g.push(l(f,v));else{if(v instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");g.push(v)}return g}else{let g=Object.keys(m),v=Object.create(null);for(let _ of g){let T=m[_];if(T!==null&&typeof T=="object"||Array.isArray(T))v[_]=l(f,T);else{if(T instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");v[_]=T}}return v}}function p(f,m){let g=m.asChangeTextDocumentParams(f,f.document.uri,f.document.version);return{document:g.textDocument,changes:g.contentChanges}}t.asTextContentChange=p;function h(f,m){let g=Object.create(null);if(f.metadata&&(g.metadata=r.c2p.asMetadata(f.metadata)),f.cells!==void 0){let v=Object.create(null),_=f.cells;_.structure&&(v.structure={array:{start:_.structure.array.start,deleteCount:_.structure.array.deleteCount,cells:_.structure.array.cells!==void 0?_.structure.array.cells.map(T=>r.c2p.asNotebookCell(T,m)):void 0},didOpen:_.structure.didOpen!==void 0?_.structure.didOpen.map(T=>m.asOpenTextDocumentParams(T.document).textDocument):void 0,didClose:_.structure.didClose!==void 0?_.structure.didClose.map(T=>m.asCloseTextDocumentParams(T.document).textDocument):void 0}),_.data!==void 0&&(v.data=_.data.map(T=>r.c2p.asNotebookCell(T,m))),_.textContent!==void 0&&(v.textContent=_.textContent.map(T=>r.c2p.asTextContentChange(T,m))),Object.keys(v).length>0&&(g.cells=v)}return g}t.asNotebookDocumentChangeEvent=h})(e=r.c2p||(r.c2p={}))})(Rn||(Rn={}));var vo;(function(r){function e(a,u,l){let p=a.length,h=u.length,f=0;for(;f<h&&f<p&&t(a[f],u[f],l);)f++;if(f<h&&f<p){let m=p-1,g=h-1;for(;m>=0&&g>=0&&t(a[m],u[g],l);)m--,g--;let v=m+1-f,_=f===g+1?void 0:u.slice(f,g+1);return _!==void 0?{start:f,deleteCount:v,cells:_}:{start:f,deleteCount:v}}else return f<h?{start:f,deleteCount:0,cells:u.slice(f)}:f<p?{start:f,deleteCount:p-f}:void 0}r.computeDiff=e;function t(a,u,l=!0){return a.kind!==u.kind||a.document.uri.toString()!==u.document.uri.toString()||a.document.languageId!==u.document.languageId||!n(a.executionSummary,u.executionSummary)?!1:!l||l&&s(a.metadata,u.metadata)}function n(a,u){return a===u?!0:a===void 0||u===void 0?!1:a.executionOrder===u.executionOrder&&a.success===u.success&&i(a.timing,u.timing)}function i(a,u){return a===u?!0:a===void 0||u===void 0?!1:a.startTime===u.startTime&&a.endTime===u.endTime}function s(a,u){if(a===u)return!0;if(a==null||u===null||u===void 0||typeof a!=typeof u||typeof a!="object")return!1;let l=Array.isArray(a),p=Array.isArray(u);if(l!==p)return!1;if(l&&p){if(a.length!==u.length)return!1;for(let h=0;h<a.length;h++)if(!s(a[h],u[h]))return!1}if(o(a)&&o(u)){let h=Object.keys(a),f=Object.keys(u);if(h.length!==f.length||(h.sort(),f.sort(),!s(h,f)))return!1;for(let m=0;m<h.length;m++){let g=h[m];if(!s(a[g],u[g]))return!1}return!0}return!1}function o(a){return a!==null&&typeof a=="object"}r.isObjectLiteral=o})(vo||(vo={}));var hr;(function(r){function e(t,n){if(typeof t=="string")return t==="*"||n.notebookType===t;if(t.notebookType!==void 0&&t.notebookType!=="*"&&n.notebookType!==t.notebookType)return!1;let i=n.uri;return!(t.scheme!==void 0&&t.scheme!=="*"&&i.scheme!==t.scheme||t.pattern!==void 0&&!(0,dp.matchGlobPattern)(t.pattern,i))}r.matchNotebook=e})(hr||(hr={}));var pr;(function(r){function e(n){let i=n.notebookSelector,s=[];for(let o of i){let a=(typeof o.notebook=="string"?o.notebook:o.notebook?.notebookType)??"*",u=typeof o.notebook=="string"?void 0:o.notebook?.scheme,l=typeof o.notebook=="string"?void 0:o.notebook?.pattern;if(o.cells!==void 0)for(let p of o.cells)s.push(t(a,u,l,p.language));else s.push(t(a,u,l,void 0))}return s}r.asDocumentSelector=e;function t(n,i,s,o){return i===void 0&&s===void 0?{notebook:n,language:o}:{notebook:{notebookType:n,scheme:i,pattern:s},language:o}}})(pr||(pr={}));var gr;(function(r){function e(t){return{cells:t,uris:new Set(t.map(n=>n.document.uri.toString()))}}r.create=e})(gr||(gr={}));var On=class{client;options;notebookSyncInfo;notebookDidOpen;disposables;selector;onChangeNotificationSent;onOpenNotificationSent;onCloseNotificationSent;onSaveNotificationSent;constructor(e,t,n,i,s,o){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(pr.asDocumentSelector(t)),this.onChangeNotificationSent=n,this.onOpenNotificationSent=i,this.onCloseNotificationSent=s,this.onSaveNotificationSent=o,se.workspace.onDidOpenNotebookDocument(a=>{this.notebookDidOpen.add(a.uri.toString()),this.didOpen(a)},void 0,this.disposables);for(let a of se.workspace.notebookDocuments)this.notebookDidOpen.add(a.uri.toString()),this.didOpen(a);se.workspace.onDidChangeNotebookDocument(a=>this.didChangeNotebookDocument(a),void 0,this.disposables),this.options.save===!0&&se.workspace.onDidSaveNotebookDocument(a=>this.didSave(a),void 0,this.disposables),se.workspace.onDidCloseNotebookDocument(a=>{this.didClose(a),this.notebookDidOpen.delete(a.uri.toString())},void 0,this.disposables)}getState(){for(let e of se.workspace.notebookDocuments)if(this.getMatchingCellsConsideringSyncInfo(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){if(se.languages.match(this.selector,e)>0)return!0;let t=e.uri.toString();for(let n of this.notebookSyncInfo.values())if(n.uris.has(t))return!0;return!1}didOpenNotebookCellTextDocument(e,t){if(se.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;let n=this.getSyncInfo(e),i=this.cellMatches(e,t);if(n!==void 0){let s=n.uris.has(t.document.uri.toString());if(i&&s||!i&&!s)return;if(i){let o=this.mergeCells(e,n,[t]);if(o!==void 0){let a=this.asNotebookDocumentChangeEvent(e,void 0,n,o);a!==void 0&&this.doSendChange(a,o).catch(()=>{})}}}else i&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t,n){if(se.languages.match(this.selector,n.document)===0)return;let i=this.getSyncInfo(e);i===void 0||!i.uris.has(t.document.uri.toString())||this.doSendChange({notebook:e,cells:{textContent:[n]}},i.cells).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){let n=this.getSyncInfo(e);if(n===void 0)return;let i=t.document.uri,s=n.cells.findIndex(o=>o.document.uri.toString()===i.toString());if(s!==-1)if(s===0&&n.cells.length===1)this.doSendClose(e,n.cells).catch(()=>{});else{let o=n.cells.slice(),a=o.splice(s,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:s,deleteCount:1},didClose:a}}},o).catch(()=>{})}}dispose(){for(let e of this.disposables)e.dispose()}didOpen(e,t,n=this.getSyncInfo(e)){if(n!==void 0)if(t===void 0&&(t=n.cells.slice()),t!==void 0){let i=this.asNotebookDocumentChangeEvent(e,void 0,n,t);i!==void 0&&this.doSendChange(i,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t=this.getMatchingCells(e),t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){let t=e.notebook,n=this.getSyncInfo(t);if(n===void 0){if(e.contentChanges.length===0)return;let i=this.getMatchingCells(t);if(i===void 0)return;this.didOpen(t,i,n)}else{let i=this.getMatchingCellsFromEvent(t,n,e);if(i===void 0){this.didClose(t,n);return}let s=this.asNotebookDocumentChangeEvent(e.notebook,e,n,i);s!==void 0&&this.doSendChange(s,i).catch(()=>{})}}didSave(e){this.getSyncInfo(e)!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.getSyncInfo(e)){if(t===void 0)return;let n=e.getCells().filter(i=>t.uris.has(i.document.uri.toString()));this.doSendClose(e,n).catch(()=>{})}async sendDidOpenNotebookDocument(e){if(this.getSyncInfo(e)!==void 0)throw new Error(`Notebook document ${e.uri.toString()} is already open`);let n=this.getMatchingCells(e);if(n!==void 0)return this.doSendOpen(e,n)}async doSendOpen(e,t){let n=async(s,o)=>{let a=o.map(u=>this.client.code2ProtocolConverter.asTextDocumentItem(u.document));try{await this.client.sendNotification(At.DidOpenNotebookDocumentNotification.type,{notebookDocument:Rn.c2p.asNotebookDocument(s,o,this.client.code2ProtocolConverter),cellTextDocuments:a}),this.onOpenNotificationSent.fire(s)}catch(u){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",u),u}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),gr.create(t)),i?.didOpen!==void 0?i.didOpen(e,t,n):n(e,t)}async sendDidChangeNotebookDocument(e){let t=this.getMatchingCellsFromSyncInfo(e.notebook);if(t===void 0)throw new Error(`Received changed event for un-synced notebook ${e.notebook.uri.toString()}`);return this.doSendChange(e,t)}async doSendChange(e,t){let n=async s=>{try{await this.client.sendNotification(At.DidChangeNotebookDocumentNotification.type,{notebookDocument:Rn.c2p.asVersionedNotebookDocumentIdentifier(s.notebook,this.client.code2ProtocolConverter),change:Rn.c2p.asNotebookDocumentChangeEvent(s,this.client.code2ProtocolConverter)}),this.onChangeNotificationSent.fire(s)}catch(o){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",o),o}},i=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),gr.create(t)),i?.didChange!==void 0?i?.didChange(e,n):n(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){let t=async i=>{try{await this.client.sendNotification(At.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(i.uri)}}),this.onSaveNotificationSent.fire(i)}catch(s){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",s),s}},n=this.client.middleware?.notebooks;return n?.didSave!==void 0?n.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){let t=this.getMatchingCellsFromSyncInfo(e);if(t===void 0)throw new Error(`Received close event for un-synced notebook ${e.uri.toString()}`);return this.doSendClose(e,t)}async doSendClose(e,t){let n=async(s,o)=>{try{await this.client.sendNotification(At.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(s.uri)},cellTextDocuments:o.map(a=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(a.document))}),this.onCloseNotificationSent.fire(s)}catch(a){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",a),a}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),i?.didClose!==void 0?i.didClose(e,t,n):n(e,t)}getSynchronizedCells(e){return this.getSyncInfo(e)?.cells}asNotebookDocumentChangeEvent(e,t,n,i){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");let s={notebook:e};t?.metadata!==void 0&&(s.metadata=Rn.c2p.asMetadata(t.metadata));let o;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){let a=[];o=new Set(i.map(u=>u.document.uri.toString()));for(let u of t.cellChanges)o.has(u.cell.document.uri.toString())&&(u.executionSummary!==void 0||u.metadata!==void 0)&&a.push(u.cell);a.length>0&&(s.cells=s.cells??{},s.cells.data=a)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&n!==void 0&&i!==void 0){let a=n.cells,u=i,l=vo.computeDiff(a,u,!1),p,h;if(l!==void 0){p=l.cells===void 0?new Map:new Map(l.cells.map(g=>[g.document.uri.toString(),g])),h=l.deleteCount===0?new Map:new Map(a.slice(l.start,l.start+l.deleteCount).map(g=>[g.document.uri.toString(),g]));for(let g of Array.from(h.keys()))p.has(g)&&(h.delete(g),p.delete(g));s.cells=s.cells??{};let f=[],m=[];if(p.size>0||h.size>0){for(let g of p.values())f.push(g);for(let g of h.values())m.push(g)}s.cells.structure={array:l,didOpen:f,didClose:m}}}return Object.keys(s).length>1?s:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(let n of this.options.notebookSelector)if(n.notebook===void 0||hr.matchNotebook(n.notebook,e)){let i=this.filterCells(e,t,n.cells);return i.length===0?void 0:i}}}getMatchingCellsFromEvent(e,t,n){if(this.options.notebookSelector===void 0)return;let i;for(let u of this.options.notebookSelector)if(u.notebook===void 0||hr.matchNotebook(u.notebook,e)){i=u;break}if(i===void 0)return;if((n.cellChanges===void 0||n.cellChanges.length===0)&&(n.contentChanges===void 0||n.contentChanges.length===0))return t.cells;let s;if(n.cellChanges!==void 0&&n.cellChanges.length>0){let u=n.cellChanges.map(p=>p.cell),l=this.filterCells(e,u,i.cells);if(l.length!==u.length){s=new Set(t.uris);for(let p of u)s.delete(p.document.uri.toString());for(let p of l)s.add(p.document.uri.toString())}}if(n.contentChanges!==void 0&&n.contentChanges.length>0){s===void 0&&(s=new Set(t.uris));for(let u of n.contentChanges){for(let p of u.removedCells)s.delete(p.document.uri.toString());let l=this.filterCells(e,new Array(...u.addedCells),i.cells);for(let p of l)s.add(p.document.uri.toString())}}if(s===void 0)return t.cells;let o=[],a=e.getCells();for(let u of a)s.has(u.document.uri.toString())&&o.push(u);return o}getMatchingCellsFromSyncInfo(e){let t=this.getSyncInfo(e);return t!==void 0?t.cells:void 0}getMatchingCellsConsideringSyncInfo(e){let t=this.getSyncInfo(e);return t!==void 0?t.cells:this.getMatchingCells(e)}mergeCells(e,t,n){let i=[],s=new Set(t.uris);for(let o of n)s.add(o.document.uri.toString());for(let o of e.getCells())s.has(o.document.uri.toString())&&i.push(o);return i}cellMatches(e,t){let n=this.getMatchingCells(e,[t]);return n!==void 0&&n[0]===t}filterCells(e,t,n){let i=n!==void 0?t.filter(s=>{let o=s.document.languageId;return n.some((a=>a.language==="*"||o===a.language))}):t;return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,i):i}getSyncInfo(e){return this.notebookSyncInfo.get(e.uri.toString())}},yo=class r{static CellScheme="vscode-notebook-cell";client;registrations;dedicatedChannel;_onChangeNotificationSent;_onOpenNotificationSent;_onCloseNotificationSent;_onSaveNotificationSent;constructor(e){this.client=e,this.registrations=new Map,this.registrationType=At.NotebookDocumentSyncRegistrationType.type,this._onChangeNotificationSent=new se.EventEmitter,this._onOpenNotificationSent=new se.EventEmitter,this._onCloseNotificationSent=new se.EventEmitter,this._onSaveNotificationSent=new se.EventEmitter,se.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==r.CellScheme)return;let[n,i]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||i===void 0))for(let s of this.registrations.values())s instanceof On&&s.didOpenNotebookCellTextDocument(n,i)}),se.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;let n=t.document;if(n.uri.scheme!==r.CellScheme)return;let[i,s]=this.findNotebookDocumentAndCell(n);if(!(i===void 0||s===void 0))for(let o of this.registrations.values())o instanceof On&&o.didChangeNotebookCellTextDocument(i,s,t)}),se.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==r.CellScheme)return;let[n,i]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||i===void 0))for(let s of this.registrations.values())s instanceof On&&s.didCloseNotebookCellTextDocument(n,i)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(let e of this.registrations.values()){let t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}registrationType;get onOpenNotificationSent(){return this._onOpenNotificationSent.event}get onChangeNotificationSent(){return this._onChangeNotificationSent.event}get onCloseNotificationSent(){return this._onCloseNotificationSent.event}get onSaveNotificationSent(){return this._onSaveNotificationSent.event}fillClientCapabilities(e){let t=Pu(Pu(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){let t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(pr.asDocumentSelector(t)))}initialize(e){let t=e.notebookDocumentSync;if(t===void 0)return;let n=t.id??lp.generateUuid();this.register({id:n,registerOptions:t})}register(e){let t=new On(this.client,e.registerOptions,this._onChangeNotificationSent,this._onOpenNotificationSent,this._onCloseNotificationSent,this._onSaveNotificationSent);this.registrations.set(e.id,t)}unregister(e){let t=this.registrations.get(e);t!==void 0&&(this.registrations.delete(e),t.dispose())}clear(){for(let e of this.registrations.values())e.dispose();this.registrations.clear(),this._onChangeNotificationSent.dispose(),this._onChangeNotificationSent=new se.EventEmitter,this._onOpenNotificationSent.dispose(),this._onOpenNotificationSent=new se.EventEmitter,this._onCloseNotificationSent.dispose(),this._onCloseNotificationSent=new se.EventEmitter,this._onSaveNotificationSent.dispose(),this._onSaveNotificationSent=new se.EventEmitter}handles(e){if(e.uri.scheme!==r.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&se.languages.match(this.dedicatedChannel,e)>0)return!0;for(let t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(let t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){let t=e.uri.toString();for(let n of se.workspace.notebookDocuments)for(let i of n.getCells())if(i.document.uri.toString()===t)return[n,i];return[void 0,void 0]}};rt.NotebookDocumentSyncFeature=yo});var Fu=M(je=>{"use strict";var fp=je&&je.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),hp=je&&je.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ou=je&&je.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&fp(t,e,n[i]);return hp(t,e),t}})();Object.defineProperty(je,"__esModule",{value:!0});je.SyncConfigurationFeature=je.ConfigurationFeature=void 0;je.toJSONObject=ln;var Fn=I("vscode"),ci=N(),pp=Ou(He()),gp=Ou(ne()),Ru=B(),_o=class{_client;constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(ci.ConfigurationRequest.type,(t,n)=>{let i=o=>{let a=[];for(let u of o.items){let l=u.scopeUri!==void 0&&u.scopeUri!==null?this._client.protocol2CodeConverter.asUri(u.scopeUri):void 0;a.push(this.getConfiguration(l,u.section!==null?u.section:void 0))}return a},s=e.middleware.workspace;return s&&s.configuration?s.configuration(t,n,i):i(t,n)})}getConfiguration(e,t){let n=null;if(t){let i=t.lastIndexOf(".");if(i===-1)n=ln(Fn.workspace.getConfiguration(void 0,e).get(t));else{let s=Fn.workspace.getConfiguration(t.substr(0,i),e);s&&(n=ln(s.get(t.substr(i+1))))}}else{let i=Fn.workspace.getConfiguration(void 0,e);n={};for(let s of Object.keys(i))i.has(s)&&(n[s]=ln(i.get(s)))}return n===void 0&&(n=null),n}clear(){}};je.ConfigurationFeature=_o;function ln(r){if(r){if(Array.isArray(r))return r.map(ln);if(typeof r=="object"){let e=Object.create(null);for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=ln(r[t]));return e}}return r}var wo=class{_client;isCleared;_listeners;constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return ci.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,Ru.ensure)((0,Ru.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:gp.generateUuid(),registerOptions:{section:e}})}register(e){let t=Fn.workspace.onDidChangeConfiguration(n=>{this.onDidChangeConfiguration(e.registerOptions.section,n)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let n;if(pp.string(e)?n=[e]:n=e,n!==void 0&&t!==void 0&&!n.some(a=>t.affectsConfiguration(a)))return;let i=async o=>o===void 0?this._client.sendNotification(ci.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(ci.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(o)}),s=this._client.middleware.workspace?.didChangeConfiguration;(s?s(n,i):i(n)).catch(o=>{this._client.error(`Sending notification ${ci.DidChangeConfigurationNotification.type.method} failed`,o)})}extractSettingsInformation(e){function t(s,o){let a=s;for(let u=0;u<o.length-1;u++){let l=a[o[u]];l||(l=Object.create(null),a[o[u]]=l),a=l}return a}let n=this._client.clientOptions.workspaceFolder?this._client.clientOptions.workspaceFolder.uri:void 0,i=Object.create(null);for(let s=0;s<e.length;s++){let o=e[s],a=o.indexOf("."),u=null;if(a>=0?u=Fn.workspace.getConfiguration(o.substr(0,a),n).get(o.substr(a+1)):u=Fn.workspace.getConfiguration(void 0,n).get(o),u){let l=e[s].split(".");t(i,l)[l[l.length-1]]=ln(u)}}return i}};je.SyncConfigurationFeature=wo});var xu=M(ve=>{"use strict";var mp=ve&&ve.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),vp=ve&&ve.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),yp=ve&&ve.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&mp(t,e,n[i]);return vp(t,e),t}})();Object.defineProperty(ve,"__esModule",{value:!0});ve.DidSaveTextDocumentFeature=ve.WillSaveWaitUntilFeature=ve.WillSaveFeature=ve.DidChangeTextDocumentFeature=ve.DidCloseTextDocumentFeature=ve.DidOpenTextDocumentFeature=void 0;var me=I("vscode"),ee=N(),ce=B(),xn=yp(ne()),_p=(od(),td(sd)),Co=class extends ce.TextDocumentEventFeature{_syncedDocuments;_pendingOpenNotifications;_delayOpen;_pendingOpenListeners;constructor(e,t){super(e,me.workspace.onDidOpenTextDocument,ee.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,n=>e.code2ProtocolConverter.asOpenTextDocumentParams(n),n=>n,ce.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingOpenNotifications=new Map,this._delayOpen=e.clientOptions.textSynchronization?.delayOpenNotifications??!1}async callback(e){if(this._delayOpen){if(!this.matches(e))return;if(this._client.visibleDocuments.isVisible(e))return super.callback(e);{let n=new Ro(e);this._pendingOpenNotifications.set(n.uri.toString(),n)}}else return super.callback(e)}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:xn.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return ee.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;let t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);if(me.workspace.textDocuments.forEach(n=>{let i=n.uri.toString();if(!this._syncedDocuments.has(i)&&me.languages.match(t,n)>0&&!this._client.hasDedicatedTextSynchronizationFeature(n))if(this._client.visibleDocuments.isVisible(n)){let o=this._client.middleware,a=u=>this._client.sendNotification(this._type,this._createParams(u));(o.didOpen?o.didOpen(n,a):a(n)).catch(u=>{this._client.error(`Sending document notification ${this._type.method} failed`,u)}),this._syncedDocuments.set(i,n)}else this._pendingOpenNotifications.set(i,n)}),this._delayOpen&&this._pendingOpenListeners===void 0){this._pendingOpenListeners=[];let n=this._client.visibleDocuments;this._pendingOpenListeners.push(n.onClose(i=>{for(let s of i)this._pendingOpenNotifications.delete(s.toString())})),this._pendingOpenListeners.push(n.onOpen(i=>{for(let s of i){let o=this._pendingOpenNotifications.get(s.toString());o!==void 0&&(super.callback(o).catch((a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})),this._pendingOpenNotifications.delete(s.toString()))}})),this._pendingOpenListeners.push(me.workspace.onDidCloseTextDocument(i=>{this._pendingOpenNotifications.delete(i.uri.toString())}))}}async sendPendingOpenNotifications(e){let t=Array.from(this._pendingOpenNotifications.values());this._pendingOpenNotifications.clear();let n=!1;for(let i of t){if(e!==void 0&&i.uri.toString()===e){n=!0;continue}await super.callback(i)}return n}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,n)}clear(){if(this._pendingOpenNotifications.clear(),this._pendingOpenListeners!==void 0){for(let e of this._pendingOpenListeners)e.dispose();this._pendingOpenListeners=void 0}super.clear()}};ve.DidOpenTextDocumentFeature=Co;var bo=class extends ce.TextDocumentEventFeature{_syncedDocuments;_pendingTextDocumentChanges;constructor(e,t,n){super(e,me.workspace.onDidCloseTextDocument,ee.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,i=>e.code2ProtocolConverter.asCloseTextDocumentParams(i),i=>i,ce.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=n}get registrationType(){return ee.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:xn.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,n)}unregister(e){let t=this._selectors.get(e);if(t===void 0)return;super.unregister(e);let n=this._selectors.values();this._syncedDocuments.forEach(i=>{if(me.languages.match(t,i)>0&&!this._selectorFilter(n,i)&&!this._client.hasDedicatedTextSynchronizationFeature(i)){let s=this._client.middleware,o=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(i.uri.toString()),(s.didClose?s.didClose(i,o):o(i)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}};ve.DidCloseTextDocumentFeature=bo;var So=class extends ce.DynamicDocumentFeature{_listener;_changeData;_onNotificationSent;_onPendingChangeAdded;_pendingTextDocumentChanges;_syncKind;constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new me.EventEmitter,this._onPendingChangeAdded=new me.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=ee.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return ee.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.change!==void 0&&n.change!==ee.TextDocumentSyncKind.None&&this.register({id:xn.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:n.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=me.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(let e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;let t=e.document.uri,n=e.document.version,i=[];for(let s of this._changeData.values())if(me.languages.match(s.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let o=this._client.middleware;if(s.syncKind===ee.TextDocumentSyncKind.Incremental){let a=async u=>{let l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(u,t,n);await this._client.sendNotification(ee.DidChangeTextDocumentNotification.type,l),this.notificationSent(u.document,ee.DidChangeTextDocumentNotification.type,l)};i.push(o.didChange?o.didChange(e,u=>a(u)):a(e))}else if(s.syncKind===ee.TextDocumentSyncKind.Full){let a=async u=>{let l=u.document.uri.toString();this._pendingTextDocumentChanges.set(l,u.document),this._onPendingChangeAdded.fire()};i.push(o.didChange?o.didChange(e,u=>a(u)):a(e))}}return Promise.all(i).then(void 0,s=>{throw this._client.error(`Sending document notification ${ee.DidChangeTextDocumentNotification.type.method} failed`,s),s})}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&(this._listener.dispose(),this._listener=void 0),this._syncKind=ee.TextDocumentSyncKind.None;else{this._syncKind=ee.TextDocumentSyncKind.None;for(let t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===ee.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=ee.TextDocumentSyncKind.None,this._listener&&(this._listener.dispose(),this._listener=void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(let n of this._pendingTextDocumentChanges)e.has(n[0])||(t.push(n[1]),this._pendingTextDocumentChanges.delete(n[0]))}return t}getProvider(e){for(let t of this._changeData.values())if(me.languages.match(t.documentSelector,e)>0)return{send:n=>this.callback(n)}}updateSyncKind(e){if(this._syncKind!==ee.TextDocumentSyncKind.Full)switch(e){case ee.TextDocumentSyncKind.Full:this._syncKind=e;break;case ee.TextDocumentSyncKind.Incremental:this._syncKind===ee.TextDocumentSyncKind.None&&(this._syncKind=ee.TextDocumentSyncKind.Incremental);break}}};ve.DidChangeTextDocumentFeature=So;var Do=class extends ce.TextDocumentEventFeature{constructor(e){super(e,me.workspace.onWillSaveTextDocument,ee.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,n)=>ce.TextDocumentEventFeature.textDocumentFilter(t,n.document))}get registrationType(){return ee.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSave&&this.register({id:xn.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}};ve.WillSaveFeature=Do;var Po=class extends ce.DynamicDocumentFeature{_listener;_selectors;constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return ee.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSaveWaitUntil&&this.register({id:xn.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=me.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(ce.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,n=i=>this._client.sendRequest(ee.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(i)).then(async s=>{let o=await this._client.protocol2CodeConverter.asTextEdits(s);return o===void 0?[]:o});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,n):n(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}};ve.WillSaveWaitUntilFeature=Po;var To=class extends ce.TextDocumentEventFeature{_includeText;constructor(e){super(e,me.workspace.onDidSaveTextDocument,ee.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,ce.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return ee.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,ce.ensure)((0,ce.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;if(t&&n&&n.save){let i=typeof n.save=="boolean"?{includeText:!1}:{includeText:!!n.save.includeText};this.register({id:xn.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},i)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}};ve.DidSaveTextDocumentFeature=To;var wp="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Cp(r=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let t of wp)r.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}var bp=Cp(),Ro=class r{_extTextDocument;_capturedTextDocument;_content;_uri;_fileName;_languageId;_version;_eol;_isUntitled;_encoding;_isDirty;_isClosed;constructor(e){this._extTextDocument=e,this._content=e.getText(),this._uri=e.uri,this._fileName=e.fileName,this._languageId=e.languageId,this._version=e.version,this._eol=e.eol,this._isUntitled=e.isUntitled,this._encoding=e.encoding,this._isDirty=e.isDirty,this._isClosed=e.isClosed,this._capturedTextDocument=_p.TextDocument.create(this._uri.toString(),this._languageId,this._version,this._content)}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}get eol(){return this._eol}get isUntitled(){return this._isUntitled}get encoding(){return this._encoding}get fileName(){return this._fileName}get isDirty(){return this._isDirty}get isClosed(){return this._isClosed}save(){return this.version===this._extTextDocument.version?this._extTextDocument.save():Promise.resolve(!1)}get lineCount(){return this._capturedTextDocument.lineCount}offsetAt(e){return this._capturedTextDocument.offsetAt(e)}positionAt(e){let t=this._capturedTextDocument.positionAt(e);return new me.Position(t.line,t.character)}getText(e){return this._capturedTextDocument.getText(e)}lineAt(e){let t=typeof e=="number"?e:this.validatePosition(e).line;if(t<0||t>=this.lineCount)throw new RangeError(`Illegal value for line: ${t}`);let n=this._capturedTextDocument.getLineRange(t),i=this._capturedTextDocument.getText(n),s=i.search(/\S/),o=new me.Range(n.start.line,n.start.character,n.end.line,n.end.character),a=t+1<this.lineCount?new me.Range(o.start.line,o.start.character,t+1,0):o;return{lineNumber:t,text:i,range:o,rangeIncludingLineBreak:a,firstNonWhitespaceCharacterIndex:s===-1?i.length:s,isEmptyOrWhitespace:s===-1}}getWordRangeAtPosition(e,t){let n=this.validatePosition(e).line,i=this.lineAt(n).text,s=r.getWordRegExp(t),o;for(s.lastIndex=0;(o=s.exec(i))!==null;)if(o.index<=e.character&&s.lastIndex>=e.character)return new me.Range(n,o.index,n,s.lastIndex)}validateRange(e){let t=this.validatePosition(e.start),n=this.validatePosition(e.end);return t===e.start&&n===e.end?e:new me.Range(t.line,t.character,n.line,n.character)}validatePosition(e){let t=Math.min(Math.max(e.line,0),this.lineCount-1),n=this._capturedTextDocument.getLineRange(t),i=Math.min(Math.max(e.character,0),n.end.character);return t===e.line&&i===e.character?e:new me.Position(t,i)}static getWordRegExp(e){let t=e??bp;if(t.flags.includes("g"))return t;let n=`${t.flags}g`;return new RegExp(t.source,n)}}});var Mu=M(st=>{"use strict";var Sp=st&&st.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Dp=st&&st.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Pp=st&&st.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Sp(t,e,n[i]);return Dp(t,e),t}})();Object.defineProperty(st,"__esModule",{value:!0});st.CompletionItemFeature=void 0;var Tp=I("vscode"),H=N(),Oo=B(),Rp=Pp(ne()),Op=[H.CompletionItemKind.Text,H.CompletionItemKind.Method,H.CompletionItemKind.Function,H.CompletionItemKind.Constructor,H.CompletionItemKind.Field,H.CompletionItemKind.Variable,H.CompletionItemKind.Class,H.CompletionItemKind.Interface,H.CompletionItemKind.Module,H.CompletionItemKind.Property,H.CompletionItemKind.Unit,H.CompletionItemKind.Value,H.CompletionItemKind.Enum,H.CompletionItemKind.Keyword,H.CompletionItemKind.Snippet,H.CompletionItemKind.Color,H.CompletionItemKind.File,H.CompletionItemKind.Reference,H.CompletionItemKind.Folder,H.CompletionItemKind.EnumMember,H.CompletionItemKind.Constant,H.CompletionItemKind.Struct,H.CompletionItemKind.Event,H.CompletionItemKind.Operator,H.CompletionItemKind.TypeParameter],Fo=class extends Oo.TextDocumentLanguageFeature{labelDetailsSupport;constructor(e){super(e,H.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Oo.ensure)((0,Oo.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[H.MarkupKind.Markdown,H.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[H.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[H.InsertTextMode.asIs,H.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=H.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:Op},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"],applyKindSupport:!0}}initialize(e,t){let n=this.getRegistrationOptions(t,e.completionProvider);n&&this.register({id:Rp.generateUuid(),registerOptions:n})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);let n=e.triggerCharacters??[],i=e.allCommitCharacters,s=e.documentSelector,o={provideCompletionItems:(a,u,l,p)=>{let h=this._client,f=this._client.middleware,m=(g,v,_,T)=>h.sendRequest(H.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(g,v,_),T).then(C=>T.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(C,i,T),C=>h.handleFailedRequest(H.CompletionRequest.type,T,C,null));return f.provideCompletionItem?f.provideCompletionItem(a,u,p,l,m):m(a,u,p,l)},resolveCompletionItem:e.resolveProvider?(a,u)=>{let l=this._client,p=this._client.middleware,h=(f,m)=>l.sendRequest(H.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(f,!!this.labelDetailsSupport.get(t)),m).then(g=>m.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(g),g=>l.handleFailedRequest(H.CompletionResolveRequest.type,m,g,f));return p.resolveCompletionItem?p.resolveCompletionItem(a,u,h):h(a,u)}:void 0};return[Tp.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(s),o,...n),o]}};st.CompletionItemFeature=Fo});var ku=M(ot=>{"use strict";var Fp=ot&&ot.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),xp=ot&&ot.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Mp=ot&&ot.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Fp(t,e,n[i]);return xp(t,e),t}})();Object.defineProperty(ot,"__esModule",{value:!0});ot.HoverFeature=void 0;var kp=I("vscode"),ui=N(),xo=B(),Ep=Mp(ne()),Mo=class extends xo.TextDocumentLanguageFeature{constructor(e){super(e,ui.HoverRequest.type)}fillClientCapabilities(e){let t=(0,xo.ensure)((0,xo.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[ui.MarkupKind.Markdown,ui.MarkupKind.PlainText]}initialize(e,t){let n=this.getRegistrationOptions(t,e.hoverProvider);n&&this.register({id:Ep.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideHover:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(ui.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asHover(m),m=>a.handleFailedRequest(ui.HoverRequest.type,f,m,null)),l=a.middleware;return l.provideHover?l.provideHover(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return kp.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};ot.HoverFeature=Mo});var Eu=M(at=>{"use strict";var qp=at&&at.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Ip=at&&at.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ap=at&&at.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&qp(t,e,n[i]);return Ip(t,e),t}})();Object.defineProperty(at,"__esModule",{value:!0});at.DefinitionFeature=void 0;var jp=I("vscode"),ko=N(),Eo=B(),Lp=Ap(ne()),qo=class extends Eo.TextDocumentLanguageFeature{constructor(e){super(e,ko.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,Eo.ensure)((0,Eo.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.definitionProvider);n&&this.register({id:Lp.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDefinition:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(ko.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(m,f),m=>a.handleFailedRequest(ko.DefinitionRequest.type,f,m,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return jp.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};at.DefinitionFeature=qo});var Iu=M(ct=>{"use strict";var Np=ct&&ct.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Up=ct&&ct.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Kp=ct&&ct.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Np(t,e,n[i]);return Up(t,e),t}})();Object.defineProperty(ct,"__esModule",{value:!0});ct.SignatureHelpFeature=void 0;var qu=I("vscode"),li=N(),Io=B(),Hp=Kp(ne()),Ao=class extends Io.TextDocumentLanguageFeature{constructor(e){super(e,li.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,Io.ensure)((0,Io.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[li.MarkupKind.Markdown,li.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.signatureInformation.noActiveParameterSupport=!0,t.contextSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.signatureHelpProvider);n&&this.register({id:Hp.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t={provideSignatureHelp:(n,i,s,o)=>{let a=this._client,u=(p,h,f,m)=>a.sendRequest(li.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(p,h,f),m).then(g=>m.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(g,m),g=>a.handleFailedRequest(li.SignatureHelpRequest.type,m,g,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(n,i,o,s,u):u(n,i,o,s)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){let n=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){let i=e.triggerCharacters||[];return qu.languages.registerSignatureHelpProvider(n,t,...i)}else{let i={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return qu.languages.registerSignatureHelpProvider(n,t,i)}}};ct.SignatureHelpFeature=Ao});var Au=M(ut=>{"use strict";var Wp=ut&&ut.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),$p=ut&&ut.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Bp=ut&&ut.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Wp(t,e,n[i]);return $p(t,e),t}})();Object.defineProperty(ut,"__esModule",{value:!0});ut.DocumentHighlightFeature=void 0;var zp=I("vscode"),jo=N(),Lo=B(),Vp=Bp(ne()),No=class extends Lo.TextDocumentLanguageFeature{constructor(e){super(e,jo.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,Lo.ensure)((0,Lo.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentHighlightProvider);n&&this.register({id:Vp.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentHighlights:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(jo.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(m,f),m=>a.handleFailedRequest(jo.DocumentHighlightRequest.type,f,m,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(i,s,o,u):u(i,s,o)}};return[zp.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};ut.DocumentHighlightFeature=No});var Ho=M(Pe=>{"use strict";var Gp=Pe&&Pe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Jp=Pe&&Pe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Yp=Pe&&Pe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Gp(t,e,n[i]);return Jp(t,e),t}})();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.DocumentSymbolFeature=Pe.SupportedSymbolTags=Pe.SupportedSymbolKinds=void 0;var Qp=I("vscode"),J=N(),Uo=B(),Zp=Yp(ne());Pe.SupportedSymbolKinds=[J.SymbolKind.File,J.SymbolKind.Module,J.SymbolKind.Namespace,J.SymbolKind.Package,J.SymbolKind.Class,J.SymbolKind.Method,J.SymbolKind.Property,J.SymbolKind.Field,J.SymbolKind.Constructor,J.SymbolKind.Enum,J.SymbolKind.Interface,J.SymbolKind.Function,J.SymbolKind.Variable,J.SymbolKind.Constant,J.SymbolKind.String,J.SymbolKind.Number,J.SymbolKind.Boolean,J.SymbolKind.Array,J.SymbolKind.Object,J.SymbolKind.Key,J.SymbolKind.Null,J.SymbolKind.EnumMember,J.SymbolKind.Struct,J.SymbolKind.Event,J.SymbolKind.Operator,J.SymbolKind.TypeParameter];Pe.SupportedSymbolTags=[J.SymbolTag.Deprecated];var Ko=class extends Uo.TextDocumentLanguageFeature{constructor(e){super(e,J.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Uo.ensure)((0,Uo.ensure)(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:Pe.SupportedSymbolKinds},t.hierarchicalDocumentSymbolSupport=!0,t.tagSupport={valueSet:Pe.SupportedSymbolTags},t.labelSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentSymbolProvider);n&&this.register({id:Zp.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentSymbols:(s,o)=>{let a=this._client,u=async(p,h)=>{try{let f=await a.sendRequest(J.DocumentSymbolRequest.type,a.code2ProtocolConverter.asDocumentSymbolParams(p),h);if(h.isCancellationRequested||f===void 0||f===null)return null;if(f.length===0)return[];{let m=f[0];return J.DocumentSymbol.is(m)?await a.protocol2CodeConverter.asDocumentSymbols(f,h):await a.protocol2CodeConverter.asSymbolInformations(f,h)}}catch(f){return a.handleFailedRequest(J.DocumentSymbolRequest.type,h,f,null)}},l=a.middleware;return l.provideDocumentSymbols?l.provideDocumentSymbols(s,o,u):u(s,o)}},i=e.label!==void 0?{label:e.label}:void 0;return[Qp.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,i),n]}};Pe.DocumentSymbolFeature=Ko});var Lu=M(lt=>{"use strict";var Xp=lt&&lt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),eg=lt&&lt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),tg=lt&&lt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Xp(t,e,n[i]);return eg(t,e),t}})();Object.defineProperty(lt,"__esModule",{value:!0});lt.WorkspaceSymbolFeature=void 0;var ng=I("vscode"),di=N(),Wo=B(),ju=Ho(),ig=tg(ne()),$o=class extends Wo.WorkspaceFeature{constructor(e){super(e,di.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,Wo.ensure)((0,Wo.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:ju.SupportedSymbolKinds},t.tagSupport={valueSet:ju.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:ig.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let t={provideWorkspaceSymbols:(n,i)=>{let s=this._client,o=(u,l)=>s.sendRequest(di.WorkspaceSymbolRequest.type,{query:u},l).then(p=>l.isCancellationRequested?null:s.protocol2CodeConverter.asSymbolInformations(p,l),p=>s.handleFailedRequest(di.WorkspaceSymbolRequest.type,l,p,null)),a=s.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(n,i,o):o(n,i)},resolveWorkspaceSymbol:e.resolveProvider===!0?(n,i)=>{let s=this._client,o=(u,l)=>s.sendRequest(di.WorkspaceSymbolResolveRequest.type,s.code2ProtocolConverter.asWorkspaceSymbol(u),l).then(p=>l.isCancellationRequested?null:s.protocol2CodeConverter.asSymbolInformation(p),p=>s.handleFailedRequest(di.WorkspaceSymbolResolveRequest.type,l,p,null)),a=s.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(n,i,o):o(n,i)}:void 0};return[ng.languages.registerWorkspaceSymbolProvider(t),t]}};lt.WorkspaceSymbolFeature=$o});var Nu=M(dt=>{"use strict";var rg=dt&&dt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),sg=dt&&dt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),og=dt&&dt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&rg(t,e,n[i]);return sg(t,e),t}})();Object.defineProperty(dt,"__esModule",{value:!0});dt.ReferencesFeature=void 0;var ag=I("vscode"),Bo=N(),zo=B(),cg=og(ne()),Vo=class extends zo.TextDocumentLanguageFeature{constructor(e){super(e,Bo.ReferencesRequest.type)}fillClientCapabilities(e){(0,zo.ensure)((0,zo.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.referencesProvider);n&&this.register({id:cg.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideReferences:(i,s,o,a)=>{let u=this._client,l=(h,f,m,g)=>u.sendRequest(Bo.ReferencesRequest.type,u.code2ProtocolConverter.asReferenceParams(h,f,m),g).then(v=>g.isCancellationRequested?null:u.protocol2CodeConverter.asReferences(v,g),v=>u.handleFailedRequest(Bo.ReferencesRequest.type,g,v,null)),p=u.middleware;return p.provideReferences?p.provideReferences(i,s,o,a,l):l(i,s,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return ag.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};dt.ReferencesFeature=Vo});var Uu=M(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.TypeDefinitionFeature=void 0;var ug=I("vscode"),Go=N(),fi=B(),Jo=class extends fi.TextDocumentLanguageFeature{constructor(e){super(e,Go.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,fi.ensure)((0,fi.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,fi.ensure)((0,fi.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.typeDefinitionProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideTypeDefinition:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(Go.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(m,f),m=>a.handleFailedRequest(Go.TypeDefinitionRequest.type,f,m,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return ug.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};vr.TypeDefinitionFeature=Jo});var Ku=M(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.ImplementationFeature=void 0;var lg=I("vscode"),Yo=N(),Qo=B(),Zo=class extends Qo.TextDocumentLanguageFeature{constructor(e){super(e,Yo.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Qo.ensure)((0,Qo.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.implementationProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideImplementation:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(Yo.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(m,f),m=>a.handleFailedRequest(Yo.ImplementationRequest.type,f,m,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return lg.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};yr.ImplementationFeature=Zo});var Hu=M(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ColorProviderFeature=void 0;var dg=I("vscode"),hi=N(),Xo=B(),ea=class extends Xo.TextDocumentLanguageFeature{constructor(e){super(e,hi.DocumentColorRequest.type)}fillClientCapabilities(e){(0,Xo.ensure)((0,Xo.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.colorProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideColorPresentations:(i,s,o)=>{let a=this._client,u=(p,h,f)=>{let m={color:p,textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h.document),range:a.code2ProtocolConverter.asRange(h.range)};return a.sendRequest(hi.ColorPresentationRequest.type,m,f).then(g=>f.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(g,f),g=>a.handleFailedRequest(hi.ColorPresentationRequest.type,f,g,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(i,s,o,u):u(i,s,o)},provideDocumentColors:(i,s)=>{let o=this._client,a=(l,p)=>{let h={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(l)};return o.sendRequest(hi.DocumentColorRequest.type,h,p).then(f=>p.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(f,p),f=>o.handleFailedRequest(hi.DocumentColorRequest.type,p,f,null))},u=o.middleware;return u.provideDocumentColors?u.provideDocumentColors(i,s,a):a(i,s)}};return[dg.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};_r.ColorProviderFeature=ea});var Wu=M(ft=>{"use strict";var fg=ft&&ft.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),hg=ft&&ft.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),pg=ft&&ft.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&fg(t,e,n[i]);return hg(t,e),t}})();Object.defineProperty(ft,"__esModule",{value:!0});ft.CodeActionFeature=void 0;var gg=I("vscode"),Te=N(),mg=pg(ne()),ta=B(),na=class extends ta.TextDocumentLanguageFeature{constructor(e){super(e,Te.CodeActionRequest.type)}fillClientCapabilities(e){let t=(0,ta.ensure)((0,ta.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit","command"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Te.CodeActionKind.Empty,Te.CodeActionKind.QuickFix,Te.CodeActionKind.Refactor,Te.CodeActionKind.RefactorExtract,Te.CodeActionKind.RefactorInline,Te.CodeActionKind.RefactorMove,Te.CodeActionKind.RefactorRewrite,Te.CodeActionKind.Source,Te.CodeActionKind.SourceOrganizeImports,Te.CodeActionKind.Notebook]}},t.honorsChangeAnnotations=!0,t.documentationSupport=!0,t.tagSupport={valueSet:[Te.CodeActionTag.LLMGenerated]}}initialize(e,t){let n=this.getRegistrationOptions(t,e.codeActionProvider);n&&this.register({id:mg.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideCodeActions:(i,s,o,a)=>{let u=this._client,l=async(h,f,m,g)=>{let v={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h),range:u.code2ProtocolConverter.asRange(f),context:u.code2ProtocolConverter.asCodeActionContextSync(m)};return u.sendRequest(Te.CodeActionRequest.type,v,g).then(_=>g.isCancellationRequested||_===null||_===void 0?null:u.protocol2CodeConverter.asCodeActionResult(_,g),_=>u.handleFailedRequest(Te.CodeActionRequest.type,g,_,null))},p=u.middleware;return p.provideCodeActions?p.provideCodeActions(i,s,o,a,l):l(i,s,o,a)},resolveCodeAction:e.resolveProvider?(i,s)=>{let o=this._client,a=this._client.middleware,u=async(l,p)=>o.sendRequest(Te.CodeActionResolveRequest.type,o.code2ProtocolConverter.asCodeActionSync(l),p).then(h=>p.isCancellationRequested?l:o.protocol2CodeConverter.asCodeAction(h,p),h=>o.handleFailedRequest(Te.CodeActionResolveRequest.type,p,h,l));return a.resolveCodeAction?a.resolveCodeAction(i,s,u):u(i,s)}:void 0};return[gg.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,this.getMetadata(e)),n]}getMetadata(e){if(!(e.codeActionKinds===void 0&&e.documentation===void 0))return{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds),documentation:this._client.protocol2CodeConverter.asCodeActionDocumentations(e.documentation)}}};ft.CodeActionFeature=na});var Bu=M(ht=>{"use strict";var vg=ht&&ht.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),yg=ht&&ht.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),_g=ht&&ht.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&vg(t,e,n[i]);return yg(t,e),t}})();Object.defineProperty(ht,"__esModule",{value:!0});ht.CodeLensFeature=void 0;var $u=I("vscode"),Mn=N(),wg=_g(ne()),pi=B(),ia=class extends pi.TextDocumentLanguageFeature{constructor(e){super(e,Mn.CodeLensRequest.type)}fillClientCapabilities(e){let t=(0,pi.ensure)((0,pi.ensure)(e,"textDocument"),"codeLens");t.dynamicRegistration=!0,t.resolveSupport={properties:["command"]},(0,pi.ensure)((0,pi.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Mn.CodeLensRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeCodeLensEmitter.fire()});let i=this.getRegistrationOptions(t,e.codeLensProvider);i&&this.register({id:wg.generateUuid(),registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new $u.EventEmitter,i={onDidChangeCodeLenses:n.event,provideCodeLenses:(s,o)=>{let a=this._client,u=(p,h)=>a.sendRequest(Mn.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(p),h).then(f=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(f,h),f=>a.handleFailedRequest(Mn.CodeLensRequest.type,h,f,null)),l=a.middleware;return l.provideCodeLenses?l.provideCodeLenses(s,o,u):u(s,o)},resolveCodeLens:e.resolveProvider?(s,o)=>{let a=this._client,u=(p,h)=>a.sendRequest(Mn.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(p),h).then(f=>h.isCancellationRequested?p:a.protocol2CodeConverter.asCodeLens(f),f=>a.handleFailedRequest(Mn.CodeLensResolveRequest.type,h,f,p)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(s,o,u):u(s,o)}:void 0};return[$u.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),{provider:i,onDidChangeCodeLensEmitter:n}]}};ht.CodeLensFeature=ia});var zu=M(qe=>{"use strict";var Cg=qe&&qe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),bg=qe&&qe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Sg=qe&&qe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Cg(t,e,n[i]);return bg(t,e),t}})();Object.defineProperty(qe,"__esModule",{value:!0});qe.DocumentOnTypeFormattingFeature=qe.DocumentRangeFormattingFeature=qe.DocumentFormattingFeature=void 0;var wr=I("vscode"),Ze=N(),aa=Sg(ne()),jt=B(),kn;(function(r){function e(t){let n=wr.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:n.get("trimTrailingWhitespace"),trimFinalNewlines:n.get("trimFinalNewlines"),insertFinalNewline:n.get("insertFinalNewline")}}r.fromConfiguration=e})(kn||(kn={}));var ra=class extends jt.TextDocumentLanguageFeature{constructor(e){super(e,Ze.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,jt.ensure)((0,jt.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentFormattingProvider);n&&this.register({id:aa.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentFormattingEdits:(i,s,o)=>{let a=this._client,u=(p,h,f)=>{let m={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(p),options:a.code2ProtocolConverter.asFormattingOptions(h,kn.fromConfiguration(p))};return a.sendRequest(Ze.DocumentFormattingRequest.type,m,f).then(g=>f.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(g,f),g=>a.handleFailedRequest(Ze.DocumentFormattingRequest.type,f,g,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(i,s,o,u):u(i,s,o)}};return[wr.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};qe.DocumentFormattingFeature=ra;var sa=class extends jt.TextDocumentLanguageFeature{constructor(e){super(e,Ze.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){let t=(0,jt.ensure)((0,jt.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);n&&this.register({id:aa.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentRangeFormattingEdits:(i,s,o,a)=>{let u=this._client,l=(h,f,m,g)=>{let v={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h),range:u.code2ProtocolConverter.asRange(f),options:u.code2ProtocolConverter.asFormattingOptions(m,kn.fromConfiguration(h))};return u.sendRequest(Ze.DocumentRangeFormattingRequest.type,v,g).then(_=>g.isCancellationRequested?null:u.protocol2CodeConverter.asTextEdits(_,g),_=>u.handleFailedRequest(Ze.DocumentRangeFormattingRequest.type,g,_,null))},p=u.middleware;return p.provideDocumentRangeFormattingEdits?p.provideDocumentRangeFormattingEdits(i,s,o,a,l):l(i,s,o,a)}};return e.rangesSupport&&(n.provideDocumentRangesFormattingEdits=(i,s,o,a)=>{let u=this._client,l=(h,f,m,g)=>{let v={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h),ranges:u.code2ProtocolConverter.asRanges(f),options:u.code2ProtocolConverter.asFormattingOptions(m,kn.fromConfiguration(h))};return u.sendRequest(Ze.DocumentRangesFormattingRequest.type,v,g).then(_=>g.isCancellationRequested?null:u.protocol2CodeConverter.asTextEdits(_,g),_=>u.handleFailedRequest(Ze.DocumentRangesFormattingRequest.type,g,_,null))},p=u.middleware;return p.provideDocumentRangesFormattingEdits?p.provideDocumentRangesFormattingEdits(i,s,o,a,l):l(i,s,o,a)}),[wr.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};qe.DocumentRangeFormattingFeature=sa;var oa=class extends jt.TextDocumentLanguageFeature{constructor(e){super(e,Ze.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,jt.ensure)((0,jt.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);n&&this.register({id:aa.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideOnTypeFormattingEdits:(s,o,a,u,l)=>{let p=this._client,h=(m,g,v,_,T)=>{let C={textDocument:p.code2ProtocolConverter.asTextDocumentIdentifier(m),position:p.code2ProtocolConverter.asPosition(g),ch:v,options:p.code2ProtocolConverter.asFormattingOptions(_,kn.fromConfiguration(m))};return p.sendRequest(Ze.DocumentOnTypeFormattingRequest.type,C,T).then(D=>T.isCancellationRequested?null:p.protocol2CodeConverter.asTextEdits(D,T),D=>p.handleFailedRequest(Ze.DocumentOnTypeFormattingRequest.type,T,D,null))},f=p.middleware;return f.provideOnTypeFormattingEdits?f.provideOnTypeFormattingEdits(s,o,a,u,l,h):h(s,o,a,u,l)}},i=e.moreTriggerCharacter||[];return[wr.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,e.firstTriggerCharacter,...i),n]}};qe.DocumentOnTypeFormattingFeature=oa});var Ju=M(pt=>{"use strict";var Dg=pt&&pt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Pg=pt&&pt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Gu=pt&&pt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Dg(t,e,n[i]);return Pg(t,e),t}})();Object.defineProperty(pt,"__esModule",{value:!0});pt.RenameFeature=void 0;var Tg=I("vscode"),dn=N(),Rg=Gu(ne()),Vu=Gu(He()),ca=B(),ua=class extends ca.TextDocumentLanguageFeature{constructor(e){super(e,dn.RenameRequest.type)}fillClientCapabilities(e){let t=(0,ca.ensure)((0,ca.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=dn.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.renameProvider);n&&(Vu.boolean(e.renameProvider)&&(n.prepareProvider=!1),this.register({id:Rg.generateUuid(),registerOptions:n}))}registerLanguageProvider(e){let t=e.documentSelector,n={provideRenameEdits:(i,s,o,a)=>{let u=this._client,l=async(h,f,m,g)=>{let v={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h),position:u.code2ProtocolConverter.asPosition(f),newName:m},_=null;try{_=await u.sendRequest(dn.RenameRequest.type,v,g)}catch(C){return u.handleFailedRequest(dn.RenameRequest.type,g,C,null,!1)}if(g.isCancellationRequested||_===null)return null;let T=await u.protocol2CodeConverter.asWorkspaceEdit(_,g);if(g.isCancellationRequested)return null;if(!u.validateWorkspaceEdit(_))throw new Error("The rename edit returned from the server is not valid anymore and cannot be applied.");return T},p=u.middleware;return p.provideRenameEdits?p.provideRenameEdits(i,s,o,a,l):l(i,s,o,a)},prepareRename:e.prepareProvider?(i,s,o)=>{let a=this._client,u=(p,h,f)=>{let m={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(p),position:a.code2ProtocolConverter.asPosition(h)};return a.sendRequest(dn.PrepareRenameRequest.type,m,f).then(g=>f.isCancellationRequested?null:dn.Range.is(g)?a.protocol2CodeConverter.asRange(g):this.isDefaultBehavior(g)?g.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):g&&dn.Range.is(g.range)?{range:a.protocol2CodeConverter.asRange(g.range),placeholder:g.placeholder}:Promise.reject(new Error("The element can't be renamed.")),g=>{throw typeof g.message=="string"?new Error(g.message):new Error("The element can't be renamed.")})},l=a.middleware;return l.prepareRename?l.prepareRename(i,s,o,u):u(i,s,o)}:void 0};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Tg.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){let t=e;return t&&Vu.boolean(t.defaultBehavior)}};pt.RenameFeature=ua});var Yu=M(gt=>{"use strict";var Og=gt&&gt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Fg=gt&&gt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),xg=gt&&gt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Og(t,e,n[i]);return Fg(t,e),t}})();Object.defineProperty(gt,"__esModule",{value:!0});gt.DocumentLinkFeature=void 0;var Mg=I("vscode"),gi=N(),la=B(),kg=xg(ne()),da=class extends la.TextDocumentLanguageFeature{constructor(e){super(e,gi.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=(0,la.ensure)((0,la.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentLinkProvider);n&&this.register({id:kg.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentLinks:(i,s)=>{let o=this._client,a=(l,p)=>o.sendRequest(gi.DocumentLinkRequest.type,o.code2ProtocolConverter.asDocumentLinkParams(l),p).then(h=>p.isCancellationRequested?null:o.protocol2CodeConverter.asDocumentLinks(h,p),h=>o.handleFailedRequest(gi.DocumentLinkRequest.type,p,h,null)),u=o.middleware;return u.provideDocumentLinks?u.provideDocumentLinks(i,s,a):a(i,s)},resolveDocumentLink:e.resolveProvider?(i,s)=>{let o=this._client,a=(l,p)=>o.sendRequest(gi.DocumentLinkResolveRequest.type,o.code2ProtocolConverter.asDocumentLink(l),p).then(h=>p.isCancellationRequested?l:o.protocol2CodeConverter.asDocumentLink(h),h=>o.handleFailedRequest(gi.DocumentLinkResolveRequest.type,p,h,l)),u=o.middleware;return u.resolveDocumentLink?u.resolveDocumentLink(i,s,a):a(i,s)}:void 0};return[Mg.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};gt.DocumentLinkFeature=da});var Zu=M(mt=>{"use strict";var Eg=mt&&mt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),qg=mt&&mt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ig=mt&&mt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Eg(t,e,n[i]);return qg(t,e),t}})();Object.defineProperty(mt,"__esModule",{value:!0});mt.ExecuteCommandFeature=void 0;var Ag=I("vscode"),fa=N(),jg=Ig(ne()),Qu=B(),ha=class{_client;_commands;constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return fa.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Qu.ensure)((0,Qu.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:jg.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){let t=this._client,n=t.middleware,i=(s,o)=>{let a={command:s,arguments:o};return t.sendRequest(fa.ExecuteCommandRequest.type,a).then(void 0,u=>t.handleFailedRequest(fa.ExecuteCommandRequest.type,void 0,u,void 0))};if(e.registerOptions.commands){let s=[];for(let o of e.registerOptions.commands)s.push(Ag.commands.registerCommand(o,(...a)=>n.executeCommand?n.executeCommand(o,a,i):i(o,a)));this._commands.set(e.id,s)}}unregister(e){let t=this._commands.get(e);t&&(this._commands.delete(e),t.forEach(n=>n.dispose()))}clear(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}};mt.ExecuteCommandFeature=ha});var el=M(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.FoldingRangeFeature=void 0;var Xu=I("vscode"),fn=N(),mi=B(),pa=class extends mi.TextDocumentLanguageFeature{constructor(e){super(e,fn.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,mi.ensure)((0,mi.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[fn.FoldingRangeKind.Comment,fn.FoldingRangeKind.Imports,fn.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,mi.ensure)((0,mi.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(fn.FoldingRangeRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeFoldingRange.fire()});let[n,i]=this.getRegistration(t,e.foldingRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new Xu.EventEmitter,i={onDidChangeFoldingRanges:n.event,provideFoldingRanges:(s,o,a)=>{let u=this._client,l=(h,f,m)=>{let g={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h)};return u.sendRequest(fn.FoldingRangeRequest.type,g,m).then(v=>m.isCancellationRequested?null:u.protocol2CodeConverter.asFoldingRanges(v,m),v=>u.handleFailedRequest(fn.FoldingRangeRequest.type,m,v,null))},p=u.middleware;return p.provideFoldingRanges?p.provideFoldingRanges(s,o,a,l):l(s,o,a)}};return[Xu.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),{provider:i,onDidChangeFoldingRange:n}]}};Cr.FoldingRangeFeature=pa});var tl=M(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.DeclarationFeature=void 0;var Lg=I("vscode"),ga=N(),ma=B(),va=class extends ma.TextDocumentLanguageFeature{constructor(e){super(e,ga.DeclarationRequest.type)}fillClientCapabilities(e){let t=(0,ma.ensure)((0,ma.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.declarationProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDeclaration:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(ga.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(m,f),m=>a.handleFailedRequest(ga.DeclarationRequest.type,f,m,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Lg.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};br.DeclarationFeature=va});var nl=M(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.SelectionRangeFeature=void 0;var Ng=I("vscode"),ya=N(),_a=B(),wa=class extends _a.TextDocumentLanguageFeature{constructor(e){super(e,ya.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=(0,_a.ensure)((0,_a.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.selectionRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideSelectionRanges:(i,s,o)=>{let a=this._client,u=async(p,h,f)=>{let m={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(p),positions:a.code2ProtocolConverter.asPositionsSync(h,f)};return a.sendRequest(ya.SelectionRangeRequest.type,m,f).then(g=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(g,f),g=>a.handleFailedRequest(ya.SelectionRangeRequest.type,f,g,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Ng.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Sr.SelectionRangeFeature=wa});var il=M(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.CallHierarchyFeature=void 0;var Ug=I("vscode"),hn=N(),Ca=B(),ba=class{client;middleware;constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,n){let i=this.client,s=this.middleware,o=(a,u,l)=>{let p=i.code2ProtocolConverter.asTextDocumentPositionParams(a,u);return i.sendRequest(hn.CallHierarchyPrepareRequest.type,p,l).then(h=>l.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>i.handleFailedRequest(hn.CallHierarchyPrepareRequest.type,l,h,null))};return s.prepareCallHierarchy?s.prepareCallHierarchy(e,t,n,o):o(e,t,n)}provideCallHierarchyIncomingCalls(e,t){let n=this.client,i=this.middleware,s=(o,a)=>{let u={item:n.code2ProtocolConverter.asCallHierarchyItem(o)};return n.sendRequest(hn.CallHierarchyIncomingCallsRequest.type,u,a).then(l=>a.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>n.handleFailedRequest(hn.CallHierarchyIncomingCallsRequest.type,a,l,null))};return i.provideCallHierarchyIncomingCalls?i.provideCallHierarchyIncomingCalls(e,t,s):s(e,t)}provideCallHierarchyOutgoingCalls(e,t){let n=this.client,i=this.middleware,s=(o,a)=>{let u={item:n.code2ProtocolConverter.asCallHierarchyItem(o)};return n.sendRequest(hn.CallHierarchyOutgoingCallsRequest.type,u,a).then(l=>a.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>n.handleFailedRequest(hn.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return i.provideCallHierarchyOutgoingCalls?i.provideCallHierarchyOutgoingCalls(e,t,s):s(e,t)}},Sa=class extends Ca.TextDocumentLanguageFeature{constructor(e){super(e,hn.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=e,n=(0,Ca.ensure)((0,Ca.ensure)(t,"textDocument"),"callHierarchy");n.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.callHierarchyProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=this._client,n=new ba(t);return[Ug.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};Dr.CallHierarchyFeature=Sa});var sl=M(vt=>{"use strict";var Kg=vt&&vt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Hg=vt&&vt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),rl=vt&&vt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Kg(t,e,n[i]);return Hg(t,e),t}})();Object.defineProperty(vt,"__esModule",{value:!0});vt.SemanticTokensFeature=void 0;var Pr=rl(I("vscode")),U=N(),vi=B(),Wg=rl(He()),Da=class extends vi.TextDocumentLanguageFeature{constructor(e){super(e,U.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){let t=(0,vi.ensure)((0,vi.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[U.SemanticTokenTypes.namespace,U.SemanticTokenTypes.type,U.SemanticTokenTypes.class,U.SemanticTokenTypes.enum,U.SemanticTokenTypes.interface,U.SemanticTokenTypes.struct,U.SemanticTokenTypes.typeParameter,U.SemanticTokenTypes.parameter,U.SemanticTokenTypes.variable,U.SemanticTokenTypes.property,U.SemanticTokenTypes.enumMember,U.SemanticTokenTypes.event,U.SemanticTokenTypes.function,U.SemanticTokenTypes.method,U.SemanticTokenTypes.macro,U.SemanticTokenTypes.keyword,U.SemanticTokenTypes.comment,U.SemanticTokenTypes.string,U.SemanticTokenTypes.number,U.SemanticTokenTypes.regexp,U.SemanticTokenTypes.operator,U.SemanticTokenTypes.decorator,U.SemanticTokenTypes.label],t.tokenModifiers=[U.SemanticTokenModifiers.declaration,U.SemanticTokenModifiers.definition,U.SemanticTokenModifiers.readonly,U.SemanticTokenModifiers.static,U.SemanticTokenModifiers.deprecated,U.SemanticTokenModifiers.abstract,U.SemanticTokenModifiers.async,U.SemanticTokenModifiers.modification,U.SemanticTokenModifiers.documentation,U.SemanticTokenModifiers.defaultLibrary],t.formats=[U.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,vi.ensure)((0,vi.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(U.SemanticTokensRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeSemanticTokensEmitter.fire()});let[i,s]=this.getRegistration(t,e.semanticTokensProvider);!i||!s||this.register({id:i,registerOptions:s})}registerLanguageProvider(e){let t=e.documentSelector,n=Wg.boolean(e.full)?e.full:e.full!==void 0,i=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,s=new Pr.EventEmitter,o=n?{onDidChangeSemanticTokens:s.event,provideDocumentSemanticTokens:(m,g)=>{let v=this._client,_=v.middleware,T=(C,D)=>{let F={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(C)};return v.sendRequest(U.SemanticTokensRequest.type,F,D).then(E=>D.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(E,D),E=>v.handleFailedRequest(U.SemanticTokensRequest.type,D,E,null))};return _.provideDocumentSemanticTokens?_.provideDocumentSemanticTokens(m,g,T):T(m,g)},provideDocumentSemanticTokensEdits:i?(m,g,v)=>{let _=this._client,T=_.middleware,C=(D,F,E)=>{let Q={textDocument:_.code2ProtocolConverter.asTextDocumentIdentifier(D),previousResultId:F};return _.sendRequest(U.SemanticTokensDeltaRequest.type,Q,E).then(async we=>E.isCancellationRequested?null:U.SemanticTokens.is(we)?await _.protocol2CodeConverter.asSemanticTokens(we,E):await _.protocol2CodeConverter.asSemanticTokensEdits(we,E),we=>_.handleFailedRequest(U.SemanticTokensDeltaRequest.type,E,we,null))};return T.provideDocumentSemanticTokensEdits?T.provideDocumentSemanticTokensEdits(m,g,v,C):C(m,g,v)}:void 0}:void 0,u=e.range===!0?{onDidChangeSemanticTokens:s.event,provideDocumentRangeSemanticTokens:(m,g,v)=>{let _=this._client,T=_.middleware,C=(D,F,E)=>{let Q={textDocument:_.code2ProtocolConverter.asTextDocumentIdentifier(D),range:_.code2ProtocolConverter.asRange(F)};return _.sendRequest(U.SemanticTokensRangeRequest.type,Q,E).then(we=>E.isCancellationRequested?null:_.protocol2CodeConverter.asSemanticTokens(we,E),we=>_.handleFailedRequest(U.SemanticTokensRangeRequest.type,E,we,null))};return T.provideDocumentRangeSemanticTokens?T.provideDocumentRangeSemanticTokens(m,g,v,C):C(m,g,v)}}:void 0,l=[],p=this._client,h=p.protocol2CodeConverter.asSemanticTokensLegend(e.legend),f=p.protocol2CodeConverter.asDocumentSelector(t);return o!==void 0&&l.push(Pr.languages.registerDocumentSemanticTokensProvider(f,o,h)),u!==void 0&&l.push(Pr.languages.registerDocumentRangeSemanticTokensProvider(f,u,h)),[new Pr.Disposable(()=>l.forEach(m=>m.dispose())),{range:u,full:o,onDidChangeSemanticTokensEmitter:s}]}};vt.SemanticTokensFeature=Da});var al=M(yt=>{"use strict";var $g=yt&&yt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Bg=yt&&yt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),ol=yt&&yt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&$g(t,e,n[i]);return Bg(t,e),t}})();Object.defineProperty(yt,"__esModule",{value:!0});yt.LinkedEditingFeature=void 0;var zg=ol(I("vscode")),Pa=ol(N()),Ta=B(),Ra=class extends Ta.TextDocumentLanguageFeature{constructor(e){super(e,Pa.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){let t=(0,Ta.ensure)((0,Ta.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.linkedEditingRangeProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n={provideLinkedEditingRanges:(i,s,o)=>{let a=this._client,u=(p,h,f)=>a.sendRequest(Pa.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(p,h),f).then(m=>f.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(m,f),m=>a.handleFailedRequest(Pa.LinkedEditingRangeRequest.type,f,m,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(i,s,o,u):u(i,s,o)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return zg.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};yt.LinkedEditingFeature=Ra});var cl=M(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.TypeHierarchyFeature=void 0;var Vg=I("vscode"),pn=N(),Oa=B(),Fa=class{client;middleware;constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,n){let i=this.client,s=this.middleware,o=(a,u,l)=>{let p=i.code2ProtocolConverter.asTextDocumentPositionParams(a,u);return i.sendRequest(pn.TypeHierarchyPrepareRequest.type,p,l).then(h=>l.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>i.handleFailedRequest(pn.TypeHierarchyPrepareRequest.type,l,h,null))};return s.prepareTypeHierarchy?s.prepareTypeHierarchy(e,t,n,o):o(e,t,n)}provideTypeHierarchySupertypes(e,t){let n=this.client,i=this.middleware,s=(o,a)=>{let u={item:n.code2ProtocolConverter.asTypeHierarchyItem(o)};return n.sendRequest(pn.TypeHierarchySupertypesRequest.type,u,a).then(l=>a.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>n.handleFailedRequest(pn.TypeHierarchySupertypesRequest.type,a,l,null))};return i.provideTypeHierarchySupertypes?i.provideTypeHierarchySupertypes(e,t,s):s(e,t)}provideTypeHierarchySubtypes(e,t){let n=this.client,i=this.middleware,s=(o,a)=>{let u={item:n.code2ProtocolConverter.asTypeHierarchyItem(o)};return n.sendRequest(pn.TypeHierarchySubtypesRequest.type,u,a).then(l=>a.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>n.handleFailedRequest(pn.TypeHierarchySubtypesRequest.type,a,l,null))};return i.provideTypeHierarchySubtypes?i.provideTypeHierarchySubtypes(e,t,s):s(e,t)}},xa=class extends Oa.TextDocumentLanguageFeature{constructor(e){super(e,pn.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=(0,Oa.ensure)((0,Oa.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.typeHierarchyProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=this._client,n=new Fa(t);return[Vg.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};Tr.TypeHierarchyFeature=xa});var ll=M(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.InlineValueFeature=void 0;var ul=I("vscode"),Rr=N(),yi=B(),Ma=class extends yi.TextDocumentLanguageFeature{constructor(e){super(e,Rr.InlineValueRequest.type)}fillClientCapabilities(e){(0,yi.ensure)((0,yi.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,yi.ensure)((0,yi.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(Rr.InlineValueRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeInlineValues.fire()});let[n,i]=this.getRegistration(t,e.inlineValueProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new ul.EventEmitter,i={onDidChangeInlineValues:n.event,provideInlineValues:(s,o,a,u)=>{let l=this._client,p=(f,m,g,v)=>{let _={textDocument:l.code2ProtocolConverter.asTextDocumentIdentifier(f),range:l.code2ProtocolConverter.asRange(m),context:l.code2ProtocolConverter.asInlineValueContext(g)};return l.sendRequest(Rr.InlineValueRequest.type,_,v).then(T=>v.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(T,v),T=>l.handleFailedRequest(Rr.InlineValueRequest.type,v,T,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(s,o,a,u,p):p(s,o,a,u)}};return[this.registerProvider(t,i),{provider:i,onDidChangeInlineValues:n}]}registerProvider(e,t){return ul.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Or.InlineValueFeature=Ma});var fl=M(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.InlayHintsFeature=void 0;var dl=I("vscode"),En=N(),_i=B(),ka=class extends _i.TextDocumentLanguageFeature{constructor(e){super(e,En.InlayHintRequest.type)}fillClientCapabilities(e){let t=(0,_i.ensure)((0,_i.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,_i.ensure)((0,_i.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(En.InlayHintRefreshRequest.type,async()=>{for(let s of this.getAllProviders())s.onDidChangeInlayHints.fire()});let[n,i]=this.getRegistration(t,e.inlayHintProvider);!n||!i||this.register({id:n,registerOptions:i})}registerLanguageProvider(e){let t=e.documentSelector,n=new dl.EventEmitter,i={onDidChangeInlayHints:n.event,provideInlayHints:(s,o,a)=>{let u=this._client,l=async(h,f,m)=>{let g={textDocument:u.code2ProtocolConverter.asTextDocumentIdentifier(h),range:u.code2ProtocolConverter.asRange(f)};try{let v=await u.sendRequest(En.InlayHintRequest.type,g,m);return m.isCancellationRequested?null:u.protocol2CodeConverter.asInlayHints(v,m)}catch(v){return u.handleFailedRequest(En.InlayHintRequest.type,m,v,null)}},p=u.middleware;return p.provideInlayHints?p.provideInlayHints(s,o,a,l):l(s,o,a)}};return i.resolveInlayHint=e.resolveProvider===!0?(s,o)=>{let a=this._client,u=async(p,h)=>{try{let f=await a.sendRequest(En.InlayHintResolveRequest.type,a.code2ProtocolConverter.asInlayHint(p),h);if(h.isCancellationRequested)return null;let m=a.protocol2CodeConverter.asInlayHint(f,h);return h.isCancellationRequested?null:m}catch(f){return a.handleFailedRequest(En.InlayHintResolveRequest.type,h,f,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(s,o,u):u(s,o)}:void 0,[this.registerProvider(t,i),{provider:i,onDidChangeInlayHints:n}]}registerProvider(e,t){return dl.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Fr.InlayHintsFeature=ka});var hl=M(Xe=>{"use strict";var Gg=Xe&&Xe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Jg=Xe&&Xe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Yg=Xe&&Xe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Gg(t,e,n[i]);return Jg(t,e),t}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.WorkspaceFoldersFeature=void 0;Xe.arrayDiff=qa;var Qg=Yg(ne()),xr=I("vscode"),wi=N();function Ea(r,e){if(r!=null)return r[e]}function qa(r,e){return r.filter(t=>e.indexOf(t)<0)}var Ia=class{_client;_listeners;_initialFolders;constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return wi.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){let t=xr.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(n=>this.asProtocol(n))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(wi.WorkspaceFoldersRequest.type,s=>{let o=()=>{let u=xr.workspace.workspaceFolders;return u===void 0?null:u.map(p=>this.asProtocol(p))},a=t.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(s,o):o(s)});let n=Ea(Ea(Ea(e,"workspace"),"workspaceFolders"),"changeNotifications"),i;typeof n=="string"?i=n:n===!0&&(i=Qg.generateUuid()),i&&this.register({id:i,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){let n=qa(this._initialFolders,e),i=qa(e,this._initialFolders);(i.length>0||n.length>0)&&(t=this.doSendEvent(i,n))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(n=>{this._client.error(`Sending notification ${wi.DidChangeWorkspaceFoldersNotification.type.method} failed`,n)})}doSendEvent(e,t){let n={event:{added:e.map(i=>this.asProtocol(i)),removed:t.map(i=>this.asProtocol(i))}};return this._client.sendNotification(wi.DidChangeWorkspaceFoldersNotification.type,n)}register(e){let t=e.id,n=this._client,i=xr.workspace.onDidChangeWorkspaceFolders(s=>{let o=l=>this.doSendEvent(l.added,l.removed),a=n.middleware.workspace;(a&&a.didChangeWorkspaceFolders?a.didChangeWorkspaceFolders(s,o):o(s)).catch(l=>{this._client.error(`Sending notification ${wi.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,i),this.sendInitialEvent(xr.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}};Xe.WorkspaceFoldersFeature=Ia});var ml=M(ye=>{"use strict";var Zg=ye&&ye.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Xg=ye&&ye.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Er=ye&&ye.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Zg(t,e,n[i]);return Xg(t,e),t}})();Object.defineProperty(ye,"__esModule",{value:!0});ye.WillDeleteFilesFeature=ye.WillRenameFilesFeature=ye.WillCreateFilesFeature=ye.DidDeleteFilesFeature=ye.DidRenameFilesFeature=ye.DidCreateFilesFeature=void 0;var ze=Er(I("vscode")),em=Er(ao()),Lt=Er(N()),tm=Er(ne());function pl(r,e){return r[e]===void 0&&(r[e]={}),r[e]}function nm(r,e){return r[e]}function gl(r,e,t){r[e]=t}var Ci=class r{_client;_event;_registrationType;_clientCapability;_serverCapability;_listener;_filters;constructor(e,t,n,i,s){this._client=e,this._event=t,this._registrationType=n,this._clientCapability=i,this._serverCapability=s,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){let t=pl(pl(e,"workspace"),"fileOperations");gl(t,"dynamicRegistration",!0),gl(t,this._clientCapability,!0)}initialize(e){let t=e.workspace?.fileOperations,n=t!==void 0?nm(t,this._serverCapability):void 0;if(n?.filters!==void 0)try{this.register({id:tm.generateUuid(),registerOptions:{filters:n.filters}})}catch(i){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${i}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));let t=e.registerOptions.filters.map(n=>{let i=new em.Minimatch(n.pattern.glob,r.asMinimatchOptions(n.pattern.options));if(!i.makeRe())throw new Error(`Invalid pattern ${n.pattern.glob}!`);return{scheme:n.scheme,matcher:i,kind:n.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return r.getFileType(e)}async filter(e,t){let n=await Promise.all(e.files.map(async s=>{let o=t(s),a=o.fsPath.replace(/\\/g,"/");for(let u of this._filters.values())for(let l of u)if(!(l.scheme!==void 0&&l.scheme!==o.scheme)){if(l.matcher.match(a)){if(l.kind===void 0)return!0;let p=await this.getFileType(o);if(p===void 0)return this._client.info(`Unable to determine file type for ${o.toString()}. Treating as a match.`),!0;if(p===ze.FileType.File&&l.kind===Lt.FileOperationPatternKind.file||p===ze.FileType.Directory&&l.kind===Lt.FileOperationPatternKind.folder)return!0}else if(l.kind===Lt.FileOperationPatternKind.folder&&await r.getFileType(o)===ze.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),i=e.files.filter((s,o)=>n[o]);return{...e,files:i}}static async getFileType(e){try{return(await ze.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){let t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}},Mr=class extends Ci{_notificationType;_accessUri;_createParams;constructor(e,t,n,i,s,o,a){super(e,t,n,i,s),this._notificationType=n,this._accessUri=o,this._createParams=a}async send(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=async i=>this._client.sendNotification(this._notificationType,this._createParams(i));return this.doSend(t,n)}}},kr=class extends Mr{_willListener;_fsPathFileTypes=new Map;async getFileType(e){let t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);let n=await Ci.getFileType(e);return n&&this._fsPathFileTypes.set(t,n),n}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}},Aa=class extends Mr{constructor(e){super(e,ze.workspace.onDidCreateFiles,Lt.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.didCreateFiles?n.didCreateFiles(e,t):t(e)}};ye.DidCreateFilesFeature=Aa;var ja=class extends kr{constructor(e){super(e,ze.workspace.onDidRenameFiles,Lt.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=ze.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didRenameFiles?n.didRenameFiles(e,t):t(e)}};ye.DidRenameFilesFeature=ja;var La=class extends kr{constructor(e){super(e,ze.workspace.onDidDeleteFiles,Lt.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=ze.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didDeleteFiles?n.didDeleteFiles(e,t):t(e)}};ye.DidDeleteFilesFeature=La;var bi=class extends Ci{_requestType;_accessUri;_createParams;constructor(e,t,n,i,s,o,a){super(e,t,n,i,s),this._requestType=n,this._accessUri=o,this._createParams=a}async send(e){let t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=i=>this._client.sendRequest(this._requestType,this._createParams(i),i.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,n)}else return}},Na=class extends bi{constructor(e){super(e,ze.workspace.onWillCreateFiles,Lt.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willCreateFiles?n.willCreateFiles(e,t):t(e)}};ye.WillCreateFilesFeature=Na;var Ua=class extends bi{constructor(e){super(e,ze.workspace.onWillRenameFiles,Lt.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willRenameFiles?n.willRenameFiles(e,t):t(e)}};ye.WillRenameFilesFeature=Ua;var Ka=class extends bi{constructor(e){super(e,ze.workspace.onWillDeleteFiles,Lt.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willDeleteFiles?n.willDeleteFiles(e,t):t(e)}};ye.WillDeleteFilesFeature=Ka});var vl=M(_t=>{"use strict";var im=_t&&_t.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),rm=_t&&_t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),sm=_t&&_t.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&im(t,e,n[i]);return rm(t,e),t}})();Object.defineProperty(_t,"__esModule",{value:!0});_t.InlineCompletionItemFeature=void 0;var om=I("vscode"),Ha=N(),Wa=B(),am=sm(ne()),$a=class extends Wa.TextDocumentLanguageFeature{constructor(e){super(e,Ha.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,Wa.ensure)((0,Wa.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.inlineCompletionProvider);n&&this.register({id:am.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideInlineCompletionItems:(i,s,o,a)=>{let u=this._client,l=this._client.middleware,p=(h,f,m,g)=>u.sendRequest(Ha.InlineCompletionRequest.type,u.code2ProtocolConverter.asInlineCompletionParams(h,f,m),g).then(v=>g.isCancellationRequested?null:u.protocol2CodeConverter.asInlineCompletionResult(v,g),v=>u.handleFailedRequest(Ha.InlineCompletionRequest.type,g,v,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(i,s,o,a,p):p(i,s,o,a)}};return[om.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};_t.InlineCompletionItemFeature=$a});var wl=M(wt=>{"use strict";var cm=wt&&wt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),um=wt&&wt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),_l=wt&&wt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&cm(t,e,n[i]);return um(t,e),t}})();Object.defineProperty(wt,"__esModule",{value:!0});wt.TextDocumentContentFeature=void 0;var Ba=_l(I("vscode")),qn=N(),yl=B(),lm=_l(ne()),za=class{_client;_registrations=new Map;constructor(e){this._client=e}getState(){let e=this._registrations.size>0;return{kind:"workspace",id:qn.TextDocumentContentRequest.method,registrations:e}}get registrationType(){return qn.TextDocumentContentRequest.type}getProviders(){let e=[];for(let t of this._registrations.values())e.push(...t.providers);return e}fillClientCapabilities(e){let t=(0,yl.ensure)((0,yl.ensure)(e,"workspace"),"textDocumentContent");t.dynamicRegistration=!0}initialize(e){let t=this._client;if(t.onRequest(qn.TextDocumentContentRefreshRequest.type,async s=>{let o=t.protocol2CodeConverter.asUri(s.uri);for(let a of this._registrations.values())for(let u of a.providers)u.scheme===o.scheme&&u.onDidChangeEmitter.fire(o)}),!e?.workspace?.textDocumentContent)return;let n=e.workspace.textDocumentContent,i=qn.StaticRegistrationOptions.hasId(n)?n.id:lm.generateUuid();this.register({id:i,registerOptions:n})}register(e){let t=[],n=[];for(let i of e.registerOptions.schemes){let[s,o]=this.registerTextDocumentContentProvider(i);t.push(o),n.push(s)}this._registrations.set(e.id,{disposable:Ba.Disposable.from(...n),providers:t})}registerTextDocumentContentProvider(e){let t=new Ba.EventEmitter,n={onDidChange:t.event,provideTextDocumentContent:(i,s)=>{let o=this._client,a=(l,p)=>{let h={uri:o.code2ProtocolConverter.asUri(l)};return o.sendRequest(qn.TextDocumentContentRequest.type,h,p).then(f=>p.isCancellationRequested?null:f.text,f=>o.handleFailedRequest(qn.TextDocumentContentRequest.type,p,f,null))},u=o.middleware;return u.provideTextDocumentContent?u.provideTextDocumentContent(i,s,a):a(i,s)}};return[Ba.workspace.registerTextDocumentContentProvider(e,n),{scheme:e,onDidChangeEmitter:t,provider:n}]}unregister(e){let t=this._registrations.get(e);t!==void 0&&(this._registrations.delete(e),t.disposable.dispose())}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}};wt.TextDocumentContentFeature=za});var Cl=M(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.FileSystemWatcherFeature=void 0;var dm=I("vscode"),gn=N(),qr=B(),Va=class{_client;_notifyFileEvent;_watchers;constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return gn.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,qr.ensure)((0,qr.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,qr.ensure)((0,qr.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;let t=[];for(let n of e.registerOptions.watchers){let i=this._client.protocol2CodeConverter.asGlobPattern(n.globPattern);if(i===void 0)continue;let s=!0,o=!0,a=!0;n.kind!==void 0&&n.kind!==null&&(s=(n.kind&gn.WatchKind.Create)!==0,o=(n.kind&gn.WatchKind.Change)!==0,a=(n.kind&gn.WatchKind.Delete)!==0);let u=dm.workspace.createFileSystemWatcher(i,!s,!o,!a);this.hookListeners(u,s,o,a,t),t.push(u)}this._watchers.set(e.id,t)}registerRaw(e,t){let n=[];for(let i of t)this.hookListeners(i,!0,!0,!0,n);this._watchers.set(e,n)}hookListeners(e,t,n,i,s){t&&e.onDidCreate(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:gn.FileChangeType.Created}),null,s),n&&e.onDidChange(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:gn.FileChangeType.Changed}),null,s),i&&e.onDidDelete(o=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(o),type:gn.FileChangeType.Deleted}),null,s)}unregister(e){let t=this._watchers.get(e);if(t){this._watchers.delete(e);for(let n of t)n.dispose()}}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}};Ir.FileSystemWatcherFeature=Va});var Sl=M(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.ProgressFeature=void 0;var bl=N(),fm=Js();function hm(r,e){return r[e]===void 0&&(r[e]=Object.create(null)),r[e]}var Ga=class{_client;activeParts;constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:bl.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){hm(e,"window").workDoneProgress=!0}initialize(){let e=this._client,t=i=>{this.activeParts.delete(i)},n=i=>{this.activeParts.add(new fm.ProgressPart(this._client,i.token,t))};e.onRequest(bl.WorkDoneProgressCreateRequest.type,n)}clear(){for(let e of this.activeParts)e.done();this.activeParts.clear()}};Ar.ProgressFeature=Ga});var ic=M(Y=>{"use strict";var pm=Y&&Y.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),gm=Y&&Y.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nr=Y&&Y.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&pm(t,e,n[i]);return gm(t,e),t}})();Object.defineProperty(Y,"__esModule",{value:!0});Y.ProposedFeatures=Y.LanguageClient=Y.BaseLanguageClient=Y.ShutdownMode=Y.MessageTransports=Y.SuspendMode=Y.State=Y.CloseAction=Y.ErrorAction=Y.RevealOutputChannelOn=void 0;var j=I("vscode"),S=N(),mm=Nr(Wc()),vm=Nr(zc()),et=Nr(He()),jr=Qi(),Dl=Nr(ne()),ym=Js(),Le=B(),_m=mo(),Ya=Tu(),Pl=Fu(),In=xu(),wm=Mu(),Cm=ku(),bm=Eu(),Sm=Iu(),Dm=Au(),Pm=Ho(),Tm=Lu(),Rm=Nu(),Om=Uu(),Fm=Ku(),xm=Hu(),Mm=Wu(),km=Bu(),Ja=zu(),Em=Ju(),qm=Yu(),Im=Zu(),Am=el(),jm=tl(),Lm=nl(),Nm=il(),Um=sl(),Km=al(),Hm=cl(),Wm=ll(),$m=fl(),Bm=hl(),An=ml(),zm=vl(),Vm=wl(),Gm=Cl(),Jm=Sl(),mn;(function(r){r[r.Debug=0]="Debug",r[r.Info=1]="Info",r[r.Warn=2]="Warn",r[r.Error=3]="Error",r[r.Never=4]="Never"})(mn||(Y.RevealOutputChannelOn=mn={}));var Si;(function(r){r[r.Continue=1]="Continue",r[r.Shutdown=2]="Shutdown"})(Si||(Y.ErrorAction=Si={}));var Xt;(function(r){r[r.DoNotRestart=1]="DoNotRestart",r[r.Restart=2]="Restart"})(Xt||(Y.CloseAction=Xt={}));var jn;(function(r){r[r.Stopped=1]="Stopped",r[r.Starting=3]="Starting",r[r.StartFailed=4]="StartFailed",r[r.Running=2]="Running"})(jn||(Y.State=jn={}));var Tl;(function(r){r.off="off",r.on="on"})(Tl||(Y.SuspendMode=Tl={}));var Qa;(function(r){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&et.stringArray(t.enabledCommands)?t:!1}r.sanitizeIsTrusted=e})(Qa||(Qa={}));var Za=class{client;maxRestartCount;restarts;constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,n){return n&&n<=3?{action:Si.Continue}:{action:Si.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:Xt.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=180*1e3?{action:Xt.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:Xt.Restart})}},K;(function(r){r.Initial="initial",r.Starting="starting",r.StartFailed="startFailed",r.Running="running",r.Stopping="stopping",r.Stopped="stopped"})(K||(K={}));var Rl;(function(r){function e(t){return t&&S.MessageReader.is(t.reader)&&S.MessageWriter.is(t.writer)}r.is=e})(Rl||(Y.MessageTransports=Rl={}));var Zt;(function(r){r.Restart="restart",r.Stop="stop"})(Zt||(Y.ShutdownMode=Zt={}));var Xa=class r{open;_onOpen;_onClose;disposables;constructor(){this.disposables=[],this.open=new Set,this._onOpen=new j.EventEmitter,this._onClose=new j.EventEmitter,r.fillVisibleResources(this.open);let e=()=>{let t=this.open,n=new Set;r.fillVisibleResources(n);let i=new Set,s=new Set(n);for(let o of t.values())n.has(o)?s.delete(o):i.add(o);if(this.open=n,i.size>0){let o=new Set;for(let a of i)o.add(j.Uri.parse(a));this._onClose.fire(o)}if(s.size>0){let o=new Set;for(let a of s)o.add(j.Uri.parse(a));this._onOpen.fire(o)}};this.disposables.push(j.window.tabGroups.onDidChangeTabs(t=>{t.closed.length===0&&t.opened.length===0||e()})),this.disposables.push(j.window.onDidChangeVisibleTextEditors(t=>{e()}))}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposables.forEach(e=>e.dispose())}isActive(e){return e instanceof j.Uri?j.window.activeTextEditor?.document.uri===e:j.window.activeTextEditor?.document===e}isVisible(e){let t=e instanceof j.Uri?e:e.uri;return t.scheme===Ya.NotebookDocumentSyncFeature.CellScheme?j.workspace.notebookDocuments.some(n=>this.open.has(n.uri.toString())?n.getCells().find(s=>s.document.uri.toString()===t.toString())!==void 0:!1):this.open.has(t.toString())}getResources(){let e=new Set;return r.fillVisibleResources(new Set,e),e}static fillVisibleResources(e,t){let n=e??new Set;for(let i of j.window.tabGroups.all)for(let s of i.tabs){let o=s.input,a;o instanceof j.TabInputText?a=o.uri:o instanceof j.TabInputTextDiff?a=o.modified:(o instanceof j.TabInputCustom||o instanceof j.TabInputNotebook)&&(a=o.uri),a!==void 0&&!n.has(a.toString())&&(n.add(a.toString()),t!==void 0&&t.add(a))}for(let i of j.window.visibleTextEditors){let s=i.document.uri;n.has(s.toString())||(n.add(s.toString()),t!==void 0&&t.add(s))}}},Lr=class r{_id;_name;_clientOptions;_state;_onStart;_onStop;_connection;_idleInterval;_ignoredRegistrations;_listeners;_disposed;_notificationHandlers;_notificationDisposables;_pendingNotificationHandlers;_requestHandlers;_requestDisposables;_pendingRequestHandlers;_progressHandlers;_pendingProgressHandlers;_progressDisposables;_initializeResult;_outputChannel;_disposeOutputChannel;_traceOutputChannel;_traceLogLevel;_capabilities;_diagnostics;_syncedDocuments;_didChangeTextDocumentFeature;_inFlightOpenNotifications;_pendingChangeSemaphore;_pendingChangeDelayer;_didOpenTextDocumentFeature;_fileEvents;_fileEventDelayer;_telemetryEmitter;_stateChangeEmitter;_trace;_traceFormat=S.TraceFormat.Text;_tracer;_c2p;_p2c;_visibleDocuments;constructor(e,t,n){this._id=e,this._name=t,n=n||{};let i={isTrusted:!1,supportHtml:!1,supportThemeIcons:!1};n.markdown!==void 0&&(i.isTrusted=Qa.sanitizeIsTrusted(n.markdown.isTrusted),i.supportHtml=n.markdown.supportHtml===!0,i.supportThemeIcons=n.markdown.supportThemeIcons===!0),this._clientOptions={documentSelector:n.documentSelector??[],synchronize:n.synchronize??{},diagnosticCollectionName:n.diagnosticCollectionName,outputChannelName:n.outputChannelName??this._name,revealOutputChannelOn:n.revealOutputChannelOn??mn.Error,stdioEncoding:n.stdioEncoding??"utf8",initializationOptions:n.initializationOptions,initializationFailedHandler:n.initializationFailedHandler,progressOnInitialization:!!n.progressOnInitialization,errorHandler:n.errorHandler??this.createDefaultErrorHandler(n.connectionOptions?.maxRestartCount),middleware:n.middleware??{},uriConverters:n.uriConverters,workspaceFolder:n.workspaceFolder,connectionOptions:n.connectionOptions,markdown:i,diagnosticPullOptions:n.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:n.notebookDocumentOptions??{},textSynchronization:this.createTextSynchronizationOptions(n.textSynchronization)},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=K.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,n.outputChannel?(this._outputChannel=n.outputChannel,this._disposeOutputChannel=!1,this._traceLogLevel=this._outputChannel.logLevel):(this._outputChannel=void 0,this._disposeOutputChannel=!0,this._traceLogLevel=j.LogLevel.Info),this._traceOutputChannel=n.traceOutputChannel,this._traceOutputChannel!==void 0&&(this._traceLogLevel=this._traceOutputChannel.logLevel),this._diagnostics=void 0,this._inFlightOpenNotifications=new Set,this._pendingChangeSemaphore=new jr.Semaphore(1),this._pendingChangeDelayer=new jr.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new jr.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new S.Emitter,this._stateChangeEmitter=new S.Emitter,this._trace=S.Trace.Off,this._tracer={log:(s,o)=>{et.string(s)?this.trace(s,o):this.traceObject(s)}},this._c2p=mm.createConverter(n.uriConverters?n.uriConverters.code2Protocol:void 0),this._p2c=vm.createConverter(n.uriConverters?n.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml,this._clientOptions.markdown.supportThemeIcons),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}createTextSynchronizationOptions(e){return e?typeof e.delayOpenNotifications=="boolean"?{delayOpenNotifications:e.delayOpenNotifications}:{delayOpenNotifications:!1}:{delayOpenNotifications:!1}}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get visibleDocuments(){return this._visibleDocuments===void 0&&(this._visibleDocuments=new Xa),this._visibleDocuments}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=j.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name,{log:!0}),this._traceOutputChannel===void 0&&(this._traceLogLevel=this._outputChannel.logLevel)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let n=this.getPublicState();n!==t&&this._stateChangeEmitter.fire({oldState:t,newState:n})}getPublicState(){switch(this.$state){case K.Starting:return jn.Starting;case K.Running:return jn.Running;case K.StartFailed:return jn.StartFailed;default:return jn.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===K.StartFailed||this.$state===K.Stopping||this.$state===K.Stopped)return Promise.reject(new S.ResponseError(S.ErrorCodes.ConnectionInactive,"Client is not running"));let n=await this.$start();await this._didOpenTextDocumentFeature.sendPendingOpenNotifications(),this._didChangeTextDocumentFeature.syncKind===S.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(n);let i,s;if(t.length===1?S.CancellationToken.is(t[0])?s=t[0]:i=t[0]:t.length===2&&(i=t[0],s=t[1]),s!==void 0&&s.isCancellationRequested)return Promise.reject(new S.ResponseError(S.LSPErrorCodes.RequestCancelled,"Request got cancelled"));let o=this._clientOptions.middleware?.sendRequest;return o!==void 0?o(e,i,s,(a,u,l)=>{let p=[];return u!==void 0&&p.push(u),l!==void 0&&p.push(l),n.sendRequest(a,...p)}):n.sendRequest(e,...t)}onRequest(e,t){let n=typeof e=="string"?e:e.method;this._requestHandlers.set(n,t);let i=this.activeConnection(),s;return i!==void 0?(this._requestDisposables.set(n,i.onRequest(e,t)),s={dispose:()=>{let o=this._requestDisposables.get(n);o!==void 0&&(o.dispose(),this._requestDisposables.delete(n))}}):(this._pendingRequestHandlers.set(n,t),s={dispose:()=>{this._pendingRequestHandlers.delete(n);let o=this._requestDisposables.get(n);o!==void 0&&(o.dispose(),this._requestDisposables.delete(n))}}),{dispose:()=>{this._requestHandlers.delete(n),s.dispose()}}}async sendNotification(e,t){if(this.$state===K.StartFailed||this.$state===K.Stopping||this.$state===K.Stopped)return Promise.reject(new S.ResponseError(S.ErrorCodes.ConnectionInactive,"Client is not running"));let n=this._didChangeTextDocumentFeature.syncKind===S.TextDocumentSyncKind.Full,i;n&&typeof e!="string"&&e.method===S.DidOpenTextDocumentNotification.method&&(i=t?.textDocument.uri,this._inFlightOpenNotifications.add(i));let s;typeof e!="string"&&e.method===S.DidCloseTextDocumentNotification.method&&(s=t.textDocument.uri);let o=await this.$start();if(await this._didOpenTextDocumentFeature.sendPendingOpenNotifications(s))return;n&&await this.sendPendingFullTextDocumentChanges(o),i!==void 0&&this._inFlightOpenNotifications.delete(i);let u=this._clientOptions.middleware?.sendNotification;return u?u(e,o.sendNotification.bind(o),t):o.sendNotification(e,t)}onNotification(e,t){let n=typeof e=="string"?e:e.method;this._notificationHandlers.set(n,t);let i=this.activeConnection(),s;return i!==void 0?(this._notificationDisposables.set(n,i.onNotification(e,t)),s={dispose:()=>{let o=this._notificationDisposables.get(n);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(n))}}):(this._pendingNotificationHandlers.set(n,t),s={dispose:()=>{this._pendingNotificationHandlers.delete(n);let o=this._notificationDisposables.get(n);o!==void 0&&(o.dispose(),this._notificationDisposables.delete(n))}}),{dispose:()=>{this._notificationHandlers.delete(n),s.dispose()}}}async sendProgress(e,t,n){if(this.$state===K.StartFailed||this.$state===K.Stopping||this.$state===K.Stopped)return Promise.reject(new S.ResponseError(S.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,n)}catch(i){throw this.error(`Sending progress for token ${t} failed.`,i),i}}onProgress(e,t,n){this._progressHandlers.set(t,{type:e,handler:n});let i=this.activeConnection(),s,o=this._clientOptions.middleware?.handleWorkDoneProgress,a=S.WorkDoneProgress.is(e)&&o!==void 0?u=>{o(t,u,()=>n(u))}:n;return i!==void 0?(this._progressDisposables.set(t,i.onProgress(e,t,a)),s={dispose:()=>{let u=this._progressDisposables.get(t);u!==void 0&&(u.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:n}),s={dispose:()=>{this._pendingProgressHandlers.delete(t);let u=this._progressDisposables.get(t);u!==void 0&&(u.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),s.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new Za(this,e??4)}async setTrace(e){this._trace=e;let t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof S.ResponseError){let t=e;return` Message: ${t.message}
7
9
  Code: ${t.code} ${t.data?`
8
- `+t.data.toString():""}`}return e instanceof Error?je.string(e.stack)?e.stack:e.message:je.string(e)?e:e.toString()}debug(e,t,n=!0){this.logOutputMessage(_.MessageType.Debug,Ft.Debug,"Debug",e,t,n)}info(e,t,n=!0){this.logOutputMessage(_.MessageType.Info,Ft.Info,"Info",e,t,n)}warn(e,t,n=!0){this.logOutputMessage(_.MessageType.Warning,Ft.Warn,"Warn",e,t,n)}error(e,t,n=!0){this.logOutputMessage(_.MessageType.Error,Ft.Error,"Error",e,t,n)}logOutputMessage(e,t,n,i,r,s){this.outputChannel.appendLine(`[${n.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${i}`),r!=null&&this.outputChannel.appendLine(this.data2String(r)),(s==="force"||s&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,i)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===_.MessageType.Error?Y.window.showErrorMessage:e===_.MessageType.Warning?Y.window.showWarningMessage:Y.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===N.Initial||this.$state===N.Stopping||this.$state===N.Stopped}needsStop(){return this.$state===N.Starting||this.$state===N.Running}activeConnection(){return this.$state===N.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===N.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===N.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,n]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Y.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Y.languages.createDiagnosticCollection());for(let[i,r]of this._notificationHandlers)this._pendingNotificationHandlers.has(i)||this._pendingNotificationHandlers.set(i,r);for(let[i,r]of this._requestHandlers)this._pendingRequestHandlers.has(i)||this._pendingRequestHandlers.set(i,r);for(let[i,r]of this._progressHandlers)this._pendingProgressHandlers.has(i)||this._pendingProgressHandlers.set(i,r);this.$state=N.Starting;try{let i=await this.createConnection();i.onNotification(_.LogMessageNotification.type,r=>{switch(r.type){case _.MessageType.Error:this.error(r.message,void 0,!1);break;case _.MessageType.Warning:this.warn(r.message,void 0,!1);break;case _.MessageType.Info:this.info(r.message,void 0,!1);break;case _.MessageType.Debug:this.debug(r.message,void 0,!1);break;default:this.outputChannel.appendLine(r.message)}}),i.onNotification(_.ShowMessageNotification.type,r=>{switch(r.type){case _.MessageType.Error:Y.window.showErrorMessage(r.message);break;case _.MessageType.Warning:Y.window.showWarningMessage(r.message);break;case _.MessageType.Info:Y.window.showInformationMessage(r.message);break;default:Y.window.showInformationMessage(r.message)}}),i.onRequest(_.ShowMessageRequest.type,r=>{let s;switch(r.type){case _.MessageType.Error:s=Y.window.showErrorMessage;break;case _.MessageType.Warning:s=Y.window.showWarningMessage;break;case _.MessageType.Info:s=Y.window.showInformationMessage;break;default:s=Y.window.showInformationMessage}let c=r.actions||[];return s(r.message,...c)}),i.onNotification(_.TelemetryEventNotification.type,r=>{this._telemetryEmitter.fire(r)}),i.onRequest(_.ShowDocumentRequest.type,async r=>{let s=async d=>{let l=this.protocol2CodeConverter.asUri(d.uri);try{if(d.external===!0)return{success:await Y.env.openExternal(l)};{let g={};return d.selection!==void 0&&(g.selection=this.protocol2CodeConverter.asRange(d.selection)),d.takeFocus===void 0||d.takeFocus===!1?g.preserveFocus=!0:d.takeFocus===!0&&(g.preserveFocus=!1),await Y.window.showTextDocument(l,g),{success:!0}}}catch{return{success:!1}}},c=this._clientOptions.middleware.window?.showDocument;return c!==void 0?c(r,s):s(r)}),i.listen(),await this.initialize(i),t()}catch(i){this.$state=N.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,i,"force"),n(i)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((i,r)=>{e=i,t=r}),e,t]}async initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,[n,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],r={processId:null,clientInfo:{name:Y.env.appName,version:Y.version},locale:this.getLocale(),rootPath:n||null,rootUri:n?this._c2p.asUri(Y.Uri.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:je.func(t)?t():t,trace:_.Trace.toString(this._trace),workspaceFolders:i};if(this.fillInitializeParams(r),this._clientOptions.progressOnInitialization){let s=Zc.generateUuid(),c=new Sl.ProgressPart(e,s);r.workDoneToken=s;try{let d=await this.doInitialize(e,r);return c.done(),d}catch(d){throw c.cancel(),d}}else return this.doInitialize(e,r)}async doInitialize(e,t){try{let n=await e.initialize(t);if(n.capabilities.positionEncoding!==void 0&&n.capabilities.positionEncoding!==_.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${n.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=n,this.$state=N.Running;let i;je.number(n.capabilities.textDocumentSync)?n.capabilities.textDocumentSync===_.TextDocumentSyncKind.None?i={openClose:!1,change:_.TextDocumentSyncKind.None,save:void 0}:i={openClose:!0,change:n.capabilities.textDocumentSync,save:{includeText:!1}}:n.capabilities.textDocumentSync!==void 0&&n.capabilities.textDocumentSync!==null&&(i=n.capabilities.textDocumentSync),this._capabilities=Object.assign({},n.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(_.PublishDiagnosticsNotification.type,r=>this.handleDiagnostics(r)),e.onRequest(_.RegistrationRequest.type,r=>this.handleRegistrationRequest(r)),e.onRequest("client/registerFeature",r=>this.handleRegistrationRequest(r)),e.onRequest(_.UnregistrationRequest.type,r=>this.handleUnregistrationRequest(r)),e.onRequest("client/unregisterFeature",r=>this.handleUnregistrationRequest(r)),e.onRequest(_.ApplyWorkspaceEditRequest.type,r=>this.handleApplyWorkspaceEdit(r));for(let[r,s]of this._pendingNotificationHandlers)this._notificationDisposables.set(r,e.onNotification(r,s));this._pendingNotificationHandlers.clear();for(let[r,s]of this._pendingRequestHandlers)this._requestDisposables.set(r,e.onRequest(r,s));this._pendingRequestHandlers.clear();for(let[r,s]of this._pendingProgressHandlers)this._progressDisposables.set(r,e.onProgress(s.type,r,s.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(_.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),n}catch(n){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(n)?this.initialize(e):this.stop():n instanceof _.ResponseError&&n.data&&n.data.retry?Y.window.showErrorMessage(n.message,{title:"Retry",id:"retry"}).then(i=>{i&&i.id==="retry"?this.initialize(e):this.stop()}):(n&&n.message&&Y.window.showErrorMessage(n.message),this.error("Server initialization failed.",n),this.stop()),n}}_clientGetRootPath(){let e=Y.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===N.Stopped||this.$state===N.Initial)return;if(this.$state===N.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}let n=this.activeConnection();if(n===void 0||this.$state!==N.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=N.Stopping,this.cleanUp(e);let i=new Promise(s=>{(0,_.RAL)().timer.setTimeout(s,t)}),r=(async s=>(await s.shutdown(),await s.exit(),s))(n);return this._onStop=Promise.race([i,r]).then(s=>{if(s!==void 0)s.end(),s.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},s=>{throw this.error("Stopping server failed",s,!1),s}).finally(()=>{this.$state=N.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 n of t)n.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let n of Array.from(this._features.entries()).map(i=>i[1]).reverse())n.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 n(r){return t._fileEvents.push(r),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(_.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,n):n(e)).catch(r=>{t.error("Notify file events failed.",r)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(let n of t){let i=this.code2ProtocolConverter.asChangeTextDocumentParams(n);await e.sendNotification(_.DidChangeTextDocumentNotification.type,i),this._didChangeTextDocumentFeature.notificationSent(n,_.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,_.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,n]=e.value;this._diagnosticQueue.delete(t);let i=new Y.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:i},this._p2c.asDiagnostics(n,i.token).then(r=>{if(!i.token.isCancellationRequested){let s=this._p2c.asUri(t),c=this.clientOptions.middleware;c.handleDiagnostics?c.handleDiagnostics(s,r,(d,l)=>this.setDiagnostics(d,l)):this.setDiagnostics(s,r)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Y.env.language}async $start(){if(this.$state===N.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,r,s)=>{this.handleConnectionError(i,r,s).catch(c=>this.error("Handling connection error failed",c))},t=()=>{this.handleConnectionClosed().catch(i=>this.error("Handling connection close failed",i))},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=Xl(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===N.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:mt.DoNotRestart};if(this.$state!==N.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===mt.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===N.Starting?this.$state=N.StartFailed:this.$state=N.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===mt.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=N.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,n){let i=await this._clientOptions.errorHandler.error(e,t,n);i.action===xn.Shutdown?(this.error(i.message??`Client ${this._name}: connection to server is erroring.
10
+ `+t.data.toString():""}`}return e instanceof Error?et.string(e.stack)?e.stack:e.message:et.string(e)?e:e.toString()}shouldLogToOutputChannel(){return this.$state!==K.Stopped?!0:this._outputChannel!==void 0}error(e,t,n=!0){this.shouldLogToOutputChannel()&&this.outputChannel.error(this.getLogMessage(e,t)),(n==="force"||n&&this._clientOptions.revealOutputChannelOn<=mn.Error)&&this.showNotificationMessage(S.MessageType.Error,e,t)}warn(e,t,n=!0){this.shouldLogToOutputChannel()&&this.outputChannel.warn(this.getLogMessage(e,t)),n&&this._clientOptions.revealOutputChannelOn<=mn.Warn&&this.showNotificationMessage(S.MessageType.Warning,e,t)}info(e,t,n=!0){this.shouldLogToOutputChannel()&&this.outputChannel.info(this.getLogMessage(e,t)),n&&this._clientOptions.revealOutputChannelOn<=mn.Info&&this.showNotificationMessage(S.MessageType.Info,e,t)}debug(e,t,n=!0){this.shouldLogToOutputChannel()&&this.outputChannel.debug(this.getLogMessage(e,t)),n&&this._clientOptions.revealOutputChannelOn<=mn.Debug&&this.showNotificationMessage(S.MessageType.Debug,e,t)}trace(e,t){this.traceOutputChannel.trace(this.getLogMessage(e,t))}traceObject(e){this.traceOutputChannel.trace(JSON.stringify(e))}showNotificationMessage(e,t,n){t=t??"A request has failed. See the output for more information.",n&&(t+=`
11
+ `+this.data2String(n)),(e===S.MessageType.Error?j.window.showErrorMessage:e===S.MessageType.Warning?j.window.showWarningMessage:j.window.showInformationMessage)(t,"Go to output").then(s=>{s!==void 0&&this.outputChannel.show(!0)})}getLogMessage(e,t){return t!=null?`${e}
12
+ ${this.data2String(t)}`:e}needsStart(){return this.$state===K.Initial||this.$state===K.Stopping||this.$state===K.Stopped}needsStop(){return this.$state===K.Starting||this.$state===K.Running}activeConnection(){return this.$state===K.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===K.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===K.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,n]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=j.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName??this._id));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=K.Starting;try{let i=await this.createConnection();i.onNotification(S.LogMessageNotification.type,s=>{switch(s.type){case S.MessageType.Error:this.error(s.message,void 0,!1);break;case S.MessageType.Warning:this.warn(s.message,void 0,!1);break;case S.MessageType.Info:this.info(s.message,void 0,!1);break;case S.MessageType.Debug:this.debug(s.message,void 0,!1);break;default:this.outputChannel.appendLine(s.message)}}),i.onNotification(S.ShowMessageNotification.type,s=>{switch(s.type){case S.MessageType.Error:j.window.showErrorMessage(s.message);break;case S.MessageType.Warning:j.window.showWarningMessage(s.message);break;case S.MessageType.Info:j.window.showInformationMessage(s.message);break;default:j.window.showInformationMessage(s.message)}}),i.onRequest(S.ShowMessageRequest.type,s=>{let o;switch(s.type){case S.MessageType.Error:o=j.window.showErrorMessage;break;case S.MessageType.Warning:o=j.window.showWarningMessage;break;case S.MessageType.Info:o=j.window.showInformationMessage;break;default:o=j.window.showInformationMessage}let a=s.actions||[];return o(s.message,...a)}),i.onNotification(S.TelemetryEventNotification.type,s=>{this._telemetryEmitter.fire(s)}),i.onRequest(S.ShowDocumentRequest.type,async(s,o)=>{let a=async l=>{let p=this.protocol2CodeConverter.asUri(l.uri);try{if(l.external===!0)return{success:await j.env.openExternal(p)};{let h={};return l.selection!==void 0&&(h.selection=this.protocol2CodeConverter.asRange(l.selection)),l.takeFocus===void 0||l.takeFocus===!1?h.preserveFocus=!0:l.takeFocus===!0&&(h.preserveFocus=!1),await j.window.showTextDocument(p,h),{success:!0}}}catch{return{success:!1}}},u=this._clientOptions.middleware.window?.showDocument;return u!==void 0?u(s,o,a):a(s)}),i.listen(),await this.initialize(i),t()}catch(i){this.$state=K.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,i,"force"),n(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,[n,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:j.env.appName,version:j.version},locale:this.getLocale(),rootPath:n||null,rootUri:n?this._c2p.asUri(j.Uri.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:et.func(t)?t():t,trace:S.Trace.toString(this._trace),workspaceFolders:i};if(this.fillInitializeParams(s),this._clientOptions.progressOnInitialization){let o=Dl.generateUuid(),a=new ym.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 n=await e.initialize(t);if(n.capabilities.positionEncoding!==void 0&&n.capabilities.positionEncoding!==S.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${n.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=n,this.$state=K.Running;let i;et.number(n.capabilities.textDocumentSync)?n.capabilities.textDocumentSync===S.TextDocumentSyncKind.None?i={openClose:!1,change:S.TextDocumentSyncKind.None,save:void 0}:i={openClose:!0,change:n.capabilities.textDocumentSync,save:{includeText:!1}}:n.capabilities.textDocumentSync!==void 0&&n.capabilities.textDocumentSync!==null&&(i=n.capabilities.textDocumentSync),this._capabilities=Object.assign({},n.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(S.PublishDiagnosticsNotification.type,s=>this.handleDiagnostics(s)),e.onRequest(S.RegistrationRequest.type,s=>this.handleRegistrationRequest(s)),e.onRequest("client/registerFeature",s=>this.handleRegistrationRequest(s)),e.onRequest(S.UnregistrationRequest.type,s=>this.handleUnregistrationRequest(s)),e.onRequest("client/unregisterFeature",s=>this.handleUnregistrationRequest(s)),e.onRequest(S.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(S.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookLogLevelChanged(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),n}catch(n){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(n)?this.initialize(e):this.stop():n instanceof S.ResponseError&&n.data&&n.data.retry?j.window.showErrorMessage(n.message,{title:"Retry",id:"retry"}).then(i=>{i&&i.id==="retry"?this.initialize(e):this.stop()}):(n&&n.message&&j.window.showErrorMessage(n.message),this.error("Server initialization failed.",n),this.stop()),n}}_clientGetRootPath(){let e=j.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(Zt.Stop,e)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t=2e3){if(this.$state===K.Stopped||this.$state===K.Initial)return;if(this.$state===K.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}let n=this.activeConnection();if(n===void 0||this.$state!==K.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=K.Stopping,this.cleanUp(e);let i=new Promise(o=>{(0,S.RAL)().timer.setTimeout(o,t)}),s=(async o=>(await o.shutdown(),await o.exit(),o))(n);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=K.Stopped,e===Zt.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 n of t)n.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let n of Array.from(this._features.entries()).map(i=>i[1]).reverse())n.clear();(e===Zt.Stop||e===Zt.Restart)&&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 n(s){return t._fileEvents.push(s),t._fileEventDelayer.trigger(async()=>{let o=t._fileEvents;t._fileEvents=[];try{await t.sendNotification(S.DidChangeWatchedFilesNotification.type,{changes:o})}catch(a){throw t._fileEvents.push(...o),a}})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,n):n(e)).catch(s=>{t.error("Notifying file events failed.",s)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._inFlightOpenNotifications);if(t.length===0)return;for(let n of t){let i=this.code2ProtocolConverter.asChangeTextDocumentParams(n);await e.sendNotification(S.DidChangeTextDocumentNotification.type,i),this._didChangeTextDocumentFeature.notificationSent(n,S.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))}_diagnosticQueue=new Map;_diagnosticQueueState={state:"idle"};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,S.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,n]=e.value;this._diagnosticQueue.delete(t);let i=new j.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:i},this._p2c.asDiagnostics(n,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)}}).catch(s=>{this.error("Processing diagnostic queue failed.",s)}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return j.env.language}async $start(){if(this.$state===K.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))},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=Ym(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===K.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:Xt.DoNotRestart};if(this.$state!==K.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===Xt.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp(Zt.Stop),this.$state===K.Starting?this.$state=K.StartFailed:this.$state=K.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===Xt.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",void 0,!e.handled),this.cleanUp(Zt.Restart),this.$state=K.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,n){let i=await this._clientOptions.errorHandler.error(e,t,n);i.action===Si.Shutdown?(this.error(i.message??`Client ${this._name}: connection to server is erroring.
9
13
  ${e.message}
10
- Shutting down server.`,void 0,i.handled===!0?!1:"force"),this.stop().catch(r=>{this.error("Stopping server failed",r,!1)})):this.error(i.message??`Client ${this._name}: connection to server is erroring.
11
- ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Y.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let n=Y.workspace.getConfiguration(this._id),i=_.Trace.Off,r=_.TraceFormat.Text;if(n){let s=n.get("trace.server","off");typeof s=="string"?i=_.Trace.fromString(s):(i=_.Trace.fromString(n.get("trace.server.verbosity","off")),r=_.TraceFormat.fromString(n.get("trace.server.format","text")))}this._trace=i,this._traceFormat=r,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(s=>{this.error("Updating trace failed with error",s,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let n;je.array(t)?n=t:n=[t],n&&this._dynamicFeatures.get(_.DidChangeWatchedFilesNotification.type.method).registerRaw(Zc.generateUuid(),n)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Ke.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(_.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Xc.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new ed.ConfigurationFeature(this)),this.registerFeature(new Jt.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new Jt.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new Jt.WillSaveFeature(this)),this.registerFeature(new Jt.WillSaveWaitUntilFeature(this)),this.registerFeature(new Jt.DidSaveTextDocumentFeature(this)),this.registerFeature(new Jt.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Ll.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new _l.CompletionItemFeature(this)),this.registerFeature(new Tl.HoverFeature(this)),this.registerFeature(new Pl.SignatureHelpFeature(this)),this.registerFeature(new kl.DefinitionFeature(this)),this.registerFeature(new ql.ReferencesFeature(this)),this.registerFeature(new Rl.DocumentHighlightFeature(this)),this.registerFeature(new xl.DocumentSymbolFeature(this)),this.registerFeature(new Fl.WorkspaceSymbolFeature(this)),this.registerFeature(new Il.CodeActionFeature(this)),this.registerFeature(new El.CodeLensFeature(this)),this.registerFeature(new ia.DocumentFormattingFeature(this)),this.registerFeature(new ia.DocumentRangeFormattingFeature(this)),this.registerFeature(new ia.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Ml.RenameFeature(this)),this.registerFeature(new Al.DocumentLinkFeature(this)),this.registerFeature(new Ol.ExecuteCommandFeature(this)),this.registerFeature(new ed.SyncConfigurationFeature(this)),this.registerFeature(new Hl.TypeDefinitionFeature(this)),this.registerFeature(new Nl.ImplementationFeature(this)),this.registerFeature(new Ul.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Kl.WorkspaceFoldersFeature(this)),this.registerFeature(new jl.FoldingRangeFeature(this)),this.registerFeature(new Wl.DeclarationFeature(this)),this.registerFeature(new $l.SelectionRangeFeature(this)),this.registerFeature(new zl.ProgressFeature(this)),this.registerFeature(new Vl.CallHierarchyFeature(this)),this.registerFeature(new Bl.SemanticTokensFeature(this)),this.registerFeature(new Yl.LinkedEditingFeature(this)),this.registerFeature(new Qt.DidCreateFilesFeature(this)),this.registerFeature(new Qt.DidRenameFilesFeature(this)),this.registerFeature(new Qt.DidDeleteFilesFeature(this)),this.registerFeature(new Qt.WillCreateFilesFeature(this)),this.registerFeature(new Qt.WillRenameFilesFeature(this)),this.registerFeature(new Qt.WillDeleteFilesFeature(this)),this.registerFeature(new Jl.TypeHierarchyFeature(this)),this.registerFeature(new Ql.InlineValueFeature(this)),this.registerFeature(new Gl.InlayHintsFeature(this)),this.registerFeature(new bl.DiagnosticFeature(this)),this.registerFeature(new Xc.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(aa.createAll(this))}fillInitializeParams(e){for(let t of this._features)je.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Ke.ensure)(e,"workspace").applyEdit=!0;let t=(0,Ke.ensure)((0,Ke.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[_.ResourceOperationKind.Create,_.ResourceOperationKind.Rename,_.ResourceOperationKind.Delete],t.failureHandling=_.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let n=(0,Ke.ensure)((0,Ke.ensure)(e,"textDocument"),"publishDiagnostics");n.relatedInformation=!0,n.versionSupport=!1,n.tagSupport={valueSet:[_.DiagnosticTag.Unnecessary,_.DiagnosticTag.Deprecated]},n.codeDescriptionSupport=!0,n.dataSupport=!0;let i=(0,Ke.ensure)(e,"window"),r=(0,Ke.ensure)(i,"showMessage");r.messageActionItem={additionalPropertiesSupport:!0};let s=(0,Ke.ensure)(i,"showDocument");s.support=!0;let c=(0,Ke.ensure)(e,"general");c.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(a.RequestsToCancelOnContentModified)},c.regularExpressions={engine:"ECMAScript",version:"ES2020"},c.markdown={parser:"marked",version:"1.1.0"},c.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(c.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 d of this._features)d.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let n of this._features)je.func(n.preInitialize)&&n.preInitialize(this._capabilities,t);for(let n of this._features)n.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,n=>this.doRegisterCapability(n)):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 n=this._dynamicFeatures.get(t.method);if(n===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 r={id:t.id,registerOptions:i};try{n.register(r)}catch(s){return Promise.reject(s)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,n=>this.doUnregisterCapability(n)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let n=this._dynamicFeatures.get(t.method);if(!n)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));n.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,n=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),i=new Map;Y.workspace.textDocuments.forEach(s=>i.set(s.uri.toString(),s));let r=!1;if(t.documentChanges){for(let s of t.documentChanges)if(_.TextDocumentEdit.is(s)&&s.textDocument.version&&s.textDocument.version>=0){let c=this._p2c.asUri(s.textDocument.uri).toString(),d=i.get(c);if(d&&d.version!==s.textDocument.version){r=!0;break}}}return r?Promise.resolve({applied:!1}):je.asPromise(Y.workspace.applyEdit(n).then(s=>({applied:s})))}handleFailedRequest(e,t,n,i,r=!0){if(n instanceof _.ResponseError){if(n.code===_.ErrorCodes.PendingResponseRejected||n.code===_.ErrorCodes.ConnectionInactive)return i;if(n.code===_.LSPErrorCodes.RequestCancelled||n.code===_.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return i;throw n.data!==void 0?new Ke.LSPCancellationError(n.data):new Y.CancellationError}else if(n.code===_.LSPErrorCodes.ContentModified){if(a.RequestsToCancelOnContentModified.has(e.method)||a.CancellableResolveCalls.has(e.method))throw new Y.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,n,r),n}};me.BaseLanguageClient=Fn;Fn.RequestsToCancelOnContentModified=new Set([_.SemanticTokensRequest.method,_.SemanticTokensRangeRequest.method,_.SemanticTokensDeltaRequest.method]);Fn.CancellableResolveCalls=new Set([_.CompletionResolveRequest.method,_.CodeLensResolveRequest.method,_.CodeActionResolveRequest.method,_.InlayHintResolveRequest.method,_.DocumentLinkResolveRequest.method,_.WorkspaceSymbolResolveRequest.method]);var oa=class{error(e){(0,_.RAL)().console.error(e)}warn(e){(0,_.RAL)().console.warn(e)}info(e){(0,_.RAL)().console.info(e)}log(e){(0,_.RAL)().console.log(e)}};function Xl(a,e,t,n,i){let r=new oa,s=(0,_.createProtocolConnection)(a,e,r,i);return s.onError(d=>{t(d[0],d[1],d[2])}),s.onClose(n),{listen:()=>s.listen(),sendRequest:s.sendRequest,onRequest:s.onRequest,hasPendingResponse:s.hasPendingResponse,sendNotification:s.sendNotification,onNotification:s.onNotification,onProgress:s.onProgress,sendProgress:s.sendProgress,trace:(d,l,g)=>{let h={sendNotification:!1,traceFormat:_.TraceFormat.Text};return g===void 0?s.trace(d,l,h):(je.boolean(g),s.trace(d,l,g))},initialize:d=>s.sendRequest(_.InitializeRequest.type,d),shutdown:()=>s.sendRequest(_.ShutdownRequest.type,void 0),exit:()=>s.sendNotification(_.ExitNotification.type),end:()=>s.end(),dispose:()=>s.dispose()}}var aa;(function(a){function e(t){return[new Zl.InlineCompletionItemFeature(t)]}a.createAll=e})(aa||(me.ProposedFeatures=aa={}))});var rd=F(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.terminate=void 0;var id=I("child_process"),ep=I("path"),tp=process.platform==="win32",np=process.platform==="darwin",ip=process.platform==="linux";function rp(a,e){if(tp)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),id.execFileSync("taskkill",["/T","/F","/PID",a.pid.toString()],i),!0}catch{return!1}else if(ip||np)try{var t=(0,ep.join)(__dirname,"terminateProcess.sh"),n=id.spawnSync(t,[a.pid.toString()]);return!n.error}catch{return!1}else return a.kill("SIGKILL"),!0}Xi.terminate=rp});var od=F(Fe=>{"use strict";var sp=Fe&&Fe.__createBinding||(Object.create?(function(a,e,t,n){n===void 0&&(n=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(a,n,i)}):(function(a,e,t,n){n===void 0&&(n=t),a[n]=e[t]})),da=Fe&&Fe.__exportStar||function(a,e){for(var t in a)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&sp(e,a,t)};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DiagnosticPullMode=Fe.vsdiag=void 0;da(L(),Fe);da(W(),Fe);var sd=ks();Object.defineProperty(Fe,"vsdiag",{enumerable:!0,get:function(){return sd.vsdiag}});Object.defineProperty(Fe,"DiagnosticPullMode",{enumerable:!0,get:function(){return sd.DiagnosticPullMode}});da(ca(),Fe)});var ud=F(Te=>{"use strict";var op=Te&&Te.__createBinding||(Object.create?(function(a,e,t,n){n===void 0&&(n=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(a,n,i)}):(function(a,e,t,n){n===void 0&&(n=t),a[n]=e[t]})),dd=Te&&Te.__exportStar||function(a,e){for(var t in a)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&op(e,a,t)};Object.defineProperty(Te,"__esModule",{value:!0});Te.SettingMonitor=Te.LanguageClient=Te.TransportKind=void 0;var it=I("child_process"),ua=I("fs"),la=I("path"),yt=I("vscode"),ne=Ie(),ad=ca(),ap=rd(),re=Pa(),cp=qd(),dp=Id();dd(Pa(),Te);dd(od(),Te);var cd="^1.82.0",se;(function(a){a[a.stdio=0]="stdio",a[a.ipc=1]="ipc",a[a.pipe=2]="pipe",a[a.socket=3]="socket"})(se||(Te.TransportKind=se={}));var vt;(function(a){function e(t){let n=t;return n&&n.kind===se.socket&&ne.number(n.port)}a.isSocket=e})(vt||(vt={}));var pa;(function(a){function e(t){return ne.string(t.command)}a.is=e})(pa||(pa={}));var fa;(function(a){function e(t){return ne.string(t.module)}a.is=e})(fa||(fa={}));var ha;(function(a){function e(t){let n=t;return n&&n.writer!==void 0&&n.reader!==void 0}a.is=e})(ha||(ha={}));var ga;(function(a){function e(t){let n=t;return n&&n.process!==void 0&&typeof n.detached=="boolean"}a.is=e})(ga||(ga={}));var ma=class extends ad.BaseLanguageClient{constructor(e,t,n,i,r){let s,c,d,l,g;ne.string(t)?(s=e,c=t,d=n,l=i,g=!!r):(s=e.toLowerCase(),c=e,d=t,l=n,g=i),g===void 0&&(g=!1),super(s,c,l),this._serverOptions=d,this._forceDebug=g,this._isInDebugMode=g;try{this.checkVersion()}catch(h){throw ne.string(h.message)&&this.outputChannel.appendLine(h.message),h}}checkVersion(){let e=cp(yt.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${yt.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!dp(e,cd))throw new Error(`The language client requires VS Code version ${cd} but received version ${yt.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,ap.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(g,h){if(!g&&!h)return;let f=Object.create(null);return Object.keys(process.env).forEach(v=>f[v]=process.env[v]),h&&(f.ELECTRON_RUN_AS_NODE="1",f.ELECTRON_NO_ASAR="1"),g&&Object.keys(g).forEach(v=>f[v]=g[v]),f}let n=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function r(){let g=process.execArgv;return g?g.some(h=>n.some(f=>h.startsWith(f))||i.some(f=>h===f)):!1}function s(g){if(g.stdin===null||g.stdout===null||g.stderr===null)throw new Error("Process created without stdio streams")}let c=this._serverOptions;if(ne.func(c))return c().then(g=>{if(ad.MessageTransports.is(g))return this._isDetached=!!g.detached,g;if(ha.is(g))return this._isDetached=!!g.detached,{reader:new re.StreamMessageReader(g.reader),writer:new re.StreamMessageWriter(g.writer)};{let h;return ga.is(g)?(h=g.process,this._isDetached=g.detached):(h=g,this._isDetached=!1),h.stderr.on("data",f=>this.outputChannel.append(ne.string(f)?f:f.toString(e))),{reader:new re.StreamMessageReader(h.stdout),writer:new re.StreamMessageWriter(h.stdin)}}});let d,l=c;return l.run||l.debug?this._forceDebug||r()?(d=l.debug,this._isInDebugMode=!0):(d=l.run,this._isInDebugMode=!1):d=c,this._getServerWorkingDir(d.options).then(g=>{if(fa.is(d)&&d.module){let h=d,f=h.transport||se.stdio;if(h.runtime){let v=[],p=h.options??Object.create(null);p.execArgv&&p.execArgv.forEach(T=>v.push(T)),v.push(h.module),h.args&&h.args.forEach(T=>v.push(T));let y=Object.create(null);y.cwd=g,y.env=t(p.env,!1);let C=this._getRuntimePath(h.runtime,g),b;if(f===se.ipc?(y.stdio=[null,null,null,"ipc"],v.push("--node-ipc")):f===se.stdio?v.push("--stdio"):f===se.pipe?(b=(0,re.generateRandomPipeName)(),v.push(`--pipe=${b}`)):vt.isSocket(f)&&v.push(`--socket=${f.port}`),v.push(`--clientProcessId=${process.pid.toString()}`),f===se.ipc||f===se.stdio){let T=it.spawn(C,v,y);return!T||!T.pid?Gt(T,`Launching server using runtime ${C} failed.`):(this._serverProcess=T,T.stderr.on("data",P=>this.outputChannel.append(ne.string(P)?P:P.toString(e))),f===se.ipc?(T.stdout.on("data",P=>this.outputChannel.append(ne.string(P)?P:P.toString(e))),Promise.resolve({reader:new re.IPCMessageReader(T),writer:new re.IPCMessageWriter(T)})):Promise.resolve({reader:new re.StreamMessageReader(T.stdout),writer:new re.StreamMessageWriter(T.stdin)}))}else{if(f===se.pipe)return(0,re.createClientPipeTransport)(b).then(T=>{let P=it.spawn(C,v,y);return!P||!P.pid?Gt(P,`Launching server using runtime ${C} failed.`):(this._serverProcess=P,P.stderr.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),P.stdout.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),T.onConnected().then(q=>({reader:q[0],writer:q[1]})))});if(vt.isSocket(f))return(0,re.createClientSocketTransport)(f.port).then(T=>{let P=it.spawn(C,v,y);return!P||!P.pid?Gt(P,`Launching server using runtime ${C} failed.`):(this._serverProcess=P,P.stderr.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),P.stdout.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),T.onConnected().then(q=>({reader:q[0],writer:q[1]})))})}}else{let v;return new Promise((p,y)=>{let C=(h.args&&h.args.slice())??[];f===se.ipc?C.push("--node-ipc"):f===se.stdio?C.push("--stdio"):f===se.pipe?(v=(0,re.generateRandomPipeName)(),C.push(`--pipe=${v}`)):vt.isSocket(f)&&C.push(`--socket=${f.port}`),C.push(`--clientProcessId=${process.pid.toString()}`);let b=h.options??Object.create(null);if(b.env=t(b.env,!0),b.execArgv=b.execArgv||[],b.cwd=g,b.silent=!0,f===se.ipc||f===se.stdio){let T=it.fork(h.module,C||[],b);s(T),this._serverProcess=T,T.stderr.on("data",P=>this.outputChannel.append(ne.string(P)?P:P.toString(e))),f===se.ipc?(T.stdout.on("data",P=>this.outputChannel.append(ne.string(P)?P:P.toString(e))),p({reader:new re.IPCMessageReader(this._serverProcess),writer:new re.IPCMessageWriter(this._serverProcess)})):p({reader:new re.StreamMessageReader(T.stdout),writer:new re.StreamMessageWriter(T.stdin)})}else f===se.pipe?(0,re.createClientPipeTransport)(v).then(T=>{let P=it.fork(h.module,C||[],b);s(P),this._serverProcess=P,P.stderr.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),P.stdout.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),T.onConnected().then(q=>{p({reader:q[0],writer:q[1]})},y)},y):vt.isSocket(f)&&(0,re.createClientSocketTransport)(f.port).then(T=>{let P=it.fork(h.module,C||[],b);s(P),this._serverProcess=P,P.stderr.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),P.stdout.on("data",q=>this.outputChannel.append(ne.string(q)?q:q.toString(e))),T.onConnected().then(q=>{p({reader:q[0],writer:q[1]})},y)},y)})}}else if(pa.is(d)&&d.command){let h=d,f=d.args!==void 0?d.args.slice(0):[],v,p=d.transport;if(p===se.stdio)f.push("--stdio");else if(p===se.pipe)v=(0,re.generateRandomPipeName)(),f.push(`--pipe=${v}`);else if(vt.isSocket(p))f.push(`--socket=${p.port}`);else if(p===se.ipc)throw new Error("Transport kind ipc is not support for command executable");let y=Object.assign({},h.options);if(y.cwd=y.cwd||g,p===void 0||p===se.stdio){let C=it.spawn(h.command,f,y);return!C||!C.pid?Gt(C,`Launching server using command ${h.command} failed.`):(C.stderr.on("data",b=>this.outputChannel.append(ne.string(b)?b:b.toString(e))),this._serverProcess=C,this._isDetached=!!y.detached,Promise.resolve({reader:new re.StreamMessageReader(C.stdout),writer:new re.StreamMessageWriter(C.stdin)}))}else{if(p===se.pipe)return(0,re.createClientPipeTransport)(v).then(C=>{let b=it.spawn(h.command,f,y);return!b||!b.pid?Gt(b,`Launching server using command ${h.command} failed.`):(this._serverProcess=b,this._isDetached=!!y.detached,b.stderr.on("data",T=>this.outputChannel.append(ne.string(T)?T:T.toString(e))),b.stdout.on("data",T=>this.outputChannel.append(ne.string(T)?T:T.toString(e))),C.onConnected().then(T=>({reader:T[0],writer:T[1]})))});if(vt.isSocket(p))return(0,re.createClientSocketTransport)(p.port).then(C=>{let b=it.spawn(h.command,f,y);return!b||!b.pid?Gt(b,`Launching server using command ${h.command} failed.`):(this._serverProcess=b,this._isDetached=!!y.detached,b.stderr.on("data",T=>this.outputChannel.append(ne.string(T)?T:T.toString(e))),b.stdout.on("data",T=>this.outputChannel.append(ne.string(T)?T:T.toString(e))),C.onConnected().then(T=>({reader:T[0],writer:T[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(c,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(g,h)=>{g!==null&&this.error(`Server process exited with code ${g}.`,void 0,!1),h!==null&&this.error(`Server process exited with signal ${h}.`,void 0,!1)})})}_getRuntimePath(e,t){if(la.isAbsolute(e))return e;let n=this._mainGetRootPath();if(n!==void 0){let i=la.join(n,e);if(ua.existsSync(i))return i}if(t!==void 0){let i=la.join(t,e);if(ua.existsSync(i))return i}return e}_mainGetRootPath(){let e=yt.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(n=>{ua.lstat(t,(i,r)=>{n(!i&&r.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};Te.LanguageClient=ma;var va=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return yt.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new yt.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,n=e>=0?this._setting.substr(e+1):void 0,i=n?yt.workspace.getConfiguration(t).get(n,!1):yt.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start().catch(r=>this._client.error("Start failed after configuration change",r,"force")):!i&&this._client.needsStop()&&this._client.stop().catch(r=>this._client.error("Stop failed after configuration change",r,"force"))}};Te.SettingMonitor=va;function Gt(a,e){return a===null?Promise.reject(e):new Promise((t,n)=>{a.on("error",i=>{n(`${e} ${i}`)}),setImmediate(()=>n(e))})}});var pd=F((Of,ld)=>{"use strict";ld.exports=ud()});import*as ue from"vscode";var Pr=sn(Ed(),1);import*as S from"vscode";import*as Lt from"path";import{fork as Md}from"child_process";import*as Tr from"vscode";var Gn=class{constructor(e){this.secrets=e}secrets;async ReadyAPIKey(e){if(process.env.FACTORIO_UPLOAD_API_KEY)return{from:"env"};try{let t=await this.secrets.get("factorio-uploadmods");if(t&&(e&&(e=await Tr.window.showInformationMessage("Key already present. Replace it?",{modal:!0},"Yes","No")==="Yes"),!e))return{from:"secrets",key:t};if(t=await Tr.window.showInputBox({prompt:"Mod Portal API Key:",ignoreFocusOut:!0,password:!0}),t)return t=t.trim(),await this.secrets.store("factorio-uploadmods",t),{from:"new",key:t}}catch{}return!1}async ClearApiKey(){return this.secrets.delete("factorio-uploadmods")}};import{platform as Ad,tmpdir as Od}from"os";var j={valTypes:{none:"NONE",primitive:"PRIM",object:"OBJECT",array:"ARRAY"},getValType:function(a){return a&&typeof a=="object"||Array.isArray(a)?Array.isArray(a)?j.valTypes.array:typeof a=="object"?j.valTypes.object:void 0:j.valTypes.primitive},getPathType:function(a){var e=[];for(var t in a){var n=a[t];n?j.isNumber(n)?e.push(j.valTypes.array):e.push(j.valTypes.object):e.push(j.valTypes.none)}return e},isUndefined:function(a){return a===void 0},isNumber:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&a.indexOf(".")===-1},isEmptyObj:function(a){for(var e in a)if(Object.hasOwnProperty.call(a,e))return!1;return JSON.stringify(a)===JSON.stringify({})},isNotObject:function(a){return!a||typeof a!="object"},isEmptyArray:function(a){return Array.isArray(a)&&a.length==0},isNotArray:function(a){return Array.isArray(a)==0},removeEmptyArrayItem:function(a){return a.filter(function(e){return e!=null&&e!=""})},getFieldName:function(a,e,t,n,i){return i?(e||"")+(j.isNumber(a)?"["+a+"]":(t&&!e?"":".")+a):n?(e||"")+"["+a+"]":(e?e+".":"")+a},startsWith:function(a,e){return a.indexOf(e)==0},convert:function(a,e){var t={};return j.isNotObject(a)&&j.isNotArray(a)?e?(t[e]=a,t):a:j.isEmptyArray(a)?a:(function n(i,r,s){var c=Array.isArray(i);for(var d in i){var l=i[d];l&&typeof l=="object"?Array.isArray(l)?j.isEmptyArray(l)?t[j.getFieldName(d,r,s,!1,!0)]=l:t=n(l,j.getFieldName(d,r,s,!1,!0),c):c&&j.isEmptyObj(l)==0?t=n(l,j.getFieldName(d,r,s,!0)):j.isEmptyObj(l)==0?t=n(l,j.getFieldName(d,r,s)):j.isEmptyObj(l)&&(t[j.getFieldName(d,r,s,c)]=l):c||j.isNumber(d)?t[j.getFieldName(d,r,s,!0)]=l:t[j.getFieldName(d,r,s)]=l}return t})(a,e,!0)},backward:function(a,e){var t={},n=/\[(\d+)\]/g;if(j.isNotObject(a)&&j.isNotArray(a))return e?a[e]:a;if(j.isEmptyArray(a))return a;for(var i in a){var r=a[i];if(e){var s=new RegExp("^"+e);i=i.replace(s,"")}i=i.replace(n,".$1"),j.startsWith(i,".")&&(i=i.replace(/^\./,""));var c=i.split("."),d=j.getPathType(c);j.isUndefined(d)||d[0]!=j.valTypes.array||Array.isArray(t)!=0||(t=[]),(function l(g,h,f,v){var p=c.shift(),y=d.shift();if(p!==void 0&&p!=""){if(p=j.isNumber(p)?parseInt(p):p,c.length>0)return h[p]===void 0&&(h[p]=d[0]==j.valTypes.array?[]:{}),void l(g,h[p],p,h);y==j.valTypes.array&&f&&v?(Array.isArray(v[f])==0&&(v[f]=[]),v[f].push(g)):h[p]=g}else t=g})(r,t)}return t}};var Zn;function Ld(a){return Zn?Ad()==="win32"?`${a};${S.Uri.joinPath(Zn,"bin").fsPath}`:`${a}:${S.Uri.joinPath(Zn,"bin").fsPath}`:a}async function Ia(a){if(S.workspace.workspaceFolders){let e=new Gn(a.secrets);a.subscriptions.push(S.commands.registerCommand("factorio.clearApiKey",async()=>{await e.ClearApiKey()})),a.subscriptions.push(S.commands.registerCommand("factorio.setApiKey",async()=>{await e.ReadyAPIKey(!0)}));let t=S.extensions.getExtension("vscode.git");t&&!t.isActive&&await t.activate();let n=new xr(a,e,t?.exports.getAPI(1));a.subscriptions.push(n);let i=S.window.createTreeView("factoriomods",{treeDataProvider:n});a.subscriptions.push(i),Zn=a.extensionUri}}var Rr=class{constructor(e,t){this.context=e;this.modPackages=t}context;modPackages;provideTasks(e){let t=[],n=Ve.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())n.has(i)&&(t.push(new S.Task({label:`${i.name}.datestamp`,type:"factorio",modname:i.label,command:"datestamp"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.datestamp`,"factorio",i.DateStampTask(),[])),t.push(new S.Task({label:`${i.name}.package`,type:"factorio",modname:i.label,command:"package"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.package`,"factorio",i.PackageTask(),[])),t.push(new S.Task({label:`${i.name}.version`,type:"factorio",modname:i.label,command:"version"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.version`,"factorio",i.IncrementTask(),[])),t.push(new S.Task({label:`${i.name}.upload`,type:"factorio",modname:i.label,command:"upload"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.upload`,"factorio",i.PostToPortalTask(),[])),t.push(new S.Task({label:`${i.name}.details`,type:"factorio",modname:i.label,command:"details"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.details`,"factorio",i.DetailsTask(),[])),t.push(new S.Task({label:`${i.name}.publish`,type:"factorio",modname:i.label,command:"publish"},S.workspace.getWorkspaceFolder(i.resourceUri)||S.TaskScope.Workspace,`${i.name}.publish`,"factorio",i.PublishTask(),[])));return t}resolveTaskExecution(e,t){if(e.definition.command==="adjustMods")return e.definition.adjustMods?e.definition.modsPath?this.AdjustModsTask(e.definition):this.ConfigErrorTask(e.definition,"missing `modsPath`"):this.ConfigErrorTask(e.definition,"missing `adjustMods`");if(!e.definition.modname)return this.ConfigErrorTask(e.definition,"missing `modname`");if(e.definition.command==="run"&&!e.definition.script)return this.ConfigErrorTask(e.definition,"missing `script`");let n=Ve.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())if(i.label===e.definition.modname&&n.has(i)){let r=i;switch(e.definition.command){case"run":return r.RunTask(e.definition.script,e.definition.scriptArgs);case"compile":return r.RunTask("compile");case"datestamp":return r.DateStampTask();case"package":return r.PackageTask();case"version":return r.IncrementTask();case"upload":return r.PostToPortalTask();case"details":return r.DetailsTask();case"publish":return r.PublishTask();default:return this.ConfigErrorTask(e.definition,`unknown \`command\` "${e.definition.command}"`)}}return this.ConfigErrorTask(e.definition,`mod "${e.definition.modname}" not found`)}resolveTask(e,t){if(e.definition.type==="factorio"){let n=this.resolveTaskExecution(e,t);return new S.Task(e.definition,e.scope||S.TaskScope.Workspace,e.name,e.source,n,[])}}ConfigErrorTask(e,t){return new S.CustomExecution(async()=>new Ne(n=>{n.write(t+`
12
- `),n.write(JSON.stringify(e,void 0,2)),n.close()}))}getFMTKCLIPath(){return this.context.asAbsolutePath("./dist/fmtk-cli.js")}AdjustModsTask(e){let t=["mods","--modsPath",e.modsPath,"adjust"];e.allowDisableBaseMod&&t.push("--allowDisableBase"),e.disableExtraMods&&t.push("--disableExtra");for(let n in e.adjustMods)t.push(`${n}=${e.adjustMods[n]}`);return new S.CustomExecution(async()=>new Ne(async n=>{await ze(n,this.getFMTKCLIPath(),t,process.cwd()),n.close()}))}},Ve=class extends S.TreeItem{constructor(t,n,i,r,s,c){super(t);this.resourceUri=t;this.modinfo=n;this.keychain=i;this.context=r;this._onDidChange=s;this.gitapi=c;this.command={title:"Open",command:"vscode.open",arguments:[t]},this.UpdateTreeItemFields()}resourceUri;modinfo;keychain;context;_onDidChange;gitapi;get name(){return this.modinfo.name}get title(){return this.modinfo.title}get version(){return this.modinfo.version}get scripts(){return this.modinfo.package?.scripts}static sort(t,n){let i=t.name.toLowerCase().localeCompare(n.name.toLowerCase());if(i!==0)return i*100;let r=Pr.compare(t.version,n.version,{loose:!0});return r!==0?-r*10:t.resourceUri<n.resourceUri?-1:t.resourceUri>n.resourceUri?1:0}static latestPackages(t){let n=new Map;for(let r of t)n.has(r.name)?n.get(r.name).push(r):n.set(r.name,[r]);let i=new Set;for(let r of n.values())i.add(r.reduce((s,c)=>Pr.compare(s.version,c.version,{loose:!0})<0?c:s));return i}async gitLabel(){let t=this.gitapi?.getRepository(this.resourceUri);if(t){let n=await t.log({}),i=0;for(;i<n.length;i++){let r=n[i];if("refNames"in r&&r.refNames.some(d=>d.match(/^tag:/)))return`+${i}`}}}async ReloadInfo(){let n=(await S.workspace.openTextDocument(this.resourceUri)).getText();this.modinfo=JSON.parse(n);let i=await this.gitLabel();this.UpdateTreeItemFields(i),this._onDidChange(this)}UpdateTreeItemFields(t){this.label=this.name,this.description=t?`${this.version} (${t})`:this.version,this.tooltip=this.title}getFMTKCLIPath(){return this.context.asAbsolutePath("./dist/fmtk-cli.js")}RunTask(t,n){return new S.CustomExecution(async()=>new Ne(async i=>{await ze(i,this.getFMTKCLIPath(),["run",t,...n??[]],S.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),i.close()}))}DateStampTask(){return new S.CustomExecution(async()=>new Ne(async t=>{await ze(t,this.getFMTKCLIPath(),["datestamp"],S.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),t.close()}))}PackageTask(){let t=["package"];return S.workspace.getConfiguration(void 0,this.resourceUri).get("factorio.package.zipLocation","inside")==="outside"&&(t.push("--outdir"),t.push("..")),new S.CustomExecution(async()=>new Ne(async i=>{await ze(i,this.getFMTKCLIPath(),t,S.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),i.close()}))}IncrementTask(){return new S.CustomExecution(async()=>new Ne(async t=>{await ze(t,this.getFMTKCLIPath(),["version"],S.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),t.close()}))}PostToPortalTask(){return new S.CustomExecution(async()=>new Ne(async t=>{await this.ReloadInfo();let n=S.workspace.getConfiguration(void 0,this.resourceUri),i=Lt.dirname(this.resourceUri.path);n.get("factorio.package.zipLocation","inside")==="outside"&&(i=Lt.dirname(i));let r=this.resourceUri.with({path:i}),c=(await S.workspace.fs.readDirectory(r)).filter(([h,f])=>f===S.FileType.File&&h.startsWith(this.name)&&h.match(/_\d+\.\d+\.\d+\.zip$/)).map(([h,f])=>h).sort().reverse(),d=await S.window.showQuickPick(c,{placeHolder:"Select Package to upload"});if(!d){t.close();return}let l=Lt.join(r.fsPath,d),g=await this.keychain.ReadyAPIKey();g&&await ze(t,this.getFMTKCLIPath(),["upload",l,this.name],S.Uri.joinPath(this.resourceUri,"..").fsPath,g.from!=="env"?{FACTORIO_UPLOAD_API_KEY:g.key}:void 0),await this.ReloadInfo(),t.close()}))}DetailsTask(){return new S.CustomExecution(async()=>new Ne(async t=>{let n=await this.keychain.ReadyAPIKey();n&&await ze(t,this.getFMTKCLIPath(),["details"],S.Uri.joinPath(this.resourceUri,"..").fsPath,n.from!=="env"?{FACTORIO_UPLOAD_API_KEY:n.key}:void 0),await this.ReloadInfo(),t.close()}))}PublishTask(){return new S.CustomExecution(async()=>new Ne(async t=>{let n=await this.keychain.ReadyAPIKey();n&&await ze(t,this.getFMTKCLIPath(),["publish"],S.Uri.joinPath(this.resourceUri,"..").fsPath,n.from!=="env"?{FACTORIO_UPLOAD_API_KEY:n.key}:void 0),await this.ReloadInfo(),t.close()}))}},xr=class{constructor(e,t,n){this.context=e;this.keychain=t;this.gitapi=n;this.modPackages=new Map,S.workspace.findFiles("**/info.json").then(r=>{r.forEach(s=>{this.updateInfoJson(s)})});let i=S.workspace.createFileSystemWatcher("**/info.json");this.subscriptions.push(i.onDidChange(r=>this.updateInfoJson(r))),this.subscriptions.push(i.onDidCreate(r=>this.updateInfoJson(r))),this.subscriptions.push(i.onDidDelete(r=>this.removeInfoJson(r))),this.subscriptions.push(i),n&&this.subscriptions.push(n.onDidOpenRepository(async r=>{for(let s of this.modPackages.values()){let c=n.getRepository(s.resourceUri);r.rootUri.toString()===c?.rootUri?.toString()&&(await s.ReloadInfo(),this.subscriptions.push(r.onDidCommit(async()=>{await s.ReloadInfo()})),this.subscriptions.push(r.onDidCheckout(async()=>{await s.ReloadInfo()})))}})),this.subscriptions.push(S.tasks.registerTaskProvider("factorio",new Rr(this.context,this.modPackages))),this.subscriptions.push(S.commands.registerCommand("factorio.openchangelog",async r=>S.window.showTextDocument(S.Uri.joinPath(r.resourceUri,"../changelog.txt")))),this.subscriptions.push(S.commands.registerCommand("factorio.datestamp",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="datestamp"&&c.definition.modname===r.label);await S.tasks.executeTask(s)})),this.subscriptions.push(S.commands.registerCommand("factorio.package",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="package"&&c.definition.modname===r.label);await S.tasks.executeTask(s)})),this.subscriptions.push(S.commands.registerCommand("factorio.version",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="version"&&c.definition.modname===r.label);await S.tasks.executeTask(s)})),this.subscriptions.push(S.commands.registerCommand("factorio.upload",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="upload"&&c.definition.modname===r.label);await S.tasks.executeTask(s)})),this.subscriptions.push(S.commands.registerCommand("factorio.details",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="details"&&c.definition.modname===r.label);await S.tasks.executeTask(s)})),this.subscriptions.push(S.commands.registerCommand("factorio.publish",async r=>{let s=(await S.tasks.fetchTasks({type:"factorio"})).find(c=>c.definition.command==="publish"&&c.definition.modname===r.label);await S.tasks.executeTask(s)}))}context;keychain;gitapi;_onDidChangeTreeData=new S.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;modPackages;subscriptions=[this._onDidChangeTreeData];dispose(){this.subscriptions.forEach(e=>e.dispose())}async updateInfoJson(e){if(e.scheme==="file"){let n=(await S.workspace.openTextDocument(e)).getText();if(n){let i=JSON.parse(n);if(i&&i.name)if(this.modPackages.has(e.toString()))await this.modPackages.get(e.toString())?.ReloadInfo();else{let r=new Ve(e,i,this.keychain,this.context,s=>{this._onDidChangeTreeData.fire(s)},this.gitapi);this.modPackages.set(e.toString(),r),await r.ReloadInfo()}else this.modPackages.delete(e.toString())}else this.modPackages.delete(e.toString())}else this.modPackages.delete(e.toString());this._onDidChangeTreeData.fire(void 0)}removeInfoJson(e){this.modPackages.delete(e.toString()),this._onDidChangeTreeData.fire(void 0)}getTreeItem(e){return e}async getChildren(e){if(e)if(e instanceof Ve){let t=[];if(this.modPackages){let n=Ve.latestPackages(this.modPackages.values());n.has(e)&&this.modPackages.forEach((i,r)=>{i.label===e.label&&!n.has(i)&&(t.push(i),i.contextValue="older")})}return t.sort(Ve.sort)}else return[];else{let t=[];if(this.modPackages){let n=Ve.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())if(n.has(i)){t.push(i);let r=["latest"];try{await S.workspace.fs.stat(S.Uri.joinPath(i.resourceUri,"../changelog.txt")),r.push("haschangelog")}catch{}i.contextValue=r.join(" "),i.collapsibleState=(()=>{for(let s of this.modPackages.values())if(i.label===s.label&&!n.has(s))return S.TreeItemCollapsibleState.Collapsed;return S.TreeItemCollapsibleState.None})()}}return t.sort(Ve.sort)}}},kr=S.Uri.file(Lt.join(Od(),`vscode-${process.pid}-fmtk-config.json`));async function ze(a,e,t,n,i,r){let s=S.workspace.getConfiguration("factorio");await S.workspace.fs.writeFile(kr,Buffer.from(JSON.stringify(j.convert({docs:await s.get("docs"),package:await s.get("package")}))));let c=Object.assign({},process.env,i,{FMTK_CONFIG:kr.fsPath}),d=process.execArgv;for(let l of s.get("tasks.execArgvOptions",[]))switch(l){case"clear":d=[];break;case"stripjsflags":d=d.filter(g=>!g.match(/^--js-flags/));break;case"stripinspect":d=d.filter(g=>!g.match(/^--inspect/));break}return d=[...d,...s.get("tasks.execArgvExtra",[])],c.Path=Ld(c.Path??""),new Promise((l,g)=>{let h=Md(e,t,{cwd:n,execArgv:d,env:c,stdio:"pipe"});new _r(h.stdout,Buffer.from(`
13
- `)).on("segment",p=>{a.write(p.toString()+`\r
14
- `)}),new _r(h.stderr,Buffer.from(`
15
- `)).on("segment",p=>{p.toString().match(/^Debugger listening/)&&console.log(p.toString()),a.write(p.toString()+`\r
16
- `)}),h.on("error",p=>{a.write(`${p.message}\r
17
- `)}),h.on("exit",(p,y)=>{S.workspace.fs.delete(kr),l(p??-1)}),r&&h.stdin.write(r),h.stdin.end()})}var Ne=class{constructor(e){this.runner=e}runner;writeEmitter=new S.EventEmitter;onDidWrite=this.writeEmitter.event;closeEmitter=new S.EventEmitter;onDidClose=this.closeEmitter.event;tokensource=new S.CancellationTokenSource;open(e){let t=this.writeEmitter,n=this.closeEmitter,i=this.runner({write:r=>t.fire(r.replace(/\r?\n/g,`\r
18
- `)),close:()=>n.fire()},this.tokensource.token);i?i.finally(()=>{n.fire()}):n.fire()}close(){this.tokensource.cancel()}};import*as E from"vscode";import*as Ir from"os";import*as Ea from"path";var Be=E.workspace.fs,Ud=[{name:"Steam",factorioPath:"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Factorio\\bin\\x64\\factorio.exe"},{name:"System",factorioPath:"C:\\Program Files\\Factorio\\bin\\x64\\factorio.exe"},{name:"Steam",factorioPath:"~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents/MacOS/factorio"},{name:"System",factorioPath:"/Applications/factorio.app/Contents/MacOS/factorio"},{name:"Steam",factorioPath:"~/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio"},{name:"Home",factorioPath:"~/.factorio/bin/x64/factorio"}],Fr={name:"Online Latest",onlineDocs:!0},qr={name:"Online Stable",onlineDocs:"stable"},Xn=class{constructor(e,t,n){this.context=e;this.output=t;this.fsprovider=n;this.bar=E.window.createStatusBarItem("factorio-version",E.StatusBarAlignment.Left,10),this.bar.name="Factorio Version Selector",this.bar.text="Factorio (unselected)",this.bar.command="factorio.selectVersion",this.bar.show(),e.subscriptions.push(this.bar),e.subscriptions.push(E.commands.registerCommand("factorio.selectVersion",()=>this.selectVersionCommand())),e.subscriptions.push(E.commands.registerCommand("factorio.checkConfig",()=>this.checkConfigCommand())),e.subscriptions.push(E.commands.registerCommand("factorio.disablePrototypeCache",()=>this.disablePrototypeCacheCommand())),e.subscriptions.push(E.commands.registerCommand("factorio.disableMouseAutoCapture",()=>this.disableMouseAutoCaptureCommand())),this.migrateActiveVersion().then(()=>this.loadActiveVersion())}context;output;fsprovider;bar;async migrateActiveVersion(){if(this.context.workspaceState.get("active_version"))return;let e=E.workspace.getConfiguration("factorio"),t=e.get("versions",[]),n=t.find(i=>i.active);n&&(t.forEach(i=>delete i.active),await this.context.workspaceState.update("active_version",n),await e.update("versions",t))}async loadActiveVersion(){let e=this.context.workspaceState.get("active_version");if(!e)return;let t=await this.tryJsonDocs(e).catch(()=>{});if(!t){await this.context.workspaceState.update("active_version",void 0);return}this.bar.text=`Factorio ${t.application_version} (${e.name})`,this._active_version=new br(E.workspace.fs,e,t,E.workspace.workspaceFolders),this.output.info(`Active Factorio version: ${e.name} (${t.application_version})`),await this.checkDocs()}async checkConfigCommand(){this.output.info("Check Config:"),this.output.show();let e=await this.getActiveVersion();if(!e){this.output.error("No Active Factorio Version");return}this.output.info("Active Factorio Version:"),e.onlineOnly?this.output.info("Online Only"):this.output.info(`Binary: ${await e.getBinaryVersion().catch(f=>f.toString())}`),this.output.info(`Runtime JSON: ${e.docs.application_version}`),e.onlineOnly||(await e.isPrototypeCacheEnabled()&&this.output.warn("Prototype Cache is enabled!"),await e.isMouseAutoCaptureDisabled()&&this.output.info("Mouse Auto Capture is disabled")),this.output.info(`Workspace Trusted: ${E.workspace.isTrusted}`),E.workspace.workspaceFolders?.forEach(f=>this.output.info(`Workspace folder: ${f.uri.toString()}`));let t=this.context.storageUri;if(!t){this.output.error("No Workspace");return}let n=E.workspace.getConfiguration("Lua"),i=E.workspace.getConfiguration("factorio");this.output.info(`execArgv: ${JSON.stringify(process.execArgv)}`),this.output.info(`execArgvOptions: ${JSON.stringify(i.get("tasks.execArgvOptions",[]))}`),this.output.info(`execArgvExtras: ${JSON.stringify(i.get("tasks.execArgvExtras",[]))}`);try{let f=(await Be.readFile(Pe.joinPath(t,"sumneko-3rd/factorio/config.json"))).toString(),v=JSON.parse(f);this.output.info(`Library bundle found in ${t.fsPath}, generated from Factorio ${v.factorioVersion} with FMTK ${v.bundleVersion}`);for(let p of xa())try{(await Be.readFile(Pe.joinPath(t,"sumneko-3rd",p.name))).toString()!==p.content&&this.output.info(`file ${p.name} content mismatch!`)}catch(y){this.output.error(`file ${p.name} ${y}`)}}catch(f){this.output.error(`Missing or damaged library bundle info ${f}`)}let r=E.extensions.getExtension("sumneko.lua");if(!r){this.output.warn("LuaLS (sumneko.lua) not present!");return}this.output.info(`LuaLS ${r.packageJSON.version} ${r.isActive?"Activated":"Not Yet Activated"}`);let s=n.get("workspace.userThirdParty");if(!s)this.output.warn("Lua.workspace.userThirdParty not present!");else{let f=Pe.joinPath(t,"sumneko-3rd").fsPath;s.includes(f)?this.output.info(`Lua.workspace.userThirdParty: workspace link OK (${f})`):this.output.warn(`Lua.workspace.userThirdParty: workspace link missing! (${f})`);let v=s.filter(p=>p!==f);for(let p of v)p.match(/justarandomgeek\.factoriomod\-debug[\\\/]sumneko\-3rd$/)?this.output.warn(`Lua.workspace.userThirdParty: stale workspace link? (${p})`):this.output.info(`Lua.workspace.userThirdParty: other library (${p})`)}let c=n.get("workspace.checkThirdParty"),d=c==="ApplyInMemory";c===!1||c==="Disable"?this.output.warn(`Lua.workspace.checkThirdParty = ${c}`):this.output.info(`Lua.workspace.checkThirdParty = ${c}`);let l=i.get("workspace.manageLibraryDataLinks",!1),g=n.get("workspace.library");if(!g)this.output.warn("Lua.workspace.library not present!");else{let f=[];if(!e.onlineOnly){let C=lt.file(await e.dataPath()).fsPath;f.push(C),g.includes(C)?this.output.info(`Lua.workspace.library: /data link OK (${C})`):l&&this.output.warn(`Lua.workspace.library: /data link missing! (${C})`)}let v=Pe.joinPath(t,"sumneko-3rd/factorio/library").fsPath,p=g.find(C=>lt.file(C).fsPath===v);p?(f.push(p),d?this.output.warn(`Lua.workspace.library: redundant workspace library link (${p})`):this.output.info(`Lua.workspace.library: workspace library link OK (${p})`)):d||this.output.warn(`Lua.workspace.library: workspace library link missing! (${v})`);let y=g.filter(C=>!f.includes(C));for(let C of y)C.match(/justarandomgeek\.factoriomod\-debug[\\\/]sumneko\-3rd[\\\/]factorio[\\\/]library$/)?this.output.warn(`Lua.workspace.library: stale workspace link? (${C})`):C.endsWith("data")?this.output.warn(`Lua.workspace.library: stale data link? (${C})`):this.output.info(`Lua.workspace.library: other library (${C})`)}let h=n.get("runtime.plugin");if(!h)d||this.output.warn("Lua.runtime.plugin not present!");else{let f=Pe.joinPath(t,"sumneko-3rd/factorio/plugin.lua").fsPath.replace(/[\\]/g,"/");h===f?d?this.output.warn(`Lua.runtime.plugin: redundant workspace link (${h})`):this.output.info(`Lua.runtime.plugin: OK (${h})`):this.output.warn(`Lua.runtime.plugin: wrong plugin? (${h})`)}}async disablePrototypeCacheCommand(){let e=await this.getActiveVersion();if(e?.onlineOnly)throw new Error("Select a local Factorio install to edit config");return e?.disablePrototypeCache()}async disableMouseAutoCaptureCommand(){let e=await this.getActiveVersion();if(e?.onlineOnly)throw new Error("Select a local Factorio install to edit config");return e?.disableMouseAutoCapture()}async selectVersionCommand(){if(E.debug.activeDebugSession?.type==="factoriomod"){E.window.showErrorMessage("Cannot select Factorio version while debugging.");return}let e=E.workspace.getConfiguration("factorio"),t=e.get("versions",[]),n=t.map(h=>h.factorioPath),i=(await Promise.all(Ud.filter(h=>!n.includes(h.factorioPath)).map(async h=>{try{return(await Be.stat(lt.file(an(h.factorioPath,E.workspace.workspaceFolders)))).type&E.FileType.File?h:void 0}catch{return}}))).filter(h=>!!h),r=async h=>h.onlineDocs===!0?"latest":h.onlineDocs?h.onlineDocs:(await this.tryJsonDocs(h).catch(()=>{}))?.application_version??"unknown",s=await E.window.showQuickPick([{kind:E.QuickPickItemKind.Separator,label:"settings"},...await Promise.all(t.map(async h=>({fv:h,label:h.name,description:await r(h),detail:h.factorioPath}))),{kind:E.QuickPickItemKind.Separator,label:"autodetected"},...await Promise.all(i.map(async h=>({fv:h,label:h.name,description:await r(h),detail:h.factorioPath}))),{fv:Fr,label:Fr.name,description:await r(Fr)},{fv:qr,label:qr.name,description:await r(qr)},{kind:E.QuickPickItemKind.Separator,label:""},{fv:void 0,label:"Select another install locaton...",picked:!1}],{title:"Select Factorio Version"});if(!s)return;let c=s.fv;if(c?.factorioPath){let h=!1;try{(await Be.stat(lt.file(an(c.factorioPath,E.workspace.workspaceFolders)))).type&E.FileType.File&&(h=!0)}catch{}if(!h)if(await E.window.showErrorMessage("The selected factorio version is no longer present at the specified location","Remove from settings","Cancel")==="Remove from settings"){e.update("versions",t.filter(v=>v!==c));return}else return}let d=!1;if(!c){let h=await E.window.showOpenDialog({canSelectFiles:!0,canSelectFolders:!1,openLabel:"Select Factorio binary",filters:Ir.platform()==="win32"?{"":["exe"]}:void 0});if(!h)return;let f=await E.window.showInputBox({prompt:"Display Name for this version",placeHolder:"Enter a display name to be used in the Version Selector for this version",ignoreFocusOut:!0});if(!f)return;c={name:f,factorioPath:h[0].fsPath},d=!0}let l;try{l=await this.tryJsonDocs(c)}catch(h){if(!c.factorioPath){E.window.showErrorMessage(`Unable to read online docs: ${h}`);return}if(await E.window.showErrorMessage(`Unable to read JSON docs: ${h}`,"Select alternate location","Cancel")!=="Select alternate location")return;let f=await E.window.showOpenDialog({canSelectFiles:!0,canSelectFolders:!1,openLabel:"Select Runtime JSON Docs",title:"Select Runtime JSON Docs",filters:{"JSON Docs":["json"]}});if(!f)return;c.docsPath=Ea.relative(an(c.factorioPath,E.workspace.workspaceFolders),f[0].fsPath);try{l=await this.tryJsonDocs(c)}catch(v){E.window.showErrorMessage(`Unable to read JSON docs: ${v}`);return}}await this.context.workspaceState.update("active_version",c),d&&(t.push(c),e.update("versions",t)),this.bar.text=`Factorio ${l.application_version} (${c.name})`;let g=this._active_version;this._active_version=new br(E.workspace.fs,c,l,E.workspace.workspaceFolders),this.output.info(`Active Factorio version: ${c.name} (${l.application_version})`),await this.generateDocs(g)}_active_version;async getActiveVersion(){return this._active_version||await this.selectVersionCommand(),this._active_version}async tryJsonDocs(e){let t;if(e.onlineDocs){let i=`https://lua-api.factorio.com/${e.onlineDocs===!0||e.onlineDocs==="throw"?"latest":e.onlineDocs}/runtime-api.json`,r=await fetch(i);if(!r.ok)throw new Error(`Error fetching ${i} : ${r.statusText}`);t=await r.text()}else{if(!e.factorioPath)throw new Error(`Invalid Config: requires at least one of factorioPath or onlineDocs in ${e.name}`);let n=Pe.joinPath(lt.file(an(e.factorioPath,E.workspace.workspaceFolders)),e.docsPath?e.docsPath:Ir.platform()==="darwin"?"../../doc-html/runtime-api.json":"../../../doc-html/runtime-api.json");t=(await Be.readFile(n)).toString()}return new Ra(t)}async checkDocs(){let e=await this.getActiveVersion();if(!e)return;let t=this.context.storageUri;if(t)try{let n=(await Be.readFile(Pe.joinPath(t,"sumneko-3rd/factorio/config.json"))).toString(),i=JSON.parse(n);if(i.factorioVersion!==e.docs.application_version||i.bundleVersion!==Qn)return this.generateDocs()}catch{return this.generateDocs()}}async generateDocs(e){if(!E.workspace.getConfiguration("factorio").get("docs.generateDocs",!0))return;let t=await this.getActiveVersion();if(!t)return;let n=this.context.storageUri;if(!n){E.window.showErrorMessage("Unable to generate docs: no open workspace");return}let i=Pe.joinPath(n,"sumneko-3rd");await Be.createDirectory(i);try{await Promise.allSettled([Be.delete(Pe.joinPath(i,"factorio","library"),{recursive:!0}),Be.delete(Pe.joinPath(i,"factorio","factorio-plugin"),{recursive:!0})])}catch{}let r=this.output,s=await ze({close(){},write(y){r.info(`docgen: ${y.trimEnd()}`)}},this.context.asAbsolutePath("./dist/fmtk-cli.js"),await t.docArgs(E.workspace.getConfiguration("factorio").get("docs.usePrototypeDumps",!1)),i.fsPath);if(s!==0){this.output.warn(`docgen return code ${s}`),await E.window.showErrorMessage("Error while generating docs","Show Output")==="Show Output"&&this.output.show();return}let c=E.workspace.getConfiguration("Lua"),d=c.get("workspace.library",[]),l=(y,...C)=>{if(y){let b=Pe.joinPath(y,...C),T=d.indexOf(b.fsPath);T!==-1&&d.splice(T,1)}},g=async(y,...C)=>{try{let b=Pe.joinPath(y,...C);!d.includes(b.fsPath)&&(await Be.stat(b)).type&E.FileType.Directory&&d.push(b.fsPath)}catch{}},h=E.workspace.getConfiguration("factorio");if(e&&!e.onlineOnly){let y=lt.file(await e.dataPath());l(y)}if(d.length===0?await c.update("workspace.library",void 0):await c.update("workspace.library",d),h.get("workspace.manageLibraryDataLinks",!1)){let y=lt.file(await t.dataPath());await g(y)}d.length===0?await c.update("workspace.library",void 0):await c.update("workspace.library",d);let f=c.get("workspace.userThirdParty",[]);f=f.filter(y=>!y.includes("justarandomgeek.factoriomod-debug")),await c.update("workspace.userThirdParty",f),f.push(i.fsPath),await c.update("workspace.userThirdParty",f);let v=c.get("workspace.checkThirdParty");v&&["Ask","Apply","ApplyInMemory"].includes(v)||await c.update("workspace.checkThirdParty","ApplyInMemory");let p=E.extensions.getExtension("sumneko.lua");p&&(p.isActive||await p.activate())}};import*as pt from"path";import*as ee from"vscode";var ei=class{type;ctime;mtime;size;name;data;constructor(e){this.type=ee.FileType.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}},Dt=class{type;ctime;mtime;size;name;entries;constructor(e){this.type=ee.FileType.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}},ti=class{root=new Dt("");stat(e){return this._lookup(e,!1)}readDirectory(e){let t=this._lookupAsDirectory(e,!1),n=[];for(let[i,r]of t.entries)n.push([i,r.type]);return n}readFile(e){let t=this._lookupAsFile(e,!1).data;if(t)return t;throw ee.FileSystemError.FileNotFound()}writeFile(e,t,n){let i=pt.posix.basename(e.path),r=this._lookupParentDirectory(e),s=r.entries.get(i);if(s instanceof Dt)throw ee.FileSystemError.FileIsADirectory(e);if(!s&&!n.create)throw ee.FileSystemError.FileNotFound(e);if(s&&n.create&&!n.overwrite)throw ee.FileSystemError.FileExists(e);s||(s=new ei(i),r.entries.set(i,s),this._fireSoon({type:ee.FileChangeType.Created,uri:e})),s.mtime=Date.now(),s.size=t.byteLength,s.data=t,this._fireSoon({type:ee.FileChangeType.Changed,uri:e})}rename(e,t,n){if(!n.overwrite&&this._lookup(t,!0))throw ee.FileSystemError.FileExists(t);let i=this._lookup(e,!1),r=this._lookupParentDirectory(e),s=this._lookupParentDirectory(t),c=pt.posix.basename(t.path);r.entries.delete(i.name),i.name=c,s.entries.set(c,i),this._fireSoon({type:ee.FileChangeType.Deleted,uri:e},{type:ee.FileChangeType.Created,uri:t})}delete(e,t){let n=e.with({path:pt.posix.dirname(e.path)}),i=pt.posix.basename(e.path),r=this._lookupAsDirectory(n,t?.silent??!1);if(!r||!r.entries.has(i)){if(t?.silent)return;throw ee.FileSystemError.FileNotFound(e)}r.entries.delete(i),r.mtime=Date.now(),r.size-=1,this._fireSoon({type:ee.FileChangeType.Changed,uri:n},{uri:e,type:ee.FileChangeType.Deleted})}createDirectory(e){let t=pt.posix.basename(e.path),n=e.with({path:pt.posix.dirname(e.path)}),i=this._lookupAsDirectory(n,!1),r=new Dt(t);i.entries.set(r.name,r),i.mtime=Date.now(),i.size+=1,this._fireSoon({type:ee.FileChangeType.Changed,uri:n},{type:ee.FileChangeType.Created,uri:e})}_lookup(e,t){let n=e.path.split("/"),i=this.root;for(let r of n){if(!r)continue;let s;if(i instanceof Dt&&(s=i.entries.get(r)),!s){if(t)return;throw ee.FileSystemError.FileNotFound(e)}i=s}return i}_lookupAsDirectory(e,t){let n=this._lookup(e,t);if(n instanceof Dt)return n;throw ee.FileSystemError.FileNotADirectory(e)}_lookupAsFile(e,t){let n=this._lookup(e,t);if(n instanceof ei)return n;throw ee.FileSystemError.FileIsADirectory(e)}_lookupParentDirectory(e){let t=e.with({path:pt.posix.dirname(e.path)});return this._lookupAsDirectory(t,!1)}_emitter=new ee.EventEmitter;_bufferedEvents=[];_fireSoonHandle;onDidChangeFile=this._emitter.event;watch(e){return new ee.Disposable(()=>{})}_fireSoon(...e){this._bufferedEvents.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._emitter.fire(this._bufferedEvents),this._bufferedEvents.length=0},5)}};import*as La from"vscode";import*as A from"vscode";import{assert as Oa}from"console";var Ma=sn(Sr()),Aa=(0,Ma.decompressFromBase64)("DwQgIg8gwgKgmgBQKIAIAWAXAtgGwHwCwAUMJrijgIYB2A5gLwBEAptY4SWs5QCYcCQwHAEtqAaxQAnZjiYBnDAE8czOV2YZGKJQAdmTDMwAeGAPQBjOXK1ppAMyYASAGJUszWpMo60AOktyjuzEwKZcvBzAAEYA9jyKAsA8wgBuKMI8TOZolJKaeKHJKYly5pLCOhjainpMWHEAripacpLmTq6U7p7efgBWgeyhpeWVkaax8eNk+EA=");function Ut(a,e){return isNaN(a)?e:isNaN(e)?a:Math.max(a,e)}var Nt=class a{constructor(e=0,t=0){this.timer=e;this.count=t}timer;count;add(e){return e?new a(this.timer+e.timer,this.count+e.count):this}avg(){return this.timer/this.count}},ni=class{functions=new Map;lines=new Map;add(e){e.functions.forEach((t,n)=>{this.functions.set(n,t.add(this.functions.get(n)))}),e.lines.forEach((t,n)=>{this.lines.set(n,t.add(this.lines.get(n)))})}max(){let e={func:{timer:0,count:0,average:0},line:{timer:0,count:0,average:0}};return this.functions.forEach(t=>{e.func.timer=Ut(e.func.timer,t.timer),e.func.count=Ut(e.func.count,t.count),e.func.average=Ut(e.func.average,t.avg())}),this.lines.forEach(t=>{e.line.timer=Ut(e.line.timer,t.timer),e.line.count=Ut(e.line.count,t.count),e.line.average=Ut(e.line.average,t.avg())}),e}},Er=class{totalTime=0;file=new Map},ii=class a{constructor(e,t,n,i){this.name=e;this.value=t;this.filename=n;this.line=i}name;value;filename;line;children=[];ToStringInner(e){return`${e}${this.name} : ${this.value}
19
- ${this.children.map(t=>t.ToStringInner(e+" ")).join(`
20
- `)}`}ToString(){return this.ToStringInner("")}AddToChild(e,t,n,i){let r=this.children.find(s=>s.name===e);return r?r.value+=t:(r=new a(e,t,n,i),this.children.push(r)),r}Merge(e){this.value+=e.value,e.children.forEach(t=>{let n=this.children.find(i=>i.name===t.name);n?n.Merge(t):this.children.push(t)})}},Mr=class{totalTime=0;mod=new Map;getMod(e){let t=this.mod.get(e);return t||(t=new Er,this.mod.set(e,t)),t}getFile(e,t){let n=this.getMod(e),i=n.file.get(t);return i||(i=new ni,n.file.set(t,i)),i}AddModTime(e,t){this.totalTime+=t,this.getMod(e).totalTime+=t}AddLineTime(e,t,n,i,r){let s=this.getFile(e,t),c=new Nt(i,r),d=s.lines.get(n);s.lines.set(n,c.add(d))}AddFuncTime(e,t,n,i,r){let s=this.getFile(e,t),c=new Nt(i,r),d=s.functions.get(n);s.functions.set(n,c.add(d))}Report(e){let t=new ni;return this.mod.forEach(n=>{let i=n.file.get(e);i&&t.add(i)}),{totalTime:this.totalTime,fileData:t}}},ri=class{constructor(e,t,n){this.context=t;this.debug=n;this._disposables.push(A.debug.onDidReceiveDebugSessionCustomEvent(r=>this.onCustomEvent(r),this)),this._disposables.push(A.debug.onDidTerminateDebugSession(r=>this.onTerminate(r),this)),this.timeDecorationType=A.window.createTextEditorDecorationType({before:{contentText:"",color:new A.ThemeColor("factorio.ProfileTimerForeground")}}),this.funcDecorationType=A.window.createTextEditorDecorationType({after:{contentText:"",color:new A.ThemeColor("factorio.ProfileFunctionTimerForeground"),borderColor:new A.ThemeColor("factorio.ProfileFunctionTimerForeground"),border:"1px solid",margin:"0 0 0 3ch"}});let i=A.workspace.getConfiguration().get("factorio.profile.rulers",[]);this.rulerDecorationTypes=i.filter(r=>r.color||r.themeColor).map(r=>{let s=A.OverviewRulerLane.Right;switch(r.lane){case"Right":s=A.OverviewRulerLane.Right;break;case"Center":s=A.OverviewRulerLane.Center;break;case"Left":s=A.OverviewRulerLane.Left;break;case"Full":s=A.OverviewRulerLane.Full;break;default:break}return{type:A.window.createTextEditorDecorationType({overviewRulerColor:r.color??new A.ThemeColor(r.themeColor),overviewRulerLane:s}),threshold:r.threshold}}),this.statusBar=A.window.createStatusBarItem(),this._disposables.push(A.window.onDidChangeActiveTextEditor(r=>{r&&r.document.uri.scheme==="file"&&this.render(r)})),e&&this.createFlamePanel()}context;debug;profileData=new Mr;profileTreeRoot=new ii("root",0);profileOverhead=new Nt(0,0);timeDecorationType;funcDecorationType;rulerDecorationTypes;statusBar;flamePanel;_disposables=[];onTerminate(e){e===this.debug&&this.dispose()}dispose(){this._disposables.forEach(e=>e.dispose()),this.timeDecorationType.dispose(),this.funcDecorationType.dispose(),this.rulerDecorationTypes.forEach(e=>{e.type.dispose()}),this.statusBar.dispose(),this.flamePanel&&this.flamePanel.dispose()}async onCustomEvent(e){if(e.session===this.debug&&e.event==="x-Factorio-Profile"){await this.parse(e.body);let t=A.window.activeTextEditor;t&&t.document.uri.scheme==="file"&&this.render(t)}}createFlamePanel(){if(this.flamePanel)return;this.flamePanel=A.window.createWebviewPanel("factorioProfile","Factorio Profile",A.ViewColumn.Two,{enableScripts:!0,localResourceRoots:[this.context.extensionUri]});let e=this.flamePanel.webview;e.html=Aa.replace("$Flamegraph.css$",e.asWebviewUri(A.Uri.joinPath(this.context.extensionUri,"/dist/Flamegraph.css")).toString()).replace("$Flamegraph.js$",e.asWebviewUri(A.Uri.joinPath(this.context.extensionUri,"/dist/Flamegraph.js")).toString()),e.onDidReceiveMessage(t=>{switch(t.command){case"init":e.postMessage({command:"update",data:this.profileTreeRoot});break;case"click":t.line&&t.line>0&&t.filename&&t.line&&A.window.showTextDocument(A.Uri.parse(t.filename),{selection:new A.Range(t.line,0,t.line,0),viewColumn:A.ViewColumn.One});break;default:break}}),this.flamePanel.onDidDispose(()=>this.flamePanel=void 0)}async parse(e){let t=e.split(`
21
- `),n,i,r=[new ii("root",0)],s;for(let c of t){let d=c.split(":");switch(d[0]){case"PROFILE":break;case"PMN":{n=d[1].replace(/[\r\n]*/g,"");let l=parseFloat(d[3]);this.profileData.AddModTime(n,l)}break;case"PFN":n&&(i=await this.debug.customRequest("x-Factorio-ConvertPath",{path:d[1].replace(/[\r\n]*/g,"")}));break;case"PLN":if(n&&i){let l=parseInt(d[1]),g=parseFloat(d[3]),h=parseInt(d[4]);this.profileData.AddLineTime(n,i,l,g,h)}break;case"PFT":if(n&&i){let l=parseInt(d[1]),g=parseFloat(d[3]),h=parseInt(d[4]);this.profileData.AddFuncTime(n,i,l,g,h)}break;case"POV":{let l=parseFloat(d[2]);this.profileOverhead=this.profileOverhead.add(new Nt(l,1))}break;case"PROOT":n&&(Oa(r.length===1),s=r[0].AddToChild(n,0));break;case"PTREE":if(s){let l=d[1],g=await this.debug.customRequest("x-Factorio-ConvertPath",{path:d[2]}),h=d[3],f=l+":"+g+":"+h,v=parseFloat(d[5]);r.push(s),s=s.AddToChild(f,v,g,parseInt(h))}break;case"PTEND":s&&(r.length===1?s=void 0:s=r.pop());break}}Oa(r.length===1),this.flamePanel&&this.flamePanel.visible&&this.flamePanel.webview.postMessage({command:"merge",data:r[0]}),this.profileTreeRoot.Merge(r[0])}render(e){let t=this.profileData.Report(e.document.uri.fsPath),n=t.fileData.max(),i=n.line.timer,r=n.line.average,s=n.line.count,c=new Array,d=new Array,l=this.rulerDecorationTypes.map((V,X)=>({type:V.type,threshold:V.threshold,decs:new Array})),g=A.workspace.getConfiguration().get("factorio.profile.displayAverageTime"),h=A.workspace.getConfiguration().get("factorio.profile.colorBy","totaltime"),f=A.workspace.getConfiguration().get("factorio.profile.timerHighlightColor"),v={count:s,totaltime:i,averagetime:r}[h],p=Math.max(Number.MIN_VALUE,A.workspace.getConfiguration().get("factorio.profile.colorScaleFactor",1)),y={boost:V=>Math.log1p(V*p)/Math.log1p(v*p),linear:V=>V/v,mute:V=>(Math.pow(1+v,V*p/v)-1)/(v*p)}[A.workspace.getConfiguration().get("factorio.profile.colorScaleMode","boost")],C=s.toFixed(0).length+1,b=g?6:3,T=i.toFixed(b).length+1,P=C+T+3,q=t.fileData.lines.size>0,ce=t.fileData.functions.size>0;for(let V=1;V<=e.document.lineCount;V++){if(q){let X=t.fileData.lines.get(V);if(X){let Je=X.timer,rt=X.count,Qe=g?X.avg():Je,st=y({count:rt,totaltime:Je,averagetime:X.avg()}[h]),It=e.document.validateRange(new A.Range(V-1,0,V-1,1/0));c.push({range:It,hoverMessage:g?`total: ${Je}`:`avg: ${X.avg()}`,renderOptions:{before:{backgroundColor:`${f}${Math.floor(255*st).toString(16)}`,contentText:`${rt.toFixed(0).padStart(C,"\xA0")}${Qe.toFixed(b).padStart(T,"\xA0")}\xA0ms`,width:`${P+1}ch`}}});let Et=l.find(ot=>st>=ot.threshold);Et&&Et.decs.push({range:It})}else c.push({range:e.document.validateRange(new A.Range(V-1,0,V-1,1/0)),renderOptions:{before:{width:`${P+1}ch`}}})}if(ce){let X=t.fileData.functions.get(V);if(X){let Je=X.timer,rt=X.count,Qe=g?X.avg():Je,st=e.document.validateRange(new A.Range(V-1,0,V-1,1/0));d.push({range:st,renderOptions:{after:{contentText:`\xA0${rt.toFixed(0)}\xA0|\xA0${Qe.toFixed(b)}\xA0ms\xA0`,color:new A.ThemeColor("factorio.ProfileFunctionTimerForeground"),borderColor:new A.ThemeColor("factorio.ProfileFunctionTimerForeground"),margin:"0 0 0 3ch"}}})}}}e.setDecorations(this.timeDecorationType,c),e.setDecorations(this.funcDecorationType,d),l.forEach(V=>{e.setDecorations(V.type,V.decs)}),this.statusBar.text=`Profile Dump Avg ${this.profileOverhead.avg().toFixed(3)} ms`,this.statusBar.show()}clear(){A.window.visibleTextEditors.forEach(e=>{e.setDecorations(this.timeDecorationType,[]),e.setDecorations(this.funcDecorationType,[]),this.rulerDecorationTypes.forEach(t=>{e.setDecorations(t.type,[])})}),this.statusBar.hide()}};var si=class{constructor(e){this.context=e;e.subscriptions.push(La.debug.onDidStartDebugSession(t=>this.onDidStartDebugSession(t),this))}context;onDidStartDebugSession(e){e.type==="factoriomod"&&e.configuration.hookMode==="profile"&&new ri(e.configuration.profileTree??!0,this.context,e)}};var qn=sn(pd(),1);import*as hd from"path";import{workspace as fd}from"vscode";function gd(a){let e=a.asAbsolutePath(hd.join("dist","fmtk-cli.js")),t={execArgv:["--nolazy","--inspect-brk=34199"]},n={run:{module:e,transport:qn.TransportKind.ipc,args:["lsp"]},debug:{module:e,transport:qn.TransportKind.ipc,args:["lsp"],options:t}},i={documentSelector:[{language:"factorio-locale"},{language:"factorio-changelog"},{language:"lua"}],synchronize:{fileEvents:[fd.createFileSystemWatcher("**/locale/*/*.cfg"),fd.createFileSystemWatcher("**/changelog.txt")]}},r=new qn.LanguageClient("factorioLanguageServer","Factorio Language Server",n,i);r.start(),a.subscriptions.push({dispose(){return r.stop()}})}import*as ve from"vscode";function md(a){return a.type==="int"?{type:"int",value:lp("",a.value)}:a}function ya(a,e){return typeof e=="bigint"?`jsonbigint ${e}n`:e}function lp(a,e){if(typeof e=="string"){let t=e.match(/^jsonbigint\x01\x02 (\d+)n$/);if(t)return BigInt(t[1])}return e}function er(){let a="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<32;t++)a+=e.charAt(Math.floor(Math.random()*e.length));return a}var vd=sn(Sr()),yd=(0,vd.decompressFromBase64)("DwQgIg8gwgKgmgBQKIAIAWAXAtgGwHwCwAUMJrijgIYB2A5gLwBEAptY4SWs5QCYcCQwLMwyUUAYzSUATgGcRTAKowAYgFoAHO2KCQatTsXyUY8QHtqGVhhTzxAV2kBLDAE8UABzM4n49xjMUCxx3ShwcMwB3CjNeJzoUJyxKWmZZFAAzaTMsdAwMD3SzaUzs3LNHFGYADytqWScLFB4naWZxAOlXABodGh4g6hCTcKjbcWcPDHSMKRspADdmE1sPdqcM3xRqC3FmADodfQEhETFMArVmAEd7JwWmKAs6jDUAZXbHF1c1BG9fVyMCTPaxMHjMDKUew4V6yaTiFAAch21GYiIA3IksLQ1HCEQAScSyDxvCrw5j4zGyNw4Zi4+EoQnE0mOPaUzLPekEokkslsqkTJxTLlIlF7NT4sUUjHaIiCYSibaUYRMBZOZiRLzSDBA8yWUGMSJOHizejgtXio0mtDdRLUFxOMK48RhZj0ACM+wADLLBD5qABrdBtDJMfEAWTMPA++XitFkAHVmAAjNUa/ZE2T4oFtHBMamuWmyLgiIEAehOGBctLwkYGMardFkwDLVYwNeILa4vA4wGTUdcJzsVYsAkEaHdeAAasw5I1qF3JzpBC0FokeKrZw0LOwW6uTmXh/OODpgAtZOZwWoPDRmDh0jJHWoqMm70wG3HZL7BOfL3Sb6iOBqKIybrkwIFqO67BvKI2r2B4La/lG/63kBIFjmeF7IdeqHAZQoHGuB+FqAATOwABK9iWEkywAOIRMmYSIVhV4AXeeHJhhSGsbhIFgYwEEAMwUVRVbCCgCCzigRizsxf44YBHFcSxKGKWm0SEYw6mQd+gggR2cr8EZwAYP2PDuJp1IyBg8G7q2ZmDsugitvhBnGWW3Gqex6nKfJbFAep/HaWRY56a5zChXpDn8dIok0WotAMWEdmmQOoUtvpEXLnJ2H+WoPnZZ5CneeqGkblppVqMJ6WZZFJnRZpsXUcI16zmo9jyNIKUOelLnJm5zlFXlBVyjlPGAbIJ6jVYWAeFQVj8fIsZ0LiGDOHQ34mdINUDOIVCyLI+YiI2OLUMqzApXwTkmVdhnGUVVi1Gomx3rt+2HYwS0nflYT2BdeBjXSj2vC9OC3UZzkYODxlQxI71HctOJ6mt3hfnVRXJvY+RNHtlAHQj33grSVhApQHhrDINB7Ewvg7iYziUM++FvowYB3iI/1OcZxI0HDeMfZetPUMCLR6sB0h42gdk89QdUeSpaiY9jsvXa20MZdtp6tsws3zVlRCnjNc2UAtlnHXGajUPYWCvl1GFrTtfP4595srWdwiXTt6MK8Dz3qmDTsfV9FsLL9F0oG4axMFbNuznZD01CD/vQ5DKc3YHBMW8j2T3rpP4K0rATC7jzvBytRMc6T5PcBL1DU4wQukwzTOvnmrPsyTkWCDLGeMILeoi0L4uS9LAFyxjWNF71UMYa2mujdrusm/rhs68bpvlWXOL9t4m0O9dsMl0HrunednsHyn+fyZI7QBv21S91vP04H98cKzf4h32Y1TT2nh/wy7RGahs6ozzpheShccYAKfhXEmJhq6Uzrm6Bueom5PhfCzNmxNOZ3W5gBXu/ccZRiHmtEeANDxjy5oDRWk9RyqxntlOeB4jZ6ymnpNeetFon2Ad4Yoe954Q3TkfTObsz7kIYXdG6dUMH4CeBEaQAAuFsMi6rxA8FjCOrgo5914V1R+3DQ4v2WE/cw8jn6vwrFQlRABBHAHgpBKLLCoqhCcnqgzevzEROJDF/VsNwxmPjw6R2QTHW2b95K+3cb/R2wjAHfRAbnb2EDaHF2gdw2B4cyYU1rvXRu9N0HMzblgyuXdgA91iYQ4uxCxakOLKPGg48C4pOiYw/eC8WHLzYSZDhy8uFAN4DwfhXsXE+0Tn7V6+j+k8B4JbMR1DInJxaZIiREMr7YR4NkDwPAoipM8XEi2AzgJaJwastZV4zBTGPNSdatBqEXJHCrXBZy6T3OPDvHAdzLl0KeeA7CrzRyhNkvLeS/zHmnN+ecr5ws0DGnBLLeIGBPkPNKUVUFeBTHFCRceKhwL1mbO2ZEMF7kVkww8aXbhCS0YjOScrSZ30BnJgwGweB2SqbILyY+RmMimDWOmXnbu+CKnVKIaLCwagBn1KJe5CeyslnEoERlHpVgukXkmDYYJTAsBRmhOHKUYYpTZlsPCMMdYPxNiTKmUq+wABWWYgTggyLOCsLZVVCgwL2MsPVOxljIPgIAA===");var tr=class{constructor(e){this.context=e;this.context.subscriptions.push(ve.window.registerCustomEditorProvider("fmtk.modsettings",this,{supportsMultipleEditorsPerDocument:!1,webviewOptions:{retainContextWhenHidden:!0}}))}context;webviews=new Map;_onDidChangeCustomDocument=new ve.EventEmitter;onDidChangeCustomDocument=this._onDidChangeCustomDocument.event;async saveCustomDocument(e,t){return e.save(t)}async saveCustomDocumentAs(e,t,n){return e.saveAs(t,n)}async revertCustomDocument(e,t){return e.revert(t)}async backupCustomDocument(e,t,n){return e.backup(t.destination,n)}async openCustomDocument(e,t,n){let i=await Ca.create(e,t.backupId),r=[];return r.push(i.onDidChange(s=>{this._onDidChangeCustomDocument.fire({document:i,...s})})),r.push(i.onDidChangeContent(s=>{let c=this.webviews.get(i.uri.toString());c&&this.postMessage(c,"init",{version:i.version,saves_ints:i.saves_ints,settings:JSON.stringify(i.settings,ya),editable:ve.workspace.fs.isWritableFileSystem(i.uri.scheme)!==!1})})),i.onDidDispose(()=>r.forEach(s=>s.dispose())),i}resolveCustomEditor(e,t,n){let i=t.webview;this.webviews.set(e.uri.toString(),t),i.options={enableScripts:!0},i.html=yd.replace(/\$cspSource\$/g,i.cspSource).replace(/\$nonce\$/g,er()).replace(/\$ModSettingsWebview\.css\$/g,i.asWebviewUri(ve.Uri.joinPath(this.context.extensionUri,"/dist/ModSettingsWebview.css")).toString()).replace(/\$ModSettingsWebview\.js\$/g,i.asWebviewUri(ve.Uri.joinPath(this.context.extensionUri,"/dist/ModSettingsWebview.js")).toString()),t.webview.onDidReceiveMessage(r=>this.onMessage(e,r)),t.webview.onDidReceiveMessage(r=>{r.type==="ready"&&this.postMessage(t,"init",{version:e.version,saves_ints:e.saves_ints,settings:JSON.stringify(e.settings,ya),editable:ve.workspace.fs.isWritableFileSystem(e.uri.scheme)!==!1})})}postMessage(e,t,n){e.webview.postMessage({type:t,body:n})}onMessage(e,t){if(t.type==="edit"){e.edit(t.body);return}}},Ca=class a{constructor(e,t){this.uri=e;this._settings=new wr(new on(t))}uri;static async create(e,t){let n=typeof t=="string"?ve.Uri.parse(t):e,i=await ve.workspace.fs.readFile(n);return new a(e,i)}_settings;get version(){return this._settings.version.format()}get saves_ints(){return this._settings.version.isBeyond(1,2)}get settings(){return this._settings.settings}async save(e){return this.saveAs(this.uri,e)}async saveAs(e,t){return ve.workspace.fs.writeFile(e,this._settings.save())}async revert(e){this._settings=new wr(new on(await ve.workspace.fs.readFile(this.uri))),this._onDidChangeDocument.fire({})}async backup(e,t){return await this.saveAs(e,t),{id:e.toString(),delete:()=>{ve.workspace.fs.delete(e)}}}edit(e){e.value.type==="none"?this._settings.set(e.scope,e.name,void 0):this._settings.set(e.scope,e.name,md(e.value)),this._onDidChange.fire({})}_onDidDispose=new ve.EventEmitter;onDidDispose=this._onDidDispose.event;_onDidChangeDocument=new ve.EventEmitter;onDidChangeContent=this._onDidChangeDocument.event;_onDidChange=new ve.EventEmitter;onDidChange=this._onDidChange.event;disposables=[this._onDidDispose,this._onDidChangeDocument,this._onDidChange];dispose(){this._onDidDispose.fire(),this.disposables.forEach(e=>e.dispose())}};import*as qt from"vscode";function In(a){switch(a.type){case"Table":case"TableWithMeta":return Object.assign({},a,{values:void 0,values_count:a.values.length});default:return a}}var Cd=sn(Sr()),wd=(0,Cd.decompressFromBase64)("DwQgIg8gwgKgmgBQKIAIAWAXAtgGwHwCwAUMJrijgIYB2A5gLwBEAptY4SWs5QCYcCQwLMwyUUAYzSUATgGcRTAKowAYgFoAHO2KCQatTsXyUY8QHtqGVhhTzxAV2kBLDAE8UABzM4n49xjMUCxx3ShwcMwB3CjNeJzoUJyxKWmZZFAAzaTMsdAwMD3SzaUzs3LNHFGYADytqWScLFB4naWZxAOlXABodGh4g6hCTcKjbcWcPDHSMKRspADdmE1sPdqcM3xRqC3FmADodfQEhETFMArVmAEd7JwWmKAs6jDUAZXbHF1c1BG9fVyMCTPaxMHjMDKUew4V6yaTiFAAch21GYiIA3IksLQ1HCEQAScSyDxvCrw5j4zGyNw4Zi4+EoQnE0mOPaUzLPekEokkslsqkTJxTLlIlF7NT4sUUjHaIiCYSibaUYRMBZOZiRLzSDBA8yWUGMSJOHizejgtXio0mtDdRLUFxOMK48RhZj0ACM+wADLLBD5qABrdBtDJMfFvQVTMCUDAAdWYACM1Rr9kTZPigW0cExqa5abIuCIgQB6E4YFy0vARyYYfbRjDAYvljCV4iNri8DjABNmHiuE52csWASCNDuvAANWYcka1Hb450ghaC0SPFV04aFnYjeXJ2Lg9nHB0wAPw8XpHH9co85HwGXq6Y2TMOtvxd3x/37SH1CPcpPkZsNw1iYLBe2hZggSlMMpQzWx4TDashQwet4yTdVIn2AArdMgXBDJp1LRtZAArtix7PtSLIfAgA===");import*as Ct from"vscode";var nr=class a{constructor(e,t){this.uri=e;this._data=new qa(new on(t))}uri;static async create(e,t){let n=typeof t=="string"?Ct.Uri.parse(t):e,i=await Ct.workspace.fs.readFile(n);return new a(e,i)}_data;get version(){return this._data.version.format()}get rootdata(){let e={};for(let t in this._data.data)e[t]=In(this._data.data[t]);return e}find(e,t){return this._data.find(e,t)}_onDidDispose=new Ct.EventEmitter;onDidDispose=this._onDidDispose.event;_onDidChangeDocument=new Ct.EventEmitter;onDidChangeContent=this._onDidChangeDocument.event;_onDidChange=new Ct.EventEmitter;onDidChange=this._onDidChange.event;disposables=[this._onDidDispose,this._onDidChangeDocument,this._onDidChange];dispose(){this._onDidDispose.fire(),this.disposables.forEach(e=>e.dispose())}};var ir=class{constructor(e){this.context=e;this.context.subscriptions.push(qt.window.registerCustomEditorProvider("fmtk.scriptdat",this,{supportsMultipleEditorsPerDocument:!1,webviewOptions:{retainContextWhenHidden:!0}}))}context;webviews=new Map;_onDidChangeCustomDocument=new qt.EventEmitter;onDidChangeCustomDocument=this._onDidChangeCustomDocument.event;async openCustomDocument(e,t,n){let i=await nr.create(e,t.backupId),r=[];return r.push(i.onDidChange(s=>{this._onDidChangeCustomDocument.fire({document:i,...s})})),r.push(i.onDidChangeContent(s=>{let c=this.webviews.get(i.uri.toString());c&&this.postMessage(c,"init",{version:i.version,data:i.rootdata})})),i.onDidDispose(()=>r.forEach(s=>s.dispose())),i}resolveCustomEditor(e,t,n){let i=t.webview;this.webviews.set(e.uri.toString(),t),i.options={enableScripts:!0},i.html=wd.replace(/\$cspSource\$/g,i.cspSource).replace(/\$nonce\$/g,er()).replace(/\$ScriptDatWebview\.css\$/g,i.asWebviewUri(qt.Uri.joinPath(this.context.extensionUri,"/dist/ScriptDatWebview.css")).toString()).replace(/\$ScriptDatWebview\.js\$/g,i.asWebviewUri(qt.Uri.joinPath(this.context.extensionUri,"/dist/ScriptDatWebview.js")).toString()),t.webview.onDidReceiveMessage(r=>this.onMessage(e,r)),t.webview.onDidReceiveMessage(r=>{r.type==="ready"&&this.postMessage(t,"init",{version:e.version,data:e.rootdata})})}postMessage(e,t,n){e.webview.postMessage({type:t,body:n})}onMessage(e,t){if(t.type==="fetch"){let n=t.body,i=e.find(n.modname,n.gcid),r;n.index!==void 0&&n.count!==void 0?r=i.values.slice(n.index,n.index+n.count):r=i.values,this.postMessage(this.webviews.get(e.uri.toString()),"values",{...n,values:r.map(s=>({key:In(s.key),value:In(s.value)}))})}}};async function ph(a){let e=ue.window.createOutputChannel("FMTK",{log:!0});e.info(`FMTK ${Qn}`);try{e.info("Registering FS Provider...");let t=new ti;a.subscriptions.push(ue.workspace.registerFileSystemProvider("fmtk",t,{isCaseSensitive:!0})),e.info("Registering Version Selector...");let n=new Xn(a,e,t);e.info("Registering Debug Provider...");let i=new wa(n);a.subscriptions.push(ue.debug.registerDebugConfigurationProvider("factoriomod",i));let r=new Da(n);a.subscriptions.push(ue.debug.registerDebugAdapterDescriptorFactory("factoriomod",r)),a.subscriptions.push(r),e.info("Registering Language Client..."),gd(a),e.info("Registering Mod Package Provider..."),await Ia(a),e.info("Registering Profile Renderer..."),new si(a),e.info("Registering Custom Editors..."),new tr(a),new ir(a),e.info("Activate Complete")}catch(t){e.error(`Error while activating: ${t}`)}}var wa=class{constructor(e){this.versionSelector=e}versionSelector;async resolveDebugConfigurationWithSubstitutedVariables(e,t,n){let i=await this.versionSelector.getActiveVersion();if(!i)return;if(await i.isPrototypeCacheEnabled()){let s=await ue.window.showWarningMessage("Prototype Caching is enabled, which usually conflicts with the final portion of debugger initialization (which occurs in settings stage).",{modal:!0},"Disable in config.ini","Continue anyway");if(s==="Disable in config.ini")await i.disablePrototypeCache();else if(s===void 0)return}let r=ue.workspace.getConfiguration("factorio.debug").get("env",{});return Object.keys(r).length>0&&(t.env=Object.assign({},r,t.env)),t}},Da=class{constructor(e){this.versionSelector=e}versionSelector;async createDebugAdapterDescriptor(e,t){let n=await this.versionSelector.getActiveVersion();if(!n)return;if(n.onlineOnly)throw new Error("Select a local Factorio install to debug");if(n.nativeDAP)return new ue.DebugAdapterExecutable(n.factorioPath,["--dap"]);let i=ue.workspace.getConfiguration("factorio");switch(i.get("debug.runMode","inline")){case"inline":default:return new ue.DebugAdapterInlineImplementation(new Fa(n,ue.workspace.fs,{findWorkspaceFiles:ue.workspace.findFiles,getExtension:ue.extensions.getExtension,executeCommand:ue.commands.executeCommand}));case"external":return i.get("inspect",!1)&&t.args.unshift("--nolazy","--inspect-brk=34198"),t.args.push(...await n.debugLaunchArgs()),t}}dispose(){}};export{ph as activate};
14
+ 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.
15
+ ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(j.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}hookLogLevelChanged(e){this._listeners.push(this.traceOutputChannel.onDidChangeLogLevel(t=>{this._traceLogLevel=t,this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let n=j.workspace.getConfiguration(this._id),i=this._traceLogLevel!==j.LogLevel.Trace?S.Trace.Off:S.Trace.Messages,s=S.TraceFormat.Text;if(n&&i!==S.Trace.Off){let o=n.get("trace.server","messages");typeof o=="string"?(i=S.Trace.fromString(o),i===S.Trace.Off&&(i=S.Trace.Messages)):(i=S.Trace.fromString(n.get("trace.server.verbosity","messages")),i===S.Trace.Off&&(i=S.Trace.Messages),s=S.TraceFormat.fromString(n.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 n;et.array(t)?n=t:n=[t],n&&this._dynamicFeatures.get(S.DidChangeWatchedFilesNotification.type.method).registerRaw(Dl.generateUuid(),n)}_features=[];_dynamicFeatures=new Map;registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Le.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(S.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Ya.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new Pl.ConfigurationFeature(this)),this._didOpenTextDocumentFeature=new In.DidOpenTextDocumentFeature(this,this._syncedDocuments),this.registerFeature(this._didOpenTextDocumentFeature),this._didChangeTextDocumentFeature=new In.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new In.WillSaveFeature(this)),this.registerFeature(new In.WillSaveWaitUntilFeature(this)),this.registerFeature(new In.DidSaveTextDocumentFeature(this)),this.registerFeature(new In.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Gm.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new wm.CompletionItemFeature(this)),this.registerFeature(new Cm.HoverFeature(this)),this.registerFeature(new Sm.SignatureHelpFeature(this)),this.registerFeature(new bm.DefinitionFeature(this)),this.registerFeature(new Rm.ReferencesFeature(this)),this.registerFeature(new Dm.DocumentHighlightFeature(this)),this.registerFeature(new Pm.DocumentSymbolFeature(this)),this.registerFeature(new Tm.WorkspaceSymbolFeature(this)),this.registerFeature(new Mm.CodeActionFeature(this)),this.registerFeature(new km.CodeLensFeature(this)),this.registerFeature(new Ja.DocumentFormattingFeature(this)),this.registerFeature(new Ja.DocumentRangeFormattingFeature(this)),this.registerFeature(new Ja.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Em.RenameFeature(this)),this.registerFeature(new qm.DocumentLinkFeature(this)),this.registerFeature(new Im.ExecuteCommandFeature(this)),this.registerFeature(new Pl.SyncConfigurationFeature(this)),this.registerFeature(new Om.TypeDefinitionFeature(this)),this.registerFeature(new Fm.ImplementationFeature(this)),this.registerFeature(new xm.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Bm.WorkspaceFoldersFeature(this)),this.registerFeature(new Am.FoldingRangeFeature(this)),this.registerFeature(new jm.DeclarationFeature(this)),this.registerFeature(new Lm.SelectionRangeFeature(this)),this.registerFeature(new Jm.ProgressFeature(this)),this.registerFeature(new Nm.CallHierarchyFeature(this)),this.registerFeature(new Um.SemanticTokensFeature(this)),this.registerFeature(new Km.LinkedEditingFeature(this)),this.registerFeature(new An.DidCreateFilesFeature(this)),this.registerFeature(new An.DidRenameFilesFeature(this)),this.registerFeature(new An.DidDeleteFilesFeature(this)),this.registerFeature(new An.WillCreateFilesFeature(this)),this.registerFeature(new An.WillRenameFilesFeature(this)),this.registerFeature(new An.WillDeleteFilesFeature(this)),this.registerFeature(new Hm.TypeHierarchyFeature(this)),this.registerFeature(new Wm.InlineValueFeature(this)),this.registerFeature(new $m.InlayHintsFeature(this)),this.registerFeature(new _m.DiagnosticFeature(this)),this.registerFeature(new Ya.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(nc.createAll(this))}fillInitializeParams(e){for(let t of this._features)et.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Le.ensure)(e,"workspace").applyEdit=!0;let t=(0,Le.ensure)((0,Le.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[S.ResourceOperationKind.Create,S.ResourceOperationKind.Rename,S.ResourceOperationKind.Delete],t.failureHandling=S.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0},t.metadataSupport=!0,t.snippetEditSupport=!0;let n=(0,Le.ensure)((0,Le.ensure)(e,"textDocument"),"publishDiagnostics");n.relatedInformation=!0,n.versionSupport=!1,n.tagSupport={valueSet:[S.DiagnosticTag.Unnecessary,S.DiagnosticTag.Deprecated]},n.codeDescriptionSupport=!0,n.dataSupport=!0;let i=(0,Le.ensure)((0,Le.ensure)(e,"textDocument"),"filters");i.relativePatternSupport=!0;let s=(0,Le.ensure)(e,"window"),o=(0,Le.ensure)(s,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};let a=(0,Le.ensure)(s,"showDocument");a.support=!0;let u=(0,Le.ensure)(e,"general");u.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(r.RequestsToCancelOnContentModified)},u.regularExpressions={engine:"ECMAScript",version:"ES2020"},u.markdown={parser:"marked",version:"1.1.0"},u.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(u.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 l of this._features)l.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let n of this._features)et.func(n.preInitialize)&&n.preInitialize(this._capabilities,t);for(let n of this._features)n.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,n=>this.doRegisterCapability(n)):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 n=this._dynamicFeatures.get(t.method);if(n===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{n.register(s)}catch(o){return Promise.reject(o)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,n=>this.doUnregisterCapability(n)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let n=this._dynamicFeatures.get(t.method);if(!n)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));n.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=this.clientOptions.middleware?.workspace?.handleApplyEdit;if(t){let n=await t(e,i=>this.doHandleApplyWorkspaceEdit(i));return n instanceof S.ResponseError?Promise.reject(n):n}else return this.doHandleApplyWorkspaceEdit(e)}workspaceEditLock=new jr.Semaphore(1);async doHandleApplyWorkspaceEdit(e){let t=e.edit,n=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t));return this.validateWorkspaceEdit(t)?et.asPromise(j.workspace.applyEdit(n,{isRefactoring:e.metadata?.isRefactoring}).then(s=>({applied:s}))):Promise.resolve({applied:!1})}validateWorkspaceEdit(e){let t=new Map;if(j.workspace.textDocuments.forEach(n=>t.set(n.uri.toString(),n)),e.documentChanges){for(let n of e.documentChanges)if(S.TextDocumentEdit.is(n)&&n.textDocument.version!==null&&n.textDocument.version>=0){let i=this._p2c.asUri(n.textDocument.uri).toString(),s=t.get(i);if(s&&s.version!==n.textDocument.version)return!1}}return!0}static RequestsToCancelOnContentModified=new Set([S.SemanticTokensRequest.method,S.SemanticTokensRangeRequest.method,S.SemanticTokensDeltaRequest.method]);static CancellableResolveCalls=new Set([S.CompletionResolveRequest.method,S.CodeLensResolveRequest.method,S.CodeActionResolveRequest.method,S.InlayHintResolveRequest.method,S.DocumentLinkResolveRequest.method,S.WorkspaceSymbolResolveRequest.method]);handleFailedRequest(e,t,n,i,s=!0,o=!1){if(n instanceof S.ResponseError){if(n.code===S.ErrorCodes.PendingResponseRejected||n.code===S.ErrorCodes.ConnectionInactive)return i;if(n.code===S.LSPErrorCodes.RequestCancelled||n.code===S.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested&&!o)return i;throw n.data!==void 0?new Le.LSPCancellationError(n.data):new j.CancellationError}else if(n.code===S.LSPErrorCodes.ContentModified){if(r.RequestsToCancelOnContentModified.has(e.method)||r.CancellableResolveCalls.has(e.method))throw new j.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,n,s),n}};Y.BaseLanguageClient=Lr;var ec=class extends Lr{serverOptions;constructor(e,t,n,i){super(e,t,i),this.serverOptions=n}async createMessageTransports(e){return this.serverOptions()}};Y.LanguageClient=ec;var tc=class{error(e){(0,S.RAL)().console.error(e)}warn(e){(0,S.RAL)().console.warn(e)}info(e){(0,S.RAL)().console.info(e)}log(e){(0,S.RAL)().console.log(e)}};function Ym(r,e,t,n,i){let s=new tc,o=(0,S.createProtocolConnection)(r,e,s,i);return o.onError(u=>{t(u[0],u[1],u[2])}),o.onClose(n),{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 h={sendNotification:!1,traceFormat:S.TraceFormat.Text};return p===void 0?o.trace(u,l,h):(et.boolean(p),o.trace(u,l,p))},initialize:u=>o.sendRequest(S.InitializeRequest.type,u),shutdown:()=>o.sendRequest(S.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(S.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var nc;(function(r){function e(t){return[new zm.InlineCompletionItemFeature(t),new Vm.TextDocumentContentFeature(t)]}r.createAll=e})(nc||(Y.ProposedFeatures=nc={}))});var Fl=M(Nt=>{"use strict";var Qm=Nt&&Nt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Zm=Nt&&Nt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Xm=Nt&&Nt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Qm(t,e,n[i]);return Zm(t,e),t}})();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.terminate=iv;var Ol=Xm(I("child_process")),ev=process.platform==="win32",tv=process.platform==="darwin",nv=process.platform==="linux";function iv(r,e){if(ev)try{let t={stdio:["pipe","pipe","ignore"]};return e&&(t.cwd=e),Ol.execFileSync("taskkill",["/T","/F","/PID",r.pid.toString()],t),!0}catch{return!1}else if(nv||tv)try{let t=r.pid.toString();if(!/^\d+$/.test(t))return!1;let n=`
16
+ terminateTree() {
17
+ for cpid in $(pgrep -P "$1"); do
18
+ terminateTree "$cpid"
19
+ done
20
+ kill -9 "$1" > /dev/null 2>&1
21
+ }
22
+
23
+ terminateTree "${t}"
24
+ `;return!Ol.spawnSync("/bin/sh",[],{input:n,stdio:["pipe","inherit","inherit"]}).error}catch{return!1}else return r.kill("SIGKILL"),!0}});var Ml=M(Ne=>{"use strict";var rv=Ne&&Ne.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),rc=Ne&&Ne.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rv(e,r,t)};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.DiagnosticPullMode=Ne.vsdiag=void 0;rc(N(),Ne);rc(B(),Ne);var xl=mo();Object.defineProperty(Ne,"vsdiag",{enumerable:!0,get:function(){return xl.vsdiag}});Object.defineProperty(Ne,"DiagnosticPullMode",{enumerable:!0,get:function(){return xl.DiagnosticPullMode}});rc(ic(),Ne)});var jl=M(be=>{"use strict";var Il=be&&be.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),sv=be&&be.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Di=be&&be.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Il(t,e,n[i]);return sv(t,e),t}})(),Al=be&&be.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Il(e,r,t)};Object.defineProperty(be,"__esModule",{value:!0});be.SettingMonitor=be.LanguageClient=be.TransportKind=void 0;var Ut=Di(I("child_process")),sc=Di(I("fs")),oc=Di(I("path")),kl=Di(I("readline")),tn=I("vscode"),Nn=Di(He()),El=ic(),ov=Fl(),ue=Dc(),av=nd(),cv=id();Al(Dc(),be);Al(Ml(),be);var ql="^1.91.0",le;(function(r){r[r.stdio=0]="stdio",r[r.ipc=1]="ipc",r[r.pipe=2]="pipe",r[r.socket=3]="socket"})(le||(be.TransportKind=le={}));var en;(function(r){function e(t){let n=t;return n&&n.kind===le.socket&&Nn.number(n.port)}r.isSocket=e})(en||(en={}));var ac;(function(r){function e(t){return Nn.string(t.command)}r.is=e})(ac||(ac={}));var cc;(function(r){function e(t){return Nn.string(t.module)}r.is=e})(cc||(cc={}));var uc;(function(r){function e(t){let n=t;return n&&n.writer!==void 0&&n.reader!==void 0}r.is=e})(uc||(uc={}));var lc;(function(r){function e(t){let n=t;return n&&n.process!==void 0&&typeof n.detached=="boolean"}r.is=e})(lc||(lc={}));var dc=class extends El.BaseLanguageClient{_serverOptions;_forceDebug;_serverProcess;_isDetached;_isInDebugMode;constructor(e,t,n,i,s){let o,a,u,l,p;Nn.string(t)?(o=e,a=t,u=n,l=i,p=!!s):(o=e.toLowerCase(),a=e,u=t,l=n,p=i),p===void 0&&(p=!1),super(o,a,l),this._serverOptions=u,this._forceDebug=p,this._isInDebugMode=p;try{this.checkVersion()}catch(h){throw Nn.string(h.message)&&this.outputChannel.appendLine(h.message),h}}checkVersion(){let e=av(tn.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${tn.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!cv(e,ql))throw new Error(`The language client requires VS Code version ${ql} but received version ${tn.version}`)}get isInDebugMode(){return this._isInDebugMode}get serverProcess(){return this._serverProcess}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(e=>setTimeout(e,1e3)),await this.start()):await this.start()}shutdown(e,t=2e3){return super.shutdown(e,t).finally(()=>{if(this._serverProcess){let n=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(n),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,ov.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(f,m){if(!f&&!m)return;let g=Object.create(null);return Object.keys(process.env).forEach(v=>g[v]=process.env[v]),m&&(g.ELECTRON_RUN_AS_NODE="1",g.ELECTRON_NO_ASAR="1"),f&&Object.keys(f).forEach(v=>g[v]=f[v]),g}let n=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let f=process.execArgv;return f?f.some(m=>n.some(g=>m.startsWith(g))||i.some(g=>m===g)):!1}function o(f){if(f.stdin===null||f.stdout===null||f.stderr===null)throw new Error("Process created without stdio streams")}function a(f,m){kl.createInterface({input:f,crlfDelay:1/0,terminal:!1,historySize:0}).on("line",g=>m.info(g))}function u(f,m){kl.createInterface({input:f,crlfDelay:1/0,terminal:!1,historySize:0}).on("line",g=>m.error(g))}let l=this._serverOptions;if(Nn.func(l))return l().then(f=>{if(El.MessageTransports.is(f))return this._isDetached=!!f.detached,f;if(uc.is(f))return this._isDetached=!!f.detached,{reader:new ue.StreamMessageReader(f.reader),writer:new ue.StreamMessageWriter(f.writer)};{let m;return lc.is(f)?(m=f.process,this._isDetached=f.detached):(m=f,this._isDetached=!1),u(m.stderr,this.outputChannel),{reader:new ue.StreamMessageReader(m.stdout),writer:new ue.StreamMessageWriter(m.stdin)}}});let p,h=l;return h.run||h.debug?this._forceDebug||s()?(p=h.debug,this._isInDebugMode=!0):(p=h.run,this._isInDebugMode=!1):p=l,this._getServerWorkingDir(p.options).then(f=>{if(cc.is(p)&&p.module){let m=p,g=m.transport||le.stdio;if(m.runtime){let v=[],_=m.options??Object.create(null);_.execArgv&&_.execArgv.forEach(F=>v.push(F)),v.push(m.module),m.args&&m.args.forEach(F=>v.push(F));let T=Object.create(null);T.cwd=f,T.env=t(_.env,!1);let C=this._getRuntimePath(m.runtime,f),D;if(g===le.ipc?(T.stdio=[null,null,null,"ipc"],v.push("--node-ipc")):g===le.stdio?v.push("--stdio"):g===le.pipe?(D=(0,ue.generateRandomPipeName)(),v.push(`--pipe=${D}`)):en.isSocket(g)&&v.push(`--socket=${g.port}`),v.push(`--clientProcessId=${process.pid.toString()}`),g===le.ipc||g===le.stdio){let F=Ut.spawn(C,v,T);return!F||!F.pid?Ln(F,`Launching server using runtime ${C} failed.`):(this._serverProcess=F,u(F.stderr,this.outputChannel),g===le.ipc?(a(F.stdout,this.outputChannel),Promise.resolve({reader:new ue.IPCMessageReader(F),writer:new ue.IPCMessageWriter(F)})):Promise.resolve({reader:new ue.StreamMessageReader(F.stdout),writer:new ue.StreamMessageWriter(F.stdin)}))}else{if(g===le.pipe)return(0,ue.createClientPipeTransport)(D).then(F=>{let E=Ut.spawn(C,v,T);return!E||!E.pid?Ln(E,`Launching server using runtime ${C} failed.`):(this._serverProcess=E,u(E.stderr,this.outputChannel),a(E.stdout,this.outputChannel),F.onConnected().then(Q=>({reader:Q[0],writer:Q[1]})))});if(en.isSocket(g))return(0,ue.createClientSocketTransport)(g.port).then(F=>{let E=Ut.spawn(C,v,T);return!E||!E.pid?Ln(E,`Launching server using runtime ${C} failed.`):(this._serverProcess=E,u(E.stderr,this.outputChannel),a(E.stdout,this.outputChannel),F.onConnected().then(Q=>({reader:Q[0],writer:Q[1]})))})}}else{let v;return new Promise((_,T)=>{let C=(m.args&&m.args.slice())??[];g===le.ipc?C.push("--node-ipc"):g===le.stdio?C.push("--stdio"):g===le.pipe?(v=(0,ue.generateRandomPipeName)(),C.push(`--pipe=${v}`)):en.isSocket(g)&&C.push(`--socket=${g.port}`),C.push(`--clientProcessId=${process.pid.toString()}`);let D=m.options?{...m.options}:Object.create(null);if(D.env=t(D.env,!0),D.execArgv=D.execArgv||[],D.cwd=f,D.silent=!0,g===le.ipc||g===le.stdio){let F=Ut.fork(m.module,C||[],D);o(F),this._serverProcess=F,u(F.stderr,this.outputChannel),g===le.ipc?(a(F.stdout,this.outputChannel),_({reader:new ue.IPCMessageReader(this._serverProcess),writer:new ue.IPCMessageWriter(this._serverProcess)})):_({reader:new ue.StreamMessageReader(F.stdout),writer:new ue.StreamMessageWriter(F.stdin)})}else g===le.pipe?(0,ue.createClientPipeTransport)(v).then(F=>{let E=Ut.fork(m.module,C||[],D);o(E),this._serverProcess=E,u(E.stderr,this.outputChannel),a(E.stdout,this.outputChannel),F.onConnected().then(Q=>{_({reader:Q[0],writer:Q[1]})},T)},T):en.isSocket(g)&&(0,ue.createClientSocketTransport)(g.port).then(F=>{let E=Ut.fork(m.module,C||[],D);o(E),this._serverProcess=E,u(E.stderr,this.outputChannel),a(E.stdout,this.outputChannel),F.onConnected().then(Q=>{_({reader:Q[0],writer:Q[1]})},T)},T)})}}else if(ac.is(p)&&p.command){let m=p,g=p.args!==void 0?p.args.slice(0):[],v,_=p.transport;if(_===le.stdio)g.push("--stdio");else if(_===le.pipe)v=(0,ue.generateRandomPipeName)(),g.push(`--pipe=${v}`);else if(en.isSocket(_))g.push(`--socket=${_.port}`);else if(_===le.ipc)throw new Error("Transport kind ipc is not support for command executable");let T=Object.assign({},m.options);if(T.cwd=T.cwd||f,_===void 0||_===le.stdio){let C=Ut.spawn(m.command,g,T);return!C||!C.pid?Ln(C,`Launching server using command ${m.command} failed.`):(u(C.stderr,this.outputChannel),this._serverProcess=C,this._isDetached=!!T.detached,Promise.resolve({reader:new ue.StreamMessageReader(C.stdout),writer:new ue.StreamMessageWriter(C.stdin)}))}else{if(_===le.pipe)return(0,ue.createClientPipeTransport)(v).then(C=>{let D=Ut.spawn(m.command,g,T);return!D||!D.pid?Ln(D,`Launching server using command ${m.command} failed.`):(this._serverProcess=D,this._isDetached=!!T.detached,u(D.stderr,this.outputChannel),a(D.stdout,this.outputChannel),C.onConnected().then(F=>({reader:F[0],writer:F[1]})))});if(en.isSocket(_))return(0,ue.createClientSocketTransport)(_.port).then(C=>{let D=Ut.spawn(m.command,g,T);return!D||!D.pid?Ln(D,`Launching server using command ${m.command} failed.`):(this._serverProcess=D,this._isDetached=!!T.detached,u(D.stderr,this.outputChannel),a(D.stdout,this.outputChannel),C.onConnected().then(F=>({reader:F[0],writer:F[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(l,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(f,m)=>{f===0?this.info("Server process exited successfully",void 0,!1):f!==null&&this.error(`Server process exited with code ${f}.`,void 0,!1),m!==null&&this.error(`Server process exited with signal ${m}.`,void 0,!1)})})}_getRuntimePath(e,t){if(oc.isAbsolute(e))return e;let n=this._mainGetRootPath();if(n!==void 0){let i=oc.join(n,e);if(sc.existsSync(i))return i}if(t!==void 0){let i=oc.join(t,e);if(sc.existsSync(i))return i}return e}_mainGetRootPath(){let e=tn.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(n=>{sc.lstat(t,(i,s)=>{n(!i&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};be.LanguageClient=dc;var fc=class{_client;_setting;_listeners;constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return tn.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new tn.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,n=e>=0?this._setting.substr(e+1):void 0,i=n?tn.workspace.getConfiguration(t).get(n,!1):tn.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"))}};be.SettingMonitor=fc;function Ln(r,e){return r===null?Promise.reject(e):new Promise((t,n)=>{r.on("error",i=>{n(`${e} ${i}`)}),setImmediate(()=>n(e))})}});import*as W from"vscode";var gs=Yn(rd(),1);import*as P from"vscode";import*as Pn from"path";import{fork as cd}from"child_process";import{EventEmitter as ad}from"events";var Zn=class extends ad{buf;matchers;constructor(e,t){super(),this.buf=Buffer.alloc(0),this.matchers=t instanceof Buffer?[t]:t,e.on("close",()=>{this.emit("close")}),e.on("end",()=>{this.emit("end")}),e.on("data",n=>{for(this.buf=Buffer.concat([this.buf,n]);this.buf.length>0;){let i=this.matchers.map(o=>this.buf.indexOf(o instanceof Buffer?o:o.start)),s=i.reduce((o,a)=>o===-1?a:a===-1?o:Math.min(o,a));if(s!==-1){let o=this.matchers[i.indexOf(s)];if(o instanceof Buffer)s>0&&this.emit("segment",this.buf.subarray(0,s)),this.buf=this.buf.subarray(s+o.length);else{let a=o;s>0&&(this.emit("segment",this.buf.subarray(0,s)),this.buf=this.buf.subarray(s));let u=this.buf.indexOf(a.end,a.start.length);if(u!==-1)this.emit("segment",this.buf.subarray(a.start.length,u)),this.buf=this.buf.subarray(u+a.end.length);else return}}else return}})}};import*as hs from"vscode";var Bi=class{constructor(e){this.secrets=e}secrets;async ReadyAPIKey(e){if(process.env.FACTORIO_UPLOAD_API_KEY)return{from:"env"};try{let t=await this.secrets.get("factorio-uploadmods");if(t&&(e&&(e=await hs.window.showInformationMessage("Key already present. Replace it?",{modal:!0},"Yes","No")==="Yes"),!e))return{from:"secrets",key:t};if(t=await hs.window.showInputBox({prompt:"Mod Portal API Key:",ignoreFocusOut:!0,password:!0}),t)return t=t.trim(),await this.secrets.store("factorio-uploadmods",t),{from:"new",key:t}}catch{}return!1}async ClearApiKey(){return this.secrets.delete("factorio-uploadmods")}};import{platform as ud,tmpdir as ld}from"os";var $={valTypes:{none:"NONE",primitive:"PRIM",object:"OBJECT",array:"ARRAY"},getValType:function(r){return r&&typeof r=="object"||Array.isArray(r)?Array.isArray(r)?$.valTypes.array:typeof r=="object"?$.valTypes.object:void 0:$.valTypes.primitive},getPathType:function(r){var e=[];for(var t in r){var n=r[t];n?$.isNumber(n)?e.push($.valTypes.array):e.push($.valTypes.object):e.push($.valTypes.none)}return e},isUndefined:function(r){return r===void 0},isNumber:function(r){return!isNaN(parseFloat(r))&&isFinite(r)&&r.indexOf(".")===-1},isEmptyObj:function(r){for(var e in r)if(Object.hasOwnProperty.call(r,e))return!1;return JSON.stringify(r)===JSON.stringify({})},isNotObject:function(r){return!r||typeof r!="object"},isEmptyArray:function(r){return Array.isArray(r)&&r.length==0},isNotArray:function(r){return Array.isArray(r)==0},removeEmptyArrayItem:function(r){return r.filter(function(e){return e!=null&&e!=""})},getFieldName:function(r,e,t,n,i){return i?(e||"")+($.isNumber(r)?"["+r+"]":(t&&!e?"":".")+r):n?(e||"")+"["+r+"]":(e?e+".":"")+r},startsWith:function(r,e){return r.indexOf(e)==0},convert:function(r,e){var t={};return $.isNotObject(r)&&$.isNotArray(r)?e?(t[e]=r,t):r:$.isEmptyArray(r)?r:(function n(i,s,o){var a=Array.isArray(i);for(var u in i){var l=i[u];l&&typeof l=="object"?Array.isArray(l)?$.isEmptyArray(l)?t[$.getFieldName(u,s,o,!1,!0)]=l:t=n(l,$.getFieldName(u,s,o,!1,!0),a):a&&$.isEmptyObj(l)==0?t=n(l,$.getFieldName(u,s,o,!0)):$.isEmptyObj(l)==0?t=n(l,$.getFieldName(u,s,o)):$.isEmptyObj(l)&&(t[$.getFieldName(u,s,o,a)]=l):a||$.isNumber(u)?t[$.getFieldName(u,s,o,!0)]=l:t[$.getFieldName(u,s,o)]=l}return t})(r,e,!0)},backward:function(r,e){var t={},n=/\[(\d+)\]/g;if($.isNotObject(r)&&$.isNotArray(r))return e?r[e]:r;if($.isEmptyArray(r))return r;for(var i in r){var s=r[i];if(e){var o=new RegExp("^"+e);i=i.replace(o,"")}i=i.replace(n,".$1"),$.startsWith(i,".")&&(i=i.replace(/^\./,""));var a=i.split("."),u=$.getPathType(a);$.isUndefined(u)||u[0]!=$.valTypes.array||Array.isArray(t)!=0||(t=[]),(function l(p,h,f,m){var g=a.shift(),v=u.shift();if(g!==void 0&&g!=""){if(g=$.isNumber(g)?parseInt(g):g,a.length>0)return h[g]===void 0&&(h[g]=u[0]==$.valTypes.array?[]:{}),void l(p,h[g],g,h);v==$.valTypes.array&&f&&m?(Array.isArray(m[f])==0&&(m[f]=[]),m[f].push(p)):h[g]=p}else t=p})(s,t)}return t}};var zi;function dd(r){return zi?ud()==="win32"?`${r};${P.Uri.joinPath(zi,"bin").fsPath}`:`${r}:${P.Uri.joinPath(zi,"bin").fsPath}`:r}async function Tc(r){if(P.workspace.workspaceFolders){let e=new Bi(r.secrets);r.subscriptions.push(P.commands.registerCommand("factorio.clearApiKey",async()=>{await e.ClearApiKey()})),r.subscriptions.push(P.commands.registerCommand("factorio.setApiKey",async()=>{await e.ReadyAPIKey(!0)}));let t=P.extensions.getExtension("vscode.git");t&&!t.isActive&&await t.activate();let n=new vs(r,e,t?.exports.getAPI(1));r.subscriptions.push(n);let i=P.window.createTreeView("factoriomods",{treeDataProvider:n});r.subscriptions.push(i),zi=r.extensionUri}}var ms=class{constructor(e,t){this.context=e;this.modPackages=t}context;modPackages;provideTasks(e){let t=[],n=nt.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())n.has(i)&&(t.push(new P.Task({label:`${i.name}.datestamp`,type:"factorio",modname:i.label,command:"datestamp"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.datestamp`,"factorio",i.DateStampTask(),[])),t.push(new P.Task({label:`${i.name}.package`,type:"factorio",modname:i.label,command:"package"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.package`,"factorio",i.PackageTask(),[])),t.push(new P.Task({label:`${i.name}.version`,type:"factorio",modname:i.label,command:"version"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.version`,"factorio",i.IncrementTask(),[])),t.push(new P.Task({label:`${i.name}.upload`,type:"factorio",modname:i.label,command:"upload"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.upload`,"factorio",i.PostToPortalTask(),[])),t.push(new P.Task({label:`${i.name}.details`,type:"factorio",modname:i.label,command:"details"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.details`,"factorio",i.DetailsTask(),[])),t.push(new P.Task({label:`${i.name}.publish`,type:"factorio",modname:i.label,command:"publish"},P.workspace.getWorkspaceFolder(i.resourceUri)||P.TaskScope.Workspace,`${i.name}.publish`,"factorio",i.PublishTask(),[])));return t}resolveTaskExecution(e,t){if(e.definition.command==="adjustMods")return e.definition.adjustMods?e.definition.modsPath?this.AdjustModsTask(e.definition):this.ConfigErrorTask(e.definition,"missing `modsPath`"):this.ConfigErrorTask(e.definition,"missing `adjustMods`");if(!e.definition.modname)return this.ConfigErrorTask(e.definition,"missing `modname`");if(e.definition.command==="run"&&!e.definition.script)return this.ConfigErrorTask(e.definition,"missing `script`");let n=nt.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())if(i.label===e.definition.modname&&n.has(i)){let s=i;switch(e.definition.command){case"run":return s.RunTask(e.definition.script,e.definition.scriptArgs);case"compile":return s.RunTask("compile");case"datestamp":return s.DateStampTask();case"package":return s.PackageTask();case"version":return s.IncrementTask();case"upload":return s.PostToPortalTask();case"details":return s.DetailsTask();case"publish":return s.PublishTask();default:return this.ConfigErrorTask(e.definition,`unknown \`command\` "${e.definition.command}"`)}}return this.ConfigErrorTask(e.definition,`mod "${e.definition.modname}" not found`)}resolveTask(e,t){if(e.definition.type==="factorio"){let n=this.resolveTaskExecution(e,t);return new P.Task(e.definition,e.scope||P.TaskScope.Workspace,e.name,e.source,n,[])}}ConfigErrorTask(e,t){return new P.CustomExecution(async()=>new Ge(n=>{n.write(t+`
25
+ `),n.write(JSON.stringify(e,void 0,2)),n.close()}))}getFMTKCLIPath(){return this.context.asAbsolutePath("./dist/fmtk-cli.js")}AdjustModsTask(e){let t=["mods","--modsPath",e.modsPath,"adjust"];e.allowDisableBaseMod&&t.push("--allowDisableBase"),e.disableExtraMods&&t.push("--disableExtra");for(let n in e.adjustMods)t.push(`${n}=${e.adjustMods[n]}`);return new P.CustomExecution(async()=>new Ge(async n=>{await tt(n,this.getFMTKCLIPath(),t,process.cwd()),n.close()}))}},nt=class extends P.TreeItem{constructor(t,n,i,s,o,a){super(t);this.resourceUri=t;this.modinfo=n;this.keychain=i;this.context=s;this._onDidChange=o;this.gitapi=a;this.command={title:"Open",command:"vscode.open",arguments:[t]},this.UpdateTreeItemFields()}resourceUri;modinfo;keychain;context;_onDidChange;gitapi;get name(){return this.modinfo.name}get title(){return this.modinfo.title}get version(){return this.modinfo.version}get scripts(){return this.modinfo.package?.scripts}static sort(t,n){let i=t.name.toLowerCase().localeCompare(n.name.toLowerCase());if(i!==0)return i*100;let s=gs.compare(t.version,n.version,{loose:!0});return s!==0?-s*10:t.resourceUri<n.resourceUri?-1:t.resourceUri>n.resourceUri?1:0}static latestPackages(t){let n=new Map;for(let s of t)n.has(s.name)?n.get(s.name).push(s):n.set(s.name,[s]);let i=new Set;for(let s of n.values())i.add(s.reduce((o,a)=>gs.compare(o.version,a.version,{loose:!0})<0?a:o));return i}async gitLabel(){let t=this.gitapi?.getRepository(this.resourceUri);if(t){let n=await t.log({}),i=0;for(;i<n.length;i++){let s=n[i];if("refNames"in s&&s.refNames.some(u=>u.match(/^tag:/)))return`+${i}`}}}async ReloadInfo(){let n=(await P.workspace.openTextDocument(this.resourceUri)).getText();this.modinfo=JSON.parse(n);let i=await this.gitLabel();this.UpdateTreeItemFields(i),this._onDidChange(this)}UpdateTreeItemFields(t){this.label=this.name,this.description=t?`${this.version} (${t})`:this.version,this.tooltip=this.title}getFMTKCLIPath(){return this.context.asAbsolutePath("./dist/fmtk-cli.js")}RunTask(t,n){return new P.CustomExecution(async()=>new Ge(async i=>{await tt(i,this.getFMTKCLIPath(),["run",t,...n??[]],P.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),i.close()}))}DateStampTask(){return new P.CustomExecution(async()=>new Ge(async t=>{await tt(t,this.getFMTKCLIPath(),["datestamp"],P.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),t.close()}))}PackageTask(){let t=["package"];return P.workspace.getConfiguration(void 0,this.resourceUri).get("factorio.package.zipLocation","inside")==="outside"&&(t.push("--outdir"),t.push("..")),new P.CustomExecution(async()=>new Ge(async i=>{await tt(i,this.getFMTKCLIPath(),t,P.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),i.close()}))}IncrementTask(){return new P.CustomExecution(async()=>new Ge(async t=>{await tt(t,this.getFMTKCLIPath(),["version"],P.Uri.joinPath(this.resourceUri,"..").fsPath),await this.ReloadInfo(),t.close()}))}PostToPortalTask(){return new P.CustomExecution(async()=>new Ge(async t=>{await this.ReloadInfo();let n=P.workspace.getConfiguration(void 0,this.resourceUri),i=Pn.dirname(this.resourceUri.path);n.get("factorio.package.zipLocation","inside")==="outside"&&(i=Pn.dirname(i));let s=this.resourceUri.with({path:i}),a=(await P.workspace.fs.readDirectory(s)).filter(([h,f])=>f===P.FileType.File&&h.startsWith(this.name)&&h.match(/_\d+\.\d+\.\d+\.zip$/)).map(([h,f])=>h).sort().reverse(),u=await P.window.showQuickPick(a,{placeHolder:"Select Package to upload"});if(!u){t.close();return}let l=Pn.join(s.fsPath,u),p=await this.keychain.ReadyAPIKey();p&&await tt(t,this.getFMTKCLIPath(),["upload",l,this.name],P.Uri.joinPath(this.resourceUri,"..").fsPath,p.from!=="env"?{FACTORIO_UPLOAD_API_KEY:p.key}:void 0),await this.ReloadInfo(),t.close()}))}DetailsTask(){return new P.CustomExecution(async()=>new Ge(async t=>{let n=await this.keychain.ReadyAPIKey();n&&await tt(t,this.getFMTKCLIPath(),["details"],P.Uri.joinPath(this.resourceUri,"..").fsPath,n.from!=="env"?{FACTORIO_UPLOAD_API_KEY:n.key}:void 0),await this.ReloadInfo(),t.close()}))}PublishTask(){return new P.CustomExecution(async()=>new Ge(async t=>{let n=await this.keychain.ReadyAPIKey();n&&await tt(t,this.getFMTKCLIPath(),["publish"],P.Uri.joinPath(this.resourceUri,"..").fsPath,n.from!=="env"?{FACTORIO_UPLOAD_API_KEY:n.key}:void 0),await this.ReloadInfo(),t.close()}))}},vs=class{constructor(e,t,n){this.context=e;this.keychain=t;this.gitapi=n;this.modPackages=new Map,P.workspace.findFiles("**/info.json").then(s=>{s.forEach(o=>{this.updateInfoJson(o)})});let i=P.workspace.createFileSystemWatcher("**/info.json");this.subscriptions.push(i.onDidChange(s=>this.updateInfoJson(s))),this.subscriptions.push(i.onDidCreate(s=>this.updateInfoJson(s))),this.subscriptions.push(i.onDidDelete(s=>this.removeInfoJson(s))),this.subscriptions.push(i),n&&this.subscriptions.push(n.onDidOpenRepository(async s=>{for(let o of this.modPackages.values()){let a=n.getRepository(o.resourceUri);s.rootUri.toString()===a?.rootUri?.toString()&&(await o.ReloadInfo(),this.subscriptions.push(s.onDidCommit(async()=>{await o.ReloadInfo()})),this.subscriptions.push(s.onDidCheckout(async()=>{await o.ReloadInfo()})))}})),this.subscriptions.push(P.tasks.registerTaskProvider("factorio",new ms(this.context,this.modPackages))),this.subscriptions.push(P.commands.registerCommand("factorio.openchangelog",async s=>P.window.showTextDocument(P.Uri.joinPath(s.resourceUri,"../changelog.txt")))),this.subscriptions.push(P.commands.registerCommand("factorio.datestamp",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="datestamp"&&a.definition.modname===s.label);await P.tasks.executeTask(o)})),this.subscriptions.push(P.commands.registerCommand("factorio.package",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="package"&&a.definition.modname===s.label);await P.tasks.executeTask(o)})),this.subscriptions.push(P.commands.registerCommand("factorio.version",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="version"&&a.definition.modname===s.label);await P.tasks.executeTask(o)})),this.subscriptions.push(P.commands.registerCommand("factorio.upload",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="upload"&&a.definition.modname===s.label);await P.tasks.executeTask(o)})),this.subscriptions.push(P.commands.registerCommand("factorio.details",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="details"&&a.definition.modname===s.label);await P.tasks.executeTask(o)})),this.subscriptions.push(P.commands.registerCommand("factorio.publish",async s=>{let o=(await P.tasks.fetchTasks({type:"factorio"})).find(a=>a.definition.command==="publish"&&a.definition.modname===s.label);await P.tasks.executeTask(o)}))}context;keychain;gitapi;_onDidChangeTreeData=new P.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;modPackages;subscriptions=[this._onDidChangeTreeData];dispose(){this.subscriptions.forEach(e=>e.dispose())}async updateInfoJson(e){if(e.scheme==="file"){let n=(await P.workspace.openTextDocument(e)).getText();if(n){let i=JSON.parse(n);if(i&&i.name)if(this.modPackages.has(e.toString()))await this.modPackages.get(e.toString())?.ReloadInfo();else{let s=new nt(e,i,this.keychain,this.context,o=>{this._onDidChangeTreeData.fire(o)},this.gitapi);this.modPackages.set(e.toString(),s),await s.ReloadInfo()}else this.modPackages.delete(e.toString())}else this.modPackages.delete(e.toString())}else this.modPackages.delete(e.toString());this._onDidChangeTreeData.fire(void 0)}removeInfoJson(e){this.modPackages.delete(e.toString()),this._onDidChangeTreeData.fire(void 0)}getTreeItem(e){return e}async getChildren(e){if(e)if(e instanceof nt){let t=[];if(this.modPackages){let n=nt.latestPackages(this.modPackages.values());n.has(e)&&this.modPackages.forEach((i,s)=>{i.label===e.label&&!n.has(i)&&(t.push(i),i.contextValue="older")})}return t.sort(nt.sort)}else return[];else{let t=[];if(this.modPackages){let n=nt.latestPackages(this.modPackages.values());for(let i of this.modPackages.values())if(n.has(i)){t.push(i);let s=["latest"];try{await P.workspace.fs.stat(P.Uri.joinPath(i.resourceUri,"../changelog.txt")),s.push("haschangelog")}catch{}i.contextValue=s.join(" "),i.collapsibleState=(()=>{for(let o of this.modPackages.values())if(i.label===o.label&&!n.has(o))return P.TreeItemCollapsibleState.Collapsed;return P.TreeItemCollapsibleState.None})()}}return t.sort(nt.sort)}}},ps=P.Uri.file(Pn.join(ld(),`vscode-${process.pid}-fmtk-config.json`));async function tt(r,e,t,n,i,s){let o=P.workspace.getConfiguration("factorio");await P.workspace.fs.writeFile(ps,Buffer.from(JSON.stringify($.convert({docs:await o.get("docs"),package:await o.get("package")}))));let a=Object.assign({},process.env,i,{FMTK_CONFIG:ps.fsPath}),u=process.execArgv;for(let l of o.get("tasks.execArgvOptions",[]))switch(l){case"clear":u=[];break;case"stripjsflags":u=u.filter(p=>!p.match(/^--js-flags/));break;case"stripinspect":u=u.filter(p=>!p.match(/^--inspect/));break}return u=[...u,...o.get("tasks.execArgvExtra",[])],a.Path=dd(a.Path??""),new Promise((l,p)=>{let h=cd(e,t,{cwd:n,execArgv:u,env:a,stdio:"pipe"});new Zn(h.stdout,Buffer.from(`
26
+ `)).on("segment",g=>{r.write(g.toString()+`\r
27
+ `)}),new Zn(h.stderr,Buffer.from(`
28
+ `)).on("segment",g=>{g.toString().match(/^Debugger listening/)&&console.log(g.toString()),r.write(g.toString()+`\r
29
+ `)}),h.on("error",g=>{r.write(`${g.message}\r
30
+ `)}),h.on("exit",(g,v)=>{P.workspace.fs.delete(ps),l(g??-1)}),s&&h.stdin.write(s),h.stdin.end()})}var Ge=class{constructor(e){this.runner=e}runner;writeEmitter=new P.EventEmitter;onDidWrite=this.writeEmitter.event;closeEmitter=new P.EventEmitter;onDidClose=this.closeEmitter.event;tokensource=new P.CancellationTokenSource;open(e){let t=this.writeEmitter,n=this.closeEmitter,i=this.runner({write:s=>t.fire(s.replace(/\r?\n/g,`\r
31
+ `)),close:()=>n.fire()},this.tokensource.token);i?i.finally(()=>{n.fire()}):n.fire()}close(){this.tokensource.cancel()}};import*as q from"vscode";import*as Ss from"os";import*as kc from"path";var Xn=Yn(Mc(),1);import*as Ie from"os";import*as G from"path";import{execFile as fd}from"child_process";function sn(r,e){return r.match(/^~[\\\/]/)&&(r=G.posix.join(Ie.homedir().replace(/\\/g,"/"),r.replace(/^~[\\\/]/,""))),r=r.replace("${userHome}",Ie.homedir()),e?.[0]&&(r=r.replace("${workspaceFolder}",e[0].uri.fsPath)),r=r.replace(/\$\{env:(\w+)}/g,(t,n)=>process.env[n]??t),r}var ei=class{constructor(e,t,n,i){this.fs=e;this.fv=t;this.docs=n;this.workspaceFolders=i}fs;fv;docs;workspaceFolders;async getBinaryVersion(){return new Promise((e,t)=>{fd(this.factorioPath,["--version"],{env:Object.assign({},process.env,{SteamAppId:"427520"})},(n,i,s)=>{n&&t(new Error(n.message));let o=i?.match(/^Version: ([0-9\.]+) /m);o&&e(o[1]),t(new Error(`Unable to read version:
32
+ stdout: ${i}
33
+ stderr: ${s}`))})})}get name(){return this.fv.name}get onlineOnly(){return!this.fv.factorioPath}get factorioPath(){if(!this.fv.factorioPath)throw new Error("No factorioPath");return sn(this.fv.factorioPath,this.workspaceFolders)}get isLocal(){return!!this.fv.factorioPath}async docArgs(e){let t=["luals-addon"];if(this.fv.onlineDocs?t.push("-o",this.fv.onlineDocs===!0?"latest":this.fv.onlineDocs):t.push("-d",this.docsPath,"-p",this.protosPath),e&&this.isLocal){try{let n=G.join(await this.scriptOutputPath(),"mod-settings-dump.json");await this.fs.stat(Re.file(n)),t.push("--sdump",n)}catch{}try{let n=G.join(await this.scriptOutputPath(),"data-raw-dump.json");await this.fs.stat(Re.file(n)),t.push("--pdump",n)}catch{}}return t}get docsPath(){return G.join(this.factorioPath,this.fv.docsPath?this.fv.docsPath:Ie.platform()==="darwin"?"../../doc-html/runtime-api.json":"../../../doc-html/runtime-api.json")}get protosPath(){return G.join(this.factorioPath,this.fv.protosPath?this.fv.protosPath:this.fv.docsPath?G.join(this.fv.docsPath,"../prototype-api.json"):Ie.platform()==="darwin"?"../../doc-html/prototype-api.json":"../../../doc-html/prototype-api.json")}configPathIsOverriden(){return!!this.fv.configPath}async configPath(){if(this.fv.configPath)return sn(this.fv.configPath,this.workspaceFolders);let e=G.resolve(G.dirname(this.factorioPath),"../../config-path.cfg");try{let t=Xn.parse((await this.fs.readFile(Re.file(e))).toString());return G.resolve(this.translatePath(t["config-path"]),"./config.ini")}catch{}return this.translatePath("__PATH__system-write-data__/config/config.ini")}iniData;async configIni(){return this.iniData||(this.iniData=this.fs.readFile(Re.file(await this.configPath())).then(e=>Xn.parse(e.toString()))),this.iniData}async isPrototypeCacheEnabled(){try{return(await this.configIni()).other?.["cache-prototype-data"]}catch{return}}async disablePrototypeCache(){this.iniData=void 0;let e=Re.file(await this.configPath()),t=(await this.fs.readFile(e)).toString();t=t.replace("cache-prototype-data=","; cache-prototype-data="),await this.fs.writeFile(e,Buffer.from(t)),this.iniData=Xn.parse(t)}async isMouseAutoCaptureDisabled(){try{return(await this.configIni()).other?.["disable-mouse-auto-capture"]}catch{return}}async disableMouseAutoCapture(){this.iniData=void 0;let e=Re.file(await this.configPath()),t=(await this.fs.readFile(e)).toString(),n=t.match(/^;? *disable-mouse-auto-capture=.*$/m);if(n)t=t.slice(0,n.index)+`
34
+ disable-mouse-auto-capture=true
35
+ `+t.slice(n.index+n[0].length);else{let i=t.match(/^\[other\]$/m);t=t.slice(0,i.index+i[0].length)+`
36
+ disable-mouse-auto-capture=true
37
+ `+t.slice(i.index+i[0].length)}await this.fs.writeFile(e,Buffer.from(t)),this.iniData=Xn.parse(t)}async defaultModsPath(){let e=(await this.configIni())?.path?.["write-data"];if(!e)throw new Error("path.write-data missing in config.ini");return G.posix.normalize(G.resolve(this.translatePath(e),"mods"))}async dataPath(){let e=(await this.configIni().catch(()=>({path:{"read-data":"__PATH__executable__/../../data"}}))).path?.["read-data"];if(!e)throw new Error("path.read-data missing in config.ini");return G.posix.normalize(this.translatePath(e))}async lualibPath(){return G.posix.normalize(G.resolve(await this.dataPath(),"core","lualib"))}async writeDataPath(){let e=(await this.configIni()).path?.["write-data"];if(!e)throw new Error("path.write-data missing in config.ini");return G.posix.normalize(this.translatePath(e))}async scriptOutputPath(){return G.posix.join(await this.writeDataPath(),"script-output")}translatePath(e){if(e.startsWith("__PATH__executable__"))return G.join(G.dirname(this.factorioPath),e.replace("__PATH__executable__",""));if(e.startsWith("__PATH__system-write-data__")){let t=Ie.platform()==="win32"?G.resolve(process.env.APPDATA,"Factorio"):Ie.platform()==="linux"?G.resolve(Ie.homedir(),".factorio"):Ie.platform()==="darwin"?G.resolve(Ie.homedir(),"Library/Application Support/factorio"):"??";return G.join(t,e.replace("__PATH__system-write-data__",""))}if(e.startsWith("__PATH__system-read-data__")){let t=Ie.platform()==="linux"?"/usr/share/factorio":Ie.platform()==="darwin"?G.resolve(G.dirname(this.factorioPath),"../data"):G.resolve(G.dirname(this.factorioPath),"../../data");return G.join(t,e.replace("__PATH__system-read-data__",""))}return e}is(e){let t=this.fv;return t.name===e.name&&t.factorioPath===e.factorioPath&&t.configPath===e.configPath&&t.onlineDocs===e.onlineDocs&&t.docsPath===e.docsPath&&t.protosPath===e.protosPath}};var Oe=q.workspace.fs,hd=[{name:"Steam",factorioPath:"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Factorio\\bin\\x64\\factorio.exe"},{name:"System",factorioPath:"C:\\Program Files\\Factorio\\bin\\x64\\factorio.exe"},{name:"Steam",factorioPath:"~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents/MacOS/factorio"},{name:"System",factorioPath:"/Applications/factorio.app/Contents/MacOS/factorio"},{name:"Steam",factorioPath:"~/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio"},{name:"Home",factorioPath:"~/.factorio/bin/x64/factorio"}],ws={name:"Online Latest",onlineDocs:!0},Cs={name:"Online Stable",onlineDocs:"stable"},bs=["tangzx.emmylua","xuhuanzy.emmylua-luals","theo.emmylua"],Gi=class{constructor(e,t,n){this.context=e;this.output=t;this.fsprovider=n;this.bar=q.window.createStatusBarItem("factorio-version",q.StatusBarAlignment.Left,10),this.bar.name="Factorio Version Selector",this.bar.text="Factorio (unselected)",this.bar.command="factorio.selectVersion",this.bar.show(),e.subscriptions.push(this.bar),e.subscriptions.push(q.commands.registerCommand("factorio.selectVersion",()=>this.selectVersionCommand())),e.subscriptions.push(q.commands.registerCommand("factorio.checkConfig",()=>this.checkConfigCommand())),e.subscriptions.push(q.commands.registerCommand("factorio.disablePrototypeCache",()=>this.disablePrototypeCacheCommand())),e.subscriptions.push(q.commands.registerCommand("factorio.disableMouseAutoCapture",()=>this.disableMouseAutoCaptureCommand())),this.migrateActiveVersion().then(()=>this.loadActiveVersion())}context;output;fsprovider;bar;async migrateActiveVersion(){if(this.context.workspaceState.get("active_version"))return;let e=q.workspace.getConfiguration("factorio"),t=e.get("versions",[]),n=t.find(i=>i.active);n&&(t.forEach(i=>delete i.active),await this.context.workspaceState.update("active_version",n),await e.update("versions",t))}async loadActiveVersion(){let e=this.context.workspaceState.get("active_version");if(!e)return;let t=await this.tryJsonDocs(e).catch(()=>{});if(!t){await this.context.workspaceState.update("active_version",void 0);return}this.bar.text=`Factorio ${t.application_version} (${e.name})`,this._active_version=new ei(q.workspace.fs,e,t,q.workspace.workspaceFolders),this.output.info(`Active Factorio version: ${e.name} (${t.application_version})`),await this.checkDocs()}async checkConfigCommand(){this.output.info("Check Config:"),this.output.show();let e=await this.getActiveVersion();if(!e){this.output.error("No Active Factorio Version");return}this.output.info("Active Factorio Version:"),e.onlineOnly?this.output.info("Online Only"):this.output.info(`Binary: ${await e.getBinaryVersion().catch(i=>i.toString())}`),this.output.info(`Runtime JSON: ${e.docs.application_version}`),e.onlineOnly||(await e.isPrototypeCacheEnabled()&&this.output.warn("Prototype Cache is enabled!"),await e.isMouseAutoCaptureDisabled()&&this.output.info("Mouse Auto Capture is disabled")),this.output.info(`Workspace Trusted: ${q.workspace.isTrusted}`),q.workspace.workspaceFolders?.forEach(i=>this.output.info(`Workspace folder: ${i.uri.toString()}`));let t=q.workspace.getConfiguration("factorio");this.output.info(`execArgv: ${JSON.stringify(process.execArgv)}`),this.output.info(`execArgvOptions: ${JSON.stringify(t.get("tasks.execArgvOptions",[]))}`),this.output.info(`execArgvExtras: ${JSON.stringify(t.get("tasks.execArgvExtras",[]))}`);let n=q.extensions.getExtension("sumneko.lua");n?await this.checkLuaLSConfig(n,e,t):this.output.info("LuaLS (sumneko.lua) not present");for(let i of bs){let s=q.extensions.getExtension(i);s?await this.checkEmmyLuaConfig(s,e,t):this.output.info(`EmmyLua (${i}) not present`)}}async checkEmmyLuaConfig(e,t,n){this.output.info(`EmmyLua (${e.id}) ${e.packageJSON.version} ${e.isActive?"Activated":"Not Yet Activated"}`);let i=this.context.storageUri;if(!i){this.output.error("No Workspace");return}try{let s=(await Oe.readFile(_e.joinPath(i,"emmylua/factorio/config.json"))).toString(),o=JSON.parse(s);this.output.info(`Library bundle found in ${i.fsPath}, generated from Factorio ${o.factorioVersion} with FMTK ${o.bundleVersion}`);for(let a of fs())try{(await Oe.readFile(_e.joinPath(i,"emmylua",a.name))).toString()!==a.content&&this.output.info(`file ${a.name} content mismatch!`)}catch(u){this.output.error(`file ${a.name} ${u}`)}}catch(s){this.output.error(`Missing or damaged library bundle info ${s}`)}}async checkLuaLSConfig(e,t,n){this.output.info(`LuaLS (${e.id}) ${e.packageJSON.version} ${e.isActive?"Activated":"Not Yet Activated"}`);let i=q.workspace.getConfiguration("Lua"),s=this.context.storageUri;if(!s){this.output.error("No Workspace");return}try{let f=(await Oe.readFile(_e.joinPath(s,"sumneko-3rd/factorio/config.json"))).toString(),m=JSON.parse(f);this.output.info(`Library bundle found in ${s.fsPath}, generated from Factorio ${m.factorioVersion} with FMTK ${m.bundleVersion}`);for(let g of fs())try{(await Oe.readFile(_e.joinPath(s,"sumneko-3rd",g.name))).toString()!==g.content&&this.output.info(`file ${g.name} content mismatch!`)}catch(v){this.output.error(`file ${g.name} ${v}`)}}catch(f){this.output.error(`Missing or damaged library bundle info ${f}`)}let o=i.get("workspace.userThirdParty");if(!o)this.output.warn("Lua.workspace.userThirdParty not present!");else{let f=_e.joinPath(s,"sumneko-3rd").fsPath;o.includes(f)?this.output.info(`Lua.workspace.userThirdParty: workspace link OK (${f})`):this.output.warn(`Lua.workspace.userThirdParty: workspace link missing! (${f})`);let m=o.filter(g=>g!==f);for(let g of m)g.match(/justarandomgeek\.factoriomod\-debug[\\\/]sumneko\-3rd$/)?this.output.warn(`Lua.workspace.userThirdParty: stale workspace link? (${g})`):this.output.info(`Lua.workspace.userThirdParty: other library (${g})`)}let a=i.get("workspace.checkThirdParty"),u=a==="ApplyInMemory";a===!1||a==="Disable"?this.output.warn(`Lua.workspace.checkThirdParty = ${a}`):this.output.info(`Lua.workspace.checkThirdParty = ${a}`);let l=n.get("workspace.manageLibraryDataLinks",!1),p=i.get("workspace.library");if(!p)this.output.warn("Lua.workspace.library not present!");else{let f=[];if(!t.onlineOnly){let _=Re.file(await t.dataPath()).fsPath;f.push(_),p.includes(_)?this.output.info(`Lua.workspace.library: /data link OK (${_})`):l&&this.output.warn(`Lua.workspace.library: /data link missing! (${_})`)}let m=_e.joinPath(s,"sumneko-3rd/factorio/library").fsPath,g=p.find(_=>Re.file(_).fsPath===m);g?(f.push(g),u?this.output.warn(`Lua.workspace.library: redundant workspace library link (${g})`):this.output.info(`Lua.workspace.library: workspace library link OK (${g})`)):u||this.output.warn(`Lua.workspace.library: workspace library link missing! (${m})`);let v=p.filter(_=>!f.includes(_));for(let _ of v)_.match(/justarandomgeek\.factoriomod\-debug[\\\/]sumneko\-3rd[\\\/]factorio[\\\/]library$/)?this.output.warn(`Lua.workspace.library: stale workspace link? (${_})`):_.endsWith("data")?this.output.warn(`Lua.workspace.library: stale data link? (${_})`):this.output.info(`Lua.workspace.library: other library (${_})`)}let h=i.get("runtime.plugin");if(!h)u||this.output.warn("Lua.runtime.plugin not present!");else{let f=_e.joinPath(s,"sumneko-3rd/factorio/plugin.lua").fsPath.replace(/[\\]/g,"/");h===f?u?this.output.warn(`Lua.runtime.plugin: redundant workspace link (${h})`):this.output.info(`Lua.runtime.plugin: OK (${h})`):this.output.warn(`Lua.runtime.plugin: wrong plugin? (${h})`)}}async disablePrototypeCacheCommand(){let e=await this.getActiveVersion();if(e?.onlineOnly)throw new Error("Select a local Factorio install to edit config");return e?.disablePrototypeCache()}async disableMouseAutoCaptureCommand(){let e=await this.getActiveVersion();if(e?.onlineOnly)throw new Error("Select a local Factorio install to edit config");return e?.disableMouseAutoCapture()}async selectVersionCommand(){if(q.debug.activeDebugSession?.type==="factoriomod"){q.window.showErrorMessage("Cannot select Factorio version while debugging.");return}let e=q.workspace.getConfiguration("factorio"),t=e.get("versions",[]),n=t.map(h=>h.factorioPath),i=(await Promise.all(hd.filter(h=>!n.includes(h.factorioPath)).map(async h=>{try{return(await Oe.stat(Re.file(sn(h.factorioPath,q.workspace.workspaceFolders)))).type&q.FileType.File?h:void 0}catch{return}}))).filter(h=>!!h),s=async h=>h.onlineDocs===!0?"latest":h.onlineDocs?h.onlineDocs:(await this.tryJsonDocs(h).catch(()=>{}))?.application_version??"unknown",o=await q.window.showQuickPick([{kind:q.QuickPickItemKind.Separator,label:"settings"},...await Promise.all(t.map(async h=>({fv:h,label:h.name,description:await s(h),detail:h.factorioPath}))),{kind:q.QuickPickItemKind.Separator,label:"autodetected"},...await Promise.all(i.map(async h=>({fv:h,label:h.name,description:await s(h),detail:h.factorioPath}))),{fv:ws,label:ws.name,description:await s(ws)},{fv:Cs,label:Cs.name,description:await s(Cs)},{kind:q.QuickPickItemKind.Separator,label:""},{fv:void 0,label:"Select another install locaton...",picked:!1}],{title:"Select Factorio Version"});if(!o)return;let a=o.fv;if(a?.factorioPath){let h=!1;try{(await Oe.stat(Re.file(sn(a.factorioPath,q.workspace.workspaceFolders)))).type&q.FileType.File&&(h=!0)}catch{}if(!h)if(await q.window.showErrorMessage("The selected factorio version is no longer present at the specified location","Remove from settings","Cancel")==="Remove from settings"){e.update("versions",t.filter(m=>m!==a));return}else return}let u=!1;if(!a){let h=await q.window.showOpenDialog({canSelectFiles:!0,canSelectFolders:!1,openLabel:"Select Factorio binary",filters:Ss.platform()==="win32"?{"":["exe"]}:void 0});if(!h)return;let f=await q.window.showInputBox({prompt:"Display Name for this version",placeHolder:"Enter a display name to be used in the Version Selector for this version",ignoreFocusOut:!0});if(!f)return;a={name:f,factorioPath:h[0].fsPath},u=!0}let l;try{l=await this.tryJsonDocs(a)}catch(h){if(!a.factorioPath){q.window.showErrorMessage(`Unable to read online docs: ${h}`);return}if(await q.window.showErrorMessage(`Unable to read JSON docs: ${h}`,"Select alternate location","Cancel")!=="Select alternate location")return;let f=await q.window.showOpenDialog({canSelectFiles:!0,canSelectFolders:!1,openLabel:"Select Runtime JSON Docs",title:"Select Runtime JSON Docs",filters:{"JSON Docs":["json"]}});if(!f)return;a.docsPath=kc.relative(sn(a.factorioPath,q.workspace.workspaceFolders),f[0].fsPath);try{l=await this.tryJsonDocs(a)}catch(m){q.window.showErrorMessage(`Unable to read JSON docs: ${m}`);return}}await this.context.workspaceState.update("active_version",a),u&&(t.push(a),e.update("versions",t)),this.bar.text=`Factorio ${l.application_version} (${a.name})`;let p=this._active_version;this._active_version=new ei(q.workspace.fs,a,l,q.workspace.workspaceFolders),this.output.info(`Active Factorio version: ${a.name} (${l.application_version})`),await this.generateDocs(p)}_active_version;async getActiveVersion(){return this._active_version||await this.selectVersionCommand(),this._active_version}async tryJsonDocs(e){let t;if(e.onlineDocs){let i=`https://lua-api.factorio.com/${e.onlineDocs===!0||e.onlineDocs==="throw"?"latest":e.onlineDocs}/runtime-api.json`,s=await fetch(i);if(!s.ok)throw new Error(`Error fetching ${i} : ${s.statusText}`);t=await s.text()}else{if(!e.factorioPath)throw new Error(`Invalid Config: requires at least one of factorioPath or onlineDocs in ${e.name}`);let n=_e.joinPath(Re.file(sn(e.factorioPath,q.workspace.workspaceFolders)),e.docsPath?e.docsPath:Ss.platform()==="darwin"?"../../doc-html/runtime-api.json":"../../../doc-html/runtime-api.json");t=(await Oe.readFile(n)).toString()}return new bc(t)}async wantsRegenFromConfigFileVersion(e,t){try{let n=(await Oe.readFile(e)).toString(),i=JSON.parse(n);return i.factorioVersion!==t.docs.application_version||i.bundleVersion!==$i}catch{return!0}}async checkDocs(){let e=await this.getActiveVersion();if(!e)return;let t=this.context.storageUri;if(!t)return;let n=!1;if(bs.some(o=>q.extensions.getExtension(o))&&(n||=await this.wantsRegenFromConfigFileVersion(_e.joinPath(t,"emmylua/factorio/config.json"),e)),q.extensions.getExtension("sumneko.lua")&&(n||=await this.wantsRegenFromConfigFileVersion(_e.joinPath(t,"sumneko-3rd/factorio/config.json"),e)),n)return this.generateDocs()}async generateDocs(e){if(!q.workspace.getConfiguration("factorio").get("docs.generateDocs",!0))return;let t=await this.getActiveVersion();if(!t)return;let n=this.context.storageUri;if(!n){q.window.showErrorMessage("Unable to generate docs: no open workspace");return}let i=bs.map(o=>q.extensions.getExtension(o)).find(o=>!!o);if(i){this.output.appendLine(`Generating EmmyLua bundle for ${i.id}`);let o=q.workspace.getConfiguration("factorio"),a=_e.joinPath(n,"emmylua");await this.refreshDocFiles(a,t);let u=await q.workspace.findFiles(".luarc.json"),l="{}";u.length>0&&(l=(await Oe.readFile(u[0])).toString()),l=Dn(l,Sn(l,["$schema"],"https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",{})),l=Dn(l,Sn(l,["runtime","version"],"Lua5.2",{})),l=Dn(l,Sn(l,["runtime","requirePattern"],["?","?.lua"],{}));let p=[_e.joinPath(a,"factorio","library").fsPath];o.get("workspace.manageLibraryDataLinks")!==!1&&(p.push(await t.dataPath()),p.push(await t.lualibPath())),l=Dn(l,Sn(l,["workspace","library"],p,{})),l=Dn(l,Sn(l,["diagnostics","disable"],["unnecessary-if"],{})),u.length>0?await Oe.writeFile(u[0],Buffer.from(l)):await Oe.writeFile(_e.joinPath(q.workspace.workspaceFolders[0].uri,".luarc.json"),Buffer.from(l))}let s=q.extensions.getExtension("sumneko.lua");if(s){this.output.appendLine(`Generating LuaLS bundle for ${s.id}`);let o=_e.joinPath(n,"sumneko-3rd");await this.refreshDocFiles(o,t);let a=q.workspace.getConfiguration("Lua"),u=a.get("workspace.library",[]),l=(g,...v)=>{if(g){let _=_e.joinPath(g,...v),T=u.indexOf(_.fsPath);T!==-1&&u.splice(T,1)}},p=async(g,...v)=>{try{let _=_e.joinPath(g,...v);!u.includes(_.fsPath)&&(await Oe.stat(_)).type&q.FileType.Directory&&u.push(_.fsPath)}catch{}},h=q.workspace.getConfiguration("factorio");if(e&&!e.onlineOnly){let g=Re.file(await e.dataPath());l(g)}if(u.length===0?await a.update("workspace.library",void 0):await a.update("workspace.library",u),h.get("workspace.manageLibraryDataLinks")===!0){let g=Re.file(await t.dataPath());await p(g)}u.length===0?await a.update("workspace.library",void 0):await a.update("workspace.library",u);let f=a.get("workspace.userThirdParty",[]);f=f.filter(g=>!g.includes("justarandomgeek.factoriomod-debug")),await a.update("workspace.userThirdParty",f),f.push(o.fsPath),await a.update("workspace.userThirdParty",f);let m=a.get("workspace.checkThirdParty");m&&["Ask","Apply","ApplyInMemory"].includes(m)||await a.update("workspace.checkThirdParty","ApplyInMemory"),s.isActive||await s.activate()}}async refreshDocFiles(e,t){await Oe.createDirectory(e);try{await Promise.allSettled([Oe.delete(_e.joinPath(e,"factorio","library"),{recursive:!0}),Oe.delete(_e.joinPath(e,"factorio","factorio-plugin"),{recursive:!0})])}catch{}let n=this.output,i=await tt({close(){},write(s){n.info(`docgen: ${s.trimEnd()}`)}},this.context.asAbsolutePath("./dist/fmtk-cli.js"),await t.docArgs(q.workspace.getConfiguration("factorio").get("docs.usePrototypeDumps",!1)),e.fsPath);if(i!==0){this.output.warn(`docgen return code ${i}`),await q.window.showErrorMessage("Error while generating docs","Show Output")==="Show Output"&&this.output.show();return}}};import*as zt from"path";import*as te from"vscode";var Ji=class{type;ctime;mtime;size;name;data;constructor(e){this.type=te.FileType.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}},on=class{type;ctime;mtime;size;name;entries;constructor(e){this.type=te.FileType.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}},Yi=class{root=new on("");stat(e){return this._lookup(e,!1)}readDirectory(e){let t=this._lookupAsDirectory(e,!1),n=[];for(let[i,s]of t.entries)n.push([i,s.type]);return n}readFile(e){let t=this._lookupAsFile(e,!1).data;if(t)return t;throw te.FileSystemError.FileNotFound()}writeFile(e,t,n){let i=zt.posix.basename(e.path),s=this._lookupParentDirectory(e),o=s.entries.get(i);if(o instanceof on)throw te.FileSystemError.FileIsADirectory(e);if(!o&&!n.create)throw te.FileSystemError.FileNotFound(e);if(o&&n.create&&!n.overwrite)throw te.FileSystemError.FileExists(e);o||(o=new Ji(i),s.entries.set(i,o),this._fireSoon({type:te.FileChangeType.Created,uri:e})),o.mtime=Date.now(),o.size=t.byteLength,o.data=t,this._fireSoon({type:te.FileChangeType.Changed,uri:e})}rename(e,t,n){if(!n.overwrite&&this._lookup(t,!0))throw te.FileSystemError.FileExists(t);let i=this._lookup(e,!1),s=this._lookupParentDirectory(e),o=this._lookupParentDirectory(t),a=zt.posix.basename(t.path);s.entries.delete(i.name),i.name=a,o.entries.set(a,i),this._fireSoon({type:te.FileChangeType.Deleted,uri:e},{type:te.FileChangeType.Created,uri:t})}delete(e,t){let n=e.with({path:zt.posix.dirname(e.path)}),i=zt.posix.basename(e.path),s=this._lookupAsDirectory(n,t?.silent??!1);if(!s||!s.entries.has(i)){if(t?.silent)return;throw te.FileSystemError.FileNotFound(e)}s.entries.delete(i),s.mtime=Date.now(),s.size-=1,this._fireSoon({type:te.FileChangeType.Changed,uri:n},{uri:e,type:te.FileChangeType.Deleted})}createDirectory(e){let t=zt.posix.basename(e.path),n=e.with({path:zt.posix.dirname(e.path)}),i=this._lookupAsDirectory(n,!1),s=new on(t);i.entries.set(s.name,s),i.mtime=Date.now(),i.size+=1,this._fireSoon({type:te.FileChangeType.Changed,uri:n},{type:te.FileChangeType.Created,uri:e})}_lookup(e,t){let n=e.path.split("/"),i=this.root;for(let s of n){if(!s)continue;let o;if(i instanceof on&&(o=i.entries.get(s)),!o){if(t)return;throw te.FileSystemError.FileNotFound(e)}i=o}return i}_lookupAsDirectory(e,t){let n=this._lookup(e,t);if(n instanceof on)return n;throw te.FileSystemError.FileNotADirectory(e)}_lookupAsFile(e,t){let n=this._lookup(e,t);if(n instanceof Ji)return n;throw te.FileSystemError.FileIsADirectory(e)}_lookupParentDirectory(e){let t=e.with({path:zt.posix.dirname(e.path)});return this._lookupAsDirectory(t,!1)}_emitter=new te.EventEmitter;_bufferedEvents=[];_fireSoonHandle;onDidChangeFile=this._emitter.event;watch(e){return new te.Disposable(()=>{})}_fireSoon(...e){this._bufferedEvents.push(...e),this._fireSoonHandle&&clearTimeout(this._fireSoonHandle),this._fireSoonHandle=setTimeout(()=>{this._emitter.fire(this._bufferedEvents),this._bufferedEvents.length=0},5)}};var Pi=Yn(jl(),1);import*as Nl from"path";import{workspace as Ll}from"vscode";function Ul(r){let e=r.asAbsolutePath(Nl.join("dist","fmtk-cli.js")),t={execArgv:["--nolazy","--inspect-brk=34199"]},n={run:{module:e,transport:Pi.TransportKind.ipc,args:["lsp"]},debug:{module:e,transport:Pi.TransportKind.ipc,args:["lsp"],options:t}},i={documentSelector:[{language:"factorio-locale"},{language:"factorio-changelog"},{language:"lua"}],synchronize:{fileEvents:[Ll.createFileSystemWatcher("**/locale/*/*.cfg"),Ll.createFileSystemWatcher("**/changelog.txt")]}},s=new Pi.LanguageClient("factorioLanguageServer","Factorio Language Server",n,i);s.start(),r.subscriptions.push({dispose(){return s.stop()}})}import*as Se from"vscode";function Kl(r){return r.type==="int"?{type:"int",value:lv("",r.value)}:r}function hc(r,e){return typeof e=="bigint"?`jsonbigint ${e}n`:e}function lv(r,e){if(typeof e=="string"){let t=e.match(/^jsonbigint\x01\x02 (\d+)n$/);if(t)return BigInt(t[1])}return e}function Ur(){let r="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<32;t++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}var Hl=Yn(Sc()),Wl=(0,Hl.decompressFromBase64)("DwQgIg8gwgKgmgBQKIAIAWAXAtgGwHwCwAUMJrijgIYB2A5gLwBEAptY4SWs5QCYcCQwLMwyUUAYzSUATgGcRTAKowAYgFoAHO2KCQatTsXyUY8QHtqGVhhTzxAV2kBLDAE8UABzM4n49xjMUCxx3ShwcMwB3CjNeJzoUJyxKWmZZFAAzaTMsdAwMD3SzaUzs3LNHFGYADytqWScLFB4naWZxAOlXABodGh4g6hCTcKjbcWcPDHSMKRspADdmE1sPdqcM3xRqC3FmADodfQEhETFMArVmAEd7JwWmKAs6jDUAZXbHF1c1BG9fVyMCTPaxMHjMDKUew4V6yaTiFAAch21GYiIA3IksLQ1HCEQAScSyDxvCrw5j4zGyNw4Zi4+EoQnE0mOPaUzLPekEokkslsqkTJxTLlIlF7NT4sUUjHaIiCYSibaUYRMBZOZiRLzSDBA8yWUGMSJOHizejgtXio0mtDdRLUFxOMK48RhZj0ACM+wADLLBD5qABrdBtDJMfEAWTMPA++XitFkAHVmAAjNUa/ZE2T4oFtHBMamuWmyLgiIEAehOGBctLwkYGMardFkwDLVYwNeILa4vA4wGTUdcJzsVYsAkEaHdeAAasw5I1qF3JzpBC0FokeKrZw0LOwW6uTmXh/OODpgAtZOZwWoPDRmDh0jJHWoqMm70wG3HZL7BOfL3Sb6iOBqKIybrkwIFqO67BvKI2r2B4La/lG/63kBIFjmeF7IdeqHAZQoHGuB+FqAATOwABK9iWEkywAOIRMmYSIVhV4AXeeHJhhSGsbhIFgYwEEAMwUVRVbCCgCCzigRizsxf44YBHFcSxKGKWm0SEYw6mQd+gggR2cr8EZwAYP2PDuJp1IyBg8G7q2ZmDsugitvhBnGWW3Gqex6nKfJbFAep/HaWRY56a5zChXpDn8dIok0WotAMWEdmmQOoUtvpEXLnJ2H+WoPnZZ5CneeqGkblppVqMJ6WZZFJnRZpsXUcI16zmo9jyNIKUOelLnJm5zlFXlBVyjlPGAbIJ6jVYWAeFQVj8fIsZ0LiGDOHQ34mdINUDOIVCyLI+YiI2OLUMqzApXwTkmVdhnGUVVi1Gomx3rt+2HYwS0nflYT2BdeBjXSj2vC9OC3UZzkYODxlQxI71HctOJ6mt3hfnVRXJvY+RNHtlAHQj33grSVhApQHhrDINB7Ewvg7iYziUM++FvowYB3iI/1OcZxI0HDeMfZetPUMCLR6sB0h42gdk89QdUeSpaiY9jsvXa20MZdtp6tsws3zVlRCnjNc2UAtlnHXGajUPYWCvl1GFrTtfP4595srWdwiXTt6MK8Dz3qmDTsfV9FsLL9F0oG4axMFbNuznZD01CD/vQ5DKc3YHBMW8j2T3rpP4K0rATC7jzvBytRMc6T5PcBL1DU4wQukwzTOvnmrPsyTkWCDLGeMILeoi0L4uS9LAFyxjWNF71UMYa2mujdrusm/rhs68bpvlWXOL9t4m0O9dsMl0HrunednsHyn+fyZI7QBv21S91vP04H98cKzf4h32Y1TT2nh/wy7RGahs6ozzpheShccYAKfhXEmJhq6Uzrm6Bueom5PhfCzNmxNOZ3W5gBXu/ccZRiHmtEeANDxjy5oDRWk9RyqxntlOeB4jZ6ymnpNeetFon2Ad4Yoe954Q3TkfTObsz7kIYXdG6dUMH4CeBEaQAAuFsMi6rxA8FjCOrgo5914V1R+3DQ4v2WE/cw8jn6vwrFQlRABBHAHgpBKLLCoqhCcnqgzevzEROJDF/VsNwxmPjw6R2QTHW2b95K+3cb/R2wjAHfRAbnb2EDaHF2gdw2B4cyYU1rvXRu9N0HMzblgyuXdgA91iYQ4uxCxakOLKPGg48C4pOiYw/eC8WHLzYSZDhy8uFAN4DwfhXsXE+0Tn7V6+j+k8B4JbMR1DInJxaZIiREMr7YR4NkDwPAoipM8XEi2AzgJaJwastZV4zBTGPNSdatBqEXJHCrXBZy6T3OPDvHAdzLl0KeeA7CrzRyhNkvLeS/zHmnN+ecr5ws0DGnBLLeIGBPkPNKUVUFeBTHFCRceKhwL1mbO2ZEMF7kVkww8aXbhCS0YjOScrSZ30BnJgwGweB2SqbILyY+RmMimDWOmXnbu+CKnVKIaLCwagBn1KJe5CeyslnEoERlHpVgukXkmDYYJTAsBRmhOHKUYYpTZlsPCMMdYPxNiTKmUq+wABWWYgTggyLOCsLZVVCgwL2MsPVOxljIPgIAA===");var Kr=class{constructor(e){this.context=e;this.context.subscriptions.push(Se.window.registerCustomEditorProvider("fmtk.modsettings",this,{supportsMultipleEditorsPerDocument:!1,webviewOptions:{retainContextWhenHidden:!0}}))}context;webviews=new Map;_onDidChangeCustomDocument=new Se.EventEmitter;onDidChangeCustomDocument=this._onDidChangeCustomDocument.event;async saveCustomDocument(e,t){return e.save(t)}async saveCustomDocumentAs(e,t,n){return e.saveAs(t,n)}async revertCustomDocument(e,t){return e.revert(t)}async backupCustomDocument(e,t,n){return e.backup(t.destination,n)}async openCustomDocument(e,t,n){let i=await pc.create(e,t.backupId),s=[];return s.push(i.onDidChange(o=>{this._onDidChangeCustomDocument.fire({document:i,...o})})),s.push(i.onDidChangeContent(o=>{let a=this.webviews.get(i.uri.toString());a&&this.postMessage(a,"init",{version:i.version,saves_ints:i.saves_ints,settings:JSON.stringify(i.settings,hc),editable:Se.workspace.fs.isWritableFileSystem(i.uri.scheme)!==!1})})),i.onDidDispose(()=>s.forEach(o=>o.dispose())),i}resolveCustomEditor(e,t,n){let i=t.webview;this.webviews.set(e.uri.toString(),t),i.options={enableScripts:!0},i.html=Wl.replace(/\$cspSource\$/g,i.cspSource).replace(/\$nonce\$/g,Ur()).replace(/\$ModSettingsWebview\.css\$/g,i.asWebviewUri(Se.Uri.joinPath(this.context.extensionUri,"/dist/ModSettingsWebview.css")).toString()).replace(/\$ModSettingsWebview\.js\$/g,i.asWebviewUri(Se.Uri.joinPath(this.context.extensionUri,"/dist/ModSettingsWebview.js")).toString()),t.webview.onDidReceiveMessage(s=>this.onMessage(e,s)),t.webview.onDidReceiveMessage(s=>{s.type==="ready"&&this.postMessage(t,"init",{version:e.version,saves_ints:e.saves_ints,settings:JSON.stringify(e.settings,hc),editable:Se.workspace.fs.isWritableFileSystem(e.uri.scheme)!==!1})})}postMessage(e,t,n){e.webview.postMessage({type:t,body:n})}onMessage(e,t){if(t.type==="edit"){e.edit(t.body);return}}},pc=class r{constructor(e,t){this.uri=e;this._settings=new ds(new Qn(t))}uri;static async create(e,t){let n=typeof t=="string"?Se.Uri.parse(t):e,i=await Se.workspace.fs.readFile(n);return new r(e,i)}_settings;get version(){return this._settings.version.format()}get saves_ints(){return this._settings.version.isBeyond(1,2)}get settings(){return this._settings.settings}async save(e){return this.saveAs(this.uri,e)}async saveAs(e,t){return Se.workspace.fs.writeFile(e,this._settings.save())}async revert(e){this._settings=new ds(new Qn(await Se.workspace.fs.readFile(this.uri))),this._onDidChangeDocument.fire({})}async backup(e,t){return await this.saveAs(e,t),{id:e.toString(),delete:()=>{Se.workspace.fs.delete(e)}}}edit(e){e.value.type==="none"?this._settings.set(e.scope,e.name,void 0):this._settings.set(e.scope,e.name,Kl(e.value)),this._onDidChange.fire({})}_onDidDispose=new Se.EventEmitter;onDidDispose=this._onDidDispose.event;_onDidChangeDocument=new Se.EventEmitter;onDidChangeContent=this._onDidChangeDocument.event;_onDidChange=new Se.EventEmitter;onDidChange=this._onDidChange.event;disposables=[this._onDidDispose,this._onDidChangeDocument,this._onDidChange];dispose(){this._onDidDispose.fire(),this.disposables.forEach(e=>e.dispose())}};import*as vn from"vscode";function Ti(r){switch(r.type){case"Table":case"TableWithMeta":return Object.assign({},r,{values:void 0,values_count:r.values.length});default:return r}}var $l=Yn(Sc()),Bl=(0,$l.decompressFromBase64)("DwQgIg8gwgKgmgBQKIAIAWAXAtgGwHwCwAUMJrijgIYB2A5gLwBEAptY4SWs5QCYcCQwLMwyUUAYzSUATgGcRTAKowAYgFoAHO2KCQatTsXyUY8QHtqGVhhTzxAV2kBLDAE8UABzM4n49xjMUCxx3ShwcMwB3CjNeJzoUJyxKWmZZFAAzaTMsdAwMD3SzaUzs3LNHFGYADytqWScLFB4naWZxAOlXABodGh4g6hCTcKjbcWcPDHSMKRspADdmE1sPdqcM3xRqC3FmADodfQEhETFMArVmAEd7JwWmKAs6jDUAZXbHF1c1BG9fVyMCTPaxMHjMDKUew4V6yaTiFAAch21GYiIA3IksLQ1HCEQAScSyDxvCrw5j4zGyNw4Zi4+EoQnE0mOPaUzLPekEokkslsqkTJxTLlIlF7NT4sUUjHaIiCYSibaUYRMBZOZiRLzSDBA8yWUGMSJOHizejgtXio0mtDdRLUFxOMK48RhZj0ACM+wADLLBD5qABrdBtDJMfFvQVTMCUDAAdWYACM1Rr9kTZPigW0cExqa5abIuCIgQB6E4YFy0vARyYYfbRjDAYvljCV4iNri8DjABNmHiuE52csWASCNDuvAANWYcka1Hb450ghaC0SPFV04aFnYjeXJ2Lg9nHB0wAPw8XpHH9co85HwGXq6Y2TMOtvxd3x/37SH1CPcpPkZsNw1iYLBe2hZggSlMMpQzWx4TDashQwet4yTdVIn2AArdMgXBDJp1LRtZAArtix7PtSLIfAgA===");import*as nn from"vscode";var Hr=class r{constructor(e,t){this.uri=e;this._data=new Pc(new Qn(t))}uri;static async create(e,t){let n=typeof t=="string"?nn.Uri.parse(t):e,i=await nn.workspace.fs.readFile(n);return new r(e,i)}_data;get version(){return this._data.version.format()}get rootdata(){let e={};for(let t in this._data.data)e[t]=Ti(this._data.data[t]);return e}find(e,t){return this._data.find(e,t)}_onDidDispose=new nn.EventEmitter;onDidDispose=this._onDidDispose.event;_onDidChangeDocument=new nn.EventEmitter;onDidChangeContent=this._onDidChangeDocument.event;_onDidChange=new nn.EventEmitter;onDidChange=this._onDidChange.event;disposables=[this._onDidDispose,this._onDidChangeDocument,this._onDidChange];dispose(){this._onDidDispose.fire(),this.disposables.forEach(e=>e.dispose())}};var Wr=class{constructor(e){this.context=e;this.context.subscriptions.push(vn.window.registerCustomEditorProvider("fmtk.scriptdat",this,{supportsMultipleEditorsPerDocument:!1,webviewOptions:{retainContextWhenHidden:!0}}))}context;webviews=new Map;_onDidChangeCustomDocument=new vn.EventEmitter;onDidChangeCustomDocument=this._onDidChangeCustomDocument.event;async openCustomDocument(e,t,n){let i=await Hr.create(e,t.backupId),s=[];return s.push(i.onDidChange(o=>{this._onDidChangeCustomDocument.fire({document:i,...o})})),s.push(i.onDidChangeContent(o=>{let a=this.webviews.get(i.uri.toString());a&&this.postMessage(a,"init",{version:i.version,data:i.rootdata})})),i.onDidDispose(()=>s.forEach(o=>o.dispose())),i}resolveCustomEditor(e,t,n){let i=t.webview;this.webviews.set(e.uri.toString(),t),i.options={enableScripts:!0},i.html=Bl.replace(/\$cspSource\$/g,i.cspSource).replace(/\$nonce\$/g,Ur()).replace(/\$ScriptDatWebview\.css\$/g,i.asWebviewUri(vn.Uri.joinPath(this.context.extensionUri,"/dist/ScriptDatWebview.css")).toString()).replace(/\$ScriptDatWebview\.js\$/g,i.asWebviewUri(vn.Uri.joinPath(this.context.extensionUri,"/dist/ScriptDatWebview.js")).toString()),t.webview.onDidReceiveMessage(s=>this.onMessage(e,s)),t.webview.onDidReceiveMessage(s=>{s.type==="ready"&&this.postMessage(t,"init",{version:e.version,data:e.rootdata})})}postMessage(e,t,n){e.webview.postMessage({type:t,body:n})}onMessage(e,t){if(t.type==="fetch"){let n=t.body,i=e.find(n.modname,n.gcid),s;n.index!==void 0&&n.count!==void 0?s=i.values.slice(n.index,n.index+n.count):s=i.values,this.postMessage(this.webviews.get(e.uri.toString()),"values",{...n,values:s.map(o=>({key:Ti(o.key),value:Ti(o.value)}))})}}};async function w_(r){let e=W.window.createOutputChannel("FMTK",{log:!0});e.info(`FMTK ${$i}`);try{e.info("Registering FS Provider...");let t=new Yi;r.subscriptions.push(W.workspace.registerFileSystemProvider("fmtk",t,{isCaseSensitive:!0})),e.info("Registering Version Selector...");let n=new Gi(r,e,t);e.info("Registering Native Debug Provider...");let i=new gc(n);r.subscriptions.push(W.debug.registerDebugConfigurationProvider("factorio",i)),r.subscriptions.push(W.debug.registerDebugAdapterDescriptorFactory("factorio",i)),r.subscriptions.push(i),e.info("Registering Language Client..."),Ul(r),e.info("Registering Mod Package Provider..."),await Tc(r),e.info("Registering Custom Editors..."),new Kr(r),new Wr(r),e.info("Activate Complete")}catch(t){e.error(`Error while activating: ${t}`)}}var gc=class{constructor(e){this.versionSelector=e;this.disposables.push(W.debug.onDidReceiveDebugSessionCustomEvent(async t=>{if(t.session.type==="factorio")switch(t.event){case"profileRunning":await W.commands.executeCommand("setContext","factorio.debugProfileStarting",!1),await W.commands.executeCommand("setContext","factorio.debugProfileStopping",!1),await W.commands.executeCommand("setContext","factorio.debugProfileIsRunning",!0);break;case"profileComplete":await W.commands.executeCommand("setContext","factorio.debugProfileStarting",!1),await W.commands.executeCommand("setContext","factorio.debugProfileStopping",!1),await W.commands.executeCommand("setContext","factorio.debugProfileIsRunning",!1),await W.commands.executeCommand("vscode.open",W.Uri.file(t.body.path));break;default:break}})),this.disposables.push(W.commands.registerCommand("factorio.startProfile",async()=>{let t=W.debug.activeDebugSession;t&&(await W.commands.executeCommand("setContext","factorio.debugProfileStarting",!0),await W.commands.executeCommand("setContext","factorio.debugProfileStopping",!1),await W.commands.executeCommand("setContext","factorio.debugProfileIsRunning",!1),await t.customRequest("startProfile",{}))})),this.disposables.push(W.commands.registerCommand("factorio.stopProfile",async()=>{let t=W.debug.activeDebugSession;t&&(await W.commands.executeCommand("setContext","factorio.debugProfileStarting",!1),await W.commands.executeCommand("setContext","factorio.debugProfileStopping",!0),await W.commands.executeCommand("setContext","factorio.debugProfileIsRunning",!0),await t.customRequest("stopProfile",{}))}))}versionSelector;async resolveDebugConfigurationWithSubstitutedVariables(e,t,n){if(!await this.versionSelector.getActiveVersion())return;let s=W.workspace.getConfiguration("factorio.debug").get("env",{});return t.env={...s,...t.env,SteamAppId:"427520"},t}async createDebugAdapterDescriptor(e,t){let n=await this.versionSelector.getActiveVersion();if(!n)return;if(n.onlineOnly)throw new Error("Cannot debug online docs. Select a local Factorio install to debug.");await W.commands.executeCommand("setContext","factorio.debugProfileStarting",!1),await W.commands.executeCommand("setContext","factorio.debugProfileStopping",!1),await W.commands.executeCommand("setContext","factorio.debugProfileIsRunning",!1);let s=W.workspace.getConfiguration("factorio.debug").get("shim");return s?new W.DebugAdapterExecutable(s,[n.factorioPath,"--dap"],{env:e.configuration.env}):new W.DebugAdapterExecutable(n.factorioPath,["--dap"],{env:e.configuration.env})}disposables=[];dispose(){this.disposables.forEach(e=>e.dispose())}};export{w_ as activate};
22
38
  //# sourceMappingURL=fmtk-vscode.js.map