devicetree-language-server 0.0.6 → 0.0.8

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.
Files changed (3) hide show
  1. package/README.md +193 -0
  2. package/dist/server.js +98 -98
  3. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -1,110 +1,110 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var kw=Object.create;var Pp=Object.defineProperty;var Ew=Object.getOwnPropertyDescriptor;var ww=Object.getOwnPropertyNames;var Nw=Object.getPrototypeOf,_w=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Pw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ww(e))!_w.call(n,r)&&r!==t&&Pp(n,r,{get:()=>e[r],enumerable:!(i=Ew(e,r))||i.enumerable});return n};var G=(n,e,t)=>(t=n!=null?kw(Nw(n)):{},Pw(e||!n||!n.__esModule?Pp(t,"default",{value:n,enumerable:!0}):t,n));var Wo=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.thenable=He.typedArray=He.stringArray=He.array=He.func=He.error=He.number=He.string=He.boolean=void 0;function Dw(n){return n===!0||n===!1}He.boolean=Dw;function Dp(n){return typeof n=="string"||n instanceof String}He.string=Dp;function Rw(n){return typeof n=="number"||n instanceof Number}He.number=Rw;function Cw(n){return n instanceof Error}He.error=Cw;function Rp(n){return typeof n=="function"}He.func=Rp;function Cp(n){return Array.isArray(n)}He.array=Cp;function Ow(n){return Cp(n)&&n.every(e=>Dp(e))}He.stringArray=Ow;function Aw(n,e){return Array.isArray(n)&&n.every(e)}He.typedArray=Aw;function Iw(n){return n&&Rp(n.then)}He.thenable=Iw});var sr=C(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function Lw(n){return n===!0||n===!1}mt.boolean=Lw;function Op(n){return typeof n=="string"||n instanceof String}mt.string=Op;function xw(n){return typeof n=="number"||n instanceof Number}mt.number=xw;function Mw(n){return n instanceof Error}mt.error=Mw;function qw(n){return typeof n=="function"}mt.func=qw;function Ap(n){return Array.isArray(n)}mt.array=Ap;function Fw(n){return Ap(n)&&n.every(e=>Op(e))}mt.stringArray=Fw});var Cu=C(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Message=Y.NotificationType9=Y.NotificationType8=Y.NotificationType7=Y.NotificationType6=Y.NotificationType5=Y.NotificationType4=Y.NotificationType3=Y.NotificationType2=Y.NotificationType1=Y.NotificationType0=Y.NotificationType=Y.RequestType9=Y.RequestType8=Y.RequestType7=Y.RequestType6=Y.RequestType5=Y.RequestType4=Y.RequestType3=Y.RequestType2=Y.RequestType1=Y.RequestType=Y.RequestType0=Y.AbstractMessageSignature=Y.ParameterStructures=Y.ResponseError=Y.ErrorCodes=void 0;var Ii=sr(),ou;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(ou||(Y.ErrorCodes=ou={}));var au=class n extends Error{constructor(e,t,i){super(t),this.code=Ii.number(e)?e:ou.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Y.ResponseError=au;var Pt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Y.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var Oe=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Pt.auto}};Y.AbstractMessageSignature=Oe;var cu=class extends Oe{constructor(e){super(e,0)}};Y.RequestType0=cu;var lu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType=lu;var uu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType1=uu;var fu=class extends Oe{constructor(e){super(e,2)}};Y.RequestType2=fu;var du=class extends Oe{constructor(e){super(e,3)}};Y.RequestType3=du;var hu=class extends Oe{constructor(e){super(e,4)}};Y.RequestType4=hu;var pu=class extends Oe{constructor(e){super(e,5)}};Y.RequestType5=pu;var mu=class extends Oe{constructor(e){super(e,6)}};Y.RequestType6=mu;var gu=class extends Oe{constructor(e){super(e,7)}};Y.RequestType7=gu;var yu=class extends Oe{constructor(e){super(e,8)}};Y.RequestType8=yu;var bu=class extends Oe{constructor(e){super(e,9)}};Y.RequestType9=bu;var Tu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType=Tu;var vu=class extends Oe{constructor(e){super(e,0)}};Y.NotificationType0=vu;var Su=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType1=Su;var ku=class extends Oe{constructor(e){super(e,2)}};Y.NotificationType2=ku;var Eu=class extends Oe{constructor(e){super(e,3)}};Y.NotificationType3=Eu;var wu=class extends Oe{constructor(e){super(e,4)}};Y.NotificationType4=wu;var Nu=class extends Oe{constructor(e){super(e,5)}};Y.NotificationType5=Nu;var _u=class extends Oe{constructor(e){super(e,6)}};Y.NotificationType6=_u;var Pu=class extends Oe{constructor(e){super(e,7)}};Y.NotificationType7=Pu;var Du=class extends Oe{constructor(e){super(e,8)}};Y.NotificationType8=Du;var Ru=class extends Oe{constructor(e){super(e,9)}};Y.NotificationType9=Ru;var Ip;(function(n){function e(r){let s=r;return s&&Ii.string(s.method)&&(Ii.string(s.id)||Ii.number(s.id))}n.isRequest=e;function t(r){let s=r;return s&&Ii.string(s.method)&&r.id===void 0}n.isNotification=t;function i(r){let s=r;return s&&(s.result!==void 0||!!s.error)&&(Ii.string(s.id)||Ii.number(s.id)||s.id===null)}n.isResponse=i})(Ip||(Y.Message=Ip={}))});var Au=C(Yn=>{"use strict";var Lp;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LRUCache=Yn.LinkedMap=Yn.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt||(Yn.Touch=gt={}));var Vo=class{constructor(){this[Lp]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=gt.None){let i=this._map.get(e);if(i)return t!==gt.None&&this.touch(i,t),i.value}set(e,t,i=gt.None){let r=this._map.get(e);if(r)r.value=t,i!==gt.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case gt.None:this.addItemLast(r);break;case gt.First:this.addItemFirst(r);break;case gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.key,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}values(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.value,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}entries(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:[t.key,t.value],done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}[(Lp=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Yn.LinkedMap=Vo;var Ou=class extends Vo{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yn.LRUCache=Ou});var Mp=C(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Disposable=void 0;var xp;(function(n){function e(t){return{dispose:t}}n.create=e})(xp||(Ho.Disposable=xp={}))});var Kn=C(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});var Iu;function Lu(){if(Iu===void 0)throw new Error("No runtime abstraction layer installed");return Iu}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Iu=t}n.install=e})(Lu||(Lu={}));xu.default=Lu});var ar=C(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.Emitter=or.Event=void 0;var Bw=Kn(),qp;(function(n){let e={dispose(){}};n.None=function(){return e}})(qp||(or.Event=qp={}));var Mu=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let r=0,s=this._callbacks.length;r<s;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),r=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(r[s],e))}catch(a){(0,Bw.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Yo=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new Mu),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};or.Emitter=Yo;Yo._noop=function(){}});var Go=C(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.CancellationTokenSource=cr.CancellationToken=void 0;var jw=Kn(),Uw=sr(),qu=ar(),Ko;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:qu.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qu.Event.None});function e(t){let i=t;return i&&(i===n.None||i===n.Cancelled||Uw.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Ko||(cr.CancellationToken=Ko={}));var $w=Object.freeze(function(n,e){let t=(0,jw.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),zo=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?$w:(this._emitter||(this._emitter=new qu.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Fu=class{get token(){return this._token||(this._token=new zo),this._token}cancel(){this._token?this._token.cancel():this._token=Ko.Cancelled}dispose(){this._token?this._token instanceof zo&&this._token.dispose():this._token=Ko.None}};cr.CancellationTokenSource=Fu});var Fp=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.SharedArrayReceiverStrategy=lr.SharedArraySenderStrategy=void 0;var Ww=Go(),fs;(function(n){n.Continue=0,n.Cancelled=1})(fs||(fs={}));var Bu=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=fs.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let i=this.buffers.get(t);if(i===void 0)return;let r=new Int32Array(i,0,1);Atomics.store(r,0,fs.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};lr.SharedArraySenderStrategy=Bu;var ju=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===fs.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Uu=class{constructor(e){this.token=new ju(e)}cancel(){}dispose(){}},$u=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new Ww.CancellationTokenSource:new Uu(t)}};lr.SharedArrayReceiverStrategy=$u});var Vu=C(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Semaphore=void 0;var Vw=Kn(),Wu=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,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Vw.default)().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(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Xo.Semaphore=Wu});var jp=C(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ReadableStreamMessageReader=zn.AbstractMessageReader=zn.MessageReader=void 0;var Yu=Kn(),ur=sr(),Hu=ar(),Hw=Vu(),Bp;(function(n){function e(t){let i=t;return i&&ur.func(i.listen)&&ur.func(i.dispose)&&ur.func(i.onError)&&ur.func(i.onClose)&&ur.func(i.onPartialMessage)}n.is=e})(Bp||(zn.MessageReader=Bp={}));var Qo=class{constructor(){this.errorEmitter=new Hu.Emitter,this.closeEmitter=new Hu.Emitter,this.partialMessageEmitter=new Hu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ur.string(e.message)?e.message:"unknown"}`)}};zn.AbstractMessageReader=Qo;var Ku;(function(n){function e(t){let i,r,s,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Yu.default)().applicationJson.decoder,c.set(a.name,a)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Ku||(Ku={}));var zu=class extends Qo{constructor(e,t){super(),this.readable=e,this.options=Ku.fromOptions(t),this.buffer=(0,Yu.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Hw.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let r=i.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property.
3
- ${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(r);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=s}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,r=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(r)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Yu.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};zn.ReadableStreamMessageReader=zu});var Hp=C(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.WriteableStreamMessageWriter=Gn.AbstractMessageWriter=Gn.MessageWriter=void 0;var Up=Kn(),ds=sr(),Yw=Vu(),$p=ar(),Kw="Content-Length: ",Wp=`\r
4
- `,Vp;(function(n){function e(t){let i=t;return i&&ds.func(i.dispose)&&ds.func(i.onClose)&&ds.func(i.onError)&&ds.func(i.write)}n.is=e})(Vp||(Gn.MessageWriter=Vp={}));var Jo=class{constructor(){this.errorEmitter=new $p.Emitter,this.closeEmitter=new $p.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ds.string(e.message)?e.message:"unknown"}`)}};Gn.AbstractMessageWriter=Jo;var Gu;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Up.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Up.default)().applicationJson.encoder}}n.fromOptions=e})(Gu||(Gu={}));var Xu=class extends Jo{constructor(e,t){super(),this.writable=e,this.options=Gu.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Yw.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let r=[];return r.push(Kw,i.byteLength.toString(),Wp),r.push(Wp),this.doWrite(e,r,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Gn.WriteableStreamMessageWriter=Xu});var Yp=C(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.AbstractMessageBuffer=void 0;var zw=13,Gw=10,Xw=`\r
5
- `,Qu=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,r=0,s=0;e:for(;i<this._chunks.length;){let l=this._chunks[i];for(r=0;r<l.length;){switch(l[r]){case zw:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case Gw:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}s+=l.byteLength,i++}if(t!==4)return;let o=this._read(s+r),a=new Map,c=this.toString(o,"ascii").split(Xw);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
6
- ${u}`);let p=u.substr(0,d),g=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let s=this._chunks[r];if(s.byteLength>e){let o=s.slice(0,e);t.set(o,i),i+=e,this._chunks[r]=s.slice(e),this._totalLength-=e,e-=e}else t.set(s,i),i+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return t}};Zo.AbstractMessageBuffer=Qu});var Qp=C(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.createMessageConnection=te.ConnectionOptions=te.MessageStrategy=te.CancellationStrategy=te.CancellationSenderStrategy=te.CancellationReceiverStrategy=te.RequestCancellationReceiverStrategy=te.IdCancellationReceiverStrategy=te.ConnectionStrategy=te.ConnectionError=te.ConnectionErrors=te.LogTraceNotification=te.SetTraceNotification=te.TraceFormat=te.TraceValues=te.Trace=te.NullLogger=te.ProgressType=te.ProgressToken=void 0;var Kp=Kn(),qe=sr(),X=Cu(),zp=Au(),hs=ar(),Ju=Go(),gs;(function(n){n.type=new X.NotificationType("$/cancelRequest")})(gs||(gs={}));var Zu;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Zu||(te.ProgressToken=Zu={}));var ps;(function(n){n.type=new X.NotificationType("$/progress")})(ps||(ps={}));var ef=class{constructor(){}};te.ProgressType=ef;var tf;(function(n){function e(t){return qe.func(t)}n.is=e})(tf||(tf={}));te.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var me;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(me||(te.Trace=me={}));var Gp;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(Gp||(te.TraceValues=Gp={}));(function(n){function e(i){if(!qe.string(i))return n.Off;switch(i=i.toLowerCase(),i){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(i){switch(i){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(me||(te.Trace=me={}));var xt;(function(n){n.Text="text",n.JSON="json"})(xt||(te.TraceFormat=xt={}));(function(n){function e(t){return qe.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(xt||(te.TraceFormat=xt={}));var nf;(function(n){n.type=new X.NotificationType("$/setTrace")})(nf||(te.SetTraceNotification=nf={}));var ea;(function(n){n.type=new X.NotificationType("$/logTrace")})(ea||(te.LogTraceNotification=ea={}));var ms;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(ms||(te.ConnectionErrors=ms={}));var fr=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};te.ConnectionError=fr;var rf;(function(n){function e(t){let i=t;return i&&qe.func(i.cancelUndispatched)}n.is=e})(rf||(te.ConnectionStrategy=rf={}));var ta;(function(n){function e(t){let i=t;return i&&(i.kind===void 0||i.kind==="id")&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(ta||(te.IdCancellationReceiverStrategy=ta={}));var sf;(function(n){function e(t){let i=t;return i&&i.kind==="request"&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(sf||(te.RequestCancellationReceiverStrategy=sf={}));var na;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Ju.CancellationTokenSource}});function e(t){return ta.is(t)||sf.is(t)}n.is=e})(na||(te.CancellationReceiverStrategy=na={}));var ia;(function(n){n.Message=Object.freeze({sendCancellation(t,i){return t.sendNotification(gs.type,{id:i})},cleanup(t){}});function e(t){let i=t;return i&&qe.func(i.sendCancellation)&&qe.func(i.cleanup)}n.is=e})(ia||(te.CancellationSenderStrategy=ia={}));var ra;(function(n){n.Message=Object.freeze({receiver:na.Message,sender:ia.Message});function e(t){let i=t;return i&&na.is(i.receiver)&&ia.is(i.sender)}n.is=e})(ra||(te.CancellationStrategy=ra={}));var sa;(function(n){function e(t){let i=t;return i&&qe.func(i.handleMessage)}n.is=e})(sa||(te.MessageStrategy=sa={}));var Xp;(function(n){function e(t){let i=t;return i&&(ra.is(i.cancellationStrategy)||rf.is(i.connectionStrategy)||sa.is(i.messageStrategy))}n.is=e})(Xp||(te.ConnectionOptions=Xp={}));var tn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(tn||(tn={}));function Qw(n,e,t,i){let r=t!==void 0?t:te.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,p=new Map,g=new Map,_,b=new zp.LinkedMap,w=new Map,R=new Set,v=new Map,T=me.Off,N=xt.Text,L,q=tn.New,H=new hs.Emitter,j=new hs.Emitter,ie=new hs.Emitter,Be=new hs.Emitter,Et=new hs.Emitter,ce=i&&i.cancellationStrategy?i.cancellationStrategy:ra.Message;function On(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function Zi(S){return S===null?"res-unknown-"+(++a).toString():"res-"+S.toString()}function Po(){return"not-"+(++o).toString()}function su(S,I){X.Message.isRequest(I)?S.set(On(I.id),I):X.Message.isResponse(I)?S.set(Zi(I.id),I):S.set(Po(),I)}function Do(S){}function ss(){return q===tn.Listening}function Ci(){return q===tn.Closed}function An(){return q===tn.Disposed}function er(){(q===tn.New||q===tn.Listening)&&(q=tn.Closed,j.fire(void 0))}function Oi(S){H.fire([S,void 0,void 0])}function Ro(S){H.fire(S)}n.onClose(er),n.onError(Oi),e.onClose(er),e.onError(Ro);function os(){_||b.size===0||(_=(0,Kp.default)().timer.setImmediate(()=>{_=void 0,Co()}))}function as(S){X.Message.isRequest(S)?Ao(S):X.Message.isNotification(S)?Lo(S):X.Message.isResponse(S)?Io(S):tr(S)}function Co(){if(b.size===0)return;let S=b.shift();try{let I=i?.messageStrategy;sa.is(I)?I.handleMessage(S,as):as(S)}finally{os()}}let Oo=S=>{try{if(X.Message.isNotification(S)&&S.method===gs.type.method){let I=S.params.id,B=On(I),W=b.get(B);if(X.Message.isRequest(W)){let ge=i?.connectionStrategy,Ce=ge&&ge.cancelUndispatched?ge.cancelUndispatched(W,Do):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){b.delete(B),v.delete(I),Ce.id=W.id,Ai(Ce,S.method,Date.now()),e.write(Ce).catch(()=>r.error("Sending response for canceled message failed."));return}}let ke=v.get(I);if(ke!==void 0){ke.cancel(),nr(S);return}else R.add(I)}su(b,S)}finally{os()}};function Ao(S){if(An())return;function I(se,Ee,fe){let je={jsonrpc:c,id:S.id};se instanceof X.ResponseError?je.error=se.toJson():je.result=se===void 0?null:se,Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function B(se,Ee,fe){let je={jsonrpc:c,id:S.id,error:se.toJson()};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function W(se,Ee,fe){se===void 0&&(se=null);let je={jsonrpc:c,id:S.id,result:se};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}qo(S);let ke=u.get(S.method),ge,Ce;ke&&(ge=ke.type,Ce=ke.handler);let Le=Date.now();if(Ce||l){let se=S.id??String(Date.now()),Ee=ta.is(ce.receiver)?ce.receiver.createCancellationTokenSource(se):ce.receiver.createCancellationTokenSource(S);S.id!==null&&R.has(S.id)&&Ee.cancel(),S.id!==null&&v.set(se,Ee);try{let fe;if(Ce)if(S.params===void 0){if(ge!==void 0&&ge.numberOfParams!==0){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines ${ge.numberOfParams} params but received none.`),S.method,Le);return}fe=Ce(Ee.token)}else if(Array.isArray(S.params)){if(ge!==void 0&&ge.parameterStructures===X.ParameterStructures.byName){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,Le);return}fe=Ce(...S.params,Ee.token)}else{if(ge!==void 0&&ge.parameterStructures===X.ParameterStructures.byPosition){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,Le);return}fe=Ce(S.params,Ee.token)}else l&&(fe=l(S.method,S.params,Ee.token));let je=fe;fe?je.then?je.then(nt=>{v.delete(se),I(nt,S.method,Le)},nt=>{v.delete(se),nt instanceof X.ResponseError?B(nt,S.method,Le):nt&&qe.string(nt.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${nt.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}):(v.delete(se),I(fe,S.method,Le)):(v.delete(se),W(fe,S.method,Le))}catch(fe){v.delete(se),fe instanceof X.ResponseError?I(fe,S.method,Le):fe&&qe.string(fe.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${fe.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}}else B(new X.ResponseError(X.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,Le)}function Io(S){if(!An())if(S.id===null)S.error?r.error(`Received response message without id: Error is:
7
- ${JSON.stringify(S.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let I=S.id,B=w.get(I);if(Fo(S,B),B!==void 0){w.delete(I);try{if(S.error){let W=S.error;B.reject(new X.ResponseError(W.code,W.message,W.data))}else if(S.result!==void 0)B.resolve(S.result);else throw new Error("Should never happen.")}catch(W){W.message?r.error(`Response handler '${B.method}' failed with message: ${W.message}`):r.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function Lo(S){if(An())return;let I,B;if(S.method===gs.type.method){let W=S.params.id;R.delete(W),nr(S);return}else{let W=p.get(S.method);W&&(B=W.handler,I=W.type)}if(B||d)try{if(nr(S),B)if(S.params===void 0)I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received none.`),B();else if(Array.isArray(S.params)){let W=S.params;S.method===ps.type.method&&W.length===2&&Zu.is(W[0])?B({token:W[0],value:W[1]}):(I!==void 0&&(I.parameterStructures===X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines parameters by name but received parameters by position`),I.numberOfParams!==S.params.length&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received ${W.length} arguments`)),B(...W))}else I!==void 0&&I.parameterStructures===X.ParameterStructures.byPosition&&r.error(`Notification ${S.method} defines parameters by position but received parameters by name`),B(S.params);else d&&d(S.method,S.params)}catch(W){W.message?r.error(`Notification handler '${S.method}' failed with message: ${W.message}`):r.error(`Notification handler '${S.method}' failed unexpectedly.`)}else ie.fire(S)}function tr(S){if(!S){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
8
- ${JSON.stringify(S,null,4)}`);let I=S;if(qe.string(I.id)||qe.number(I.id)){let B=I.id,W=w.get(B);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function Jt(S){if(S!=null)switch(T){case me.Verbose:return JSON.stringify(S,null,4);case me.Compact:return JSON.stringify(S);default:return}}function xo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Jt(S.params)}
2
+ "use strict";var Pw=Object.create;var Rp=Object.defineProperty;var Dw=Object.getOwnPropertyDescriptor;var Rw=Object.getOwnPropertyNames;var Cw=Object.getPrototypeOf,Ow=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Aw=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Rw(e))!Ow.call(n,r)&&r!==t&&Rp(n,r,{get:()=>e[r],enumerable:!(i=Dw(e,r))||i.enumerable});return n};var z=(n,e,t)=>(t=n!=null?Pw(Cw(n)):{},Aw(e||!n||!n.__esModule?Rp(t,"default",{value:n,enumerable:!0}):t,n));var Ho=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.thenable=He.typedArray=He.stringArray=He.array=He.func=He.error=He.number=He.string=He.boolean=void 0;function Iw(n){return n===!0||n===!1}He.boolean=Iw;function Cp(n){return typeof n=="string"||n instanceof String}He.string=Cp;function Lw(n){return typeof n=="number"||n instanceof Number}He.number=Lw;function xw(n){return n instanceof Error}He.error=xw;function Op(n){return typeof n=="function"}He.func=Op;function Ap(n){return Array.isArray(n)}He.array=Ap;function Mw(n){return Ap(n)&&n.every(e=>Cp(e))}He.stringArray=Mw;function qw(n,e){return Array.isArray(n)&&n.every(e)}He.typedArray=qw;function Fw(n){return n&&Op(n.then)}He.thenable=Fw});var or=C(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function Bw(n){return n===!0||n===!1}mt.boolean=Bw;function Ip(n){return typeof n=="string"||n instanceof String}mt.string=Ip;function jw(n){return typeof n=="number"||n instanceof Number}mt.number=jw;function Uw(n){return n instanceof Error}mt.error=Uw;function $w(n){return typeof n=="function"}mt.func=$w;function Lp(n){return Array.isArray(n)}mt.array=Lp;function Ww(n){return Lp(n)&&n.every(e=>Ip(e))}mt.stringArray=Ww});var Ou=C(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.Message=Y.NotificationType9=Y.NotificationType8=Y.NotificationType7=Y.NotificationType6=Y.NotificationType5=Y.NotificationType4=Y.NotificationType3=Y.NotificationType2=Y.NotificationType1=Y.NotificationType0=Y.NotificationType=Y.RequestType9=Y.RequestType8=Y.RequestType7=Y.RequestType6=Y.RequestType5=Y.RequestType4=Y.RequestType3=Y.RequestType2=Y.RequestType1=Y.RequestType=Y.RequestType0=Y.AbstractMessageSignature=Y.ParameterStructures=Y.ResponseError=Y.ErrorCodes=void 0;var Ii=or(),au;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(au||(Y.ErrorCodes=au={}));var cu=class n extends Error{constructor(e,t,i){super(t),this.code=Ii.number(e)?e:au.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Y.ResponseError=cu;var Pt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Y.ParameterStructures=Pt;Pt.auto=new Pt("auto");Pt.byPosition=new Pt("byPosition");Pt.byName=new Pt("byName");var Oe=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Pt.auto}};Y.AbstractMessageSignature=Oe;var lu=class extends Oe{constructor(e){super(e,0)}};Y.RequestType0=lu;var uu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType=uu;var fu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.RequestType1=fu;var du=class extends Oe{constructor(e){super(e,2)}};Y.RequestType2=du;var hu=class extends Oe{constructor(e){super(e,3)}};Y.RequestType3=hu;var pu=class extends Oe{constructor(e){super(e,4)}};Y.RequestType4=pu;var mu=class extends Oe{constructor(e){super(e,5)}};Y.RequestType5=mu;var gu=class extends Oe{constructor(e){super(e,6)}};Y.RequestType6=gu;var yu=class extends Oe{constructor(e){super(e,7)}};Y.RequestType7=yu;var bu=class extends Oe{constructor(e){super(e,8)}};Y.RequestType8=bu;var Tu=class extends Oe{constructor(e){super(e,9)}};Y.RequestType9=Tu;var vu=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType=vu;var Su=class extends Oe{constructor(e){super(e,0)}};Y.NotificationType0=Su;var ku=class extends Oe{constructor(e,t=Pt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Y.NotificationType1=ku;var Eu=class extends Oe{constructor(e){super(e,2)}};Y.NotificationType2=Eu;var wu=class extends Oe{constructor(e){super(e,3)}};Y.NotificationType3=wu;var Nu=class extends Oe{constructor(e){super(e,4)}};Y.NotificationType4=Nu;var _u=class extends Oe{constructor(e){super(e,5)}};Y.NotificationType5=_u;var Pu=class extends Oe{constructor(e){super(e,6)}};Y.NotificationType6=Pu;var Du=class extends Oe{constructor(e){super(e,7)}};Y.NotificationType7=Du;var Ru=class extends Oe{constructor(e){super(e,8)}};Y.NotificationType8=Ru;var Cu=class extends Oe{constructor(e){super(e,9)}};Y.NotificationType9=Cu;var xp;(function(n){function e(r){let s=r;return s&&Ii.string(s.method)&&(Ii.string(s.id)||Ii.number(s.id))}n.isRequest=e;function t(r){let s=r;return s&&Ii.string(s.method)&&r.id===void 0}n.isNotification=t;function i(r){let s=r;return s&&(s.result!==void 0||!!s.error)&&(Ii.string(s.id)||Ii.number(s.id)||s.id===null)}n.isResponse=i})(xp||(Y.Message=xp={}))});var Iu=C(Kn=>{"use strict";var Mp;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.LRUCache=Kn.LinkedMap=Kn.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt||(Kn.Touch=gt={}));var Yo=class{constructor(){this[Mp]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=gt.None){let i=this._map.get(e);if(i)return t!==gt.None&&this.touch(i,t),i.value}set(e,t,i=gt.None){let r=this._map.get(e);if(r)r.value=t,i!==gt.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case gt.None:this.addItemLast(r);break;case gt.First:this.addItemFirst(r);break;case gt.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.key,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}values(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:t.value,done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}entries(){let e=this._state,t=this._head,i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let r={value:[t.key,t.value],done:!1};return t=t.next,r}else return{value:void 0,done:!0}}};return i}[(Mp=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(let[t,i]of e)this.set(t,i)}};Kn.LinkedMap=Yo;var Au=class extends Yo{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Kn.LRUCache=Au});var Fp=C(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Disposable=void 0;var qp;(function(n){function e(t){return{dispose:t}}n.create=e})(qp||(Ko.Disposable=qp={}))});var zn=C(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});var Lu;function xu(){if(Lu===void 0)throw new Error("No runtime abstraction layer installed");return Lu}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Lu=t}n.install=e})(xu||(xu={}));Mu.default=xu});var cr=C(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.Emitter=ar.Event=void 0;var Vw=zn(),Bp;(function(n){let e={dispose(){}};n.None=function(){return e}})(Bp||(ar.Event=Bp={}));var qu=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let r=0,s=this._callbacks.length;r<s;r++)if(this._callbacks[r]===e)if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],i=this._callbacks.slice(0),r=this._contexts.slice(0);for(let s=0,o=i.length;s<o;s++)try{t.push(i[s].apply(r[s],e))}catch(a){(0,Vw.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},zo=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new qu),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ar.Emitter=zo;zo._noop=function(){}});var Qo=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CancellationTokenSource=lr.CancellationToken=void 0;var Hw=zn(),Yw=or(),Fu=cr(),Go;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Fu.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Fu.Event.None});function e(t){let i=t;return i&&(i===n.None||i===n.Cancelled||Yw.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}n.is=e})(Go||(lr.CancellationToken=Go={}));var Kw=Object.freeze(function(n,e){let t=(0,Hw.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Xo=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Kw:(this._emitter||(this._emitter=new Fu.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Bu=class{get token(){return this._token||(this._token=new Xo),this._token}cancel(){this._token?this._token.cancel():this._token=Go.Cancelled}dispose(){this._token?this._token instanceof Xo&&this._token.dispose():this._token=Go.None}};lr.CancellationTokenSource=Bu});var jp=C(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.SharedArrayReceiverStrategy=ur.SharedArraySenderStrategy=void 0;var zw=Qo(),hs;(function(n){n.Continue=0,n.Cancelled=1})(hs||(hs={}));var ju=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=hs.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let i=this.buffers.get(t);if(i===void 0)return;let r=new Int32Array(i,0,1);Atomics.store(r,0,hs.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};ur.SharedArraySenderStrategy=ju;var Uu=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===hs.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$u=class{constructor(e){this.token=new Uu(e)}cancel(){}dispose(){}},Wu=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new zw.CancellationTokenSource:new $u(t)}};ur.SharedArrayReceiverStrategy=Wu});var Hu=C(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Semaphore=void 0;var Gw=zn(),Vu=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,i)=>{this._waiting.push({thunk:e,resolve:t,reject:i}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Gw.default)().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(i=>{this._active--,e.resolve(i),this.runNext()},i=>{this._active--,e.reject(i),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Jo.Semaphore=Vu});var $p=C(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ReadableStreamMessageReader=Gn.AbstractMessageReader=Gn.MessageReader=void 0;var Ku=zn(),fr=or(),Yu=cr(),Xw=Hu(),Up;(function(n){function e(t){let i=t;return i&&fr.func(i.listen)&&fr.func(i.dispose)&&fr.func(i.onError)&&fr.func(i.onClose)&&fr.func(i.onPartialMessage)}n.is=e})(Up||(Gn.MessageReader=Up={}));var Zo=class{constructor(){this.errorEmitter=new Yu.Emitter,this.closeEmitter=new Yu.Emitter,this.partialMessageEmitter=new Yu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${fr.string(e.message)?e.message:"unknown"}`)}};Gn.AbstractMessageReader=Zo;var zu;(function(n){function e(t){let i,r,s,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(s=t.contentDecoder,o.set(s.name,s)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Ku.default)().applicationJson.decoder,c.set(a.name,a)),{charset:i,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(zu||(zu={}));var Gu=class extends Zo{constructor(e,t){super(),this.readable=e,this.options=zu.fromOptions(t),this.buffer=(0,Ku.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Xw.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let i=this.buffer.tryReadHeaders(!0);if(!i)return;let r=i.get("content-length");if(!r){this.fireError(new Error(`Header must provide a Content-Length property.
3
+ ${JSON.stringify(Object.fromEntries(i))}`));return}let s=parseInt(r);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${r}`));return}this.nextMessageLength=s}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let i=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,r=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(r)}).catch(i=>{this.fireError(i)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ku.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Gn.ReadableStreamMessageReader=Gu});var Kp=C(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WriteableStreamMessageWriter=Xn.AbstractMessageWriter=Xn.MessageWriter=void 0;var Wp=zn(),ps=or(),Qw=Hu(),Vp=cr(),Jw="Content-Length: ",Hp=`\r
4
+ `,Yp;(function(n){function e(t){let i=t;return i&&ps.func(i.dispose)&&ps.func(i.onClose)&&ps.func(i.onError)&&ps.func(i.write)}n.is=e})(Yp||(Xn.MessageWriter=Yp={}));var ea=class{constructor(){this.errorEmitter=new Vp.Emitter,this.closeEmitter=new Vp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ps.string(e.message)?e.message:"unknown"}`)}};Xn.AbstractMessageWriter=ea;var Xu;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Wp.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Wp.default)().applicationJson.encoder}}n.fromOptions=e})(Xu||(Xu={}));var Qu=class extends ea{constructor(e,t){super(),this.writable=e,this.options=Xu.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Qw.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let r=[];return r.push(Jw,i.byteLength.toString(),Hp),r.push(Hp),this.doWrite(e,r,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Xn.WriteableStreamMessageWriter=Qu});var zp=C(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.AbstractMessageBuffer=void 0;var Zw=13,eN=10,tN=`\r
5
+ `,Ju=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,i=0,r=0,s=0;e:for(;i<this._chunks.length;){let l=this._chunks[i];for(r=0;r<l.length;){switch(l[r]){case Zw:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case eN:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}s+=l.byteLength,i++}if(t!==4)return;let o=this._read(s+r),a=new Map,c=this.toString(o,"ascii").split(tN);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
6
+ ${u}`);let p=u.substr(0,d),g=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let s=this._chunks[r];if(s.byteLength>e){let o=s.slice(0,e);t.set(o,i),i+=e,this._chunks[r]=s.slice(e),this._totalLength-=e,e-=e}else t.set(s,i),i+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return t}};ta.AbstractMessageBuffer=Ju});var Zp=C(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.createMessageConnection=te.ConnectionOptions=te.MessageStrategy=te.CancellationStrategy=te.CancellationSenderStrategy=te.CancellationReceiverStrategy=te.RequestCancellationReceiverStrategy=te.IdCancellationReceiverStrategy=te.ConnectionStrategy=te.ConnectionError=te.ConnectionErrors=te.LogTraceNotification=te.SetTraceNotification=te.TraceFormat=te.TraceValues=te.Trace=te.NullLogger=te.ProgressType=te.ProgressToken=void 0;var Gp=zn(),qe=or(),X=Ou(),Xp=Iu(),ms=cr(),Zu=Qo(),bs;(function(n){n.type=new X.NotificationType("$/cancelRequest")})(bs||(bs={}));var ef;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(ef||(te.ProgressToken=ef={}));var gs;(function(n){n.type=new X.NotificationType("$/progress")})(gs||(gs={}));var tf=class{constructor(){}};te.ProgressType=tf;var nf;(function(n){function e(t){return qe.func(t)}n.is=e})(nf||(nf={}));te.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var me;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(me||(te.Trace=me={}));var Qp;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(Qp||(te.TraceValues=Qp={}));(function(n){function e(i){if(!qe.string(i))return n.Off;switch(i=i.toLowerCase(),i){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(i){switch(i){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(me||(te.Trace=me={}));var xt;(function(n){n.Text="text",n.JSON="json"})(xt||(te.TraceFormat=xt={}));(function(n){function e(t){return qe.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(xt||(te.TraceFormat=xt={}));var rf;(function(n){n.type=new X.NotificationType("$/setTrace")})(rf||(te.SetTraceNotification=rf={}));var na;(function(n){n.type=new X.NotificationType("$/logTrace")})(na||(te.LogTraceNotification=na={}));var ys;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(ys||(te.ConnectionErrors=ys={}));var dr=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};te.ConnectionError=dr;var sf;(function(n){function e(t){let i=t;return i&&qe.func(i.cancelUndispatched)}n.is=e})(sf||(te.ConnectionStrategy=sf={}));var ia;(function(n){function e(t){let i=t;return i&&(i.kind===void 0||i.kind==="id")&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(ia||(te.IdCancellationReceiverStrategy=ia={}));var of;(function(n){function e(t){let i=t;return i&&i.kind==="request"&&qe.func(i.createCancellationTokenSource)&&(i.dispose===void 0||qe.func(i.dispose))}n.is=e})(of||(te.RequestCancellationReceiverStrategy=of={}));var ra;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Zu.CancellationTokenSource}});function e(t){return ia.is(t)||of.is(t)}n.is=e})(ra||(te.CancellationReceiverStrategy=ra={}));var sa;(function(n){n.Message=Object.freeze({sendCancellation(t,i){return t.sendNotification(bs.type,{id:i})},cleanup(t){}});function e(t){let i=t;return i&&qe.func(i.sendCancellation)&&qe.func(i.cleanup)}n.is=e})(sa||(te.CancellationSenderStrategy=sa={}));var oa;(function(n){n.Message=Object.freeze({receiver:ra.Message,sender:sa.Message});function e(t){let i=t;return i&&ra.is(i.receiver)&&sa.is(i.sender)}n.is=e})(oa||(te.CancellationStrategy=oa={}));var aa;(function(n){function e(t){let i=t;return i&&qe.func(i.handleMessage)}n.is=e})(aa||(te.MessageStrategy=aa={}));var Jp;(function(n){function e(t){let i=t;return i&&(oa.is(i.cancellationStrategy)||sf.is(i.connectionStrategy)||aa.is(i.messageStrategy))}n.is=e})(Jp||(te.ConnectionOptions=Jp={}));var nn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(nn||(nn={}));function nN(n,e,t,i){let r=t!==void 0?t:te.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,p=new Map,g=new Map,_,b=new Xp.LinkedMap,w=new Map,R=new Set,v=new Map,T=me.Off,N=xt.Text,L,q=nn.New,H=new ms.Emitter,j=new ms.Emitter,re=new ms.Emitter,Be=new ms.Emitter,Et=new ms.Emitter,ce=i&&i.cancellationStrategy?i.cancellationStrategy:oa.Message;function On(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function er(S){return S===null?"res-unknown-"+(++a).toString():"res-"+S.toString()}function Ro(){return"not-"+(++o).toString()}function ou(S,I){X.Message.isRequest(I)?S.set(On(I.id),I):X.Message.isResponse(I)?S.set(er(I.id),I):S.set(Ro(),I)}function Co(S){}function as(){return q===nn.Listening}function Ci(){return q===nn.Closed}function An(){return q===nn.Disposed}function tr(){(q===nn.New||q===nn.Listening)&&(q=nn.Closed,j.fire(void 0))}function Oi(S){H.fire([S,void 0,void 0])}function Oo(S){H.fire(S)}n.onClose(tr),n.onError(Oi),e.onClose(tr),e.onError(Oo);function cs(){_||b.size===0||(_=(0,Gp.default)().timer.setImmediate(()=>{_=void 0,Ao()}))}function ls(S){X.Message.isRequest(S)?Lo(S):X.Message.isNotification(S)?Mo(S):X.Message.isResponse(S)?xo(S):nr(S)}function Ao(){if(b.size===0)return;let S=b.shift();try{let I=i?.messageStrategy;aa.is(I)?I.handleMessage(S,ls):ls(S)}finally{cs()}}let Io=S=>{try{if(X.Message.isNotification(S)&&S.method===bs.type.method){let I=S.params.id,B=On(I),W=b.get(B);if(X.Message.isRequest(W)){let ye=i?.connectionStrategy,Ce=ye&&ye.cancelUndispatched?ye.cancelUndispatched(W,Co):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){b.delete(B),v.delete(I),Ce.id=W.id,Ai(Ce,S.method,Date.now()),e.write(Ce).catch(()=>r.error("Sending response for canceled message failed."));return}}let ke=v.get(I);if(ke!==void 0){ke.cancel(),ir(S);return}else R.add(I)}ou(b,S)}finally{cs()}};function Lo(S){if(An())return;function I(se,Ee,fe){let je={jsonrpc:c,id:S.id};se instanceof X.ResponseError?je.error=se.toJson():je.result=se===void 0?null:se,Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function B(se,Ee,fe){let je={jsonrpc:c,id:S.id,error:se.toJson()};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function W(se,Ee,fe){se===void 0&&(se=null);let je={jsonrpc:c,id:S.id,result:se};Ai(je,Ee,fe),e.write(je).catch(()=>r.error("Sending response failed."))}Bo(S);let ke=u.get(S.method),ye,Ce;ke&&(ye=ke.type,Ce=ke.handler);let Le=Date.now();if(Ce||l){let se=S.id??String(Date.now()),Ee=ia.is(ce.receiver)?ce.receiver.createCancellationTokenSource(se):ce.receiver.createCancellationTokenSource(S);S.id!==null&&R.has(S.id)&&Ee.cancel(),S.id!==null&&v.set(se,Ee);try{let fe;if(Ce)if(S.params===void 0){if(ye!==void 0&&ye.numberOfParams!==0){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines ${ye.numberOfParams} params but received none.`),S.method,Le);return}fe=Ce(Ee.token)}else if(Array.isArray(S.params)){if(ye!==void 0&&ye.parameterStructures===X.ParameterStructures.byName){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,Le);return}fe=Ce(...S.params,Ee.token)}else{if(ye!==void 0&&ye.parameterStructures===X.ParameterStructures.byPosition){B(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,Le);return}fe=Ce(S.params,Ee.token)}else l&&(fe=l(S.method,S.params,Ee.token));let je=fe;fe?je.then?je.then(nt=>{v.delete(se),I(nt,S.method,Le)},nt=>{v.delete(se),nt instanceof X.ResponseError?B(nt,S.method,Le):nt&&qe.string(nt.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${nt.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}):(v.delete(se),I(fe,S.method,Le)):(v.delete(se),W(fe,S.method,Le))}catch(fe){v.delete(se),fe instanceof X.ResponseError?I(fe,S.method,Le):fe&&qe.string(fe.message)?B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${fe.message}`),S.method,Le):B(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Le)}}else B(new X.ResponseError(X.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,Le)}function xo(S){if(!An())if(S.id===null)S.error?r.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(S.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let I=S.id,B=w.get(I);if(jo(S,B),B!==void 0){w.delete(I);try{if(S.error){let W=S.error;B.reject(new X.ResponseError(W.code,W.message,W.data))}else if(S.result!==void 0)B.resolve(S.result);else throw new Error("Should never happen.")}catch(W){W.message?r.error(`Response handler '${B.method}' failed with message: ${W.message}`):r.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function Mo(S){if(An())return;let I,B;if(S.method===bs.type.method){let W=S.params.id;R.delete(W),ir(S);return}else{let W=p.get(S.method);W&&(B=W.handler,I=W.type)}if(B||d)try{if(ir(S),B)if(S.params===void 0)I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received none.`),B();else if(Array.isArray(S.params)){let W=S.params;S.method===gs.type.method&&W.length===2&&ef.is(W[0])?B({token:W[0],value:W[1]}):(I!==void 0&&(I.parameterStructures===X.ParameterStructures.byName&&r.error(`Notification ${S.method} defines parameters by name but received parameters by position`),I.numberOfParams!==S.params.length&&r.error(`Notification ${S.method} defines ${I.numberOfParams} params but received ${W.length} arguments`)),B(...W))}else I!==void 0&&I.parameterStructures===X.ParameterStructures.byPosition&&r.error(`Notification ${S.method} defines parameters by position but received parameters by name`),B(S.params);else d&&d(S.method,S.params)}catch(W){W.message?r.error(`Notification handler '${S.method}' failed with message: ${W.message}`):r.error(`Notification handler '${S.method}' failed unexpectedly.`)}else re.fire(S)}function nr(S){if(!S){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(S,null,4)}`);let I=S;if(qe.string(I.id)||qe.number(I.id)){let B=I.id,W=w.get(B);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function Zt(S){if(S!=null)switch(T){case me.Verbose:return JSON.stringify(S,null,4);case me.Compact:return JSON.stringify(S);default:return}}function qo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Zt(S.params)}
9
9
 
10
- `),L.log(`Sending request '${S.method} - (${S.id})'.`,I)}else In("send-request",S)}function Mo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Jt(S.params)}
10
+ `),L.log(`Sending request '${S.method} - (${S.id})'.`,I)}else In("send-request",S)}function Fo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Zt(S.params)}
11
11
 
12
12
  `:I=`No parameters provided.
13
13
 
14
- `),L.log(`Sending notification '${S.method}'.`,I)}else In("send-notification",S)}function Ai(S,I,B){if(!(T===me.Off||!L))if(N===xt.Text){let W;(T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?W=`Error data: ${Jt(S.error.data)}
14
+ `),L.log(`Sending notification '${S.method}'.`,I)}else In("send-notification",S)}function Ai(S,I,B){if(!(T===me.Off||!L))if(N===xt.Text){let W;(T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?W=`Error data: ${Zt(S.error.data)}
15
15
 
16
- `:S.result?W=`Result: ${Jt(S.result)}
16
+ `:S.result?W=`Result: ${Zt(S.result)}
17
17
 
18
18
  `:S.error===void 0&&(W=`No result returned.
19
19
 
20
- `)),L.log(`Sending response '${I} - (${S.id})'. Processing request took ${Date.now()-B}ms`,W)}else In("send-response",S)}function qo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Jt(S.params)}
20
+ `)),L.log(`Sending response '${I} - (${S.id})'. Processing request took ${Date.now()-B}ms`,W)}else In("send-response",S)}function Bo(S){if(!(T===me.Off||!L))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&S.params&&(I=`Params: ${Zt(S.params)}
21
21
 
22
- `),L.log(`Received request '${S.method} - (${S.id})'.`,I)}else In("receive-request",S)}function nr(S){if(!(T===me.Off||!L||S.method===ea.type.method))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Jt(S.params)}
22
+ `),L.log(`Received request '${S.method} - (${S.id})'.`,I)}else In("receive-request",S)}function ir(S){if(!(T===me.Off||!L||S.method===na.type.method))if(N===xt.Text){let I;(T===me.Verbose||T===me.Compact)&&(S.params?I=`Params: ${Zt(S.params)}
23
23
 
24
24
  `:I=`No parameters provided.
25
25
 
26
- `),L.log(`Received notification '${S.method}'.`,I)}else In("receive-notification",S)}function Fo(S,I){if(!(T===me.Off||!L))if(N===xt.Text){let B;if((T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?B=`Error data: ${Jt(S.error.data)}
26
+ `),L.log(`Received notification '${S.method}'.`,I)}else In("receive-notification",S)}function jo(S,I){if(!(T===me.Off||!L))if(N===xt.Text){let B;if((T===me.Verbose||T===me.Compact)&&(S.error&&S.error.data?B=`Error data: ${Zt(S.error.data)}
27
27
 
28
- `:S.result?B=`Result: ${Jt(S.result)}
28
+ `:S.result?B=`Result: ${Zt(S.result)}
29
29
 
30
30
  `:S.error===void 0&&(B=`No result returned.
31
31
 
32
- `)),I){let W=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";L.log(`Received response '${I.method} - (${S.id})' in ${Date.now()-I.timerStart}ms.${W}`,B)}else L.log(`Received response ${S.id} without active response promise.`,B)}else In("receive-response",S)}function In(S,I){if(!L||T===me.Off)return;let B={isLSPMessage:!0,type:S,message:I,timestamp:Date.now()};L.log(B)}function Hn(){if(Ci())throw new fr(ms.Closed,"Connection is closed.");if(An())throw new fr(ms.Disposed,"Connection is disposed.")}function Bo(){if(ss())throw new fr(ms.AlreadyListening,"Connection is already listening")}function jo(){if(!ss())throw new Error("Call listen() first.")}function pn(S){return S===void 0?null:S}function cs(S){if(S!==null)return S}function ls(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function ir(S,I){switch(S){case X.ParameterStructures.auto:return ls(I)?cs(I):[pn(I)];case X.ParameterStructures.byName:if(!ls(I))throw new Error("Received parameters by name but param is not an object literal.");return cs(I);case X.ParameterStructures.byPosition:return[pn(I)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function us(S,I){let B,W=S.numberOfParams;switch(W){case 0:B=void 0;break;case 1:B=ir(S.parameterStructures,I[0]);break;default:B=[];for(let ke=0;ke<I.length&&ke<W;ke++)B.push(pn(I[ke]));if(I.length<W)for(let ke=I.length;ke<W;ke++)B.push(null);break}return B}let Ln={sendNotification:(S,...I)=>{Hn();let B,W;if(qe.string(S)){B=S;let ge=I[0],Ce=0,Le=X.ParameterStructures.auto;X.ParameterStructures.is(ge)&&(Ce=1,Le=ge);let se=I.length,Ee=se-Ce;switch(Ee){case 0:W=void 0;break;case 1:W=ir(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${Ee} parameters for 'by Name' notification parameter structure.`);W=I.slice(Ce,se).map(fe=>pn(fe));break}}else{let ge=I;B=S.method,W=us(S,ge)}let ke={jsonrpc:c,method:B,params:W};return Mo(ke),e.write(ke).catch(ge=>{throw r.error("Sending notification failed."),ge})},onNotification:(S,I)=>{Hn();let B;return qe.func(S)?d=S:I&&(qe.string(S)?(B=S,p.set(S,{type:void 0,handler:I})):(B=S.method,p.set(S.method,{type:S,handler:I}))),{dispose:()=>{B!==void 0?p.delete(B):d=void 0}}},onProgress:(S,I,B)=>{if(g.has(I))throw new Error(`Progress handler for token ${I} already registered`);return g.set(I,B),{dispose:()=>{g.delete(I)}}},sendProgress:(S,I,B)=>Ln.sendNotification(ps.type,{token:I,value:B}),onUnhandledProgress:Be.event,sendRequest:(S,...I)=>{Hn(),jo();let B,W,ke;if(qe.string(S)){B=S;let se=I[0],Ee=I[I.length-1],fe=0,je=X.ParameterStructures.auto;X.ParameterStructures.is(se)&&(fe=1,je=se);let nt=I.length;Ju.CancellationToken.is(Ee)&&(nt=nt-1,ke=Ee);let Lt=nt-fe;switch(Lt){case 0:W=void 0;break;case 1:W=ir(je,I[fe]);break;default:if(je===X.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);W=I.slice(fe,nt).map(Uo=>pn(Uo));break}}else{let se=I;B=S.method,W=us(S,se);let Ee=S.numberOfParams;ke=Ju.CancellationToken.is(se[Ee])?se[Ee]:void 0}let ge=s++,Ce;ke&&(Ce=ke.onCancellationRequested(()=>{let se=ce.sender.sendCancellation(Ln,ge);return se===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${ge}`),Promise.resolve()):se.catch(()=>{r.log(`Sending cancellation messages for id ${ge} failed`)})}));let Le={jsonrpc:c,id:ge,method:B,params:W};return xo(Le),typeof ce.sender.enableCancellation=="function"&&ce.sender.enableCancellation(Le),new Promise(async(se,Ee)=>{let fe=Lt=>{se(Lt),ce.sender.cleanup(ge),Ce?.dispose()},je=Lt=>{Ee(Lt),ce.sender.cleanup(ge),Ce?.dispose()},nt={method:B,timerStart:Date.now(),resolve:fe,reject:je};try{await e.write(Le),w.set(ge,nt)}catch(Lt){throw r.error("Sending request failed."),nt.reject(new X.ResponseError(X.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(S,I)=>{Hn();let B=null;return tf.is(S)?(B=void 0,l=S):qe.string(S)?(B=null,I!==void 0&&(B=S,u.set(S,{handler:I,type:void 0}))):I!==void 0&&(B=S.method,u.set(S.method,{type:S,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>w.size>0,trace:async(S,I,B)=>{let W=!1,ke=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,ke=B.traceFormat||xt.Text)),T=S,N=ke,T===me.Off?L=void 0:L=I,W&&!Ci()&&!An()&&await Ln.sendNotification(nf.type,{value:me.toString(S)})},onError:H.event,onClose:j.event,onUnhandledNotification:ie.event,onDispose:Et.event,end:()=>{e.end()},dispose:()=>{if(An())return;q=tn.Disposed,Et.fire(void 0);let S=new X.ResponseError(X.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of w.values())I.reject(S);w=new Map,v=new Map,R=new Set,b=new zp.LinkedMap,qe.func(e.dispose)&&e.dispose(),qe.func(n.dispose)&&n.dispose()},listen:()=>{Hn(),Bo(),q=tn.Listening,n.listen(Oo)},inspect:()=>{(0,Kp.default)().console.log("inspect")}};return Ln.onNotification(ea.type,S=>{if(T===me.Off||!L)return;let I=T===me.Verbose||T===me.Compact;L.log(S.message,I?S.verbose:void 0)}),Ln.onNotification(ps.type,S=>{let I=g.get(S.token);I?I(S.value):Be.fire(S)}),Ln}te.createMessageConnection=Qw});var oa=C(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var _e=Cu();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return _e.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return _e.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return _e.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return _e.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return _e.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return _e.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return _e.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return _e.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return _e.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return _e.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return _e.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return _e.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return _e.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return _e.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return _e.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return _e.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return _e.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return _e.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return _e.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return _e.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return _e.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return _e.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return _e.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return _e.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return _e.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return _e.ParameterStructures}});var of=Au();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return of.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return of.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return of.Touch}});var Jw=Mp();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return Jw.Disposable}});var Jp=ar();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return Jp.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return Jp.Emitter}});var Zp=Go();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return Zp.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return Zp.CancellationToken}});var em=Fp();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return em.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return em.SharedArrayReceiverStrategy}});var af=jp();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return af.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return af.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return af.ReadableStreamMessageReader}});var cf=Hp();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return cf.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return cf.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return cf.WriteableStreamMessageWriter}});var Zw=Yp();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return Zw.AbstractMessageBuffer}});var ut=Qp();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return ut.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return ut.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return ut.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return ut.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return ut.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return ut.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return ut.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return ut.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return ut.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return ut.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return ut.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return ut.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return ut.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ut.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ut.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return ut.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return ut.MessageStrategy}});var eN=Kn();O.RAL=eN.default});var im=C(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var tm=require("util"),Mn=oa(),aa=class n extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new tm.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};aa.emptyBuffer=Buffer.allocUnsafe(0);var lf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},uf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let s=o=>{o==null?i():r(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},nm=Object.freeze({messageBuffer:Object.freeze({create:n=>new aa(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new tm.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new lf(n),asWritableStream:n=>new uf(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function ff(){return nm}(function(n){function e(){Mn.RAL.install(nm)}n.install=e})(ff||(ff={}));df.default=ff});var Mi=C(ae=>{"use strict";var tN=ae&&ae.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),nN=ae&&ae.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tN(e,n,t)};Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.createServerSocketTransport=ae.createClientSocketTransport=ae.createServerPipeTransport=ae.createClientPipeTransport=ae.generateRandomPipeName=ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;var dr=im();dr.default.install();var rm=require("path"),iN=require("os"),rN=require("crypto"),ua=require("net"),Mt=oa();nN(oa(),ae);var hf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mt.Disposable.create(()=>this.process.off("message",e))}};ae.IPCMessageReader=hf;var pf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.IPCMessageWriter=pf;var mf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.onData=new Mt.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ae.PortMessageReader=mf;var gf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.PortMessageWriter=gf;var Li=class extends Mt.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,dr.default)().stream.asReadableStream(e),t)}};ae.SocketMessageReader=Li;var xi=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,dr.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=xi;var ca=class extends Mt.ReadableStreamMessageReader{constructor(e,t){super((0,dr.default)().stream.asReadableStream(e),t)}};ae.StreamMessageReader=ca;var la=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,dr.default)().stream.asWritableStream(e),t)}};ae.StreamMessageWriter=la;var sm=process.env.XDG_RUNTIME_DIR,sN=new Map([["linux",107],["darwin",103]]);function oN(){let n=(0,rN.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;sm?e=rm.join(sm,`vscode-ipc-${n}.sock`):e=rm.join(iN.tmpdir(),`vscode-${n}.sock`);let t=sN.get(process.platform);return t!==void 0&&e.length>t&&(0,dr.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ae.generateRandomPipeName=oN;function aN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientPipeTransport=aN;function cN(n,e="utf-8"){let t=(0,ua.createConnection)(n);return[new Li(t,e),new xi(t,e)]}ae.createServerPipeTransport=cN;function lN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,ua.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientSocketTransport=lN;function uN(n,e="utf-8"){let t=(0,ua.createConnection)(n,"127.0.0.1");return[new Li(t,e),new xi(t,e)]}ae.createServerSocketTransport=uN;function fN(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function dN(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function hN(n,e,t,i){t||(t=Mt.NullLogger);let r=fN(n)?new ca(n):n,s=dN(e)?new la(e):e;return Mt.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Mt.createMessageConnection)(r,s,t,i)}ae.createMessageConnection=hN});var yf=C((qA,om)=>{"use strict";om.exports=Mi()});var da=C((am,fa)=>{(function(n){if(typeof fa=="object"&&typeof fa.exports=="object"){var e=n(require,am);e!==void 0&&(fa.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(h){function k(E){return typeof E=="string"}h.is=k})(t||(e.DocumentUri=t={}));var i;(function(h){function k(E){return typeof E=="string"}h.is=k})(i||(e.URI=i={}));var r;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(r||(e.integer=r={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(s||(e.uinteger=s={}));var o;(function(h){function k(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=E})(o||(e.Position=o={}));var a;(function(h){function k(m,f,P,x){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(P)&&D.uinteger(x))return{start:o.create(m,f),end:o.create(P,x)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(P,", ").concat(x,"]"))}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=E})(a||(e.Range=a={}));var c;(function(h){function k(m,f){return{uri:m,range:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=E})(c||(e.Location=c={}));var l;(function(h){function k(m,f,P,x){return{targetUri:m,targetRange:f,targetSelectionRange:P,originSelectionRange:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=E})(l||(e.LocationLink=l={}));var u;(function(h){function k(m,f,P,x){return{red:m,green:f,blue:P,alpha:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=E})(u||(e.Color=u={}));var d;(function(h){function k(m,f){return{range:m,color:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&u.is(f.color)}h.is=E})(d||(e.ColorInformation=d={}));var p;(function(h){function k(m,f,P){return{label:m,textEdit:f,additionalTextEdits:P}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||L.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,L.is))}h.is=E})(p||(e.ColorPresentation=p={}));var g;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(h){function k(m,f,P,x,ee,Ue){var Ne={startLine:m,endLine:f};return D.defined(P)&&(Ne.startCharacter=P),D.defined(x)&&(Ne.endCharacter=x),D.defined(ee)&&(Ne.kind=ee),D.defined(Ue)&&(Ne.collapsedText=Ue),Ne}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=E})(_||(e.FoldingRange=_={}));var b;(function(h){function k(m,f){return{location:m,message:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&c.is(f.location)&&D.string(f.message)}h.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var w;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(w||(e.DiagnosticSeverity=w={}));var R;(function(h){h.Unnecessary=1,h.Deprecated=2})(R||(e.DiagnosticTag=R={}));var v;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&D.string(m.href)}h.is=k})(v||(e.CodeDescription=v={}));var T;(function(h){function k(m,f,P,x,ee,Ue){var Ne={range:m,message:f};return D.defined(P)&&(Ne.severity=P),D.defined(x)&&(Ne.code=x),D.defined(ee)&&(Ne.source=ee),D.defined(Ue)&&(Ne.relatedInformation=Ue),Ne}h.create=k;function E(m){var f,P=m;return D.defined(P)&&a.is(P.range)&&D.string(P.message)&&(D.number(P.severity)||D.undefined(P.severity))&&(D.integer(P.code)||D.string(P.code)||D.undefined(P.code))&&(D.undefined(P.codeDescription)||D.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(P.source)||D.undefined(P.source))&&(D.undefined(P.relatedInformation)||D.typedArray(P.relatedInformation,b.is))}h.is=E})(T||(e.Diagnostic=T={}));var N;(function(h){function k(m,f){for(var P=[],x=2;x<arguments.length;x++)P[x-2]=arguments[x];var ee={title:m,command:f};return D.defined(P)&&P.length>0&&(ee.arguments=P),ee}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=E})(N||(e.Command=N={}));var L;(function(h){function k(P,x){return{range:P,newText:x}}h.replace=k;function E(P,x){return{range:{start:P,end:P},newText:x}}h.insert=E;function m(P){return{range:P,newText:""}}h.del=m;function f(P){var x=P;return D.objectLiteral(x)&&D.string(x.newText)&&a.is(x.range)}h.is=f})(L||(e.TextEdit=L={}));var q;(function(h){function k(m,f,P){var x={label:m};return f!==void 0&&(x.needsConfirmation=f),P!==void 0&&(x.description=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=E})(q||(e.ChangeAnnotation=q={}));var H;(function(h){function k(E){var m=E;return D.string(m)}h.is=k})(H||(e.ChangeAnnotationIdentifier=H={}));var j;(function(h){function k(P,x,ee){return{range:P,newText:x,annotationId:ee}}h.replace=k;function E(P,x,ee){return{range:{start:P,end:P},newText:x,annotationId:ee}}h.insert=E;function m(P,x){return{range:P,newText:"",annotationId:x}}h.del=m;function f(P){var x=P;return L.is(x)&&(q.is(x.annotationId)||H.is(x.annotationId))}h.is=f})(j||(e.AnnotatedTextEdit=j={}));var ie;(function(h){function k(m,f){return{textDocument:m,edits:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&Ci.is(f.textDocument)&&Array.isArray(f.edits)}h.is=E})(ie||(e.TextDocumentEdit=ie={}));var Be;(function(h){function k(m,f,P){var x={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Be||(e.CreateFile=Be={}));var Et;(function(h){function k(m,f,P,x){var ee={kind:"rename",oldUri:m,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ee.options=P),x!==void 0&&(ee.annotationId=x),ee}h.create=k;function E(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Et||(e.RenameFile=Et={}));var ce;(function(h){function k(m,f,P){var x={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(ce||(e.DeleteFile=ce={}));var On;(function(h){function k(E){var m=E;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?Be.is(f)||Et.is(f)||ce.is(f):ie.is(f)}))}h.is=k})(On||(e.WorkspaceEdit=On={}));var Zi=function(){function h(k,E){this.edits=k,this.changeAnnotations=E}return h.prototype.insert=function(k,E,m){var f,P;if(m===void 0?f=L.insert(k,E):H.is(m)?(P=m,f=j.insert(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.insert(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.replace=function(k,E,m){var f,P;if(m===void 0?f=L.replace(k,E):H.is(m)?(P=m,f=j.replace(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.replace(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.delete=function(k,E){var m,f;if(E===void 0?m=L.del(k):H.is(E)?(f=E,m=j.del(k,E)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(E),m=j.del(k,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(k){this.edits.push(k)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(k){if(k===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),Po=function(){function h(k){this._annotations=k===void 0?Object.create(null):k,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(k,E){var m;if(H.is(k)?m=k:(m=this.nextId(),E=k),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=E,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),su=function(){function h(k){var E=this;this._textEditChanges=Object.create(null),k!==void 0?(this._workspaceEdit=k,k.documentChanges?(this._changeAnnotations=new Po(k.changeAnnotations),k.changeAnnotations=this._changeAnnotations.all(),k.documentChanges.forEach(function(m){if(ie.is(m)){var f=new Zi(m.edits,E._changeAnnotations);E._textEditChanges[m.textDocument.uri]=f}})):k.changes&&Object.keys(k.changes).forEach(function(m){var f=new Zi(k.changes[m]);E._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(k){if(Ci.is(k)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:k.uri,version:k.version},m=this._textEditChanges[E.uri];if(!m){var f=[],P={textDocument:E,edits:f};this._workspaceEdit.documentChanges.push(P),m=new Zi(f,this._changeAnnotations),this._textEditChanges[E.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[k];if(!m){var f=[];this._workspaceEdit.changes[k]=f,m=new Zi(f),this._textEditChanges[k]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Po,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=Be.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=Be.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h.prototype.renameFile=function(k,E,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;q.is(m)||H.is(m)?P=m:f=m;var x,ee;if(P===void 0?x=Et.create(k,E,f):(ee=H.is(P)?P:this._changeAnnotations.manage(P),x=Et.create(k,E,f,ee)),this._workspaceEdit.documentChanges.push(x),ee!==void 0)return ee},h.prototype.deleteFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=ce.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=ce.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h}();e.WorkspaceChange=su;var Do;(function(h){function k(m){return{uri:m}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=E})(Do||(e.TextDocumentIdentifier=Do={}));var ss;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=E})(ss||(e.VersionedTextDocumentIdentifier=ss={}));var Ci;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=E})(Ci||(e.OptionalVersionedTextDocumentIdentifier=Ci={}));var An;(function(h){function k(m,f,P,x){return{uri:m,languageId:f,version:P,text:x}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=E})(An||(e.TextDocumentItem=An={}));var er;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function k(E){var m=E;return m===h.PlainText||m===h.Markdown}h.is=k})(er||(e.MarkupKind=er={}));var Oi;(function(h){function k(E){var m=E;return D.objectLiteral(E)&&er.is(m.kind)&&D.string(m.value)}h.is=k})(Oi||(e.MarkupContent=Oi={}));var Ro;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Ro||(e.CompletionItemKind=Ro={}));var os;(function(h){h.PlainText=1,h.Snippet=2})(os||(e.InsertTextFormat=os={}));var as;(function(h){h.Deprecated=1})(as||(e.CompletionItemTag=as={}));var Co;(function(h){function k(m,f,P){return{newText:m,insert:f,replace:P}}h.create=k;function E(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=E})(Co||(e.InsertReplaceEdit=Co={}));var Oo;(function(h){h.asIs=1,h.adjustIndentation=2})(Oo||(e.InsertTextMode=Oo={}));var Ao;(function(h){function k(E){var m=E;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=k})(Ao||(e.CompletionItemLabelDetails=Ao={}));var Io;(function(h){function k(E){return{label:E}}h.create=k})(Io||(e.CompletionItem=Io={}));var Lo;(function(h){function k(E,m){return{items:E||[],isIncomplete:!!m}}h.create=k})(Lo||(e.CompletionList=Lo={}));var tr;(function(h){function k(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=k;function E(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=E})(tr||(e.MarkedString=tr={}));var Jt;(function(h){function k(E){var m=E;return!!m&&D.objectLiteral(m)&&(Oi.is(m.contents)||tr.is(m.contents)||D.typedArray(m.contents,tr.is))&&(E.range===void 0||a.is(E.range))}h.is=k})(Jt||(e.Hover=Jt={}));var xo;(function(h){function k(E,m){return m?{label:E,documentation:m}:{label:E}}h.create=k})(xo||(e.ParameterInformation=xo={}));var Mo;(function(h){function k(E,m){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var x={label:E};return D.defined(m)&&(x.documentation=m),D.defined(f)?x.parameters=f:x.parameters=[],x}h.create=k})(Mo||(e.SignatureInformation=Mo={}));var Ai;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ai||(e.DocumentHighlightKind=Ai={}));var qo;(function(h){function k(E,m){var f={range:E};return D.number(m)&&(f.kind=m),f}h.create=k})(qo||(e.DocumentHighlight=qo={}));var nr;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(nr||(e.SymbolKind=nr={}));var Fo;(function(h){h.Deprecated=1})(Fo||(e.SymbolTag=Fo={}));var In;(function(h){function k(E,m,f,P,x){var ee={name:E,kind:m,location:{uri:P,range:f}};return x&&(ee.containerName=x),ee}h.create=k})(In||(e.SymbolInformation=In={}));var Hn;(function(h){function k(E,m,f,P){return P!==void 0?{name:E,kind:m,location:{uri:f,range:P}}:{name:E,kind:m,location:{uri:f}}}h.create=k})(Hn||(e.WorkspaceSymbol=Hn={}));var Bo;(function(h){function k(m,f,P,x,ee,Ue){var Ne={name:m,detail:f,kind:P,range:x,selectionRange:ee};return Ue!==void 0&&(Ne.children=Ue),Ne}h.create=k;function E(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=E})(Bo||(e.DocumentSymbol=Bo={}));var jo;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(jo||(e.CodeActionKind=jo={}));var pn;(function(h){h.Invoked=1,h.Automatic=2})(pn||(e.CodeActionTriggerKind=pn={}));var cs;(function(h){function k(m,f,P){var x={diagnostics:m};return f!=null&&(x.only=f),P!=null&&(x.triggerKind=P),x}h.create=k;function E(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,T.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===pn.Invoked||f.triggerKind===pn.Automatic)}h.is=E})(cs||(e.CodeActionContext=cs={}));var ls;(function(h){function k(m,f,P){var x={title:m},ee=!0;return typeof f=="string"?(ee=!1,x.kind=f):N.is(f)?x.command=f:x.edit=f,ee&&P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||N.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||On.is(f.edit))}h.is=E})(ls||(e.CodeAction=ls={}));var ir;(function(h){function k(m,f){var P={range:m};return D.defined(f)&&(P.data=f),P}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||N.is(f.command))}h.is=E})(ir||(e.CodeLens=ir={}));var us;(function(h){function k(m,f){return{tabSize:m,insertSpaces:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=E})(us||(e.FormattingOptions=us={}));var Ln;(function(h){function k(m,f,P){return{range:m,target:f,data:P}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=E})(Ln||(e.DocumentLink=Ln={}));var S;(function(h){function k(m,f){return{range:m,parent:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=E})(S||(e.SelectionRange=S={}));var I;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var W;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=k})(W||(e.SemanticTokens=W={}));var ke;(function(h){function k(m,f){return{range:m,text:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=E})(ke||(e.InlineValueText=ke={}));var ge;(function(h){function k(m,f,P){return{range:m,variableName:f,caseSensitiveLookup:P}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=E})(ge||(e.InlineValueVariableLookup=ge={}));var Ce;(function(h){function k(m,f){return{range:m,expression:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=E})(Ce||(e.InlineValueEvaluatableExpression=Ce={}));var Le;(function(h){function k(m,f){return{frameId:m,stoppedLocation:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=E})(Le||(e.InlineValueContext=Le={}));var se;(function(h){h.Type=1,h.Parameter=2;function k(E){return E===1||E===2}h.is=k})(se||(e.InlayHintKind=se={}));var Ee;(function(h){function k(m){return{value:m}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.location===void 0||c.is(f.location))&&(f.command===void 0||N.is(f.command))}h.is=E})(Ee||(e.InlayHintLabelPart=Ee={}));var fe;(function(h){function k(m,f,P){var x={position:m,label:f};return P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,Ee.is))&&(f.kind===void 0||se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=E})(fe||(e.InlayHint=fe={}));var je;(function(h){function k(E){return{kind:"snippet",value:E}}h.createSnippet=k})(je||(e.StringValue=je={}));var nt;(function(h){function k(E,m,f,P){return{insertText:E,filterText:m,range:f,command:P}}h.create=k})(nt||(e.InlineCompletionItem=nt={}));var Lt;(function(h){function k(E){return{items:E}}h.create=k})(Lt||(e.InlineCompletionList=Lt={}));var Uo;(function(h){h.Invoked=0,h.Automatic=1})(Uo||(e.InlineCompletionTriggerKind=Uo={}));var kp;(function(h){function k(E,m){return{range:E,text:m}}h.create=k})(kp||(e.SelectedCompletionInfo=kp={}));var Ep;(function(h){function k(E,m){return{triggerKind:E,selectedCompletionInfo:m}}h.create=k})(Ep||(e.InlineCompletionContext=Ep={}));var wp;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&i.is(m.uri)&&D.string(m.name)}h.is=k})(wp||(e.WorkspaceFolder=wp={})),e.EOL=[`
32
+ `)),I){let W=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";L.log(`Received response '${I.method} - (${S.id})' in ${Date.now()-I.timerStart}ms.${W}`,B)}else L.log(`Received response ${S.id} without active response promise.`,B)}else In("receive-response",S)}function In(S,I){if(!L||T===me.Off)return;let B={isLSPMessage:!0,type:S,message:I,timestamp:Date.now()};L.log(B)}function Yn(){if(Ci())throw new dr(ys.Closed,"Connection is closed.");if(An())throw new dr(ys.Disposed,"Connection is disposed.")}function Uo(){if(as())throw new dr(ys.AlreadyListening,"Connection is already listening")}function $o(){if(!as())throw new Error("Call listen() first.")}function mn(S){return S===void 0?null:S}function us(S){if(S!==null)return S}function fs(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function rr(S,I){switch(S){case X.ParameterStructures.auto:return fs(I)?us(I):[mn(I)];case X.ParameterStructures.byName:if(!fs(I))throw new Error("Received parameters by name but param is not an object literal.");return us(I);case X.ParameterStructures.byPosition:return[mn(I)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function ds(S,I){let B,W=S.numberOfParams;switch(W){case 0:B=void 0;break;case 1:B=rr(S.parameterStructures,I[0]);break;default:B=[];for(let ke=0;ke<I.length&&ke<W;ke++)B.push(mn(I[ke]));if(I.length<W)for(let ke=I.length;ke<W;ke++)B.push(null);break}return B}let Ln={sendNotification:(S,...I)=>{Yn();let B,W;if(qe.string(S)){B=S;let ye=I[0],Ce=0,Le=X.ParameterStructures.auto;X.ParameterStructures.is(ye)&&(Ce=1,Le=ye);let se=I.length,Ee=se-Ce;switch(Ee){case 0:W=void 0;break;case 1:W=rr(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${Ee} parameters for 'by Name' notification parameter structure.`);W=I.slice(Ce,se).map(fe=>mn(fe));break}}else{let ye=I;B=S.method,W=ds(S,ye)}let ke={jsonrpc:c,method:B,params:W};return Fo(ke),e.write(ke).catch(ye=>{throw r.error("Sending notification failed."),ye})},onNotification:(S,I)=>{Yn();let B;return qe.func(S)?d=S:I&&(qe.string(S)?(B=S,p.set(S,{type:void 0,handler:I})):(B=S.method,p.set(S.method,{type:S,handler:I}))),{dispose:()=>{B!==void 0?p.delete(B):d=void 0}}},onProgress:(S,I,B)=>{if(g.has(I))throw new Error(`Progress handler for token ${I} already registered`);return g.set(I,B),{dispose:()=>{g.delete(I)}}},sendProgress:(S,I,B)=>Ln.sendNotification(gs.type,{token:I,value:B}),onUnhandledProgress:Be.event,sendRequest:(S,...I)=>{Yn(),$o();let B,W,ke;if(qe.string(S)){B=S;let se=I[0],Ee=I[I.length-1],fe=0,je=X.ParameterStructures.auto;X.ParameterStructures.is(se)&&(fe=1,je=se);let nt=I.length;Zu.CancellationToken.is(Ee)&&(nt=nt-1,ke=Ee);let Lt=nt-fe;switch(Lt){case 0:W=void 0;break;case 1:W=rr(je,I[fe]);break;default:if(je===X.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);W=I.slice(fe,nt).map(Wo=>mn(Wo));break}}else{let se=I;B=S.method,W=ds(S,se);let Ee=S.numberOfParams;ke=Zu.CancellationToken.is(se[Ee])?se[Ee]:void 0}let ye=s++,Ce;ke&&(Ce=ke.onCancellationRequested(()=>{let se=ce.sender.sendCancellation(Ln,ye);return se===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${ye}`),Promise.resolve()):se.catch(()=>{r.log(`Sending cancellation messages for id ${ye} failed`)})}));let Le={jsonrpc:c,id:ye,method:B,params:W};return qo(Le),typeof ce.sender.enableCancellation=="function"&&ce.sender.enableCancellation(Le),new Promise(async(se,Ee)=>{let fe=Lt=>{se(Lt),ce.sender.cleanup(ye),Ce?.dispose()},je=Lt=>{Ee(Lt),ce.sender.cleanup(ye),Ce?.dispose()},nt={method:B,timerStart:Date.now(),resolve:fe,reject:je};try{await e.write(Le),w.set(ye,nt)}catch(Lt){throw r.error("Sending request failed."),nt.reject(new X.ResponseError(X.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(S,I)=>{Yn();let B=null;return nf.is(S)?(B=void 0,l=S):qe.string(S)?(B=null,I!==void 0&&(B=S,u.set(S,{handler:I,type:void 0}))):I!==void 0&&(B=S.method,u.set(S.method,{type:S,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>w.size>0,trace:async(S,I,B)=>{let W=!1,ke=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,ke=B.traceFormat||xt.Text)),T=S,N=ke,T===me.Off?L=void 0:L=I,W&&!Ci()&&!An()&&await Ln.sendNotification(rf.type,{value:me.toString(S)})},onError:H.event,onClose:j.event,onUnhandledNotification:re.event,onDispose:Et.event,end:()=>{e.end()},dispose:()=>{if(An())return;q=nn.Disposed,Et.fire(void 0);let S=new X.ResponseError(X.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of w.values())I.reject(S);w=new Map,v=new Map,R=new Set,b=new Xp.LinkedMap,qe.func(e.dispose)&&e.dispose(),qe.func(n.dispose)&&n.dispose()},listen:()=>{Yn(),Uo(),q=nn.Listening,n.listen(Io)},inspect:()=>{(0,Gp.default)().console.log("inspect")}};return Ln.onNotification(na.type,S=>{if(T===me.Off||!L)return;let I=T===me.Verbose||T===me.Compact;L.log(S.message,I?S.verbose:void 0)}),Ln.onNotification(gs.type,S=>{let I=g.get(S.token);I?I(S.value):Be.fire(S)}),Ln}te.createMessageConnection=nN});var ca=C(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var _e=Ou();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return _e.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return _e.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return _e.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return _e.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return _e.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return _e.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return _e.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return _e.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return _e.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return _e.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return _e.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return _e.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return _e.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return _e.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return _e.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return _e.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return _e.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return _e.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return _e.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return _e.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return _e.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return _e.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return _e.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return _e.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return _e.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return _e.ParameterStructures}});var af=Iu();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return af.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return af.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return af.Touch}});var iN=Fp();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return iN.Disposable}});var em=cr();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return em.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return em.Emitter}});var tm=Qo();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return tm.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return tm.CancellationToken}});var nm=jp();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return nm.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return nm.SharedArrayReceiverStrategy}});var cf=$p();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return cf.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return cf.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return cf.ReadableStreamMessageReader}});var lf=Kp();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return lf.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return lf.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return lf.WriteableStreamMessageWriter}});var rN=zp();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return rN.AbstractMessageBuffer}});var ft=Zp();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return ft.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return ft.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return ft.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return ft.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return ft.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return ft.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return ft.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return ft.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return ft.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return ft.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return ft.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return ft.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return ft.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ft.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ft.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return ft.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return ft.MessageStrategy}});var sN=zn();O.RAL=sN.default});var sm=C(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var im=require("util"),Mn=ca(),la=class n extends Mn.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new im.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};la.emptyBuffer=Buffer.allocUnsafe(0);var uf=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mn.Disposable.create(()=>this.stream.off("data",e))}},ff=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mn.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let s=o=>{o==null?i():r(o)};typeof e=="string"?this.stream.write(e,t,s):this.stream.write(e,s)})}end(){this.stream.end()}},rm=Object.freeze({messageBuffer:Object.freeze({create:n=>new la(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new im.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new uf(n),asWritableStream:n=>new ff(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function df(){return rm}(function(n){function e(){Mn.RAL.install(rm)}n.install=e})(df||(df={}));hf.default=df});var Mi=C(ae=>{"use strict";var oN=ae&&ae.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),aN=ae&&ae.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&oN(e,n,t)};Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.createServerSocketTransport=ae.createClientSocketTransport=ae.createServerPipeTransport=ae.createClientPipeTransport=ae.generateRandomPipeName=ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;var hr=sm();hr.default.install();var om=require("path"),cN=require("os"),lN=require("crypto"),da=require("net"),Mt=ca();aN(ca(),ae);var pf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Mt.Disposable.create(()=>this.process.off("message",e))}};ae.IPCMessageReader=pf;var mf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.IPCMessageWriter=mf;var gf=class extends Mt.AbstractMessageReader{constructor(e){super(),this.onData=new Mt.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ae.PortMessageReader=gf;var yf=class extends Mt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ae.PortMessageWriter=yf;var Li=class extends Mt.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,hr.default)().stream.asReadableStream(e),t)}};ae.SocketMessageReader=Li;var xi=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,hr.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=xi;var ua=class extends Mt.ReadableStreamMessageReader{constructor(e,t){super((0,hr.default)().stream.asReadableStream(e),t)}};ae.StreamMessageReader=ua;var fa=class extends Mt.WriteableStreamMessageWriter{constructor(e,t){super((0,hr.default)().stream.asWritableStream(e),t)}};ae.StreamMessageWriter=fa;var am=process.env.XDG_RUNTIME_DIR,uN=new Map([["linux",107],["darwin",103]]);function fN(){let n=(0,lN.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;am?e=om.join(am,`vscode-ipc-${n}.sock`):e=om.join(cN.tmpdir(),`vscode-${n}.sock`);let t=uN.get(process.platform);return t!==void 0&&e.length>t&&(0,hr.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ae.generateRandomPipeName=fN;function dN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,da.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientPipeTransport=dN;function hN(n,e="utf-8"){let t=(0,da.createConnection)(n);return[new Li(t,e),new xi(t,e)]}ae.createServerPipeTransport=hN;function pN(n,e="utf-8"){let t,i=new Promise((r,s)=>{t=r});return new Promise((r,s)=>{let o=(0,da.createServer)(a=>{o.close(),t([new Li(a,e),new xi(a,e)])});o.on("error",s),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",s),r({onConnected:()=>i})})})}ae.createClientSocketTransport=pN;function mN(n,e="utf-8"){let t=(0,da.createConnection)(n,"127.0.0.1");return[new Li(t,e),new xi(t,e)]}ae.createServerSocketTransport=mN;function gN(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function yN(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function bN(n,e,t,i){t||(t=Mt.NullLogger);let r=gN(n)?new ua(n):n,s=yN(e)?new fa(e):e;return Mt.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Mt.createMessageConnection)(r,s,t,i)}ae.createMessageConnection=bN});var bf=C((WA,cm)=>{"use strict";cm.exports=Mi()});var pa=C((lm,ha)=>{(function(n){if(typeof ha=="object"&&typeof ha.exports=="object"){var e=n(require,lm);e!==void 0&&(ha.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(h){function k(E){return typeof E=="string"}h.is=k})(t||(e.DocumentUri=t={}));var i;(function(h){function k(E){return typeof E=="string"}h.is=k})(i||(e.URI=i={}));var r;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(r||(e.integer=r={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function k(E){return typeof E=="number"&&h.MIN_VALUE<=E&&E<=h.MAX_VALUE}h.is=k})(s||(e.uinteger=s={}));var o;(function(h){function k(m,f){return m===Number.MAX_VALUE&&(m=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:m,character:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=E})(o||(e.Position=o={}));var a;(function(h){function k(m,f,P,x){if(D.uinteger(m)&&D.uinteger(f)&&D.uinteger(P)&&D.uinteger(x))return{start:o.create(m,f),end:o.create(P,x)};if(o.is(m)&&o.is(f))return{start:m,end:f};throw new Error("Range#create called with invalid arguments[".concat(m,", ").concat(f,", ").concat(P,", ").concat(x,"]"))}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=E})(a||(e.Range=a={}));var c;(function(h){function k(m,f){return{uri:m,range:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=E})(c||(e.Location=c={}));var l;(function(h){function k(m,f,P,x){return{targetUri:m,targetRange:f,targetSelectionRange:P,originSelectionRange:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=E})(l||(e.LocationLink=l={}));var u;(function(h){function k(m,f,P,x){return{red:m,green:f,blue:P,alpha:x}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=E})(u||(e.Color=u={}));var d;(function(h){function k(m,f){return{range:m,color:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&u.is(f.color)}h.is=E})(d||(e.ColorInformation=d={}));var p;(function(h){function k(m,f,P){return{label:m,textEdit:f,additionalTextEdits:P}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||L.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,L.is))}h.is=E})(p||(e.ColorPresentation=p={}));var g;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(g||(e.FoldingRangeKind=g={}));var _;(function(h){function k(m,f,P,x,ee,Ue){var Ne={startLine:m,endLine:f};return D.defined(P)&&(Ne.startCharacter=P),D.defined(x)&&(Ne.endCharacter=x),D.defined(ee)&&(Ne.kind=ee),D.defined(Ue)&&(Ne.collapsedText=Ue),Ne}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=E})(_||(e.FoldingRange=_={}));var b;(function(h){function k(m,f){return{location:m,message:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&c.is(f.location)&&D.string(f.message)}h.is=E})(b||(e.DiagnosticRelatedInformation=b={}));var w;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(w||(e.DiagnosticSeverity=w={}));var R;(function(h){h.Unnecessary=1,h.Deprecated=2})(R||(e.DiagnosticTag=R={}));var v;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&D.string(m.href)}h.is=k})(v||(e.CodeDescription=v={}));var T;(function(h){function k(m,f,P,x,ee,Ue){var Ne={range:m,message:f};return D.defined(P)&&(Ne.severity=P),D.defined(x)&&(Ne.code=x),D.defined(ee)&&(Ne.source=ee),D.defined(Ue)&&(Ne.relatedInformation=Ue),Ne}h.create=k;function E(m){var f,P=m;return D.defined(P)&&a.is(P.range)&&D.string(P.message)&&(D.number(P.severity)||D.undefined(P.severity))&&(D.integer(P.code)||D.string(P.code)||D.undefined(P.code))&&(D.undefined(P.codeDescription)||D.string((f=P.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(P.source)||D.undefined(P.source))&&(D.undefined(P.relatedInformation)||D.typedArray(P.relatedInformation,b.is))}h.is=E})(T||(e.Diagnostic=T={}));var N;(function(h){function k(m,f){for(var P=[],x=2;x<arguments.length;x++)P[x-2]=arguments[x];var ee={title:m,command:f};return D.defined(P)&&P.length>0&&(ee.arguments=P),ee}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=E})(N||(e.Command=N={}));var L;(function(h){function k(P,x){return{range:P,newText:x}}h.replace=k;function E(P,x){return{range:{start:P,end:P},newText:x}}h.insert=E;function m(P){return{range:P,newText:""}}h.del=m;function f(P){var x=P;return D.objectLiteral(x)&&D.string(x.newText)&&a.is(x.range)}h.is=f})(L||(e.TextEdit=L={}));var q;(function(h){function k(m,f,P){var x={label:m};return f!==void 0&&(x.needsConfirmation=f),P!==void 0&&(x.description=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=E})(q||(e.ChangeAnnotation=q={}));var H;(function(h){function k(E){var m=E;return D.string(m)}h.is=k})(H||(e.ChangeAnnotationIdentifier=H={}));var j;(function(h){function k(P,x,ee){return{range:P,newText:x,annotationId:ee}}h.replace=k;function E(P,x,ee){return{range:{start:P,end:P},newText:x,annotationId:ee}}h.insert=E;function m(P,x){return{range:P,newText:"",annotationId:x}}h.del=m;function f(P){var x=P;return L.is(x)&&(q.is(x.annotationId)||H.is(x.annotationId))}h.is=f})(j||(e.AnnotatedTextEdit=j={}));var re;(function(h){function k(m,f){return{textDocument:m,edits:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&Ci.is(f.textDocument)&&Array.isArray(f.edits)}h.is=E})(re||(e.TextDocumentEdit=re={}));var Be;(function(h){function k(m,f,P){var x={kind:"create",uri:m};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Be||(e.CreateFile=Be={}));var Et;(function(h){function k(m,f,P,x){var ee={kind:"rename",oldUri:m,newUri:f};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(ee.options=P),x!==void 0&&(ee.annotationId=x),ee}h.create=k;function E(m){var f=m;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(Et||(e.RenameFile=Et={}));var ce;(function(h){function k(m,f,P){var x={kind:"delete",uri:m};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&(x.options=f),P!==void 0&&(x.annotationId=P),x}h.create=k;function E(m){var f=m;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=E})(ce||(e.DeleteFile=ce={}));var On;(function(h){function k(E){var m=E;return m&&(m.changes!==void 0||m.documentChanges!==void 0)&&(m.documentChanges===void 0||m.documentChanges.every(function(f){return D.string(f.kind)?Be.is(f)||Et.is(f)||ce.is(f):re.is(f)}))}h.is=k})(On||(e.WorkspaceEdit=On={}));var er=function(){function h(k,E){this.edits=k,this.changeAnnotations=E}return h.prototype.insert=function(k,E,m){var f,P;if(m===void 0?f=L.insert(k,E):H.is(m)?(P=m,f=j.insert(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.insert(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.replace=function(k,E,m){var f,P;if(m===void 0?f=L.replace(k,E):H.is(m)?(P=m,f=j.replace(k,E,m)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(m),f=j.replace(k,E,P)),this.edits.push(f),P!==void 0)return P},h.prototype.delete=function(k,E){var m,f;if(E===void 0?m=L.del(k):H.is(E)?(f=E,m=j.del(k,E)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(E),m=j.del(k,f)),this.edits.push(m),f!==void 0)return f},h.prototype.add=function(k){this.edits.push(k)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(k){if(k===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),Ro=function(){function h(k){this._annotations=k===void 0?Object.create(null):k,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(k,E){var m;if(H.is(k)?m=k:(m=this.nextId(),E=k),this._annotations[m]!==void 0)throw new Error("Id ".concat(m," is already in use."));if(E===void 0)throw new Error("No annotation provided for id ".concat(m));return this._annotations[m]=E,this._size++,m},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),ou=function(){function h(k){var E=this;this._textEditChanges=Object.create(null),k!==void 0?(this._workspaceEdit=k,k.documentChanges?(this._changeAnnotations=new Ro(k.changeAnnotations),k.changeAnnotations=this._changeAnnotations.all(),k.documentChanges.forEach(function(m){if(re.is(m)){var f=new er(m.edits,E._changeAnnotations);E._textEditChanges[m.textDocument.uri]=f}})):k.changes&&Object.keys(k.changes).forEach(function(m){var f=new er(k.changes[m]);E._textEditChanges[m]=f})):this._workspaceEdit={}}return Object.defineProperty(h.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),h.prototype.getTextEditChange=function(k){if(Ci.is(k)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var E={uri:k.uri,version:k.version},m=this._textEditChanges[E.uri];if(!m){var f=[],P={textDocument:E,edits:f};this._workspaceEdit.documentChanges.push(P),m=new er(f,this._changeAnnotations),this._textEditChanges[E.uri]=m}return m}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var m=this._textEditChanges[k];if(!m){var f=[];this._workspaceEdit.changes[k]=f,m=new er(f),this._textEditChanges[k]=m}return m}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ro,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=Be.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=Be.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h.prototype.renameFile=function(k,E,m,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;q.is(m)||H.is(m)?P=m:f=m;var x,ee;if(P===void 0?x=Et.create(k,E,f):(ee=H.is(P)?P:this._changeAnnotations.manage(P),x=Et.create(k,E,f,ee)),this._workspaceEdit.documentChanges.push(x),ee!==void 0)return ee},h.prototype.deleteFile=function(k,E,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;q.is(E)||H.is(E)?f=E:m=E;var P,x;if(f===void 0?P=ce.create(k,m):(x=H.is(f)?f:this._changeAnnotations.manage(f),P=ce.create(k,m,x)),this._workspaceEdit.documentChanges.push(P),x!==void 0)return x},h}();e.WorkspaceChange=ou;var Co;(function(h){function k(m){return{uri:m}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)}h.is=E})(Co||(e.TextDocumentIdentifier=Co={}));var as;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=E})(as||(e.VersionedTextDocumentIdentifier=as={}));var Ci;(function(h){function k(m,f){return{uri:m,version:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=E})(Ci||(e.OptionalVersionedTextDocumentIdentifier=Ci={}));var An;(function(h){function k(m,f,P,x){return{uri:m,languageId:f,version:P,text:x}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=E})(An||(e.TextDocumentItem=An={}));var tr;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function k(E){var m=E;return m===h.PlainText||m===h.Markdown}h.is=k})(tr||(e.MarkupKind=tr={}));var Oi;(function(h){function k(E){var m=E;return D.objectLiteral(E)&&tr.is(m.kind)&&D.string(m.value)}h.is=k})(Oi||(e.MarkupContent=Oi={}));var Oo;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Oo||(e.CompletionItemKind=Oo={}));var cs;(function(h){h.PlainText=1,h.Snippet=2})(cs||(e.InsertTextFormat=cs={}));var ls;(function(h){h.Deprecated=1})(ls||(e.CompletionItemTag=ls={}));var Ao;(function(h){function k(m,f,P){return{newText:m,insert:f,replace:P}}h.create=k;function E(m){var f=m;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=E})(Ao||(e.InsertReplaceEdit=Ao={}));var Io;(function(h){h.asIs=1,h.adjustIndentation=2})(Io||(e.InsertTextMode=Io={}));var Lo;(function(h){function k(E){var m=E;return m&&(D.string(m.detail)||m.detail===void 0)&&(D.string(m.description)||m.description===void 0)}h.is=k})(Lo||(e.CompletionItemLabelDetails=Lo={}));var xo;(function(h){function k(E){return{label:E}}h.create=k})(xo||(e.CompletionItem=xo={}));var Mo;(function(h){function k(E,m){return{items:E||[],isIncomplete:!!m}}h.create=k})(Mo||(e.CompletionList=Mo={}));var nr;(function(h){function k(m){return m.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=k;function E(m){var f=m;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=E})(nr||(e.MarkedString=nr={}));var Zt;(function(h){function k(E){var m=E;return!!m&&D.objectLiteral(m)&&(Oi.is(m.contents)||nr.is(m.contents)||D.typedArray(m.contents,nr.is))&&(E.range===void 0||a.is(E.range))}h.is=k})(Zt||(e.Hover=Zt={}));var qo;(function(h){function k(E,m){return m?{label:E,documentation:m}:{label:E}}h.create=k})(qo||(e.ParameterInformation=qo={}));var Fo;(function(h){function k(E,m){for(var f=[],P=2;P<arguments.length;P++)f[P-2]=arguments[P];var x={label:E};return D.defined(m)&&(x.documentation=m),D.defined(f)?x.parameters=f:x.parameters=[],x}h.create=k})(Fo||(e.SignatureInformation=Fo={}));var Ai;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ai||(e.DocumentHighlightKind=Ai={}));var Bo;(function(h){function k(E,m){var f={range:E};return D.number(m)&&(f.kind=m),f}h.create=k})(Bo||(e.DocumentHighlight=Bo={}));var ir;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(ir||(e.SymbolKind=ir={}));var jo;(function(h){h.Deprecated=1})(jo||(e.SymbolTag=jo={}));var In;(function(h){function k(E,m,f,P,x){var ee={name:E,kind:m,location:{uri:P,range:f}};return x&&(ee.containerName=x),ee}h.create=k})(In||(e.SymbolInformation=In={}));var Yn;(function(h){function k(E,m,f,P){return P!==void 0?{name:E,kind:m,location:{uri:f,range:P}}:{name:E,kind:m,location:{uri:f}}}h.create=k})(Yn||(e.WorkspaceSymbol=Yn={}));var Uo;(function(h){function k(m,f,P,x,ee,Ue){var Ne={name:m,detail:f,kind:P,range:x,selectionRange:ee};return Ue!==void 0&&(Ne.children=Ue),Ne}h.create=k;function E(m){var f=m;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=E})(Uo||(e.DocumentSymbol=Uo={}));var $o;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})($o||(e.CodeActionKind=$o={}));var mn;(function(h){h.Invoked=1,h.Automatic=2})(mn||(e.CodeActionTriggerKind=mn={}));var us;(function(h){function k(m,f,P){var x={diagnostics:m};return f!=null&&(x.only=f),P!=null&&(x.triggerKind=P),x}h.create=k;function E(m){var f=m;return D.defined(f)&&D.typedArray(f.diagnostics,T.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===mn.Invoked||f.triggerKind===mn.Automatic)}h.is=E})(us||(e.CodeActionContext=us={}));var fs;(function(h){function k(m,f,P){var x={title:m},ee=!0;return typeof f=="string"?(ee=!1,x.kind=f):N.is(f)?x.command=f:x.edit=f,ee&&P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,T.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||N.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||On.is(f.edit))}h.is=E})(fs||(e.CodeAction=fs={}));var rr;(function(h){function k(m,f){var P={range:m};return D.defined(f)&&(P.data=f),P}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||N.is(f.command))}h.is=E})(rr||(e.CodeLens=rr={}));var ds;(function(h){function k(m,f){return{tabSize:m,insertSpaces:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=E})(ds||(e.FormattingOptions=ds={}));var Ln;(function(h){function k(m,f,P){return{range:m,target:f,data:P}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=E})(Ln||(e.DocumentLink=Ln={}));var S;(function(h){function k(m,f){return{range:m,parent:f}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=E})(S||(e.SelectionRange=S={}));var I;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var W;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&(m.resultId===void 0||typeof m.resultId=="string")&&Array.isArray(m.data)&&(m.data.length===0||typeof m.data[0]=="number")}h.is=k})(W||(e.SemanticTokens=W={}));var ke;(function(h){function k(m,f){return{range:m,text:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=E})(ke||(e.InlineValueText=ke={}));var ye;(function(h){function k(m,f,P){return{range:m,variableName:f,caseSensitiveLookup:P}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=E})(ye||(e.InlineValueVariableLookup=ye={}));var Ce;(function(h){function k(m,f){return{range:m,expression:f}}h.create=k;function E(m){var f=m;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=E})(Ce||(e.InlineValueEvaluatableExpression=Ce={}));var Le;(function(h){function k(m,f){return{frameId:m,stoppedLocation:f}}h.create=k;function E(m){var f=m;return D.defined(f)&&a.is(m.stoppedLocation)}h.is=E})(Le||(e.InlineValueContext=Le={}));var se;(function(h){h.Type=1,h.Parameter=2;function k(E){return E===1||E===2}h.is=k})(se||(e.InlayHintKind=se={}));var Ee;(function(h){function k(m){return{value:m}}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.location===void 0||c.is(f.location))&&(f.command===void 0||N.is(f.command))}h.is=E})(Ee||(e.InlayHintLabelPart=Ee={}));var fe;(function(h){function k(m,f,P){var x={position:m,label:f};return P!==void 0&&(x.kind=P),x}h.create=k;function E(m){var f=m;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,Ee.is))&&(f.kind===void 0||se.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||D.string(f.tooltip)||Oi.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=E})(fe||(e.InlayHint=fe={}));var je;(function(h){function k(E){return{kind:"snippet",value:E}}h.createSnippet=k})(je||(e.StringValue=je={}));var nt;(function(h){function k(E,m,f,P){return{insertText:E,filterText:m,range:f,command:P}}h.create=k})(nt||(e.InlineCompletionItem=nt={}));var Lt;(function(h){function k(E){return{items:E}}h.create=k})(Lt||(e.InlineCompletionList=Lt={}));var Wo;(function(h){h.Invoked=0,h.Automatic=1})(Wo||(e.InlineCompletionTriggerKind=Wo={}));var wp;(function(h){function k(E,m){return{range:E,text:m}}h.create=k})(wp||(e.SelectedCompletionInfo=wp={}));var Np;(function(h){function k(E,m){return{triggerKind:E,selectedCompletionInfo:m}}h.create=k})(Np||(e.InlineCompletionContext=Np={}));var _p;(function(h){function k(E){var m=E;return D.objectLiteral(m)&&i.is(m.uri)&&D.string(m.name)}h.is=k})(_p||(e.WorkspaceFolder=_p={})),e.EOL=[`
33
33
  `,`\r
34
- `,"\r"];var Np;(function(h){function k(P,x,ee,Ue){return new Sw(P,x,ee,Ue)}h.create=k;function E(P){var x=P;return!!(D.defined(x)&&D.string(x.uri)&&(D.undefined(x.languageId)||D.string(x.languageId))&&D.uinteger(x.lineCount)&&D.func(x.getText)&&D.func(x.positionAt)&&D.func(x.offsetAt))}h.is=E;function m(P,x){for(var ee=P.getText(),Ue=f(x,function(rr,$o){var _p=rr.range.start.line-$o.range.start.line;return _p===0?rr.range.start.character-$o.range.start.character:_p}),Ne=ee.length,Zt=Ue.length-1;Zt>=0;Zt--){var en=Ue[Zt],xn=P.offsetAt(en.range.start),oe=P.offsetAt(en.range.end);if(oe<=Ne)ee=ee.substring(0,xn)+en.newText+ee.substring(oe,ee.length);else throw new Error("Overlapping edit");Ne=xn}return ee}h.applyEdits=m;function f(P,x){if(P.length<=1)return P;var ee=P.length/2|0,Ue=P.slice(0,ee),Ne=P.slice(ee);f(Ue,x),f(Ne,x);for(var Zt=0,en=0,xn=0;Zt<Ue.length&&en<Ne.length;){var oe=x(Ue[Zt],Ne[en]);oe<=0?P[xn++]=Ue[Zt++]:P[xn++]=Ne[en++]}for(;Zt<Ue.length;)P[xn++]=Ue[Zt++];for(;en<Ne.length;)P[xn++]=Ne[en++];return P}})(Np||(e.TextDocument=Np={}));var Sw=function(){function h(k,E,m,f){this._uri=k,this._languageId=E,this._version=m,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(k){if(k){var E=this.offsetAt(k.start),m=this.offsetAt(k.end);return this._content.substring(E,m)}return this._content},h.prototype.update=function(k,E){this._content=k.text,this._version=E,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var k=[],E=this._content,m=!0,f=0;f<E.length;f++){m&&(k.push(f),m=!1);var P=E.charAt(f);m=P==="\r"||P===`
34
+ `,"\r"];var Pp;(function(h){function k(P,x,ee,Ue){return new _w(P,x,ee,Ue)}h.create=k;function E(P){var x=P;return!!(D.defined(x)&&D.string(x.uri)&&(D.undefined(x.languageId)||D.string(x.languageId))&&D.uinteger(x.lineCount)&&D.func(x.getText)&&D.func(x.positionAt)&&D.func(x.offsetAt))}h.is=E;function m(P,x){for(var ee=P.getText(),Ue=f(x,function(sr,Vo){var Dp=sr.range.start.line-Vo.range.start.line;return Dp===0?sr.range.start.character-Vo.range.start.character:Dp}),Ne=ee.length,en=Ue.length-1;en>=0;en--){var tn=Ue[en],xn=P.offsetAt(tn.range.start),oe=P.offsetAt(tn.range.end);if(oe<=Ne)ee=ee.substring(0,xn)+tn.newText+ee.substring(oe,ee.length);else throw new Error("Overlapping edit");Ne=xn}return ee}h.applyEdits=m;function f(P,x){if(P.length<=1)return P;var ee=P.length/2|0,Ue=P.slice(0,ee),Ne=P.slice(ee);f(Ue,x),f(Ne,x);for(var en=0,tn=0,xn=0;en<Ue.length&&tn<Ne.length;){var oe=x(Ue[en],Ne[tn]);oe<=0?P[xn++]=Ue[en++]:P[xn++]=Ne[tn++]}for(;en<Ue.length;)P[xn++]=Ue[en++];for(;tn<Ne.length;)P[xn++]=Ne[tn++];return P}})(Pp||(e.TextDocument=Pp={}));var _w=function(){function h(k,E,m,f){this._uri=k,this._languageId=E,this._version=m,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(k){if(k){var E=this.offsetAt(k.start),m=this.offsetAt(k.end);return this._content.substring(E,m)}return this._content},h.prototype.update=function(k,E){this._content=k.text,this._version=E,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var k=[],E=this._content,m=!0,f=0;f<E.length;f++){m&&(k.push(f),m=!1);var P=E.charAt(f);m=P==="\r"||P===`
35
35
  `,P==="\r"&&f+1<E.length&&E.charAt(f+1)===`
36
- `&&f++}m&&E.length>0&&k.push(E.length),this._lineOffsets=k}return this._lineOffsets},h.prototype.positionAt=function(k){k=Math.max(Math.min(k,this._content.length),0);var E=this.getLineOffsets(),m=0,f=E.length;if(f===0)return o.create(0,k);for(;m<f;){var P=Math.floor((m+f)/2);E[P]>k?f=P:m=P+1}var x=m-1;return o.create(x,k-E[x])},h.prototype.offsetAt=function(k){var E=this.getLineOffsets();if(k.line>=E.length)return this._content.length;if(k.line<0)return 0;var m=E[k.line],f=k.line+1<E.length?E[k.line+1]:this._content.length;return Math.max(Math.min(m+k.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var k=Object.prototype.toString;function E(oe){return typeof oe<"u"}h.defined=E;function m(oe){return typeof oe>"u"}h.undefined=m;function f(oe){return oe===!0||oe===!1}h.boolean=f;function P(oe){return k.call(oe)==="[object String]"}h.string=P;function x(oe){return k.call(oe)==="[object Number]"}h.number=x;function ee(oe,rr,$o){return k.call(oe)==="[object Number]"&&rr<=oe&&oe<=$o}h.numberRange=ee;function Ue(oe){return k.call(oe)==="[object Number]"&&-2147483648<=oe&&oe<=2147483647}h.integer=Ue;function Ne(oe){return k.call(oe)==="[object Number]"&&0<=oe&&oe<=2147483647}h.uinteger=Ne;function Zt(oe){return k.call(oe)==="[object Function]"}h.func=Zt;function en(oe){return oe!==null&&typeof oe=="object"}h.objectLiteral=en;function xn(oe,rr){return Array.isArray(oe)&&oe.every(rr)}h.typedArray=xn})(D||(D={}))})});var xe=C(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var hr=Mi(),cm;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(cm||(Dt.MessageDirection=cm={}));var bf=class{constructor(e){this.method=e}};Dt.RegistrationType=bf;var Tf=class extends hr.RequestType0{constructor(e){super(e)}};Dt.ProtocolRequestType0=Tf;var vf=class extends hr.RequestType{constructor(e){super(e,hr.ParameterStructures.byName)}};Dt.ProtocolRequestType=vf;var Sf=class extends hr.NotificationType0{constructor(e){super(e)}};Dt.ProtocolNotificationType0=Sf;var kf=class extends hr.NotificationType{constructor(e){super(e,hr.ParameterStructures.byName)}};Dt.ProtocolNotificationType=kf});var ha=C(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.objectLiteral=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function pN(n){return n===!0||n===!1}Ye.boolean=pN;function lm(n){return typeof n=="string"||n instanceof String}Ye.string=lm;function mN(n){return typeof n=="number"||n instanceof Number}Ye.number=mN;function gN(n){return n instanceof Error}Ye.error=gN;function yN(n){return typeof n=="function"}Ye.func=yN;function um(n){return Array.isArray(n)}Ye.array=um;function bN(n){return um(n)&&n.every(e=>lm(e))}Ye.stringArray=bN;function TN(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=TN;function vN(n){return n!==null&&typeof n=="object"}Ye.objectLiteral=vN});var hm=C(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ImplementationRequest=void 0;var fm=xe(),dm;(function(n){n.method="textDocument/implementation",n.messageDirection=fm.MessageDirection.clientToServer,n.type=new fm.ProtocolRequestType(n.method)})(dm||(pa.ImplementationRequest=dm={}))});var gm=C(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.TypeDefinitionRequest=void 0;var pm=xe(),mm;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=pm.MessageDirection.clientToServer,n.type=new pm.ProtocolRequestType(n.method)})(mm||(ma.TypeDefinitionRequest=mm={}))});var Tm=C(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.DidChangeWorkspaceFoldersNotification=pr.WorkspaceFoldersRequest=void 0;var ga=xe(),ym;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=ga.MessageDirection.serverToClient,n.type=new ga.ProtocolRequestType0(n.method)})(ym||(pr.WorkspaceFoldersRequest=ym={}));var bm;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=ga.MessageDirection.clientToServer,n.type=new ga.ProtocolNotificationType(n.method)})(bm||(pr.DidChangeWorkspaceFoldersNotification=bm={}))});var km=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.ConfigurationRequest=void 0;var vm=xe(),Sm;(function(n){n.method="workspace/configuration",n.messageDirection=vm.MessageDirection.serverToClient,n.type=new vm.ProtocolRequestType(n.method)})(Sm||(ya.ConfigurationRequest=Sm={}))});var Nm=C(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.ColorPresentationRequest=mr.DocumentColorRequest=void 0;var ba=xe(),Em;(function(n){n.method="textDocument/documentColor",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(Em||(mr.DocumentColorRequest=Em={}));var wm;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolRequestType(n.method)})(wm||(mr.ColorPresentationRequest=wm={}))});var Dm=C(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.FoldingRangeRefreshRequest=gr.FoldingRangeRequest=void 0;var Ta=xe(),_m;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Ta.MessageDirection.clientToServer,n.type=new Ta.ProtocolRequestType(n.method)})(_m||(gr.FoldingRangeRequest=_m={}));var Pm;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Ta.MessageDirection.serverToClient,n.type=new Ta.ProtocolRequestType0(n.method)})(Pm||(gr.FoldingRangeRefreshRequest=Pm={}))});var Om=C(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.DeclarationRequest=void 0;var Rm=xe(),Cm;(function(n){n.method="textDocument/declaration",n.messageDirection=Rm.MessageDirection.clientToServer,n.type=new Rm.ProtocolRequestType(n.method)})(Cm||(va.DeclarationRequest=Cm={}))});var Lm=C(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.SelectionRangeRequest=void 0;var Am=xe(),Im;(function(n){n.method="textDocument/selectionRange",n.messageDirection=Am.MessageDirection.clientToServer,n.type=new Am.ProtocolRequestType(n.method)})(Im||(Sa.SelectionRangeRequest=Im={}))});var Fm=C(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WorkDoneProgressCancelNotification=Xn.WorkDoneProgressCreateRequest=Xn.WorkDoneProgress=void 0;var SN=Mi(),ka=xe(),xm;(function(n){n.type=new SN.ProgressType;function e(t){return t===n.type}n.is=e})(xm||(Xn.WorkDoneProgress=xm={}));var Mm;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=ka.MessageDirection.serverToClient,n.type=new ka.ProtocolRequestType(n.method)})(Mm||(Xn.WorkDoneProgressCreateRequest=Mm={}));var qm;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=ka.MessageDirection.clientToServer,n.type=new ka.ProtocolNotificationType(n.method)})(qm||(Xn.WorkDoneProgressCancelNotification=qm={}))});var $m=C(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallHierarchyOutgoingCallsRequest=Qn.CallHierarchyIncomingCallsRequest=Qn.CallHierarchyPrepareRequest=void 0;var yr=xe(),Bm;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(Bm||(Qn.CallHierarchyPrepareRequest=Bm={}));var jm;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(jm||(Qn.CallHierarchyIncomingCallsRequest=jm={}));var Um;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=yr.MessageDirection.clientToServer,n.type=new yr.ProtocolRequestType(n.method)})(Um||(Qn.CallHierarchyOutgoingCallsRequest=Um={}))});var zm=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var qn=xe(),Wm;(function(n){n.Relative="relative"})(Wm||(Rt.TokenFormat=Wm={}));var ys;(function(n){n.method="textDocument/semanticTokens",n.type=new qn.RegistrationType(n.method)})(ys||(Rt.SemanticTokensRegistrationType=ys={}));var Vm;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Vm||(Rt.SemanticTokensRequest=Vm={}));var Hm;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Hm||(Rt.SemanticTokensDeltaRequest=Hm={}));var Ym;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=ys.method})(Ym||(Rt.SemanticTokensRangeRequest=Ym={}));var Km;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=qn.MessageDirection.serverToClient,n.type=new qn.ProtocolRequestType0(n.method)})(Km||(Rt.SemanticTokensRefreshRequest=Km={}))});var Qm=C(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.ShowDocumentRequest=void 0;var Gm=xe(),Xm;(function(n){n.method="window/showDocument",n.messageDirection=Gm.MessageDirection.serverToClient,n.type=new Gm.ProtocolRequestType(n.method)})(Xm||(Ea.ShowDocumentRequest=Xm={}))});var eg=C(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.LinkedEditingRangeRequest=void 0;var Jm=xe(),Zm;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=Jm.MessageDirection.clientToServer,n.type=new Jm.ProtocolRequestType(n.method)})(Zm||(wa.LinkedEditingRangeRequest=Zm={}))});var cg=C(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var Ut=xe(),tg;(function(n){n.file="file",n.folder="folder"})(tg||(yt.FileOperationPatternKind=tg={}));var ng;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ng||(yt.WillCreateFilesRequest=ng={}));var ig;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(ig||(yt.DidCreateFilesNotification=ig={}));var rg;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(rg||(yt.WillRenameFilesRequest=rg={}));var sg;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(sg||(yt.DidRenameFilesNotification=sg={}));var og;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolNotificationType(n.method)})(og||(yt.DidDeleteFilesNotification=og={}));var ag;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=Ut.MessageDirection.clientToServer,n.type=new Ut.ProtocolRequestType(n.method)})(ag||(yt.WillDeleteFilesRequest=ag={}))});var hg=C(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.MonikerRequest=Jn.MonikerKind=Jn.UniquenessLevel=void 0;var lg=xe(),ug;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(ug||(Jn.UniquenessLevel=ug={}));var fg;(function(n){n.$import="import",n.$export="export",n.local="local"})(fg||(Jn.MonikerKind=fg={}));var dg;(function(n){n.method="textDocument/moniker",n.messageDirection=lg.MessageDirection.clientToServer,n.type=new lg.ProtocolRequestType(n.method)})(dg||(Jn.MonikerRequest=dg={}))});var yg=C(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TypeHierarchySubtypesRequest=Zn.TypeHierarchySupertypesRequest=Zn.TypeHierarchyPrepareRequest=void 0;var br=xe(),pg;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(pg||(Zn.TypeHierarchyPrepareRequest=pg={}));var mg;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(mg||(Zn.TypeHierarchySupertypesRequest=mg={}));var gg;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(gg||(Zn.TypeHierarchySubtypesRequest=gg={}))});var vg=C(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.InlineValueRefreshRequest=Tr.InlineValueRequest=void 0;var Na=xe(),bg;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Na.MessageDirection.clientToServer,n.type=new Na.ProtocolRequestType(n.method)})(bg||(Tr.InlineValueRequest=bg={}));var Tg;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Na.MessageDirection.serverToClient,n.type=new Na.ProtocolRequestType0(n.method)})(Tg||(Tr.InlineValueRefreshRequest=Tg={}))});var wg=C(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.InlayHintRefreshRequest=ei.InlayHintResolveRequest=ei.InlayHintRequest=void 0;var vr=xe(),Sg;(function(n){n.method="textDocument/inlayHint",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method)})(Sg||(ei.InlayHintRequest=Sg={}));var kg;(function(n){n.method="inlayHint/resolve",n.messageDirection=vr.MessageDirection.clientToServer,n.type=new vr.ProtocolRequestType(n.method)})(kg||(ei.InlayHintResolveRequest=kg={}));var Eg;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=vr.MessageDirection.serverToClient,n.type=new vr.ProtocolRequestType0(n.method)})(Eg||(ei.InlayHintRefreshRequest=Eg={}))});var Og=C($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.DiagnosticRefreshRequest=$t.WorkspaceDiagnosticRequest=$t.DocumentDiagnosticRequest=$t.DocumentDiagnosticReportKind=$t.DiagnosticServerCancellationData=void 0;var Cg=Mi(),kN=ha(),Sr=xe(),Ng;(function(n){function e(t){let i=t;return i&&kN.boolean(i.retriggerRequest)}n.is=e})(Ng||($t.DiagnosticServerCancellationData=Ng={}));var _g;(function(n){n.Full="full",n.Unchanged="unchanged"})(_g||($t.DocumentDiagnosticReportKind=_g={}));var Pg;(function(n){n.method="textDocument/diagnostic",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Pg||($t.DocumentDiagnosticRequest=Pg={}));var Dg;(function(n){n.method="workspace/diagnostic",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method),n.partialResult=new Cg.ProgressType})(Dg||($t.WorkspaceDiagnosticRequest=Dg={}));var Rg;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=Sr.MessageDirection.serverToClient,n.type=new Sr.ProtocolRequestType0(n.method)})(Rg||($t.DiagnosticRefreshRequest=Rg={}))});var Fg=C($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var bs=da(),nn=ha(),mn=xe(),Ef;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(Ef||($e.NotebookCellKind=Ef={}));var wf;(function(n){function e(r,s){let o={executionOrder:r};return(s===!0||s===!1)&&(o.success=s),o}n.create=e;function t(r){let s=r;return nn.objectLiteral(s)&&bs.uinteger.is(s.executionOrder)&&(s.success===void 0||nn.boolean(s.success))}n.is=t;function i(r,s){return r===s?!0:r==null||s===null||s===void 0?!1:r.executionOrder===s.executionOrder&&r.success===s.success}n.equals=i})(wf||($e.ExecutionSummary=wf={}));var _a;(function(n){function e(s,o){return{kind:s,document:o}}n.create=e;function t(s){let o=s;return nn.objectLiteral(o)&&Ef.is(o.kind)&&bs.DocumentUri.is(o.document)&&(o.metadata===void 0||nn.objectLiteral(o.metadata))}n.is=t;function i(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!r(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!wf.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function r(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!r(s[l],o[l]))return!1}if(nn.objectLiteral(s)&&nn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!r(l,u)))return!1;for(let d=0;d<l.length;d++){let p=l[d];if(!r(s[p],o[p]))return!1}}return!0}})(_a||($e.NotebookCell=_a={}));var Ag;(function(n){function e(i,r,s,o){return{uri:i,notebookType:r,version:s,cells:o}}n.create=e;function t(i){let r=i;return nn.objectLiteral(r)&&nn.string(r.uri)&&bs.integer.is(r.version)&&nn.typedArray(r.cells,_a.is)}n.is=t})(Ag||($e.NotebookDocument=Ag={}));var kr;(function(n){n.method="notebookDocument/sync",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.RegistrationType(n.method)})(kr||($e.NotebookDocumentSyncRegistrationType=kr={}));var Ig;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(Ig||($e.DidOpenNotebookDocumentNotification=Ig={}));var Lg;(function(n){function e(i){let r=i;return nn.objectLiteral(r)&&bs.uinteger.is(r.start)&&bs.uinteger.is(r.deleteCount)&&(r.cells===void 0||nn.typedArray(r.cells,_a.is))}n.is=e;function t(i,r,s){let o={start:i,deleteCount:r};return s!==void 0&&(o.cells=s),o}n.create=t})(Lg||($e.NotebookCellArrayChange=Lg={}));var xg;(function(n){n.method="notebookDocument/didChange",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(xg||($e.DidChangeNotebookDocumentNotification=xg={}));var Mg;(function(n){n.method="notebookDocument/didSave",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(Mg||($e.DidSaveNotebookDocumentNotification=Mg={}));var qg;(function(n){n.method="notebookDocument/didClose",n.messageDirection=mn.MessageDirection.clientToServer,n.type=new mn.ProtocolNotificationType(n.method),n.registrationMethod=kr.method})(qg||($e.DidCloseNotebookDocumentNotification=qg={}))});var Ug=C(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.InlineCompletionRequest=void 0;var Bg=xe(),jg;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=Bg.MessageDirection.clientToServer,n.type=new Bg.ProtocolRequestType(n.method)})(jg||(Pa.InlineCompletionRequest=jg={}))});var eb=C(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var F=xe(),$g=da(),it=ha(),EN=hm();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return EN.ImplementationRequest}});var wN=gm();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return wN.TypeDefinitionRequest}});var Xy=Tm();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Xy.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Xy.DidChangeWorkspaceFoldersNotification}});var NN=km();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return NN.ConfigurationRequest}});var Qy=Nm();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return Qy.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return Qy.ColorPresentationRequest}});var Jy=Dm();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Jy.FoldingRangeRefreshRequest}});var _N=Om();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return _N.DeclarationRequest}});var PN=Lm();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return PN.SelectionRangeRequest}});var Rf=Fm();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return Rf.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Rf.WorkDoneProgressCancelNotification}});var Cf=$m();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Cf.CallHierarchyPrepareRequest}});var Er=zm();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return Er.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Er.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Er.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Er.SemanticTokensRegistrationType}});var DN=Qm();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return DN.ShowDocumentRequest}});var RN=eg();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return RN.LinkedEditingRangeRequest}});var qi=cg();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Of=hg();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return Of.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return Of.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return Of.MonikerRequest}});var Af=yg();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Af.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Af.TypeHierarchySupertypesRequest}});var Zy=vg();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return Zy.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Zy.InlineValueRefreshRequest}});var If=wg();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return If.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return If.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return If.InlayHintRefreshRequest}});var Ts=Og();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ts.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ts.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ts.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ts.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ts.DiagnosticRefreshRequest}});var gn=Fg();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return gn.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return gn.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return gn.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return gn.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return gn.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return gn.DidCloseNotebookDocumentNotification}});var CN=Ug();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return CN.InlineCompletionRequest}});var Nf;(function(n){function e(t){let i=t;return it.string(i)||it.string(i.language)||it.string(i.scheme)||it.string(i.pattern)}n.is=e})(Nf||(y.TextDocumentFilter=Nf={}));var _f;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebookType)||it.string(i.scheme)||it.string(i.pattern))}n.is=e})(_f||(y.NotebookDocumentFilter=_f={}));var Pf;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebook)||_f.is(i.notebook))&&(i.language===void 0||it.string(i.language))}n.is=e})(Pf||(y.NotebookCellTextDocumentFilter=Pf={}));var Df;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!it.string(i)&&!Nf.is(i)&&!Pf.is(i))return!1;return!0}n.is=e})(Df||(y.DocumentSelector=Df={}));var Wg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Wg||(y.RegistrationRequest=Wg={}));var Vg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Vg||(y.UnregistrationRequest=Vg={}));var Hg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Hg||(y.ResourceOperationKind=Hg={}));var Yg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(Yg||(y.FailureHandlingKind=Yg={}));var Kg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Kg||(y.PositionEncodingKind=Kg={}));var zg;(function(n){function e(t){let i=t;return i&&it.string(i.id)&&i.id.length>0}n.hasId=e})(zg||(y.StaticRegistrationOptions=zg={}));var Gg;(function(n){function e(t){let i=t;return i&&(i.documentSelector===null||Df.is(i.documentSelector))}n.is=e})(Gg||(y.TextDocumentRegistrationOptions=Gg={}));var Xg;(function(n){function e(i){let r=i;return it.objectLiteral(r)&&(r.workDoneProgress===void 0||it.boolean(r.workDoneProgress))}n.is=e;function t(i){let r=i;return r&&it.boolean(r.workDoneProgress)}n.hasWorkDoneProgress=t})(Xg||(y.WorkDoneProgressOptions=Xg={}));var Qg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Qg||(y.InitializeRequest=Qg={}));var Jg;(function(n){n.unknownProtocolVersion=1})(Jg||(y.InitializeErrorCodes=Jg={}));var Zg;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Zg||(y.InitializedNotification=Zg={}));var ey;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ey||(y.ShutdownRequest=ey={}));var ty;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(ty||(y.ExitNotification=ty={}));var ny;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ny||(y.DidChangeConfigurationNotification=ny={}));var iy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(iy||(y.MessageType=iy={}));var ry;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ry||(y.ShowMessageNotification=ry={}));var sy;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(sy||(y.ShowMessageRequest=sy={}));var oy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(y.LogMessageNotification=oy={}));var ay;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ay||(y.TelemetryEventNotification=ay={}));var cy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(cy||(y.TextDocumentSyncKind=cy={}));var ly;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ly||(y.DidOpenTextDocumentNotification=ly={}));var uy;(function(n){function e(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}n.isIncremental=e;function t(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}n.isFull=t})(uy||(y.TextDocumentContentChangeEvent=uy={}));var fy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(y.DidChangeTextDocumentNotification=fy={}));var dy;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(dy||(y.DidCloseTextDocumentNotification=dy={}));var hy;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(y.DidSaveTextDocumentNotification=hy={}));var py;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(py||(y.TextDocumentSaveReason=py={}));var my;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(y.WillSaveTextDocumentNotification=my={}));var gy;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(gy||(y.WillSaveTextDocumentWaitUntilRequest=gy={}));var yy;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(y.DidChangeWatchedFilesNotification=yy={}));var by;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(by||(y.FileChangeType=by={}));var Ty;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&($g.URI.is(i.baseUri)||$g.WorkspaceFolder.is(i.baseUri))&&it.string(i.pattern)}n.is=e})(Ty||(y.RelativePattern=Ty={}));var vy;(function(n){n.Create=1,n.Change=2,n.Delete=4})(vy||(y.WatchKind=vy={}));var Sy;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Sy||(y.PublishDiagnosticsNotification=Sy={}));var ky;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(ky||(y.CompletionTriggerKind=ky={}));var Ey;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ey||(y.CompletionRequest=Ey={}));var wy;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(wy||(y.CompletionResolveRequest=wy={}));var Ny;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(y.HoverRequest=Ny={}));var _y;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(_y||(y.SignatureHelpTriggerKind=_y={}));var Py;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(y.SignatureHelpRequest=Py={}));var Dy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Dy||(y.DefinitionRequest=Dy={}));var Ry;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(y.ReferencesRequest=Ry={}));var Cy;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(y.DocumentHighlightRequest=Cy={}));var Oy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(y.DocumentSymbolRequest=Oy={}));var Ay;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(y.CodeActionRequest=Ay={}));var Iy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(y.CodeActionResolveRequest=Iy={}));var Ly;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(y.WorkspaceSymbolRequest=Ly={}));var xy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(y.WorkspaceSymbolResolveRequest=xy={}));var My;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(y.CodeLensRequest=My={}));var qy;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(y.CodeLensResolveRequest=qy={}));var Fy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(Fy||(y.CodeLensRefreshRequest=Fy={}));var By;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(y.DocumentLinkRequest=By={}));var jy;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(jy||(y.DocumentLinkResolveRequest=jy={}));var Uy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(y.DocumentFormattingRequest=Uy={}));var $y;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(y.DocumentRangeFormattingRequest=$y={}));var Wy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(y.DocumentRangesFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(y.DocumentOnTypeFormattingRequest=Vy={}));var Hy;(function(n){n.Identifier=1})(Hy||(y.PrepareSupportDefaultBehavior=Hy={}));var Yy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(y.RenameRequest=Yy={}));var Ky;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ky||(y.PrepareRenameRequest=Ky={}));var zy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(y.ExecuteCommandRequest=zy={}));var Gy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Gy||(y.ApplyWorkspaceEditRequest=Gy={}))});var nb=C(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createProtocolConnection=void 0;var tb=Mi();function ON(n,e,t,i){return tb.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,tb.createMessageConnection)(n,e,t,i)}Da.createProtocolConnection=ON});var rb=C(Ct=>{"use strict";var AN=Ct&&Ct.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Ra=Ct&&Ct.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AN(e,n,t)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LSPErrorCodes=Ct.createProtocolConnection=void 0;Ra(Mi(),Ct);Ra(da(),Ct);Ra(xe(),Ct);Ra(eb(),Ct);var IN=nb();Object.defineProperty(Ct,"createProtocolConnection",{enumerable:!0,get:function(){return IN.createProtocolConnection}});var ib;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(ib||(Ct.LSPErrorCodes=ib={}))});var We=C(yn=>{"use strict";var LN=yn&&yn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),sb=yn&&yn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&LN(e,n,t)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createProtocolConnection=void 0;var xN=yf();sb(yf(),yn);sb(rb(),yn);function MN(n,e,t,i){return(0,xN.createMessageConnection)(n,e,t,i)}yn.createProtocolConnection=MN});var Lf=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.generateUuid=Wt.parse=Wt.isUUID=Wt.v4=Wt.empty=void 0;var vs=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Ss=class n extends vs{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};Ss._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Ss._timeHighBits=["8","9","a","b"];Wt.empty=new vs("00000000-0000-0000-0000-000000000000");function ob(){return new Ss}Wt.v4=ob;var qN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ab(n){return qN.test(n)}Wt.isUUID=ab;function FN(n){if(!ab(n))throw new Error("invalid uuid");return new vs(n)}Wt.parse=FN;function BN(){return ob().asHex()}Wt.generateUuid=BN});var cb=C(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.attachPartialResult=ni.ProgressFeature=ni.attachWorkDone=void 0;var ti=We(),jN=Lf(),Fi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,i,r){let s={kind:"begin",title:e,percentage:t,message:i,cancellable:r};this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,s)}report(e,t){let i={kind:"report"};typeof e=="number"?(i.percentage=e,t!==void 0&&(i.message=t)):i.message=e,this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,i)}done(){n.Instances.delete(this._token),this._connection.sendProgress(ti.WorkDoneProgress.type,this._token,{kind:"end"})}};Fi.Instances=new Map;var Ca=class extends Fi{constructor(e,t){super(e,t),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ks=class{constructor(){}begin(){}report(){}done(){}},Oa=class extends ks{constructor(){super(),this._source=new ti.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function UN(n,e){if(e===void 0||e.workDoneToken===void 0)return new ks;let t=e.workDoneToken;return delete e.workDoneToken,new Fi(n,t)}ni.attachWorkDone=UN;var $N=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ti.WorkDoneProgressCancelNotification.type,t=>{let i=Fi.Instances.get(t.token);(i instanceof Ca||i instanceof Oa)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ks:new Fi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,jN.generateUuid)();return this.connection.sendRequest(ti.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ca(this.connection,e))}else return Promise.resolve(new Oa)}};ni.ProgressFeature=$N;var xf;(function(n){n.type=new ti.ProgressType})(xf||(xf={}));var Mf=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(xf.type,this._token,e)}};function WN(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Mf(n,t)}ni.attachPartialResult=WN});var lb=C(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ConfigurationFeature=void 0;var VN=We(),HN=Wo(),YN=n=>class extends n{getConfiguration(e){return e?HN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(VN.ConfigurationRequest.type,t).then(i=>Array.isArray(i)?Array.isArray(e)?i:i[0]:Array.isArray(e)?[]:null)}};Aa.ConfigurationFeature=YN});var ub=C(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.WorkspaceFoldersFeature=void 0;var Ia=We(),KN=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ia.Emitter,this.connection.onNotification(Ia.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ia.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Ia.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};La.WorkspaceFoldersFeature=KN});var fb=C(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.CallHierarchyFeature=void 0;var qf=We(),zN=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(qf.CallHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=qf.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onOutgoingCalls:e=>{let t=qf.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};xa.CallHierarchyFeature=zN});var Bf=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.SemanticTokensBuilder=ii.SemanticTokensDiff=ii.SemanticTokensFeature=void 0;var Ma=We(),GN=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ma.SemanticTokensRefreshRequest.type),on:e=>{let t=Ma.SemanticTokensRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onDelta:e=>{let t=Ma.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onRange:e=>{let t=Ma.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};ii.SemanticTokensFeature=GN;var qa=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,i=0;for(;i<t&&i<e&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<t&&i<e){let r=e-1,s=t-1;for(;r>=i&&s>=i&&this.originalSequence[r]===this.modifiedSequence[s];)r--,s--;(r<i||s<i)&&(r++,s++);let o=r-i+1,a=this.modifiedSequence.slice(i,s+1);return a.length===1&&a[0]===this.originalSequence[r]?[{start:i,deleteCount:o-1}]:[{start:i,deleteCount:o,data:a}]}else return i<t?[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}]:i<e?[{start:i,deleteCount:e-i}]:[]}};ii.SemanticTokensDiff=qa;var Ff=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,i,r,s){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new qa(this._prevData,this._data).computeDiff()}:this.build()}};ii.SemanticTokensBuilder=Ff});var db=C(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ShowDocumentFeature=void 0;var XN=We(),QN=n=>class extends n{showDocument(e){return this.connection.sendRequest(XN.ShowDocumentRequest.type,e)}};Fa.ShowDocumentFeature=QN});var hb=C(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.FileOperationsFeature=void 0;var wr=We(),JN=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(wr.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(wr.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(wr.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(wr.WillCreateFilesRequest.type,(t,i)=>e(t,i))}onWillRenameFiles(e){return this.connection.onRequest(wr.WillRenameFilesRequest.type,(t,i)=>e(t,i))}onWillDeleteFiles(e){return this.connection.onRequest(wr.WillDeleteFilesRequest.type,(t,i)=>e(t,i))}};Ba.FileOperationsFeature=JN});var pb=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.LinkedEditingRangeFeature=void 0;var ZN=We(),e_=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(ZN.LinkedEditingRangeRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0))}};ja.LinkedEditingRangeFeature=e_});var mb=C(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.TypeHierarchyFeature=void 0;var jf=We(),t_=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(jf.TypeHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=jf.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onSubtypes:e=>{let t=jf.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Ua.TypeHierarchyFeature=t_});var yb=C($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.InlineValueFeature=void 0;var gb=We(),n_=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(gb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(gb.InlineValueRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};$a.InlineValueFeature=n_});var Tb=C(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.FoldingRangeFeature=void 0;var bb=We(),i_=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(bb.FoldingRangeRefreshRequest.type),on:e=>{let t=bb.FoldingRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Wa.FoldingRangeFeature=i_});var vb=C(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.InlayHintFeature=void 0;var Uf=We(),r_=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Uf.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Uf.InlayHintRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Uf.InlayHintResolveRequest.type,(t,i)=>e(t,i))}}};Va.InlayHintFeature=r_});var Sb=C(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.DiagnosticFeature=void 0;var Es=We(),s_=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Es.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Es.DocumentDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Es.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Es.WorkspaceDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Es.WorkspaceDiagnosticRequest.partialResult,t)))}}};Ha.DiagnosticFeature=s_});var Wf=C(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.TextDocuments=void 0;var Bi=We(),$f=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Bi.Emitter,this._onDidOpen=new Bi.Emitter,this._onDidClose=new Bi.Emitter,this._onDidSave=new Bi.Emitter,this._onWillSave=new Bi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Bi.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(i=>{let r=i.textDocument,s=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(i=>{let r=i.textDocument,s=i.contentChanges;if(s.length===0)return;let{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),t.push(e.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((i,r)=>{let s=this._syncedDocuments.get(i.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:i.reason}),r):[]})),t.push(e.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Bi.Disposable.create(()=>{t.forEach(i=>i.dispose())})}};Ya.TextDocuments=$f});var Hf=C(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.NotebookDocuments=Nr.NotebookSyncFeature=void 0;var Vt=We(),kb=Wf(),o_=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Vt.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Vt.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Vt.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Vt.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};Nr.NotebookSyncFeature=o_;var Ka=class n{onDidOpenTextDocument(e){return this.openHandler=e,Vt.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Vt.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Vt.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Ka.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Vf=class{constructor(e){e instanceof kb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new kb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Vt.Emitter,this._onDidChange=new Vt.Emitter,this._onDidSave=new Vt.Emitter,this._onDidClose=new Vt.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,i=this.notebookCellMap.get(t);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Ka,i=[];return i.push(this.cellTextDocuments.listen(t)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let s of r.cellTextDocuments)t.openTextDocument({textDocument:s});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s===void 0)return;s.version=r.notebookDocument.version;let o=s.metadata,a=!1,c=r.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],p=[];if(c.cells!==void 0){let R=c.cells;if(R.structure!==void 0){let v=R.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),R.structure.didOpen!==void 0)for(let T of R.structure.didOpen)t.openTextDocument({textDocument:T}),l.push(T.uri);if(R.structure.didClose)for(let T of R.structure.didClose)t.closeTextDocument({textDocument:T}),u.push(T.uri)}if(R.data!==void 0){let v=new Map(R.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let N=v.get(s.cells[T].document);if(N!==void 0){let L=s.cells.splice(T,1,N);if(d.push({old:L[0],new:N}),v.delete(N.document),v.size===0)break}}}if(R.textContent!==void 0)for(let v of R.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),p.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let R of l)_.push(this.getNotebookCell(R));let b=[];for(let R of u)b.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||b.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:b,changed:{data:d,textContent:w}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of r.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(r.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Vt.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};Nr.NotebookDocuments=Vf});var Eb=C(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.MonikerFeature=void 0;var a_=We(),c_=n=>class extends n{get moniker(){return{on:e=>{let t=a_.MonikerRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};za.MonikerFeature=c_});var Qf=C(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.createConnection=de.combineFeatures=de.combineNotebooksFeatures=de.combineLanguagesFeatures=de.combineWorkspaceFeatures=de.combineWindowFeatures=de.combineClientFeatures=de.combineTracerFeatures=de.combineTelemetryFeatures=de.combineConsoleFeatures=de._NotebooksImpl=de._LanguagesImpl=de.BulkUnregistration=de.BulkRegistration=de.ErrorMessageTracker=void 0;var U=We(),Ht=Wo(),Kf=Lf(),Z=cb(),l_=lb(),u_=ub(),f_=fb(),d_=Bf(),h_=db(),p_=hb(),m_=pb(),g_=mb(),y_=yb(),b_=Tb(),T_=vb(),v_=Sb(),S_=Hf(),k_=Eb();function Yf(n){if(n!==null)return n}var zf=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};de.ErrorMessageTracker=zf;var Ga=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Gf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let i={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showWarningMessage(e,...t){let i={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}showInformationMessage(e,...t){let i={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Yf)}},wb=(0,h_.ShowDocumentFeature)((0,Z.ProgressFeature)(Gf)),Nb;(function(n){function e(){return new Xa}n.create=e})(Nb||(de.BulkRegistration=Nb={}));var Xa=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let i=Ht.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);let r=Kf.generateUuid();this._registrations.push({id:r,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},_b;(function(n){function e(){return new ws(void 0,[])}n.create=e})(_b||(de.BulkUnregistration=_b={}));var ws=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let i of this._unregistrations.values())e.push(i);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Ht.string(e)?e:e.method,i=this._unregistrations.get(t);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(U.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(t)},s=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},Qa=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,i){return e instanceof Xa?this.registerMany(e):e instanceof ws?this.registerSingle1(e,t,i):this.registerSingle2(e,t)}registerSingle1(e,t,i){let r=Ht.string(t)?t:t.method,s=Kf.generateUuid(),o={registrations:[{id:s,method:r,registerOptions:i||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:r}),e),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(e,t){let i=Ht.string(e)?e:e.method,r=Kf.generateUuid(),s={registrations:[{id:r,method:i,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,s).then(o=>U.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let i={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new ws(this._connection,t.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}},Xf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(r){return r&&!!r.edit}let i=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,i)}},Pb=(0,p_.FileOperationsFeature)((0,u_.WorkspaceFoldersFeature)((0,l_.ConfigurationFeature)(Xf))),Ja=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Za=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},ec=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._LanguagesImpl=ec;var Db=(0,b_.FoldingRangeFeature)((0,k_.MonikerFeature)((0,v_.DiagnosticFeature)((0,T_.InlayHintFeature)((0,y_.InlineValueFeature)((0,g_.TypeHierarchyFeature)((0,m_.LinkedEditingRangeFeature)((0,d_.SemanticTokensFeature)((0,f_.CallHierarchyFeature)(ec))))))))),tc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._NotebooksImpl=tc;var Rb=(0,S_.NotebookSyncFeature)(tc);function Cb(n,e){return function(t){return e(n(t))}}de.combineConsoleFeatures=Cb;function Ob(n,e){return function(t){return e(n(t))}}de.combineTelemetryFeatures=Ob;function Ab(n,e){return function(t){return e(n(t))}}de.combineTracerFeatures=Ab;function Ib(n,e){return function(t){return e(n(t))}}de.combineClientFeatures=Ib;function Lb(n,e){return function(t){return e(n(t))}}de.combineWindowFeatures=Lb;function xb(n,e){return function(t){return e(n(t))}}de.combineWorkspaceFeatures=xb;function Mb(n,e){return function(t){return e(n(t))}}de.combineLanguagesFeatures=Mb;function qb(n,e){return function(t){return e(n(t))}}de.combineNotebooksFeatures=qb;function E_(n,e){function t(r,s,o){return r&&s?o(r,s):r||s}return{__brand:"features",console:t(n.console,e.console,Cb),tracer:t(n.tracer,e.tracer,Ab),telemetry:t(n.telemetry,e.telemetry,Ob),client:t(n.client,e.client,Ib),window:t(n.window,e.window,Lb),workspace:t(n.workspace,e.workspace,xb),languages:t(n.languages,e.languages,Mb),notebooks:t(n.notebooks,e.notebooks,qb)}}de.combineFeatures=E_;function w_(n,e,t){let i=t&&t.console?new(t.console(Ga)):new Ga,r=n(i);i.rawAttach(r);let s=t&&t.tracer?new(t.tracer(Ja)):new Ja,o=t&&t.telemetry?new(t.telemetry(Za)):new Za,a=t&&t.client?new(t.client(Qa)):new Qa,c=t&&t.window?new(t.window(wb)):new wb,l=t&&t.workspace?new(t.workspace(Pb)):new Pb,u=t&&t.languages?new(t.languages(Db)):new Db,d=t&&t.notebooks?new(t.notebooks(Rb)):new Rb,p=[i,s,o,a,c,l,u,d];function g(v){return v instanceof Promise?v:Ht.thenable(v)?new Promise((T,N)=>{v.then(L=>T(L),L=>N(L))}):Promise.resolve(v)}let _,b,w,R={listen:()=>r.listen(),sendRequest:(v,...T)=>r.sendRequest(Ht.string(v)?v:v.method,...T),onRequest:(v,T)=>r.onRequest(v,T),sendNotification:(v,T)=>{let N=Ht.string(v)?v:v.method;return r.sendNotification(N,T)},onNotification:(v,T)=>r.onNotification(v,T),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:v=>(b=v,{dispose:()=>{b=void 0}}),onInitialized:v=>r.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(_=v,{dispose:()=>{_=void 0}}),onExit:v=>(w=v,{dispose:()=>{w=void 0}}),get console(){return i},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>r.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>r.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>r.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>r.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>r.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>r.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>r.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>r.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>r.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>r.onRequest(U.HoverRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onCompletion:v=>r.onRequest(U.CompletionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCompletionResolve:v=>r.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>r.onRequest(U.SignatureHelpRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDeclaration:v=>r.onRequest(U.DeclarationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDefinition:v=>r.onRequest(U.DefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onTypeDefinition:v=>r.onRequest(U.TypeDefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onImplementation:v=>r.onRequest(U.ImplementationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onReferences:v=>r.onRequest(U.ReferencesRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentHighlight:v=>r.onRequest(U.DocumentHighlightRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentSymbol:v=>r.onRequest(U.DocumentSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbol:v=>r.onRequest(U.WorkspaceSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbolResolve:v=>r.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>r.onRequest(U.CodeActionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeActionResolve:v=>r.onRequest(U.CodeActionResolveRequest.type,(T,N)=>v(T,N)),onCodeLens:v=>r.onRequest(U.CodeLensRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeLensResolve:v=>r.onRequest(U.CodeLensResolveRequest.type,(T,N)=>v(T,N)),onDocumentFormatting:v=>r.onRequest(U.DocumentFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentRangeFormatting:v=>r.onRequest(U.DocumentRangeFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentOnTypeFormatting:v=>r.onRequest(U.DocumentOnTypeFormattingRequest.type,(T,N)=>v(T,N)),onRenameRequest:v=>r.onRequest(U.RenameRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onPrepareRename:v=>r.onRequest(U.PrepareRenameRequest.type,(T,N)=>v(T,N)),onDocumentLinks:v=>r.onRequest(U.DocumentLinkRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentLinkResolve:v=>r.onRequest(U.DocumentLinkResolveRequest.type,(T,N)=>v(T,N)),onDocumentColor:v=>r.onRequest(U.DocumentColorRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onColorPresentation:v=>r.onRequest(U.ColorPresentationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onFoldingRanges:v=>r.onRequest(U.FoldingRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onSelectionRanges:v=>r.onRequest(U.SelectionRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onExecuteCommand:v=>r.onRequest(U.ExecuteCommandRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),dispose:()=>r.dispose()};for(let v of p)v.attach(R);return r.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Ht.string(v.trace)&&(s.trace=U.Trace.fromString(v.trace));for(let T of p)T.initialize(v.capabilities);if(b){let T=b(v,new U.CancellationTokenSource().token,(0,Z.attachWorkDone)(r,v),void 0);return g(T).then(N=>{if(N instanceof U.ResponseError)return N;let L=N;L||(L={capabilities:{}});let q=L.capabilities;q||(q={},L.capabilities=q),q.textDocumentSync===void 0||q.textDocumentSync===null?q.textDocumentSync=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None:!Ht.number(q.textDocumentSync)&&!Ht.number(q.textDocumentSync.change)&&(q.textDocumentSync.change=Ht.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(q);return L})}else{let T={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let N of p)N.fillServerCapabilities(T.capabilities);return T}}),r.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new U.CancellationTokenSource().token)}),r.onNotification(U.ExitNotification.type,()=>{try{w&&w()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),r.onNotification(U.SetTraceNotification.type,v=>{s.trace=U.Trace.fromString(v.value)}),R}de.createConnection=w_});var Fb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.resolveModulePath=Ot.FileSystem=Ot.resolveGlobalYarnPath=Ot.resolveGlobalNodePath=Ot.resolve=Ot.uriToFilePath=void 0;var N_=require("url"),rn=require("path"),Jf=require("fs"),nd=require("child_process");function __(n){let e=N_.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var i=0,r=t.length;i<r;i++)t[i]=decodeURIComponent(t[i]);if(process.platform==="win32"&&t.length>1){let s=t[0],o=t[1];s.length===0&&o.length>1&&o[1]===":"&&t.shift()}return rn.normalize(t.join("/"))}Ot.uriToFilePath=__;function Zf(){return process.platform==="win32"}function nc(n,e,t,i){let r="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Jf.existsSync(e)&&(l[r]?l[r]=e+rn.delimiter+l[r]:l[r]=e,i&&i(`NODE_PATH value is: ${l[r]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,nd.fork)("",[],{cwd:t,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",p=>{a(p)}),u.on("message",p=>{p.c==="r"&&(u.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}Ot.resolve=nc;function ed(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(s=>t[s]=process.env[s]),t.NO_UPDATE_NOTIFIER="true";let i={encoding:"utf8",env:t};Zf()&&(e="npm.cmd",i.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,nd.spawnSync)(e,["config","get","prefix"],i).stdout;if(!s){n&&n("'npm config get prefix' didn't return a value.");return}let o=s.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Zf()?rn.join(o,"node_modules"):rn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}Ot.resolveGlobalNodePath=ed;function P_(n){let e="yarn",t={encoding:"utf8"};Zf()&&(e="yarn.cmd",t.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let r=(0,nd.spawnSync)(e,["global","dir","--json"],t),s=r.stdout;if(!s){n&&(n("'yarn global dir' didn't return a value."),r.stderr&&n(r.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return rn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",i)}}Ot.resolveGlobalYarnPath=P_;var td;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Jf.existsSync(__filename.toUpperCase())||!Jf.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function i(r,s){return t()?rn.normalize(s).indexOf(rn.normalize(r))===0:rn.normalize(s).toLowerCase().indexOf(rn.normalize(r).toLowerCase())===0}n.isParent=i})(td||(Ot.FileSystem=td={}));function D_(n,e,t,i){return t?(rn.isAbsolute(t)||(t=rn.join(n,t)),nc(e,t,t,i).then(r=>td.isParent(t,r)?r:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,r=>nc(e,ed(i),n,i))):nc(e,ed(i),n,i)}Ot.resolveModulePath=D_});var id=C((HI,Bb)=>{"use strict";Bb.exports=We()});var jb=C(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.InlineCompletionFeature=void 0;var R_=We(),C_=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(R_.InlineCompletionRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};ic.InlineCompletionFeature=C_});var Wb=C(bt=>{"use strict";var O_=bt&&bt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),$b=bt&&bt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&O_(e,n,t)};Object.defineProperty(bt,"__esModule",{value:!0});bt.ProposedFeatures=bt.NotebookDocuments=bt.TextDocuments=bt.SemanticTokensBuilder=void 0;var A_=Bf();Object.defineProperty(bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return A_.SemanticTokensBuilder}});var I_=jb();$b(We(),bt);var L_=Wf();Object.defineProperty(bt,"TextDocuments",{enumerable:!0,get:function(){return L_.TextDocuments}});var x_=Hf();Object.defineProperty(bt,"NotebookDocuments",{enumerable:!0,get:function(){return x_.NotebookDocuments}});$b(Qf(),bt);var Ub;(function(n){n.all={__brand:"features",languages:I_.InlineCompletionFeature}})(Ub||(bt.ProposedFeatures=Ub={}))});var Q=C(Yt=>{"use strict";var M_=Yt&&Yt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Kb=Yt&&Yt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&M_(e,n,t)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.createConnection=Yt.Files=void 0;var Vb=require("node:util"),rd=Wo(),q_=Qf(),Ns=Fb(),ji=id();Kb(id(),Yt);Kb(Wb(),Yt);var Hb;(function(n){n.uriToFilePath=Ns.uriToFilePath,n.resolveGlobalNodePath=Ns.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ns.resolveGlobalYarnPath,n.resolve=Ns.resolve,n.resolveModulePath=Ns.resolveModulePath})(Hb||(Yt.Files=Hb={}));var Yb;function rc(){if(Yb!==void 0)try{Yb.end()}catch{}}var _r=!1,zb;function F_(){let n="--clientProcessId";function e(t){try{let i=parseInt(t);isNaN(i)||(zb=setInterval(()=>{try{process.kill(i,0)}catch{rc(),process.exit(_r?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let i=process.argv[t];if(i===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let r=i.split("=");r[0]===n&&e(r[1])}}}F_();var B_={initialize:n=>{let e=n.processId;rd.number(e)&&zb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(_r?0:1)}},3e3)},get shutdownReceived(){return _r},set shutdownReceived(n){_r=n},exit:n=>{rc(),process.exit(n)}};function j_(n,e,t,i){let r,s,o,a;return n!==void 0&&n.__brand==="features"&&(r=n,n=e,e=t,t=i),ji.ConnectionStrategy.is(n)||ji.ConnectionOptions.is(n)?a=n:(s=n,o=e,a=t),U_(s,o,a,r)}Yt.createConnection=j_;function U_(n,e,t,i){let r=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let p=u[d];if(p==="--node-ipc"){n=new ji.IPCMessageReader(process),e=new ji.IPCMessageWriter(process);break}else if(p==="--stdio"){r=!0,n=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(u[d+1]);break}else if(p==="--pipe"){l=u[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,ji.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ji.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(rd.func(n.read)&&rd.func(n.on)){let c=n;c.on("end",()=>{rc(),process.exit(_r?0:1)}),c.on("close",()=>{rc(),process.exit(_r?0:1)})}let a=c=>{let l=(0,ji.createProtocolConnection)(n,e,c,t);return r&&$_(c),l};return(0,q_.createConnection)(a,B_,i)}function $_(n){function e(i){return i.map(r=>typeof r=="string"?r:(0,Vb.inspect)(r)).join(" ")}let t=new Map;console.assert=function(r,...s){if(!r)if(s.length===0)n.error("Assertion failed");else{let[o,...a]=s;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(r="default"){let s=String(r),o=t.get(s)??0;o+=1,t.set(s,o),n.log(`${s}: ${s}`)},console.countReset=function(r){r===void 0?t.clear():t.delete(String(r))},console.debug=function(...r){n.log(e(r))},console.dir=function(r,s){n.log((0,Vb.inspect)(r,s))},console.log=function(...r){n.log(e(r))},console.error=function(...r){n.error(e(r))},console.trace=function(...r){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";r.length!==0&&(o+=`: ${e(r)}`),n.log(`${o}
37
- ${s}`)},console.warn=function(...r){n.warn(e(r))}}});var Xb=C((XI,Gb)=>{"use strict";Gb.exports=Q()});var le=C(ht=>{"use strict";var gd=Symbol.for("yaml.alias"),pv=Symbol.for("yaml.document"),Bc=Symbol.for("yaml.map"),mv=Symbol.for("yaml.pair"),yd=Symbol.for("yaml.scalar"),jc=Symbol.for("yaml.seq"),Un=Symbol.for("yaml.node.type"),kP=n=>!!n&&typeof n=="object"&&n[Un]===gd,EP=n=>!!n&&typeof n=="object"&&n[Un]===pv,wP=n=>!!n&&typeof n=="object"&&n[Un]===Bc,NP=n=>!!n&&typeof n=="object"&&n[Un]===mv,gv=n=>!!n&&typeof n=="object"&&n[Un]===yd,_P=n=>!!n&&typeof n=="object"&&n[Un]===jc;function yv(n){if(n&&typeof n=="object")switch(n[Un]){case Bc:case jc:return!0}return!1}function PP(n){if(n&&typeof n=="object")switch(n[Un]){case gd:case Bc:case yd:case jc:return!0}return!1}var DP=n=>(gv(n)||yv(n))&&!!n.anchor;ht.ALIAS=gd;ht.DOC=pv;ht.MAP=Bc;ht.NODE_TYPE=Un;ht.PAIR=mv;ht.SCALAR=yd;ht.SEQ=jc;ht.hasAnchor=DP;ht.isAlias=kP;ht.isCollection=yv;ht.isDocument=EP;ht.isMap=wP;ht.isNode=PP;ht.isPair=NP;ht.isScalar=gv;ht.isSeq=_P});var Os=C(bd=>{"use strict";var tt=le(),At=Symbol("break visit"),bv=Symbol("skip children"),Nn=Symbol("remove node");function Uc(n,e){let t=Tv(e);tt.isDocument(n)?qr(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):qr(null,n,t,Object.freeze([]))}Uc.BREAK=At;Uc.SKIP=bv;Uc.REMOVE=Nn;function qr(n,e,t,i){let r=vv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Sv(n,i,r),qr(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=qr(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=qr("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=qr("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}async function $c(n,e){let t=Tv(e);tt.isDocument(n)?await Fr(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):await Fr(null,n,t,Object.freeze([]))}$c.BREAK=At;$c.SKIP=bv;$c.REMOVE=Nn;async function Fr(n,e,t,i){let r=await vv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Sv(n,i,r),Fr(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await Fr(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=await Fr("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=await Fr("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}function Tv(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function vv(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(tt.isMap(e))return t.Map?.(n,e,i);if(tt.isSeq(e))return t.Seq?.(n,e,i);if(tt.isPair(e))return t.Pair?.(n,e,i);if(tt.isScalar(e))return t.Scalar?.(n,e,i);if(tt.isAlias(e))return t.Alias?.(n,e,i)}function Sv(n,e,t){let i=e[e.length-1];if(tt.isCollection(i))i.items[n]=t;else if(tt.isPair(i))n==="key"?i.key=t:i.value=t;else if(tt.isDocument(i))i.contents=t;else{let r=tt.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}bd.visit=Uc;bd.visitAsync=$c});var Td=C(Ev=>{"use strict";var kv=le(),RP=Os(),CP={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},OP=n=>n.replace(/[!,[\]{}]/g,e=>CP[e]),As=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+OP(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&kv.isNode(e.contents)){let s={};RP.visit(e.contents,(o,a)=>{kv.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
38
- `)}};As.defaultYaml={explicit:!1,version:"1.2"};As.defaultTags={"!!":"tag:yaml.org,2002:"};Ev.Directives=As});var Wc=C(Is=>{"use strict";var wv=le(),AP=Os();function IP(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Nv(n){let e=new Set;return AP.visit(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function _v(n,e){for(let t=1;;++t){let i=`${n}${t}`;if(!e.has(i))return i}}function LP(n,e){let t=[],i=new Map,r=null;return{onAnchor:s=>{t.push(s),r||(r=Nv(n));let o=_v(e,r);return r.add(o),o},setAnchors:()=>{for(let s of t){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(wv.isScalar(o.node)||wv.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}Is.anchorIsValid=IP;Is.anchorNames=Nv;Is.createNodeAnchors=LP;Is.findNewAnchor=_v});var vd=C(Pv=>{"use strict";function Ls(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=Ls(n,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=Ls(n,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Ls(n,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=Ls(n,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return n.call(e,t,i)}Pv.applyReviver=Ls});var mi=C(Rv=>{"use strict";var xP=le();function Dv(n,e,t){if(Array.isArray(n))return n.map((i,r)=>Dv(i,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!xP.hasAnchor(n))return n.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=s=>{i.res=s,delete t.onCreate};let r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}Rv.toJS=Dv});var Vc=C(Ov=>{"use strict";var MP=vd(),Cv=le(),qP=mi(),Sd=class{constructor(e){Object.defineProperty(this,Cv.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Cv.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=qP.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?MP.applyReviver(s,{"":a},"",a):a}};Ov.NodeBase=Sd});var xs=C(Iv=>{"use strict";var FP=Wc(),Av=Os(),Hc=le(),BP=Vc(),jP=mi(),kd=class extends BP.NodeBase{constructor(e){super(Hc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Av.visit(e,{Node:(i,r)=>{if(r===this)return Av.visit.BREAK;r.anchor===this.source&&(t=r)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=t,o=this.resolve(r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(jP.toJS(o,null,t),a=i.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Yc(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,i){let r=`*${this.source}`;if(e){if(FP.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Yc(n,e,t){if(Hc.isAlias(e)){let i=e.resolve(n),r=t&&i&&t.get(i);return r?r.count*r.aliasCount:0}else if(Hc.isCollection(e)){let i=0;for(let r of e.items){let s=Yc(n,r,t);s>i&&(i=s)}return i}else if(Hc.isPair(e)){let i=Yc(n,e.key,t),r=Yc(n,e.value,t);return Math.max(i,r)}return 1}Iv.Alias=kd});var Qe=C(Ed=>{"use strict";var UP=le(),$P=Vc(),WP=mi(),VP=n=>!n||typeof n!="function"&&typeof n!="object",gi=class extends $P.NodeBase{constructor(e){super(UP.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:WP.toJS(this.value,e,t)}toString(){return String(this.value)}};gi.BLOCK_FOLDED="BLOCK_FOLDED";gi.BLOCK_LITERAL="BLOCK_LITERAL";gi.PLAIN="PLAIN";gi.QUOTE_DOUBLE="QUOTE_DOUBLE";gi.QUOTE_SINGLE="QUOTE_SINGLE";Ed.Scalar=gi;Ed.isScalarValue=VP});var Ms=C(xv=>{"use strict";var HP=xs(),Wi=le(),Lv=Qe(),YP="tag:yaml.org,2002:";function KP(n,e,t){if(e){let i=t.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>i.identify?.(n)&&!i.format)}function zP(n,e,t){if(Wi.isDocument(n)&&(n=n.contents),Wi.isNode(n))return n;if(Wi.isPair(n)){let d=t.schema[Wi.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=t,c;if(i&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=r(n)),new HP.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=YP+e.slice(2));let l=KP(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new Lv.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[Wi.MAP]:Symbol.iterator in Object(n)?o[Wi.SEQ]:o[Wi.MAP]}s&&(s(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new Lv.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}xv.createNode=zP});var zc=C(Kc=>{"use strict";var GP=Ms(),_n=le(),XP=Vc();function wd(n,e,t){let i=t;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return GP.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Mv=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Nd=class extends XP.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>_n.isNode(i)||_n.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Mv(e))this.add(t);else{let[i,...r]=e,s=this.get(i,!0);if(_n.isCollection(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(i,wd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let r=this.get(t,!0);if(_n.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!t&&_n.isScalar(s)?s.value:s:_n.isCollection(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!_n.isPair(t))return!1;let i=t.value;return i==null||e&&_n.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let r=this.get(t,!0);return _n.isCollection(r)?r.hasIn(i):!1}setIn(e,t){let[i,...r]=e;if(r.length===0)this.set(i,t);else{let s=this.get(i,!0);if(_n.isCollection(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(i,wd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Kc.Collection=Nd;Kc.collectionFromPath=wd;Kc.isEmptyPath=Mv});var qs=C(Gc=>{"use strict";var QP=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function _d(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var JP=(n,e,t)=>n.endsWith(`
39
- `)?_d(t,e):t.includes(`
36
+ `&&f++}m&&E.length>0&&k.push(E.length),this._lineOffsets=k}return this._lineOffsets},h.prototype.positionAt=function(k){k=Math.max(Math.min(k,this._content.length),0);var E=this.getLineOffsets(),m=0,f=E.length;if(f===0)return o.create(0,k);for(;m<f;){var P=Math.floor((m+f)/2);E[P]>k?f=P:m=P+1}var x=m-1;return o.create(x,k-E[x])},h.prototype.offsetAt=function(k){var E=this.getLineOffsets();if(k.line>=E.length)return this._content.length;if(k.line<0)return 0;var m=E[k.line],f=k.line+1<E.length?E[k.line+1]:this._content.length;return Math.max(Math.min(m+k.character,f),m)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var k=Object.prototype.toString;function E(oe){return typeof oe<"u"}h.defined=E;function m(oe){return typeof oe>"u"}h.undefined=m;function f(oe){return oe===!0||oe===!1}h.boolean=f;function P(oe){return k.call(oe)==="[object String]"}h.string=P;function x(oe){return k.call(oe)==="[object Number]"}h.number=x;function ee(oe,sr,Vo){return k.call(oe)==="[object Number]"&&sr<=oe&&oe<=Vo}h.numberRange=ee;function Ue(oe){return k.call(oe)==="[object Number]"&&-2147483648<=oe&&oe<=2147483647}h.integer=Ue;function Ne(oe){return k.call(oe)==="[object Number]"&&0<=oe&&oe<=2147483647}h.uinteger=Ne;function en(oe){return k.call(oe)==="[object Function]"}h.func=en;function tn(oe){return oe!==null&&typeof oe=="object"}h.objectLiteral=tn;function xn(oe,sr){return Array.isArray(oe)&&oe.every(sr)}h.typedArray=xn})(D||(D={}))})});var xe=C(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ProtocolNotificationType=Dt.ProtocolNotificationType0=Dt.ProtocolRequestType=Dt.ProtocolRequestType0=Dt.RegistrationType=Dt.MessageDirection=void 0;var pr=Mi(),um;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(um||(Dt.MessageDirection=um={}));var Tf=class{constructor(e){this.method=e}};Dt.RegistrationType=Tf;var vf=class extends pr.RequestType0{constructor(e){super(e)}};Dt.ProtocolRequestType0=vf;var Sf=class extends pr.RequestType{constructor(e){super(e,pr.ParameterStructures.byName)}};Dt.ProtocolRequestType=Sf;var kf=class extends pr.NotificationType0{constructor(e){super(e)}};Dt.ProtocolNotificationType0=kf;var Ef=class extends pr.NotificationType{constructor(e){super(e,pr.ParameterStructures.byName)}};Dt.ProtocolNotificationType=Ef});var ma=C(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.objectLiteral=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function TN(n){return n===!0||n===!1}Ye.boolean=TN;function fm(n){return typeof n=="string"||n instanceof String}Ye.string=fm;function vN(n){return typeof n=="number"||n instanceof Number}Ye.number=vN;function SN(n){return n instanceof Error}Ye.error=SN;function kN(n){return typeof n=="function"}Ye.func=kN;function dm(n){return Array.isArray(n)}Ye.array=dm;function EN(n){return dm(n)&&n.every(e=>fm(e))}Ye.stringArray=EN;function wN(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=wN;function NN(n){return n!==null&&typeof n=="object"}Ye.objectLiteral=NN});var mm=C(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.ImplementationRequest=void 0;var hm=xe(),pm;(function(n){n.method="textDocument/implementation",n.messageDirection=hm.MessageDirection.clientToServer,n.type=new hm.ProtocolRequestType(n.method)})(pm||(ga.ImplementationRequest=pm={}))});var bm=C(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.TypeDefinitionRequest=void 0;var gm=xe(),ym;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=gm.MessageDirection.clientToServer,n.type=new gm.ProtocolRequestType(n.method)})(ym||(ya.TypeDefinitionRequest=ym={}))});var Sm=C(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.DidChangeWorkspaceFoldersNotification=mr.WorkspaceFoldersRequest=void 0;var ba=xe(),Tm;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=ba.MessageDirection.serverToClient,n.type=new ba.ProtocolRequestType0(n.method)})(Tm||(mr.WorkspaceFoldersRequest=Tm={}));var vm;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=ba.MessageDirection.clientToServer,n.type=new ba.ProtocolNotificationType(n.method)})(vm||(mr.DidChangeWorkspaceFoldersNotification=vm={}))});var wm=C(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ConfigurationRequest=void 0;var km=xe(),Em;(function(n){n.method="workspace/configuration",n.messageDirection=km.MessageDirection.serverToClient,n.type=new km.ProtocolRequestType(n.method)})(Em||(Ta.ConfigurationRequest=Em={}))});var Pm=C(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.ColorPresentationRequest=gr.DocumentColorRequest=void 0;var va=xe(),Nm;(function(n){n.method="textDocument/documentColor",n.messageDirection=va.MessageDirection.clientToServer,n.type=new va.ProtocolRequestType(n.method)})(Nm||(gr.DocumentColorRequest=Nm={}));var _m;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=va.MessageDirection.clientToServer,n.type=new va.ProtocolRequestType(n.method)})(_m||(gr.ColorPresentationRequest=_m={}))});var Cm=C(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.FoldingRangeRefreshRequest=yr.FoldingRangeRequest=void 0;var Sa=xe(),Dm;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Sa.MessageDirection.clientToServer,n.type=new Sa.ProtocolRequestType(n.method)})(Dm||(yr.FoldingRangeRequest=Dm={}));var Rm;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Sa.MessageDirection.serverToClient,n.type=new Sa.ProtocolRequestType0(n.method)})(Rm||(yr.FoldingRangeRefreshRequest=Rm={}))});var Im=C(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.DeclarationRequest=void 0;var Om=xe(),Am;(function(n){n.method="textDocument/declaration",n.messageDirection=Om.MessageDirection.clientToServer,n.type=new Om.ProtocolRequestType(n.method)})(Am||(ka.DeclarationRequest=Am={}))});var Mm=C(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.SelectionRangeRequest=void 0;var Lm=xe(),xm;(function(n){n.method="textDocument/selectionRange",n.messageDirection=Lm.MessageDirection.clientToServer,n.type=new Lm.ProtocolRequestType(n.method)})(xm||(Ea.SelectionRangeRequest=xm={}))});var jm=C(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.WorkDoneProgressCancelNotification=Qn.WorkDoneProgressCreateRequest=Qn.WorkDoneProgress=void 0;var _N=Mi(),wa=xe(),qm;(function(n){n.type=new _N.ProgressType;function e(t){return t===n.type}n.is=e})(qm||(Qn.WorkDoneProgress=qm={}));var Fm;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=wa.MessageDirection.serverToClient,n.type=new wa.ProtocolRequestType(n.method)})(Fm||(Qn.WorkDoneProgressCreateRequest=Fm={}));var Bm;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=wa.MessageDirection.clientToServer,n.type=new wa.ProtocolNotificationType(n.method)})(Bm||(Qn.WorkDoneProgressCancelNotification=Bm={}))});var Vm=C(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.CallHierarchyOutgoingCallsRequest=Jn.CallHierarchyIncomingCallsRequest=Jn.CallHierarchyPrepareRequest=void 0;var br=xe(),Um;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(Um||(Jn.CallHierarchyPrepareRequest=Um={}));var $m;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})($m||(Jn.CallHierarchyIncomingCallsRequest=$m={}));var Wm;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=br.MessageDirection.clientToServer,n.type=new br.ProtocolRequestType(n.method)})(Wm||(Jn.CallHierarchyOutgoingCallsRequest=Wm={}))});var Xm=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var qn=xe(),Hm;(function(n){n.Relative="relative"})(Hm||(Rt.TokenFormat=Hm={}));var Ts;(function(n){n.method="textDocument/semanticTokens",n.type=new qn.RegistrationType(n.method)})(Ts||(Rt.SemanticTokensRegistrationType=Ts={}));var Ym;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(Ym||(Rt.SemanticTokensRequest=Ym={}));var Km;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(Km||(Rt.SemanticTokensDeltaRequest=Km={}));var zm;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method),n.registrationMethod=Ts.method})(zm||(Rt.SemanticTokensRangeRequest=zm={}));var Gm;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=qn.MessageDirection.serverToClient,n.type=new qn.ProtocolRequestType0(n.method)})(Gm||(Rt.SemanticTokensRefreshRequest=Gm={}))});var Zm=C(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.ShowDocumentRequest=void 0;var Qm=xe(),Jm;(function(n){n.method="window/showDocument",n.messageDirection=Qm.MessageDirection.serverToClient,n.type=new Qm.ProtocolRequestType(n.method)})(Jm||(Na.ShowDocumentRequest=Jm={}))});var ng=C(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.LinkedEditingRangeRequest=void 0;var eg=xe(),tg;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=eg.MessageDirection.clientToServer,n.type=new eg.ProtocolRequestType(n.method)})(tg||(_a.LinkedEditingRangeRequest=tg={}))});var ug=C(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.WillDeleteFilesRequest=yt.DidDeleteFilesNotification=yt.DidRenameFilesNotification=yt.WillRenameFilesRequest=yt.DidCreateFilesNotification=yt.WillCreateFilesRequest=yt.FileOperationPatternKind=void 0;var $t=xe(),ig;(function(n){n.file="file",n.folder="folder"})(ig||(yt.FileOperationPatternKind=ig={}));var rg;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(rg||(yt.WillCreateFilesRequest=rg={}));var sg;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(sg||(yt.DidCreateFilesNotification=sg={}));var og;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(og||(yt.WillRenameFilesRequest=og={}));var ag;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(ag||(yt.DidRenameFilesNotification=ag={}));var cg;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolNotificationType(n.method)})(cg||(yt.DidDeleteFilesNotification=cg={}));var lg;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=$t.MessageDirection.clientToServer,n.type=new $t.ProtocolRequestType(n.method)})(lg||(yt.WillDeleteFilesRequest=lg={}))});var mg=C(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.MonikerRequest=Zn.MonikerKind=Zn.UniquenessLevel=void 0;var fg=xe(),dg;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(dg||(Zn.UniquenessLevel=dg={}));var hg;(function(n){n.$import="import",n.$export="export",n.local="local"})(hg||(Zn.MonikerKind=hg={}));var pg;(function(n){n.method="textDocument/moniker",n.messageDirection=fg.MessageDirection.clientToServer,n.type=new fg.ProtocolRequestType(n.method)})(pg||(Zn.MonikerRequest=pg={}))});var Tg=C(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.TypeHierarchySubtypesRequest=ei.TypeHierarchySupertypesRequest=ei.TypeHierarchyPrepareRequest=void 0;var Tr=xe(),gg;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(gg||(ei.TypeHierarchyPrepareRequest=gg={}));var yg;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(yg||(ei.TypeHierarchySupertypesRequest=yg={}));var bg;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Tr.MessageDirection.clientToServer,n.type=new Tr.ProtocolRequestType(n.method)})(bg||(ei.TypeHierarchySubtypesRequest=bg={}))});var kg=C(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.InlineValueRefreshRequest=vr.InlineValueRequest=void 0;var Pa=xe(),vg;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Pa.MessageDirection.clientToServer,n.type=new Pa.ProtocolRequestType(n.method)})(vg||(vr.InlineValueRequest=vg={}));var Sg;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Pa.MessageDirection.serverToClient,n.type=new Pa.ProtocolRequestType0(n.method)})(Sg||(vr.InlineValueRefreshRequest=Sg={}))});var _g=C(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.InlayHintRefreshRequest=ti.InlayHintResolveRequest=ti.InlayHintRequest=void 0;var Sr=xe(),Eg;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method)})(Eg||(ti.InlayHintRequest=Eg={}));var wg;(function(n){n.method="inlayHint/resolve",n.messageDirection=Sr.MessageDirection.clientToServer,n.type=new Sr.ProtocolRequestType(n.method)})(wg||(ti.InlayHintResolveRequest=wg={}));var Ng;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Sr.MessageDirection.serverToClient,n.type=new Sr.ProtocolRequestType0(n.method)})(Ng||(ti.InlayHintRefreshRequest=Ng={}))});var Ig=C(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.DiagnosticRefreshRequest=Wt.WorkspaceDiagnosticRequest=Wt.DocumentDiagnosticRequest=Wt.DocumentDiagnosticReportKind=Wt.DiagnosticServerCancellationData=void 0;var Ag=Mi(),PN=ma(),kr=xe(),Pg;(function(n){function e(t){let i=t;return i&&PN.boolean(i.retriggerRequest)}n.is=e})(Pg||(Wt.DiagnosticServerCancellationData=Pg={}));var Dg;(function(n){n.Full="full",n.Unchanged="unchanged"})(Dg||(Wt.DocumentDiagnosticReportKind=Dg={}));var Rg;(function(n){n.method="textDocument/diagnostic",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.partialResult=new Ag.ProgressType})(Rg||(Wt.DocumentDiagnosticRequest=Rg={}));var Cg;(function(n){n.method="workspace/diagnostic",n.messageDirection=kr.MessageDirection.clientToServer,n.type=new kr.ProtocolRequestType(n.method),n.partialResult=new Ag.ProgressType})(Cg||(Wt.WorkspaceDiagnosticRequest=Cg={}));var Og;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=kr.MessageDirection.serverToClient,n.type=new kr.ProtocolRequestType0(n.method)})(Og||(Wt.DiagnosticRefreshRequest=Og={}))});var jg=C($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.DidCloseNotebookDocumentNotification=$e.DidSaveNotebookDocumentNotification=$e.DidChangeNotebookDocumentNotification=$e.NotebookCellArrayChange=$e.DidOpenNotebookDocumentNotification=$e.NotebookDocumentSyncRegistrationType=$e.NotebookDocument=$e.NotebookCell=$e.ExecutionSummary=$e.NotebookCellKind=void 0;var vs=pa(),rn=ma(),gn=xe(),wf;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(wf||($e.NotebookCellKind=wf={}));var Nf;(function(n){function e(r,s){let o={executionOrder:r};return(s===!0||s===!1)&&(o.success=s),o}n.create=e;function t(r){let s=r;return rn.objectLiteral(s)&&vs.uinteger.is(s.executionOrder)&&(s.success===void 0||rn.boolean(s.success))}n.is=t;function i(r,s){return r===s?!0:r==null||s===null||s===void 0?!1:r.executionOrder===s.executionOrder&&r.success===s.success}n.equals=i})(Nf||($e.ExecutionSummary=Nf={}));var Da;(function(n){function e(s,o){return{kind:s,document:o}}n.create=e;function t(s){let o=s;return rn.objectLiteral(o)&&wf.is(o.kind)&&vs.DocumentUri.is(o.document)&&(o.metadata===void 0||rn.objectLiteral(o.metadata))}n.is=t;function i(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!r(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Nf.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=i;function r(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(s.length!==o.length)return!1;for(let l=0;l<s.length;l++)if(!r(s[l],o[l]))return!1}if(rn.objectLiteral(s)&&rn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!r(l,u)))return!1;for(let d=0;d<l.length;d++){let p=l[d];if(!r(s[p],o[p]))return!1}}return!0}})(Da||($e.NotebookCell=Da={}));var Lg;(function(n){function e(i,r,s,o){return{uri:i,notebookType:r,version:s,cells:o}}n.create=e;function t(i){let r=i;return rn.objectLiteral(r)&&rn.string(r.uri)&&vs.integer.is(r.version)&&rn.typedArray(r.cells,Da.is)}n.is=t})(Lg||($e.NotebookDocument=Lg={}));var Er;(function(n){n.method="notebookDocument/sync",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.RegistrationType(n.method)})(Er||($e.NotebookDocumentSyncRegistrationType=Er={}));var xg;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(xg||($e.DidOpenNotebookDocumentNotification=xg={}));var Mg;(function(n){function e(i){let r=i;return rn.objectLiteral(r)&&vs.uinteger.is(r.start)&&vs.uinteger.is(r.deleteCount)&&(r.cells===void 0||rn.typedArray(r.cells,Da.is))}n.is=e;function t(i,r,s){let o={start:i,deleteCount:r};return s!==void 0&&(o.cells=s),o}n.create=t})(Mg||($e.NotebookCellArrayChange=Mg={}));var qg;(function(n){n.method="notebookDocument/didChange",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(qg||($e.DidChangeNotebookDocumentNotification=qg={}));var Fg;(function(n){n.method="notebookDocument/didSave",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(Fg||($e.DidSaveNotebookDocumentNotification=Fg={}));var Bg;(function(n){n.method="notebookDocument/didClose",n.messageDirection=gn.MessageDirection.clientToServer,n.type=new gn.ProtocolNotificationType(n.method),n.registrationMethod=Er.method})(Bg||($e.DidCloseNotebookDocumentNotification=Bg={}))});var Wg=C(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.InlineCompletionRequest=void 0;var Ug=xe(),$g;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=Ug.MessageDirection.clientToServer,n.type=new Ug.ProtocolRequestType(n.method)})($g||(Ra.InlineCompletionRequest=$g={}))});var nb=C(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.WorkspaceSymbolRequest=y.CodeActionResolveRequest=y.CodeActionRequest=y.DocumentSymbolRequest=y.DocumentHighlightRequest=y.ReferencesRequest=y.DefinitionRequest=y.SignatureHelpRequest=y.SignatureHelpTriggerKind=y.HoverRequest=y.CompletionResolveRequest=y.CompletionRequest=y.CompletionTriggerKind=y.PublishDiagnosticsNotification=y.WatchKind=y.RelativePattern=y.FileChangeType=y.DidChangeWatchedFilesNotification=y.WillSaveTextDocumentWaitUntilRequest=y.WillSaveTextDocumentNotification=y.TextDocumentSaveReason=y.DidSaveTextDocumentNotification=y.DidCloseTextDocumentNotification=y.DidChangeTextDocumentNotification=y.TextDocumentContentChangeEvent=y.DidOpenTextDocumentNotification=y.TextDocumentSyncKind=y.TelemetryEventNotification=y.LogMessageNotification=y.ShowMessageRequest=y.ShowMessageNotification=y.MessageType=y.DidChangeConfigurationNotification=y.ExitNotification=y.ShutdownRequest=y.InitializedNotification=y.InitializeErrorCodes=y.InitializeRequest=y.WorkDoneProgressOptions=y.TextDocumentRegistrationOptions=y.StaticRegistrationOptions=y.PositionEncodingKind=y.FailureHandlingKind=y.ResourceOperationKind=y.UnregistrationRequest=y.RegistrationRequest=y.DocumentSelector=y.NotebookCellTextDocumentFilter=y.NotebookDocumentFilter=y.TextDocumentFilter=void 0;y.MonikerRequest=y.MonikerKind=y.UniquenessLevel=y.WillDeleteFilesRequest=y.DidDeleteFilesNotification=y.WillRenameFilesRequest=y.DidRenameFilesNotification=y.WillCreateFilesRequest=y.DidCreateFilesNotification=y.FileOperationPatternKind=y.LinkedEditingRangeRequest=y.ShowDocumentRequest=y.SemanticTokensRegistrationType=y.SemanticTokensRefreshRequest=y.SemanticTokensRangeRequest=y.SemanticTokensDeltaRequest=y.SemanticTokensRequest=y.TokenFormat=y.CallHierarchyPrepareRequest=y.CallHierarchyOutgoingCallsRequest=y.CallHierarchyIncomingCallsRequest=y.WorkDoneProgressCancelNotification=y.WorkDoneProgressCreateRequest=y.WorkDoneProgress=y.SelectionRangeRequest=y.DeclarationRequest=y.FoldingRangeRefreshRequest=y.FoldingRangeRequest=y.ColorPresentationRequest=y.DocumentColorRequest=y.ConfigurationRequest=y.DidChangeWorkspaceFoldersNotification=y.WorkspaceFoldersRequest=y.TypeDefinitionRequest=y.ImplementationRequest=y.ApplyWorkspaceEditRequest=y.ExecuteCommandRequest=y.PrepareRenameRequest=y.RenameRequest=y.PrepareSupportDefaultBehavior=y.DocumentOnTypeFormattingRequest=y.DocumentRangesFormattingRequest=y.DocumentRangeFormattingRequest=y.DocumentFormattingRequest=y.DocumentLinkResolveRequest=y.DocumentLinkRequest=y.CodeLensRefreshRequest=y.CodeLensResolveRequest=y.CodeLensRequest=y.WorkspaceSymbolResolveRequest=void 0;y.InlineCompletionRequest=y.DidCloseNotebookDocumentNotification=y.DidSaveNotebookDocumentNotification=y.DidChangeNotebookDocumentNotification=y.NotebookCellArrayChange=y.DidOpenNotebookDocumentNotification=y.NotebookDocumentSyncRegistrationType=y.NotebookDocument=y.NotebookCell=y.ExecutionSummary=y.NotebookCellKind=y.DiagnosticRefreshRequest=y.WorkspaceDiagnosticRequest=y.DocumentDiagnosticRequest=y.DocumentDiagnosticReportKind=y.DiagnosticServerCancellationData=y.InlayHintRefreshRequest=y.InlayHintResolveRequest=y.InlayHintRequest=y.InlineValueRefreshRequest=y.InlineValueRequest=y.TypeHierarchySupertypesRequest=y.TypeHierarchySubtypesRequest=y.TypeHierarchyPrepareRequest=void 0;var F=xe(),Vg=pa(),it=ma(),DN=mm();Object.defineProperty(y,"ImplementationRequest",{enumerable:!0,get:function(){return DN.ImplementationRequest}});var RN=bm();Object.defineProperty(y,"TypeDefinitionRequest",{enumerable:!0,get:function(){return RN.TypeDefinitionRequest}});var Jy=Sm();Object.defineProperty(y,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Jy.WorkspaceFoldersRequest}});Object.defineProperty(y,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Jy.DidChangeWorkspaceFoldersNotification}});var CN=wm();Object.defineProperty(y,"ConfigurationRequest",{enumerable:!0,get:function(){return CN.ConfigurationRequest}});var Zy=Pm();Object.defineProperty(y,"DocumentColorRequest",{enumerable:!0,get:function(){return Zy.DocumentColorRequest}});Object.defineProperty(y,"ColorPresentationRequest",{enumerable:!0,get:function(){return Zy.ColorPresentationRequest}});var eb=Cm();Object.defineProperty(y,"FoldingRangeRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRequest}});Object.defineProperty(y,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRefreshRequest}});var ON=Im();Object.defineProperty(y,"DeclarationRequest",{enumerable:!0,get:function(){return ON.DeclarationRequest}});var AN=Mm();Object.defineProperty(y,"SelectionRangeRequest",{enumerable:!0,get:function(){return AN.SelectionRangeRequest}});var Cf=jm();Object.defineProperty(y,"WorkDoneProgress",{enumerable:!0,get:function(){return Cf.WorkDoneProgress}});Object.defineProperty(y,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCreateRequest}});Object.defineProperty(y,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCancelNotification}});var Of=Vm();Object.defineProperty(y,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyIncomingCallsRequest}});Object.defineProperty(y,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(y,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Of.CallHierarchyPrepareRequest}});var wr=Xm();Object.defineProperty(y,"TokenFormat",{enumerable:!0,get:function(){return wr.TokenFormat}});Object.defineProperty(y,"SemanticTokensRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRequest}});Object.defineProperty(y,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return wr.SemanticTokensDeltaRequest}});Object.defineProperty(y,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRangeRequest}});Object.defineProperty(y,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRefreshRequest}});Object.defineProperty(y,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return wr.SemanticTokensRegistrationType}});var IN=Zm();Object.defineProperty(y,"ShowDocumentRequest",{enumerable:!0,get:function(){return IN.ShowDocumentRequest}});var LN=ng();Object.defineProperty(y,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return LN.LinkedEditingRangeRequest}});var qi=ug();Object.defineProperty(y,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(y,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(y,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(y,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(y,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(y,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(y,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Af=mg();Object.defineProperty(y,"UniquenessLevel",{enumerable:!0,get:function(){return Af.UniquenessLevel}});Object.defineProperty(y,"MonikerKind",{enumerable:!0,get:function(){return Af.MonikerKind}});Object.defineProperty(y,"MonikerRequest",{enumerable:!0,get:function(){return Af.MonikerRequest}});var If=Tg();Object.defineProperty(y,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return If.TypeHierarchyPrepareRequest}});Object.defineProperty(y,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySubtypesRequest}});Object.defineProperty(y,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySupertypesRequest}});var tb=kg();Object.defineProperty(y,"InlineValueRequest",{enumerable:!0,get:function(){return tb.InlineValueRequest}});Object.defineProperty(y,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return tb.InlineValueRefreshRequest}});var Lf=_g();Object.defineProperty(y,"InlayHintRequest",{enumerable:!0,get:function(){return Lf.InlayHintRequest}});Object.defineProperty(y,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Lf.InlayHintResolveRequest}});Object.defineProperty(y,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Lf.InlayHintRefreshRequest}});var Ss=Ig();Object.defineProperty(y,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ss.DiagnosticServerCancellationData}});Object.defineProperty(y,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticReportKind}});Object.defineProperty(y,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticRequest}});Object.defineProperty(y,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ss.WorkspaceDiagnosticRequest}});Object.defineProperty(y,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ss.DiagnosticRefreshRequest}});var yn=jg();Object.defineProperty(y,"NotebookCellKind",{enumerable:!0,get:function(){return yn.NotebookCellKind}});Object.defineProperty(y,"ExecutionSummary",{enumerable:!0,get:function(){return yn.ExecutionSummary}});Object.defineProperty(y,"NotebookCell",{enumerable:!0,get:function(){return yn.NotebookCell}});Object.defineProperty(y,"NotebookDocument",{enumerable:!0,get:function(){return yn.NotebookDocument}});Object.defineProperty(y,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return yn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(y,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidOpenNotebookDocumentNotification}});Object.defineProperty(y,"NotebookCellArrayChange",{enumerable:!0,get:function(){return yn.NotebookCellArrayChange}});Object.defineProperty(y,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidChangeNotebookDocumentNotification}});Object.defineProperty(y,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidSaveNotebookDocumentNotification}});Object.defineProperty(y,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidCloseNotebookDocumentNotification}});var xN=Wg();Object.defineProperty(y,"InlineCompletionRequest",{enumerable:!0,get:function(){return xN.InlineCompletionRequest}});var _f;(function(n){function e(t){let i=t;return it.string(i)||it.string(i.language)||it.string(i.scheme)||it.string(i.pattern)}n.is=e})(_f||(y.TextDocumentFilter=_f={}));var Pf;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebookType)||it.string(i.scheme)||it.string(i.pattern))}n.is=e})(Pf||(y.NotebookDocumentFilter=Pf={}));var Df;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(it.string(i.notebook)||Pf.is(i.notebook))&&(i.language===void 0||it.string(i.language))}n.is=e})(Df||(y.NotebookCellTextDocumentFilter=Df={}));var Rf;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!it.string(i)&&!_f.is(i)&&!Df.is(i))return!1;return!0}n.is=e})(Rf||(y.DocumentSelector=Rf={}));var Hg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Hg||(y.RegistrationRequest=Hg={}));var Yg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Yg||(y.UnregistrationRequest=Yg={}));var Kg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Kg||(y.ResourceOperationKind=Kg={}));var zg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(zg||(y.FailureHandlingKind=zg={}));var Gg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Gg||(y.PositionEncodingKind=Gg={}));var Xg;(function(n){function e(t){let i=t;return i&&it.string(i.id)&&i.id.length>0}n.hasId=e})(Xg||(y.StaticRegistrationOptions=Xg={}));var Qg;(function(n){function e(t){let i=t;return i&&(i.documentSelector===null||Rf.is(i.documentSelector))}n.is=e})(Qg||(y.TextDocumentRegistrationOptions=Qg={}));var Jg;(function(n){function e(i){let r=i;return it.objectLiteral(r)&&(r.workDoneProgress===void 0||it.boolean(r.workDoneProgress))}n.is=e;function t(i){let r=i;return r&&it.boolean(r.workDoneProgress)}n.hasWorkDoneProgress=t})(Jg||(y.WorkDoneProgressOptions=Jg={}));var Zg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Zg||(y.InitializeRequest=Zg={}));var ey;(function(n){n.unknownProtocolVersion=1})(ey||(y.InitializeErrorCodes=ey={}));var ty;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ty||(y.InitializedNotification=ty={}));var ny;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ny||(y.ShutdownRequest=ny={}));var iy;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(iy||(y.ExitNotification=iy={}));var ry;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ry||(y.DidChangeConfigurationNotification=ry={}));var sy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(sy||(y.MessageType=sy={}));var oy;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(y.ShowMessageNotification=oy={}));var ay;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(ay||(y.ShowMessageRequest=ay={}));var cy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(cy||(y.LogMessageNotification=cy={}));var ly;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ly||(y.TelemetryEventNotification=ly={}));var uy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(uy||(y.TextDocumentSyncKind=uy={}));var fy;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(y.DidOpenTextDocumentNotification=fy={}));var dy;(function(n){function e(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}n.isIncremental=e;function t(i){let r=i;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}n.isFull=t})(dy||(y.TextDocumentContentChangeEvent=dy={}));var hy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(y.DidChangeTextDocumentNotification=hy={}));var py;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(py||(y.DidCloseTextDocumentNotification=py={}));var my;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(y.DidSaveTextDocumentNotification=my={}));var gy;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(gy||(y.TextDocumentSaveReason=gy={}));var yy;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(y.WillSaveTextDocumentNotification=yy={}));var by;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(by||(y.WillSaveTextDocumentWaitUntilRequest=by={}));var Ty;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Ty||(y.DidChangeWatchedFilesNotification=Ty={}));var vy;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(vy||(y.FileChangeType=vy={}));var Sy;(function(n){function e(t){let i=t;return it.objectLiteral(i)&&(Vg.URI.is(i.baseUri)||Vg.WorkspaceFolder.is(i.baseUri))&&it.string(i.pattern)}n.is=e})(Sy||(y.RelativePattern=Sy={}));var ky;(function(n){n.Create=1,n.Change=2,n.Delete=4})(ky||(y.WatchKind=ky={}));var Ey;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Ey||(y.PublishDiagnosticsNotification=Ey={}));var wy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(wy||(y.CompletionTriggerKind=wy={}));var Ny;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(y.CompletionRequest=Ny={}));var _y;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(_y||(y.CompletionResolveRequest=_y={}));var Py;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(y.HoverRequest=Py={}));var Dy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(Dy||(y.SignatureHelpTriggerKind=Dy={}));var Ry;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(y.SignatureHelpRequest=Ry={}));var Cy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(y.DefinitionRequest=Cy={}));var Oy;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(y.ReferencesRequest=Oy={}));var Ay;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(y.DocumentHighlightRequest=Ay={}));var Iy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(y.DocumentSymbolRequest=Iy={}));var Ly;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(y.CodeActionRequest=Ly={}));var xy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(y.CodeActionResolveRequest=xy={}));var My;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(y.WorkspaceSymbolRequest=My={}));var qy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(y.WorkspaceSymbolResolveRequest=qy={}));var Fy;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Fy||(y.CodeLensRequest=Fy={}));var By;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(y.CodeLensResolveRequest=By={}));var jy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(jy||(y.CodeLensRefreshRequest=jy={}));var Uy;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(y.DocumentLinkRequest=Uy={}));var $y;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(y.DocumentLinkResolveRequest=$y={}));var Wy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(y.DocumentFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(y.DocumentRangeFormattingRequest=Vy={}));var Hy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Hy||(y.DocumentRangesFormattingRequest=Hy={}));var Yy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(y.DocumentOnTypeFormattingRequest=Yy={}));var Ky;(function(n){n.Identifier=1})(Ky||(y.PrepareSupportDefaultBehavior=Ky={}));var zy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(y.RenameRequest=zy={}));var Gy;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Gy||(y.PrepareRenameRequest=Gy={}));var Xy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Xy||(y.ExecuteCommandRequest=Xy={}));var Qy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Qy||(y.ApplyWorkspaceEditRequest=Qy={}))});var rb=C(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createProtocolConnection=void 0;var ib=Mi();function MN(n,e,t,i){return ib.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,ib.createMessageConnection)(n,e,t,i)}Ca.createProtocolConnection=MN});var ob=C(Ct=>{"use strict";var qN=Ct&&Ct.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Oa=Ct&&Ct.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qN(e,n,t)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LSPErrorCodes=Ct.createProtocolConnection=void 0;Oa(Mi(),Ct);Oa(pa(),Ct);Oa(xe(),Ct);Oa(nb(),Ct);var FN=rb();Object.defineProperty(Ct,"createProtocolConnection",{enumerable:!0,get:function(){return FN.createProtocolConnection}});var sb;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(sb||(Ct.LSPErrorCodes=sb={}))});var We=C(bn=>{"use strict";var BN=bn&&bn.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),ab=bn&&bn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&BN(e,n,t)};Object.defineProperty(bn,"__esModule",{value:!0});bn.createProtocolConnection=void 0;var jN=bf();ab(bf(),bn);ab(ob(),bn);function UN(n,e,t,i){return(0,jN.createMessageConnection)(n,e,t,i)}bn.createProtocolConnection=UN});var xf=C(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.generateUuid=Vt.parse=Vt.isUUID=Vt.v4=Vt.empty=void 0;var ks=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Es=class n extends ks{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};Es._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Es._timeHighBits=["8","9","a","b"];Vt.empty=new ks("00000000-0000-0000-0000-000000000000");function cb(){return new Es}Vt.v4=cb;var $N=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lb(n){return $N.test(n)}Vt.isUUID=lb;function WN(n){if(!lb(n))throw new Error("invalid uuid");return new ks(n)}Vt.parse=WN;function VN(){return cb().asHex()}Vt.generateUuid=VN});var ub=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.attachPartialResult=ii.ProgressFeature=ii.attachWorkDone=void 0;var ni=We(),HN=xf(),Fi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,i,r){let s={kind:"begin",title:e,percentage:t,message:i,cancellable:r};this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,s)}report(e,t){let i={kind:"report"};typeof e=="number"?(i.percentage=e,t!==void 0&&(i.message=t)):i.message=e,this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,i)}done(){n.Instances.delete(this._token),this._connection.sendProgress(ni.WorkDoneProgress.type,this._token,{kind:"end"})}};Fi.Instances=new Map;var Aa=class extends Fi{constructor(e,t){super(e,t),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ws=class{constructor(){}begin(){}report(){}done(){}},Ia=class extends ws{constructor(){super(),this._source=new ni.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function YN(n,e){if(e===void 0||e.workDoneToken===void 0)return new ws;let t=e.workDoneToken;return delete e.workDoneToken,new Fi(n,t)}ii.attachWorkDone=YN;var KN=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ni.WorkDoneProgressCancelNotification.type,t=>{let i=Fi.Instances.get(t.token);(i instanceof Aa||i instanceof Ia)&&i.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ws:new Fi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,HN.generateUuid)();return this.connection.sendRequest(ni.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Aa(this.connection,e))}else return Promise.resolve(new Ia)}};ii.ProgressFeature=KN;var Mf;(function(n){n.type=new ni.ProgressType})(Mf||(Mf={}));var qf=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Mf.type,this._token,e)}};function zN(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new qf(n,t)}ii.attachPartialResult=zN});var fb=C(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.ConfigurationFeature=void 0;var GN=We(),XN=Ho(),QN=n=>class extends n{getConfiguration(e){return e?XN.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(GN.ConfigurationRequest.type,t).then(i=>Array.isArray(i)?Array.isArray(e)?i:i[0]:Array.isArray(e)?[]:null)}};La.ConfigurationFeature=QN});var db=C(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.WorkspaceFoldersFeature=void 0;var xa=We(),JN=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new xa.Emitter,this.connection.onNotification(xa.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(xa.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(xa.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ma.WorkspaceFoldersFeature=JN});var hb=C(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.CallHierarchyFeature=void 0;var Ff=We(),ZN=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ff.CallHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Ff.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onOutgoingCalls:e=>{let t=Ff.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};qa.CallHierarchyFeature=ZN});var jf=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.SemanticTokensBuilder=ri.SemanticTokensDiff=ri.SemanticTokensFeature=void 0;var Fa=We(),e_=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Fa.SemanticTokensRefreshRequest.type),on:e=>{let t=Fa.SemanticTokensRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onDelta:e=>{let t=Fa.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onRange:e=>{let t=Fa.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};ri.SemanticTokensFeature=e_;var Ba=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,i=0;for(;i<t&&i<e&&this.originalSequence[i]===this.modifiedSequence[i];)i++;if(i<t&&i<e){let r=e-1,s=t-1;for(;r>=i&&s>=i&&this.originalSequence[r]===this.modifiedSequence[s];)r--,s--;(r<i||s<i)&&(r++,s++);let o=r-i+1,a=this.modifiedSequence.slice(i,s+1);return a.length===1&&a[0]===this.originalSequence[r]?[{start:i,deleteCount:o-1}]:[{start:i,deleteCount:o,data:a}]}else return i<t?[{start:i,deleteCount:0,data:this.modifiedSequence.slice(i)}]:i<e?[{start:i,deleteCount:e-i}]:[]}};ri.SemanticTokensDiff=Ba;var Bf=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,i,r,s){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Ba(this._prevData,this._data).computeDiff()}:this.build()}};ri.SemanticTokensBuilder=Bf});var pb=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.ShowDocumentFeature=void 0;var t_=We(),n_=n=>class extends n{showDocument(e){return this.connection.sendRequest(t_.ShowDocumentRequest.type,e)}};ja.ShowDocumentFeature=n_});var mb=C(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.FileOperationsFeature=void 0;var Nr=We(),i_=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(Nr.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Nr.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Nr.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Nr.WillCreateFilesRequest.type,(t,i)=>e(t,i))}onWillRenameFiles(e){return this.connection.onRequest(Nr.WillRenameFilesRequest.type,(t,i)=>e(t,i))}onWillDeleteFiles(e){return this.connection.onRequest(Nr.WillDeleteFilesRequest.type,(t,i)=>e(t,i))}};Ua.FileOperationsFeature=i_});var gb=C($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.LinkedEditingRangeFeature=void 0;var r_=We(),s_=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(r_.LinkedEditingRangeRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0))}};$a.LinkedEditingRangeFeature=s_});var yb=C(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.TypeHierarchyFeature=void 0;var Uf=We(),o_=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Uf.TypeHierarchyPrepareRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=Uf.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))},onSubtypes:e=>{let t=Uf.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Wa.TypeHierarchyFeature=o_});var Tb=C(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.InlineValueFeature=void 0;var bb=We(),a_=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(bb.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(bb.InlineValueRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};Va.InlineValueFeature=a_});var Sb=C(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.FoldingRangeFeature=void 0;var vb=We(),c_=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(vb.FoldingRangeRefreshRequest.type),on:e=>{let t=vb.FoldingRangeRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Ha.FoldingRangeFeature=c_});var kb=C(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.InlayHintFeature=void 0;var $f=We(),l_=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest($f.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest($f.InlayHintRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest($f.InlayHintResolveRequest.type,(t,i)=>e(t,i))}}};Ya.InlayHintFeature=l_});var Eb=C(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.DiagnosticFeature=void 0;var Ns=We(),u_=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ns.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ns.DocumentDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ns.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Ns.WorkspaceDiagnosticRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ns.WorkspaceDiagnosticRequest.partialResult,t)))}}};Ka.DiagnosticFeature=u_});var Vf=C(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.TextDocuments=void 0;var Bi=We(),Wf=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Bi.Emitter,this._onDidOpen=new Bi.Emitter,this._onDidClose=new Bi.Emitter,this._onDidSave=new Bi.Emitter,this._onWillSave=new Bi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Bi.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(i=>{let r=i.textDocument,s=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(i=>{let r=i.textDocument,s=i.contentChanges;if(s.length===0)return;let{version:o}=r;if(o==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),t.push(e.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((i,r)=>{let s=this._syncedDocuments.get(i.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:i.reason}),r):[]})),t.push(e.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Bi.Disposable.create(()=>{t.forEach(i=>i.dispose())})}};za.TextDocuments=Wf});var Yf=C(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.NotebookDocuments=_r.NotebookSyncFeature=void 0;var Ht=We(),wb=Vf(),f_=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Ht.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Ht.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Ht.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Ht.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};_r.NotebookSyncFeature=f_;var Ga=class n{onDidOpenTextDocument(e){return this.openHandler=e,Ht.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ht.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ht.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Ga.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Hf=class{constructor(e){e instanceof wb.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new wb.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ht.Emitter,this._onDidChange=new Ht.Emitter,this._onDidSave=new Ht.Emitter,this._onDidClose=new Ht.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,i=this.notebookCellMap.get(t);return i&&i[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Ga,i=[];return i.push(this.cellTextDocuments.listen(t)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(let s of r.cellTextDocuments)t.openTextDocument({textDocument:s});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s===void 0)return;s.version=r.notebookDocument.version;let o=s.metadata,a=!1,c=r.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],p=[];if(c.cells!==void 0){let R=c.cells;if(R.structure!==void 0){let v=R.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),R.structure.didOpen!==void 0)for(let T of R.structure.didOpen)t.openTextDocument({textDocument:T}),l.push(T.uri);if(R.structure.didClose)for(let T of R.structure.didClose)t.closeTextDocument({textDocument:T}),u.push(T.uri)}if(R.data!==void 0){let v=new Map(R.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let N=v.get(s.cells[T].document);if(N!==void 0){let L=s.cells.splice(T,1,N);if(d.push({old:L[0],new:N}),v.delete(N.document),v.size===0)break}}}if(R.textContent!==void 0)for(let v of R.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),p.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let _=[];for(let R of l)_.push(this.getNotebookCell(R));let b=[];for(let R of u)b.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||b.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:b,changed:{data:d,textContent:w}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(r=>{let s=this.notebookDocuments.get(r.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of r.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(r.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Ht.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};_r.NotebookDocuments=Hf});var Nb=C(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.MonikerFeature=void 0;var d_=We(),h_=n=>class extends n{get moniker(){return{on:e=>{let t=d_.MonikerRequest.type;return this.connection.onRequest(t,(i,r)=>e(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t,i)))}}}};Xa.MonikerFeature=h_});var Jf=C(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.createConnection=de.combineFeatures=de.combineNotebooksFeatures=de.combineLanguagesFeatures=de.combineWorkspaceFeatures=de.combineWindowFeatures=de.combineClientFeatures=de.combineTracerFeatures=de.combineTelemetryFeatures=de.combineConsoleFeatures=de._NotebooksImpl=de._LanguagesImpl=de.BulkUnregistration=de.BulkRegistration=de.ErrorMessageTracker=void 0;var U=We(),Yt=Ho(),zf=xf(),Z=ub(),p_=fb(),m_=db(),g_=hb(),y_=jf(),b_=pb(),T_=mb(),v_=gb(),S_=yb(),k_=Tb(),E_=Sb(),w_=kb(),N_=Eb(),__=Yf(),P_=Nb();function Kf(n){if(n!==null)return n}var Gf=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};de.ErrorMessageTracker=Gf;var Qa=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},Xf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let i={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}showWarningMessage(e,...t){let i={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}showInformationMessage(e,...t){let i={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,i).then(Kf)}},_b=(0,b_.ShowDocumentFeature)((0,Z.ProgressFeature)(Xf)),Pb;(function(n){function e(){return new Ja}n.create=e})(Pb||(de.BulkRegistration=Pb={}));var Ja=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let i=Yt.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);let r=zf.generateUuid();this._registrations.push({id:r,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},Db;(function(n){function e(){return new _s(void 0,[])}n.create=e})(Db||(de.BulkUnregistration=Db={}));var _s=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let i of this._unregistrations.values())e.push(i);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Yt.string(e)?e:e.method,i=this._unregistrations.get(t);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(U.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(t)},s=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},Za=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,i){return e instanceof Ja?this.registerMany(e):e instanceof _s?this.registerSingle1(e,t,i):this.registerSingle2(e,t)}registerSingle1(e,t,i){let r=Yt.string(t)?t:t.method,s=zf.generateUuid(),o={registrations:[{id:s,method:r,registerOptions:i||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:r}),e),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(e,t){let i=Yt.string(e)?e:e.method,r=zf.generateUuid(),s={registrations:[{id:r,method:i,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,s).then(o=>U.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let i={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new _s(this._connection,t.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}},Qf=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(r){return r&&!!r.edit}let i=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,i)}},Rb=(0,T_.FileOperationsFeature)((0,m_.WorkspaceFoldersFeature)((0,p_.ConfigurationFeature)(Qf))),ec=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},tc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},nc=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._LanguagesImpl=nc;var Cb=(0,E_.FoldingRangeFeature)((0,P_.MonikerFeature)((0,N_.DiagnosticFeature)((0,w_.InlayHintFeature)((0,k_.InlineValueFeature)((0,S_.TypeHierarchyFeature)((0,v_.LinkedEditingRangeFeature)((0,y_.SemanticTokensFeature)((0,g_.CallHierarchyFeature)(nc))))))))),ic=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Z.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Z.attachPartialResult)(this.connection,t)}};de._NotebooksImpl=ic;var Ob=(0,__.NotebookSyncFeature)(ic);function Ab(n,e){return function(t){return e(n(t))}}de.combineConsoleFeatures=Ab;function Ib(n,e){return function(t){return e(n(t))}}de.combineTelemetryFeatures=Ib;function Lb(n,e){return function(t){return e(n(t))}}de.combineTracerFeatures=Lb;function xb(n,e){return function(t){return e(n(t))}}de.combineClientFeatures=xb;function Mb(n,e){return function(t){return e(n(t))}}de.combineWindowFeatures=Mb;function qb(n,e){return function(t){return e(n(t))}}de.combineWorkspaceFeatures=qb;function Fb(n,e){return function(t){return e(n(t))}}de.combineLanguagesFeatures=Fb;function Bb(n,e){return function(t){return e(n(t))}}de.combineNotebooksFeatures=Bb;function D_(n,e){function t(r,s,o){return r&&s?o(r,s):r||s}return{__brand:"features",console:t(n.console,e.console,Ab),tracer:t(n.tracer,e.tracer,Lb),telemetry:t(n.telemetry,e.telemetry,Ib),client:t(n.client,e.client,xb),window:t(n.window,e.window,Mb),workspace:t(n.workspace,e.workspace,qb),languages:t(n.languages,e.languages,Fb),notebooks:t(n.notebooks,e.notebooks,Bb)}}de.combineFeatures=D_;function R_(n,e,t){let i=t&&t.console?new(t.console(Qa)):new Qa,r=n(i);i.rawAttach(r);let s=t&&t.tracer?new(t.tracer(ec)):new ec,o=t&&t.telemetry?new(t.telemetry(tc)):new tc,a=t&&t.client?new(t.client(Za)):new Za,c=t&&t.window?new(t.window(_b)):new _b,l=t&&t.workspace?new(t.workspace(Rb)):new Rb,u=t&&t.languages?new(t.languages(Cb)):new Cb,d=t&&t.notebooks?new(t.notebooks(Ob)):new Ob,p=[i,s,o,a,c,l,u,d];function g(v){return v instanceof Promise?v:Yt.thenable(v)?new Promise((T,N)=>{v.then(L=>T(L),L=>N(L))}):Promise.resolve(v)}let _,b,w,R={listen:()=>r.listen(),sendRequest:(v,...T)=>r.sendRequest(Yt.string(v)?v:v.method,...T),onRequest:(v,T)=>r.onRequest(v,T),sendNotification:(v,T)=>{let N=Yt.string(v)?v:v.method;return r.sendNotification(N,T)},onNotification:(v,T)=>r.onNotification(v,T),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:v=>(b=v,{dispose:()=>{b=void 0}}),onInitialized:v=>r.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(_=v,{dispose:()=>{_=void 0}}),onExit:v=>(w=v,{dispose:()=>{w=void 0}}),get console(){return i},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>r.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>r.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>r.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>r.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>r.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>r.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>r.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>r.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>r.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>r.onRequest(U.HoverRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onCompletion:v=>r.onRequest(U.CompletionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCompletionResolve:v=>r.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>r.onRequest(U.SignatureHelpRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDeclaration:v=>r.onRequest(U.DeclarationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDefinition:v=>r.onRequest(U.DefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onTypeDefinition:v=>r.onRequest(U.TypeDefinitionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onImplementation:v=>r.onRequest(U.ImplementationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onReferences:v=>r.onRequest(U.ReferencesRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentHighlight:v=>r.onRequest(U.DocumentHighlightRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentSymbol:v=>r.onRequest(U.DocumentSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbol:v=>r.onRequest(U.WorkspaceSymbolRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onWorkspaceSymbolResolve:v=>r.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>r.onRequest(U.CodeActionRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeActionResolve:v=>r.onRequest(U.CodeActionResolveRequest.type,(T,N)=>v(T,N)),onCodeLens:v=>r.onRequest(U.CodeLensRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onCodeLensResolve:v=>r.onRequest(U.CodeLensResolveRequest.type,(T,N)=>v(T,N)),onDocumentFormatting:v=>r.onRequest(U.DocumentFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentRangeFormatting:v=>r.onRequest(U.DocumentRangeFormattingRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onDocumentOnTypeFormatting:v=>r.onRequest(U.DocumentOnTypeFormattingRequest.type,(T,N)=>v(T,N)),onRenameRequest:v=>r.onRequest(U.RenameRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),onPrepareRename:v=>r.onRequest(U.PrepareRenameRequest.type,(T,N)=>v(T,N)),onDocumentLinks:v=>r.onRequest(U.DocumentLinkRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onDocumentLinkResolve:v=>r.onRequest(U.DocumentLinkResolveRequest.type,(T,N)=>v(T,N)),onDocumentColor:v=>r.onRequest(U.DocumentColorRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onColorPresentation:v=>r.onRequest(U.ColorPresentationRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onFoldingRanges:v=>r.onRequest(U.FoldingRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onSelectionRanges:v=>r.onRequest(U.SelectionRangeRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),(0,Z.attachPartialResult)(r,T))),onExecuteCommand:v=>r.onRequest(U.ExecuteCommandRequest.type,(T,N)=>v(T,N,(0,Z.attachWorkDone)(r,T),void 0)),dispose:()=>r.dispose()};for(let v of p)v.attach(R);return r.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Yt.string(v.trace)&&(s.trace=U.Trace.fromString(v.trace));for(let T of p)T.initialize(v.capabilities);if(b){let T=b(v,new U.CancellationTokenSource().token,(0,Z.attachWorkDone)(r,v),void 0);return g(T).then(N=>{if(N instanceof U.ResponseError)return N;let L=N;L||(L={capabilities:{}});let q=L.capabilities;q||(q={},L.capabilities=q),q.textDocumentSync===void 0||q.textDocumentSync===null?q.textDocumentSync=Yt.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None:!Yt.number(q.textDocumentSync)&&!Yt.number(q.textDocumentSync.change)&&(q.textDocumentSync.change=Yt.number(R.__textDocumentSync)?R.__textDocumentSync:U.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(q);return L})}else{let T={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let N of p)N.fillServerCapabilities(T.capabilities);return T}}),r.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,_)return _(new U.CancellationTokenSource().token)}),r.onNotification(U.ExitNotification.type,()=>{try{w&&w()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),r.onNotification(U.SetTraceNotification.type,v=>{s.trace=U.Trace.fromString(v.value)}),R}de.createConnection=R_});var jb=C(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.resolveModulePath=Ot.FileSystem=Ot.resolveGlobalYarnPath=Ot.resolveGlobalNodePath=Ot.resolve=Ot.uriToFilePath=void 0;var C_=require("url"),sn=require("path"),Zf=require("fs"),id=require("child_process");function O_(n){let e=C_.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var i=0,r=t.length;i<r;i++)t[i]=decodeURIComponent(t[i]);if(process.platform==="win32"&&t.length>1){let s=t[0],o=t[1];s.length===0&&o.length>1&&o[1]===":"&&t.shift()}return sn.normalize(t.join("/"))}Ot.uriToFilePath=O_;function ed(){return process.platform==="win32"}function rc(n,e,t,i){let r="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Zf.existsSync(e)&&(l[r]?l[r]=e+sn.delimiter+l[r]:l[r]=e,i&&i(`NODE_PATH value is: ${l[r]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,id.fork)("",[],{cwd:t,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",p=>{a(p)}),u.on("message",p=>{p.c==="r"&&(u.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}Ot.resolve=rc;function td(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(s=>t[s]=process.env[s]),t.NO_UPDATE_NOTIFIER="true";let i={encoding:"utf8",env:t};ed()&&(e="npm.cmd",i.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,id.spawnSync)(e,["config","get","prefix"],i).stdout;if(!s){n&&n("'npm config get prefix' didn't return a value.");return}let o=s.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?ed()?sn.join(o,"node_modules"):sn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",r)}}Ot.resolveGlobalNodePath=td;function A_(n){let e="yarn",t={encoding:"utf8"};ed()&&(e="yarn.cmd",t.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let r=(0,id.spawnSync)(e,["global","dir","--json"],t),s=r.stdout;if(!s){n&&(n("'yarn global dir' didn't return a value."),r.stderr&&n(r.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return sn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",i)}}Ot.resolveGlobalYarnPath=A_;var nd;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Zf.existsSync(__filename.toUpperCase())||!Zf.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function i(r,s){return t()?sn.normalize(s).indexOf(sn.normalize(r))===0:sn.normalize(s).toLowerCase().indexOf(sn.normalize(r).toLowerCase())===0}n.isParent=i})(nd||(Ot.FileSystem=nd={}));function I_(n,e,t,i){return t?(sn.isAbsolute(t)||(t=sn.join(n,t)),rc(e,t,t,i).then(r=>nd.isParent(t,r)?r:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,r=>rc(e,td(i),n,i))):rc(e,td(i),n,i)}Ot.resolveModulePath=I_});var rd=C((QI,Ub)=>{"use strict";Ub.exports=We()});var $b=C(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.InlineCompletionFeature=void 0;var L_=We(),x_=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(L_.InlineCompletionRequest.type,(t,i)=>e(t,i,this.attachWorkDoneProgress(t)))}}};sc.InlineCompletionFeature=x_});var Hb=C(bt=>{"use strict";var M_=bt&&bt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Vb=bt&&bt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&M_(e,n,t)};Object.defineProperty(bt,"__esModule",{value:!0});bt.ProposedFeatures=bt.NotebookDocuments=bt.TextDocuments=bt.SemanticTokensBuilder=void 0;var q_=jf();Object.defineProperty(bt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return q_.SemanticTokensBuilder}});var F_=$b();Vb(We(),bt);var B_=Vf();Object.defineProperty(bt,"TextDocuments",{enumerable:!0,get:function(){return B_.TextDocuments}});var j_=Yf();Object.defineProperty(bt,"NotebookDocuments",{enumerable:!0,get:function(){return j_.NotebookDocuments}});Vb(Jf(),bt);var Wb;(function(n){n.all={__brand:"features",languages:F_.InlineCompletionFeature}})(Wb||(bt.ProposedFeatures=Wb={}))});var Q=C(Kt=>{"use strict";var U_=Kt&&Kt.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Gb=Kt&&Kt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&U_(e,n,t)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.createConnection=Kt.Files=void 0;var Yb=require("node:util"),sd=Ho(),$_=Jf(),Ps=jb(),ji=rd();Gb(rd(),Kt);Gb(Hb(),Kt);var Kb;(function(n){n.uriToFilePath=Ps.uriToFilePath,n.resolveGlobalNodePath=Ps.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ps.resolveGlobalYarnPath,n.resolve=Ps.resolve,n.resolveModulePath=Ps.resolveModulePath})(Kb||(Kt.Files=Kb={}));var zb;function oc(){if(zb!==void 0)try{zb.end()}catch{}}var Pr=!1,Xb;function W_(){let n="--clientProcessId";function e(t){try{let i=parseInt(t);isNaN(i)||(Xb=setInterval(()=>{try{process.kill(i,0)}catch{oc(),process.exit(Pr?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let i=process.argv[t];if(i===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let r=i.split("=");r[0]===n&&e(r[1])}}}W_();var V_={initialize:n=>{let e=n.processId;sd.number(e)&&Xb===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Pr?0:1)}},3e3)},get shutdownReceived(){return Pr},set shutdownReceived(n){Pr=n},exit:n=>{oc(),process.exit(n)}};function H_(n,e,t,i){let r,s,o,a;return n!==void 0&&n.__brand==="features"&&(r=n,n=e,e=t,t=i),ji.ConnectionStrategy.is(n)||ji.ConnectionOptions.is(n)?a=n:(s=n,o=e,a=t),Y_(s,o,a,r)}Kt.createConnection=H_;function Y_(n,e,t,i){let r=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let p=u[d];if(p==="--node-ipc"){n=new ji.IPCMessageReader(process),e=new ji.IPCMessageWriter(process);break}else if(p==="--stdio"){r=!0,n=process.stdin,e=process.stdout;break}else if(p==="--socket"){c=parseInt(u[d+1]);break}else if(p==="--pipe"){l=u[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,ji.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ji.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(sd.func(n.read)&&sd.func(n.on)){let c=n;c.on("end",()=>{oc(),process.exit(Pr?0:1)}),c.on("close",()=>{oc(),process.exit(Pr?0:1)})}let a=c=>{let l=(0,ji.createProtocolConnection)(n,e,c,t);return r&&K_(c),l};return(0,$_.createConnection)(a,V_,i)}function K_(n){function e(i){return i.map(r=>typeof r=="string"?r:(0,Yb.inspect)(r)).join(" ")}let t=new Map;console.assert=function(r,...s){if(!r)if(s.length===0)n.error("Assertion failed");else{let[o,...a]=s;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(r="default"){let s=String(r),o=t.get(s)??0;o+=1,t.set(s,o),n.log(`${s}: ${s}`)},console.countReset=function(r){r===void 0?t.clear():t.delete(String(r))},console.debug=function(...r){n.log(e(r))},console.dir=function(r,s){n.log((0,Yb.inspect)(r,s))},console.log=function(...r){n.log(e(r))},console.error=function(...r){n.error(e(r))},console.trace=function(...r){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";r.length!==0&&(o+=`: ${e(r)}`),n.log(`${o}
37
+ ${s}`)},console.warn=function(...r){n.warn(e(r))}}});var Jb=C((nL,Qb)=>{"use strict";Qb.exports=Q()});var le=C(ht=>{"use strict";var yd=Symbol.for("yaml.alias"),bv=Symbol.for("yaml.document"),jc=Symbol.for("yaml.map"),Tv=Symbol.for("yaml.pair"),bd=Symbol.for("yaml.scalar"),Uc=Symbol.for("yaml.seq"),Un=Symbol.for("yaml.node.type"),DP=n=>!!n&&typeof n=="object"&&n[Un]===yd,RP=n=>!!n&&typeof n=="object"&&n[Un]===bv,CP=n=>!!n&&typeof n=="object"&&n[Un]===jc,OP=n=>!!n&&typeof n=="object"&&n[Un]===Tv,vv=n=>!!n&&typeof n=="object"&&n[Un]===bd,AP=n=>!!n&&typeof n=="object"&&n[Un]===Uc;function Sv(n){if(n&&typeof n=="object")switch(n[Un]){case jc:case Uc:return!0}return!1}function IP(n){if(n&&typeof n=="object")switch(n[Un]){case yd:case jc:case bd:case Uc:return!0}return!1}var LP=n=>(vv(n)||Sv(n))&&!!n.anchor;ht.ALIAS=yd;ht.DOC=bv;ht.MAP=jc;ht.NODE_TYPE=Un;ht.PAIR=Tv;ht.SCALAR=bd;ht.SEQ=Uc;ht.hasAnchor=LP;ht.isAlias=DP;ht.isCollection=Sv;ht.isDocument=RP;ht.isMap=CP;ht.isNode=IP;ht.isPair=OP;ht.isScalar=vv;ht.isSeq=AP});var Is=C(Td=>{"use strict";var tt=le(),At=Symbol("break visit"),kv=Symbol("skip children"),Nn=Symbol("remove node");function $c(n,e){let t=Ev(e);tt.isDocument(n)?Br(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):Br(null,n,t,Object.freeze([]))}$c.BREAK=At;$c.SKIP=kv;$c.REMOVE=Nn;function Br(n,e,t,i){let r=wv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Nv(n,i,r),Br(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Br(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=Br("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=Br("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}async function Wc(n,e){let t=Ev(e);tt.isDocument(n)?await jr(null,n.contents,t,Object.freeze([n]))===Nn&&(n.contents=null):await jr(null,n,t,Object.freeze([]))}Wc.BREAK=At;Wc.SKIP=kv;Wc.REMOVE=Nn;async function jr(n,e,t,i){let r=await wv(n,e,t,i);if(tt.isNode(r)||tt.isPair(r))return Nv(n,i,r),jr(n,r,t,i);if(typeof r!="symbol"){if(tt.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await jr(s,e.items[s],t,i);if(typeof o=="number")s=o-1;else{if(o===At)return At;o===Nn&&(e.items.splice(s,1),s-=1)}}}else if(tt.isPair(e)){i=Object.freeze(i.concat(e));let s=await jr("key",e.key,t,i);if(s===At)return At;s===Nn&&(e.key=null);let o=await jr("value",e.value,t,i);if(o===At)return At;o===Nn&&(e.value=null)}}return r}function Ev(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function wv(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(tt.isMap(e))return t.Map?.(n,e,i);if(tt.isSeq(e))return t.Seq?.(n,e,i);if(tt.isPair(e))return t.Pair?.(n,e,i);if(tt.isScalar(e))return t.Scalar?.(n,e,i);if(tt.isAlias(e))return t.Alias?.(n,e,i)}function Nv(n,e,t){let i=e[e.length-1];if(tt.isCollection(i))i.items[n]=t;else if(tt.isPair(i))n==="key"?i.key=t:i.value=t;else if(tt.isDocument(i))i.contents=t;else{let r=tt.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}Td.visit=$c;Td.visitAsync=Wc});var vd=C(Pv=>{"use strict";var _v=le(),xP=Is(),MP={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},qP=n=>n.replace(/[!,[\]{}]/g,e=>MP[e]),Ls=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+qP(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&_v.isNode(e.contents)){let s={};xP.visit(e.contents,(o,a)=>{_v.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
38
+ `)}};Ls.defaultYaml={explicit:!1,version:"1.2"};Ls.defaultTags={"!!":"tag:yaml.org,2002:"};Pv.Directives=Ls});var Vc=C(xs=>{"use strict";var Dv=le(),FP=Is();function BP(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Rv(n){let e=new Set;return FP.visit(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function Cv(n,e){for(let t=1;;++t){let i=`${n}${t}`;if(!e.has(i))return i}}function jP(n,e){let t=[],i=new Map,r=null;return{onAnchor:s=>{t.push(s),r||(r=Rv(n));let o=Cv(e,r);return r.add(o),o},setAnchors:()=>{for(let s of t){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(Dv.isScalar(o.node)||Dv.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}xs.anchorIsValid=BP;xs.anchorNames=Rv;xs.createNodeAnchors=jP;xs.findNewAnchor=Cv});var Sd=C(Ov=>{"use strict";function Ms(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=Ms(n,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=Ms(n,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Ms(n,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=Ms(n,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return n.call(e,t,i)}Ov.applyReviver=Ms});var gi=C(Iv=>{"use strict";var UP=le();function Av(n,e,t){if(Array.isArray(n))return n.map((i,r)=>Av(i,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!UP.hasAnchor(n))return n.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=s=>{i.res=s,delete t.onCreate};let r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}Iv.toJS=Av});var Hc=C(xv=>{"use strict";var $P=Sd(),Lv=le(),WP=gi(),kd=class{constructor(e){Object.defineProperty(this,Lv.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Lv.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=WP.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?$P.applyReviver(s,{"":a},"",a):a}};xv.NodeBase=kd});var qs=C(qv=>{"use strict";var VP=Vc(),Mv=Is(),Yc=le(),HP=Hc(),YP=gi(),Ed=class extends HP.NodeBase{constructor(e){super(Yc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Mv.visit(e,{Node:(i,r)=>{if(r===this)return Mv.visit.BREAK;r.anchor===this.source&&(t=r)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=t,o=this.resolve(r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(YP.toJS(o,null,t),a=i.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Kc(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,i){let r=`*${this.source}`;if(e){if(VP.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Kc(n,e,t){if(Yc.isAlias(e)){let i=e.resolve(n),r=t&&i&&t.get(i);return r?r.count*r.aliasCount:0}else if(Yc.isCollection(e)){let i=0;for(let r of e.items){let s=Kc(n,r,t);s>i&&(i=s)}return i}else if(Yc.isPair(e)){let i=Kc(n,e.key,t),r=Kc(n,e.value,t);return Math.max(i,r)}return 1}qv.Alias=Ed});var Qe=C(wd=>{"use strict";var KP=le(),zP=Hc(),GP=gi(),XP=n=>!n||typeof n!="function"&&typeof n!="object",yi=class extends zP.NodeBase{constructor(e){super(KP.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:GP.toJS(this.value,e,t)}toString(){return String(this.value)}};yi.BLOCK_FOLDED="BLOCK_FOLDED";yi.BLOCK_LITERAL="BLOCK_LITERAL";yi.PLAIN="PLAIN";yi.QUOTE_DOUBLE="QUOTE_DOUBLE";yi.QUOTE_SINGLE="QUOTE_SINGLE";wd.Scalar=yi;wd.isScalarValue=XP});var Fs=C(Bv=>{"use strict";var QP=qs(),Vi=le(),Fv=Qe(),JP="tag:yaml.org,2002:";function ZP(n,e,t){if(e){let i=t.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>i.identify?.(n)&&!i.format)}function eD(n,e,t){if(Vi.isDocument(n)&&(n=n.contents),Vi.isNode(n))return n;if(Vi.isPair(n)){let d=t.schema[Vi.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=t,c;if(i&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=r(n)),new QP.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=JP+e.slice(2));let l=ZP(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new Fv.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[Vi.MAP]:Symbol.iterator in Object(n)?o[Vi.SEQ]:o[Vi.MAP]}s&&(s(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new Fv.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Bv.createNode=eD});var Gc=C(zc=>{"use strict";var tD=Fs(),_n=le(),nD=Hc();function Nd(n,e,t){let i=t;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return tD.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var jv=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,_d=class extends nD.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>_n.isNode(i)||_n.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(jv(e))this.add(t);else{let[i,...r]=e,s=this.get(i,!0);if(_n.isCollection(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(i,Nd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let r=this.get(t,!0);if(_n.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!t&&_n.isScalar(s)?s.value:s:_n.isCollection(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!_n.isPair(t))return!1;let i=t.value;return i==null||e&&_n.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let r=this.get(t,!0);return _n.isCollection(r)?r.hasIn(i):!1}setIn(e,t){let[i,...r]=e;if(r.length===0)this.set(i,t);else{let s=this.get(i,!0);if(_n.isCollection(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(i,Nd(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};zc.Collection=_d;zc.collectionFromPath=Nd;zc.isEmptyPath=jv});var Bs=C(Xc=>{"use strict";var iD=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Pd(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var rD=(n,e,t)=>n.endsWith(`
39
+ `)?Pd(t,e):t.includes(`
40
40
  `)?`
41
- `+_d(t,e):(n.endsWith(" ")?"":" ")+t;Gc.indentComment=_d;Gc.lineComment=JP;Gc.stringifyComment=QP});var Fv=C(Fs=>{"use strict";var ZP="flow",Pd="block",Xc="quoted";function eD(n,e,t="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return n;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(n.length<=c)return n;let l=[],u={},d=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):d=r-i);let p,g,_=!1,b=-1,w=-1,R=-1;t===Pd&&(b=qv(n,b,e.length),b!==-1&&(d=b+c));for(let T;T=n[b+=1];){if(t===Xc&&T==="\\"){switch(w=b,n[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}R=b}if(T===`
42
- `)t===Pd&&(b=qv(n,b,e.length)),d=b+e.length+c,p=void 0;else{if(T===" "&&g&&g!==" "&&g!==`
41
+ `+Pd(t,e):(n.endsWith(" ")?"":" ")+t;Xc.indentComment=Pd;Xc.lineComment=rD;Xc.stringifyComment=iD});var $v=C(js=>{"use strict";var sD="flow",Dd="block",Qc="quoted";function oD(n,e,t="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return n;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(n.length<=c)return n;let l=[],u={},d=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):d=r-i);let p,g,_=!1,b=-1,w=-1,R=-1;t===Dd&&(b=Uv(n,b,e.length),b!==-1&&(d=b+c));for(let T;T=n[b+=1];){if(t===Qc&&T==="\\"){switch(w=b,n[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}R=b}if(T===`
42
+ `)t===Dd&&(b=Uv(n,b,e.length)),d=b+e.length+c,p=void 0;else{if(T===" "&&g&&g!==" "&&g!==`
43
43
  `&&g!==" "){let N=n[b+1];N&&N!==" "&&N!==`
44
- `&&N!==" "&&(p=b)}if(b>=d)if(p)l.push(p),d=p+c,p=void 0;else if(t===Xc){for(;g===" "||g===" ";)g=T,T=n[b+=1],_=!0;let N=b>R+1?b-2:w-1;if(u[N])return n;l.push(N),u[N]=!0,d=N+c,p=void 0}else _=!0}g=T}if(_&&a&&a(),l.length===0)return n;o&&o();let v=n.slice(0,l[0]);for(let T=0;T<l.length;++T){let N=l[T],L=l[T+1]||n.length;N===0?v=`
45
- ${e}${n.slice(0,L)}`:(t===Xc&&u[N]&&(v+=`${n[N]}\\`),v+=`
46
- ${e}${n.slice(N+1,L)}`)}return v}function qv(n,e,t){let i=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
47
- `);i=e,r=e+1,s=n[r]}return i}Fs.FOLD_BLOCK=Pd;Fs.FOLD_FLOW=ZP;Fs.FOLD_QUOTED=Xc;Fs.foldFlowLines=eD});var js=C(Bv=>{"use strict";var cn=Qe(),yi=Fv(),Jc=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Zc=n=>/^(%|---|\.\.\.)/m.test(n);function tD(n,e,t){if(!e||e<0)return!1;let i=e-t,r=n.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(n[s]===`
48
- `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Bs(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Zc(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||t[c+2]==='"'||t.length<r)c+=1;else{for(o+=t.slice(a,c)+`
44
+ `&&N!==" "&&(p=b)}if(b>=d)if(p)l.push(p),d=p+c,p=void 0;else if(t===Qc){for(;g===" "||g===" ";)g=T,T=n[b+=1],_=!0;let N=b>R+1?b-2:w-1;if(u[N])return n;l.push(N),u[N]=!0,d=N+c,p=void 0}else _=!0}g=T}if(_&&a&&a(),l.length===0)return n;o&&o();let v=n.slice(0,l[0]);for(let T=0;T<l.length;++T){let N=l[T],L=l[T+1]||n.length;N===0?v=`
45
+ ${e}${n.slice(0,L)}`:(t===Qc&&u[N]&&(v+=`${n[N]}\\`),v+=`
46
+ ${e}${n.slice(N+1,L)}`)}return v}function Uv(n,e,t){let i=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
47
+ `);i=e,r=e+1,s=n[r]}return i}js.FOLD_BLOCK=Dd;js.FOLD_FLOW=sD;js.FOLD_QUOTED=Qc;js.foldFlowLines=oD});var $s=C(Wv=>{"use strict";var ln=Qe(),bi=$v(),Zc=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),el=n=>/^(%|---|\.\.\.)/m.test(n);function aD(n,e,t){if(!e||e<0)return!1;let i=e-t,r=n.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(n[s]===`
48
+ `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Us(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(el(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||t[c+2]==='"'||t.length<r)c+=1;else{for(o+=t.slice(a,c)+`
49
49
 
50
50
  `;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
51
- `,c+=2;o+=s,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,i?o:yi.foldFlowLines(o,s,yi.FOLD_QUOTED,Jc(e,!1))}function Dd(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
52
- `)||/[ \t]\n|\n[ \t]/.test(n))return Bs(n,e);let t=e.indent||(Zc(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
53
- ${t}`)+"'";return e.implicitKey?i:yi.foldFlowLines(i,t,yi.FOLD_FLOW,Jc(e,!1))}function Br(n,e){let{singleQuote:t}=e.options,i;if(t===!1)i=Bs;else{let r=n.includes('"'),s=n.includes("'");r&&!s?i=Dd:s&&!r?i=Bs:i=t?Dd:Bs}return i(n,e)}var Rd;try{Rd=new RegExp(`(^|(?<!
51
+ `,c+=2;o+=s,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,i?o:bi.foldFlowLines(o,s,bi.FOLD_QUOTED,Zc(e,!1))}function Rd(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
52
+ `)||/[ \t]\n|\n[ \t]/.test(n))return Us(n,e);let t=e.indent||(el(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
53
+ ${t}`)+"'";return e.implicitKey?i:bi.foldFlowLines(i,t,bi.FOLD_FLOW,Zc(e,!1))}function Ur(n,e){let{singleQuote:t}=e.options,i;if(t===!1)i=Us;else{let r=n.includes('"'),s=n.includes("'");r&&!s?i=Rd:s&&!r?i=Us:i=t?Rd:Us}return i(n,e)}var Cd;try{Cd=new RegExp(`(^|(?<!
54
54
  ))
55
55
  +(?!
56
- |$)`,"g")}catch{Rd=/\n+(?!\n|$)/g}function Qc({comment:n,type:e,value:t},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Br(t,i);let l=i.indent||(i.forceBlockIndent||Zc(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===cn.Scalar.BLOCK_FOLDED?!1:e===cn.Scalar.BLOCK_LITERAL?!0:!tD(t,c,l.length);if(!t)return u?`|
56
+ |$)`,"g")}catch{Cd=/\n+(?!\n|$)/g}function Jc({comment:n,type:e,value:t},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Ur(t,i);let l=i.indent||(i.forceBlockIndent||el(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===ln.Scalar.BLOCK_FOLDED?!1:e===ln.Scalar.BLOCK_LITERAL?!0:!aD(t,c,l.length);if(!t)return u?`|
57
57
  `:`>
58
58
  `;let d,p;for(p=t.length;p>0;--p){let L=t[p-1];if(L!==`
59
59
  `&&L!==" "&&L!==" ")break}let g=t.substring(p),_=g.indexOf(`
60
60
  `);_===-1?d="-":t===g||_!==g.length-1?(d="+",s&&s()):d="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
61
- `&&(g=g.slice(0,-1)),g=g.replace(Rd,`$&${l}`));let b=!1,w,R=-1;for(w=0;w<t.length;++w){let L=t[w];if(L===" ")b=!0;else if(L===`
61
+ `&&(g=g.slice(0,-1)),g=g.replace(Cd,`$&${l}`));let b=!1,w,R=-1;for(w=0;w<t.length;++w){let L=t[w];if(L===" ")b=!0;else if(L===`
62
62
  `)R=w;else break}let v=t.substring(0,R<w?R+1:w);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let N=(b?l?"2":"1":"")+d;if(n&&(N+=" "+a(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let L=t.replace(/\n+/g,`
63
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),q=!1,H=Jc(i,!0);o!=="folded"&&e!==cn.Scalar.BLOCK_FOLDED&&(H.onOverflow=()=>{q=!0});let j=yi.foldFlowLines(`${v}${L}${g}`,l,yi.FOLD_BLOCK,H);if(!q)return`>${N}
63
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),q=!1,H=Zc(i,!0);o!=="folded"&&e!==ln.Scalar.BLOCK_FOLDED&&(H.onOverflow=()=>{q=!0});let j=bi.foldFlowLines(`${v}${L}${g}`,l,bi.FOLD_BLOCK,H);if(!q)return`>${N}
64
64
  ${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${N}
65
- ${l}${v}${t}${g}`}function nD(n,e,t,i){let{type:r,value:s}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
66
- `)||u&&/[[\]{},]/.test(s))return Br(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
67
- `)?Br(s,e):Qc(n,e,t,i);if(!a&&!u&&r!==cn.Scalar.PLAIN&&s.includes(`
68
- `))return Qc(n,e,t,i);if(Zc(s)){if(c==="")return e.forceBlockIndent=!0,Qc(n,e,t,i);if(a&&c===l)return Br(s,e)}let d=s.replace(/\n+/g,`$&
69
- ${c}`);if(o){let p=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(d),{compat:g,tags:_}=e.doc.schema;if(_.some(p)||g?.some(p))return Br(s,e)}return a?d:yi.foldFlowLines(d,c,yi.FOLD_FLOW,Jc(e,!1))}function iD(n,e,t,i){let{implicitKey:r,inFlow:s}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==cn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=cn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case cn.Scalar.BLOCK_FOLDED:case cn.Scalar.BLOCK_LITERAL:return r||s?Br(o.value,e):Qc(o,e,t,i);case cn.Scalar.QUOTE_DOUBLE:return Bs(o.value,e);case cn.Scalar.QUOTE_SINGLE:return Dd(o.value,e);case cn.Scalar.PLAIN:return nD(o,e,t,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}Bv.stringifyString=iD});var Us=C(Cd=>{"use strict";var rD=Wc(),bi=le(),sD=qs(),oD=js();function aD(n,e){let t=Object.assign({blockQuote:!0,commentString:sD.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function cD(n,e){if(e.tag){let r=n.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let t,i;if(bi.isScalar(e)){i=e.value;let r=n.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}t=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,t=n.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!t){let r=i?.constructor?.name??typeof i;throw new Error(`Tag not resolved for ${r} value`)}return t}function lD(n,e,{anchors:t,doc:i}){if(!i.directives)return"";let r=[],s=(bi.isScalar(n)||bi.isCollection(n))&&n.anchor;s&&rD.anchorIsValid(s)&&(t.add(s),r.push(`&${s}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&r.push(i.directives.tagString(o)),r.join(" ")}function uD(n,e,t,i){if(bi.isPair(n))return n.toString(e,t,i);if(bi.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r,s=bi.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>r=c});r||(r=cD(e.doc.schema.tags,s));let o=lD(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,t,i):bi.isScalar(s)?oD.stringifyString(s,e,t,i):s.toString(e,t,i);return o?bi.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
- ${e.indent}${a}`:a}Cd.createStringifyContext=aD;Cd.stringify=uD});var Wv=C($v=>{"use strict";var $n=le(),jv=Qe(),Uv=Us(),$s=qs();function fD({key:n,value:e},t,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,p=$n.isNode(n)&&n.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if($n.isCollection(n)||!$n.isNode(n)&&typeof n=="object"){let H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let g=!d&&(!n||p&&e==null&&!t.inFlow||$n.isCollection(n)||($n.isScalar(n)?n.type===jv.Scalar.BLOCK_FOLDED||n.type===jv.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(d||!s),indent:a+c});let _=!1,b=!1,w=Uv.stringify(n,t,()=>_=!0,()=>b=!0);if(!g&&!t.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(s||e==null)return _&&i&&i(),w===""?"?":g?`? ${w}`:w}else if(s&&!d||e==null&&g)return w=`? ${w}`,p&&!_?w+=$s.lineComment(w,t.indent,l(p)):b&&r&&r(),w;_&&(p=null),g?(p&&(w+=$s.lineComment(w,t.indent,l(p))),w=`? ${w}
71
- ${a}:`):(w=`${w}:`,p&&(w+=$s.lineComment(w,t.indent,l(p))));let R,v,T;$n.isNode(e)?(R=!!e.spaceBefore,v=e.commentBefore,T=e.comment):(R=!1,v=null,T=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!p&&$n.isScalar(e)&&(t.indentAtStart=w.length+1),b=!1,!u&&c.length>=2&&!t.inFlow&&!g&&$n.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,L=Uv.stringify(e,t,()=>N=!0,()=>b=!0),q=" ";if(p||R||v){if(q=R?`
65
+ ${l}${v}${t}${g}`}function cD(n,e,t,i){let{type:r,value:s}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
66
+ `)||u&&/[[\]{},]/.test(s))return Ur(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
67
+ `)?Ur(s,e):Jc(n,e,t,i);if(!a&&!u&&r!==ln.Scalar.PLAIN&&s.includes(`
68
+ `))return Jc(n,e,t,i);if(el(s)){if(c==="")return e.forceBlockIndent=!0,Jc(n,e,t,i);if(a&&c===l)return Ur(s,e)}let d=s.replace(/\n+/g,`$&
69
+ ${c}`);if(o){let p=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(d),{compat:g,tags:_}=e.doc.schema;if(_.some(p)||g?.some(p))return Ur(s,e)}return a?d:bi.foldFlowLines(d,c,bi.FOLD_FLOW,Zc(e,!1))}function lD(n,e,t,i){let{implicitKey:r,inFlow:s}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==ln.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ln.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case ln.Scalar.BLOCK_FOLDED:case ln.Scalar.BLOCK_LITERAL:return r||s?Ur(o.value,e):Jc(o,e,t,i);case ln.Scalar.QUOTE_DOUBLE:return Us(o.value,e);case ln.Scalar.QUOTE_SINGLE:return Rd(o.value,e);case ln.Scalar.PLAIN:return cD(o,e,t,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}Wv.stringifyString=lD});var Ws=C(Od=>{"use strict";var uD=Vc(),Ti=le(),fD=Bs(),dD=$s();function hD(n,e){let t=Object.assign({blockQuote:!0,commentString:fD.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function pD(n,e){if(e.tag){let r=n.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let t,i;if(Ti.isScalar(e)){i=e.value;let r=n.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}t=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,t=n.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!t){let r=i?.constructor?.name??typeof i;throw new Error(`Tag not resolved for ${r} value`)}return t}function mD(n,e,{anchors:t,doc:i}){if(!i.directives)return"";let r=[],s=(Ti.isScalar(n)||Ti.isCollection(n))&&n.anchor;s&&uD.anchorIsValid(s)&&(t.add(s),r.push(`&${s}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&r.push(i.directives.tagString(o)),r.join(" ")}function gD(n,e,t,i){if(Ti.isPair(n))return n.toString(e,t,i);if(Ti.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r,s=Ti.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>r=c});r||(r=pD(e.doc.schema.tags,s));let o=mD(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,t,i):Ti.isScalar(s)?dD.stringifyString(s,e,t,i):s.toString(e,t,i);return o?Ti.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
+ ${e.indent}${a}`:a}Od.createStringifyContext=hD;Od.stringify=gD});var Kv=C(Yv=>{"use strict";var $n=le(),Vv=Qe(),Hv=Ws(),Vs=Bs();function yD({key:n,value:e},t,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,p=$n.isNode(n)&&n.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if($n.isCollection(n)||!$n.isNode(n)&&typeof n=="object"){let H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let g=!d&&(!n||p&&e==null&&!t.inFlow||$n.isCollection(n)||($n.isScalar(n)?n.type===Vv.Scalar.BLOCK_FOLDED||n.type===Vv.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(d||!s),indent:a+c});let _=!1,b=!1,w=Hv.stringify(n,t,()=>_=!0,()=>b=!0);if(!g&&!t.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(s||e==null)return _&&i&&i(),w===""?"?":g?`? ${w}`:w}else if(s&&!d||e==null&&g)return w=`? ${w}`,p&&!_?w+=Vs.lineComment(w,t.indent,l(p)):b&&r&&r(),w;_&&(p=null),g?(p&&(w+=Vs.lineComment(w,t.indent,l(p))),w=`? ${w}
71
+ ${a}:`):(w=`${w}:`,p&&(w+=Vs.lineComment(w,t.indent,l(p))));let R,v,T;$n.isNode(e)?(R=!!e.spaceBefore,v=e.commentBefore,T=e.comment):(R=!1,v=null,T=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!p&&$n.isScalar(e)&&(t.indentAtStart=w.length+1),b=!1,!u&&c.length>=2&&!t.inFlow&&!g&&$n.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,L=Hv.stringify(e,t,()=>N=!0,()=>b=!0),q=" ";if(p||R||v){if(q=R?`
72
72
  `:"",v){let H=l(v);q+=`
73
- ${$s.indentComment(H,t.indent)}`}L===""&&!t.inFlow?q===`
73
+ ${Vs.indentComment(H,t.indent)}`}L===""&&!t.inFlow?q===`
74
74
  `&&(q=`
75
75
 
76
76
  `):q+=`
77
77
  ${t.indent}`}else if(!g&&$n.isCollection(e)){let H=L[0],j=L.indexOf(`
78
- `),ie=j!==-1,Be=t.inFlow??e.flow??e.items.length===0;if(ie||!Be){let Et=!1;if(ie&&(H==="&"||H==="!")){let ce=L.indexOf(" ");H==="&"&&ce!==-1&&ce<j&&L[ce+1]==="!"&&(ce=L.indexOf(" ",ce+1)),(ce===-1||j<ce)&&(Et=!0)}Et||(q=`
78
+ `),re=j!==-1,Be=t.inFlow??e.flow??e.items.length===0;if(re||!Be){let Et=!1;if(re&&(H==="&"||H==="!")){let ce=L.indexOf(" ");H==="&"&&ce!==-1&&ce<j&&L[ce+1]==="!"&&(ce=L.indexOf(" ",ce+1)),(ce===-1||j<ce)&&(Et=!0)}Et||(q=`
79
79
  ${t.indent}`)}}else(L===""||L[0]===`
80
- `)&&(q="");return w+=q+L,t.inFlow?N&&i&&i():T&&!N?w+=$s.lineComment(w,t.indent,l(T)):b&&r&&r(),w}$v.stringifyPair=fD});var Ad=C(Od=>{"use strict";function dD(n,...e){n==="debug"&&console.log(...e)}function hD(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Od.debug=dD;Od.warn=hD});var il=C(nl=>{"use strict";var Ws=le(),Vv=Qe(),el="<<",tl={identify:n=>n===el||typeof n=="symbol"&&n.description===el,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Vv.Scalar(Symbol(el)),{addToJSMap:Hv}),stringify:()=>el},pD=(n,e)=>(tl.identify(e)||Ws.isScalar(e)&&(!e.type||e.type===Vv.Scalar.PLAIN)&&tl.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===tl.tag&&t.default);function Hv(n,e,t){if(t=n&&Ws.isAlias(t)?t.resolve(n.doc):t,Ws.isSeq(t))for(let i of t.items)Id(n,e,i);else if(Array.isArray(t))for(let i of t)Id(n,e,i);else Id(n,e,t)}function Id(n,e,t){let i=n&&Ws.isAlias(t)?t.resolve(n.doc):t;if(!Ws.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,n,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}nl.addMergeToJSMap=Hv;nl.isMergeKey=pD;nl.merge=tl});var xd=C(zv=>{"use strict";var mD=Ad(),Yv=il(),gD=Us(),Kv=le(),Ld=mi();function yD(n,e,{key:t,value:i}){if(Kv.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(Yv.isMergeKey(n,t))Yv.addMergeToJSMap(n,e,i);else{let r=Ld.toJS(t,"",n);if(e instanceof Map)e.set(r,Ld.toJS(i,r,n));else if(e instanceof Set)e.add(r);else{let s=bD(t,r,n),o=Ld.toJS(i,s,n);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function bD(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Kv.isNode(n)&&t?.doc){let i=gD.createStringifyContext(t.doc,{});i.anchors=new Set;for(let s of t.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=n.toString(i);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),mD.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}zv.addPairToJSMap=yD});var Ti=C(Md=>{"use strict";var Gv=Ms(),TD=Wv(),vD=xd(),rl=le();function SD(n,e,t){let i=Gv.createNode(n,void 0,t),r=Gv.createNode(e,void 0,t);return new sl(i,r)}var sl=class n{constructor(e,t=null){Object.defineProperty(this,rl.NODE_TYPE,{value:rl.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return rl.isNode(t)&&(t=t.clone(e)),rl.isNode(i)&&(i=i.clone(e)),new n(t,i)}toJSON(e,t){let i=t?.mapAsMap?new Map:{};return vD.addPairToJSMap(t,i,this)}toString(e,t,i){return e?.doc?TD.stringifyPair(this,e,t,i):JSON.stringify(this)}};Md.Pair=sl;Md.createPair=SD});var qd=C(Qv=>{"use strict";var Vi=le(),Xv=Us(),ol=qs();function kD(n,e,t){return(e.inFlow??n.flow?wD:ED)(n,e,t)}function ED({comment:n,items:e},t,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:s,type:null}),d=!1,p=[];for(let _=0;_<e.length;++_){let b=e[_],w=null;if(Vi.isNode(b))!d&&b.spaceBefore&&p.push(""),al(t,p,b.commentBefore,d),b.comment&&(w=b.comment);else if(Vi.isPair(b)){let v=Vi.isNode(b.key)?b.key:null;v&&(!d&&v.spaceBefore&&p.push(""),al(t,p,v.commentBefore,d))}d=!1;let R=Xv.stringify(b,u,()=>w=null,()=>d=!0);w&&(R+=ol.lineComment(R,s,l(w))),d&&w&&(d=!1),p.push(i+R)}let g;if(p.length===0)g=r.start+r.end;else{g=p[0];for(let _=1;_<p.length;++_){let b=p[_];g+=b?`
80
+ `)&&(q="");return w+=q+L,t.inFlow?N&&i&&i():T&&!N?w+=Vs.lineComment(w,t.indent,l(T)):b&&r&&r(),w}Yv.stringifyPair=yD});var Id=C(Ad=>{"use strict";function bD(n,...e){n==="debug"&&console.log(...e)}function TD(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Ad.debug=bD;Ad.warn=TD});var rl=C(il=>{"use strict";var Hs=le(),zv=Qe(),tl="<<",nl={identify:n=>n===tl||typeof n=="symbol"&&n.description===tl,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new zv.Scalar(Symbol(tl)),{addToJSMap:Gv}),stringify:()=>tl},vD=(n,e)=>(nl.identify(e)||Hs.isScalar(e)&&(!e.type||e.type===zv.Scalar.PLAIN)&&nl.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===nl.tag&&t.default);function Gv(n,e,t){if(t=n&&Hs.isAlias(t)?t.resolve(n.doc):t,Hs.isSeq(t))for(let i of t.items)Ld(n,e,i);else if(Array.isArray(t))for(let i of t)Ld(n,e,i);else Ld(n,e,t)}function Ld(n,e,t){let i=n&&Hs.isAlias(t)?t.resolve(n.doc):t;if(!Hs.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,n,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}il.addMergeToJSMap=Gv;il.isMergeKey=vD;il.merge=nl});var Md=C(Jv=>{"use strict";var SD=Id(),Xv=rl(),kD=Ws(),Qv=le(),xd=gi();function ED(n,e,{key:t,value:i}){if(Qv.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(Xv.isMergeKey(n,t))Xv.addMergeToJSMap(n,e,i);else{let r=xd.toJS(t,"",n);if(e instanceof Map)e.set(r,xd.toJS(i,r,n));else if(e instanceof Set)e.add(r);else{let s=wD(t,r,n),o=xd.toJS(i,s,n);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function wD(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Qv.isNode(n)&&t?.doc){let i=kD.createStringifyContext(t.doc,{});i.anchors=new Set;for(let s of t.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=n.toString(i);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),SD.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}Jv.addPairToJSMap=ED});var vi=C(qd=>{"use strict";var Zv=Fs(),ND=Kv(),_D=Md(),sl=le();function PD(n,e,t){let i=Zv.createNode(n,void 0,t),r=Zv.createNode(e,void 0,t);return new ol(i,r)}var ol=class n{constructor(e,t=null){Object.defineProperty(this,sl.NODE_TYPE,{value:sl.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return sl.isNode(t)&&(t=t.clone(e)),sl.isNode(i)&&(i=i.clone(e)),new n(t,i)}toJSON(e,t){let i=t?.mapAsMap?new Map:{};return _D.addPairToJSMap(t,i,this)}toString(e,t,i){return e?.doc?ND.stringifyPair(this,e,t,i):JSON.stringify(this)}};qd.Pair=ol;qd.createPair=PD});var Fd=C(tS=>{"use strict";var Hi=le(),eS=Ws(),al=Bs();function DD(n,e,t){return(e.inFlow??n.flow?CD:RD)(n,e,t)}function RD({comment:n,items:e},t,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:s,type:null}),d=!1,p=[];for(let _=0;_<e.length;++_){let b=e[_],w=null;if(Hi.isNode(b))!d&&b.spaceBefore&&p.push(""),cl(t,p,b.commentBefore,d),b.comment&&(w=b.comment);else if(Hi.isPair(b)){let v=Hi.isNode(b.key)?b.key:null;v&&(!d&&v.spaceBefore&&p.push(""),cl(t,p,v.commentBefore,d))}d=!1;let R=eS.stringify(b,u,()=>w=null,()=>d=!0);w&&(R+=al.lineComment(R,s,l(w))),d&&w&&(d=!1),p.push(i+R)}let g;if(p.length===0)g=r.start+r.end;else{g=p[0];for(let _=1;_<p.length;++_){let b=p[_];g+=b?`
81
81
  ${c}${b}`:`
82
82
  `}}return n?(g+=`
83
- `+ol.indentComment(l(n),c),a&&a()):d&&o&&o(),g}function wD({items:n},e,{flowChars:t,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let _=0;_<n.length;++_){let b=n[_],w=null;if(Vi.isNode(b))b.spaceBefore&&d.push(""),al(e,d,b.commentBefore,!1),b.comment&&(w=b.comment);else if(Vi.isPair(b)){let v=Vi.isNode(b.key)?b.key:null;v&&(v.spaceBefore&&d.push(""),al(e,d,v.commentBefore,!1),v.comment&&(l=!0));let T=Vi.isNode(b.value)?b.value:null;T?(T.comment&&(w=T.comment),T.commentBefore&&(l=!0)):b.value==null&&v?.comment&&(w=v.comment)}w&&(l=!0);let R=Xv.stringify(b,c,()=>w=null);_<n.length-1&&(R+=","),w&&(R+=ol.lineComment(R,i,a(w))),!l&&(d.length>u||R.includes(`
83
+ `+al.indentComment(l(n),c),a&&a()):d&&o&&o(),g}function CD({items:n},e,{flowChars:t,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let _=0;_<n.length;++_){let b=n[_],w=null;if(Hi.isNode(b))b.spaceBefore&&d.push(""),cl(e,d,b.commentBefore,!1),b.comment&&(w=b.comment);else if(Hi.isPair(b)){let v=Hi.isNode(b.key)?b.key:null;v&&(v.spaceBefore&&d.push(""),cl(e,d,v.commentBefore,!1),v.comment&&(l=!0));let T=Hi.isNode(b.value)?b.value:null;T?(T.comment&&(w=T.comment),T.commentBefore&&(l=!0)):b.value==null&&v?.comment&&(w=v.comment)}w&&(l=!0);let R=eS.stringify(b,c,()=>w=null);_<n.length-1&&(R+=","),w&&(R+=al.lineComment(R,i,a(w))),!l&&(d.length>u||R.includes(`
84
84
  `))&&(l=!0),d.push(R),u=d.length}let{start:p,end:g}=t;if(d.length===0)return p+g;if(!l){let _=d.reduce((b,w)=>b+w.length+2,2);l=e.options.lineWidth>0&&_>e.options.lineWidth}if(l){let _=p;for(let b of d)_+=b?`
85
85
  ${s}${r}${b}`:`
86
86
  `;return`${_}
87
- ${r}${g}`}else return`${p}${o}${d.join(" ")}${o}${g}`}function al({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=ol.indentComment(e(i),n);t.push(s.trimStart())}}Qv.stringifyCollection=kD});var Si=C(Bd=>{"use strict";var ND=qd(),_D=xd(),PD=zc(),vi=le(),cl=Ti(),DD=Qe();function Vs(n,e){let t=vi.isScalar(e)?e.value:e;for(let i of n)if(vi.isPair(i)&&(i.key===e||i.key===t||vi.isScalar(i.key)&&i.key.value===t))return i}var Fd=class extends PD.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(vi.MAP,e),this.items=[]}static from(e,t,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(t,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(cl.createPair(c,l,i))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let i;vi.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new cl.Pair(e,e?.value):i=new cl.Pair(e.key,e.value);let r=Vs(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${i.key} already set`);vi.isScalar(r.value)&&DD.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let t=Vs(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Vs(this.items,e)?.value;return(!t&&vi.isScalar(r)?r.value:r)??void 0}has(e){return!!Vs(this.items,e)}set(e,t){this.add(new cl.Pair(e,t),!0)}toJSON(e,t,i){let r=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let s of this.items)_D.addPairToJSMap(t,r,s);return r}toString(e,t,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!vi.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ND.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}};Bd.YAMLMap=Fd;Bd.findPair=Vs});var jr=C(Zv=>{"use strict";var RD=le(),Jv=Si(),CD={collection:"map",default:!0,nodeClass:Jv.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return RD.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>Jv.YAMLMap.from(n,e,t)};Zv.map=CD});var ki=C(eS=>{"use strict";var OD=Ms(),AD=qd(),ID=zc(),ul=le(),LD=Qe(),xD=mi(),jd=class extends ID.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ul.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ll(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let i=ll(e);if(typeof i!="number")return;let r=this.items[i];return!t&&ul.isScalar(r)?r.value:r}has(e){let t=ll(e);return typeof t=="number"&&t<this.items.length}set(e,t){let i=ll(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];ul.isScalar(r)&&LD.isScalarValue(t)?r.value=t:this.items[i]=t}toJSON(e,t){let i=[];t?.onCreate&&t.onCreate(i);let r=0;for(let s of this.items)i.push(xD.toJS(s,String(r++),t));return i}toString(e,t,i){return e?AD.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){let c=t instanceof Set?a:String(o++);a=r.call(t,c,a)}s.items.push(OD.createNode(a,void 0,i))}}return s}};function ll(n){let e=ul.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}eS.YAMLSeq=jd});var Ur=C(nS=>{"use strict";var MD=le(),tS=ki(),qD={collection:"seq",default:!0,nodeClass:tS.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return MD.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>tS.YAMLSeq.from(n,e,t)};nS.seq=qD});var Hs=C(iS=>{"use strict";var FD=js(),BD={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),FD.stringifyString(n,e,t,i)}};iS.string=BD});var fl=C(oS=>{"use strict";var rS=Qe(),sS={identify:n=>n==null,createNode:()=>new rS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rS.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&sS.test.test(n)?n:e.options.nullStr};oS.nullTag=sS});var Ud=C(cS=>{"use strict";var jD=Qe(),aS={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new jD.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&aS.test.test(n)){let i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};cS.boolTag=aS});var $r=C(lS=>{"use strict";function UD({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}lS.stringifyNumber=UD});var Wd=C(dl=>{"use strict";var $D=Qe(),$d=$r(),WD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$d.stringifyNumber},VD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():$d.stringifyNumber(n)}},HD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new $D.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:$d.stringifyNumber};dl.float=HD;dl.floatExp=VD;dl.floatNaN=WD});var Hd=C(pl=>{"use strict";var uS=$r(),hl=n=>typeof n=="bigint"||Number.isInteger(n),Vd=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function fS(n,e,t){let{value:i}=n;return hl(i)&&i>=0?t+i.toString(e):uS.stringifyNumber(n)}var YD={identify:n=>hl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Vd(n,2,8,t),stringify:n=>fS(n,8,"0o")},KD={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Vd(n,0,10,t),stringify:uS.stringifyNumber},zD={identify:n=>hl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Vd(n,2,16,t),stringify:n=>fS(n,16,"0x")};pl.int=KD;pl.intHex=zD;pl.intOct=YD});var hS=C(dS=>{"use strict";var GD=jr(),XD=fl(),QD=Ur(),JD=Hs(),ZD=Ud(),Yd=Wd(),Kd=Hd(),eR=[GD.map,QD.seq,JD.string,XD.nullTag,ZD.boolTag,Kd.intOct,Kd.int,Kd.intHex,Yd.floatNaN,Yd.floatExp,Yd.float];dS.schema=eR});var gS=C(mS=>{"use strict";var tR=Qe(),nR=jr(),iR=Ur();function pS(n){return typeof n=="bigint"||Number.isInteger(n)}var ml=({value:n})=>JSON.stringify(n),rR=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:ml},{identify:n=>n==null,createNode:()=>new tR.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ml},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:ml},{identify:pS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>pS(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:ml}],sR={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},oR=[nR.map,iR.seq].concat(rR,sR);mS.schema=oR});var Gd=C(yS=>{"use strict";var zd=Qe(),aR=js(),cR={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,r,s){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=zd.Scalar.BLOCK_LITERAL),e!==zd.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=a.substr(p,c);a=u.join(e===zd.Scalar.BLOCK_LITERAL?`
88
- `:" ")}return aR.stringifyString({comment:n,type:e,value:a},i,r,s)}};yS.binary=cR});var bl=C(yl=>{"use strict";var gl=le(),Xd=Ti(),lR=Qe(),uR=ki();function bS(n,e){if(gl.isSeq(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!gl.isPair(i)){if(gl.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Xd.Pair(new lR.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
87
+ ${r}${g}`}else return`${p}${o}${d.join(" ")}${o}${g}`}function cl({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=al.indentComment(e(i),n);t.push(s.trimStart())}}tS.stringifyCollection=DD});var ki=C(jd=>{"use strict";var OD=Fd(),AD=Md(),ID=Gc(),Si=le(),ll=vi(),LD=Qe();function Ys(n,e){let t=Si.isScalar(e)?e.value:e;for(let i of n)if(Si.isPair(i)&&(i.key===e||i.key===t||Si.isScalar(i.key)&&i.key.value===t))return i}var Bd=class extends ID.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Si.MAP,e),this.items=[]}static from(e,t,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(t,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(ll.createPair(c,l,i))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let i;Si.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new ll.Pair(e,e?.value):i=new ll.Pair(e.key,e.value);let r=Ys(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${i.key} already set`);Si.isScalar(r.value)&&LD.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let t=Ys(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Ys(this.items,e)?.value;return(!t&&Si.isScalar(r)?r.value:r)??void 0}has(e){return!!Ys(this.items,e)}set(e,t){this.add(new ll.Pair(e,t),!0)}toJSON(e,t,i){let r=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let s of this.items)AD.addPairToJSMap(t,r,s);return r}toString(e,t,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!Si.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),OD.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}};jd.YAMLMap=Bd;jd.findPair=Ys});var $r=C(iS=>{"use strict";var xD=le(),nS=ki(),MD={collection:"map",default:!0,nodeClass:nS.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return xD.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>nS.YAMLMap.from(n,e,t)};iS.map=MD});var Ei=C(rS=>{"use strict";var qD=Fs(),FD=Fd(),BD=Gc(),fl=le(),jD=Qe(),UD=gi(),Ud=class extends BD.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(fl.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ul(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let i=ul(e);if(typeof i!="number")return;let r=this.items[i];return!t&&fl.isScalar(r)?r.value:r}has(e){let t=ul(e);return typeof t=="number"&&t<this.items.length}set(e,t){let i=ul(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];fl.isScalar(r)&&jD.isScalarValue(t)?r.value=t:this.items[i]=t}toJSON(e,t){let i=[];t?.onCreate&&t.onCreate(i);let r=0;for(let s of this.items)i.push(UD.toJS(s,String(r++),t));return i}toString(e,t,i){return e?FD.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){let c=t instanceof Set?a:String(o++);a=r.call(t,c,a)}s.items.push(qD.createNode(a,void 0,i))}}return s}};function ul(n){let e=fl.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}rS.YAMLSeq=Ud});var Wr=C(oS=>{"use strict";var $D=le(),sS=Ei(),WD={collection:"seq",default:!0,nodeClass:sS.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return $D.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>sS.YAMLSeq.from(n,e,t)};oS.seq=WD});var Ks=C(aS=>{"use strict";var VD=$s(),HD={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),VD.stringifyString(n,e,t,i)}};aS.string=HD});var dl=C(uS=>{"use strict";var cS=Qe(),lS={identify:n=>n==null,createNode:()=>new cS.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new cS.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&lS.test.test(n)?n:e.options.nullStr};uS.nullTag=lS});var $d=C(dS=>{"use strict";var YD=Qe(),fS={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new YD.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&fS.test.test(n)){let i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};dS.boolTag=fS});var Vr=C(hS=>{"use strict";function KD({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}hS.stringifyNumber=KD});var Vd=C(hl=>{"use strict";var zD=Qe(),Wd=Vr(),GD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wd.stringifyNumber},XD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Wd.stringifyNumber(n)}},QD={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new zD.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Wd.stringifyNumber};hl.float=QD;hl.floatExp=XD;hl.floatNaN=GD});var Yd=C(ml=>{"use strict";var pS=Vr(),pl=n=>typeof n=="bigint"||Number.isInteger(n),Hd=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function mS(n,e,t){let{value:i}=n;return pl(i)&&i>=0?t+i.toString(e):pS.stringifyNumber(n)}var JD={identify:n=>pl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Hd(n,2,8,t),stringify:n=>mS(n,8,"0o")},ZD={identify:pl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Hd(n,0,10,t),stringify:pS.stringifyNumber},eR={identify:n=>pl(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Hd(n,2,16,t),stringify:n=>mS(n,16,"0x")};ml.int=ZD;ml.intHex=eR;ml.intOct=JD});var yS=C(gS=>{"use strict";var tR=$r(),nR=dl(),iR=Wr(),rR=Ks(),sR=$d(),Kd=Vd(),zd=Yd(),oR=[tR.map,iR.seq,rR.string,nR.nullTag,sR.boolTag,zd.intOct,zd.int,zd.intHex,Kd.floatNaN,Kd.floatExp,Kd.float];gS.schema=oR});var vS=C(TS=>{"use strict";var aR=Qe(),cR=$r(),lR=Wr();function bS(n){return typeof n=="bigint"||Number.isInteger(n)}var gl=({value:n})=>JSON.stringify(n),uR=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:gl},{identify:n=>n==null,createNode:()=>new aR.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:gl},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:gl},{identify:bS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>bS(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:gl}],fR={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},dR=[cR.map,lR.seq].concat(uR,fR);TS.schema=dR});var Xd=C(SS=>{"use strict";var Gd=Qe(),hR=$s(),pR={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,r,s){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Gd.Scalar.BLOCK_LITERAL),e!==Gd.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,p=0;d<l;++d,p+=c)u[d]=a.substr(p,c);a=u.join(e===Gd.Scalar.BLOCK_LITERAL?`
88
+ `:" ")}return hR.stringifyString({comment:n,type:e,value:a},i,r,s)}};SS.binary=pR});var Tl=C(bl=>{"use strict";var yl=le(),Qd=vi(),mR=Qe(),gR=Ei();function kS(n,e){if(yl.isSeq(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!yl.isPair(i)){if(yl.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Qd.Pair(new mR.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
89
89
  ${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
90
- ${s.comment}`:i.comment}i=r}n.items[t]=gl.isPair(i)?i:new Xd.Pair(i)}}else e("Expected a sequence for this tag");return n}function TS(n,e,t){let{replacer:i}=t,r=new uR.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Xd.createPair(a,c,t))}return r}var fR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bS,createNode:TS};yl.createPairs=TS;yl.pairs=fR;yl.resolvePairs=bS});var Zd=C(Jd=>{"use strict";var vS=le(),Qd=mi(),Ys=Si(),dR=ki(),SS=bl(),Hi=class n extends dR.YAMLSeq{constructor(){super(),this.add=Ys.YAMLMap.prototype.add.bind(this),this.delete=Ys.YAMLMap.prototype.delete.bind(this),this.get=Ys.YAMLMap.prototype.get.bind(this),this.has=Ys.YAMLMap.prototype.has.bind(this),this.set=Ys.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let r of this.items){let s,o;if(vS.isPair(r)?(s=Qd.toJS(r.key,"",t),o=Qd.toJS(r.value,s,t)):s=Qd.toJS(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,t,i){let r=SS.createPairs(e,t,i),s=new this;return s.items=r.items,s}};Hi.tag="tag:yaml.org,2002:omap";var hR={collection:"seq",identify:n=>n instanceof Map,nodeClass:Hi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=SS.resolvePairs(n,e),i=[];for(let{key:r}of t.items)vS.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Hi,t)},createNode:(n,e,t)=>Hi.from(n,e,t)};Jd.YAMLOMap=Hi;Jd.omap=hR});var _S=C(eh=>{"use strict";var kS=Qe();function ES({value:n,source:e},t){return e&&(n?wS:NS).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var wS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kS.Scalar(!0),stringify:ES},NS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kS.Scalar(!1),stringify:ES};eh.falseTag=NS;eh.trueTag=wS});var PS=C(Tl=>{"use strict";var pR=Qe(),th=$r(),mR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:th.stringifyNumber},gR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():th.stringifyNumber(n)}},yR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new pR.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:th.stringifyNumber};Tl.float=yR;Tl.floatExp=gR;Tl.floatNaN=mR});var RS=C(zs=>{"use strict";var DS=$r(),Ks=n=>typeof n=="bigint"||Number.isInteger(n);function vl(n,e,t,{intAsBigInt:i}){let r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return r==="-"?BigInt(-1)*o:o}let s=parseInt(n,t);return r==="-"?-1*s:s}function nh(n,e,t){let{value:i}=n;if(Ks(i)){let r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return DS.stringifyNumber(n)}var bR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>vl(n,2,2,t),stringify:n=>nh(n,2,"0b")},TR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>vl(n,1,8,t),stringify:n=>nh(n,8,"0")},vR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>vl(n,0,10,t),stringify:DS.stringifyNumber},SR={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>vl(n,2,16,t),stringify:n=>nh(n,16,"0x")};zs.int=vR;zs.intBin=bR;zs.intHex=SR;zs.intOct=TR});var rh=C(ih=>{"use strict";var El=le(),Sl=Ti(),kl=Si(),Yi=class n extends kl.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;El.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Sl.Pair(e.key,null):t=new Sl.Pair(e,null),kl.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let i=kl.findPair(this.items,e);return!t&&El.isPair(i)?El.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=kl.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new Sl.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),s.items.push(Sl.createPair(o,null,i));return s}};Yi.tag="tag:yaml.org,2002:set";var kR={collection:"map",identify:n=>n instanceof Set,nodeClass:Yi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Yi.from(n,e,t),resolve(n,e){if(El.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Yi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ih.YAMLSet=Yi;ih.set=kR});var oh=C(wl=>{"use strict";var ER=$r();function sh(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*s:s}function CS(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ER.stringifyNumber(n);let i="";e<0&&(i="-",e*=t(-1));let r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var wR={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>sh(n,t),stringify:CS},NR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>sh(n,!1),stringify:CS},OS={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(OS.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=sh(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};wl.floatTime=NR;wl.intTime=wR;wl.timestamp=OS});var LS=C(IS=>{"use strict";var _R=jr(),PR=fl(),DR=Ur(),RR=Hs(),CR=Gd(),AS=_S(),ah=PS(),Nl=RS(),OR=il(),AR=Zd(),IR=bl(),LR=rh(),ch=oh(),xR=[_R.map,DR.seq,RR.string,PR.nullTag,AS.trueTag,AS.falseTag,Nl.intBin,Nl.intOct,Nl.int,Nl.intHex,ah.floatNaN,ah.floatExp,ah.float,CR.binary,OR.merge,AR.omap,IR.pairs,LR.set,ch.intTime,ch.floatTime,ch.timestamp];IS.schema=xR});var VS=C(fh=>{"use strict";var FS=jr(),MR=fl(),BS=Ur(),qR=Hs(),FR=Ud(),lh=Wd(),uh=Hd(),BR=hS(),jR=gS(),jS=Gd(),Gs=il(),US=Zd(),$S=bl(),xS=LS(),WS=rh(),_l=oh(),MS=new Map([["core",BR.schema],["failsafe",[FS.map,BS.seq,qR.string]],["json",jR.schema],["yaml11",xS.schema],["yaml-1.1",xS.schema]]),qS={binary:jS.binary,bool:FR.boolTag,float:lh.float,floatExp:lh.floatExp,floatNaN:lh.floatNaN,floatTime:_l.floatTime,int:uh.int,intHex:uh.intHex,intOct:uh.intOct,intTime:_l.intTime,map:FS.map,merge:Gs.merge,null:MR.nullTag,omap:US.omap,pairs:$S.pairs,seq:BS.seq,set:WS.set,timestamp:_l.timestamp},UR={"tag:yaml.org,2002:binary":jS.binary,"tag:yaml.org,2002:merge":Gs.merge,"tag:yaml.org,2002:omap":US.omap,"tag:yaml.org,2002:pairs":$S.pairs,"tag:yaml.org,2002:set":WS.set,"tag:yaml.org,2002:timestamp":_l.timestamp};function $R(n,e,t){let i=MS.get(e);if(i&&!n)return t&&!i.includes(Gs.merge)?i.concat(Gs.merge):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{let s=Array.from(MS.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(let s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(Gs.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?qS[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(qS).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}fh.coreKnownTags=UR;fh.getTags=$R});var ph=C(HS=>{"use strict";var dh=le(),WR=jr(),VR=Ur(),HR=Hs(),Pl=VS(),YR=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,hh=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Pl.getTags(e,"compat"):e?Pl.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Pl.coreKnownTags:{},this.tags=Pl.getTags(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,dh.MAP,{value:WR.map}),Object.defineProperty(this,dh.SCALAR,{value:HR.string}),Object.defineProperty(this,dh.SEQ,{value:VR.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?YR:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};HS.Schema=hh});var KS=C(YS=>{"use strict";var KR=le(),mh=Us(),Xs=qs();function zR(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let r=mh.createStringifyContext(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=s(n.commentBefore);t.unshift(Xs.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(KR.isNode(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let u=s(n.contents.commentBefore);t.push(Xs.indentComment(u,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=mh.stringify(n.contents,r,()=>a=null,c);a&&(l+=Xs.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(mh.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=s(n.comment);c.includes(`
91
- `)?(t.push("..."),t.push(Xs.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Xs.indentComment(s(c),"")))}return t.join(`
90
+ ${s.comment}`:i.comment}i=r}n.items[t]=yl.isPair(i)?i:new Qd.Pair(i)}}else e("Expected a sequence for this tag");return n}function ES(n,e,t){let{replacer:i}=t,r=new gR.YAMLSeq(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Qd.createPair(a,c,t))}return r}var yR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:kS,createNode:ES};bl.createPairs=ES;bl.pairs=yR;bl.resolvePairs=kS});var eh=C(Zd=>{"use strict";var wS=le(),Jd=gi(),zs=ki(),bR=Ei(),NS=Tl(),Yi=class n extends bR.YAMLSeq{constructor(){super(),this.add=zs.YAMLMap.prototype.add.bind(this),this.delete=zs.YAMLMap.prototype.delete.bind(this),this.get=zs.YAMLMap.prototype.get.bind(this),this.has=zs.YAMLMap.prototype.has.bind(this),this.set=zs.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let r of this.items){let s,o;if(wS.isPair(r)?(s=Jd.toJS(r.key,"",t),o=Jd.toJS(r.value,s,t)):s=Jd.toJS(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,t,i){let r=NS.createPairs(e,t,i),s=new this;return s.items=r.items,s}};Yi.tag="tag:yaml.org,2002:omap";var TR={collection:"seq",identify:n=>n instanceof Map,nodeClass:Yi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=NS.resolvePairs(n,e),i=[];for(let{key:r}of t.items)wS.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Yi,t)},createNode:(n,e,t)=>Yi.from(n,e,t)};Zd.YAMLOMap=Yi;Zd.omap=TR});var CS=C(th=>{"use strict";var _S=Qe();function PS({value:n,source:e},t){return e&&(n?DS:RS).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var DS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _S.Scalar(!0),stringify:PS},RS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _S.Scalar(!1),stringify:PS};th.falseTag=RS;th.trueTag=DS});var OS=C(vl=>{"use strict";var vR=Qe(),nh=Vr(),SR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nh.stringifyNumber},kR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():nh.stringifyNumber(n)}},ER={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new vR.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:nh.stringifyNumber};vl.float=ER;vl.floatExp=kR;vl.floatNaN=SR});var IS=C(Xs=>{"use strict";var AS=Vr(),Gs=n=>typeof n=="bigint"||Number.isInteger(n);function Sl(n,e,t,{intAsBigInt:i}){let r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return r==="-"?BigInt(-1)*o:o}let s=parseInt(n,t);return r==="-"?-1*s:s}function ih(n,e,t){let{value:i}=n;if(Gs(i)){let r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return AS.stringifyNumber(n)}var wR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Sl(n,2,2,t),stringify:n=>ih(n,2,"0b")},NR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Sl(n,1,8,t),stringify:n=>ih(n,8,"0")},_R={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Sl(n,0,10,t),stringify:AS.stringifyNumber},PR={identify:Gs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Sl(n,2,16,t),stringify:n=>ih(n,16,"0x")};Xs.int=_R;Xs.intBin=wR;Xs.intHex=PR;Xs.intOct=NR});var sh=C(rh=>{"use strict";var wl=le(),kl=vi(),El=ki(),Ki=class n extends El.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;wl.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new kl.Pair(e.key,null):t=new kl.Pair(e,null),El.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let i=El.findPair(this.items,e);return!t&&wl.isPair(i)?wl.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=El.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new kl.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),s.items.push(kl.createPair(o,null,i));return s}};Ki.tag="tag:yaml.org,2002:set";var DR={collection:"map",identify:n=>n instanceof Set,nodeClass:Ki,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Ki.from(n,e,t),resolve(n,e){if(wl.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Ki,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};rh.YAMLSet=Ki;rh.set=DR});var ah=C(Nl=>{"use strict";var RR=Vr();function oh(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*s:s}function LS(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return RR.stringifyNumber(n);let i="";e<0&&(i="-",e*=t(-1));let r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var CR={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>oh(n,t),stringify:LS},OR={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>oh(n,!1),stringify:LS},xS={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(xS.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=oh(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Nl.floatTime=OR;Nl.intTime=CR;Nl.timestamp=xS});var FS=C(qS=>{"use strict";var AR=$r(),IR=dl(),LR=Wr(),xR=Ks(),MR=Xd(),MS=CS(),ch=OS(),_l=IS(),qR=rl(),FR=eh(),BR=Tl(),jR=sh(),lh=ah(),UR=[AR.map,LR.seq,xR.string,IR.nullTag,MS.trueTag,MS.falseTag,_l.intBin,_l.intOct,_l.int,_l.intHex,ch.floatNaN,ch.floatExp,ch.float,MR.binary,qR.merge,FR.omap,BR.pairs,jR.set,lh.intTime,lh.floatTime,lh.timestamp];qS.schema=UR});var zS=C(dh=>{"use strict";var $S=$r(),$R=dl(),WS=Wr(),WR=Ks(),VR=$d(),uh=Vd(),fh=Yd(),HR=yS(),YR=vS(),VS=Xd(),Qs=rl(),HS=eh(),YS=Tl(),BS=FS(),KS=sh(),Pl=ah(),jS=new Map([["core",HR.schema],["failsafe",[$S.map,WS.seq,WR.string]],["json",YR.schema],["yaml11",BS.schema],["yaml-1.1",BS.schema]]),US={binary:VS.binary,bool:VR.boolTag,float:uh.float,floatExp:uh.floatExp,floatNaN:uh.floatNaN,floatTime:Pl.floatTime,int:fh.int,intHex:fh.intHex,intOct:fh.intOct,intTime:Pl.intTime,map:$S.map,merge:Qs.merge,null:$R.nullTag,omap:HS.omap,pairs:YS.pairs,seq:WS.seq,set:KS.set,timestamp:Pl.timestamp},KR={"tag:yaml.org,2002:binary":VS.binary,"tag:yaml.org,2002:merge":Qs.merge,"tag:yaml.org,2002:omap":HS.omap,"tag:yaml.org,2002:pairs":YS.pairs,"tag:yaml.org,2002:set":KS.set,"tag:yaml.org,2002:timestamp":Pl.timestamp};function zR(n,e,t){let i=jS.get(e);if(i&&!n)return t&&!i.includes(Qs.merge)?i.concat(Qs.merge):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{let s=Array.from(jS.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(let s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(Qs.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?US[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(US).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}dh.coreKnownTags=KR;dh.getTags=zR});var mh=C(GS=>{"use strict";var hh=le(),GR=$r(),XR=Wr(),QR=Ks(),Dl=zS(),JR=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,ph=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Dl.getTags(e,"compat"):e?Dl.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Dl.coreKnownTags:{},this.tags=Dl.getTags(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,hh.MAP,{value:GR.map}),Object.defineProperty(this,hh.SCALAR,{value:QR.string}),Object.defineProperty(this,hh.SEQ,{value:XR.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?JR:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};GS.Schema=ph});var QS=C(XS=>{"use strict";var ZR=le(),gh=Ws(),Js=Bs();function eC(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let r=gh.createStringifyContext(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=s(n.commentBefore);t.unshift(Js.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(ZR.isNode(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let u=s(n.contents.commentBefore);t.push(Js.indentComment(u,""))}r.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=gh.stringify(n.contents,r,()=>a=null,c);a&&(l+=Js.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(gh.stringify(n.contents,r));if(n.directives?.docEnd)if(n.comment){let c=s(n.comment);c.includes(`
91
+ `)?(t.push("..."),t.push(Js.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Js.indentComment(s(c),"")))}return t.join(`
92
92
  `)+`
93
- `}YS.stringifyDocument=zR});var Qs=C(zS=>{"use strict";var GR=xs(),Wr=zc(),zt=le(),XR=Ti(),QR=mi(),JR=ph(),ZR=KS(),gh=Wc(),eC=vd(),tC=Ms(),yh=Td(),bh=class n{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,zt.NODE_TYPE,{value:zt.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new yh.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(n.prototype,{[zt.NODE_TYPE]:{value:zt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=zt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Vr(this.contents)&&this.contents.add(e)}addIn(e,t){Vr(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let i=gh.anchorNames(this);e.anchor=!t||i.has(t)?gh.findNewAnchor(t||"a",i):t}return new GR.Alias(e.anchor)}createNode(e,t,i){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let w=v=>typeof v=="number"||v instanceof String||v instanceof Number,R=t.filter(w).map(String);R.length>0&&(t=t.concat(R)),r=t}else i===void 0&&t&&(i=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:g}=gh.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:g},b=tC.createNode(e,u,_);return a&&zt.isCollection(b)&&(b.flow=!0),p(),b}createPair(e,t,i={}){let r=this.createNode(e,null,i),s=this.createNode(t,null,i);return new XR.Pair(r,s)}delete(e){return Vr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Wr.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Vr(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return zt.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Wr.isEmptyPath(e)?!t&&zt.isScalar(this.contents)?this.contents.value:this.contents:zt.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return zt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Wr.isEmptyPath(e)?this.contents!==void 0:zt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Wr.collectionFromPath(this.schema,[e],t):Vr(this.contents)&&this.contents.set(e,t)}setIn(e,t){Wr.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Wr.collectionFromPath(this.schema,Array.from(e),t):Vr(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new yh.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new yh.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new JR.Schema(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=QR.toJS(this.contents,t??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?eC.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ZR.stringifyDocument(this,e)}};function Vr(n){if(zt.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}zS.Document=bh});var eo=C(Zs=>{"use strict";var Js=class extends Error{constructor(e,t,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=t}},Th=class extends Js{constructor(e,t,i){super("YAMLParseError",e,t,i)}},vh=class extends Js{constructor(e,t,i){super("YAMLWarning",e,t,i)}},nC=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:i,col:r}=t.linePos[0];t.message+=` at line ${i}, column ${r}`;let s=r-1,o=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let a=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
93
+ `}XS.stringifyDocument=eC});var Zs=C(JS=>{"use strict";var tC=qs(),Hr=Gc(),Gt=le(),nC=vi(),iC=gi(),rC=mh(),sC=QS(),yh=Vc(),oC=Sd(),aC=Fs(),bh=vd(),Th=class n{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gt.NODE_TYPE,{value:Gt.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new bh.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(n.prototype,{[Gt.NODE_TYPE]:{value:Gt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Gt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Yr(this.contents)&&this.contents.add(e)}addIn(e,t){Yr(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let i=yh.anchorNames(this);e.anchor=!t||i.has(t)?yh.findNewAnchor(t||"a",i):t}return new tC.Alias(e.anchor)}createNode(e,t,i){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let w=v=>typeof v=="number"||v instanceof String||v instanceof Number,R=t.filter(w).map(String);R.length>0&&(t=t.concat(R)),r=t}else i===void 0&&t&&(i=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:g}=yh.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:g},b=aC.createNode(e,u,_);return a&&Gt.isCollection(b)&&(b.flow=!0),p(),b}createPair(e,t,i={}){let r=this.createNode(e,null,i),s=this.createNode(t,null,i);return new nC.Pair(r,s)}delete(e){return Yr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Hr.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Yr(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Gt.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Hr.isEmptyPath(e)?!t&&Gt.isScalar(this.contents)?this.contents.value:this.contents:Gt.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Gt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Hr.isEmptyPath(e)?this.contents!==void 0:Gt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Hr.collectionFromPath(this.schema,[e],t):Yr(this.contents)&&this.contents.set(e,t)}setIn(e,t){Hr.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Hr.collectionFromPath(this.schema,Array.from(e),t):Yr(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new bh.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new bh.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new rC.Schema(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=iC.toJS(this.contents,t??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?oC.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return sC.stringifyDocument(this,e)}};function Yr(n){if(Gt.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}JS.Document=Th});var no=C(to=>{"use strict";var eo=class extends Error{constructor(e,t,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=t}},vh=class extends eo{constructor(e,t,i){super("YAMLParseError",e,t,i)}},Sh=class extends eo{constructor(e,t,i){super("YAMLWarning",e,t,i)}},cC=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:i,col:r}=t.linePos[0];t.message+=` at line ${i}, column ${r}`;let s=r-1,o=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let a=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
94
94
  `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-s)));let l=" ".repeat(s)+"^".repeat(a);t.message+=`:
95
95
 
96
96
  ${o}
97
97
  ${l}
98
- `}};Zs.YAMLError=Js;Zs.YAMLParseError=Th;Zs.YAMLWarning=vh;Zs.prettifyError=nC});var to=C(GS=>{"use strict";function iC(n,{flow:e,indicator:t,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",g=!1,_=!1,b=null,w=null,R=null,v=null,T=null,N=null,L=null;for(let j of n)switch(_&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&s(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),b&&(l&&j.type!=="comment"&&j.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),j.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&j.source.includes(" ")&&(b=j),u=!0;break;case"comment":{u||s(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ie=j.source.substring(1)||" ";d?d+=p+ie:d=ie,p="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:p+=j.source,l=!0,g=!0,(w||R)&&(v=j),u=!0;break;case"anchor":w&&s(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&s(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break;case"tag":{R&&s(j,"MULTIPLE_TAGS","A node can have at most one tag"),R=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break}case t:(w||R)&&s(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),N&&s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),N=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){T&&s(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=j,l=!1,u=!1;break}default:s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let q=n[n.length-1],H=q?q.offset+q.source.length:r;return _&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(l&&b.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:N,spaceBefore:c,comment:d,hasNewline:g,anchor:w,tag:R,newlineAfterProp:v,end:H,start:L??H}}GS.resolveProps=iC});var Dl=C(XS=>{"use strict";function Sh(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
99
- `))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Sh(e.key)||Sh(e.value))return!0}return!1;default:return!0}}XS.containsNewline=Sh});var kh=C(QS=>{"use strict";var rC=Dl();function sC(n,e,t){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&rC.containsNewline(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}QS.flowIndentCheck=sC});var Eh=C(ZS=>{"use strict";var JS=le();function oC(n,e,t){let{uniqueKeys:i}=n.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||JS.isScalar(s)&&JS.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,t))}ZS.mapIncludes=oC});var sk=C(rk=>{"use strict";var ek=Ti(),aC=Si(),tk=to(),cC=Dl(),nk=kh(),lC=Eh(),ik="All mapping items must start at the same column";function uC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??aC.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:g,value:_}=u,b=tk.resolveProps(d,{indicator:"explicit-key-ind",next:p??g?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),w=!b.found;if(w){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",ik)),!b.anchor&&!b.tag&&!g){l=b.end,b.comment&&(a.comment?a.comment+=`
100
- `+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||cC.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==i.indent&&r(c,"BAD_INDENT",ik);t.atKey=!0;let R=b.end,v=p?n(t,p,b,r):e(t,R,d,null,b,r);t.schema.compat&&nk.flowIndentCheck(i.indent,p,r),t.atKey=!1,lC.mapIncludes(t,a.items,v)&&r(R,"DUPLICATE_KEY","Map keys must be unique");let T=tk.resolveProps(g??[],{indicator:"map-value-ind",next:_,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=T.end,T.found){w&&(_?.type==="block-map"&&!T.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<T.found.offset-1024&&r(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let N=_?n(t,_,T,r):e(t,c,g,null,T,r);t.schema.compat&&nk.flowIndentCheck(i.indent,_,r),c=N.range[2];let L=new ek.Pair(v,N);t.options.keepSourceTokens&&(L.srcToken=u),a.items.push(L)}else{w&&r(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(v.comment?v.comment+=`
101
- `+T.comment:v.comment=T.comment);let N=new ek.Pair(v);t.options.keepSourceTokens&&(N.srcToken=u),a.items.push(N)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}rk.resolveBlockMap=uC});var ak=C(ok=>{"use strict";var fC=ki(),dC=to(),hC=kh();function pC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??fC.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=dC.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d&&d.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let g=d?n(t,d,p,r):e(t,p.end,u,null,p,r);t.schema.compat&&hC.flowIndentCheck(i.indent,d,r),c=g.range[2],a.items.push(g)}return a.range=[i.offset,c,l??c],a}ok.resolveBlockSeq=pC});var Hr=C(ck=>{"use strict";function mC(n,e,t,i){let r="";if(n){let s=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{t&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}ck.resolveEnd=mC});var dk=C(fk=>{"use strict";var gC=le(),yC=Ti(),lk=Si(),bC=ki(),TC=Hr(),uk=to(),vC=Dl(),SC=Eh(),wh="Block collections are not allowed within flow collections",Nh=n=>n&&(n.type==="block-map"||n.type==="block-seq");function kC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?lk.YAMLMap:bC.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=i.offset+i.start.source.length;for(let w=0;w<i.items.length;++w){let R=i.items[w],{start:v,key:T,sep:N,value:L}=R,q=uk.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:T??N?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!N&&!L){w===0&&q.comma?r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<i.items.length-1&&r(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),q.comment&&(l.comment?l.comment+=`
102
- `+q.comment:l.comment=q.comment),d=q.end;continue}!o&&t.options.strict&&vC.containsNewline(T)&&r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)q.comma&&r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(q.comma||r(q.start,"MISSING_CHAR",`Missing , between ${a} items`),q.comment){let H="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":H=j.source.substring(1);break e;default:break e}if(H){let j=l.items[l.items.length-1];gC.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
103
- `+H:j.comment=H,q.comment=q.comment.substring(H.length+1)}}if(!o&&!N&&!q.found){let H=L?n(t,L,q,r):e(t,q.end,N,null,q,r);l.items.push(H),d=H.range[2],Nh(L)&&r(H.range,"BLOCK_IN_FLOW",wh)}else{t.atKey=!0;let H=q.end,j=T?n(t,T,q,r):e(t,H,v,null,q,r);Nh(T)&&r(j.range,"BLOCK_IN_FLOW",wh),t.atKey=!1;let ie=uk.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:L,offset:j.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(ie.found){if(!o&&!q.found&&t.options.strict){if(N)for(let ce of N){if(ce===ie.found)break;if(ce.type==="newline"){r(ce,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}q.start<ie.found.offset-1024&&r(ie.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source&&L.source[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${a}`):r(ie.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Be=L?n(t,L,ie,r):ie.found?e(t,ie.end,N,null,ie,r):null;Be?Nh(L)&&r(Be.range,"BLOCK_IN_FLOW",wh):ie.comment&&(j.comment?j.comment+=`
104
- `+ie.comment:j.comment=ie.comment);let Et=new yC.Pair(j,Be);if(t.options.keepSourceTokens&&(Et.srcToken=R),o){let ce=l;SC.mapIncludes(t,ce.items,j)&&r(H,"DUPLICATE_KEY","Map keys must be unique"),ce.items.push(Et)}else{let ce=new lk.YAMLMap(t.schema);ce.flow=!0,ce.items.push(Et);let On=(Be??j).range;ce.range=[j.range[0],On[1],On[2]],l.items.push(ce)}d=Be?Be.range[2]:ie.end}}let p=o?"}":"]",[g,..._]=i.end,b=d;if(g&&g.source===p)b=g.offset+g.source.length;else{let w=a[0].toUpperCase()+a.substring(1),R=u?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;r(d,u?"MISSING_CHAR":"BAD_INDENT",R),g&&g.source.length!==1&&_.unshift(g)}if(_.length>0){let w=TC.resolveEnd(_,b,t.options.strict,r);w.comment&&(l.comment?l.comment+=`
105
- `+w.comment:l.comment=w.comment),l.range=[i.offset,b,w.offset]}else l.range=[i.offset,b,b];return l}fk.resolveFlowCollection=kC});var pk=C(hk=>{"use strict";var EC=le(),wC=Qe(),NC=Si(),_C=ki(),PC=sk(),DC=ak(),RC=dk();function _h(n,e,t,i,r,s){let o=t.type==="block-map"?PC.resolveBlockMap(n,e,t,i,s):t.type==="block-seq"?DC.resolveBlockSeq(n,e,t,i,s):RC.resolveFlowCollection(n,e,t,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function CC(n,e,t,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,p=>r(s,"TAG_RESOLVE_FAILED",p)):null;if(t.type==="block-seq"){let{anchor:p,newlineAfterProp:g}=i,_=p&&s?p.offset>s.offset?p:s:p??s;_&&(!g||g.offset<_.offset)&&r(_,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===NC.YAMLMap.tagName&&a==="map"||o===_C.YAMLSeq.tagName&&a==="seq")return _h(n,e,t,r,o);let c=e.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!c){let p=e.schema.knownTags[o];if(p&&p.collection===a)e.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?.collection?r(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),_h(n,e,t,r,o)}let l=_h(n,e,t,r,o,c),u=c.resolve?.(l,p=>r(s,"TAG_RESOLVE_FAILED",p),e.options)??l,d=EC.isNode(u)?u:new wC.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}hk.composeCollection=CC});var Dh=C(mk=>{"use strict";var Ph=Qe();function OC(n,e,t){let i=e.offset,r=AC(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?Ph.Scalar.BLOCK_FOLDED:Ph.Scalar.BLOCK_LITERAL,o=e.source?IC(e.source):[],a=o.length;for(let b=o.length-1;b>=0;--b){let w=o[b][1];if(w===""||w==="\r")a=b;else break}if(a===0){let b=r.chomp==="+"&&o.length>0?`
98
+ `}};to.YAMLError=eo;to.YAMLParseError=vh;to.YAMLWarning=Sh;to.prettifyError=cC});var io=C(ZS=>{"use strict";function lC(n,{flow:e,indicator:t,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",g=!1,_=!1,b=null,w=null,R=null,v=null,T=null,N=null,L=null;for(let j of n)switch(_&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&s(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),b&&(l&&j.type!=="comment"&&j.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),j.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&j.source.includes(" ")&&(b=j),u=!0;break;case"comment":{u||s(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let re=j.source.substring(1)||" ";d?d+=p+re:d=re,p="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:p+=j.source,l=!0,g=!0,(w||R)&&(v=j),u=!0;break;case"anchor":w&&s(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&s(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break;case"tag":{R&&s(j,"MULTIPLE_TAGS","A node can have at most one tag"),R=j,L===null&&(L=j.offset),l=!1,u=!1,_=!0;break}case t:(w||R)&&s(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),N&&s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),N=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){T&&s(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=j,l=!1,u=!1;break}default:s(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let q=n[n.length-1],H=q?q.offset+q.source.length:r;return _&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(l&&b.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:N,spaceBefore:c,comment:d,hasNewline:g,anchor:w,tag:R,newlineAfterProp:v,end:H,start:L??H}}ZS.resolveProps=lC});var Rl=C(ek=>{"use strict";function kh(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
99
+ `))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(kh(e.key)||kh(e.value))return!0}return!1;default:return!0}}ek.containsNewline=kh});var Eh=C(tk=>{"use strict";var uC=Rl();function fC(n,e,t){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&uC.containsNewline(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}tk.flowIndentCheck=fC});var wh=C(ik=>{"use strict";var nk=le();function dC(n,e,t){let{uniqueKeys:i}=n.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||nk.isScalar(s)&&nk.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,t))}ik.mapIncludes=dC});var lk=C(ck=>{"use strict";var rk=vi(),hC=ki(),sk=io(),pC=Rl(),ok=Eh(),mC=wh(),ak="All mapping items must start at the same column";function gC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??hC.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:g,value:_}=u,b=sk.resolveProps(d,{indicator:"explicit-key-ind",next:p??g?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),w=!b.found;if(w){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",ak)),!b.anchor&&!b.tag&&!g){l=b.end,b.comment&&(a.comment?a.comment+=`
100
+ `+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||pC.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==i.indent&&r(c,"BAD_INDENT",ak);t.atKey=!0;let R=b.end,v=p?n(t,p,b,r):e(t,R,d,null,b,r);t.schema.compat&&ok.flowIndentCheck(i.indent,p,r),t.atKey=!1,mC.mapIncludes(t,a.items,v)&&r(R,"DUPLICATE_KEY","Map keys must be unique");let T=sk.resolveProps(g??[],{indicator:"map-value-ind",next:_,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=T.end,T.found){w&&(_?.type==="block-map"&&!T.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<T.found.offset-1024&&r(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let N=_?n(t,_,T,r):e(t,c,g,null,T,r);t.schema.compat&&ok.flowIndentCheck(i.indent,_,r),c=N.range[2];let L=new rk.Pair(v,N);t.options.keepSourceTokens&&(L.srcToken=u),a.items.push(L)}else{w&&r(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(v.comment?v.comment+=`
101
+ `+T.comment:v.comment=T.comment);let N=new rk.Pair(v);t.options.keepSourceTokens&&(N.srcToken=u),a.items.push(N)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}ck.resolveBlockMap=gC});var fk=C(uk=>{"use strict";var yC=Ei(),bC=io(),TC=Eh();function vC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=s?.nodeClass??yC.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=bC.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d&&d.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let g=d?n(t,d,p,r):e(t,p.end,u,null,p,r);t.schema.compat&&TC.flowIndentCheck(i.indent,d,r),c=g.range[2],a.items.push(g)}return a.range=[i.offset,c,l??c],a}uk.resolveBlockSeq=vC});var Kr=C(dk=>{"use strict";function SC(n,e,t,i){let r="";if(n){let s=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{t&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}dk.resolveEnd=SC});var gk=C(mk=>{"use strict";var kC=le(),EC=vi(),hk=ki(),wC=Ei(),NC=Kr(),pk=io(),_C=Rl(),PC=wh(),Nh="Block collections are not allowed within flow collections",_h=n=>n&&(n.type==="block-map"||n.type==="block-seq");function DC({composeNode:n,composeEmptyNode:e},t,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?hk.YAMLMap:wC.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=i.offset+i.start.source.length;for(let w=0;w<i.items.length;++w){let R=i.items[w],{start:v,key:T,sep:N,value:L}=R,q=pk.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:T??N?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!N&&!L){w===0&&q.comma?r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<i.items.length-1&&r(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),q.comment&&(l.comment?l.comment+=`
102
+ `+q.comment:l.comment=q.comment),d=q.end;continue}!o&&t.options.strict&&_C.containsNewline(T)&&r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)q.comma&&r(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(q.comma||r(q.start,"MISSING_CHAR",`Missing , between ${a} items`),q.comment){let H="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":H=j.source.substring(1);break e;default:break e}if(H){let j=l.items[l.items.length-1];kC.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
103
+ `+H:j.comment=H,q.comment=q.comment.substring(H.length+1)}}if(!o&&!N&&!q.found){let H=L?n(t,L,q,r):e(t,q.end,N,null,q,r);l.items.push(H),d=H.range[2],_h(L)&&r(H.range,"BLOCK_IN_FLOW",Nh)}else{t.atKey=!0;let H=q.end,j=T?n(t,T,q,r):e(t,H,v,null,q,r);_h(T)&&r(j.range,"BLOCK_IN_FLOW",Nh),t.atKey=!1;let re=pk.resolveProps(N??[],{flow:a,indicator:"map-value-ind",next:L,offset:j.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(re.found){if(!o&&!q.found&&t.options.strict){if(N)for(let ce of N){if(ce===re.found)break;if(ce.type==="newline"){r(ce,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}q.start<re.found.offset-1024&&r(re.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source&&L.source[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${a}`):r(re.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Be=L?n(t,L,re,r):re.found?e(t,re.end,N,null,re,r):null;Be?_h(L)&&r(Be.range,"BLOCK_IN_FLOW",Nh):re.comment&&(j.comment?j.comment+=`
104
+ `+re.comment:j.comment=re.comment);let Et=new EC.Pair(j,Be);if(t.options.keepSourceTokens&&(Et.srcToken=R),o){let ce=l;PC.mapIncludes(t,ce.items,j)&&r(H,"DUPLICATE_KEY","Map keys must be unique"),ce.items.push(Et)}else{let ce=new hk.YAMLMap(t.schema);ce.flow=!0,ce.items.push(Et);let On=(Be??j).range;ce.range=[j.range[0],On[1],On[2]],l.items.push(ce)}d=Be?Be.range[2]:re.end}}let p=o?"}":"]",[g,..._]=i.end,b=d;if(g&&g.source===p)b=g.offset+g.source.length;else{let w=a[0].toUpperCase()+a.substring(1),R=u?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;r(d,u?"MISSING_CHAR":"BAD_INDENT",R),g&&g.source.length!==1&&_.unshift(g)}if(_.length>0){let w=NC.resolveEnd(_,b,t.options.strict,r);w.comment&&(l.comment?l.comment+=`
105
+ `+w.comment:l.comment=w.comment),l.range=[i.offset,b,w.offset]}else l.range=[i.offset,b,b];return l}mk.resolveFlowCollection=DC});var bk=C(yk=>{"use strict";var RC=le(),CC=Qe(),OC=ki(),AC=Ei(),IC=lk(),LC=fk(),xC=gk();function Ph(n,e,t,i,r,s){let o=t.type==="block-map"?IC.resolveBlockMap(n,e,t,i,s):t.type==="block-seq"?LC.resolveBlockSeq(n,e,t,i,s):xC.resolveFlowCollection(n,e,t,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function MC(n,e,t,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,p=>r(s,"TAG_RESOLVE_FAILED",p)):null;if(t.type==="block-seq"){let{anchor:p,newlineAfterProp:g}=i,_=p&&s?p.offset>s.offset?p:s:p??s;_&&(!g||g.offset<_.offset)&&r(_,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===OC.YAMLMap.tagName&&a==="map"||o===AC.YAMLSeq.tagName&&a==="seq")return Ph(n,e,t,r,o);let c=e.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!c){let p=e.schema.knownTags[o];if(p&&p.collection===a)e.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?.collection?r(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ph(n,e,t,r,o)}let l=Ph(n,e,t,r,o,c),u=c.resolve?.(l,p=>r(s,"TAG_RESOLVE_FAILED",p),e.options)??l,d=RC.isNode(u)?u:new CC.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}yk.composeCollection=MC});var Rh=C(Tk=>{"use strict";var Dh=Qe();function qC(n,e,t){let i=e.offset,r=FC(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?Dh.Scalar.BLOCK_FOLDED:Dh.Scalar.BLOCK_LITERAL,o=e.source?BC(e.source):[],a=o.length;for(let b=o.length-1;b>=0;--b){let w=o[b][1];if(w===""||w==="\r")a=b;else break}if(a===0){let b=r.chomp==="+"&&o.length>0?`
106
106
  `.repeat(Math.max(1,o.length-1)):"",w=i+r.length;return e.source&&(w+=e.source.length),{value:b,type:s,comment:r.comment,range:[i,w,w]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let b=0;b<a;++b){let[w,R]=o[b];if(R===""||R==="\r")r.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&t(l+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=w.length),u=b,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=w.length+R.length+1}for(let b=o.length-1;b>=a;--b)o[b][0].length>c&&(a=b+1);let d="",p="",g=!1;for(let b=0;b<u;++b)d+=o[b][0].slice(c)+`
107
- `;for(let b=u;b<a;++b){let[w,R]=o[b];l+=w.length+R.length+1;let v=R[R.length-1]==="\r";if(v&&(R=R.slice(0,-1)),R&&w.length<c){let N=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(l-R.length-(v?2:1),"BAD_INDENT",N),w=""}s===Ph.Scalar.BLOCK_LITERAL?(d+=p+w.slice(c)+R,p=`
107
+ `;for(let b=u;b<a;++b){let[w,R]=o[b];l+=w.length+R.length+1;let v=R[R.length-1]==="\r";if(v&&(R=R.slice(0,-1)),R&&w.length<c){let N=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(l-R.length-(v?2:1),"BAD_INDENT",N),w=""}s===Dh.Scalar.BLOCK_LITERAL?(d+=p+w.slice(c)+R,p=`
108
108
  `):w.length>c||R[0]===" "?(p===" "?p=`
109
109
  `:!g&&p===`
110
110
  `&&(p=`
@@ -117,70 +117,70 @@ ${l}
117
117
  `+o[b][0].slice(c);d[d.length-1]!==`
118
118
  `&&(d+=`
119
119
  `);break;default:d+=`
120
- `}let _=i+r.length+e.source.length;return{value:d,type:s,comment:r.comment,range:[i,_,_]}}function AC({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let p=1;p<r.length;++p){let g=r[p];if(!a&&(g==="-"||g==="+"))a=g;else{let _=Number(g);!o&&_?o=_:c===-1&&(c=n+p)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",d=r.length;for(let p=1;p<e.length;++p){let g=e[p];switch(g.type){case"space":l=!0;case"newline":d+=g.source.length;break;case"comment":t&&!l&&i(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=g.source.length,u=g.source.substring(1);break;case"error":i(g,"UNEXPECTED_TOKEN",g.message),d+=g.source.length;break;default:{let _=`Unexpected token in block scalar header: ${g.type}`;i(g,"UNEXPECTED_TOKEN",_);let b=g.source;b&&typeof b=="string"&&(d+=b.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function IC(n){let e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),s=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}mk.resolveBlockScalar=OC});var Ch=C(yk=>{"use strict";var Rh=Qe(),LC=Hr();function xC(n,e,t){let{offset:i,type:r,source:s,end:o}=n,a,c,l=(p,g,_)=>t(i+p,g,_);switch(r){case"scalar":a=Rh.Scalar.PLAIN,c=MC(s,l);break;case"single-quoted-scalar":a=Rh.Scalar.QUOTE_SINGLE,c=qC(s,l);break;case"double-quoted-scalar":a=Rh.Scalar.QUOTE_DOUBLE,c=FC(s,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,d=LC.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function MC(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),gk(n)}function qC(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),gk(n.slice(1,-1)).replace(/''/g,"'")}function gk(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
120
+ `}let _=i+r.length+e.source.length;return{value:d,type:s,comment:r.comment,range:[i,_,_]}}function FC({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let p=1;p<r.length;++p){let g=r[p];if(!a&&(g==="-"||g==="+"))a=g;else{let _=Number(g);!o&&_?o=_:c===-1&&(c=n+p)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",d=r.length;for(let p=1;p<e.length;++p){let g=e[p];switch(g.type){case"space":l=!0;case"newline":d+=g.source.length;break;case"comment":t&&!l&&i(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=g.source.length,u=g.source.substring(1);break;case"error":i(g,"UNEXPECTED_TOKEN",g.message),d+=g.source.length;break;default:{let _=`Unexpected token in block scalar header: ${g.type}`;i(g,"UNEXPECTED_TOKEN",_);let b=g.source;b&&typeof b=="string"&&(d+=b.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function BC(n){let e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),s=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}Tk.resolveBlockScalar=qC});var Oh=C(Sk=>{"use strict";var Ch=Qe(),jC=Kr();function UC(n,e,t){let{offset:i,type:r,source:s,end:o}=n,a,c,l=(p,g,_)=>t(i+p,g,_);switch(r){case"scalar":a=Ch.Scalar.PLAIN,c=$C(s,l);break;case"single-quoted-scalar":a=Ch.Scalar.QUOTE_SINGLE,c=WC(s,l);break;case"double-quoted-scalar":a=Ch.Scalar.QUOTE_DOUBLE,c=VC(s,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,d=jC.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function $C(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),vk(n)}function WC(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),vk(n.slice(1,-1)).replace(/''/g,"'")}function vk(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
121
121
  `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
122
122
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(n);if(!i)return n;let r=i[1],s=" ",o=e.lastIndex;for(t.lastIndex=o;i=t.exec(n);)i[1]===""?s===`
123
123
  `?r+=s:s=`
124
- `:(r+=s+i[1],s=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(n),r+s+(i?.[1]??"")}function FC(n,e){let t="";for(let i=1;i<n.length-1;++i){let r=n[i];if(!(r==="\r"&&n[i+1]===`
124
+ `:(r+=s+i[1],s=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(n),r+s+(i?.[1]??"")}function VC(n,e){let t="";for(let i=1;i<n.length-1;++i){let r=n[i];if(!(r==="\r"&&n[i+1]===`
125
125
  `))if(r===`
126
- `){let{fold:s,offset:o}=BC(n,i);t+=s,i=o}else if(r==="\\"){let s=n[++i],o=jC[s];if(o)t+=o;else if(s===`
126
+ `){let{fold:s,offset:o}=HC(n,i);t+=s,i=o}else if(r==="\\"){let s=n[++i],o=YC[s];if(o)t+=o;else if(s===`
127
127
  `)for(s=n[i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="\r"&&n[i+1]===`
128
- `)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];t+=UC(n,i+1,a,e),i+=a}else{let a=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r===" "){let s=i,o=n[i+1];for(;o===" "||o===" ";)o=n[++i+1];o!==`
128
+ `)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];t+=KC(n,i+1,a,e),i+=a}else{let a=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r===" "){let s=i,o=n[i+1];for(;o===" "||o===" ";)o=n[++i+1];o!==`
129
129
  `&&!(o==="\r"&&n[i+2]===`
130
- `)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function BC(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
130
+ `)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function HC(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
131
131
  `||i==="\r")&&!(i==="\r"&&n[e+2]!==`
132
132
  `);)i===`
133
133
  `&&(t+=`
134
- `),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}var jC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
135
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function UC(n,e,t,i){let r=n.substr(e,t),o=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}yk.resolveFlowScalar=xC});var vk=C(Tk=>{"use strict";var Ki=le(),bk=Qe(),$C=Dh(),WC=Ch();function VC(n,e,t,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?$C.resolveBlockScalar(n,e,i):WC.resolveFlowScalar(e,n.options.strict,i),c=t?n.directives.tagName(t.source,d=>i(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[Ki.SCALAR]:c?l=HC(n.schema,r,c,t,i):e.type==="scalar"?l=YC(n,r,e,i):l=n.schema[Ki.SCALAR];let u;try{let d=l.resolve(r,p=>i(t??e,"TAG_RESOLVE_FAILED",p),n.options);u=Ki.isScalar(d)?d:new bk.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(t??e,"TAG_RESOLVE_FAILED",p),u=new bk.Scalar(r)}return u.range=a,u.source=r,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function HC(n,e,t,i,r){if(t==="!")return n[Ki.SCALAR];let s=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[Ki.SCALAR])}function YC({atKey:n,directives:e,schema:t},i,r,s){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(i))||t[Ki.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(i))??t[Ki.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}Tk.composeScalar=VC});var kk=C(Sk=>{"use strict";function KC(n,e,t){if(e){t===null&&(t=e.length);for(let i=t-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++i];r?.type==="space";)n+=r.source.length,r=e[++i];break}}return n}Sk.emptyScalarPosition=KC});var Nk=C(Ah=>{"use strict";var zC=xs(),GC=le(),XC=pk(),Ek=vk(),QC=Hr(),JC=kk(),ZC={composeNode:wk,composeEmptyNode:Oh};function wk(n,e,t,i){let r=n.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=eO(n,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Ek.composeScalar(n,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=XC.composeCollection(ZC,n,e,t,i),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",d),l=Oh(n,e.offset,void 0,null,t,i),u=!1}}return a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!GC.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Oh(n,e,t,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:JC.emptyScalarPosition(e,t,i),indent:-1,source:""},d=Ek.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function eO({options:n},{offset:e,source:t,end:i},r){let s=new zC.Alias(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=QC.resolveEnd(i,o,n.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Ah.composeEmptyNode=Oh;Ah.composeNode=wk});var Dk=C(Pk=>{"use strict";var tO=Qs(),_k=Nk(),nO=Hr(),iO=to();function rO(n,e,{offset:t,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},n),c=new tO.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=iO.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?_k.composeNode(l,r,u,o):_k.composeEmptyNode(l,u.end,i,null,u,o);let d=c.contents.range[2],p=nO.resolveEnd(s,d,!1,o);return p.comment&&(c.comment=p.comment),c.range=[t,d,p.offset],c}Pk.composeDoc=rO});var Lh=C(Ok=>{"use strict";var sO=Td(),oO=Qs(),no=eo(),Rk=le(),aO=Dk(),cO=Hr();function io(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Ck(n){let e="",t=!1,i=!1;for(let r=0;r<n.length;++r){let s=n[r];switch(s[0]){case"#":e+=(e===""?"":i?`
134
+ `),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}var YC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
135
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function KC(n,e,t,i){let r=n.substr(e,t),o=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Sk.resolveFlowScalar=UC});var wk=C(Ek=>{"use strict";var zi=le(),kk=Qe(),zC=Rh(),GC=Oh();function XC(n,e,t,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?zC.resolveBlockScalar(n,e,i):GC.resolveFlowScalar(e,n.options.strict,i),c=t?n.directives.tagName(t.source,d=>i(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[zi.SCALAR]:c?l=QC(n.schema,r,c,t,i):e.type==="scalar"?l=JC(n,r,e,i):l=n.schema[zi.SCALAR];let u;try{let d=l.resolve(r,p=>i(t??e,"TAG_RESOLVE_FAILED",p),n.options);u=zi.isScalar(d)?d:new kk.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(t??e,"TAG_RESOLVE_FAILED",p),u=new kk.Scalar(r)}return u.range=a,u.source=r,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function QC(n,e,t,i,r){if(t==="!")return n[zi.SCALAR];let s=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[zi.SCALAR])}function JC({atKey:n,directives:e,schema:t},i,r,s){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(i))||t[zi.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(i))??t[zi.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}Ek.composeScalar=XC});var _k=C(Nk=>{"use strict";function ZC(n,e,t){if(e){t===null&&(t=e.length);for(let i=t-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++i];r?.type==="space";)n+=r.source.length,r=e[++i];break}}return n}Nk.emptyScalarPosition=ZC});var Rk=C(Ih=>{"use strict";var eO=qs(),tO=le(),nO=bk(),Pk=wk(),iO=Kr(),rO=_k(),sO={composeNode:Dk,composeEmptyNode:Ah};function Dk(n,e,t,i){let r=n.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=oO(n,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Pk.composeScalar(n,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=nO.composeCollection(sO,n,e,t,i),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",d),l=Ah(n,e.offset,void 0,null,t,i),u=!1}}return a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!tO.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Ah(n,e,t,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:rO.emptyScalarPosition(e,t,i),indent:-1,source:""},d=Pk.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function oO({options:n},{offset:e,source:t,end:i},r){let s=new eO.Alias(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=iO.resolveEnd(i,o,n.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Ih.composeEmptyNode=Ah;Ih.composeNode=Dk});var Ak=C(Ok=>{"use strict";var aO=Zs(),Ck=Rk(),cO=Kr(),lO=io();function uO(n,e,{offset:t,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},n),c=new aO.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=lO.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Ck.composeNode(l,r,u,o):Ck.composeEmptyNode(l,u.end,i,null,u,o);let d=c.contents.range[2],p=cO.resolveEnd(s,d,!1,o);return p.comment&&(c.comment=p.comment),c.range=[t,d,p.offset],c}Ok.composeDoc=uO});var xh=C(xk=>{"use strict";var fO=vd(),dO=Zs(),ro=no(),Ik=le(),hO=Ak(),pO=Kr();function so(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Lk(n){let e="",t=!1,i=!1;for(let r=0;r<n.length;++r){let s=n[r];switch(s[0]){case"#":e+=(e===""?"":i?`
136
136
 
137
137
  `:`
138
- `)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}var Ih=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{let o=io(t);s?this.warnings.push(new no.YAMLWarning(o,i,r)):this.errors.push(new no.YAMLParseError(o,i,r))},this.directives=new sO.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:i,afterEmptyLine:r}=Ck(this.prelude);if(i){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
139
- ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Rk.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Rk.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
138
+ `)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}var Lh=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{let o=so(t);s?this.warnings.push(new ro.YAMLWarning(o,i,r)):this.errors.push(new ro.YAMLParseError(o,i,r))},this.directives=new fO.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:i,afterEmptyLine:r}=Lk(this.prelude);if(i){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
139
+ ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Ik.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ik.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
140
140
  ${a}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
141
- ${o}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ck(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{let s=io(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=aO.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let t=cO.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
142
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new no.YAMLParseError(io(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new oO.Document(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};Ok.Composer=Ih});var Lk=C(Rl=>{"use strict";var lO=Dh(),uO=Ch(),fO=eo(),Ak=js();function dO(n,e=!0,t){if(n){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(a,s,o);else throw new fO.YAMLParseError([a,a+1],s,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uO.resolveFlowScalar(n,e,i);case"block-scalar":return lO.resolveBlockScalar({options:{strict:e}},n,i)}}return null}function hO(n,e){let{implicitKey:t=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Ak.stringifyString({type:o,value:n},{implicitKey:t,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
141
+ ${o}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Lk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{let s=so(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=hO.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new ro.YAMLParseError(so(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new ro.YAMLParseError(so(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let t=pO.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
142
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ro.YAMLParseError(so(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new dO.Document(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};xk.Composer=Lh});var Fk=C(Cl=>{"use strict";var mO=Rh(),gO=Oh(),yO=no(),Mk=$s();function bO(n,e=!0,t){if(n){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(a,s,o);else throw new yO.YAMLParseError([a,a+1],s,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return gO.resolveFlowScalar(n,e,i);case"block-scalar":return mO.resolveBlockScalar({options:{strict:e}},n,i)}}return null}function TO(n,e){let{implicitKey:t=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Mk.stringifyString({type:o,value:n},{implicitKey:t,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
143
143
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
144
144
  `),u=a.substring(0,l),d=a.substring(l+1)+`
145
- `,p=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return Ik(p,c)||p.push({type:"newline",offset:-1,indent:i,source:`
146
- `}),{type:"block-scalar",offset:s,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function pO(n,e,t={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=t,a="indent"in n?n.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Ak.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":mO(n,c);break;case'"':xh(n,c,"double-quoted-scalar");break;case"'":xh(n,c,"single-quoted-scalar");break;default:xh(n,c,"scalar")}}function mO(n,e){let t=e.indexOf(`
145
+ `,p=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return qk(p,c)||p.push({type:"newline",offset:-1,indent:i,source:`
146
+ `}),{type:"block-scalar",offset:s,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function vO(n,e,t={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=t,a="indent"in n?n.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Mk.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":SO(n,c);break;case'"':Mh(n,c,"double-quoted-scalar");break;case"'":Mh(n,c,"single-quoted-scalar");break;default:Mh(n,c,"scalar")}}function SO(n,e){let t=e.indexOf(`
147
147
  `),i=e.substring(0,t),r=e.substring(t+1)+`
148
- `;if(n.type==="block-scalar"){let s=n.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,n.source=r}else{let{offset:s}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];Ik(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
149
- `});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:r})}}function Ik(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function xh(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let i=n.props.slice(1),r=e.length;n.props[0].type==="block-scalar-header"&&(r-=n.props[0].source.length);for(let s of i)s.offset+=r;delete n.props,Object.assign(n,{type:t,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
150
- `};delete n.items,Object.assign(n,{type:t,source:e,end:[r]});break}default:{let i="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:t,indent:i,source:e,end:r})}}}Rl.createScalarToken=hO;Rl.resolveAsScalar=dO;Rl.setScalarValue=pO});var Mk=C(xk=>{"use strict";var gO=n=>"type"in n?Ol(n):Cl(n);function Ol(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Ol(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Cl(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Cl(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Cl(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Cl({start:n,key:e,sep:t,value:i}){let r="";for(let s of n)r+=s.source;if(e&&(r+=Ol(e)),t)for(let s of t)r+=s.source;return i&&(r+=Ol(i)),r}xk.stringify=gO});var jk=C(Bk=>{"use strict";var Mh=Symbol("break visit"),yO=Symbol("skip children"),qk=Symbol("remove item");function zi(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Fk(Object.freeze([]),n,e)}zi.BREAK=Mh;zi.SKIP=yO;zi.REMOVE=qk;zi.itemAtPath=(n,e)=>{let t=n;for(let[i,r]of e){let s=t?.[i];if(s&&"items"in s)t=s.items[r];else return}return t};zi.parentCollection=(n,e)=>{let t=zi.itemAtPath(n,e.slice(0,-1)),i=e[e.length-1][0],r=t?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Fk(n,e,t){let i=t(e,n);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Fk(Object.freeze(n.concat([[r,o]])),s.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Mh)return Mh;a===qk&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,n))}}return typeof i=="function"?i(e,n):i}Bk.visit=zi});var Al=C(It=>{"use strict";var qh=Lk(),bO=Mk(),TO=jk(),Fh="\uFEFF",Bh="",jh="",Uh="",vO=n=>!!n&&"items"in n,SO=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function kO(n){switch(n){case Fh:return"<BOM>";case Bh:return"<DOC>";case jh:return"<FLOW_END>";case Uh:return"<SCALAR>";default:return JSON.stringify(n)}}function EO(n){switch(n){case Fh:return"byte-order-mark";case Bh:return"doc-mode";case jh:return"flow-error-end";case Uh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
148
+ `;if(n.type==="block-scalar"){let s=n.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,n.source=r}else{let{offset:s}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];qk(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
149
+ `});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:r})}}function qk(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Mh(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let i=n.props.slice(1),r=e.length;n.props[0].type==="block-scalar-header"&&(r-=n.props[0].source.length);for(let s of i)s.offset+=r;delete n.props,Object.assign(n,{type:t,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
150
+ `};delete n.items,Object.assign(n,{type:t,source:e,end:[r]});break}default:{let i="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:t,indent:i,source:e,end:r})}}}Cl.createScalarToken=TO;Cl.resolveAsScalar=bO;Cl.setScalarValue=vO});var jk=C(Bk=>{"use strict";var kO=n=>"type"in n?Al(n):Ol(n);function Al(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Al(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Ol(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Ol(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Ol(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Ol({start:n,key:e,sep:t,value:i}){let r="";for(let s of n)r+=s.source;if(e&&(r+=Al(e)),t)for(let s of t)r+=s.source;return i&&(r+=Al(i)),r}Bk.stringify=kO});var Vk=C(Wk=>{"use strict";var qh=Symbol("break visit"),EO=Symbol("skip children"),Uk=Symbol("remove item");function Gi(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),$k(Object.freeze([]),n,e)}Gi.BREAK=qh;Gi.SKIP=EO;Gi.REMOVE=Uk;Gi.itemAtPath=(n,e)=>{let t=n;for(let[i,r]of e){let s=t?.[i];if(s&&"items"in s)t=s.items[r];else return}return t};Gi.parentCollection=(n,e)=>{let t=Gi.itemAtPath(n,e.slice(0,-1)),i=e[e.length-1][0],r=t?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function $k(n,e,t){let i=t(e,n);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=$k(Object.freeze(n.concat([[r,o]])),s.items[o],t);if(typeof a=="number")o=a-1;else{if(a===qh)return qh;a===Uk&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,n))}}return typeof i=="function"?i(e,n):i}Wk.visit=Gi});var Il=C(It=>{"use strict";var Fh=Fk(),wO=jk(),NO=Vk(),Bh="\uFEFF",jh="",Uh="",$h="",_O=n=>!!n&&"items"in n,PO=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function DO(n){switch(n){case Bh:return"<BOM>";case jh:return"<DOC>";case Uh:return"<FLOW_END>";case $h:return"<SCALAR>";default:return JSON.stringify(n)}}function RO(n){switch(n){case Bh:return"byte-order-mark";case jh:return"doc-mode";case Uh:return"flow-error-end";case $h:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
151
151
  `:case`\r
152
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}It.createScalarToken=qh.createScalarToken;It.resolveAsScalar=qh.resolveAsScalar;It.setScalarValue=qh.setScalarValue;It.stringify=bO.stringify;It.visit=TO.visit;It.BOM=Fh;It.DOCUMENT=Bh;It.FLOW_END=jh;It.SCALAR=Uh;It.isCollection=vO;It.isScalar=SO;It.prettyToken=kO;It.tokenType=EO});var Vh=C($k=>{"use strict";var ro=Al();function ln(n){switch(n){case void 0:case" ":case`
153
- `:case"\r":case" ":return!0;default:return!1}}var Uk=new Set("0123456789ABCDEFabcdef"),wO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Il=new Set(",[]{}"),NO=new Set(` ,[]{}
154
- \r `),$h=n=>!n||NO.has(n),Wh=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
152
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}It.createScalarToken=Fh.createScalarToken;It.resolveAsScalar=Fh.resolveAsScalar;It.setScalarValue=Fh.setScalarValue;It.stringify=wO.stringify;It.visit=NO.visit;It.BOM=Bh;It.DOCUMENT=jh;It.FLOW_END=Uh;It.SCALAR=$h;It.isCollection=_O;It.isScalar=PO;It.prettyToken=DO;It.tokenType=RO});var Hh=C(Yk=>{"use strict";var oo=Il();function un(n){switch(n){case void 0:case" ":case`
153
+ `:case"\r":case" ":return!0;default:return!1}}var Hk=new Set("0123456789ABCDEFabcdef"),CO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ll=new Set(",[]{}"),OO=new Set(` ,[]{}
154
+ \r `),Wh=n=>!n||OO.has(n),Vh=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
155
155
  `?!0:t==="\r"?this.buffer[e+1]===`
156
156
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let i=0;for(;t===" ";)t=this.buffer[++i+e];if(t==="\r"){let r=this.buffer[i+e+1];if(r===`
157
157
  `||!r&&!this.atEnd)return e+i+1}return t===`
158
- `||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ln(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
159
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ro.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[t-1];if(s===" "||s===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ro.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&ln(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ln(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ln(t)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($h),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ln(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield ro.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil($h),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ln(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}let i=this.buffer.substring(0,t),r=i.indexOf(`
158
+ `||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&un(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
159
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===oo.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[t-1];if(s===" "||s===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield oo.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&un(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!un(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&un(t)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Wh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&un(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield oo.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Wh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||un(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}let i=this.buffer.substring(0,t),r=i.indexOf(`
160
160
  `,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
161
- `,s)}r!==-1&&(t=r-(i[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>ln(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":t+=1;break;case`
161
+ `,s)}r!==-1&&(t=r-(i[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>un(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":t+=1;break;case`
162
162
  `:e=s,t=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
163
163
  `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
164
164
  `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
165
165
  `;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
166
- `&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield ro.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ln(s)||e&&Il.has(s))break;t=i}else if(ln(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
166
+ `&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield oo.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(un(s)||e&&Ll.has(s))break;t=i}else if(un(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
167
167
  `?(i+=1,r=`
168
- `,s=this.buffer[i+1]):t=i),s==="#"||e&&Il.has(s))break;if(r===`
169
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Il.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield ro.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($h))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(ln(t)||e&&Il.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!ln(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(wO.has(t))t=this.buffer[++e];else if(t==="%"&&Uk.has(this.buffer[e+1])&&Uk.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
168
+ `,s=this.buffer[i+1]):t=i),s==="#"||e&&Ll.has(s))break;if(r===`
169
+ `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Ll.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield oo.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Wh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(un(t)||e&&Ll.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!un(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(CO.has(t))t=this.buffer[++e];else if(t==="%"&&Hk.has(this.buffer[e+1])&&Hk.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
170
170
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
171
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};$k.Lexer=Wh});var Yh=C(Wk=>{"use strict";var Hh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){let s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Wk.LineCounter=Hh});var zh=C(zk=>{"use strict";var Vk=Al(),_O=Vh();function Gi(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Hk(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Kk(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ll(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Yr(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Yk(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!Gi(e.start,"explicit-key-ind")&&!Gi(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Kk(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Kh=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new _O.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,t))yield*this.next(i);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",Vk.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Vk.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Yk(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Hk(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Hk(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Ll(this.peek(2)),i=Yr(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
171
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Yk.Lexer=Vh});var Kh=C(Kk=>{"use strict";var Yh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){let s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Kk.LineCounter=Yh});var Gh=C(Jk=>{"use strict";var zk=Il(),AO=Hh();function Xi(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Gk(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Qk(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function xl(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function zr(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Xk(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!Xi(e.start,"explicit-key-ind")&&!Xi(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Qk(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var zh=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new AO.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,t))yield*this.next(i);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",zk.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=zk.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Xk(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Gk(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Gk(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=xl(this.peek(2)),i=zr(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
172
172
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
173
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Gi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Kk(t.key)&&!Gi(t.sep,"newline")){let o=Yr(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(Gi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Yr(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Gi(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||t.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){i&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Gi(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i&&i.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Ll(i),s=Yr(r);Yk(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
173
+ `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Xi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Qk(t.key)&&!Xi(t.sep,"newline")){let o=zr(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(Xi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=zr(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Xi(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||t.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){i&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Xi(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i&&i.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=xl(i),s=zr(r);Xk(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
174
174
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
175
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ll(e),i=Yr(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ll(e),i=Yr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};zk.Parser=Kh});var Zk=C(oo=>{"use strict";var Gk=Lh(),PO=Qs(),so=eo(),DO=Ad(),RO=le(),CO=Yh(),Xk=zh();function Qk(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new CO.LineCounter||null,prettyErrors:e}}function OO(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=Array.from(s.compose(r.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(so.prettifyError(n,t)),a.warnings.forEach(so.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Jk(n,e={}){let{lineCounter:t,prettyErrors:i}=Qk(e),r=new Xk.Parser(t?.addNewLine),s=new Gk.Composer(e),o=null;for(let a of s.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new so.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(so.prettifyError(n,t)),o.warnings.forEach(so.prettifyError(n,t))),o}function AO(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=Jk(n,t);if(!r)return null;if(r.warnings.forEach(s=>DO.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function IO(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return RO.isDocument(n)&&!i?n.toString(t):new PO.Document(n,i,t).toString(t)}oo.parse=AO;oo.parseAllDocuments=OO;oo.parseDocument=Jk;oo.stringify=IO});var tE=C(be=>{"use strict";var LO=Lh(),xO=Qs(),MO=ph(),Gh=eo(),qO=xs(),Ei=le(),FO=Ti(),BO=Qe(),jO=Si(),UO=ki(),$O=Al(),WO=Vh(),VO=Yh(),HO=zh(),xl=Zk(),eE=Os();be.Composer=LO.Composer;be.Document=xO.Document;be.Schema=MO.Schema;be.YAMLError=Gh.YAMLError;be.YAMLParseError=Gh.YAMLParseError;be.YAMLWarning=Gh.YAMLWarning;be.Alias=qO.Alias;be.isAlias=Ei.isAlias;be.isCollection=Ei.isCollection;be.isDocument=Ei.isDocument;be.isMap=Ei.isMap;be.isNode=Ei.isNode;be.isPair=Ei.isPair;be.isScalar=Ei.isScalar;be.isSeq=Ei.isSeq;be.Pair=FO.Pair;be.Scalar=BO.Scalar;be.YAMLMap=jO.YAMLMap;be.YAMLSeq=UO.YAMLSeq;be.CST=$O;be.Lexer=WO.Lexer;be.LineCounter=VO.LineCounter;be.Parser=HO.Parser;be.parse=xl.parse;be.parseAllDocuments=xl.parseAllDocuments;be.parseDocument=xl.parseDocument;be.stringify=xl.stringify;be.visit=eE.visit;be.visitAsync=eE.visitAsync});var oE=C((q$,sE)=>{"use strict";sE.exports=iE;function iE(n,e,t){n instanceof RegExp&&(n=nE(n,t)),e instanceof RegExp&&(e=nE(e,t));var i=rE(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function nE(n,e){var t=e.match(n);return t?t[0]:null}iE.range=rE;function rE(n,e,t){var i,r,s,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],s=t.length;u>=0&&!a;)u==c?(i.push(u),c=t.indexOf(n,u+1)):i.length==1?a=[i.pop(),l]:(r=i.pop(),r<s&&(s=r,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}});var pE=C((F$,hE)=>{var aE=oE();hE.exports=zO;var cE="\0SLASH"+Math.random()+"\0",lE="\0OPEN"+Math.random()+"\0",Qh="\0CLOSE"+Math.random()+"\0",uE="\0COMMA"+Math.random()+"\0",fE="\0PERIOD"+Math.random()+"\0";function Xh(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function YO(n){return n.split("\\\\").join(cE).split("\\{").join(lE).split("\\}").join(Qh).split("\\,").join(uE).split("\\.").join(fE)}function KO(n){return n.split(cE).join("\\").split(lE).join("{").split(Qh).join("}").split(uE).join(",").split(fE).join(".")}function dE(n){if(!n)return[""];var e=[],t=aE("{","}",n);if(!t)return n.split(",");var i=t.pre,r=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+r+"}";var a=dE(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function zO(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),ao(YO(n),!0).map(KO)):[]}function GO(n){return"{"+n+"}"}function XO(n){return/^-?0\d/.test(n)}function QO(n,e){return n<=e}function JO(n,e){return n>=e}function ao(n,e){var t=[],i=aE("{","}",n);if(!i)return[n];var r=i.pre,s=i.post.length?ao(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o<s.length;o++){var a=r+"{"+i.body+"}"+s[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+Qh+i.post,ao(n)):[n];var p;if(u)p=i.body.split(/\.\./);else if(p=dE(i.body),p.length===1&&(p=ao(p[0],!1).map(GO),p.length===1))return s.map(function(Be){return i.pre+p[0]+Be});var g;if(u){var _=Xh(p[0]),b=Xh(p[1]),w=Math.max(p[0].length,p[1].length),R=p.length==3?Math.abs(Xh(p[2])):1,v=QO,T=b<_;T&&(R*=-1,v=JO);var N=p.some(XO);g=[];for(var L=_;v(L,b);L+=R){var q;if(l)q=String.fromCharCode(L),q==="\\"&&(q="");else if(q=String(L),N){var H=w-q.length;if(H>0){var j=new Array(H+1).join("0");L<0?q="-"+j+q.slice(1):q=j+q}}g.push(q)}}else{g=[];for(var ie=0;ie<p.length;ie++)g.push.apply(g,ao(p[ie],!1))}for(var ie=0;ie<g.length;ie++)for(var o=0;o<s.length;o++){var a=r+g[ie]+s[o];(!e||u||a)&&t.push(a)}}return t}});var Se=G(Xb());var sc=class n{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(n.isIncremental(i)){let r=Jb(i.range),s=this.offsetAt(r.start),o=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(o,this._content.length);let a=Math.max(r.start.line,0),c=Math.max(r.end.line,0),l=this._lineOffsets,u=Qb(i.text,!1,s);if(c-a===u.length)for(let p=0,g=u.length;p<g;p++)l[p+a+1]=u[p];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=i.text.length-(o-s);if(d!==0)for(let p=a+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+d}else if(n.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Qb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},oc;(function(n){function e(r,s,o,a){return new sc(r,s,o,a)}n.create=e;function t(r,s,o){if(r instanceof sc)return r.update(s,o),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function i(r,s){let o=r.getText(),a=sd(s.map(W_),(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=0,l=[];for(let u of a){let d=r.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=r.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=i})(oc||(oc={}));function sd(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);sd(i,e),sd(r,e);let s=0,o=0,a=0;for(;s<i.length&&o<r.length;)e(i[s],r[o])<=0?n[a++]=i[s++]:n[a++]=r[o++];for(;s<i.length;)n[a++]=i[s++];for(;o<r.length;)n[a++]=r[o++];return n}function Qb(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function Jb(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function W_(n){let e=Jb(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var ac=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],cc=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Zb=G(Q());var ne=n=>({start:{line:n.tokenIndexes?.start?.pos.line??0,character:n.tokenIndexes?.start?.pos.col??0},end:{line:n.tokenIndexes?.end?.pos.line??0,character:(n.tokenIndexes?.end?.pos.col??0)+(n.tokenIndexes?.end?.pos.len??0)}}),eT=" ",tT=n=>{eT=n},od=()=>eT,ri=n=>ac.findIndex(e=>e===n),si=n=>cc.findIndex(e=>e===n),bn=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),nT=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),iT=(n,e,t)=>{if(!n)return!1;let r=n.filter(s=>s.pos.line===t.line).at(-1);return r&&r.pos.col>=t.character?!1:e.tokenIndexes?.end===r};var Tn=(n,e,t)=>{let i=n,r=n;for(;r;)i=r,r=[...i.children].reverse().find(s=>bn(s,e,t));return i},A=(n,e,t=Zb.DiagnosticSeverity.Error,i=[],r=void 0,s=[],o)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:i,tags:r,templateStrings:s,edit:o}),rT=n=>[...n].sort((t,i)=>{if(t.sortKey===void 0||i.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==i.sortKey)return t.sortKey-i.sortKey;if(!t.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function ft(n,e,t,i){let r=n.textDocument.uri.replace("file://",""),s=await Pr(e,r,i);if(!s)return[];console.time("search");let a=(await s.context.getRuntime()).getDeepestAstNode(r,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===r?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function z(n,e){return{start:n,end:e??n}}var M=(n,e)=>n?.tokens.some(t=>t===e),Je=n=>e=>e?.value&&n===e.value?"yes":V_(n)(e),we=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",V_=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Fn=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,Bn=(n,e)=>!!n&&!!e&&Fn(n,e)&&n.pos.col+n.pos.len===e.pos.col,lc=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),Pr=async(n,e,t)=>(await lc(n)).sort(r=>r.context.name===t?-1:0).find(r=>r.files.some(s=>s===e)),sT=async(n,e)=>(await lc(n)).filter(i=>i.files.some(r=>r===e));var Dr=G(Q()),$=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(i=>i.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=ne(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(i=>i.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=ne(this);return[{location:Dr.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Dr.SymbolKind.File||t.kind===Dr.SymbolKind.Class||t.kind===Dr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(ri(this.semanticTokenType),si(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Rr=G(Q());var uT=G(Q());var oT=G(Q()),Tt=class extends ${constructor(t,i){super(i);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:oT.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}};var aT=G(Q()),Ke=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:aT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}};var cT=G(Q());var vn=class extends ${},_s=class extends vn{constructor(t,i){super();this.expression=t;this.join=i;this.addChild(t),i&&(this.addChild(i.operator),this.addChild(i.expression))}addExpression(t,i){this.addChild(t),this.addChild(i)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var vt=class extends vn{constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:cT.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}};var lT=G(Q()),oi=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:lT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}};var Pe=class extends ${constructor(t,i){super(i);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Me=class extends ${constructor(t,i=[]){super();this.propertyName=t;this.labels=i;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:uT.SymbolKind.Property},this.labels.forEach(r=>this.addChild(r)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Tt?t.value.value:t.value instanceof Ke?t.value.values.map(i=>i.value instanceof vt?i.value.value:NaN):t.value instanceof oi?t.value.values.map(i=>i.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var fT=G(Q()),Sn=class extends ${constructor(t,i){super();this.keyword=i;this.addChild(i),this.docSymbolsMeta={name:t,kind:fT.SymbolKind.Function}}};var Kt=class extends Sn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ae=class extends Sn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var De=class n extends ${constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof qt)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof Kt)}addNodeChild(e){this.addChild(e)}},qt=class extends De{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Rr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Me)}get deleteProperties(){return this.children.filter(e=>e instanceof Ae)}get nodes(){return this.children.filter(e=>e instanceof he)}get pathName(){return"/"}},rt=class extends De{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},t.forEach(i=>{super.addChild(i)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof he)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},he=class n extends De{constructor(t=[],i){super();this.labels=t;this.omitIfNoRef=i;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},i&&this.addChild(i),t.forEach(r=>{this.addChild(r)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},Te=class extends ${constructor(t,i,r){super(i);this.name=t;this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}toString(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let i={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};if(t(ri("type"),si("declaration"),{start:i,end:i}),this.address!==void 0){let r={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.tokenIndexes.start.pos.col+this.name.length+1,len:this.tokenIndexes.start.pos.len-this.name.length-1}},s={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.name.length+2,len:1}};t(ri("decorator"),si("declaration"),{start:s,end:s}),t(ri("number"),si("declaration"),{start:r,end:r})}}};var dT=G(Q()),pe=class extends ${constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:dT.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}};var En=G(Q());var Ze=n=>n instanceof Sn?!0:n instanceof De?!1:n.parentNode?Ze(n.parentNode):!1;var uc=n=>[...n.filter(t=>t instanceof he||t instanceof rt).map(t=>t instanceof he?t.name:t.labelReference)].filter(t=>!!t);var et=G(Q());var hT=G(Q());var jn=class extends ${constructor(){super();this._pathParts=[]}addPath(t,i){this._pathParts.push(t),i&&this.addChild(i),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},sn=class extends ${constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:hT.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}};var Fe=G(Q());var fc=G(Q());var pT=require("path"),ai=class extends ${constructor(t,i){super();this.keyword=t;this.path=i;this.docSymbolsMeta={name:`Include ${i}`,kind:fc.SymbolKind.File},this.addChild(t),this.addChild(i)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:fc.SymbolKind.File},this._reolvedPath=t}},dc=class extends ${constructor(t,i,r){super(r);this._path=t;this.relative=i;this.docSymbolsMeta={name:(0,pT.basename)(this.path),kind:fc.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var kn=class extends ${constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var H_=async(n,e,t)=>{let i=Fe.Position.create(n.pos.line,n.pos.col),r=t.find(s=>bn(s,e,i));if(r)return Tn(r,e,i)},ad=n=>{if(n)return n instanceof De?n:ad(n?.parentNode)},hc=(n,e,t=0)=>!e||e.uri!==n?t:hc(n,ad(e.parentNode),t+1),Y_=(n,e)=>async t=>{let i=await H_(t.firstToken,e,n);return!i||i===t||t.allDescendants.some(s=>s===i)?0:i instanceof De?hc(e,ad(i)):void 0};async function mT(n,e){let t=[],i=n.textDocument.uri.replace("file://",""),r=(await e.getRuntime()).fileTopMostAst(i);return t.push(...(await Promise.all(r.flatMap(async s=>await gT(n,s,i,Y_(r,i))))).flat()),t}var Ui=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),Fe.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
176
- `))}},Cr=(n,e,t,i="")=>{if(n.pos.line===n.prevToken?.pos.line)return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col),Fe.Position.create(n.pos.line,n.pos.col)),`
177
- ${i}${"".padStart(e*t.length,t)}`)},ci=(n,e,t,i="")=>Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,0),Fe.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${i}`),ze=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let i=Ui(n.nextToken,0);if(!i)throw new Error("remove new LinesEdit must be defined");return[Fe.TextEdit.insert(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),"".padEnd(e," ")),i]}return n.nextToken.pos.col-(n.pos.col+n.pos.len)===e?[]:[Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),Fe.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},K_=async(n,e,t,i,r,s)=>{if(e.uri!==t)return[];let o=[],a=Cr(e.firstToken,i,r);if(a)o.push(a);else{o.push(ci(e.firstToken,i,r));let l=Ui(e.firstToken);l&&o.push(l)}if(e instanceof he||e instanceof rt)if(o.push(...e.labels.flatMap(l=>ze(l.lastToken))),e instanceof he){let l=e.name&&e.openScope?ze(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?ze(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>gT(n,l,t,s,i+1)))).flat()),e.closeScope){let l=Cr(e.closeScope,i,r);if(l)o.push(l);else{o.push(ci(e.closeScope,i,r));let u=Ui(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?ze(e.lastToken.prevToken,0):[];return o.push(...c),o},z_=(n,e,t,i)=>{let r=[];if(r.push(...ze(n.lastToken,i?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let s=Ui(n.firstToken);s&&r.push(s),r.push(ci(n.firstToken,e+1,t))}return n.value,r},G_=(n,e,t,i)=>{let r=[];return n instanceof Ke||n instanceof oi?(n.openBracket&&r.push(...ze(n.openBracket,0)),r.push(...n.values.flatMap((s,o)=>z_(s,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&r.push(...ze(n.closeBracket,0))):n?.lastToken&&i&&r.push(...ze(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),r},X_=(n,e,t,i)=>{let r=[];return r.push(...n.startLabels.flatMap((s,o)=>o+1===n.startLabels.length?[]:ze(s.lastToken))),r.push(...G_(n.value,e,t,!i||n.endLabels.length>0)),r.push(...n.endLabels.flatMap((s,o)=>o+1===n.endLabels.length?[]:ze(s.lastToken))),r},Q_=(n,e,t)=>{let i=[],r=s=>{if(s&&bn(n,n.uri,Fe.Position.create(s.pos.line,s.pos.col)))return s.value===","?s:r(s.nextToken)};return n.values.forEach((s,o)=>{if(!s)return[];let a=r(s.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)i.push(...ze(a,1));else if(c?.firstToken){let l=Ui(c?.firstToken);l&&i.push(l),i.push(ci(c?.firstToken,e+1,t))}}}),[...i,...n.values.flatMap((s,o)=>s?X_(s,e,t,o+1===n.values.length):[])]},J_=(n,e,t)=>{let i=[],r=Cr(n.firstToken,e,t);if(r)i.push(r);else{i.push(ci(n.firstToken,e,t));let o=Ui(n.firstToken);o&&i.push(o)}if(i.push(...n.labels.flatMap(o=>ze(o.lastToken))),n.values){if(n.propertyName){i.push(...ze(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&i.push(...ze(a))}i.push(...Q_(n.values,e,t))}let s=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...s),i},Z_=(n,e,t)=>{let i=[],r=Cr(n.firstToken,e,t);r?i.push(r):i.push(ci(n.firstToken,e,t));let s=ze(n.keyword.lastToken);i.push(...s);let o=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...o),i},eP=(n,e,t,i)=>{if(t===void 0)return[];if(n.uri!==e)return[];let r=[],s=Cr(n.firstToken,t,i);s?r.push(s):r.push(ci(n.firstToken,t,i));let o=ze(n.keyword.lastToken);return r.push(...o),r},tP=(n,e,t)=>{let i=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&i.push(...ze(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return i.push(...ze(n.firstToken.prevToken)),i;if(e===void 0)return i;let r=n.firstToken.value.startsWith("*")?" ":"",s=Cr(n.firstToken,e,t,r);if(s)i.push(s);else{i.push(ci(n.firstToken,e,t,r));let o=Ui(n.firstToken);o&&i.push(o)}return i},gT=async(n,e,t,i,r=0)=>{let s=n.options.tabSize,a=n.options.insertSpaces?"".padStart(s," "):" ";return tT(a),e instanceof De?K_(n,e,t,r,a,i):e instanceof Me?J_(e,r,a):e instanceof Sn?Z_(e,r,a):e instanceof ai?eP(e,t,await i(e),a):e instanceof kn?tP(e,await i(e),a):[]};var K=class{constructor(e,t,i="optional",r=void 0,s=[],o){this.name=e;this.type=t;this.def=r;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:et.MarkupKind.Markdown,value:[...this.desctiption?["### Desctiption",this.desctiption.join(`
175
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=xl(e),i=zr(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=xl(e),i=zr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Jk.Parser=zh});var iE=C(co=>{"use strict";var Zk=xh(),IO=Zs(),ao=no(),LO=Id(),xO=le(),MO=Kh(),eE=Gh();function tE(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new MO.LineCounter||null,prettyErrors:e}}function qO(n,e={}){let{lineCounter:t,prettyErrors:i}=tE(e),r=new eE.Parser(t?.addNewLine),s=new Zk.Composer(e),o=Array.from(s.compose(r.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(ao.prettifyError(n,t)),a.warnings.forEach(ao.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function nE(n,e={}){let{lineCounter:t,prettyErrors:i}=tE(e),r=new eE.Parser(t?.addNewLine),s=new Zk.Composer(e),o=null;for(let a of s.compose(r.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ao.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(ao.prettifyError(n,t)),o.warnings.forEach(ao.prettifyError(n,t))),o}function FO(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=nE(n,t);if(!r)return null;if(r.warnings.forEach(s=>LO.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function BO(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return xO.isDocument(n)&&!i?n.toString(t):new IO.Document(n,i,t).toString(t)}co.parse=FO;co.parseAllDocuments=qO;co.parseDocument=nE;co.stringify=BO});var sE=C(Te=>{"use strict";var jO=xh(),UO=Zs(),$O=mh(),Xh=no(),WO=qs(),wi=le(),VO=vi(),HO=Qe(),YO=ki(),KO=Ei(),zO=Il(),GO=Hh(),XO=Kh(),QO=Gh(),Ml=iE(),rE=Is();Te.Composer=jO.Composer;Te.Document=UO.Document;Te.Schema=$O.Schema;Te.YAMLError=Xh.YAMLError;Te.YAMLParseError=Xh.YAMLParseError;Te.YAMLWarning=Xh.YAMLWarning;Te.Alias=WO.Alias;Te.isAlias=wi.isAlias;Te.isCollection=wi.isCollection;Te.isDocument=wi.isDocument;Te.isMap=wi.isMap;Te.isNode=wi.isNode;Te.isPair=wi.isPair;Te.isScalar=wi.isScalar;Te.isSeq=wi.isSeq;Te.Pair=VO.Pair;Te.Scalar=HO.Scalar;Te.YAMLMap=YO.YAMLMap;Te.YAMLSeq=KO.YAMLSeq;Te.CST=zO;Te.Lexer=GO.Lexer;Te.LineCounter=XO.LineCounter;Te.Parser=QO.Parser;Te.parse=Ml.parse;Te.parseAllDocuments=Ml.parseAllDocuments;Te.parseDocument=Ml.parseDocument;Te.stringify=Ml.stringify;Te.visit=rE.visit;Te.visitAsync=rE.visitAsync});var uE=C((H$,lE)=>{"use strict";lE.exports=aE;function aE(n,e,t){n instanceof RegExp&&(n=oE(n,t)),e instanceof RegExp&&(e=oE(e,t));var i=cE(n,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+n.length,i[1]),post:t.slice(i[1]+e.length)}}function oE(n,e){var t=e.match(n);return t?t[0]:null}aE.range=cE;function cE(n,e,t){var i,r,s,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(i=[],s=t.length;u>=0&&!a;)u==c?(i.push(u),c=t.indexOf(n,u+1)):i.length==1?a=[i.pop(),l]:(r=i.pop(),r<s&&(s=r,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}});var bE=C((Y$,yE)=>{var fE=uE();yE.exports=e0;var dE="\0SLASH"+Math.random()+"\0",hE="\0OPEN"+Math.random()+"\0",Jh="\0CLOSE"+Math.random()+"\0",pE="\0COMMA"+Math.random()+"\0",mE="\0PERIOD"+Math.random()+"\0";function Qh(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function JO(n){return n.split("\\\\").join(dE).split("\\{").join(hE).split("\\}").join(Jh).split("\\,").join(pE).split("\\.").join(mE)}function ZO(n){return n.split(dE).join("\\").split(hE).join("{").split(Jh).join("}").split(pE).join(",").split(mE).join(".")}function gE(n){if(!n)return[""];var e=[],t=fE("{","}",n);if(!t)return n.split(",");var i=t.pre,r=t.body,s=t.post,o=i.split(",");o[o.length-1]+="{"+r+"}";var a=gE(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function e0(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),lo(JO(n),!0).map(ZO)):[]}function t0(n){return"{"+n+"}"}function n0(n){return/^-?0\d/.test(n)}function i0(n,e){return n<=e}function r0(n,e){return n>=e}function lo(n,e){var t=[],i=fE("{","}",n);if(!i)return[n];var r=i.pre,s=i.post.length?lo(i.post,!1):[""];if(/\$$/.test(i.pre))for(var o=0;o<s.length;o++){var a=r+"{"+i.body+"}"+s[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(n=i.pre+"{"+i.body+Jh+i.post,lo(n)):[n];var p;if(u)p=i.body.split(/\.\./);else if(p=gE(i.body),p.length===1&&(p=lo(p[0],!1).map(t0),p.length===1))return s.map(function(Be){return i.pre+p[0]+Be});var g;if(u){var _=Qh(p[0]),b=Qh(p[1]),w=Math.max(p[0].length,p[1].length),R=p.length==3?Math.abs(Qh(p[2])):1,v=i0,T=b<_;T&&(R*=-1,v=r0);var N=p.some(n0);g=[];for(var L=_;v(L,b);L+=R){var q;if(l)q=String.fromCharCode(L),q==="\\"&&(q="");else if(q=String(L),N){var H=w-q.length;if(H>0){var j=new Array(H+1).join("0");L<0?q="-"+j+q.slice(1):q=j+q}}g.push(q)}}else{g=[];for(var re=0;re<p.length;re++)g.push.apply(g,lo(p[re],!1))}for(var re=0;re<g.length;re++)for(var o=0;o<s.length;o++){var a=r+g[re]+s[o];(!e||u||a)&&t.push(a)}}return t}});var ge=z(Jb());var ac=class n{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(n.isIncremental(i)){let r=eT(i.range),s=this.offsetAt(r.start),o=this.offsetAt(r.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(o,this._content.length);let a=Math.max(r.start.line,0),c=Math.max(r.end.line,0),l=this._lineOffsets,u=Zb(i.text,!1,s);if(c-a===u.length)for(let p=0,g=u.length;p<g;p++)l[p+a+1]=u[p];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=i.text.length-(o-s);if(d!==0)for(let p=a+1+u.length,g=l.length;p<g;p++)l[p]=l[p]+d}else if(n.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Zb(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}let s=i-1;return{line:s,character:e-t[s]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},cc;(function(n){function e(r,s,o,a){return new ac(r,s,o,a)}n.create=e;function t(r,s,o){if(r instanceof ac)return r.update(s,o),r;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function i(r,s){let o=r.getText(),a=od(s.map(z_),(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),c=0,l=[];for(let u of a){let d=r.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=r.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=i})(cc||(cc={}));function od(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);od(i,e),od(r,e);let s=0,o=0,a=0;for(;s<i.length&&o<r.length;)e(i[s],r[o])<=0?n[a++]=i[s++]:n[a++]=r[o++];for(;s<i.length;)n[a++]=i[s++];for(;o<r.length;)n[a++]=r[o++];return n}function Zb(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);(s===13||s===10)&&(s===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function eT(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function z_(n){let e=eT(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var lc=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],uc=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var tT=z(Q());var ne=n=>({start:{line:n.tokenIndexes?.start?.pos.line??0,character:n.tokenIndexes?.start?.pos.col??0},end:{line:n.tokenIndexes?.end?.pos.line??0,character:(n.tokenIndexes?.end?.pos.col??0)+(n.tokenIndexes?.end?.pos.len??0)}}),nT=" ",iT=n=>{nT=n},ad=()=>nT,si=n=>lc.findIndex(e=>e===n),oi=n=>uc.findIndex(e=>e===n),qt=(n,e,t)=>!!(n.uri===e&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len>=t.character)),rT=(n,e,t)=>!!(n.uri===e&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.col+n.tokenIndexes.end.pos.len),sT=(n,e,t)=>{if(!n)return!1;let r=n.filter(s=>s.pos.line===t.line).at(-1);return r&&r.pos.col>=t.character?!1:e.tokenIndexes?.end===r};var Tn=(n,e,t)=>{let i=n,r=n;for(;r;)i=r,r=[...i.children].reverse().find(s=>qt(s,e,t));return i},A=(n,e,t=tT.DiagnosticSeverity.Error,i=[],r=void 0,s=[],o)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:i,tags:r,templateStrings:s,edit:o}),oT=n=>[...n].sort((t,i)=>{if(t.sortKey===void 0||i.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==i.sortKey)return t.sortKey-i.sortKey;if(!t.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function dt(n,e,t,i){let r=n.textDocument.uri.replace("file://",""),s=await Ui(e,r,i);if(!s)return[];console.time("search");let a=(await s.context.getRuntime()).getDeepestAstNode(r,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===r?!!(u.tokenIndexes?.end&&(u.tokenIndexes.end.pos.line<d.line||u.tokenIndexes.end.pos.line===d.line&&u.tokenIndexes.end.pos.col+u.tokenIndexes.end.pos.len<=d.character)):c!==void 0&&u.sortKey<=c})}function G(n,e){return{start:n,end:e??n}}var M=(n,e)=>n?.tokens.some(t=>t===e),Je=n=>e=>e?.value&&n===e.value?"yes":G_(n)(e),we=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",G_=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Fn=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,Bn=(n,e)=>!!n&&!!e&&Fn(n,e)&&n.pos.col+n.pos.len===e.pos.col,fc=async n=>Promise.all(n.map(async(e,t)=>({index:t,context:e,files:e.getContextFiles()}))),Ui=async(n,e,t)=>(await fc(n)).sort(r=>r.context.name===t?-1:0).find(r=>r.files.some(s=>s===e)),aT=async(n,e)=>(await fc(n)).filter(i=>i.files.some(r=>r===e));var Dr=z(Q()),$=class{constructor(e){this._children=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get sortKey(){return this.firstToken.sortKey??this.parentNode?.sortKey??-1}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(i=>i.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=ne(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(i=>i.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=ne(this);return[{location:Dr.Location.create(`file://${this.uri}`,e),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(t=>t.getWorkspaceSymbols()??[]).filter(t=>t.kind===Dr.SymbolKind.File||t.kind===Dr.SymbolKind.Class||t.kind===Dr.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(si(this.semanticTokenType),oi(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return[...this._children,...this._children.flatMap(e=>e.allDescendants)]}addChild(e){e&&(e.parentNode=this,this.children.push(e))}};var Rr=z(Q());var dT=z(Q());var cT=z(Q()),Tt=class extends ${constructor(t,i){super(i);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:cT.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}};var lT=z(Q()),Ke=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:lT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}};var uT=z(Q());var vn=class extends ${},Ds=class extends vn{constructor(t,i){super();this.expression=t;this.join=i;this.addChild(t),i&&(this.addChild(i.operator),this.addChild(i.expression))}addExpression(t,i){this.addChild(t),this.addChild(i)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var vt=class extends vn{constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:uT.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}};var fT=z(Q()),ai=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:fT.SymbolKind.Array},this.values.forEach(i=>this.addChild(i))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}};var Pe=class extends ${constructor(t,i){super(i);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Me=class extends ${constructor(t,i=[]){super();this.propertyName=t;this.labels=i;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:dT.SymbolKind.Property},this.labels.forEach(r=>this.addChild(r)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Tt?t.value.value:t.value instanceof Ke?t.value.values.map(i=>i.value instanceof vt?i.value.value:NaN):t.value instanceof ai?t.value.values.map(i=>i.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this._values?.values.length?` = ${this._values.values.map(t=>t?.toString()??"NULL").join(", ")}`:""};`}};var hT=z(Q()),Sn=class extends ${constructor(t,i){super();this.keyword=i;this.addChild(i),this.docSymbolsMeta={name:t,kind:hT.SymbolKind.Function}}};var zt=class extends Sn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ae=class extends Sn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var De=class n extends ${constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Ft)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof zt)}addNodeChild(e){this.addChild(e)}},Ft=class extends De{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Rr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Me)}get deleteProperties(){return this.children.filter(e=>e instanceof Ae)}get nodes(){return this.children.filter(e=>e instanceof he)}get pathName(){return"/"}},rt=class extends De{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},t.forEach(i=>{super.addChild(i)})}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof he)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},he=class n extends De{constructor(t=[],i){super();this.labels=t;this.omitIfNoRef=i;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Rr.SymbolKind.Class},i&&this.addChild(i),t.forEach(r=>{this.addChild(r)})}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Rr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof Me)}get deleteProperties(){return this.children.filter(t=>t instanceof Ae)}},Se=class extends ${constructor(t,i,r){super(i);this.name=t;this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}toString(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let i={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};if(t(si("type"),oi("declaration"),{start:i,end:i}),this.address!==void 0){let r={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.tokenIndexes.start.pos.col+this.name.length+1,len:this.tokenIndexes.start.pos.len-this.name.length-1}},s={...this.tokenIndexes.start,pos:{line:this.tokenIndexes.start.pos.line,col:this.name.length+2,len:1}};t(si("decorator"),oi("declaration"),{start:s,end:s}),t(si("number"),oi("declaration"),{start:r,end:r})}}};var pT=z(Q()),pe=class extends ${constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:pT.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}};var En=z(Q());var Ze=n=>n instanceof Sn?!0:n instanceof De?!1:n.parentNode?Ze(n.parentNode):!1;var dc=n=>[...n.filter(t=>t instanceof he||t instanceof rt).map(t=>t instanceof he?t.name:t.labelReference)].filter(t=>!!t);var et=z(Q());var mT=z(Q());var jn=class extends ${constructor(){super();this._pathParts=[]}addPath(t,i){this._pathParts.push(t),i&&this.addChild(i),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},on=class extends ${constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:mT.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}};var Fe=z(Q());var hc=z(Q());var gT=require("path"),ci=class extends ${constructor(t,i){super();this.keyword=t;this.path=i;this.docSymbolsMeta={name:`Include ${i}`,kind:hc.SymbolKind.File},this.addChild(t),this.addChild(i)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:hc.SymbolKind.File},this._reolvedPath=t}},Cr=class extends ${constructor(t,i,r){super(r);this._path=t;this.relative=i;this.docSymbolsMeta={name:(0,gT.basename)(this.path),kind:hc.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var kn=class extends ${constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var X_=async(n,e,t)=>{let i=Fe.Position.create(n.pos.line,n.pos.col),r=t.find(s=>qt(s,e,i));if(r)return Tn(r,e,i)},cd=n=>{if(n)return n instanceof De?n:cd(n?.parentNode)},pc=(n,e,t=0)=>!e||e.uri!==n?t:pc(n,cd(e.parentNode),t+1),Q_=(n,e)=>async t=>{let i=await X_(t.firstToken,e,n);return!i||i===t||t.allDescendants.some(s=>s===i)?0:i instanceof De?pc(e,cd(i)):void 0};async function yT(n,e){let t=[],i=n.textDocument.uri.replace("file://",""),r=(await e.getRuntime()).fileTopMostAst(i);return t.push(...(await Promise.all(r.flatMap(async s=>await bT(n,s,i,Q_(r,i))))).flat()),t}var $i=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),Fe.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
176
+ `))}},Or=(n,e,t,i="")=>{if(n.pos.line===n.prevToken?.pos.line)return Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col),Fe.Position.create(n.pos.line,n.pos.col)),`
177
+ ${i}${"".padStart(e*t.length,t)}`)},li=(n,e,t,i="")=>Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,0),Fe.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${i}`),ze=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let i=$i(n.nextToken,0);if(!i)throw new Error("remove new LinesEdit must be defined");return[Fe.TextEdit.insert(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),"".padEnd(e," ")),i]}return n.nextToken.pos.col-(n.pos.col+n.pos.len)===e?[]:[Fe.TextEdit.replace(Fe.Range.create(Fe.Position.create(n.pos.line,n.pos.col+n.pos.len),Fe.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},J_=async(n,e,t,i,r,s)=>{if(e.uri!==t)return[];let o=[],a=Or(e.firstToken,i,r);if(a)o.push(a);else{o.push(li(e.firstToken,i,r));let l=$i(e.firstToken);l&&o.push(l)}if(e instanceof he||e instanceof rt)if(o.push(...e.labels.flatMap(l=>ze(l.lastToken))),e instanceof he){let l=e.name&&e.openScope?ze(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?ze(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>bT(n,l,t,s,i+1)))).flat()),e.closeScope){let l=Or(e.closeScope,i,r);if(l)o.push(l);else{o.push(li(e.closeScope,i,r));let u=$i(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?ze(e.lastToken.prevToken,0):[];return o.push(...c),o},Z_=(n,e,t,i)=>{let r=[];if(r.push(...ze(n.lastToken,i?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let s=$i(n.firstToken);s&&r.push(s),r.push(li(n.firstToken,e+1,t))}return n.value,r},eP=(n,e,t,i)=>{let r=[];return n instanceof Ke||n instanceof ai?(n.openBracket&&r.push(...ze(n.openBracket,0)),r.push(...n.values.flatMap((s,o)=>Z_(s,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&r.push(...ze(n.closeBracket,0))):n?.lastToken&&i&&r.push(...ze(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),r},tP=(n,e,t,i)=>{let r=[];return r.push(...n.startLabels.flatMap((s,o)=>o+1===n.startLabels.length?[]:ze(s.lastToken))),r.push(...eP(n.value,e,t,!i||n.endLabels.length>0)),r.push(...n.endLabels.flatMap((s,o)=>o+1===n.endLabels.length?[]:ze(s.lastToken))),r},nP=(n,e,t)=>{let i=[],r=s=>{if(s&&qt(n,n.uri,Fe.Position.create(s.pos.line,s.pos.col)))return s.value===","?s:r(s.nextToken)};return n.values.forEach((s,o)=>{if(!s)return[];let a=r(s.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)i.push(...ze(a,1));else if(c?.firstToken){let l=$i(c?.firstToken);l&&i.push(l),i.push(li(c?.firstToken,e+1,t))}}}),[...i,...n.values.flatMap((s,o)=>s?tP(s,e,t,o+1===n.values.length):[])]},iP=(n,e,t)=>{let i=[],r=Or(n.firstToken,e,t);if(r)i.push(r);else{i.push(li(n.firstToken,e,t));let o=$i(n.firstToken);o&&i.push(o)}if(i.push(...n.labels.flatMap(o=>ze(o.lastToken))),n.values){if(n.propertyName){i.push(...ze(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&i.push(...ze(a))}i.push(...nP(n.values,e,t))}let s=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...s),i},rP=(n,e,t)=>{let i=[],r=Or(n.firstToken,e,t);r?i.push(r):i.push(li(n.firstToken,e,t));let s=ze(n.keyword.lastToken);i.push(...s);let o=n.lastToken.value===";"&&n.lastToken.prevToken?ze(n.lastToken.prevToken,0):[];return i.push(...o),i},sP=(n,e,t,i)=>{if(t===void 0)return[];if(n.uri!==e)return[];let r=[],s=Or(n.firstToken,t,i);s?r.push(s):r.push(li(n.firstToken,t,i));let o=ze(n.keyword.lastToken);return r.push(...o),r},oP=(n,e,t)=>{let i=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&i.push(...ze(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return i.push(...ze(n.firstToken.prevToken)),i;if(e===void 0)return i;let r=n.firstToken.value.startsWith("*")?" ":"",s=Or(n.firstToken,e,t,r);if(s)i.push(s);else{i.push(li(n.firstToken,e,t,r));let o=$i(n.firstToken);o&&i.push(o)}return i},bT=async(n,e,t,i,r=0)=>{let s=n.options.tabSize,a=n.options.insertSpaces?"".padStart(s," "):" ";return iT(a),e instanceof De?J_(n,e,t,r,a,i):e instanceof Me?iP(e,r,a):e instanceof Sn?rP(e,r,a):e instanceof ci?sP(e,t,await i(e),a):e instanceof kn?oP(e,await i(e),a):[]};var K=class{constructor(e,t,i="optional",r=void 0,s=[],o){this.name=e;this.type=t;this.def=r;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:et.MarkupKind.Markdown,value:[...this.desctiption?["### Desctiption",this.desctiption.join(`
178
178
 
179
179
  `)]:[],...this.examples?["### Example",this.examples.join(`
180
180
 
181
181
  `)]:[]].join(`
182
- `)});typeof i!="function"?this.required=()=>i:this.required=i,typeof s!="function"?this.values=()=>r&&s.indexOf(r)===-1?[r,...s]:s:this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,i,r){let s=this.required(t);if(r){if(s==="omitted")return[A(11,r.ast,et.DiagnosticSeverity.Error,void 0,[],[i])]}else{if(s==="required"){let l=e.getOrderedNodeAst(t),u=uc(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case 1:case 2:case 4:d=" = <>";break;case 3:case 5:d=' = ""';break;case 6:d=" = []";break}return[...l.map((p,g)=>{let _=p.openScope??u[g].lastToken;return A(0,u[g],et.DiagnosticSeverity.Error,[],[],[i],et.TextEdit.insert(et.Position.create(_.pos.line,_.pos.col+1),`
183
- ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=nP(r),a=[],c=(l,u,d)=>{if(d??=r.ast,!(l.some(g=>g==u)||l.some(g=>g==5)&&(u===3||u===5)||l.some(g=>g==4)&&(u===1||u===2))){let g=[];l.forEach(_=>{switch(_){case 0:g.push(1);break;case 3:g.push(2);break;case 5:g.push(3);break;case 1:g.push(5);break;case 2:g.push(6);break;case 4:g.push(7);break}}),g.length&&a.push(A(g,d,et.DiagnosticSeverity.Error,[],[],[r.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,r.ast.values??r.ast,et.DiagnosticSeverity.Error,[],[],[i,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(p=>p!==u)&&a.push(A(3,r.ast.values?.values[d]??r.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,r.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,r.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,r.ast.propertyName??r.ast,et.DiagnosticSeverity.Error,(r.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[r.name])):o.length===1&&c(this.type[0].types,o[0],r.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(r)??[]),this.values(r).length&&this.type[0].types.some(l=>l===3))){let l=r.ast.values?.values[0]?.value;this.values(r).some(u=>l.value===u)||a.push(A(9,r.ast.values?.values[0]?.value??r.ast,et.DiagnosticSeverity.Error,[],[],[this.values(r).map(u=>`'${u}'`).join(" or ")]))}return a}validate(e,t){if(typeof this.name=="string"){let s=t.getProperty(this.name);return this.validateProperty(e,t,this.name,s)}let i=t.properties.filter(s=>this.getNameMatch(s.name)),r=t.nodeType?.properties.filter(s=>s!==this)??[];return i.filter(s=>r.some(o=>o.getNameMatch(s.name)))?[]:i.flatMap(s=>this.validateProperty(e,t,s.name,s))}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:`"${i}"`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):t?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:`<${i}>`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},nP=n=>n.ast.values?n.ast.values.values.map(e=>iP(e)):[0],iP=n=>n?n.value instanceof Tt?3:n.value instanceof Ke?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof pe||n.value instanceof sn?1:6:7,pc=class{constructor(){this._properties=[]}getIssue(e,t){let i=[],r=t.getProperty("status"),s=r?.ast.values?.values.at(0)?.value;return s instanceof Tt&&s.value==="disabled"?([...t.definitions,...t.referencedBy].forEach(o=>i.push(A(22,o,et.DiagnosticSeverity.Hint,[...r?.ast.parentNode?[r?.ast.parentNode]:[]],[et.DiagnosticTag.Unnecessary]))),i):[...i,...this.properties.flatMap(o=>o.validate(e,t))]}get properties(){return this._properties}addProperty(e){Array.isArray(e)?e.forEach(t=>this._properties.push(t)):this._properties.push(e),this._properties.sort(t=>typeof t.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(e){e&&(e.bindingsPath=this.bindingsPath,this._childNodeType=e)}getOnPropertyHover(e){let t=this.properties.find(i=>i.getNameMatch(e));return t?.onHover.bind(t)()}};var on=class extends ${constructor(t,i,r){super();this.startLabels=t;this.value=i;this.endLabels=r;this.startLabels.forEach(s=>{this.addChild(s)}),this.addChild(i),this.endLabels.forEach(s=>{this.addChild(s)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}};var wt=n=>{if(!n?.values.some(e=>!(e?.value instanceof Ke)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Re=(n,e,t)=>{let i=n.ast.values?.values.at(e)?.value;if(i instanceof Ke){let r=i.values.at(t);if(r?.value instanceof vt)return r.value.value}},an=(n,e,t=0)=>{if(n instanceof on){if(n?.value instanceof Ke){let i=n.value.values.at(t);if(i?.value instanceof vt)return e.getPhandle(i.value.value);if(i?.value instanceof pe)return i.value.linksTo;if(i?.value instanceof sn)return i.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof vt)return e.getPhandle(n.value);if(n instanceof pe)return n.linksTo;if(n instanceof sn)return n.path?.pathParts.at(-1)?.linksTo}},yT=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values.at(0)?.value;if(i instanceof vt)return{cellsProperty:e,node:n,value:i.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var bT=()=>{let n=new K("compatible",V(5));return n.desctiption=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var cd=G(Q()),TT=()=>{let n=new K("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"optional":"omitted",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Tt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,cd.DiagnosticSeverity.Error,[],[],[e.name])]}return[]});return n.desctiption=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var vT=()=>{let n=new K("#interrupt-cells",V(1));return n.desctiption=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var ST=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.desctiption=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var kT=()=>{let n=new K("interrupt-parent",V(1));return n.desctiption=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var ET=G(Q()),wT=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupt-parent"),s=i.root;return(r?an(r?.ast.values?.values.at(0),s):i.parent)?t:r?(t.push(A(18,r.ast.values?.values.at(0)?.value??r.ast)),t):(t.push(A(16,e.ast,ET.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.desctiption=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Or=G(Q()),NT=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupts");r&&t.push(A(15,r.ast,Or.DiagnosticSeverity.Warning,[e.ast],[],[r.name,"is ignored when 'interrupts-extended' is used"]));let s=i.getProperty("interrupt-parent");s&&t.push(A(15,s.ast,Or.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.root,a=wt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=an(a[c],o);if(!l)return t.push(A(18,a[c],Or.DiagnosticSeverity.Error)),t;let u=yT(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Or.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Or.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.desctiption=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var _T=()=>{let n=new K("dma-noncoherent",V(0));return n.desctiption=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var PT=()=>{let n=new K("dma-coherent",V(0));return n.desctiption=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var DT=G(Q()),RT=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,DT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var CT=G(Q()),OT=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,CT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
182
+ `)});typeof i!="function"?this.required=()=>i:this.required=i,typeof s!="function"?this.values=()=>r&&s.indexOf(r)===-1?[r,...s]:s:this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,i,r){let s=this.required(t);if(r){if(s==="omitted")return[A(11,r.ast,et.DiagnosticSeverity.Error,void 0,[],[i])]}else{if(s==="required"){let l=e.getOrderedNodeAst(t),u=dc(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case 1:case 2:case 4:d=" = <>";break;case 3:case 5:d=' = ""';break;case 6:d=" = []";break}return[...l.map((p,g)=>{let _=p.openScope??u[g].lastToken;return A(0,u[g],et.DiagnosticSeverity.Error,[],[],[i],et.TextEdit.insert(et.Position.create(_.pos.line,_.pos.col+1),`
183
+ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r),a=[],c=(l,u,d)=>{if(d??=r.ast,!(l.some(g=>g==u)||l.some(g=>g==5)&&(u===3||u===5)||l.some(g=>g==4)&&(u===1||u===2))){let g=[];l.forEach(_=>{switch(_){case 0:g.push(1);break;case 3:g.push(2);break;case 5:g.push(3);break;case 1:g.push(5);break;case 2:g.push(6);break;case 4:g.push(7);break}}),g.length&&a.push(A(g,d,et.DiagnosticSeverity.Error,[],[],[r.name]))}};if(this.type[0].types.some(l=>l===8))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(A(4,r.ast.values??r.ast,et.DiagnosticSeverity.Error,[],[],[i,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(p=>p!==u)&&a.push(A(3,r.ast.values?.values[d]??r.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,r.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(l=>l!==0).every(l=>l===4)?o.some(l=>c(this.type[0].types,l,r.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,r.ast.propertyName??r.ast,et.DiagnosticSeverity.Error,(r.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[r.name])):o.length===1&&c(this.type[0].types,o[0],r.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(r)??[]),this.values(r).length&&this.type[0].types.some(l=>l===3))){let l=r.ast.values?.values[0]?.value;this.values(r).some(u=>l.value===u)||a.push(A(9,r.ast.values?.values[0]?.value??r.ast,et.DiagnosticSeverity.Error,[],[],[this.values(r).map(u=>`'${u}'`).join(" or ")]))}return a}validate(e,t){if(typeof this.name=="string"){let s=t.getProperty(this.name);return this.validateProperty(e,t,this.name,s)}let i=t.properties.filter(s=>this.getNameMatch(s.name)),r=t.nodeType?.properties.filter(s=>s!==this)??[];return i.filter(s=>r.some(o=>o.getNameMatch(s.name)))?[]:i.flatMap(s=>this.validateProperty(e,t,s.name,s))}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(i=>i===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:`"${i}"`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):t?.types.some(i=>i===1||i===2)?this.values(e).map(i=>({label:`<${i}>`,kind:et.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},aP=n=>n.ast.values?n.ast.values.values.map(e=>cP(e)):[0],cP=n=>n?n.value instanceof Tt?3:n.value instanceof Ke?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof pe||n.value instanceof on?1:6:7,mc=class{constructor(){this._properties=[]}getIssue(e,t){let i=[],r=t.getProperty("status"),s=r?.ast.values?.values.at(0)?.value;return s instanceof Tt&&s.value==="disabled"?([...t.definitions,...t.referencedBy].forEach(o=>i.push(A(22,o,et.DiagnosticSeverity.Hint,[...r?.ast.parentNode?[r?.ast.parentNode]:[]],[et.DiagnosticTag.Unnecessary]))),i):[...i,...this.properties.flatMap(o=>o.validate(e,t))]}get properties(){return this._properties}addProperty(e){Array.isArray(e)?e.forEach(t=>this._properties.push(t)):this._properties.push(e),this._properties.sort(t=>typeof t.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(e){e&&(e.bindingsPath=this.bindingsPath,this._childNodeType=e)}getOnPropertyHover(e){let t=this.properties.find(i=>i.getNameMatch(e));return t?.onHover.bind(t)()}};var an=class extends ${constructor(t,i,r){super();this.startLabels=t;this.value=i;this.endLabels=r;this.startLabels.forEach(s=>{this.addChild(s)}),this.addChild(i),this.endLabels.forEach(s=>{this.addChild(s)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}};var wt=n=>{if(!n?.values.some(e=>!(e?.value instanceof Ke)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Re=(n,e,t)=>{let i=n.ast.values?.values.at(e)?.value;if(i instanceof Ke){let r=i.values.at(t);if(r?.value instanceof vt)return r.value.value}},cn=(n,e,t=0)=>{if(n instanceof an){if(n?.value instanceof Ke){let i=n.value.values.at(t);if(i?.value instanceof vt)return e.getPhandle(i.value.value);if(i?.value instanceof pe)return i.value.linksTo;if(i?.value instanceof on)return i.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof vt)return e.getPhandle(n.value);if(n instanceof pe)return n.linksTo;if(n instanceof on)return n.path?.pathParts.at(-1)?.linksTo}},TT=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values.at(0)?.value;if(i instanceof vt)return{cellsProperty:e,node:n,value:i.value}}return{cellsProperty:e,node:n}},V=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var vT=()=>{let n=new K("compatible",V(5));return n.desctiption=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var ld=z(Q()),ST=()=>{let n=new K("device_type",V(3),e=>e.name==="cpu"||e.name==="memory"?"optional":"omitted",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Tt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name])]}return[]});return n.desctiption=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var kT=()=>{let n=new K("#interrupt-cells",V(1));return n.desctiption=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var ET=()=>{let n=new K("interrupt-controller",V(0),"optional");return n.desctiption=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var wT=()=>{let n=new K("interrupt-parent",V(1));return n.desctiption=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var NT=z(Q()),_T=()=>{let n=new K("interrupts",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupt-parent"),s=i.root;return(r?cn(r?.ast.values?.values.at(0),s):i.parent)?t:r?(t.push(A(18,r.ast.values?.values.at(0)?.value??r.ast)),t):(t.push(A(16,e.ast,NT.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.desctiption=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var Ar=z(Q()),PT=()=>{let n=new K("interrupts-extended",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=i.getProperty("interrupts");r&&t.push(A(15,r.ast,Ar.DiagnosticSeverity.Warning,[e.ast],[],[r.name,"is ignored when 'interrupts-extended' is used"]));let s=i.getProperty("interrupt-parent");s&&t.push(A(15,s.ast,Ar.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.root,a=wt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=cn(a[c],o);if(!l)return t.push(A(18,a[c],Ar.DiagnosticSeverity.Error)),t;let u=TT(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Ar.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(A(17,a[c],Ar.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.desctiption=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var DT=()=>{let n=new K("dma-noncoherent",V(0));return n.desctiption=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var RT=()=>{let n=new K("dma-coherent",V(0));return n.desctiption=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var CT=z(Q()),OT=()=>{let n=new K("dma-ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,CT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var AT=z(Q()),IT=()=>{let n=new K("ranges",V([0,4]),"optional",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i?.length)return[];let r=e.parent?.getProperty("#size-cells"),s=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=r?Re(r,0,0)??1:1,c=s?Re(s,0,0)??2:2,l=o?Re(o,0,0)??2:2;return(i.length===0||i.length%(c+l+a)!==0)&&t.push(A(20,i.at(i.length-i.length%(c+l+a))??e.ast,AT.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:c},()=>"child-bus-address"),...Array.from({length:l},()=>"parent-bus-address"),...Array.from({length:l},()=>"length")].join(" ")}>`])),t});return n.desctiption=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
184
184
  compatible = "simple-bus";
185
185
  #address-cells = <1>;
186
186
  #size-cells = <1>;
@@ -195,7 +195,7 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=nP(r
195
195
  };
196
196
  };`,"```"].join(`
197
197
  `),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
198
- `),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var AT=()=>{let n=new K("virtual-reg",V(1));return n.desctiption=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var ld=G(Q()),IT=()=>{let n=new K("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i)return[];let r=e.parent.parent?.getProperty("#size-cells"),s=e.parent.parent?.getProperty("#address-cells"),o=r?Re(r,0,0)??1:1,a=s?Re(s,0,0)??2:2;if(i.length===0||i.length%(o+a)!==0)return t.push(A(20,i.at(i.length-i.length%(o+a))??e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<i.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);i.slice(0,a).map((d,p)=>Re(e,0,p)??0).forEach((d,p)=>{u.setUint32(p*4,d)}),e.parent.address&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address)||a===1&&u.getUint32(0)!==e.parent.address)&&t.push(A(10,e.ast,ld.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return n.desctiption=["The reg property describes the address of the device's resources within the address space defined by its parent bus. Most commonly this means the offsets and lengths of memory-mapped IO register blocks, but may have a different meaning on some bus types. Addresses in the address space defined by the root node are CPU real addresses.","The value is a <prop-encoded-array>, composed of an arbitrary number of pairs of address and length, <ad-dress length>. The number of <u32> cells required to specify the address and length are bus-specific and are specified by the #address-cells and #size-cells properties in the parent of the device node. If the parent node specifies a value of 0 for #size-cells, the length field in the value of reg shall be omitted."],n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var LT=()=>new K("#size-cells",V(1),"optional",1);var xT=()=>{let n=new K("#address-cells",V(1),"optional",2);return n.desctiption=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
198
+ `),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var LT=()=>{let n=new K("virtual-reg",V(1));return n.desctiption=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var ud=z(Q()),xT=()=>{let n=new K("reg",V(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],i=wt(e.ast.values);if(!i)return[];let r=e.parent.parent?.getProperty("#size-cells"),s=e.parent.parent?.getProperty("#address-cells"),o=r?Re(r,0,0)??1:1,a=s?Re(s,0,0)??2:2;if(i.length===0||i.length%(o+a)!==0)return t.push(A(20,i.at(i.length-i.length%(o+a))??e.ast,ud.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<i.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);i.slice(0,a).map((d,p)=>Re(e,0,p)??0).forEach((d,p)=>{u.setUint32(p*4,d)}),e.parent.address&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address)||a===1&&u.getUint32(0)!==e.parent.address)&&t.push(A(10,e.ast,ud.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return n.desctiption=["The reg property describes the address of the device's resources within the address space defined by its parent bus. Most commonly this means the offsets and lengths of memory-mapped IO register blocks, but may have a different meaning on some bus types. Addresses in the address space defined by the root node are CPU real addresses.","The value is a <prop-encoded-array>, composed of an arbitrary number of pairs of address and length, <ad-dress length>. The number of <u32> cells required to specify the address and length are bus-specific and are specified by the #address-cells and #size-cells properties in the parent of the device node. If the parent node specifies a value of 0 for #size-cells, the length field in the value of reg shall be omitted."],n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var MT=()=>new K("#size-cells",V(1),"optional",1);var qT=()=>{let n=new K("#address-cells",V(1),"optional",2);return n.desctiption=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
199
199
  #address-cells = <1>;
200
200
  #size-cells = <1>;
201
201
  serial@4600 {
@@ -206,8 +206,8 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=nP(r
206
206
  interrupt-parent = <&ipic>;
207
207
  };
208
208
  };`,"```"].join(`
209
- `),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var MT=()=>{let n=new K("status",V(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.desctiption=[`The status property indicates the operational status of a device.
210
- The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var qT=G(Q()),FT=()=>{let n=new K("phandle",V(1),"optional",void 0,[],e=>{let t=Re(e,0,0);if(t){let i=e.parent.root.getAllPhandle(t);if(i.length>1&&i.at(-1)===e.parent)return[A(19,e.ast.values?.values.at(0)??e.ast,qT.DiagnosticSeverity.Error,i.slice(0,-1).flatMap(r=>r.getProperty("phandle")?.ast).filter(r=>!!r),[],[e.name])]}return[]});return n.desctiption=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
209
+ `),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var FT=()=>{let n=new K("status",V(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.desctiption=[`The status property indicates the operational status of a device.
210
+ The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var BT=z(Q()),jT=()=>{let n=new K("phandle",V(1),"optional",void 0,[],e=>{let t=Re(e,0,0);if(t){let i=e.parent.root.getAllPhandle(t);if(i.length>1&&i.at(-1)===e.parent)return[A(19,e.ast.values?.values.at(0)??e.ast,BT.DiagnosticSeverity.Error,i.slice(0,-1).flatMap(r=>r.getProperty("phandle")?.ast).filter(r=>!!r),[],[e.name])]}return[]});return n.desctiption=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
211
211
  phandle = <1>;
212
212
  interrupt-controller;
213
213
  reg = <0x10000000 0x100>;
@@ -215,18 +215,18 @@ ${"".padEnd(hc(u[g].uri,p)*od().length,od())}${i}${d};`))})]}return[]}let o=nP(r
215
215
  `),"A phandle value of 1 is defined. Another device node could reference the pic node with a phandle value of 1:",["```devicetree",`another-device-node {
216
216
  interrupt-parent = <1>;
217
217
  };`,"```"].join(`
218
- `)],n};var BT=()=>{let n=new K("model",V(3));return n.desctiption=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var mc=G(Q()),jT=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[A(14,e.ast,mc.DiagnosticSeverity.Warning,[],[mc.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var li=G(Q());var UT=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=e.parent.root,s=wt(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#address-cells"),a=i.getProperty("#interrupt-cells");if(o||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),a||t.push(A(16,e.ast,li.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)return t;let c=0;for(;c<s.length;){let l=Re(o,0,0),u=Re(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,s.length<c+1){let R=l+u+1;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}let p=an(s[c],r);if(!p){t.push(A(18,s[c],li.DiagnosticSeverity.Error));break}let g=p.getProperty("#address-cells"),_=p.getProperty("#interrupt-cells");if(g||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),_||t.push(A(16,s[c],li.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)break;c++;let b=Re(g,0,0),w=Re(_,0,0);if(b==null||w==null)break;if(c+=b+w,s.length<c){let R=l+u+1+b+w;t.push(A(21,s[s.length-1],li.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:b},()=>"ParentUnitAddress"),...Array.from({length:w},()=>"ParentInterruptSpecifier")].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Re(o,0,0),p=Re(a,0,0);if(d==null||p==null||!(u.value instanceof Ke))return t}return t});return n.desctiption=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var $T=()=>{let n=new K("interrupt-map-mask",V(4));return n.desctiption=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Ar=G(Q()),WT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],i=[],r=e.parent,s=e.parent.root,o=r.getProperty(`#${t}-cells`);if(!o)return i.push(A(16,e.ast,Ar.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;let a=Re(o,0,0);if(a==null)return i;let c=wt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let _=a+1;i.push(A(21,c[c.length-1],Ar.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}let d=an(c[l],s);if(!d){i.push(A(18,c[l],Ar.DiagnosticSeverity.Error));break}let p=d.getProperty(`#${t}-cells`);if(!p)return i.push(A(16,c[l],Ar.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;l++;let g=Re(p,0,0);if(g==null)break;if(l+=g,c.length<l){let _=a+1+g;i.push(A(21,c[c.length-1],Ar.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentSpecifier")].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}u=l}return i});return n.desctiption=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var VT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.desctiption=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var HT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.desctiption=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var YT=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.desctiption=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function ui(){let n=new pc;return n.addProperty([bT(),BT(),FT(),MT(),xT(),LT(),IT(),AT(),OT(),RT(),PT(),_T(),jT(),TT(),wT(),kT(),NT(),vT(),ST(),UT(),$T(),WT(),VT(),HT(),YT()]),n}var ye=class{constructor(e,t,i,r=null){this.bindingLoader=e;this.name=t;this.address=i;this.parent=r;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[ui()];r?.addNode(this)}get nodeTypes(){let e=this.parent?.nodeTypes.at(0)?.childNodeType;return e?[e]:this._nodeTypes??[ui()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return uc([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let i=[...this.definitions,...this.referencedBy].find(r=>bn(r,e,t));if(i){let r=this.deletes.map(c=>({item:this,ast:Tn(c,e,t)})).find(c=>bn(c.ast,e,t));if(r)return r;let s=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>c.ast.lastToken.value===";"?bn(c.ast,e,t):nT(c.ast,e,t));if(s)return s.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Tn(i,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof he).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.properties.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.properties.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.properties.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof he),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:En.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[t instanceof he?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get properties(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(i=>i.name===e&&i.address===t)}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,i){let r=this._nodes.findIndex(s=>s.name===e&&i===s.address);r!==-1&&(this._deletedNodes.push({node:this._nodes[r],by:t}),this._nodes.splice(r,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]}return this._nodes.flatMap(i=>i.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return this}return this._nodes.flatMap(i=>i.getPhandle(e)).find(i=>!!i)}getNode(e,t,i=!0){let r=i||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!r||o.address===t));if(s!==-1)return this._nodes[s]}deleteProperty(e,t){let i=this._properties.findIndex(r=>r.name===e);i!==-1&&(this._deletedProperties.push({property:this._properties[i],by:t}),this._properties.splice(i,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(i=>i.name===e.name);if(t===-1)this._properties.push(e);else{let i=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=i,i.replacedBy=e}e.name==="compatible"&&(this._nodeTypes=this.bindingLoader?.getNodeTypes(this)??[ui()])}getChild(e,t=!0){let i=[...e];i.splice(0,1);let r=i[0].split("@"),s=r[0],o=r[1]!==void 0?Number.parseInt(r[1],16):void 0,a=this.getNode(s,o,t);return i.length===1||!a?a:a.getChild(i)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let i=[...e];return i.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!t(s.by)).map(s=>s.node)].find(s=>s.fullName===i[0])?.getChildFromScope(i,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.properties.length?`
218
+ `)],n};var UT=()=>{let n=new K("model",V(3));return n.desctiption=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var gc=z(Q()),$T=()=>{let n=new K("name",V(3),"optional",void 0,[],e=>[A(14,e.ast,gc.DiagnosticSeverity.Warning,[],[gc.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var ui=z(Q());var WT=()=>{let n=new K("interrupt-map",V(4),"optional",void 0,[],e=>{let t=[],i=e.parent,r=e.parent.root,s=wt(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#address-cells"),a=i.getProperty("#interrupt-cells");if(o||t.push(A(16,e.ast,ui.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),a||t.push(A(16,e.ast,ui.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)return t;let c=0;for(;c<s.length;){let l=Re(o,0,0),u=Re(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,s.length<c+1){let R=l+u+1;t.push(A(21,s[s.length-1],ui.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}let p=cn(s[c],r);if(!p){t.push(A(18,s[c],ui.DiagnosticSeverity.Error));break}let g=p.getProperty("#address-cells"),_=p.getProperty("#interrupt-cells");if(g||t.push(A(16,s[c],ui.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#address-cells",`/${i.path.slice(1).join("/")}`])),_||t.push(A(16,s[c],ui.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),t.length)break;c++;let b=Re(g,0,0),w=Re(_,0,0);if(b==null||w==null)break;if(c+=b+w,s.length<c){let R=l+u+1+b+w;t.push(A(21,s[s.length-1],ui.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:b},()=>"ParentUnitAddress"),...Array.from({length:w},()=>"ParentInterruptSpecifier")].slice((s.length-d)%R===0?R:(s.length-d)%R).join(" ")}`]));break}d=c}if(!e.ast.values)return[];for(let l=0;l<e.ast.values.values.length;l++){let u=e.ast.values.values.at(l);if(!u)continue;if(t.length)return t;let d=Re(o,0,0),p=Re(a,0,0);if(d==null||p==null||!(u.value instanceof Ke))return t}return t});return n.desctiption=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var VT=()=>{let n=new K("interrupt-map-mask",V(4));return n.desctiption=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Ir=z(Q()),HT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),V(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],i=[],r=e.parent,s=e.parent.root,o=r.getProperty(`#${t}-cells`);if(!o)return i.push(A(16,e.ast,Ir.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;let a=Re(o,0,0);if(a==null)return i;let c=wt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let _=a+1;i.push(A(21,c[c.length-1],Ir.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}let d=cn(c[l],s);if(!d){i.push(A(18,c[l],Ir.DiagnosticSeverity.Error));break}let p=d.getProperty(`#${t}-cells`);if(!p)return i.push(A(16,c[l],Ir.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${r.path.slice(1).join("/")}`])),i;l++;let g=Re(p,0,0);if(g==null)break;if(l+=g,c.length<l){let _=a+1+g;i.push(A(21,c[c.length-1],Ir.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentSpecifier")].slice((c.length-u)%_===0?_:(c.length-u)%_).join(" ")}`]));break}u=l}return i});return n.desctiption=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var YT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),V(4));return n.desctiption=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var KT=()=>{let n=new K(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),V(4));return n.desctiption=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var zT=()=>{let n=new K(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),V(1));return n.list=!0,n.desctiption=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function fi(){let n=new mc;return n.addProperty([vT(),UT(),jT(),FT(),qT(),MT(),xT(),LT(),IT(),OT(),RT(),DT(),$T(),ST(),_T(),wT(),PT(),kT(),ET(),WT(),VT(),HT(),YT(),KT(),zT()]),n}var be=class{constructor(e,t,i,r=null){this.bindingLoader=e;this.name=t;this.address=i;this.parent=r;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[fi()];r?.addNode(this)}get nodeTypes(){let e=this.parent?.nodeTypes.at(0)?.childNodeType;return e?[e]:this._nodeTypes??[fi()]}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return dc([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let i=[...this.definitions,...this.referencedBy].find(r=>qt(r,e,t));if(i){let r=this.deletes.map(c=>({item:this,ast:Tn(c,e,t)})).find(c=>qt(c.ast,e,t));if(r)return r;let s=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>c.ast.lastToken.value===";"?qt(c.ast,e,t):rT(c.ast,e,t));if(s)return s.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Tn(i,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof he).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.properties.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.properties.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.properties.flatMap(e=>e.issues),...this._nodes.flatMap(e=>e.issues),...this._deletedNodes.flatMap(e=>e.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues]}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[{issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:En.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof he),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:En.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[En.DiagnosticTag.Deprecated],templateStrings:[t instanceof he?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get properties(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(i=>i.name===e&&i.address===t)}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,i){let r=this._nodes.findIndex(s=>s.name===e&&i===s.address);r!==-1&&(this._deletedNodes.push({node:this._nodes[r],by:t}),this._nodes.splice(r,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return[this,...this._nodes.flatMap(r=>r.getAllPhandle(e))]}return this._nodes.flatMap(i=>i.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof Ke){let i=t.values[0].value;if(i instanceof vt&&i.value===e)return this}return this._nodes.flatMap(i=>i.getPhandle(e)).find(i=>!!i)}getNode(e,t,i=!0){let r=i||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!r||o.address===t));if(s!==-1)return this._nodes[s]}deleteProperty(e,t){let i=this._properties.findIndex(r=>r.name===e);i!==-1&&(this._deletedProperties.push({property:this._properties[i],by:t}),this._properties.splice(i,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(i=>i.name===e.name);if(t===-1)this._properties.push(e);else{let i=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=i,i.replacedBy=e}e.name==="compatible"&&(this._nodeTypes=this.bindingLoader?.getNodeTypes(this)??[fi()])}getChild(e,t=!0){let i=[...e];i.splice(0,1);let r=i[0].split("@"),s=r[0],o=r[1]!==void 0?Number.parseInt(r[1],16):void 0,a=this.getNode(s,o,t);return i.length===1||!a?a:a.getChild(i)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let i=[...e];return i.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!t(s.by)).map(s=>s.node)].find(s=>s.fullName===i[0])?.getChildFromScope(i,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.toString(16)}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.properties.length?`
219
219
  `:""}${this.properties.map(e=>e.toString()).join(`
220
220
  `)}${this.nodes.length?`
221
221
  ${this.nodes.map(e=>`${e.fullName}{ /* ... */ };`).join(`
222
222
  `)}`:""}
223
223
  };`}toMarkupContent(){return{kind:En.MarkupKind.Markdown,value:["### Current State","```devicetree",this.toString(),"```",...this.nodeType?.description?["### Description",this.nodeType?.description]:[]].join(`
224
- `)}}};var yc=G(Q());var ud=G(Q());var fi=class extends ${constructor(t,i){super(i);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:ud.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},Ge=class extends ${constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value,kind:ud.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let i=this.parentNode;if(!(i instanceof pe&&i.linksTo)){super.buildSemanticTokens(t);return}t(ri("type"),si("declaration"),{start:this.firstToken,end:this.lastToken})}};var Xe=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){return{item:this,ast:Tn(this.ast,e,t)}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof fi)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[{issues:[0],severity:yc.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[yc.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var zT=G(Q());var Tc=require("fs");var bc=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
224
+ `)}}};var bc=z(Q());var fd=z(Q());var di=class extends ${constructor(t,i){super(i);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:fd.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},Ge=class extends ${constructor(t,i){super(i);this.value=t;this.docSymbolsMeta={name:this.value,kind:fd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let i=this.parentNode;if(!(i instanceof pe&&i.linksTo)){super.buildSemanticTokens(t);return}t(si("type"),oi("declaration"),{start:this.firstToken,end:this.lastToken})}};var Xe=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){return{item:this,ast:Tn(this.ast,e,t)}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof di)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[{issues:[0],severity:bc.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[bc.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var XT=z(Q());var vc=require("fs");var Tc=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
225
225
  `,`
226
226
  `).split(/\n/).map(i=>`${i}
227
227
  `),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
228
- `)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let i=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,i===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let i=this._tokens.at(-1);return t&&!i?.tokens.some(r=>r===21)&&i&&i.pos.len<e.length?this.process(e.slice(i.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},i=this._tokens.at(-1);t.prevToken=i,i&&(i.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let i=this.lineNumber,r=this.columnNumber,s=this.getString(t[0]);return this.pushToken({tokens:[21],value:s,pos:{col:r-1,line:i,len:s.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var KT,fd=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(i=>({...i}));return t.forEach((i,r)=>{i.prevToken=t[r-1],i.nextToken=t[r+1]}),t}renewLexer(e,t){if(!e||!(0,Tc.existsSync)(e))return[];t??=(0,Tc.readFileSync)(e).toString();let i=new bc(t,e);return this.fileMap.set(e,i),n.clone(i.tokens)}requestTokens(e,t){let i=this.fileMap.get(e)?.tokens;return!i&&t?[...this.renewLexer(e)]:n.clone(i??[])}};function di(){return KT??=new fd,KT}var vc=class n{constructor(e){this.bindingLoader=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new ye(this.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(i=>n.getFileTopMostAst(i,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let r=this.fileTopMostAst(e).find(s=>bn(s,e,t)||iT(di().requestTokens(e,!1),s,t));if(r instanceof rt){let o=this.rootNode.getReferenceBy(r)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Tn(r,e,t)}}else if(r instanceof qt&&r.path){let s=this.rootNode.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r instanceof he&&r.path){let s=n.getNodeFromPath(r.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r)return{runtime:this,item:null,ast:Tn(r,e,t)}}static getNodeFromPath(e,t){if(e.length===0)return t;let i=e[0].split("@"),r=i[0],s=i.at(1),o=s?Number.parseInt(s,16):void 0,a=e.slice(1),c=t.getNode(r,o);return c?n.getNodeFromPath(a,c):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let i=this.labelsUsedCache.get(e[0].slice(1));return i||(t??=this.rootNode.allDescendantsLabels,t.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof De)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(i=>{t.has(i.label.label.value)?t.get(i.label.label.value)?.push(i):t.set(i.label.label.value,[i])}),Array.from(t).forEach(i=>{let r=i[1];if(r.length>1){let s=r.find(a=>a.owner instanceof ye);if(!r.every(a=>a&&a.owner===s?.owner)||!s){let a=r.filter(c=>!(c&&c.owner===s?.owner));e.push(A(4,r.at(0).label,zT.DiagnosticSeverity.Error,r.slice(1).map(c=>c.label),[],[r.at(0).label.label.value]))}}}),e}get typesIssues(){if(this.typeIssueCache)return this.typeIssueCache;let e=t=>[...t.nodeTypes.at(0)?.getIssue(this,t)??[],...t.nodes.flatMap(i=>e(i))];return this.typeIssueCache=e(this.rootNode),this.typeIssueCache}getOrderedNodeAst(e){return rT([...e.definitions,...e.referencedBy])}};var st=class extends ${constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var GT=G(Q()),Sc=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:GT.SymbolKind.String},this.values.forEach(i=>this.addChild(i))}};var XT=G(Q()),kc=class extends ${constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:XT.SymbolKind.Function}}};var wn=class extends ${constructor(t,i){super();this.value=t;this.labels=i;this.labels.forEach(r=>{this.addChild(r)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var dd=G(Q());var Ec=class extends vn{constructor(t,i,r){super(i);this.value=t;this.docSymbolsMeta={name:`param${r+1}`,kind:dd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},wc=class extends vn{constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:dd.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var QT=G(Q());var Ir=class extends vn{constructor(t,i){super(i);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:QT.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Nc=class extends ${constructor(t,i){super(i);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var hi=class{constructor(){this.positionStack=[];this.issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{if(this.currentToken?.pos.line!==e)return;let i=this.currentToken,r=i;for(;this.currentToken?.pos.line===e;)r=this.moveToNextToken;if(t){let s=new $(z(i,r));this.issues.push(A(22,s))}return r};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this.issues=[]}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this.issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this.issues.length&&this.issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(i=>{let r=this.currentToken,s=i(r),o=!1;return s!=="no"&&r&&(t.push(r),this.moveToNextToken,o=Bn(r,this.currentToken)),s==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],i,r=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&r);)t.push(this.currentToken),i=this.currentToken,this.moveToNextToken,r=Bn(i,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let i=[],r=(s,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;i.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(r)}),i.sort((s,o)=>s.line===o.line?s.char-o.char:s.line-o.line).forEach(s=>e.push(s.line,s.char,s.length,s.tokenType,s.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!e.length){this.popStack();return}let t=e.map(r=>r.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Ir(t,z(e[0],e.at(-1)));return this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,i;if(M(e,40)?(i="&",M(this.currentToken,40)&&(i="&&",t=this.moveToNextToken)):M(e,10)?(i="!",M(this.currentToken,0)&&(i="==",t=this.moveToNextToken)):M(e,8)?(i="|",M(this.currentToken,8)&&(i="||",t=this.moveToNextToken)):M(e,9)?i="^":M(e,4)?(i=">",M(this.currentToken,4)?(i="<<",t=this.moveToNextToken):M(this.currentToken,0)&&(i=">=",t=this.moveToNextToken)):M(e,5)?(i=">",M(this.currentToken,5)?(i=">>",t=this.moveToNextToken):M(this.currentToken,0)&&(i="<=",t=this.moveToNextToken)):M(e,15)?i="+":M(e,16)?i="-":M(e,17)?i="*":M(e,13)?i="/":M(e,18)?i="%":M(e,46)&&M(this.currentToken,46)&&(i="##",t=this.moveToNextToken),i){let r=new Nc(i,z(e,t));return this.mergeStack(),r}this.popStack()}parseScopedBlock(e,t,i){this.enqueueToStack();let r=this.moveToNextToken;if(!r||!e(r)){this.popStack();return}let s=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(i?.(l)&&(o[o.length]=[]),l&&(s.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,i);u&&(s.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:r,items:s,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var hd=require("fs"),Lr=require("path");var Pc=class n extends hi{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let i=0;i<this.tokens.length;i++){let r=n.processBlockComments(this.tokens,i)||n.processLineComments(this.tokens,i);r&&(i=r.index,t.push(...r.tokenUsed),this.comments.push(...r.comments))}t.reverse().forEach(i=>this.tokens.splice(i,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=di().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,i){let r=[],s=()=>(r.push(i++),t[i]),o=()=>t[i],a=()=>t[i-1],c=o(),l=c;if(!c||!M(c,13)||(l=s(),!M(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!M(a(),17)||!M(o(),13)||!Bn(a(),o())),d=l.pos.line,p=c,g=[];l=s();do{if(o()?.pos.line!==d){let b=new kn(z(p,a()));g.push(b),d=o().pos.line??0,p=o()}l=s()}while(i<t.length&&!u());let _=new kn(z(p,o()));return g.push(_),s(),{comments:g,tokenUsed:r,index:i-1}}static processLineComments(t,i){let r=[];if(!M(t[i],13)||t.length===i+1||!M(t[i+1],13)||!Bn(t[i],t[i+1]))return;let s=[];for(;t[i].pos.line===t.at(i+1)?.pos.line;)r.push(i++);r.push(i++);let o=t[r.at(-1)],a=new kn(z(t[r[0]],t[r.at(-1)]));return s.push(a),{comments:s,tokenUsed:r,index:i-1}}};var Dc=class extends ${constructor(t,i){super(t);this.content=i}toString(){let t=this.content.filter(i=>!M(i,14));return t.map((i,r)=>{let s=i.value;return i.pos.line===t.at(r+1)?.pos.line?s=s.padEnd(t[r+1].pos.col-i.pos.col," "):t.at(r+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Rc=class extends ${constructor(t,i,r){super();this.keyword=t;this.identifier=i;this.content=r;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ir?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var JT=G(Q());var Cc=class extends st{toString(){return"..."}},Oc=class extends ${constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:JT.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Ds=class extends ${constructor(e){super(e)}},Ac=class extends ${constructor(t,i){super();this.keyword=t;this.content=i;this.addChild(t)}},Rs=class extends Ac{constructor(t,i,r){super(t,r);this.identifier=i;this.addChild(i),this.addChild(r)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Ic=class extends Rs{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Lc=class extends Ac{};var xc=class extends ${constructor(t,i,r){super();this.ifDef=t;this.endIf=i;this.elseOption=r;this.addChild(t),r&&this.addChild(r),this.addChild(i)}getInValidTokenRange(t,i){let r=[],s=a=>i.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];r.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&r.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(r.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&r.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&r.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),r}};var Mc=class n extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.macros=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(r).forEach(([s,o])=>this.macroSnapShot.set(s,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,i])=>this.macros.set(t,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(i=>{t.then(()=>{this.reset(),this.parse().then(i)})}),this.parsing}async parse(){let t=new Pc(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),this.prevToken&&this.prevToken.pos.line===this.currentToken?.pos.line){this.moveEndOfLine(this.prevToken.pos.line,!1),this.mergeStack();return}let t=this.currentToken?.pos.line,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();t!==void 0&&this.moveEndOfLine(t,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken;if(!i||!M(i,25))return this.popStack(),!1;let r=new st(z(i)),s=this.isFunctionDefinition()||this.processCIdentifier();if(!s)return this.issues.push(A(30,r)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Dc(z(o[0],o.at(-1)),o));let c=new Rc(r,s,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],i=this.prevToken;for(;Fn(i,this.currentToken)||i&&M(i,14)&&i.pos.line+1===this.currentToken?.pos.line;)i=this.moveToNextToken,i&&t.push(i);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.moveToNextToken;if(!M(i,42)){this.popStack();return}let r=[],s=this.processCIdentifier()||this.processVariadic();for(;s;)r.push(s),!M(this.currentToken,24)&&!M(this.currentToken,43)?this.issues.push(A(28,s)):M(this.currentToken,43)||(i=this.moveToNextToken),s=this.processCIdentifier()||this.processVariadic();let o=new Oc(t,r);return M(this.currentToken,43)?(i=this.moveToNextToken,o.lastToken=i):(o.lastToken=this.prevToken,this.issues.push(A(26,r.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(45),we(45),we(45)]);if(t.length!==3){this.popStack();return}let i=new Cc(z(t[0],t.at(-1)));return this.mergeStack(),i}processIfDefBlocks(){let t=this.peekIndex(),i=this.parseScopedBlock(r=>{let s=this.getTokenIndex(r)-1;return!!r&&[33,34].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[37].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[36].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)});if(i&&(M(i.startToken,33)||M(i.startToken,34))){let r;M(i.startToken,33)?r=this.processIfDefBlock(i,(o,a,c)=>new Rs(o,a??null,c)):r=this.processIfDefBlock(i,(o,a,c)=>new Ic(o,a??null,c)),this.nodes.push(r),r.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,i){this.enqueueToStack();let r=new st(z(t.startToken)),s=new st(z(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this.issues.push(A(31,r));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new Ds(z(this.currentToken,this.tokens[a])),l=i(r,o??null,c),u;if(t.splitTokens.length>1){let p=this.getTokenIndex(t.splitTokens[1][0]),g=new st(z(this.tokens[p])),_=new Ds(z(this.tokens[p+1],t.splitTokens[1].at(-1)));u=new Lc(g,_)}let d=new xc(l,s,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,Lr.resolve)((0,Lr.dirname)(t.uri),t.path.path),...this.incudes.map(i=>(0,Lr.resolve)(i,t.path.path))].find(i=>(0,hd.existsSync)(i)):this.incudes.map(i=>(0,Lr.resolve)(i,t.path.path)).find(i=>(0,hd.existsSync)(i))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken,r=i;if(!r||!M(r,26))return this.popStack(),!1;let s=i?.pos.line,o=new st(z(r));r=this.moveToNextToken;let a=r,c=!!M(r,21);if(!a||!c&&!M(r,5))return s&&this.moveEndOfLine(s),this.mergeStack(),!0;let l="";if(c)l=r?.value??"";else for(;this.currentToken?.pos.line===s&&!M(this.currentToken,4);)l+=this.currentToken?.value??"",r=this.moveToNextToken;let u=new dc(l,c,z(a,r)),d=new ai(o,u);this.dtsIncludes.push(d),c||(this.currentToken?.pos.line!==s||!M(this.currentToken,4)?this.issues.push(A(12,d)):(r=this.moveToNextToken,u.lastToken=r)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(d);if(d.reolvedPath=g,g&&!g.endsWith(".h")){di().requestTokens(g,!0);let _=new n(g,this.incudes,this.macros);await _.stable,this.tokens.splice(t,p-t,..._.tokens),this.nodes.push(..._.nodes),this.dtsIncludes.push(..._.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var Cs=class extends hi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.tokens=[];this.others=[];this.rootDocument=new De;this.issues=[];this.unhandledStatements=new qt;this.cPreprocessorParser=new Mc(this.uri,this.incudes,r)}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new De,this.issues=[],this.unhandledStatements=new qt}async reparse(){let t=performance.now(),i=this.stable;return this.parsing=new Promise(r=>{i.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),r()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let i=async()=>{if(!(this.isDtsDocumentVersion()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let r=this.moveToNextToken;if(r){let s=new $(z(r));this.issues.push(A(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await i();if(this.unhandledStatements.properties.forEach(r=>{this.issues.push(A(32,r))}),this.unhandledStatements.deleteProperties.forEach(r=>{this.issues.push(A(33,r))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let i=this.moveToNextToken,r=i,s=13;if(!i||!M(i,s))return this.popStack(),!1;if(r=this.moveToNextToken,s=2,!r||!M(r,s))return this.popStack(),!1;let o=new qt;o.openScope=r,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??r;return o.firstToken=i,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let i=this.currentToken;if(M(i,3))this.moveToNextToken;else{let r=this.prevToken;if(r){let s=new $(z(r));this.issues.push(A(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return M(this.currentToken,3)||M(this.currentToken,1)}endStatement(t=!0){let i=this.currentToken;if(!M(i,1)){let r=this.prevToken;if(r&&t){let s=new $(z(this.prevToken));return this.issues.push(A(1,s)),r}}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;M(this.currentToken,1);){let t=this.moveToNextToken;if(t){let i=new $(z(t));this.issues.push(A(23,i))}}}processNode(t,i){if(this.done)return!1;let r=!1,s=!1;do{if(s=this.isChildNode(t,i)||this.isProperty(t)||this.isDeleteNode(t,i)||this.isDeleteProperty(t),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new $(z(o));this.issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;r=r||s}while(!this.isNodeEnd());return r}processOptionalLabelAssign(t=!1){let i=[],r=this.isLabelAssign(t);for(;r;)i.push(r),r=this.isLabelAssign(t);return i}isChildNode(t,i){this.enqueueToStack();let r;i==="Name"&&(r=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=i==="Ref"?new rt(s):new he(s,r);if(i==="Ref"?a=this.isLabelRef():i==="Name"&&(o=this.isNodeName()),!a&&!o){if(!M(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this.issues.push(A(i==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof rt?(c.labelReference=a,l=!0):o&&c instanceof he&&(l=o.address!==void 0,c.name=o),M(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this.issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(we));if(!t.length){this.popStack();return}let i=t.map(o=>o.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=this.checkConcurrentTokens([we(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(we)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new Te(i,z(t[0],o.at(-1)??t.at(-1)),a);if(!Bn(t.at(-1),r[0])){let l=new $(z(t.at(-1),r[0]));this.issues.push(A(29,l))}if(Number.isNaN(a)&&this.issues.push(A(8,c)),!Number.isNaN(a)&&!Bn(r.at(-1),o[0])){let l=new $(z(r[0],o.at(0)));this.issues.push(A(29,l))}return this.mergeStack(),c}let s=new Te(i,z(t[0],t.at(-1)));return this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(we));if(!t.length){this.popStack();return}let i=new Pe(t.map(r=>r.value).join(""),z(t[0],t.at(-1)));return this.mergeStack(),i}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!t.length){this.popStack();return}let i=t.map(s=>s.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=new Ge(i,z(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!i.length){this.popStack();return}let r=i.map(c=>c.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&M(s,50),a=new fi(new Ge(r,z(i[0],i.at(-1))),z(i[0],o?s:i.at(-1)));if(o){let c=i.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.col+c.pos.len)&&this.issues.push(A(29,new $(z(c,s)))),this.moveToNextToken}else if(t)this.issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(),r=this.isPropertyName();if(!r)return this.popStack(),!1;if(M(this.currentToken,2)||M(this.currentToken,49))return this.popStack(),!1;let s=new Me(r,i),o;M(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this.issues.push(A(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,t.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("d"),Je("ts"),we(16),Je("v"),Je("1")]);if(!t.length)return this.popStack(),!1;let i=t[0],r=i;if(t.length===1&&!M(this.currentToken,2))return this.popStack(),!1;if(t.length!==6)return this.popStack(),!1;let s=new st;s.firstToken=i;let o=new kc(s);if(this.others.push(o),M(this.currentToken,13))r=this.moveToNextToken;else return s.lastToken=t.at(-1),this.issues.push(A(21,o)),this.mergeStack(),!0;return s.lastToken=r,o.lastToken=this.endStatement(),this.mergeStack(),!0}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("omit"),we(16),Je("if"),we(16),Je("no"),we(16),Je("ref"),we(13)]);if(t.length!==9){this.popStack();return}let i=new st(z(t[0],t.at(-1)));return this.mergeStack(),i}isDeleteNode(t,i){this.enqueueToStack();let r=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("node")]);if(!r.length)return this.popStack(),!1;let s=r[0],o=s,a=new st;if(a.firstToken=s,r.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,a)),a.lastToken=r.at(-1);let d=new Kt(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=r.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=r.at(-1),c!=="/delete-node"?this.issues.push(A(c.startsWith("/delete-n")?34:25,a)):M(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this.issues.push(A(21,a));let l=new Kt(a);if(Fn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&i==="Name"&&this.issues.push(A(7,d));let p=d?void 0:this.isLabelRef();p&&i==="Name"&&this.issues.push(A(7,p));let g=d||p?void 0:this.isNodeName();g&&i==="Ref"&&this.issues.push(A(10,g)),!d&&!g&&!p&&this.issues.push(A([7,10],l)),l.nodeNameOrRef=d??p??g??null}else i==="Name"?this.issues.push(A(7,a)):i==="Ref"&&this.issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let i=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("property")]);if(!i.length)return this.popStack(),!1;let r=i[0],s=r,o=new st;if(o.firstToken=r,i.length===1&&!M(this.currentToken,2)){this.issues.push(A(25,o)),o.lastToken=i.at(-1);let u=new Ae(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=i.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=i.at(-1),a!=="/delete-property"?this.issues.push(A(a.startsWith("/delete-p")?35:25,o)):M(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this.issues.push(A(21,o));let c=new Ae(o);if(Fn(o.tokenIndexes?.end,r)){let u=this.isPropertyName();u||this.issues.push(A(6,c)),c.propertyName=u??null}else this.issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.processNodePathRef();if(!i){this.popStack();return}let r=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&r.push(...this.processOptionalLabelAssign(!0));let s=new on(t,i,r);return this.mergeStack(),s}processValue(t){this.enqueueToStack();let r=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!M(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=M(this.currentToken,24);d&&this.moveToNextToken;let p=o();if(u&&p===null&&d){let g=new $(z(u,this.currentToken));this.issues.push(A(0,g))}if(!d&&p===null)break;if(l&&!d&&p){let g=new $(z(l));this.issues.push(A(28,g))}c.push(p)}return c})();if(r.length===0){this.popStack();return}return this.mergeStack(),new Sc(r)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken;if(!M(i,21)){this.popStack();return}if(!i?.value)throw new Error("Token must have value");let r=i.value;r.match(/["']$/)&&(r=r.slice(1,-1));let s=new Tt(r,z(i));i.value.match(/["']$/)||this.issues.push(A(i.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new on(t,s,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.currentToken;if(M(r,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues(t)??null;s.openBracket=r;let o=this.processOptionalLabelAssign(!0)??[],a=new on(i,s,o);M(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this.issues.push(A(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=r,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken,r=i;if(!M(r,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this.issues.push(A(15,u))});let a=new oi(s??[]);a.openBracket=r,a.values.length===0&&(a.firstToken=i,this.issues.push(A(14,a)));let c=new on(t,a,o);M(this.currentToken,12)?a.openBracket=this.moveToNextToken:this.issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let i=t(),r=[];if(!i)return this.popStack(),[];for(;i;)r=[...r,i],i=t();if(r){let s=t();s&&(r=[...r,s])}return this.mergeStack(),r}processArrayValues(t){this.enqueueToStack();let i=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new Ke(i);return i.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processHex();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Je("0"),Je("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(o=>o.value).join(""),16),s=new vt(r,z(t[0],i.at(-1)));return this.mergeStack(),s}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.checkConcurrentTokens([20,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(a=>a.value).join(""),16),s=new vt(r,z(i[0],i.at(-1))),o=new wn(s,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processDec();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(we));if(!t.length){this.popStack();return}let i=Number.parseInt(t.map(s=>s.value).join(""),10),r=new vt(i,z(t[0],t.at(-1)));return this.mergeStack(),r}processLabeledExpression(t=!0,i=t){this.enqueueToStack();let r=[];t&&(r=this.processOptionalLabelAssign(i));let s=this.processExpression();if(!s){this.popStack();return}let o=new wn(s,r);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.processMacroCallParams();if(!i){this.popStack();return}let r=new wc(t,i);return this.mergeStack(),r}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.processExpression();if(!i){this.popStack();return}let r=this.processOptionalLabelAssign(!0),s=new on(t,i,r);return this.mergeStack(),s}processExpression(){this.enqueueToStack();let t=!1,i,r;M(this.currentToken,42)&&(t=!0,i=this.moveToNextToken,r=i);let s=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!s){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?s instanceof _s?s.addExpression(o,a):s=new _s(s,{operator:o,expression:a}):this.issues.push(A(27,o)),o=this.isOperator()}M(this.currentToken,43)?r=this.moveToNextToken:this.issues.push(A(26,o??s))}return this.mergeStack(),s}processMacroCallParams(){return M(this.currentToken,42)?this.parseScopedBlock(r=>!!M(r,42),r=>!!M(r,43),r=>!!M(r,24))?.splitTokens.map((r,s)=>{if(r.length===0||M(r[0],24)&&r.length===1)return null;let o=s?r.slice(1):r;return new Ec(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),z(o[0],o.at(-1)),s)}):void 0}isLabelRef(t){this.enqueueToStack();let i=this.currentToken;if(M(i,40))this.moveToNextToken;else{this.popStack();return}let r=this.isLabelName();if(!r){let o=new pe(null);return this.issues.push(A(18,t??o)),o.firstToken=i,this.mergeStack(),o}i&&(r.firstToken.pos.line!==i.pos.line||r.firstToken.pos.col!==i.pos.col+i.pos.len)&&this.issues.push(A(29,new $(z(i,r.firstToken))));let s=new pe(r);return s.firstToken=i,this.mergeStack(),s}isLabelRefValue(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.isLabelRef(t);if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new on(i,r,s);return this.mergeStack(),o}processRefValue(t,i){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.currentToken;if(!M(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new wn(o,r);return this.mergeStack(),l}let a=this.isLabelRef(i);if(a===void 0){this.issues.push(A([18,9],i));let l=new wn(null,r);return l.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),l}let c=new wn(a,r);return c.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(t=!0,i=new jn){this.enqueueToStack();let r;if(M(this.currentToken,13))r=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this.issues.push(A(19,new $(z(this.prevToken))))}let s=this.isNodeName();return s||this.issues.push(A(7,new $(z(r??this.prevToken)))),i.addPath(s??null,r?new $(z(r)):void 0),this.processNodePath(!1,i),this.mergeStack(),i}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,i=t;if(!M(i,40)){this.popStack();return}let r=this.moveToNextToken;if(i=r,!M(i,2)){this.popStack();return}let s=this.processNodePath(),o=new sn(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&l.lastToken.pos.col+l.lastToken.pos.len!==c.pos.col){this.issues.push(A(29,new $(z(l.lastToken,c))));return}if(u===0&&r&&r.pos.col+r.pos.len!==l?.firstToken.pos.col){this.issues.push(A(29,new $(z(r,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&l.lastToken.pos.col+l.lastToken.pos.len!==d?.firstToken.pos.col&&this.issues.push(A(29,new $(z(l.lastToken,d?.firstToken))))}),M(a,3)?this.moveToNextToken:this.prevToken&&this.issues.push(A(3,new $(z(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof ai)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var xr=G(Q());var ZT=require("fs"),ev=require("path");var Mr=class{constructor(e,t,i,r=[],s){this.bindingLoader=i;this._issues=[];this.overlays=[];this.overlays=Array.isArray(r)?r:[r],this.overlays.filter(ZT.existsSync),this.parser=new Cs(e,t),this.name=s??(0,ev.basename)(e),this.overlayParsers=this.overlays?.map(o=>new Cs(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(r=>r.ast.uri===e).flatMap(r=>r.ast.values?.values.flatMap(s=>{let a=r.parent?.nodeTypes.find(c=>s?.value instanceof Tt&&c.compatible===s.value.value);return a?{range:ne(s.value),target:`file://${a.bindingsPath}`}:void 0})).filter(r=>r)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(r=>r.uri===e).map(r=>{let s=this.parser.cPreprocessorParser.resolveInclude(r);if(s)return{range:ne(r.path),target:`file://${s}`}}).filter(r=>r)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let t=s=>[...s.properties,...s.nodes.flatMap(t)],i=t(e.rootNode),r=e.rootNode.allDescendantsLabels;i.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof pe){let a=e.resolvePath([`&${o.label?.value}`],r);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,xr.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof jn){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let p=a?.getNode(d.name,d.address,!1);d.linksTo=p,!u&&!p&&(u=!0,this._issues.push(A(8,d,xr.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(g=>g?.linksTo).map(g=>g?.toString()).join("/")}`]))),p?.linkedNodeNamePaths.push(d),a=p}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new vc(this.bindingLoader);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let i=0;i<this.overlayParsers.length;i++)this.processRoot(this.overlayParsers[i].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(i=>i instanceof kn),(await this.getAllParsers()).flatMap(i=>i.tokens).forEach((i,r)=>i.sortKey=r),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let i=0;i<e.children.length;i++){let r=e.children[i];this.processChild(r,t.rootNode,t)}}processChild(e,t,i){e instanceof De?this.processDtcBaseNode(e,t,i):e instanceof Me?this.processDtcProperty(e,t,i):e instanceof Kt?this.processDeleteNode(e,t,i):e instanceof Ae&&this.processDeleteProperty(e,t,i)}checkNodeUniqueNames(e,t){let i=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address===a.address)),r=t.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof he&&o.name)i(s,o.name)&&this._issues.push(A(2,o.name)),s.push(o.name);else if(o instanceof Kt&&o.nodeNameOrRef instanceof Te){let a=o.nodeNameOrRef;i(r,a)&&(s=s.filter(c=>i(s,c)))}})}processDtcBaseNode(e,t,i){e instanceof qt?this.processDtcRootNode(e,i):e instanceof he?this.processDtcChildNode(e,t,i):e instanceof rt&&this.processDtcRefNode(e,i)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((i,r)=>i instanceof Me&&r instanceof Ae||r instanceof Me&&i instanceof Ae?0:r instanceof Me?1:0).forEach(i=>this.processChild(i,t.rootNode,t))}processDtcChildNode(e,t,i){if(e.name?.name){let r=e.path?i.resolvePath(e.path):void 0,o=(r?i.rootNode.getChild(r):void 0)??new ye(this.bindingLoader,e.name.name,e.name.address,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,t,i))}processDtcRefNode(e,t){let i;if(e.labelReference){let r=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);r?(e.resolveNodePath??=[...r],i=t.rootNode.getChild(r),e.labelReference.linksTo=i,e.labels.forEach(s=>s.lastLinkedTo=i),i?.linkedRefLabels.push(e.labelReference),i?.referencedBy.push(e),e.labels.forEach(s=>{t.labelsUsedCache.set(s.label.value,r)}),i?(t.references.push(e),this.checkNodeUniqueNames(e,i)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,xr.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,i??new ye(this.bindingLoader,""),t))}processDtcProperty(e,t,i){e.propertyName?.name&&t.addProperty(new Xe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof Te&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let r=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address);e.nodeNameOrRef.linksTo=r,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address),r?.labels.forEach(s=>{i.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof pe&&e.nodeNameOrRef.value){let r=i.resolvePath([`&${e.nodeNameOrRef.value}`]),s;r?(s=i.rootNode.getChild(r),t.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{i.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)):(i.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,xr.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof sn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(r=>!r)){let r=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=i.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let p=s?.getNode(d.name,d.address,!1);d.linksTo=p,p?.linkedNodeNamePaths.push(d),s=p}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(i.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,xr.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{i.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)}else i.unlinkedDeletes.push(e);e.children.forEach(r=>this.processChild(r,t,i))}processDeleteProperty(e,t,i){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(r=>this.processChild(r,t,i))}};var dt=G(Q());var qc=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>qc(t.node,e)),...n.nodes.flatMap(t=>qc(t,e))],pd=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>pd(t.node,e)),...n.nodes.flatMap(t=>pd(t,e))];function rP(n,e){if(!n||!(n.item instanceof Xe)||!(n.ast instanceof pe))return[];let t=i=>pd(i,e);return Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Method}))}function sP(n,e){if(!n||n.item!==null||!(n.ast instanceof pe)||!(n.ast.parentNode instanceof rt))return[];let t=i=>qc(i,e).filter(r=>e(r));return[...Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:i,insertText:`${i} {
228
+ `)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let i=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,i===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let i=this._tokens.at(-1);return t&&!i?.tokens.some(r=>r===21)&&i&&i.pos.len<e.length?this.process(e.slice(i.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},i=this._tokens.at(-1);t.prevToken=i,i&&(i.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let i=this.lineNumber,r=this.columnNumber,s=this.getString(t[0]);return this.pushToken({tokens:[21],value:s,pos:{col:r-1,line:i,len:s.length+this.numberOfEscapedCharsLastString}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){return{line:this.lineNumber,col:this.columnNumber-e.length+this.lineNumberOfEscapedChars,len:t.length}}};var GT,dd=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(i=>({...i}));return t.forEach((i,r)=>{i.prevToken=t[r-1],i.nextToken=t[r+1]}),t}renewLexer(e,t){if(!e||!(0,vc.existsSync)(e))return[];try{t??=(0,vc.readFileSync)(e).toString();let i=new Tc(t,e);return this.fileMap.set(e,i),n.clone(i.tokens)}catch{}return[]}requestTokens(e,t){let i=this.fileMap.get(e)?.tokens;return!i&&t?[...this.renewLexer(e)]:n.clone(i??[])}};function hi(){return GT??=new dd,GT}var Sc=class n{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new be(this.context.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(i=>n.getFileTopMostAst(i,t))}fileTopMostAst(e){return[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.includes,...this.comments].flatMap(t=>n.getFileTopMostAst(t,e))}getDeepestAstNode(e,t){let r=this.fileTopMostAst(e).find(s=>qt(s,e,t)||sT(hi().requestTokens(e,!1),s,t));if(r instanceof rt){let o=this.rootNode.getReferenceBy(r)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Tn(r,e,t)}}else if(r instanceof Ft&&r.path){let s=this.rootNode.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r instanceof he&&r.path){let s=n.getNodeFromPath(r.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return s?{...s,runtime:this}:void 0}else if(r)return{runtime:this,item:null,ast:Tn(r,e,t)}}static getNodeFromPath(e,t){if(e.length===0)return t;let i=e[0].split("@"),r=i[0],s=i.at(1),o=s?Number.parseInt(s,16):void 0,a=e.slice(1),c=t.getNode(r,o);return c?n.getNodeFromPath(a,c):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let i=this.labelsUsedCache.get(e[0].slice(1));return i||(t??=this.rootNode.allDescendantsLabels,t.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof De)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(i=>{t.has(i.label.label.value)?t.get(i.label.label.value)?.push(i):t.set(i.label.label.value,[i])}),Array.from(t).forEach(i=>{let r=i[1];if(r.length>1){let s=r.find(a=>a.owner instanceof be);if(!r.every(a=>a&&a.owner===s?.owner)||!s){let a=r.filter(c=>!(c&&c.owner===s?.owner));e.push(A(4,r.at(0).label,XT.DiagnosticSeverity.Error,r.slice(1).map(c=>c.label),[],[r.at(0).label.label.value]))}}}),e}get typesIssues(){if(this.typeIssueCache)return this.typeIssueCache;let e=t=>[...t.nodeTypes.at(0)?.getIssue(this,t)??[],...t.nodes.flatMap(i=>e(i))];return this.typeIssueCache=e(this.rootNode),this.typeIssueCache}getOrderedNodeAst(e){return oT([...e.definitions,...e.referencedBy])}};var st=class extends ${constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var QT=z(Q()),kc=class extends ${constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:QT.SymbolKind.String},this.values.forEach(i=>this.addChild(i))}};var JT=z(Q()),Ec=class extends ${constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:JT.SymbolKind.Function}}};var wn=class extends ${constructor(t,i){super();this.value=t;this.labels=i;this.labels.forEach(r=>{this.addChild(r)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var hd=z(Q());var wc=class extends vn{constructor(t,i,r){super(i);this.value=t;this.docSymbolsMeta={name:`param${r+1}`,kind:hd.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Nc=class extends vn{constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:hd.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var ZT=z(Q());var Lr=class extends vn{constructor(t,i){super(i);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:ZT.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var _c=class extends ${constructor(t,i){super(i);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var pi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{if(this.currentToken?.pos.line!==e)return;let i=this.currentToken,r=i;for(;this.currentToken?.pos.line===e;)r=this.moveToNextToken;if(t){let s=new $(G(i,r));this._issues.push(A(22,s))}return r};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this._issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this._issues.length&&this._issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){if(this.positionStack[this.positionStack.length-1]===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(i=>{let r=this.currentToken,s=i(r),o=!1;return s!=="no"&&r&&(t.push(r),this.moveToNextToken,o=Bn(r,this.currentToken)),s==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],i,r=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&r);)t.push(this.currentToken),i=this.currentToken,this.moveToNextToken,r=Bn(i,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let i=[],r=(s,o,a)=>{if(!a?.start||!a?.end||a.start.uri!==t||a.end.uri!==t)return;let c=a.end.pos.col-a.start.pos.col+a.end.pos.len;i.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:s,tokenModifiers:o})};this.allAstItems.forEach(s=>{s.buildSemanticTokens(r)}),i.sort((s,o)=>s.line===o.line?s.char-o.char:s.line-o.line).forEach(s=>e.push(s.line,s.char,s.length,s.tokenType,s.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!e.length){this.popStack();return}let t=e.map(r=>r.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Lr(t,G(e[0],e.at(-1)));return this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,i;if(M(e,40)?(i="&",M(this.currentToken,40)&&(i="&&",t=this.moveToNextToken)):M(e,10)?(i="!",M(this.currentToken,0)&&(i="==",t=this.moveToNextToken)):M(e,8)?(i="|",M(this.currentToken,8)&&(i="||",t=this.moveToNextToken)):M(e,9)?i="^":M(e,4)?(i=">",M(this.currentToken,4)?(i="<<",t=this.moveToNextToken):M(this.currentToken,0)&&(i=">=",t=this.moveToNextToken)):M(e,5)?(i=">",M(this.currentToken,5)?(i=">>",t=this.moveToNextToken):M(this.currentToken,0)&&(i="<=",t=this.moveToNextToken)):M(e,15)?i="+":M(e,16)?i="-":M(e,17)?i="*":M(e,13)?i="/":M(e,18)?i="%":M(e,46)&&M(this.currentToken,46)&&(i="##",t=this.moveToNextToken),i){let r=new _c(i,G(e,t));return this.mergeStack(),r}this.popStack()}parseScopedBlock(e,t,i){this.enqueueToStack();let r=this.moveToNextToken;if(!r||!e(r)){this.popStack();return}let s=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(i?.(l)&&(o[o.length]=[]),l&&(s.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,i);u&&(s.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:r,items:s,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var pd=require("fs"),xr=require("path");var Dc=class n extends pi{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let i=0;i<this.tokens.length;i++){let r=n.processBlockComments(this.tokens,i)||n.processLineComments(this.tokens,i);r&&(i=r.index,t.push(...r.tokenUsed),this.comments.push(...r.comments))}t.reverse().forEach(i=>this.tokens.splice(i,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=hi().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,i){let r=[],s=()=>(r.push(i++),t[i]),o=()=>t[i],a=()=>t[i-1],c=o(),l=c;if(!c||!M(c,13)||(l=s(),!M(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!M(a(),17)||!M(o(),13)||!Bn(a(),o())),d=l.pos.line,p=c,g=[];l=s();do{if(o()?.pos.line!==d){let b=new kn(G(p,a()));g.push(b),d=o().pos.line??0,p=o()}l=s()}while(i<t.length&&!u());let _=new kn(G(p,o()));return g.push(_),s(),{comments:g,tokenUsed:r,index:i-1}}static processLineComments(t,i){let r=[];if(!M(t[i],13)||t.length===i+1||!M(t[i+1],13)||!Bn(t[i],t[i+1]))return;let s=[];for(;t[i].pos.line===t.at(i+1)?.pos.line;)r.push(i++);r.push(i++);let o=t[r.at(-1)],a=new kn(G(t[r[0]],t[r.at(-1)]));return s.push(a),{comments:s,tokenUsed:r,index:i-1}}};var Rc=class extends ${constructor(t,i){super(t);this.content=i}toString(){let t=this.content.filter(i=>!M(i,14));return t.map((i,r)=>{let s=i.value;return i.pos.line===t.at(r+1)?.pos.line?s=s.padEnd(t[r+1].pos.col-i.pos.col," "):t.at(r+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Cc=class extends ${constructor(t,i,r){super();this.keyword=t;this.identifier=i;this.content=r;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Lr?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var ev=z(Q());var Oc=class extends st{toString(){return"..."}},Ac=class extends ${constructor(t,i){super();this.functionName=t;this.params=i;this.addChild(t),this.params.forEach(r=>this.addChild(r))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:ev.SymbolKind.Function,range:ne(this),selectionRange:ne(this),children:this.params.flatMap(i=>i.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var Cs=class extends ${constructor(e){super(e)}},Ic=class extends ${constructor(t,i){super();this.keyword=t;this.content=i;this.addChild(t)}},Os=class extends Ic{constructor(t,i,r){super(t,r);this.identifier=i;this.addChild(i),this.addChild(r)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Lc=class extends Os{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},xc=class extends Ic{};var Mc=class extends ${constructor(t,i,r){super();this.ifDef=t;this.endIf=i;this.elseOption=r;this.addChild(t),r&&this.addChild(r),this.addChild(i)}getInValidTokenRange(t,i){let r=[],s=a=>i.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];r.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&r.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(r.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&r.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&r.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),r}};var tv=z(Q()),qc=class n extends pi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.macros=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(r).forEach(([s,o])=>this.macroSnapShot.set(s,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,i])=>this.macros.set(t,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(i=>{t.then(()=>{this.reset(),this.parse().then(i)})}),this.parsing}async parse(){let t=new Dc(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),this.prevToken&&this.prevToken.pos.line===this.currentToken?.pos.line){this.moveEndOfLine(this.prevToken.pos.line,!1),this.mergeStack();return}let t=this.currentToken?.pos.line,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();t!==void 0&&this.moveEndOfLine(t,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken;if(!i||!M(i,25))return this.popStack(),!1;let r=new st(G(i)),s=this.isFunctionDefinition()||this.processCIdentifier();if(!s)return this._issues.push(A(30,r)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Rc(G(o[0],o.at(-1)),o));let c=new Cc(r,s,a);this.macros.set(c.name,c),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),!0}consumeDefinitionContent(){let t=[],i=this.prevToken;for(;Fn(i,this.currentToken)||i&&M(i,14)&&i.pos.line+1===this.currentToken?.pos.line;)i=this.moveToNextToken,i&&t.push(i);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.moveToNextToken;if(!M(i,42)){this.popStack();return}let r=[],s=this.processCIdentifier()||this.processVariadic();for(;s;)r.push(s),!M(this.currentToken,24)&&!M(this.currentToken,43)?this._issues.push(A(28,s)):M(this.currentToken,43)||(i=this.moveToNextToken),s=this.processCIdentifier()||this.processVariadic();let o=new Ac(t,r);return M(this.currentToken,43)?(i=this.moveToNextToken,o.lastToken=i):(o.lastToken=this.prevToken,this._issues.push(A(26,r.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(45),we(45),we(45)]);if(t.length!==3){this.popStack();return}let i=new Oc(G(t[0],t.at(-1)));return this.mergeStack(),i}processIfDefBlocks(){let t=this.peekIndex(),i=this.parseScopedBlock(r=>{let s=this.getTokenIndex(r)-1;return!!r&&[33,34].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[37].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)},r=>{let s=this.getTokenIndex(r)-1;return!!r&&[36].some(o=>M(r,o))&&!Fn(this.tokens.at(s),r)});if(i&&(M(i.startToken,33)||M(i.startToken,34))){let r;M(i.startToken,33)?r=this.processIfDefBlock(i,(o,a,c)=>new Os(o,a??null,c)):r=this.processIfDefBlock(i,(o,a,c)=>new Lc(o,a??null,c)),this.nodes.push(r),r.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),this.positionStack[this.positionStack.length-1]=t;return}}processIfDefBlock(t,i){this.enqueueToStack();let r=new st(G(t.startToken)),s=new st(G(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this._issues.push(A(31,r));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new Cs(G(this.currentToken,this.tokens[a])),l=i(r,o??null,c),u;if(t.splitTokens.length>1){let p=this.getTokenIndex(t.splitTokens[1][0]),g=new st(G(this.tokens[p])),_=new Cs(G(this.tokens[p+1],t.splitTokens[1].at(-1)));u=new xc(g,_)}let d=new Mc(l,s,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,xr.resolve)((0,xr.dirname)(t.uri),t.path.path),...this.incudes.map(i=>(0,xr.resolve)(i,t.path.path))].find(i=>(0,pd.existsSync)(i)):this.incudes.map(i=>(0,xr.resolve)(i,t.path.path)).find(i=>(0,pd.existsSync)(i))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),i=this.moveToNextToken,r=i;if(!r||!M(r,26))return this.popStack(),!1;let s=i?.pos.line,o=new st(G(r));r=this.moveToNextToken;let a=r,c=!!M(r,21);if(!a||!c&&!M(r,5))return s&&this.moveEndOfLine(s),this.mergeStack(),!0;let l="";if(c)l=r?.value??"";else for(;this.currentToken?.pos.line===s&&!M(this.currentToken,4);)l+=this.currentToken?.value??"",r=this.moveToNextToken;let u=new Cr(l,c,G(a,r)),d=new ci(o,u);this.dtsIncludes.push(d),c||(this.currentToken?.pos.line!==s||!M(this.currentToken,4)?this._issues.push(A(12,d)):(r=this.moveToNextToken,u.lastToken=r)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(d);if(d.reolvedPath=g,g||this._issues.push(A(36,d.path,tv.DiagnosticSeverity.Warning)),g&&!g.endsWith(".h")){hi().requestTokens(g,!0);let _=new n(g,this.incudes,this.macros);await _.stable,this.tokens.splice(t,p-t,..._.tokens),this.nodes.push(..._.nodes),this.dtsIncludes.push(..._.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var As=class extends pi{constructor(t,i,r=new Map){super();this.uri=t;this.incudes=i;this.tokens=[];this.others=[];this.rootDocument=new De;this.unhandledStatements=new Ft;this.cPreprocessorParser=new qc(this.uri,this.incudes,r)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.reolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new De,this._issues=[],this.unhandledStatements=new Ft}async reparse(){let t=performance.now(),i=this.stable;return this.parsing=new Promise(r=>{i.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),r()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,this.uri.endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let i=async()=>{if(!(this.isDtsDocumentVersion()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let r=this.moveToNextToken;if(r){let s=new $(G(r));this._issues.push(A(22,s)),this.reportExtraEndStatements()}}};for(;!this.done;)await i();if(this.unhandledStatements.properties.forEach(r=>{this._issues.push(A(32,r))}),this.unhandledStatements.deleteProperties.forEach(r=>{this._issues.push(A(33,r))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let i=this.moveToNextToken,r=i,s=13;if(!i||!M(i,s))return this.popStack(),!1;if(r=this.moveToNextToken,s=2,!r||!M(r,s))return this.popStack(),!1;let o=new Ft;o.openScope=r,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??r;return o.firstToken=i,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let i=this.currentToken;if(M(i,3))this.moveToNextToken;else{let r=this.prevToken;if(r){let s=new $(G(r));this._issues.push(A(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return M(this.currentToken,3)||M(this.currentToken,1)}endStatement(t=!0){let i=this.currentToken;if(!M(i,1)){let r=this.prevToken;if(r&&t){let s=new $(G(this.prevToken));return this._issues.push(A(1,s)),r}}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;M(this.currentToken,1);){let t=this.moveToNextToken;if(t){let i=new $(G(t));this._issues.push(A(23,i))}}}processNode(t,i){if(this.done)return!1;let r=!1,s=!1;do{if(s=this.isChildNode(t,i)||this.isProperty(t)||this.isDeleteNode(t,i)||this.isDeleteProperty(t),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new $(G(o));this._issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;r=r||s}while(!this.isNodeEnd());return r}processOptionalLabelAssign(t=!1){let i=[],r=this.isLabelAssign(t);for(;r;)i.push(r),r=this.isLabelAssign(t);return i}isChildNode(t,i){this.enqueueToStack();let r;i==="Name"&&(r=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=i==="Ref"?new rt(s):new he(s,r);if(i==="Ref"?a=this.isLabelRef():i==="Name"&&(o=this.isNodeName()),!a&&!o){if(!M(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(A(i==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof rt?(c.labelReference=a,l=!0):o&&c instanceof he&&(l=o.address!==void 0,c.name=o),M(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(A(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(we));if(!t.length){this.popStack();return}let i=t.map(o=>o.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=this.checkConcurrentTokens([we(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(we)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new Se(i,G(t[0],o.at(-1)??t.at(-1)),a);if(!Bn(t.at(-1),r[0])){let l=new $(G(t.at(-1),r[0]));this._issues.push(A(29,l))}if(Number.isNaN(a)&&this._issues.push(A(8,c)),!Number.isNaN(a)&&!Bn(r.at(-1),o[0])){let l=new $(G(r[0],o.at(0)));this._issues.push(A(29,l))}return this.mergeStack(),c}let s=new Se(i,G(t[0],t.at(-1)));return this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(we));if(!t.length){this.popStack();return}let i=new Pe(t.map(r=>r.value).join(""),G(t[0],t.at(-1)));return this.mergeStack(),i}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!t.length){this.popStack();return}let i=t.map(s=>s.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let r=new Ge(i,G(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(we));if(!i.length){this.popStack();return}let r=i.map(c=>c.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&M(s,50),a=new di(new Ge(r,G(i[0],i.at(-1))),G(i[0],o?s:i.at(-1)));if(o){let c=i.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.col+c.pos.len)&&this._issues.push(A(29,new $(G(c,s)))),this.moveToNextToken}else if(t)this._issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(),r=this.isPropertyName();if(!r)return this.popStack(),!1;if(M(this.currentToken,2)||M(this.currentToken,49))return this.popStack(),!1;let s=new Me(r,i),o;M(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(s),o?.values.filter(c=>!!c).length||this._issues.push(A(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,t.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("d"),Je("ts"),we(16),Je("v"),Je("1")]);if(!t.length)return this.popStack(),!1;let i=t[0],r=i;if(t.length===1&&!M(this.currentToken,2))return this.popStack(),!1;if(t.length!==6)return this.popStack(),!1;let s=new st;s.firstToken=i;let o=new Ec(s);if(this.others.push(o),M(this.currentToken,13))r=this.moveToNextToken;else return s.lastToken=t.at(-1),this._issues.push(A(21,o)),this.mergeStack(),!0;return s.lastToken=r,o.lastToken=this.endStatement(),this.mergeStack(),!0}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([we(13),Je("omit"),we(16),Je("if"),we(16),Je("no"),we(16),Je("ref"),we(13)]);if(t.length!==9){this.popStack();return}let i=new st(G(t[0],t.at(-1)));return this.mergeStack(),i}isDeleteNode(t,i){this.enqueueToStack();let r=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("node")]);if(!r.length)return this.popStack(),!1;let s=r[0],o=s,a=new st;if(a.firstToken=s,r.length===1&&!M(this.currentToken,2)){this._issues.push(A(25,a)),a.lastToken=r.at(-1);let d=new zt(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=r.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=r.at(-1),c!=="/delete-node"?this._issues.push(A(c.startsWith("/delete-n")?34:25,a)):M(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(A(21,a));let l=new zt(a);if(Fn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&i==="Name"&&this._issues.push(A(7,d));let p=d?void 0:this.isLabelRef();p&&i==="Name"&&this._issues.push(A(7,p));let g=d||p?void 0:this.isNodeName();g&&i==="Ref"&&this._issues.push(A(10,g)),!d&&!g&&!p&&this._issues.push(A([7,10],l)),l.nodeNameOrRef=d??p??g??null}else i==="Name"?this._issues.push(A(7,a)):i==="Ref"&&this._issues.push(A(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let i=this.checkConcurrentTokens([we(13),Je("d"),Je("e"),Je("lete"),we(16),Je("property")]);if(!i.length)return this.popStack(),!1;let r=i[0],s=r,o=new st;if(o.firstToken=r,i.length===1&&!M(this.currentToken,2)){this._issues.push(A(25,o)),o.lastToken=i.at(-1);let u=new Ae(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=i.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=i.at(-1),a!=="/delete-property"?this._issues.push(A(a.startsWith("/delete-p")?35:25,o)):M(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(A(21,o));let c=new Ae(o);if(Fn(o.tokenIndexes?.end,r)){let u=this.isPropertyName();u||this._issues.push(A(6,c)),c.propertyName=u??null}else this._issues.push(A(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.processNodePathRef();if(!i){this.popStack();return}let r=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&r.push(...this.processOptionalLabelAssign(!0));let s=new an(t,i,r);return this.mergeStack(),s}processValue(t){this.enqueueToStack();let r=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!M(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=M(this.currentToken,24);d&&this.moveToNextToken;let p=o();if(u&&p===null&&d){let g=new $(G(u,this.currentToken));this._issues.push(A(0,g))}if(!d&&p===null)break;if(l&&!d&&p){let g=new $(G(l));this._issues.push(A(28,g))}c.push(p)}return c})();if(r.length===0){this.popStack();return}return this.mergeStack(),new kc(r)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken;if(!M(i,21)){this.popStack();return}if(!i?.value)throw new Error("Token must have value");let r=i.value;r.match(/["']$/)&&(r=r.slice(1,-1));let s=new Tt(r,G(i));i.value.match(/["']$/)||this._issues.push(A(i.value.startsWith('"')?16:17,s));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new an(t,s,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.currentToken;if(M(r,5))this.moveToNextToken;else{this.popStack();return}let s=this.processArrayValues(t)??null;s.openBracket=r;let o=this.processOptionalLabelAssign(!0)??[],a=new an(i,s,o);M(this.currentToken,4)?(s&&(s.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(A(12,a));let c=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(c=this.processOptionalLabelAssign(!0)),this.mergeStack(),a.endLabels.push(...c),a.firstToken=r,a.lastToken=this.prevToken,a}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),i=this.moveToNextToken,r=i;if(!M(r,11)){this.popStack();return}let s=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];s.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(A(15,u))});let a=new ai(s??[]);a.openBracket=r,a.values.length===0&&(a.firstToken=i,this._issues.push(A(14,a)));let c=new an(t,a,o);M(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(A(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let i=t(),r=[];if(!i)return this.popStack(),[];for(;i;)r=[...r,i],i=t();if(r){let s=t();s&&(r=[...r,s])}return this.mergeStack(),r}processArrayValues(t){this.enqueueToStack();let i=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),r=new Ke(i);return i.length===0&&(r.firstToken=this.currentToken),this.mergeStack(),r}processLabeledHex(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processHex();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Je("0"),Je("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(o=>o.value).join(""),16),s=new vt(r,G(t[0],i.at(-1)));return this.mergeStack(),s}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.checkConcurrentTokens([20,20].map(we));if(!i.length){this.popStack();return}let r=Number.parseInt(i.map(a=>a.value).join(""),16),s=new vt(r,G(i[0],i.at(-1))),o=new wn(s,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(t),r=this.processDec();if(!r){this.popStack();return}let s=new wn(r,i);return this.mergeStack(),s}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(we));if(!t.length){this.popStack();return}let i=Number.parseInt(t.map(s=>s.value).join(""),10),r=new vt(i,G(t[0],t.at(-1)));return this.mergeStack(),r}processLabeledExpression(t=!0,i=t){this.enqueueToStack();let r=[];t&&(r=this.processOptionalLabelAssign(i));let s=this.processExpression();if(!s){this.popStack();return}let o=new wn(s,r);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let i=this.processMacroCallParams();if(!i){this.popStack();return}let r=new Nc(t,i);return this.mergeStack(),r}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),i=this.processExpression();if(!i){this.popStack();return}let r=this.processOptionalLabelAssign(!0),s=new an(t,i,r);return this.mergeStack(),s}processExpression(){this.enqueueToStack();let t=!1,i,r;M(this.currentToken,42)&&(t=!0,i=this.moveToNextToken,r=i);let s=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!s){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?s instanceof Ds?s.addExpression(o,a):s=new Ds(s,{operator:o,expression:a}):this._issues.push(A(27,o)),o=this.isOperator()}M(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(A(26,o??s))}return this.mergeStack(),s}processMacroCallParams(){return M(this.currentToken,42)?this.parseScopedBlock(r=>!!M(r,42),r=>!!M(r,43),r=>!!M(r,24))?.splitTokens.map((r,s)=>{if(r.length===0||M(r[0],24)&&r.length===1)return null;let o=s?r.slice(1):r;return new wc(o.map((a,c)=>{let l=a.value;return a.pos.line===o.at(c+1)?.pos.line&&(l=l.padEnd(o[c+1].pos.col-a.pos.col," ")),l}).join(""),G(o[0],o.at(-1)),s)}):void 0}isLabelRef(t){this.enqueueToStack();let i=this.currentToken;if(M(i,40))this.moveToNextToken;else{this.popStack();return}let r=this.isLabelName();if(!r){let o=new pe(null);return this._issues.push(A(18,t??o)),o.firstToken=i,this.mergeStack(),o}i&&(r.firstToken.pos.line!==i.pos.line||r.firstToken.pos.col!==i.pos.col+i.pos.len)&&this._issues.push(A(29,new $(G(i,r.firstToken))));let s=new pe(r);return s.firstToken=i,this.mergeStack(),s}isLabelRefValue(t){this.enqueueToStack();let i=this.processOptionalLabelAssign(!0),r=this.isLabelRef(t);if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new an(i,r,s);return this.mergeStack(),o}processRefValue(t,i){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.currentToken;if(!M(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new wn(o,r);return this.mergeStack(),l}let a=this.isLabelRef(i);if(a===void 0){this._issues.push(A([18,9],i));let l=new wn(null,r);return l.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),l}let c=new wn(a,r);return c.firstToken=r.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(t=!0,i=new jn){this.enqueueToStack();let r;if(M(this.currentToken,13))r=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(A(19,new $(G(this.prevToken))))}let s=this.isNodeName();return s||this._issues.push(A(7,new $(G(r??this.prevToken)))),i.addPath(s??null,r?new $(G(r)):void 0),this.processNodePath(!1,i),this.mergeStack(),i}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,i=t;if(!M(i,40)){this.popStack();return}let r=this.moveToNextToken;if(i=r,!M(i,2)){this.popStack();return}let s=this.processNodePath(),o=new on(s??null),a=this.currentToken??this.prevToken,c=a;return s?.children.forEach((l,u)=>{if(u===s?.children.length-1&&l&&c&&l.lastToken.pos.col+l.lastToken.pos.len!==c.pos.col){this._issues.push(A(29,new $(G(l.lastToken,c))));return}if(u===0&&r&&r.pos.col+r.pos.len!==l?.firstToken.pos.col){this._issues.push(A(29,new $(G(r,l?.firstToken))));return}let d=s?.children[u+1];l&&d&&l.lastToken.pos.col+l.lastToken.pos.len!==d?.firstToken.pos.col&&this._issues.push(A(29,new $(G(l.lastToken,d?.firstToken))))}),M(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(A(3,new $(G(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof ci)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Mr=z(Q());var nv=require("fs"),iv=require("path");var qr=class{constructor(e,t,i,r=[],s){this.includePaths=t;this.bindingLoader=i;this._issues=[];this.overlays=[];this.overlays=Array.isArray(r)?r:[r],this.overlays.filter(nv.existsSync),this.parser=new As(e,t),this.name=s??(0,iv.basename)(e),this.overlayParsers=this.overlays?.map(o=>new As(o,t))??[]}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.map(e=>e.uri),this.parser.uri,...this.parser.cPreprocessorParser.dtsIncludes.flatMap(e=>e.reolvedPath).filter(e=>!!e)]}isInContext(e){return this.getContextFiles().some(t=>t===e)}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let r=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>s.ast.uri===e&&(!t||qt(s.ast,e,t))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof Tt&&l.compatible===o.value.value);return c?{range:ne(o.value),target:`file://${c.bindingsPath}`}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>s.uri===e&&(!t||qt(s,e,t))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:ne(s.path),target:`file://${o}`}}).filter(s=>s)??[],...r]}linkPropertiesLabelsAndNodePaths(e){let t=s=>[...s.properties,...s.nodes.flatMap(t)],i=t(e.rootNode),r=e.rootNode.allDescendantsLabels;i.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof pe){let a=e.resolvePath([`&${o.label?.value}`],r);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,Mr.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof jn){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let p=a?.getNode(d.name,d.address,!1);d.linksTo=p,!u&&!p&&(u=!0,this._issues.push(A(8,d,Mr.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(g=>g?.linksTo).map(g=>g?.toString()).join("/")}`]))),p?.linkedNodeNamePaths.push(d),a=p}else break}}}))}async reevaluate(e){return this.isInContext(e)?(await this.parser.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}async evaluate(){let e=performance.now();await this.stable();let t=new Sc(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let i=0;i<this.overlayParsers.length;i++)this.processRoot(this.overlayParsers[i].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(i=>i instanceof kn),(await this.getAllParsers()).flatMap(i=>i.tokens).forEach((i,r)=>i.sortKey=r),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let i=0;i<e.children.length;i++){let r=e.children[i];this.processChild(r,t.rootNode,t)}}processChild(e,t,i){e instanceof De?this.processDtcBaseNode(e,t,i):e instanceof Me?this.processDtcProperty(e,t,i):e instanceof zt?this.processDeleteNode(e,t,i):e instanceof Ae&&this.processDeleteProperty(e,t,i)}checkNodeUniqueNames(e,t){let i=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address===a.address)),r=t.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof he&&o.name)i(s,o.name)&&this._issues.push(A(2,o.name)),s.push(o.name);else if(o instanceof zt&&o.nodeNameOrRef instanceof Se){let a=o.nodeNameOrRef;i(r,a)&&(s=s.filter(c=>i(s,c)))}})}processDtcBaseNode(e,t,i){e instanceof Ft?this.processDtcRootNode(e,i):e instanceof he?this.processDtcChildNode(e,t,i):e instanceof rt&&this.processDtcRefNode(e,i)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((i,r)=>i instanceof Me&&r instanceof Ae||r instanceof Me&&i instanceof Ae?0:r instanceof Me?1:0).forEach(i=>this.processChild(i,t.rootNode,t))}processDtcChildNode(e,t,i){if(e.name?.name){let r=e.path?i.resolvePath(e.path):void 0,o=(r?i.rootNode.getChild(r):void 0)??new be(this.bindingLoader,e.name.name,e.name.address,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,t,i))}processDtcRefNode(e,t){let i;if(e.labelReference){let r=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);r?(e.resolveNodePath??=[...r],i=t.rootNode.getChild(r),e.labelReference.linksTo=i,e.labels.forEach(s=>s.lastLinkedTo=i),i?.linkedRefLabels.push(e.labelReference),i?.referencedBy.push(e),e.labels.forEach(s=>{t.labelsUsedCache.set(s.label.value,r)}),i?(t.references.push(e),this.checkNodeUniqueNames(e,i)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,Mr.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((r,s)=>r instanceof De&&s instanceof De?0:r instanceof De?-1:0).forEach(r=>this.processChild(r,i??new be(this.bindingLoader,""),t))}processDtcProperty(e,t,i){e.propertyName?.name&&t.addProperty(new Xe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof Se&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let r=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address);e.nodeNameOrRef.linksTo=r,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address),r?.labels.forEach(s=>{i.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof pe&&e.nodeNameOrRef.value){let r=i.resolvePath([`&${e.nodeNameOrRef.value}`]),s;r?(s=i.rootNode.getChild(r),t.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{i.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)):(i.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,Mr.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof on&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(r=>!r)){let r=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],s=i.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let p=s?.getNode(d.name,d.address,!1);d.linksTo=p,p?.linkedNodeNamePaths.push(d),s=p}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(i.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,Mr.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{i.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof De&&!e.parentNode.pathName&&i.globalDeletes.push(e)}else i.unlinkedDeletes.push(e);e.children.forEach(r=>this.processChild(r,t,i))}processDeleteProperty(e,t,i){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(A(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(r=>this.processChild(r,t,i))}};var ot=z(Q());var rv=require("fs"),Fr=require("path");function lP(n){if(!n||!(n.ast instanceof Cr))return[];let e=i=>i.flatMap(r=>(0,rv.readdirSync)(r,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,Fr.join)((0,Fr.relative)(r,s.parentPath),s.name)}`,kind:ot.CompletionItemKind.File})));if(n.ast.relative)return e([(0,Fr.dirname)(n.ast.uri)]);let t=n.runtime.context.includePaths;return e(t)}var Fc=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>Fc(t.node,e)),...n.nodes.flatMap(t=>Fc(t,e))],md=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>md(t.node,e)),...n.nodes.flatMap(t=>md(t,e))];function uP(n,e){if(!n||!(n.item instanceof Xe)||!(n.ast instanceof pe))return[];let t=i=>md(i,e);return Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Method}))}function fP(n,e){if(!n||n.item!==null||!(n.ast instanceof pe)||!(n.ast.parentNode instanceof rt))return[];let t=i=>Fc(i,e).filter(r=>e(r));return[...Array.from(new Set(t(n.runtime.rootNode).map(i=>i.label.value))).map(i=>({label:i,insertText:`${i} {
229
229
  $1
230
- };`,kind:dt.CompletionItemKind.Value,insertTextFormat:dt.InsertTextFormat.Snippet}))]}function oP(n,e){let t=r=>r?r.parentNode instanceof rt||r.parentNode instanceof qt||r.parentNode instanceof he?!1:t(r.parentNode):!0;if(!n||n.item!==null||!Ze(n.ast)||!t(n.ast))return[];let i=r=>qc(r,e).filter(s=>e(s));return n.ast instanceof st?i(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(i(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:dt.CompletionItemKind.Variable}))}function aP(n,e){if(!n||!(n.item instanceof ye)||n.item===null)return[];let t=i=>[...i.nodes,...i.deletedNodes.filter(r=>!e(r.by)).map(r=>r.node)].flatMap(r=>r.definitions.filter(s=>s instanceof he)).filter(r=>e(r));return n.ast instanceof Te||n.ast instanceof Kt?Array.from(new Set(t(n.item).map(i=>i.name?.toString()))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:dt.CompletionItemKind.Keyword,insertTextFormat:dt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function cP(n,e){if(!n||!(n.item instanceof ye))return[];let t=i=>[...i.properties,...i.deletedProperties.filter(r=>!e(r.by)).map(r=>r.property)].flatMap(r=>[r,...r.allReplaced]).filter(r=>e(r.ast));return n.ast instanceof Pe||n.ast instanceof Ae?Array.from(new Set(t(n.item).map(i=>i.name))).map(i=>({label:`${i}`,kind:dt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:dt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:dt.InsertTextFormat.Snippet}]:[]}function lP(n,e){let t=n?.ast instanceof jn?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof jn))return[];let i=t.pathParts.slice(0,-1);if(i.some(o=>!o))return[];let r=i.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...r],e);return[...o?.nodes.filter(a=>!Ze(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...r,o].join("/")}`,kind:dt.CompletionItemKind.Variable}))}async function tv(n,e,t){return ft(n,e,(i,r)=>[...cP(i,r),...aP(i,r),...oP(i,r),...lP(i,r),...sP(i,r),...rP(i,r)],t)}var $i=G(Q());function uP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if(r instanceof Me)return $i.Location.create(`file://${r.uri}`,ne(r.propertyName??r));if(r instanceof Ae)return $i.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function fP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he)return $i.Location.create(`file://${i.uri}`,ne(i.name??i));if(i instanceof Te)return $i.Location.create(`file://${i.uri}`,ne(i));if(i instanceof pe)return $i.Location.create(`file://${i.uri}`,ne(i.label??i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),$i.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function nv(n,e,t){return ft(n,e,i=>[...fP(i),...uP(i)],t)}var pi=G(Q());function iv(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if((r instanceof Me||r instanceof Ae)&&r.propertyName)return pi.Location.create(`file://${r.uri}`,ne(r.propertyName))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function rv(n,e){if(!e||!(e.ast instanceof Ge))return[];"newName"in n&&(e.ast.parentNode instanceof pe&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof fi&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,i=r=>[...r.definitions.filter(s=>s instanceof he).flatMap(s=>s.labels.map(o=>o.label)),...r.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===t).map(s=>{if(s)return pi.Location.create(`file://${s.uri}`,ne(s))}).filter(s=>s);return e.item instanceof ye&&!Ze(e.ast)?i(e.item):e.ast instanceof Ge&&e.ast.parentNode instanceof pe&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function sv(n){if(!n||!(n.ast instanceof Te))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he&&i.name)return pi.Location.create(`file://${i.uri}`,ne(i.name));if(i instanceof Te)return pi.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Te&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),pi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function ov(n,e,t){let i={};return(await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],t)).forEach(s=>{i[s.uri]??=[],i[s.uri].push(pi.TextEdit.replace(s.range,n.newName))}),{changes:i}}async function av(n,e,t,i){let r=await ft(n,e,s=>[...sv(s),...rv(n,s),...iv(s)],i);if(r.some(s=>t.some(o=>s.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var Fc=G(Q());function dP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast)].map(r=>{if(r instanceof Me)return Fc.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function hP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.definitions,...t.referencedBy].map(i=>{if(i instanceof he)return Fc.Location.create(`file://${i.uri}`,ne(i));if(i instanceof rt)return Fc.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function cv(n,e,t){return ft(n,e,i=>[...hP(i),...dP(i)],t)}var md=G(Q());function pP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return;let e=i=>i.replaces?e(i.replaces):i,t=i=>md.Location.create(`file://${i.ast.uri}`,ne(i.ast.propertyName??i.ast));if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof ye&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(e(i))}}function mP(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return;let e=t=>{let i=t.definitions.at(0);return i?md.Location.create(`file://${i.uri}`,ne(i)):void 0};if(n.item instanceof ye&&!Ze(n.ast))return e(n.item);if(n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Te&&n.ast.linksTo)return e(n.ast.linksTo)}async function lv(n,e,t){return(await ft(n,e,i=>[mP(i)||pP(i)],t)).at(0)}var J=G(Q());var gP=(n,e,t,i,r)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(J.Range.create(J.Position.create(i.range.start.line,n.pos.col+n.pos.len),J.Position.create(i.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.del(i.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),">")]}}}];default:return}},yP=(n,e,t,i,r,s)=>{if(!s)return[];switch(t){case 0:return[{title:`Add Property "${s.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[s]}}}];default:return}};function uv(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>gP(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>yP(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit))}}).filter(a=>!!a),t=e.filter(a=>a.kind===J.CodeActionKind.SourceFixAll),i=e.filter(a=>a.title.startsWith("Add Property")),r=e.filter(a=>a.kind!==J.CodeActionKind.SourceFixAll),s=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return i.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...r,...t.map(a=>({...a,kind:J.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var fv=G(Q());function bP(n){return!n||!(n.item instanceof Xe)||!(n.ast instanceof Me&&(n.ast.values||n.ast.values===null))?[]:n.item.parent.nodeType?.properties.find(e=>e.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]}function TP(n){if(!n||!(n.item instanceof Xe&&n.ast instanceof Pe&&n.item.ast.values===null||n.item instanceof ye)||Ze(n.ast))return[];let e=t=>t.nodeType?.properties.filter(i=>!i.hideAutoComplete&&i.required(t)!=="omitted"&&typeof i.name=="string").map(i=>{let r=t&&i.required(t),s=!!t.properties.some(a=>i.getNameMatch(a.name)),o="a";return r?o=s?"Y":"A":o=s?"Z":"B",{label:`${i.name}`,kind:fv.CompletionItemKind.Property,sortText:`${o}${i.name}`}})??[];return n.item instanceof Xe?e(n.item.parent):e(n.item)}async function dv(n,e,t){return ft(n,e,i=>[...bP(i),...TP(i)],t)}function vP(n){if(n?.item instanceof ye)return{contents:n.item.toMarkupContent(),range:ne(n.ast)};if(n?.ast instanceof Te){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}if(n?.ast.parentNode instanceof pe){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}}function SP(n){if(n?.item instanceof Xe&&n.ast instanceof Pe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:ne(n.ast)}}}function hv(n,e,t){return ft(n,e,i=>[vP(i)||SP(i)],t)}var rw=G(tE());var kE=G(pE(),1);var co=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var ZO={"[: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]},lo=n=>n.replace(/[[\]\\-]/g,"\\$&"),e0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mE=n=>n.join(""),gE=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;s<n.length;){let b=n.charAt(s);if((b==="!"||b==="^")&&s===t+1){l=!0,s++;continue}if(b==="]"&&o&&!c){u=s+1;break}if(o=!0,b==="\\"&&!c){c=!0,s++;continue}if(b==="["&&!c){for(let[w,[R,v,T]]of Object.entries(ZO))if(n.startsWith(w,s)){if(d)return["$.",!1,n.length-t,!0];s+=w.length,T?r.push(R):i.push(R),a=a||v;continue e}}if(c=!1,d){b>d?i.push(lo(d)+"-"+lo(b)):b===d&&i.push(lo(b)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(lo(b+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=b,s+=2;continue}i.push(lo(b)),s++}if(u<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,n.length-t,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let b=i[0].length===2?i[0].slice(-1):i[0];return[e0(b),!1,u-t,!1]}let p="["+(l?"^":"")+mE(i)+"]",g="["+(l?"":"^")+mE(r)+"]";return[i.length&&r.length?"("+p+"|"+g+")":i.length?p:g,a,u-t,!0]};var un=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var t0=new Set(["!","?","+","*","@"]),yE=n=>t0.has(n),n0="(?!(?:^|/)\\.\\.?(?:$|/))",Ml="(?!\\.)",i0=new Set(["[","."]),r0=new Set(["..","."]),s0=new Set("().*{}+?[]^$\\!"),o0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Jh="[^/]",bE=Jh+"*?",TE=Jh+"+?",Kr=class n{type;#e;#t;#s=!1;#i=[];#o;#v;#l;#f=!1;#a;#c;#r=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,i=t.#o;for(;i;){for(let r=t.#v+1;!i.type&&r<i.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[r])}t=i,i=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let t=0;t<this.#v;t++){let i=e.#i[t];if(!(i instanceof n&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#y(e,t,i,r){let s=!1,o=!1,a=-1,c=!1;if(t.type===null){let g=i,_="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,_+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(c=!0):b==="]"&&!(g===a+2&&c)&&(o=!1),_+=b;continue}else if(b==="["){o=!0,a=g,c=!1,_+=b;continue}if(!r.noext&&yE(b)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(b,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=b}return t.push(_),g}let l=i+1,u=new n(null,t),d=[],p="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,p+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(l===a+2&&c)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=l,c=!1,p+=g;continue}if(yE(g)&&e.charAt(l)==="("){u.push(p),p="";let _=new n(g,u);u.push(_),l=n.#y(e,_,l,r);continue}if(g==="|"){u.push(p),p="",d.push(u),u=new n(null,t);continue}if(g===")")return p===""&&t.#i.length===0&&(t.#r=!0),u.push(p),p="",t.push(...d,u),l;p+=g}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],l}static fromGlob(e,t={}){let i=new n(null,void 0,t);return n.#y(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,r,s]=this.toRegExpSource();if(!(r||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#i.map(g=>{let[_,b,w,R]=typeof g=="string"?n.#d(g,this.#t,c):g.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||R,_}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&r0.has(this.#i[0]))){let _=i0,b=t&&_.has(l.charAt(0))||l.startsWith("\\.")&&_.has(l.charAt(2))||l.startsWith("\\.\\.")&&_.has(l.charAt(4)),w=!t&&!e&&_.has(l.charAt(0));u=b?n0:w?Ml:""}let d="";return this.isEnd()&&this.#e.#f&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,un(l),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,un(this.toString()),!1,!1]}let o=!i||e||t||!Ml?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!t?Ml:"")+TE;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Ml:"")+bE+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+c}return[a,un(s),this.#t=!!this.#t,this.#s]}#h(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,r,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#d(e,t,i=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(r){r=!1,s+=(s0.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(c==="["){let[l,u,d,p]=gE(e,a);if(d){s+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){i&&e==="*"?s+=TE:s+=bE,t=!0;continue}if(c==="?"){s+=Jh,t=!0;continue}s+=o0(c)}return[s,un(e),!!t,o]}};var zr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var Nt=(n,e,t={})=>(co(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Bt(e,t).match(n)),a0=/^\*+([^+@!?\*\[\(]*)$/,c0=n=>e=>!e.startsWith(".")&&e.endsWith(n),l0=n=>e=>e.endsWith(n),u0=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),f0=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),d0=/^\*+\.\*+$/,h0=n=>!n.startsWith(".")&&n.includes("."),p0=n=>n!=="."&&n!==".."&&n.includes("."),m0=/^\.\*+$/,g0=n=>n!=="."&&n!==".."&&n.startsWith("."),y0=/^\*+$/,b0=n=>n.length!==0&&!n.startsWith("."),T0=n=>n.length!==0&&n!=="."&&n!=="..",v0=/^\?+([^+@!?\*\[\(]*)?$/,S0=([n,e=""])=>{let t=EE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},k0=([n,e=""])=>{let t=wE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},E0=([n,e=""])=>{let t=wE([n]);return e?i=>t(i)&&i.endsWith(e):t},w0=([n,e=""])=>{let t=EE([n]);return e?i=>t(i)&&i.endsWith(e):t},EE=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},wE=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},NE=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",vE={win32:{sep:"\\"},posix:{sep:"/"}},N0=NE==="win32"?vE.win32.sep:vE.posix.sep;Nt.sep=N0;var pt=Symbol("globstar **");Nt.GLOBSTAR=pt;var _0="[^/]",P0=_0+"*?",D0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",R0="(?:(?!(?:\\/|^)\\.).)*?",C0=(n,e={})=>t=>Nt(t,n,e);Nt.filter=C0;var Gt=(n,e={})=>Object.assign({},n,e),O0=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Nt;let e=Nt;return Object.assign((i,r,s={})=>e(i,r,Gt(n,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Gt(n,s))}static defaults(r){return e.defaults(Gt(n,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Gt(n,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Gt(n,s))}},unescape:(i,r={})=>e.unescape(i,Gt(n,r)),escape:(i,r={})=>e.escape(i,Gt(n,r)),filter:(i,r={})=>e.filter(i,Gt(n,r)),defaults:i=>e.defaults(Gt(n,i)),makeRe:(i,r={})=>e.makeRe(i,Gt(n,r)),braceExpand:(i,r={})=>e.braceExpand(i,Gt(n,r)),match:(i,r,s={})=>e.match(i,r,Gt(n,s)),sep:e.sep,GLOBSTAR:pt})};Nt.defaults=O0;var _E=(n,e={})=>(co(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,kE.default)(n));Nt.braceExpand=_E;var A0=(n,e={})=>new Bt(n,e).makeRe();Nt.makeRe=A0;var I0=(n,e,t={})=>{let i=new Bt(e,t);return n=n.filter(r=>i.match(r)),i.options.nonull&&!n.length&&n.push(e),n};Nt.match=I0;var SE=/[?*]|[+@!]\(.*?\)|\[|\]/,L0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){co(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||NE,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!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 i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!SE.test(s[2]))&&!SE.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.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 i=0;i<e.length;i++)for(let r=0;r<e[i].length;r++)e[i][r]==="**"&&(e[i][r]="*");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 i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let r=i;for(;t[r+1]==="**";)r++;r!==i&&t.splice(i,r-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let r=e[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let o=r;for(;i[o+1]==="**";)o++;o>r&&i.splice(r+1,o-r);let a=i[r+1],c=i[r+2],l=i[r+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,i.splice(r,1);let u=i.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(t=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let o=i[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let r=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(r){e[t]=[],e[i]=r;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<t.length;)if(e[r]===t[s])o.push(a==="b"?t[s]:e[r]),r++,s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])o.push(e[r]),r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])o.push(t[s]),s++;else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),r++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let r=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),R=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!R&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:b?0:void 0,N=v?3:R?0:void 0;if(typeof T=="number"&&typeof N=="number"){let[L,q]=[e[T],t[N]];L.toLowerCase()===q.toLowerCase()&&(t[N]=L,N>T?t=t.slice(N):T>N&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===pt){this.debug("GLOBSTAR",[t,u,d]);var p=o,g=a+1;if(g===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var _=e[p];if(this.debug(`
230
+ };`,kind:ot.CompletionItemKind.Value,insertTextFormat:ot.InsertTextFormat.Snippet}))]}function dP(n,e){let t=r=>r?r.parentNode instanceof rt||r.parentNode instanceof Ft||r.parentNode instanceof he?!1:t(r.parentNode):!0;if(!n||n.item!==null||!Ze(n.ast)||!t(n.ast))return[];let i=r=>Fc(r,e).filter(s=>e(s));return n.ast instanceof st?i(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(i(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:ot.CompletionItemKind.Variable}))}function hP(n,e){if(!n||!(n.item instanceof be)||n.item===null)return[];let t=i=>[...i.nodes,...i.deletedNodes.filter(r=>!e(r.by)).map(r=>r.node)].flatMap(r=>r.definitions.filter(s=>s instanceof he)).filter(r=>e(r));return n.ast instanceof Se||n.ast instanceof zt?Array.from(new Set(t(n.item).map(i=>i.name?.toString()))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:ot.CompletionItemKind.Keyword,insertTextFormat:ot.InsertTextFormat.Snippet,sortText:"~"}]:[]}function pP(n,e){if(!n||!(n.item instanceof be))return[];let t=i=>[...i.properties,...i.deletedProperties.filter(r=>!e(r.by)).map(r=>r.property)].flatMap(r=>[r,...r.allReplaced]).filter(r=>e(r.ast));return n.ast instanceof Pe||n.ast instanceof Ae?Array.from(new Set(t(n.item).map(i=>i.name))).map(i=>({label:`${i}`,kind:ot.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:ot.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:ot.InsertTextFormat.Snippet}]:[]}function mP(n,e){let t=n?.ast instanceof jn?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof jn))return[];let i=t.pathParts.slice(0,-1);if(i.some(o=>!o))return[];let r=i.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...r],e);return[...o?.nodes.filter(a=>!Ze(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...r,o].join("/")}`,kind:ot.CompletionItemKind.Variable}))}async function sv(n,e,t){return dt(n,e,(i,r)=>[...pP(i,r),...hP(i,r),...dP(i,r),...mP(i,r),...fP(i,r),...uP(i,r),...lP(i)],t)}var Wi=z(Q());function gP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if(r instanceof Me)return Wi.Location.create(`file://${r.uri}`,ne(r.propertyName??r));if(r instanceof Ae)return Wi.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function yP(n){if(!n||!(n.ast instanceof Se)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he)return Wi.Location.create(`file://${i.uri}`,ne(i.name??i));if(i instanceof Se)return Wi.Location.create(`file://${i.uri}`,ne(i));if(i instanceof pe)return Wi.Location.create(`file://${i.uri}`,ne(i.label??i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Se&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),Wi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function ov(n,e,t){return dt(n,e,i=>[...yP(i),...gP(i)],t)}var mi=z(Q());function av(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast),i.parent.deletedProperties.find(r=>r.property=i)?.by??[]].map(r=>{if((r instanceof Me||r instanceof Ae)&&r.propertyName)return mi.Location.create(`file://${r.uri}`,ne(r.propertyName))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function cv(n,e){if(!e||!(e.ast instanceof Ge))return[];"newName"in n&&(e.ast.parentNode instanceof pe&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof di&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,i=r=>[...r.definitions.filter(s=>s instanceof he).flatMap(s=>s.labels.map(o=>o.label)),...r.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===t).map(s=>{if(s)return mi.Location.create(`file://${s.uri}`,ne(s))}).filter(s=>s);return e.item instanceof be&&!Ze(e.ast)?i(e.item):e.ast instanceof Ge&&e.ast.parentNode instanceof pe&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function lv(n){if(!n||!(n.ast instanceof Se))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(i=>{if(i instanceof he&&i.name)return mi.Location.create(`file://${i.uri}`,ne(i.name));if(i instanceof Se)return mi.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Se&&n.ast.linksTo?Ze(n.ast)?[...e(n.ast.linksTo),mi.Location.create(`file://${n.ast.uri}`,ne(n.ast))]:e(n.ast.linksTo):[]}async function uv(n,e,t){let i={};return(await dt(n,e,s=>[...lv(s),...cv(n,s),...av(s)],t)).forEach(s=>{i[s.uri]??=[],i[s.uri].push(mi.TextEdit.replace(s.range,n.newName))}),{changes:i}}async function fv(n,e,t,i){let r=await dt(n,e,s=>[...lv(s),...cv(n,s),...av(s)],i);if(r.some(s=>t.some(o=>s.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var Bc=z(Q());function bP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return[];let e=i=>i.replacedBy?e(i.replacedBy):i,t=i=>[i.ast,...i.allReplaced.map(r=>r.ast)].map(r=>{if(r instanceof Me)return Bc.Location.create(`file://${r.uri}`,ne(r.propertyName??r))}).filter(r=>r);if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(i)}return[]}function TP(n){if(!n||!(n.ast instanceof Se)&&!(n.ast instanceof Ge))return[];let e=t=>[...t.definitions,...t.referencedBy].map(i=>{if(i instanceof he)return Bc.Location.create(`file://${i.uri}`,ne(i));if(i instanceof rt)return Bc.Location.create(`file://${i.uri}`,ne(i))}).filter(i=>i);return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Se&&n.ast.linksTo?e(n.ast.linksTo):[]}async function dv(n,e,t){return dt(n,e,i=>[...TP(i),...bP(i)],t)}var gd=z(Q());function vP(n){if(!n||n.item===null||!(n.ast instanceof Pe))return;let e=i=>i.replaces?e(i.replaces):i,t=i=>gd.Location.create(`file://${i.ast.uri}`,ne(i.ast.propertyName??i.ast));if(n.item instanceof Xe&&n.ast instanceof Pe)return t(e(n.item));if(n.item instanceof be&&n.ast instanceof Pe&&n.ast.parentNode instanceof Ae){let i=n.item.deletedProperties.find(r=>r.by===n.ast.parentNode)?.property;if(i)return t(e(i))}}function SP(n){if(!n||!(n.ast instanceof Se)&&!(n.ast instanceof Ge))return;let e=t=>{let i=t.definitions.at(0);return i?gd.Location.create(`file://${i.uri}`,ne(i)):void 0};if(n.item instanceof be&&!Ze(n.ast))return e(n.item);if(n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Se&&n.ast.linksTo)return e(n.ast.linksTo)}async function hv(n,e,t){return(await dt(n,e,i=>[SP(i)||vP(i)],t)).at(0)}var J=z(Q());var kP=(n,e,t,i,r)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(J.Range.create(J.Position.create(i.range.start.line,n.pos.col+n.pos.len),J.Position.create(i.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.del(i.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.replace(i.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[i],kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[r]:[J.TextEdit.insert(J.Position.create(i.range.end.line,i.range.end.character),">")]}}}];default:return}},EP=(n,e,t,i,r,s)=>{if(!s)return[];switch(t){case 0:return[{title:`Add Property "${s.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[i],kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:[s]}}}];default:return}};function pv(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>kP(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>EP(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit))}}).filter(a=>!!a),t=e.filter(a=>a.kind===J.CodeActionKind.SourceFixAll),i=e.filter(a=>a.title.startsWith("Add Property")),r=e.filter(a=>a.kind!==J.CodeActionKind.SourceFixAll),s=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return i.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...r,...t.map(a=>({...a,kind:J.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:J.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:J.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var mv=z(Q());function wP(n){return!n||!(n.item instanceof Xe)||!(n.ast instanceof Me&&(n.ast.values||n.ast.values===null))?[]:n.item.parent.nodeType?.properties.find(e=>e.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]}function NP(n){if(!n||!(n.item instanceof Xe&&n.ast instanceof Pe&&n.item.ast.values===null||n.item instanceof be)||Ze(n.ast))return[];let e=t=>t.nodeType?.properties.filter(i=>!i.hideAutoComplete&&i.required(t)!=="omitted"&&typeof i.name=="string").map(i=>{let r=t&&i.required(t),s=!!t.properties.some(a=>i.getNameMatch(a.name)),o="a";return r?o=s?"Y":"A":o=s?"Z":"B",{label:`${i.name}`,kind:mv.CompletionItemKind.Property,sortText:`${o}${i.name}`}})??[];return n.item instanceof Xe?e(n.item.parent):e(n.item)}async function gv(n,e,t){return dt(n,e,i=>[...wP(i),...NP(i)],t)}function _P(n){if(n?.item instanceof be)return{contents:n.item.toMarkupContent(),range:ne(n.ast)};if(n?.ast instanceof Se){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}if(n?.ast.parentNode instanceof pe){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:ne(n.ast)}}}function PP(n){if(n?.item instanceof Xe&&n.ast instanceof Pe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:ne(n.ast)}}}function yv(n,e,t){return dt(n,e,i=>[_P(i)||PP(i)],t)}var cw=z(sE());var _E=z(bE(),1);var uo=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var s0={"[: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]},fo=n=>n.replace(/[[\]\\-]/g,"\\$&"),o0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),TE=n=>n.join(""),vE=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;s<n.length;){let b=n.charAt(s);if((b==="!"||b==="^")&&s===t+1){l=!0,s++;continue}if(b==="]"&&o&&!c){u=s+1;break}if(o=!0,b==="\\"&&!c){c=!0,s++;continue}if(b==="["&&!c){for(let[w,[R,v,T]]of Object.entries(s0))if(n.startsWith(w,s)){if(d)return["$.",!1,n.length-t,!0];s+=w.length,T?r.push(R):i.push(R),a=a||v;continue e}}if(c=!1,d){b>d?i.push(fo(d)+"-"+fo(b)):b===d&&i.push(fo(b)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(fo(b+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=b,s+=2;continue}i.push(fo(b)),s++}if(u<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,n.length-t,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let b=i[0].length===2?i[0].slice(-1):i[0];return[o0(b),!1,u-t,!1]}let p="["+(l?"^":"")+TE(i)+"]",g="["+(l?"":"^")+TE(r)+"]";return[i.length&&r.length?"("+p+"|"+g+")":i.length?p:g,a,u-t,!0]};var fn=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var a0=new Set(["!","?","+","*","@"]),SE=n=>a0.has(n),c0="(?!(?:^|/)\\.\\.?(?:$|/))",ql="(?!\\.)",l0=new Set(["[","."]),u0=new Set(["..","."]),f0=new Set("().*{}+?[]^$\\!"),d0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Zh="[^/]",kE=Zh+"*?",EE=Zh+"+?",Gr=class n{type;#e;#t;#s=!1;#i=[];#o;#v;#l;#f=!1;#a;#c;#r=!1;constructor(e,t,i={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#f&&this.#l.push(this),this.#v=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,i=t.#o;for(;i;){for(let r=t.#v+1;!i.type&&r<i.#i.length;r++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[r])}t=i,i=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let t=0;t<this.#v;t++){let i=e.#i[t];if(!(i instanceof n&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let i of this.#i)t.copyIn(i);return t}static#y(e,t,i,r){let s=!1,o=!1,a=-1,c=!1;if(t.type===null){let g=i,_="";for(;g<e.length;){let b=e.charAt(g++);if(s||b==="\\"){s=!s,_+=b;continue}if(o){g===a+1?(b==="^"||b==="!")&&(c=!0):b==="]"&&!(g===a+2&&c)&&(o=!1),_+=b;continue}else if(b==="["){o=!0,a=g,c=!1,_+=b;continue}if(!r.noext&&SE(b)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(b,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=b}return t.push(_),g}let l=i+1,u=new n(null,t),d=[],p="";for(;l<e.length;){let g=e.charAt(l++);if(s||g==="\\"){s=!s,p+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(l===a+2&&c)&&(o=!1),p+=g;continue}else if(g==="["){o=!0,a=l,c=!1,p+=g;continue}if(SE(g)&&e.charAt(l)==="("){u.push(p),p="";let _=new n(g,u);u.push(_),l=n.#y(e,_,l,r);continue}if(g==="|"){u.push(p),p="",d.push(u),u=new n(null,t);continue}if(g===")")return p===""&&t.#i.length===0&&(t.#r=!0),u.push(p),p="",t.push(...d,u),l;p+=g}return t.type=null,t.#t=void 0,t.#i=[e.substring(i-1)],l}static fromGlob(e,t={}){let i=new n(null,void 0,t);return n.#y(e,i,0,t),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,i,r,s]=this.toRegExpSource();if(!(r||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#i.map(g=>{let[_,b,w,R]=typeof g=="string"?n.#d(g,this.#t,c):g.toRegExpSource(e);return this.#t=this.#t||w,this.#s=this.#s||R,_}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&u0.has(this.#i[0]))){let _=l0,b=t&&_.has(l.charAt(0))||l.startsWith("\\.")&&_.has(l.charAt(2))||l.startsWith("\\.\\.")&&_.has(l.charAt(4)),w=!t&&!e&&_.has(l.charAt(0));u=b?c0:w?ql:""}let d="";return this.isEnd()&&this.#e.#f&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,fn(l),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,fn(this.toString()),!1,!1]}let o=!i||e||t||!ql?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#r)a=(this.isStart()&&!t?ql:"")+EE;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ql:"")+kE+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+s+c}return[a,fn(s),this.#t=!!this.#t,this.#s]}#h(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[i,r,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,i}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#d(e,t,i=!1){let r=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(r){r=!1,s+=(f0.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":r=!0;continue}if(c==="["){let[l,u,d,p]=vE(e,a);if(d){s+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){i&&e==="*"?s+=EE:s+=kE,t=!0;continue}if(c==="?"){s+=Zh,t=!0;continue}s+=d0(c)}return[s,fn(e),!!t,o]}};var Xr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var Nt=(n,e,t={})=>(uo(e),!t.nocomment&&e.charAt(0)==="#"?!1:new jt(e,t).match(n)),h0=/^\*+([^+@!?\*\[\(]*)$/,p0=n=>e=>!e.startsWith(".")&&e.endsWith(n),m0=n=>e=>e.endsWith(n),g0=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),y0=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),b0=/^\*+\.\*+$/,T0=n=>!n.startsWith(".")&&n.includes("."),v0=n=>n!=="."&&n!==".."&&n.includes("."),S0=/^\.\*+$/,k0=n=>n!=="."&&n!==".."&&n.startsWith("."),E0=/^\*+$/,w0=n=>n.length!==0&&!n.startsWith("."),N0=n=>n.length!==0&&n!=="."&&n!=="..",_0=/^\?+([^+@!?\*\[\(]*)?$/,P0=([n,e=""])=>{let t=PE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},D0=([n,e=""])=>{let t=DE([n]);return e?(e=e.toLowerCase(),i=>t(i)&&i.toLowerCase().endsWith(e)):t},R0=([n,e=""])=>{let t=DE([n]);return e?i=>t(i)&&i.endsWith(e):t},C0=([n,e=""])=>{let t=PE([n]);return e?i=>t(i)&&i.endsWith(e):t},PE=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},DE=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},RE=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wE={win32:{sep:"\\"},posix:{sep:"/"}},O0=RE==="win32"?wE.win32.sep:wE.posix.sep;Nt.sep=O0;var pt=Symbol("globstar **");Nt.GLOBSTAR=pt;var A0="[^/]",I0=A0+"*?",L0="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",x0="(?:(?!(?:\\/|^)\\.).)*?",M0=(n,e={})=>t=>Nt(t,n,e);Nt.filter=M0;var Xt=(n,e={})=>Object.assign({},n,e),q0=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Nt;let e=Nt;return Object.assign((i,r,s={})=>e(i,r,Xt(n,s)),{Minimatch:class extends e.Minimatch{constructor(r,s={}){super(r,Xt(n,s))}static defaults(r){return e.defaults(Xt(n,r)).Minimatch}},AST:class extends e.AST{constructor(r,s,o={}){super(r,s,Xt(n,o))}static fromGlob(r,s={}){return e.AST.fromGlob(r,Xt(n,s))}},unescape:(i,r={})=>e.unescape(i,Xt(n,r)),escape:(i,r={})=>e.escape(i,Xt(n,r)),filter:(i,r={})=>e.filter(i,Xt(n,r)),defaults:i=>e.defaults(Xt(n,i)),makeRe:(i,r={})=>e.makeRe(i,Xt(n,r)),braceExpand:(i,r={})=>e.braceExpand(i,Xt(n,r)),match:(i,r,s={})=>e.match(i,r,Xt(n,s)),sep:e.sep,GLOBSTAR:pt})};Nt.defaults=q0;var CE=(n,e={})=>(uo(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,_E.default)(n));Nt.braceExpand=CE;var F0=(n,e={})=>new jt(n,e).makeRe();Nt.makeRe=F0;var B0=(n,e,t={})=>{let i=new jt(e,t);return n=n.filter(r=>i.match(r)),i.options.nonull&&!n.length&&n.push(e),n};Nt.match=B0;var NE=/[?*]|[+@!]\(.*?\)|\[|\]/,j0=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){uo(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||RE,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!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 i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!NE.test(s[2]))&&!NE.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(u=>this.parse(u))];if(l)return[s[0],...s.slice(1).map(u=>this.parse(u))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.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 i=0;i<e.length;i++)for(let r=0;r<e[i].length;r++)e[i][r]==="**"&&(e[i][r]="*");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 i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let r=i;for(;t[r+1]==="**";)r++;r!==i&&t.splice(i,r-i)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){let s=e[r];r===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(r,1),r--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let r=e[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(t=!0,e.splice(i-1,2),i-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let i of e){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let o=r;for(;i[o+1]==="**";)o++;o>r&&i.splice(r+1,o-r);let a=i[r+1],c=i[r+2],l=i[r+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,i.splice(r,1);let u=i.slice(0);u[r]="**",e.push(u),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(t=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let o=i[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let r=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(r){e[t]=[],e[i]=r;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=!1){let r=0,s=0,o=[],a="";for(;r<e.length&&s<t.length;)if(e[r]===t[s])o.push(a==="b"?t[s]:e[r]),r++,s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])o.push(e[r]),r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])o.push(t[s]),s++;else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[r]),r++,s++}else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),r++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,i=0;for(let r=0;r<e.length&&e.charAt(r)==="!";r++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t}matchOne(e,t,i=!1){let r=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),R=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!R&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),T=w?3:b?0:void 0,N=v?3:R?0:void 0;if(typeof T=="number"&&typeof N=="number"){let[L,q]=[e[T],t[N]];L.toLowerCase()===q.toLowerCase()&&(t[N]=L,N>T?t=t.slice(N):T>N&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===pt){this.debug("GLOBSTAR",[t,u,d]);var p=o,g=a+1;if(g===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!r.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var _=e[p];if(this.debug(`
231
231
  globstar while`,e,p,t,g,_),this.matchOne(e.slice(p),t.slice(g),i))return this.debug("globstar found match!",p,c,_),!0;if(_==="."||_===".."||!r.dot&&_.charAt(0)==="."){this.debug("dot detected!",e,p,t,g);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(i&&(this.debug(`
232
- >>> no match, partial?`,e,p,t,g),p===c))}let b;if(typeof u=="string"?(b=d===u,this.debug("string match",u,d,b)):(b=u.test(d),this.debug("pattern match",u,d,b)),!b)return!1}if(o===c&&a===l)return!0;if(o===c)return i;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return _E(this.pattern,this.options)}parse(e){co(e);let t=this.options;if(e==="**")return pt;if(e==="")return"";let i,r=null;(i=e.match(y0))?r=t.dot?T0:b0:(i=e.match(a0))?r=(t.nocase?t.dot?f0:u0:t.dot?l0:c0)(i[1]):(i=e.match(v0))?r=(t.nocase?t.dot?k0:S0:t.dot?E0:w0)(i):(i=e.match(d0))?r=t.dot?p0:h0:(i=e.match(m0))&&(r=g0);let s=Kr.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),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,i=t.noglobstar?P0:t.dot?D0:R0,r=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))r.add(d);return typeof u=="string"?L0(u):u===pt?pt:u._src});return l.forEach((u,d)=>{let p=l[d+1],g=l[d-1];u!==pt||g===pt||(g===void 0?p!==void 0&&p!==pt?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=g+"(?:\\/|"+i+")?":p!==pt&&(l[d-1]=g+"(?:\\/|\\/"+i+"\\/)"+p,l[d+1]=pt))}),l.filter(u=>u!==pt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let c=s[a],l=r;if(i.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Nt.defaults(e).Minimatch}};Nt.AST=Kr;Nt.Minimatch=Bt;Nt.escape=zr;Nt.unescape=un;var XE=require("node:url");var Gr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,DE=new Set,Zh=typeof process=="object"&&process?process:{},RE=(n,e,t,i)=>{typeof Zh.emitWarning=="function"?Zh.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},ql=globalThis.AbortController,PE=globalThis.AbortSignal;if(typeof ql>"u"){PE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},ql=class{constructor(){e()}signal=new PE;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=Zh.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,RE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var x0=n=>!DE.has(n),rW=Symbol("type"),wi=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),CE=n=>wi(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Xr:null:null,Xr=class extends Array{constructor(e){super(e),this.fill(0)}},ep=class n{heap;length;static#e=!1;static create(e){let t=CE(e);if(!t)return[];n.#e=!0;let i=new n(e,t);return n.#e=!1,i}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},uo=class n{#e;#t;#s;#i;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#c;#r;#g;#y;#h;#d;#E;#m;#w;#N;#T;#S;#k;#p;static unsafeExposeInternals(e){return{starts:e.#N,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#r,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#d},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,i,r,s)=>e.#F(t,i,r,s),moveToTail:t=>e.#j(t),indexes:t=>e.#P(t),rindexes:t=>e.#D(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:w,memoMethod:R,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:L,ignoreFetchAbort:q}=e;if(t!==0&&!wi(t))throw new TypeError("max option must be a nonnegative integer");let H=t?CE(t):Array;if(!H)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=R,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#k=!!w,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#r=new Array(t).fill(void 0),this.#g=new H(t),this.#y=new H(t),this.#h=0,this.#d=0,this.#E=ep.create(t),this.#l=0,this.#f=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#S=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#t!==0&&!wi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=wi(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!wi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";x0(j)&&(DE.add(j),RE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new Xr(this.#e),t=new Xr(this.#e);this.#T=e,this.#N=t,this.#A=(s,o,a=Gr.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#O(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#_=s=>{t[s]=e[s]!==0?Gr.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=Gr.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#b=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#_=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Xr(this.#e);this.#f=0,this.#w=e,this.#I=t=>{this.#f-=e[t],e[t]=0},this.#x=(t,i,r,s)=>{if(this.#u(i))return 0;if(!wi(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!wi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,i,r)=>{if(e[t]=i,this.#t){let s=this.#t-e[t];for(;this.#f>s;)this.#q(!0)}this.#f+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#f)}}#I=e=>{};#L=(e,t,i)=>{};#x=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#d;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#d));)t=this.#g[t]}#M(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*rentries(){for(let e of this.#D())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#D())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#c[i],this))return this.get(this.#c[i],t)}}forEach(e,t=this){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#r[t],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#T&&this.#N){let o=this.#T[t],a=this.#N[t];if(o&&a){let c=o-(Gr.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#c[t],r=this.#r[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#T&&this.#N){o.ttl=this.#T[t];let a=Gr.now()-this.#N[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=Gr.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#x(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#d:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#r[d]=t,this.#a.set(e,d),this.#g[this.#d]=d,this.#y[d]=this.#d,this.#d=d,this.#l++,this.#L(d,u,c),c&&(c.set="add"),l=!1;else{this.#j(d);let p=this.#r[d];if(t!==p){if(this.#k&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=p;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#m?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]));if(this.#I(d),this.#L(d,u,c),this.#r[d]=t,c){c.set="replace";let g=p&&this.#u(p)?p.__staleWhileFetching:p;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(r!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#A(d,r,s),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let p=this.#m,g;for(;g=p?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#r[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#q(e){let t=this.#h,i=this.#c[t],r=this.#r[t];return this.#k&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(r,i,"evict"),this.#p&&this.#m?.push([r,i,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#r[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#d=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(i),this.#l--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#a.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))r&&(r.has="stale",this.#n(r,s));else return i&&this.#_(s),r&&(r.has="hit",this.#n(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!i&&this.#b(r))return;let s=this.#r[r];return this.#u(s)?s.__staleWhileFetching:s}#F(e,t,i,r){let s=t===void 0?void 0:this.#r[t];if(this.#u(s))return s;let o=new ql,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(b,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(R&&!w?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),R&&!v&&!w)return d(o.signal.reason);let T=g;return this.#r[t]===g&&(b===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),d(b)),d=b=>{let{aborted:w}=o.signal,R=w&&i.allowStaleOnFetchAbort,v=R||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,N=g;if(this.#r[t]===g&&(!T||N.__staleWhileFetching===void 0?this.#O(e,"fetch"):R||(this.#r[t]=N.__staleWhileFetching)),v)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw b},p=(b,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>b(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=v=>l(v,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(p).then(l,u),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...c.options,status:void 0}),t=this.#a.get(e)):this.#r[t]=_,_}#u(e){if(!this.#k)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ql}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:w=!1,status:R,signal:v}=t;if(!this.#k)return R&&(R.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:R});let T={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:R,signal:v},N=this.#a.get(e);if(N===void 0){R&&(R.fetch="miss");let L=this.#F(e,N,T,b);return L.__returned=L}else{let L=this.#r[N];if(this.#u(L)){let Be=i&&L.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",Be&&(R.returnedStale=!0)),Be?L.__staleWhileFetching:L.__returned=L}let q=this.#b(N);if(!w&&!q)return R&&(R.fetch="hit"),this.#j(N),r&&this.#_(N),R&&this.#n(R,N),L;let H=this.#F(e,N,T,b),ie=H.__staleWhileFetching!==void 0&&i;return R&&(R.fetch=q?"stale":"refresh",ie&&q&&(R.returnedStale=!0)),ie?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#r[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#j(a),r&&this.#_(a),c))}else o&&(o.get="miss")}#B(e,t){this.#y[t]=e,this.#g[e]=t}#j(e){e!==this.#d&&(e===this.#h?this.#h=this.#g[e]:this.#B(this.#y[e],this.#g[e]),this.#B(this.#d,e),this.#d=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let i=!1;if(this.#l!==0){let r=this.#a.get(e);if(r!==void 0)if(i=!0,this.#l===1)this.#U(t);else{this.#I(r);let s=this.#r[r];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,t),this.#p&&this.#m?.push([s,e,t])),this.#a.delete(e),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#d)this.#d=this.#y[r];else if(r===this.#h)this.#h=this.#g[r];else{let o=this.#y[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#y[a]=this.#y[r]}this.#l--,this.#E.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,s;for(;s=r?.shift();)this.#i?.(...s)}return i}clear(){return this.#U("delete")}#U(e){for(let t of this.#D({allowStale:!0})){let i=this.#r[t];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#c[t];this.#S&&this.#s?.(i,r,e),this.#p&&this.#m?.push([i,r,e])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#T&&this.#N&&(this.#T.fill(0),this.#N.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#d=0,this.#E.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};var Zr=require("node:path"),jE=require("node:url"),Rn=require("fs"),H0=G(require("node:fs"),1),Pi=require("node:fs/promises");var Vl=require("node:events"),ap=G(require("node:stream"),1),xE=require("node:string_decoder"),OE=typeof process=="object"&&process?process:{stdout:null,stderr:null},M0=n=>!!n&&typeof n=="object"&&(n instanceof _i||n instanceof ap.default||q0(n)||F0(n)),q0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ap.default.Writable.prototype.pipe,F0=n=>!!n&&typeof n=="object"&&n instanceof Vl.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Wn=Symbol("EOF"),Vn=Symbol("maybeEmitEnd"),Ni=Symbol("emittedEnd"),Fl=Symbol("emittingEnd"),fo=Symbol("emittedError"),Bl=Symbol("closed"),AE=Symbol("read"),jl=Symbol("flush"),IE=Symbol("flushChunk"),fn=Symbol("encoding"),Qr=Symbol("decoder"),ot=Symbol("flowing"),ho=Symbol("paused"),Jr=Symbol("resume"),at=Symbol("buffer"),_t=Symbol("pipes"),ct=Symbol("bufferLength"),tp=Symbol("bufferPush"),Ul=Symbol("bufferShift"),St=Symbol("objectMode"),Ve=Symbol("destroyed"),np=Symbol("error"),ip=Symbol("emitData"),LE=Symbol("emitEnd"),rp=Symbol("emitEnd2"),Pn=Symbol("async"),sp=Symbol("abort"),$l=Symbol("aborted"),po=Symbol("signal"),Xi=Symbol("dataListeners"),jt=Symbol("discarded"),mo=n=>Promise.resolve().then(n),B0=n=>n(),j0=n=>n==="end"||n==="finish"||n==="prefinish",U0=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,$0=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Wl=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Jr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},op=class extends Wl{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>t.emit("error",r),e.on("error",this.proxyErrors)}},W0=n=>!!n.objectMode,V0=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",_i=class extends Vl.EventEmitter{[ot]=!1;[ho]=!1;[_t]=[];[at]=[];[St];[fn];[Pn];[Qr];[Wn]=!1;[Ni]=!1;[Fl]=!1;[Bl]=!1;[fo]=null;[ct]=0;[Ve]=!1;[po];[$l]=!1;[Xi]=0;[jt]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");W0(t)?(this[St]=!0,this[fn]=null):V0(t)?(this[fn]=t.encoding,this[St]=!1):(this[St]=!1,this[fn]=null),this[Pn]=!!t.async,this[Qr]=this[fn]?new xE.StringDecoder(this[fn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[at]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_t]});let{signal:i}=t;i&&(this[po]=i,i.aborted?this[sp]():i.addEventListener("abort",()=>this[sp]()))}get bufferLength(){return this[ct]}get encoding(){return this[fn]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[St]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Pn]}set async(e){this[Pn]=this[Pn]||!!e}[sp](){this[$l]=!0,this.emit("abort",this[po]?.reason),this.destroy(this[po]?.reason)}get aborted(){return this[$l]}set aborted(e){}write(e,t,i){if(this[$l])return!1;if(this[Wn])throw new Error("write after end");if(this[Ve])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[Pn]?mo:B0;if(!this[St]&&!Buffer.isBuffer(e)){if($0(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(U0(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[St]?(this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):e.length?(typeof e=="string"&&!(t===this[fn]&&!this[Qr]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[fn]&&(e=this[Qr].write(e)),this[ot]&&this[ct]!==0&&this[jl](!0),this[ot]?this.emit("data",e):this[tp](e),this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot]):(this[ct]!==0&&this.emit("readable"),i&&r(i),this[ot])}read(e){if(this[Ve])return null;if(this[jt]=!1,this[ct]===0||e===0||e&&e>this[ct])return this[Vn](),null;this[St]&&(e=null),this[at].length>1&&!this[St]&&(this[at]=[this[fn]?this[at].join(""):Buffer.concat(this[at],this[ct])]);let t=this[AE](e||null,this[at][0]);return this[Vn](),t}[AE](e,t){if(this[St])this[Ul]();else{let i=t;e===i.length||e===null?this[Ul]():typeof i=="string"?(this[at][0]=i.slice(e),t=i.slice(0,e),this[ct]-=e):(this[at][0]=i.subarray(e),t=i.subarray(0,e),this[ct]-=e)}return this.emit("data",t),!this[at].length&&!this[Wn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Wn]=!0,this.writable=!1,(this[ot]||!this[ho])&&this[Vn](),this}[Jr](){this[Ve]||(!this[Xi]&&!this[_t].length&&(this[jt]=!0),this[ho]=!1,this[ot]=!0,this.emit("resume"),this[at].length?this[jl]():this[Wn]?this[Vn]():this.emit("drain"))}resume(){return this[Jr]()}pause(){this[ot]=!1,this[ho]=!0,this[jt]=!1}get destroyed(){return this[Ve]}get flowing(){return this[ot]}get paused(){return this[ho]}[tp](e){this[St]?this[ct]+=1:this[ct]+=e.length,this[at].push(e)}[Ul](){return this[St]?this[ct]-=1:this[ct]-=this[at][0].length,this[at].shift()}[jl](e=!1){do;while(this[IE](this[Ul]())&&this[at].length);!e&&!this[at].length&&!this[Wn]&&this.emit("drain")}[IE](e){return this.emit("data",e),this[ot]}pipe(e,t){if(this[Ve])return e;this[jt]=!1;let i=this[Ni];return t=t||{},e===OE.stdout||e===OE.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[_t].push(t.proxyErrors?new op(this,e,t):new Wl(this,e,t)),this[Pn]?mo(()=>this[Jr]()):this[Jr]()),e}unpipe(e){let t=this[_t].find(i=>i.dest===e);t&&(this[_t].length===1?(this[ot]&&this[Xi]===0&&(this[ot]=!1),this[_t]=[]):this[_t].splice(this[_t].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[jt]=!1,this[Xi]++,!this[_t].length&&!this[ot]&&this[Jr]();else if(e==="readable"&&this[ct]!==0)super.emit("readable");else if(j0(e)&&this[Ni])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[fo]){let r=t;this[Pn]?mo(()=>r.call(this,this[fo])):r.call(this,this[fo])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Xi]=this.listeners("data").length,this[Xi]===0&&!this[jt]&&!this[_t].length&&(this[ot]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Xi]=0,!this[jt]&&!this[_t].length&&(this[ot]=!1)),t}get emittedEnd(){return this[Ni]}[Vn](){!this[Fl]&&!this[Ni]&&!this[Ve]&&this[at].length===0&&this[Wn]&&(this[Fl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Bl]&&this.emit("close"),this[Fl]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==Ve&&this[Ve])return!1;if(e==="data")return!this[St]&&!i?!1:this[Pn]?(mo(()=>this[ip](i)),!0):this[ip](i);if(e==="end")return this[LE]();if(e==="close"){if(this[Bl]=!0,!this[Ni]&&!this[Ve])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[fo]=i,super.emit(np,i);let s=!this[po]||this.listeners("error").length?super.emit("error",i):!1;return this[Vn](),s}else if(e==="resume"){let s=super.emit("resume");return this[Vn](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let r=super.emit(e,...t);return this[Vn](),r}[ip](e){for(let i of this[_t])i.dest.write(e)===!1&&this.pause();let t=this[jt]?!1:super.emit("data",e);return this[Vn](),t}[LE](){return this[Ni]?!1:(this[Ni]=!0,this.readable=!1,this[Pn]?(mo(()=>this[rp]()),!0):this[rp]())}[rp](){if(this[Qr]){let t=this[Qr].end();if(t){for(let i of this[_t])i.dest.write(t);this[jt]||super.emit("data",t)}}for(let t of this[_t])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[St]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[St]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[St])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[fn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Ve,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[jt]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Wn])return t();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Ve,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Ve,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Ve,u),t(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,s=d,this.once(Ve,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[jt]=!1;let e=!1,t=()=>(this.pause(),this.off(np,t),this.off(Ve,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(np,t),this.once(Ve,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Ve])return e?this.emit("error",e):this.emit(Ve),this;this[Ve]=!0,this[jt]=!0,this[at].length=0,this[ct]=0;let t=this;return typeof t.close=="function"&&!this[Bl]&&t.close(),e?this.emit("error",e):this.emit(Ve),this}static get isStream(){return M0}};var Y0=Rn.realpathSync.native,yo={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:Y0,promises:{lstat:Pi.lstat,readdir:Pi.readdir,readlink:Pi.readlink,realpath:Pi.realpath}},UE=n=>!n||n===yo||n===H0?yo:{...yo,...n,promises:{...yo.promises,...n.promises||{}}},$E=/^\\\\\?\\([a-z]:)\\?$/i,K0=n=>n.replace(/\//g,"\\").replace($E,"$1\\"),z0=/[\\\/]/,Qt=0,WE=1,VE=2,Dn=4,HE=6,YE=8,Qi=10,KE=12,Xt=15,go=~Xt,cp=16,ME=32,bo=64,dn=128,Hl=256,Kl=512,qE=bo|dn|Kl,G0=1023,lp=n=>n.isFile()?YE:n.isDirectory()?Dn:n.isSymbolicLink()?Qi:n.isCharacterDevice()?VE:n.isBlockDevice()?HE:n.isSocket()?KE:n.isFIFO()?WE:Qt,FE=new Map,To=n=>{let e=FE.get(n);if(e)return e;let t=n.normalize("NFKD");return FE.set(n,t),t},BE=new Map,Yl=n=>{let e=BE.get(n);if(e)return e;let t=To(n.toLowerCase());return BE.set(n,t),t},zl=class extends uo{constructor(){super({max:256})}},up=class extends uo{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},zE=Symbol("PathScurry setAsCwd"),kt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#d;get birthtimeMs(){return this.#d}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#N;get birthtime(){return this.#N}#T;#S;#k;#p;#R;#_;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Qt,i,r,s,o,a){this.name=e,this.#T=s?Yl(e):To(e),this.#n=t&G0,this.nocase=s,this.roots=r,this.root=i||this,this.#A=o,this.#k=a.fullpath,this.#R=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=UE(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),r=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(r):this.#I(r)}#I(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~cp,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),r=this.nocase?Yl(e):To(e);for(let c of i)if(c.#T===r)return c;let s=this.parent?this.sep:"",o=this.#k?this.#k+s+e:void 0,a=this.newChild(e,Qt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=dn),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#k!==void 0)return this.#k;let e=this.name,t=this.parent;if(!t)return this.#k=this.name;let r=t.fullpath()+(t.parent?this.sep:"")+e;return this.#k=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Xt)===Qt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Xt)===YE}isDirectory(){return(this.#n&Xt)===Dn}isCharacterDevice(){return(this.#n&Xt)===VE}isBlockDevice(){return(this.#n&Xt)===HE}isFIFO(){return(this.#n&Xt)===WE}isSocket(){return(this.#n&Xt)===KE}isSymbolicLink(){return(this.#n&Qi)===Qi}lstatCached(){return this.#n&ME?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Xt;return!(e!==Qt&&e!==Qi||this.#n&Hl||this.#n&dn)}calledReaddir(){return!!(this.#n&cp)}isENOENT(){return!!(this.#n&dn)}isNamed(e){return this.nocase?this.#T===Yl(e):this.#T===To(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}#L(e){this.#n|=cp;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#x()}}#x(){this.#n&dn||(this.#n=(this.#n|dn)&go,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#D(){this.#n|=Kl,this.#M()}#M(){if(this.#n&bo)return;let e=this.#n;(e&Xt)===Dn&&(e&=go),this.#n=e|bo,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#x():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=Hl,e==="ENOENT"&&(t|=dn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=go),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#B(e,t){return this.#O(e,t)||this.#j(e,t)}#j(e,t){let i=lp(e),r=this.newChild(e.name,i,{parent:this}),s=r.#n&Xt;return s!==Dn&&s!==Qi&&s!==Qt&&(r.#n|=bo),t.unshift(r),t.provisional++,r}#O(e,t){for(let i=t.provisional;i<t.length;i++){let r=t[i];if((this.nocase?Yl(e.name):To(e.name))===r.#T)return this.#U(e,r,i,t)}}#U(e,t,i,r){let s=t.name;return t.#n=t.#n&go|lp(e),s!==e.name&&(t.name=e.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(t)),r.provisional++,t}async lstat(){if(!(this.#n&dn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if(!(this.#n&dn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:t,atimeMs:i,birthtime:r,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:g,mtime:_,mtimeMs:b,nlink:w,rdev:R,size:v,uid:T}=e;this.#E=t,this.#g=i,this.#N=r,this.#d=s,this.#f=o,this.#r=a,this.#w=c,this.#h=l,this.#t=u,this.#v=d,this.#a=p,this.#s=g,this.#m=_,this.#y=b,this.#i=w,this.#l=R,this.#c=v,this.#o=T;let N=lp(e);this.#n=this.#n&go|N|ME,N!==Qt&&N!==Dn&&N!==Qi&&(this.#n|=bo)}#W=[];#V=!1;#Y(e){this.#V=!1;let t=this.#W.slice();this.#W.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#V)return;this.#V=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),i.provisional=0;else{for(let a of o)this.#B(a,i);this.#L(i)}this.#Y(i.slice(0,i.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#$)await this.#$;else{let i=()=>{};this.#$=new Promise(r=>i=r);try{for(let r of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(r,e);this.#L(e)}catch(r){this.#q(r.code),e.provisional=0}this.#$=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(i,e);this.#L(e)}catch(i){this.#q(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&qE)return!1;let e=Xt&this.#n;return e===Qt||e===Dn||e===Qi}shouldWalk(e,t){return(this.#n&Dn)===Dn&&!(this.#n&qE)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#C)return this.#C;if(!((Kl|Hl|dn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}[zE](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],r=this;for(;r&&r.parent;)t.add(r),r.#R=i.join(this.sep),r.#_=i.join("/"),r=r.parent,i.push("..");for(r=e;r&&r.parent&&!t.has(r);)r.#R=void 0,r.#_=void 0,r=r.parent}},Gl=class n extends kt{sep="\\";splitSep=z0;constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Zr.win32.parse(e).root}getRoot(e){if(e=K0(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new es(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($E,"$1\\"),e===t}},Xl=class n extends kt{splitSep="/";sep="/";constructor(e,t=Qt,i,r,s,o,a){super(e,t,i,r,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Qt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Ql=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:r,childrenCacheSize:s=16*1024,fs:o=yo}={}){this.#i=UE(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,jE.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new zl,this.#t=new zl,this.#s=new up(s);let c=a.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,g=!1;for(let _ of c){let b=u--;l=l.child(_,{relative:new Array(b).fill("..").join(d),relativePosix:new Array(b).fill("..").join("/"),fullpath:p+=(g?"":d)+_}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#e.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#t.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let r=await e.readdir();return i?r:r.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(r=>r.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((g,_)=>{if(g)return p(g);let b=_.length;if(!b)return p();let w=()=>{--b===0&&p()};for(let R of _)(!s||s(R))&&a.push(i?R:R.fullpath()),r&&R.isSymbolicLink()?R.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,w):w()):R.shouldWalk(c,o)?l(R,w):w()},!0)},u=e;return new Promise((d,p)=>{l(u,g=>{if(g)return p(g);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(i?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(r&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield i?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(r&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0});(!s||s(e))&&a.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=(w,R,v=!1)=>{if(w)return a.emit("error",w);if(r&&!v){let T=[];for(let N of R)N.isSymbolicLink()&&T.push(N.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,R,!0));return}}for(let T of R)T&&(!s||s(T))&&(a.write(i?T:T.fullpath())||(p=!0));u--;for(let T of R){let N=T.realpathCached()||T;N.shouldWalk(c,o)&&l.push(N)}p&&!a.flowing?a.once("drain",d):b||d()},b=!0;g.readdirCB(_,!0),b=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new _i({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=g.readdirSync();for(let b of _)(!s||s(b))&&(a.write(i?b:b.fullpath())||(p=!0));u--;for(let b of _){let w=b;if(b.isSymbolicLink()){if(!(r&&(w=b.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(c,o)&&l.push(w)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[zE](t)}},es=class extends Ql{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,Zr.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(e){return Zr.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ts=class extends Ql{sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,Zr.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Xl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},vo=class extends ts{constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}},lW=process.platform==="win32"?Gl:Xl,GE=process.platform==="win32"?es:process.platform==="darwin"?vo:ts;var X0=n=>n.length>=1,Q0=n=>n.length>=1,ns=class n{#e;#t;#s;length;#i;#o;#v;#l;#f;#a;#c=!0;constructor(e,t,i,r){if(!X0(e))throw new TypeError("empty pattern list");if(!Q0(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=i,this.#i=r,this.#s===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,p,g,..._]=this.#t;l[0]===""&&(l.shift(),_.shift());let b=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[b,...l],this.#t=[w,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=s+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===pt}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var J0=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",is=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:r,noglobstar:s,platform:o=J0}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:r,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Bt(e,this.mmopts);for(let i=0;i<t.set.length;i++){let r=t.set[i],s=t.globParts[i];if(!r||!s)throw new Error("invalid pattern object");for(;r[0]==="."&&s[0]===".";)r.shift(),s.shift();let o=new ns(r,s,0,this.platform),a=new Bt(o.globString(),this.mmopts),c=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),i=`${t}/`,r=e.relative()||".",s=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(t))return!0;return!1}};var fp=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),r=this.store.get(i);r?r.add(t.globString()):this.store.set(i,new Set([t.globString()]))}},dp=class{store=new Map;add(e,t,i){let r=(t?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?r:r&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},hp=class{store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(r=>r.globString()===t.globString())||i.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},So=class n{hasWalkedCache;matches=new dp;subwalks=new hp;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new fp}processPatterns(e,t){this.patterns=t;let i=t.map(r=>[e,r]);for(let[r,s]of i){this.hasWalkedCache.storeWalked(r,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)r=r.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(r,s))continue;this.hasWalkedCache.storeWalked(r,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,d);continue}else if(c===pt){(!r.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(r,s);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(r,a,d===""||d===".");else if(d===".."){let g=r.parent||r;p?this.hasWalkedCache.hasWalked(g,p)||this.subwalks.add(g,p):this.matches.add(g,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),r=this.child();for(let s of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===pt?r.testGlobstar(s,o,l,a):c instanceof RegExp?r.testRegExp(s,c,l,a):r.testString(s,c,l,a)}return r}testGlobstar(e,t,i,r){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),r);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),r)}}testRegExp(e,t,i,r){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}testString(e,t,i,r){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}};var Z0=(n,e)=>typeof n=="string"?new is([n],e):Array.isArray(n)?new is(n,e):n,Jl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=Z0(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+r)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+r:"."+r)}}async match(e,t,i){let r=await this.matchCheck(e,i);r&&this.matchFinish(r,t)}matchSync(e,t,i){let r=this.matchCheckSync(e,i);r&&this.matchFinish(r,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new So(this.opts),i)}walkCB2(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,i,o):a.readdirCB((l,u)=>this.walkCB3(a,u,i,o),!0)}o()}walkCB3(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of i.subwalks.entries())s++,this.walkCB2(a,c,i.child(),o);o()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new So(this.opts),i)}walkCB2Sync(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,i,o)}o()}walkCB3Sync(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of i.subwalks.entries())s++,this.walkCB2Sync(a,c,i.child(),o);o()}},ko=class extends Jl{matches=new Set;constructor(e,t,i){super(e,t,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Eo=class extends Jl{results;constructor(e,t,i){super(e,t,i),this.results=new _i({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var eA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",hn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,XE.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||eA,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?es:t.platform==="darwin"?vo:t.platform?ts:GE;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new Bt(c,r)),[o,a]=s.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new ns(c,u,0,this.platform)})}async walk(){return[...await new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ko(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var pp=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new Bt(t,e).hasMagic())return!0;return!1};function eu(n,e={}){return new hn(n,e).streamSync()}function JE(n,e={}){return new hn(n,e).stream()}function ZE(n,e={}){return new hn(n,e).walkSync()}async function QE(n,e={}){return new hn(n,e).walk()}function tu(n,e={}){return new hn(n,e).iterateSync()}function ew(n,e={}){return new hn(n,e).iterate()}var tA=eu,nA=Object.assign(JE,{sync:eu}),iA=tu,rA=Object.assign(ew,{sync:tu}),sA=Object.assign(ZE,{stream:eu,iterate:tu}),Zl=Object.assign(QE,{glob:QE,globSync:ZE,sync:sA,globStream:JE,stream:nA,globStreamSync:eu,streamSync:tA,globIterate:ew,iterate:rA,globIterateSync:tu,iterateSync:iA,Glob:hn,hasMagic:pp,escape:zr,unescape:un});Zl.glob=Zl;var wo=require("path"),sw=require("fs");var Cn=G(Q()),oA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},tw=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},nu=(n,e)=>{if(e=e.include.reduce((t,i)=>{let r=n.find(s=>(0,wo.basename)(s.filePath)===i.name);if(r){let s=i["property-blocklist"];return t.include=t.include.filter(o=>o!==i),aA(n,r,t,s)??t}return console.warn(`Unable to find ${i}`),t},e),e["child-binding"]&&(e["child-binding"].include=ow(e["child-binding"].include),e["child-binding"]=nu(n,e["child-binding"])),!e.include.length)return e},aA=(n,e,t,i=[])=>{let r=nu(n,e),s=nu(n,t);if(!r||!s)return;let o=new Set;Object.keys(r?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let p=i?.some(_=>_===d)?{}:r.properties?.[d]??{},g=s.properties?.[d]??{};a={...a,[d]:{...p,...g}}}),s.properties=a;let c=new Set;return Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let p=r[d]??[],g=s[d]??[];s[d]=Array.from([...p,...g])}),s},ow=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],mp=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values;if(!i?.values.some(r=>!(r?.value instanceof Tt)))return i?.values.map(r=>(r?.value).value)}getNodeTypes(e,t){let i=n.getNodeCompatible(t);if(!i)return[ui()];let r=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(r.length)return r;this.loadTypeAndCache(e);let s=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return s.length?s:[ui()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let r=Zl.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,wo.resolve)(t,o);try{let a=rw.default.parse((0,sw.readFileSync)(o,"utf-8"));return{...a,include:ow(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=r.map(o=>nu(r,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...cA(s))})}},nw,aw=()=>(nw??=new mp,nw),cA=n=>n.map(cw),cw=n=>{let e=ui();e.compatible=n.compatible??(n.filePath?(0,wo.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let i=Object.keys(n).filter(r=>r.endsWith("-cells")).map(r=>({specifier:r.replace(/-cells$/,""),values:n[r]}));return n.properties&&Object.keys(n.properties).forEach(r=>{let s=n.properties[r];lA(e,r,s),e.cellsValues=i}),n["child-binding"]&&(e.childNodeType=cw(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},lA=(n,e,t)=>{let i=n.properties.find(r=>typeof r.name=="string"&&r.getNameMatch(e));if(i){i.required=()=>t.required?"required":"optional",i.values=()=>t.enum??[],i.constValue=tw(t.type,t.const);let r=i.additionalTypeCheck;i.additionalTypeCheck=s=>[...iw(t,e)(s),...r?.(s)??[]]}else{let r=new K(e,oA(t.type),t.required?"required":"optional",void 0,t.enum,iw(t,e));r.desctiption=t.description?[t.description]:void 0,r.constValue=tw(t.type,t.const),n.addProperty(r)}},iw=(n,e)=>{let t=n;return i=>{let r=i.parent.root,s=[];if(t.const){let o=i.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||s.push(A(25,i.ast.values??i.ast,Cn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&s.push(A(14,i.ast,Cn.DiagnosticSeverity.Warning,[],[Cn.DiagnosticTag.Deprecated],[i.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&wt(i.ast.values)?.forEach(a=>{an(a,r)||s.push(A(23,a,Cn.DiagnosticSeverity.Error))}),t.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Tt){let o=i.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=r.getNode(c);return l?a.push(c):s.push(A(24,o,Cn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=wt(i.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=an(c,r);if(!l){s.push(A(23,c??i.ast,Cn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){s.push(A(16,i.ast,Cn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[i.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let p=d?Re(d,0,0)??0:0;if(1+p>o.length-a){let g=l.nodeType?.cellsValues?.find(_=>_.specifier===u)?.values;s.push(A(20,c??i.ast,Cn.DiagnosticSeverity.Error,[],[],[i.name,`<${["phandel",...g??[],...Array.from({length:p-(g?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+p}}return s}};var iu=(n,e)=>({getNodeTypes:t=>{switch(e){case"Zephyr":return aw().getNodeTypes(n,t)}}});var lw=G(Q()),gp=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(gp):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:lw.FoldingRangeKind.Region},...n.nodes.flatMap(gp)];function uw(n){return n.rootDocument.nodes.flatMap(gp)}var Ji=G(Q());function uA(n){if(!n||!(n.ast instanceof Te)&&!(n.ast instanceof Ge))return[];let e=t=>t.nodeType?.bindingsPath?[Ji.Location.create(`file://${t.nodeType.bindingsPath}`,Ji.Range.create(Ji.Position.create(0,0),Ji.Position.create(0,0)))]:[];return n.item instanceof ye&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Te&&n.ast.linksTo?e(n.ast.linksTo):[]}async function fw(n,e,t){return ft(n,e,i=>[...uA(i)],t)}var rs=require("path"),ve=[],Di,yp,No=new WeakMap,fA=n=>{let e=No.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},lt=async()=>{await yw,await Promise.all(ve.map(fA))},bp=n=>{let e=dw(n);return ve.filter(t=>!e.some(i=>i===t))},dw=n=>ve.filter(e=>{let t=n.contexts?.find(i=>i.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(i=>e.overlays.some(r=>r===i))}),dA=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes),i=(await e.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes);return t.length?t.every(r=>i.some(s=>s.reolvedPath===r.reolvedPath&&s.firstToken.pos.col===r.firstToken.pos.col&&s.firstToken.pos.len===r.firstToken.pos.len&&s.firstToken.pos.line===r.firstToken.pos.line&&s.lastToken.pos.col===r.lastToken.pos.col&&s.lastToken.pos.len===r.lastToken.pos.len&&s.lastToken.pos.line===r.lastToken.pos.line)):e.getContextFiles().some(r=>r===n.parser.uri)},hw=async n=>{let e=bp(re),t=await dw(re),i=await lc(e);if(ve.indexOf(n)===-1)return;let r=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(ve.indexOf(n)===-1)return;let s=await Promise.all(i.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await dA(a.context,c)})))),o=i.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&r.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{Tw(a),No.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),ve=ve.filter(a=>o.indexOf(a)===-1))},ue=(0,Se.createConnection)(Se.ProposedFeatures.all),Ri=new Se.TextDocuments(oc),vp=!0,Tp=!1;ue.onInitialize(n=>{let e=n.capabilities;vp=!!(e.workspace&&e.workspace.configuration),Tp=!!(e.workspace&&e.workspace.workspaceFolders);let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Se.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Se.CodeActionKind.QuickFix,Se.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:ac,tokenModifiers:cc},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return Tp&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});ue.onInitialized(()=>{vp&&ue.client.register(Se.DidChangeConfigurationNotification.type,{}),Tp&&ue.workspace.onDidChangeWorkspaceFolders(n=>{ue.console.log("Workspace folder change event received")})});var pw={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},re=pw,mw=new Map,gw=!1,yw=new Promise(n=>{let e=setInterval(()=>{gw&&(n(),clearInterval(e))},100)});ue.onDidChangeConfiguration(n=>{if(gw=!0,!n.settings)return;console.log("Configuration changed",n),vp&&mw.clear();let e=re;re={...pw,...n.settings?.devicetree},re.contexts?.forEach((r,s)=>{if(r.cwd||re.cwd){let o=r.cwd??re.cwd;r.includePaths??=re.defaultIncludePaths,r.zephyrBindings??=re.defaultIncludePaths,r.bindingType??=re.defaultBindingType,o&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(a=>(0,rs.resolve)(o,a)),r.includePaths=r.includePaths?.map(a=>(0,rs.resolve)(o,a)),r.dtsFile=(0,rs.resolve)(o,r.dtsFile)}});let t=bp(e);ve=[],No=new WeakMap,re.contexts?.forEach((r,s)=>{let o=r.bindingType,a=new Mr(r.dtsFile,r.includePaths??[],o?iu(r.zephyrBindings??[],o):void 0,r.overlays,r.ctxName);ve.push(a),console.log(`New context with ID ${a.name} for ${r.dtsFile}`)});let i=bw();ve=[...ve,...t.map(r=>{let s=re.defaultBindingType,o=new Mr(r.parser.uri,i.defaultIncludePaths,s?iu(i.defaultZephyrBindings,s):void 0);return console.log(`New context with ID ${o.name} for ${r.parser.uri}`),o})],t=bp(re),t.forEach(hw),yp&&_o(yp,!0),ue.languages.diagnostics.refresh()});var bw=()=>{let n=(re.defaultIncludePaths??[]).map(t=>re.cwd?(0,rs.resolve)(re.cwd,t):t);re.cwd&&re.defaultBindingType==="Zephyr"&&!re.defaultZephyrBindings&&(re.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(re.defaultZephyrBindings??[]).map(t=>re.cwd?(0,rs.resolve)(re.cwd,t):t);return{defaultIncludePaths:n,defaultZephyrBindings:e}};Ri.onDidClose(n=>{ue.sendDiagnostics({uri:n.document.uri,version:Ri.get(n.document.uri)?.version,diagnostics:[]}),mw.delete(n.document.uri)});Ri.onDidOpen(async n=>{ue.sendDiagnostics({uri:n.document.uri,version:Ri.get(n.document.uri)?.version,diagnostics:(await hA(n.document.uri)).items??[]})});var hA=async n=>{n=n.replace("file://",""),await lt();let e=await Di;return{kind:Se.DocumentDiagnosticReportKind.Full,items:e?await vw(e,n):[{severity:Se.DiagnosticSeverity.Warning,range:Se.Range.create(Se.Position.create(0,0),Se.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}},pA=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node"}},mA=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),gA=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},yA=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),bA=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};Ri.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");di().renewLexer(e,n.document.getText()),await yw;let t=await sT(ve,e);if(t.length)t.forEach(i=>{No.get(i.context)?.abort.abort();let r=new AbortController,s=new Promise(o=>{setTimeout(async()=>{if(r.signal.aborted){o();return}let a=performance.now();ru.delete(i.context),await i.context.reevaluate(e),Sp(i.context).then(c=>{c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{ue.sendDiagnostics(l)})}),o(),console.log("reevaluate",performance.now()-a)},50)});No.set(i.context,{abort:r,promise:s})});else{if(re.allowAdhocContexts===!1)return;let i=re.defaultBindingType,r=bw(),s=new Mr(e,r.defaultIncludePaths,i?iu(r.defaultZephyrBindings,i):void 0);console.log(`New ad hoc context with ID ${s.name} for ${e}`),ve.push(s),_o(e),await s.parser.stable,hw(s)}});var Tw=async n=>{n.getContextFiles().forEach(e=>{ue.sendDiagnostics({uri:e,version:Ri.get(`file://${e}`)?.version,diagnostics:[]})})},Sp=async n=>({items:[...await Promise.all(n.getContextFiles().map(async t=>{let i=await vw(n,t);return{uri:`file://${t}`,kind:Se.DocumentDiagnosticReportKind.Full,items:i,version:Ri.get(`file://${t}`)?.version??null}}))]});ue.languages.diagnostics.onWorkspace(async()=>{await lt();let n=await Di;return n?Sp(n):{items:[]}});var ru=new WeakMap;async function vw(n,e){let t=performance.now(),i=ru.get(n);if(i){let r=i.get(e);if(r)return r}else ru.set(n,new Map);try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:a.issues?a.issues.map(pA).join(" or "):"",source:"devicetree",data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:a.issues,edit:a.edit}}};r.push(c)}),(await n.getContextIssues()??[]).filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:mA(a),source:"devicetree",tags:a.tags,relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(gA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))]};r.push(c)}),(await n.getRuntime())?.typesIssues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:yA(a),relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(bA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))],source:"devicetree",tags:a.tags,data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:a.issues,edit:a.edit}}};r.push(c)}),console.log("diagnostics",e,performance.now()-t),ru.get(n)?.set(e,r),r):[{severity:Se.DiagnosticSeverity.Warning,range:Se.Range.create(Se.Position.create(0,0),Se.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}ue.onDidChangeWatchedFiles(n=>{ue.console.log("We received a file change event")});ue.onCompletion(async n=>(await lt(),ve?[...await tv(n,ve,re.preferredContext),...await dv(n,ve,re.preferredContext)]:[]));ue.onCompletionResolve(n=>n);Ri.listen(ue);ue.listen();var _o=async(n,e=!1)=>{if(!e&&re.autoChangeContext===!1)return;yp=n,await lt();let t=await Di;Di=Pr(ve,n,re.preferredContext).then(r=>r?.context);let i=await Di;t!==i&&(t&&Tw(t),i&&Sp(i).then(r=>{r.items.map(s=>({uri:s.uri,version:s.version??void 0,diagnostics:s.items})).forEach(s=>{ue.sendDiagnostics(s)})}),console.log(`(ID: ${i?.name??-1}) activeContext:`,i?.parser.uri),ve.forEach((r,s)=>{console.log(`Context with ID ${r.name} for ${r.parser.uri}`)}))};ue.onDocumentSymbol(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let i=await(await Di)?.parser;return i?i.getDocumentSymbols(e):[]});ue.onWorkspaceSymbol(async()=>{await lt();let n=await Di;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ue.languages.semanticTokens.on(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=new Se.SemanticTokensBuilder,i=await Pr(ve,e,re.preferredContext),r=i?.context.isInContext(e);return!i||!r?{data:[]}:(i.context.parser.buildSemanticTokens(t,e),t.build())});ue.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await lt(),(await Pr(ve,e,re.preferredContext))?.context.getDocumentLinks(e)});ue.onPrepareRename(async n=>(await lt(),av(n,ve,re.lockRenameEdits??[],re.preferredContext)));ue.onRenameRequest(async n=>(await lt(),ov(n,ve,re.preferredContext)));ue.onReferences(async n=>(await lt(),nv(n,ve,re.preferredContext)));ue.onDefinition(async n=>(await lt(),cv(n,ve,re.preferredContext)));ue.onDeclaration(async n=>(await lt(),lv(n,ve,re.preferredContext)));ue.onCodeAction(async n=>uv(n));ue.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await lt();let t=await Pr(ve,e,re.preferredContext);return t?mT(n,t.context):[]});ue.onHover(async n=>(await lt(),(await hv(n,ve,re.preferredContext)).at(0)));ue.onRequest("devicetree/contexts",async()=>(await lt(),ve.map(n=>n.parser.uri)));ue.onFoldingRanges(async n=>{await lt();let e=n.textDocument.uri.replace("file://","");_o(e);let t=await Di,i=t?.isInContext(e);return!t||!i?[]:uw(t.parser)});ue.onTypeDefinition(async n=>(await lt(),fw(n,ve)));
232
+ >>> no match, partial?`,e,p,t,g),p===c))}let b;if(typeof u=="string"?(b=d===u,this.debug("string match",u,d,b)):(b=u.test(d),this.debug("pattern match",u,d,b)),!b)return!1}if(o===c&&a===l)return!0;if(o===c)return i;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return CE(this.pattern,this.options)}parse(e){uo(e);let t=this.options;if(e==="**")return pt;if(e==="")return"";let i,r=null;(i=e.match(E0))?r=t.dot?N0:w0:(i=e.match(h0))?r=(t.nocase?t.dot?y0:g0:t.dot?m0:p0)(i[1]):(i=e.match(_0))?r=(t.nocase?t.dot?D0:P0:t.dot?R0:C0)(i):(i=e.match(b0))?r=t.dot?v0:T0:(i=e.match(S0))&&(r=k0);let s=Gr.fromGlob(e,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),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,i=t.noglobstar?I0:t.dot?L0:x0,r=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))r.add(d);return typeof u=="string"?j0(u):u===pt?pt:u._src});return l.forEach((u,d)=>{let p=l[d+1],g=l[d-1];u!==pt||g===pt||(g===void 0?p!==void 0&&p!==pt?l[d+1]="(?:\\/|"+i+"\\/)?"+p:l[d]=i:p===void 0?l[d-1]=g+"(?:\\/|"+i+")?":p!==pt&&(l[d-1]=g+"(?:\\/|\\/"+i+"\\/)"+p,l[d+1]=pt))}),l.filter(u=>u!==pt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].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 i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let r=this.slashSplit(e);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let o=r[r.length-1];if(!o)for(let a=r.length-2;!o&&a>=0;a--)o=r[a];for(let a=0;a<s.length;a++){let c=s[a],l=r;if(i.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Nt.defaults(e).Minimatch}};Nt.AST=Gr;Nt.Minimatch=jt;Nt.escape=Xr;Nt.unescape=fn;var ew=require("node:url");var Qr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,AE=new Set,ep=typeof process=="object"&&process?process:{},IE=(n,e,t,i)=>{typeof ep.emitWarning=="function"?ep.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},Fl=globalThis.AbortController,OE=globalThis.AbortSignal;if(typeof Fl>"u"){OE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},Fl=class{constructor(){e()}signal=new OE;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=ep.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,IE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var U0=n=>!AE.has(n),dW=Symbol("type"),Ni=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),LE=n=>Ni(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Jr:null:null,Jr=class extends Array{constructor(e){super(e),this.fill(0)}},tp=class n{heap;length;static#e=!1;static create(e){let t=LE(e);if(!t)return[];n.#e=!0;let i=new n(e,t);return n.#e=!1,i}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ho=class n{#e;#t;#s;#i;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#c;#r;#g;#y;#h;#d;#E;#m;#w;#N;#T;#S;#k;#p;static unsafeExposeInternals(e){return{starts:e.#N,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#r,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#d},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,i,r,s)=>e.#F(t,i,r,s),moveToTail:t=>e.#j(t),indexes:t=>e.#P(t),rindexes:t=>e.#D(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:w,memoMethod:R,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:N,allowStaleOnFetchAbort:L,ignoreFetchAbort:q}=e;if(t!==0&&!Ni(t))throw new TypeError("max option must be a nonnegative integer");let H=t?LE(t):Array;if(!H)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=g,this.maxEntrySize=_||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=R,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#k=!!w,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#r=new Array(t).fill(void 0),this.#g=new H(t),this.#y=new H(t),this.#h=0,this.#d=0,this.#E=tp.create(t),this.#l=0,this.#f=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#S=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!N,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(this.#t!==0&&!Ni(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ni(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ni(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!Ni(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";U0(j)&&(AE.add(j),IE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#R(){let e=new Jr(this.#e),t=new Jr(this.#e);this.#T=e,this.#N=t,this.#A=(s,o,a=Qr.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(s)&&this.#O(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#_=s=>{t[s]=e[s]!==0?Qr.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=Qr.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#b=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#_=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new Jr(this.#e);this.#f=0,this.#w=e,this.#I=t=>{this.#f-=e[t],e[t]=0},this.#x=(t,i,r,s)=>{if(this.#u(i))return 0;if(!Ni(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!Ni(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,i,r)=>{if(e[t]=i,this.#t){let s=this.#t-e[t];for(;this.#f>s;)this.#q(!0)}this.#f+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#f)}}#I=e=>{};#L=(e,t,i)=>{};#x=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#d;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#D({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#M(t)||((e||!this.#b(t))&&(yield t),t===this.#d));)t=this.#g[t]}#M(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*rentries(){for(let e of this.#D())this.#r[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#r[e])&&(yield[this.#c[e],this.#r[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*rkeys(){for(let e of this.#D()){let t=this.#c[e];t!==void 0&&!this.#u(this.#r[e])&&(yield t)}}*values(){for(let e of this.#P())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}*rvalues(){for(let e of this.#D())this.#r[e]!==void 0&&!this.#u(this.#r[e])&&(yield this.#r[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#c[i],this))return this.get(this.#c[i],t)}}forEach(e,t=this){for(let i of this.#P()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}rforEach(e,t=this){for(let i of this.#D()){let r=this.#r[i],s=this.#u(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#c[i],this)}}purgeStale(){let e=!1;for(let t of this.#D({allowStale:!0}))this.#b(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let i=this.#r[t],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#T&&this.#N){let o=this.#T[t],a=this.#N[t];if(o&&a){let c=o-(Qr.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let i=this.#c[t],r=this.#r[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#T&&this.#N){o.ttl=this.#T[t];let a=Qr.now()-this.#N[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=Qr.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#x(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#d:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#q(!1):this.#l,this.#c[d]=e,this.#r[d]=t,this.#a.set(e,d),this.#g[this.#d]=d,this.#y[d]=this.#d,this.#d=d,this.#l++,this.#L(d,u,c),c&&(c.set="add"),l=!1;else{this.#j(d);let p=this.#r[d];if(t!==p){if(this.#k&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=p;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#m?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]));if(this.#I(d),this.#L(d,u,c),this.#r[d]=t,c){c.set="replace";let g=p&&this.#u(p)?p.__staleWhileFetching:p;g!==void 0&&(c.oldValue=g)}}else c&&(c.set="update")}if(r!==0&&!this.#T&&this.#R(),this.#T&&(l||this.#A(d,r,s),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let p=this.#m,g;for(;g=p?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#l;){let e=this.#r[this.#h];if(this.#q(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#i?.(...t)}}}#q(e){let t=this.#h,i=this.#c[t],r=this.#r[t];return this.#k&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(r,i,"evict"),this.#p&&this.#m?.push([r,i,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#r[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#d=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(i),this.#l--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#a.get(e);if(s!==void 0){let o=this.#r[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))r&&(r.has="stale",this.#n(r,s));else return i&&this.#_(s),r&&(r.has="hit",this.#n(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!i&&this.#b(r))return;let s=this.#r[r];return this.#u(s)?s.__staleWhileFetching:s}#F(e,t,i,r){let s=t===void 0?void 0:this.#r[t];if(this.#u(s))return s;let o=new Fl,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(b,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(R&&!w?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),R&&!v&&!w)return d(o.signal.reason);let T=g;return this.#r[t]===g&&(b===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),d(b)),d=b=>{let{aborted:w}=o.signal,R=w&&i.allowStaleOnFetchAbort,v=R||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,N=g;if(this.#r[t]===g&&(!T||N.__staleWhileFetching===void 0?this.#O(e,"fetch"):R||(this.#r[t]=N.__staleWhileFetching)),v)return i.status&&N.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),N.__staleWhileFetching;if(N.__returned===N)throw b},p=(b,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>b(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=v=>l(v,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(p).then(l,u),_=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...c.options,status:void 0}),t=this.#a.get(e)):this.#r[t]=_,_}#u(e){if(!this.#k)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Fl}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:w=!1,status:R,signal:v}=t;if(!this.#k)return R&&(R.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:R});let T={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:g,status:R,signal:v},N=this.#a.get(e);if(N===void 0){R&&(R.fetch="miss");let L=this.#F(e,N,T,b);return L.__returned=L}else{let L=this.#r[N];if(this.#u(L)){let Be=i&&L.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",Be&&(R.returnedStale=!0)),Be?L.__staleWhileFetching:L.__returned=L}let q=this.#b(N);if(!w&&!q)return R&&(R.fetch="hit"),this.#j(N),r&&this.#_(N),R&&this.#n(R,N),L;let H=this.#F(e,N,T,b),re=H.__staleWhileFetching!==void 0&&i;return R&&(R.fetch=q?"stale":"refresh",re&&q&&(R.returnedStale=!0)),re?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#r[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#j(a),r&&this.#_(a),c))}else o&&(o.get="miss")}#B(e,t){this.#y[t]=e,this.#g[e]=t}#j(e){e!==this.#d&&(e===this.#h?this.#h=this.#g[e]:this.#B(this.#y[e],this.#g[e]),this.#B(this.#d,e),this.#d=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let i=!1;if(this.#l!==0){let r=this.#a.get(e);if(r!==void 0)if(i=!0,this.#l===1)this.#U(t);else{this.#I(r);let s=this.#r[r];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,t),this.#p&&this.#m?.push([s,e,t])),this.#a.delete(e),this.#c[r]=void 0,this.#r[r]=void 0,r===this.#d)this.#d=this.#y[r];else if(r===this.#h)this.#h=this.#g[r];else{let o=this.#y[r];this.#g[o]=this.#g[r];let a=this.#g[r];this.#y[a]=this.#y[r]}this.#l--,this.#E.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,s;for(;s=r?.shift();)this.#i?.(...s)}return i}clear(){return this.#U("delete")}#U(e){for(let t of this.#D({allowStale:!0})){let i=this.#r[t];if(this.#u(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#c[t];this.#S&&this.#s?.(i,r,e),this.#p&&this.#m?.push([i,r,e])}}if(this.#a.clear(),this.#r.fill(void 0),this.#c.fill(void 0),this.#T&&this.#N&&(this.#T.fill(0),this.#N.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#d=0,this.#E.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let t=this.#m,i;for(;i=t?.shift();)this.#i?.(...i)}}};var ts=require("node:path"),VE=require("node:url"),Rn=require("fs"),Q0=z(require("node:fs"),1),Di=require("node:fs/promises");var Hl=require("node:events"),cp=z(require("node:stream"),1),BE=require("node:string_decoder"),xE=typeof process=="object"&&process?process:{stdout:null,stderr:null},$0=n=>!!n&&typeof n=="object"&&(n instanceof Pi||n instanceof cp.default||W0(n)||V0(n)),W0=n=>!!n&&typeof n=="object"&&n instanceof Hl.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==cp.default.Writable.prototype.pipe,V0=n=>!!n&&typeof n=="object"&&n instanceof Hl.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Wn=Symbol("EOF"),Vn=Symbol("maybeEmitEnd"),_i=Symbol("emittedEnd"),Bl=Symbol("emittingEnd"),po=Symbol("emittedError"),jl=Symbol("closed"),ME=Symbol("read"),Ul=Symbol("flush"),qE=Symbol("flushChunk"),dn=Symbol("encoding"),Zr=Symbol("decoder"),at=Symbol("flowing"),mo=Symbol("paused"),es=Symbol("resume"),ct=Symbol("buffer"),_t=Symbol("pipes"),lt=Symbol("bufferLength"),np=Symbol("bufferPush"),$l=Symbol("bufferShift"),St=Symbol("objectMode"),Ve=Symbol("destroyed"),ip=Symbol("error"),rp=Symbol("emitData"),FE=Symbol("emitEnd"),sp=Symbol("emitEnd2"),Pn=Symbol("async"),op=Symbol("abort"),Wl=Symbol("aborted"),go=Symbol("signal"),Qi=Symbol("dataListeners"),Ut=Symbol("discarded"),yo=n=>Promise.resolve().then(n),H0=n=>n(),Y0=n=>n==="end"||n==="finish"||n==="prefinish",K0=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,z0=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Vl=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[es](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ap=class extends Vl{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>t.emit("error",r),e.on("error",this.proxyErrors)}},G0=n=>!!n.objectMode,X0=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",Pi=class extends Hl.EventEmitter{[at]=!1;[mo]=!1;[_t]=[];[ct]=[];[St];[dn];[Pn];[Zr];[Wn]=!1;[_i]=!1;[Bl]=!1;[jl]=!1;[po]=null;[lt]=0;[Ve]=!1;[go];[Wl]=!1;[Qi]=0;[Ut]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");G0(t)?(this[St]=!0,this[dn]=null):X0(t)?(this[dn]=t.encoding,this[St]=!1):(this[St]=!1,this[dn]=null),this[Pn]=!!t.async,this[Zr]=this[dn]?new BE.StringDecoder(this[dn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ct]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_t]});let{signal:i}=t;i&&(this[go]=i,i.aborted?this[op]():i.addEventListener("abort",()=>this[op]()))}get bufferLength(){return this[lt]}get encoding(){return this[dn]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[St]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Pn]}set async(e){this[Pn]=this[Pn]||!!e}[op](){this[Wl]=!0,this.emit("abort",this[go]?.reason),this.destroy(this[go]?.reason)}get aborted(){return this[Wl]}set aborted(e){}write(e,t,i){if(this[Wl])return!1;if(this[Wn])throw new Error("write after end");if(this[Ve])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[Pn]?yo:H0;if(!this[St]&&!Buffer.isBuffer(e)){if(z0(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(K0(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[St]?(this[at]&&this[lt]!==0&&this[Ul](!0),this[at]?this.emit("data",e):this[np](e),this[lt]!==0&&this.emit("readable"),i&&r(i),this[at]):e.length?(typeof e=="string"&&!(t===this[dn]&&!this[Zr]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[dn]&&(e=this[Zr].write(e)),this[at]&&this[lt]!==0&&this[Ul](!0),this[at]?this.emit("data",e):this[np](e),this[lt]!==0&&this.emit("readable"),i&&r(i),this[at]):(this[lt]!==0&&this.emit("readable"),i&&r(i),this[at])}read(e){if(this[Ve])return null;if(this[Ut]=!1,this[lt]===0||e===0||e&&e>this[lt])return this[Vn](),null;this[St]&&(e=null),this[ct].length>1&&!this[St]&&(this[ct]=[this[dn]?this[ct].join(""):Buffer.concat(this[ct],this[lt])]);let t=this[ME](e||null,this[ct][0]);return this[Vn](),t}[ME](e,t){if(this[St])this[$l]();else{let i=t;e===i.length||e===null?this[$l]():typeof i=="string"?(this[ct][0]=i.slice(e),t=i.slice(0,e),this[lt]-=e):(this[ct][0]=i.subarray(e),t=i.subarray(0,e),this[lt]-=e)}return this.emit("data",t),!this[ct].length&&!this[Wn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[Wn]=!0,this.writable=!1,(this[at]||!this[mo])&&this[Vn](),this}[es](){this[Ve]||(!this[Qi]&&!this[_t].length&&(this[Ut]=!0),this[mo]=!1,this[at]=!0,this.emit("resume"),this[ct].length?this[Ul]():this[Wn]?this[Vn]():this.emit("drain"))}resume(){return this[es]()}pause(){this[at]=!1,this[mo]=!0,this[Ut]=!1}get destroyed(){return this[Ve]}get flowing(){return this[at]}get paused(){return this[mo]}[np](e){this[St]?this[lt]+=1:this[lt]+=e.length,this[ct].push(e)}[$l](){return this[St]?this[lt]-=1:this[lt]-=this[ct][0].length,this[ct].shift()}[Ul](e=!1){do;while(this[qE](this[$l]())&&this[ct].length);!e&&!this[ct].length&&!this[Wn]&&this.emit("drain")}[qE](e){return this.emit("data",e),this[at]}pipe(e,t){if(this[Ve])return e;this[Ut]=!1;let i=this[_i];return t=t||{},e===xE.stdout||e===xE.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[_t].push(t.proxyErrors?new ap(this,e,t):new Vl(this,e,t)),this[Pn]?yo(()=>this[es]()):this[es]()),e}unpipe(e){let t=this[_t].find(i=>i.dest===e);t&&(this[_t].length===1?(this[at]&&this[Qi]===0&&(this[at]=!1),this[_t]=[]):this[_t].splice(this[_t].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[Ut]=!1,this[Qi]++,!this[_t].length&&!this[at]&&this[es]();else if(e==="readable"&&this[lt]!==0)super.emit("readable");else if(Y0(e)&&this[_i])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[po]){let r=t;this[Pn]?yo(()=>r.call(this,this[po])):r.call(this,this[po])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Qi]=this.listeners("data").length,this[Qi]===0&&!this[Ut]&&!this[_t].length&&(this[at]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Qi]=0,!this[Ut]&&!this[_t].length&&(this[at]=!1)),t}get emittedEnd(){return this[_i]}[Vn](){!this[Bl]&&!this[_i]&&!this[Ve]&&this[ct].length===0&&this[Wn]&&(this[Bl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[jl]&&this.emit("close"),this[Bl]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==Ve&&this[Ve])return!1;if(e==="data")return!this[St]&&!i?!1:this[Pn]?(yo(()=>this[rp](i)),!0):this[rp](i);if(e==="end")return this[FE]();if(e==="close"){if(this[jl]=!0,!this[_i]&&!this[Ve])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[po]=i,super.emit(ip,i);let s=!this[go]||this.listeners("error").length?super.emit("error",i):!1;return this[Vn](),s}else if(e==="resume"){let s=super.emit("resume");return this[Vn](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let r=super.emit(e,...t);return this[Vn](),r}[rp](e){for(let i of this[_t])i.dest.write(e)===!1&&this.pause();let t=this[Ut]?!1:super.emit("data",e);return this[Vn](),t}[FE](){return this[_i]?!1:(this[_i]=!0,this.readable=!1,this[Pn]?(yo(()=>this[sp]()),!0):this[sp]())}[sp](){if(this[Zr]){let t=this[Zr].end();if(t){for(let i of this[_t])i.dest.write(t);this[Ut]||super.emit("data",t)}}for(let t of this[_t])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[St]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[St]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[St])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[dn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Ve,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ut]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Wn])return t();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(Ve,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(Ve,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(Ve,u),t(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,s=d,this.once(Ve,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ut]=!1;let e=!1,t=()=>(this.pause(),this.off(ip,t),this.off(Ve,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(ip,t),this.once(Ve,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Ve])return e?this.emit("error",e):this.emit(Ve),this;this[Ve]=!0,this[Ut]=!0,this[ct].length=0,this[lt]=0;let t=this;return typeof t.close=="function"&&!this[jl]&&t.close(),e?this.emit("error",e):this.emit(Ve),this}static get isStream(){return $0}};var J0=Rn.realpathSync.native,To={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:J0,promises:{lstat:Di.lstat,readdir:Di.readdir,readlink:Di.readlink,realpath:Di.realpath}},HE=n=>!n||n===To||n===Q0?To:{...To,...n,promises:{...To.promises,...n.promises||{}}},YE=/^\\\\\?\\([a-z]:)\\?$/i,Z0=n=>n.replace(/\//g,"\\").replace(YE,"$1\\"),eA=/[\\\/]/,Jt=0,KE=1,zE=2,Dn=4,GE=6,XE=8,Ji=10,QE=12,Qt=15,bo=~Qt,lp=16,jE=32,vo=64,hn=128,Yl=256,zl=512,UE=vo|hn|zl,tA=1023,up=n=>n.isFile()?XE:n.isDirectory()?Dn:n.isSymbolicLink()?Ji:n.isCharacterDevice()?zE:n.isBlockDevice()?GE:n.isSocket()?QE:n.isFIFO()?KE:Jt,$E=new Map,So=n=>{let e=$E.get(n);if(e)return e;let t=n.normalize("NFKD");return $E.set(n,t),t},WE=new Map,Kl=n=>{let e=WE.get(n);if(e)return e;let t=So(n.toLowerCase());return WE.set(n,t),t},Gl=class extends ho{constructor(){super({max:256})}},fp=class extends ho{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},JE=Symbol("PathScurry setAsCwd"),kt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#a;get ino(){return this.#a}#c;get size(){return this.#c}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#d;get birthtimeMs(){return this.#d}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#N;get birthtime(){return this.#N}#T;#S;#k;#p;#R;#_;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Jt,i,r,s,o,a){this.name=e,this.#T=s?Kl(e):So(e),this.#n=t&tA,this.nocase=s,this.roots=r,this.root=i||this,this.#A=o,this.#k=a.fullpath,this.#R=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=HE(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),r=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(r):this.#I(r)}#I(e){let t=this;for(let i of e)t=t.child(i);return t}children(){let e=this.#A.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#A.set(this,t),this.#n&=~lp,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),r=this.nocase?Kl(e):So(e);for(let c of i)if(c.#T===r)return c;let s=this.parent?this.sep:"",o=this.#k?this.#k+s+e:void 0,a=this.newChild(e,Jt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=hn),i.push(a),a}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.name;let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.fullpathPosix();let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(this.#k!==void 0)return this.#k;let e=this.name,t=this.parent;if(!t)return this.#k=this.name;let r=t.fullpath()+(t.parent?this.sep:"")+e;return this.#k=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#n&Qt)===Jt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&Qt)===XE}isDirectory(){return(this.#n&Qt)===Dn}isCharacterDevice(){return(this.#n&Qt)===zE}isBlockDevice(){return(this.#n&Qt)===GE}isFIFO(){return(this.#n&Qt)===KE}isSocket(){return(this.#n&Qt)===QE}isSymbolicLink(){return(this.#n&Ji)===Ji}lstatCached(){return this.#n&jE?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#n&Qt;return!(e!==Jt&&e!==Ji||this.#n&Yl||this.#n&hn)}calledReaddir(){return!!(this.#n&lp)}isENOENT(){return!!(this.#n&hn)}isNamed(e){return this.nocase?this.#T===Kl(e):this.#T===So(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return this.#b=i}catch(t){this.#u(t.code);return}}#L(e){this.#n|=lp;for(let t=e.provisional;t<e.length;t++){let i=e[t];i&&i.#x()}}#x(){this.#n&hn||(this.#n=(this.#n|hn)&bo,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#x()}#D(){this.#n|=zl,this.#M()}#M(){if(this.#n&vo)return;let e=this.#n;(e&Qt)===Dn&&(e&=bo),this.#n=e|vo,this.#P()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#x():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#x()}#u(e=""){let t=this.#n;t|=Yl,e==="ENOENT"&&(t|=hn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=bo),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#B(e,t){return this.#O(e,t)||this.#j(e,t)}#j(e,t){let i=up(e),r=this.newChild(e.name,i,{parent:this}),s=r.#n&Qt;return s!==Dn&&s!==Ji&&s!==Jt&&(r.#n|=vo),t.unshift(r),t.provisional++,r}#O(e,t){for(let i=t.provisional;i<t.length;i++){let r=t[i];if((this.nocase?Kl(e.name):So(e.name))===r.#T)return this.#U(e,r,i,t)}}#U(e,t,i,r){let s=t.name;return t.#n=t.#n&bo|up(e),s!==e.name&&(t.name=e.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(t)),r.provisional++,t}async lstat(){if(!(this.#n&hn))try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if(!(this.#n&hn))try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:t,atimeMs:i,birthtime:r,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:g,mtime:_,mtimeMs:b,nlink:w,rdev:R,size:v,uid:T}=e;this.#E=t,this.#g=i,this.#N=r,this.#d=s,this.#f=o,this.#r=a,this.#w=c,this.#h=l,this.#t=u,this.#v=d,this.#a=p,this.#s=g,this.#m=_,this.#y=b,this.#i=w,this.#l=R,this.#c=v,this.#o=T;let N=up(e);this.#n=this.#n&bo|N|jE,N!==Jt&&N!==Dn&&N!==Ji&&(this.#n|=vo)}#W=[];#V=!1;#Y(e){this.#V=!1;let t=this.#W.slice();this.#W.length=0,t.forEach(i=>i(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#V)return;this.#V=!0;let r=this.fullpath();this.#e.readdir(r,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),i.provisional=0;else{for(let a of o)this.#B(a,i);this.#L(i)}this.#Y(i.slice(0,i.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#$)await this.#$;else{let i=()=>{};this.#$=new Promise(r=>i=r);try{for(let r of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(r,e);this.#L(e)}catch(r){this.#q(r.code),e.provisional=0}this.#$=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(i,e);this.#L(e)}catch(i){this.#q(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&UE)return!1;let e=Qt&this.#n;return e===Jt||e===Dn||e===Ji}shouldWalk(e,t){return(this.#n&Dn)===Dn&&!(this.#n&UE)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((zl|Yl|hn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#C)return this.#C;if(!((zl|Yl|hn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#D()}}[JE](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),i=[],r=this;for(;r&&r.parent;)t.add(r),r.#R=i.join(this.sep),r.#_=i.join("/"),r=r.parent,i.push("..");for(r=e;r&&r.parent&&!t.has(r);)r.#R=void 0,r.#_=void 0,r=r.parent}},Xl=class n extends kt{sep="\\";splitSep=eA;constructor(e,t=Jt,i,r,s,o,a){super(e,t,i,r,s,o,a)}newChild(e,t=Jt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return ts.win32.parse(e).root}getRoot(e){if(e=Z0(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,i]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=i;return this.roots[e]=new ns(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YE,"$1\\"),e===t}},Ql=class n extends kt{splitSep="/";sep="/";constructor(e,t=Jt,i,r,s,o,a){super(e,t,i,r,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Jt,i={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Jl=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),t,i,{nocase:r,childrenCacheSize:s=16*1024,fs:o=To}={}){this.#i=HE(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,VE.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Gl,this.#t=new Gl,this.#s=new fp(s);let c=a.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,g=!1;for(let _ of c){let b=u--;l=l.child(_,{relative:new Array(b).fill("..").join(d),relativePosix:new Array(b).fill("..").join("/"),fullpath:p+=(g?"":d)+_}),g=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#e.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpath();return this.#e.set(t,r),r}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let i=this.#t.get(t);if(i!==void 0)return i;let r=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,r),r}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let r=await e.readdir();return i?r:r.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(r=>r.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((g,_)=>{if(g)return p(g);let b=_.length;if(!b)return p();let w=()=>{--b===0&&p()};for(let R of _)(!s||s(R))&&a.push(i?R:R.fullpath()),r&&R.isSymbolicLink()?R.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,w):w()):R.shouldWalk(c,o)?l(R,w):w()},!0)},u=e;return new Promise((d,p)=>{l(u,g=>{if(g)return p(g);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=[];(!s||s(e))&&a.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!s||s(d))&&a.push(i?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(r&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield i?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!s||s(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(r&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new Pi({objectMode:!0});(!s||s(e))&&a.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=(w,R,v=!1)=>{if(w)return a.emit("error",w);if(r&&!v){let T=[];for(let N of R)N.isSymbolicLink()&&T.push(N.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(T.length){Promise.all(T).then(()=>_(null,R,!0));return}}for(let T of R)T&&(!s||s(T))&&(a.write(i?T:T.fullpath())||(p=!0));u--;for(let T of R){let N=T.realpathCached()||T;N.shouldWalk(c,o)&&l.push(N)}p&&!a.flowing?a.once("drain",d):b||d()},b=!0;g.readdirCB(_,!0),b=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof kt||(t=e,e=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:s,walkFilter:o}=t,a=new Pi({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let g=l.shift();if(!g){u===0&&a.end();return}u++,c.add(g);let _=g.readdirSync();for(let b of _)(!s||s(b))&&(a.write(i?b:b.fullpath())||(p=!0));u--;for(let b of _){let w=b;if(b.isSymbolicLink()){if(!(r&&(w=b.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(c,o)&&l.push(w)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[JE](t)}},ns=class extends Jl{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,ts.win32,"\\",{...t,nocase:i}),this.nocase=i;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(e){return ts.win32.parse(e).root.toUpperCase()}newRoot(e){return new Xl(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},is=class extends Jl{sep="/";constructor(e=process.cwd(),t={}){let{nocase:i=!1}=t;super(e,ts.posix,"/",{...t,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Ql(this.rootPath,Dn,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ko=class extends is{constructor(e=process.cwd(),t={}){let{nocase:i=!0}=t;super(e,{...t,nocase:i})}},yW=process.platform==="win32"?Xl:Ql,ZE=process.platform==="win32"?ns:process.platform==="darwin"?ko:is;var nA=n=>n.length>=1,iA=n=>n.length>=1,rs=class n{#e;#t;#s;length;#i;#o;#v;#l;#f;#a;#c=!0;constructor(e,t,i,r){if(!nA(e))throw new TypeError("empty pattern list");if(!iA(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#s=i,this.#i=r,this.#s===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,p,g,..._]=this.#t;l[0]===""&&(l.shift(),_.shift());let b=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[b,...l],this.#t=[w,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=s+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===pt}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var rA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ss=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:i,noext:r,noglobstar:s,platform:o=rA}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:i,noext:r,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new jt(e,this.mmopts);for(let i=0;i<t.set.length;i++){let r=t.set[i],s=t.globParts[i];if(!r||!s)throw new Error("invalid pattern object");for(;r[0]==="."&&s[0]===".";)r.shift(),s.shift();let o=new rs(r,s,0,this.platform),a=new jt(o.globString(),this.mmopts),c=s[s.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),i=`${t}/`,r=e.relative()||".",s=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(i))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(t))return!0;return!1}};var dp=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let i=e.fullpath(),r=this.store.get(i);r?r.add(t.globString()):this.store.set(i,new Set([t.globString()]))}},hp=class{store=new Map;add(e,t,i){let r=(t?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?r:r&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},pp=class{store=new Map;add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(r=>r.globString()===t.globString())||i.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Eo=class n{hasWalkedCache;matches=new hp;subwalks=new pp;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new dp}processPatterns(e,t){this.patterns=t;let i=t.map(r=>[e,r]);for(let[r,s]of i){this.hasWalkedCache.storeWalked(r,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)r=r.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(r,s))continue;this.hasWalkedCache.storeWalked(r,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(r.resolve(c),a,d);continue}else if(c===pt){(!r.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(r,s);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(r,a,d===""||d===".");else if(d===".."){let g=r.parent||r;p?this.hasWalkedCache.hasWalked(g,p)||this.subwalks.add(g,p):this.matches.add(g,a,!0)}}else c instanceof RegExp&&this.subwalks.add(r,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let i=this.subwalks.get(e),r=this.child();for(let s of t)for(let o of i){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===pt?r.testGlobstar(s,o,l,a):c instanceof RegExp?r.testRegExp(s,c,l,a):r.testString(s,c,l,a)}return r}testGlobstar(e,t,i,r){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(i&&t.checkFollowGlobstar()?this.subwalks.add(e,i):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),r);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),r)}}testRegExp(e,t,i,r){t.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}testString(e,t,i,r){e.isNamed(t)&&(i?this.subwalks.add(e,i):this.matches.add(e,r,!1))}};var sA=(n,e)=>typeof n=="string"?new ss([n],e):Array.isArray(n)?new ss(n,e):n,Zl=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,t,i){if(this.patterns=e,this.path=t,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=sA(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+r)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+r:"."+r)}}async match(e,t,i){let r=await this.matchCheck(e,i);r&&this.matchFinish(r,t)}matchSync(e,t,i){let r=this.matchCheckSync(e,i);r&&this.matchFinish(r,t)}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new Eo(this.opts),i)}walkCB2(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,i,o):a.readdirCB((l,u)=>this.walkCB3(a,u,i,o),!0)}o()}walkCB3(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of i.subwalks.entries())s++,this.walkCB2(a,c,i.child(),o);o()}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new Eo(this.opts),i)}walkCB2Sync(e,t,i,r){if(this.#o(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,r));return}i.processPatterns(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of i.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,i,o)}o()}walkCB3Sync(e,t,i,r){i=i.filterEntries(e,t);let s=1,o=()=>{--s===0&&r()};for(let[a,c,l]of i.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of i.subwalks.entries())s++,this.walkCB2Sync(a,c,i.child(),o);o()}},wo=class extends Zl{matches=new Set;constructor(e,t,i){super(e,t,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},No=class extends Zl{results;constructor(e,t,i){super(e,t,i),this.results=new Pi({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var oA=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",pn=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ew.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||oA,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?ns:t.platform==="darwin"?ko:t.platform?is:ZE;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new jt(c,r)),[o,a]=s.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new rs(c,u,0,this.platform)})}async walk(){return[...await new wo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new wo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new No(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new No(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var mp=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new jt(t,e).hasMagic())return!0;return!1};function tu(n,e={}){return new pn(n,e).streamSync()}function nw(n,e={}){return new pn(n,e).stream()}function iw(n,e={}){return new pn(n,e).walkSync()}async function tw(n,e={}){return new pn(n,e).walk()}function nu(n,e={}){return new pn(n,e).iterateSync()}function rw(n,e={}){return new pn(n,e).iterate()}var aA=tu,cA=Object.assign(nw,{sync:tu}),lA=nu,uA=Object.assign(rw,{sync:nu}),fA=Object.assign(iw,{stream:tu,iterate:nu}),eu=Object.assign(tw,{glob:tw,globSync:iw,sync:fA,globStream:nw,stream:cA,globStreamSync:tu,streamSync:aA,globIterate:rw,iterate:uA,globIterateSync:nu,iterateSync:lA,Glob:pn,hasMagic:mp,escape:Xr,unescape:fn});eu.glob=eu;var _o=require("path"),lw=require("fs");var Cn=z(Q()),dA=n=>{switch(n){case"string":return V(3);case"int":return V(1);case"boolean":return V(0);case"array":return V(4);case"uint8-array":return V(6);case"string-array":return V(5);case"phandle":return V(1);case"phandles":return V(4);case"phandle-array":return V(4);case"path":return V([3,1]);case"compound":return V(8)}},sw=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},iu=(n,e)=>{if(e=e.include.reduce((t,i)=>{let r=n.find(s=>(0,_o.basename)(s.filePath)===i.name);if(r){let s=i["property-blocklist"];return t.include=t.include.filter(o=>o!==i),hA(n,r,t,s)??t}return console.warn(`Unable to find ${i}`),t},e),e["child-binding"]&&(e["child-binding"].include=uw(e["child-binding"].include),e["child-binding"]=iu(n,e["child-binding"])),!e.include.length)return e},hA=(n,e,t,i=[])=>{let r=iu(n,e),s=iu(n,t);if(!r||!s)return;let o=new Set;Object.keys(r?.properties??{}).forEach(d=>o.add(d)),Object.keys(s?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let p=i?.some(_=>_===d)?{}:r.properties?.[d]??{},g=s.properties?.[d]??{};a={...a,[d]:{...p,...g}}}),s.properties=a;let c=new Set;return Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(r).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let p=r[d]??[],g=s[d]??[];s[d]=Array.from([...p,...g])}),s},uw=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],gp=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values;if(!i?.values.some(r=>!(r?.value instanceof Tt)))return i?.values.map(r=>(r?.value).value)}getNodeTypes(e,t){let i=n.getNodeCompatible(t);if(!i)return[fi()];let r=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(r.length)return r;this.loadTypeAndCache(e);let s=this.typeCache.filter(o=>e.some(a=>i.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return s.length?s:[fi()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let r=eu.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,_o.resolve)(t,o);try{let a=cw.default.parse((0,lw.readFileSync)(o,"utf-8"));return{...a,include:uw(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),s=r.map(o=>iu(r,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...pA(s))})}},ow,fw=()=>(ow??=new gp,ow),pA=n=>n.map(dw),dw=n=>{let e=fi();e.compatible=n.compatible??(n.filePath?(0,_o.basename)(n.filePath,"yaml"):void 0),e.description=n.description,e.bindingsPath=n.filePath,e.bus=typeof n.bus=="string"?[n.bus]:n.bus,e.onBus=n["on-bus"];let i=Object.keys(n).filter(r=>r.endsWith("-cells")).map(r=>({specifier:r.replace(/-cells$/,""),values:n[r]}));return n.properties&&Object.keys(n.properties).forEach(r=>{let s=n.properties[r];mA(e,r,s),e.cellsValues=i}),n["child-binding"]&&(e.childNodeType=dw(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},mA=(n,e,t)=>{let i=n.properties.find(r=>typeof r.name=="string"&&r.getNameMatch(e));if(i){i.required=()=>t.required?"required":"optional",i.values=()=>t.enum??[],i.constValue=sw(t.type,t.const);let r=i.additionalTypeCheck;i.additionalTypeCheck=s=>[...aw(t,e)(s),...r?.(s)??[]]}else{let r=new K(e,dA(t.type),t.required?"required":"optional",void 0,t.enum,aw(t,e));r.desctiption=t.description?[t.description]:void 0,r.constValue=sw(t.type,t.const),n.addProperty(r)}},aw=(n,e)=>{let t=n;return i=>{let r=i.parent.root,s=[];if(t.const){let o=i.ast.quickValues;if(o?.length==1){let a=Array.isArray(t.const)?t.const:[t.const];Array.isArray(o[0])&&a.length===o[0].length&&o[0].every((l,u)=>typeof l=="number"&&Number.isNaN(l)||a[u]===l)||s.push(A(25,i.ast.values??i.ast,Cn.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&s.push(A(14,i.ast,Cn.DiagnosticSeverity.Warning,[],[Cn.DiagnosticTag.Deprecated],[i.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&wt(i.ast.values)?.forEach(a=>{cn(a,r)||s.push(A(23,a,Cn.DiagnosticSeverity.Error))}),t.type==="path"&&i.ast.values?.values.at(0)?.value instanceof Tt){let o=i.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=r.getNode(c);return l?a.push(c):s.push(A(24,o,Cn.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=wt(i.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=cn(c,r);if(!l){s.push(A(23,c??i.ast,Cn.DiagnosticSeverity.Error));break}let u="";e.endsWith("-gpios")?u="gpio":u=t["specifier-space"]??e.slice(0,-1);let d=l.getProperty(`#${u}-cells`);if(!d){s.push(A(16,i.ast,Cn.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[i.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let p=d?Re(d,0,0)??0:0;if(1+p>o.length-a){let g=l.nodeType?.cellsValues?.find(_=>_.specifier===u)?.values;s.push(A(20,c??i.ast,Cn.DiagnosticSeverity.Error,[],[],[i.name,`<${["phandel",...g??[],...Array.from({length:p-(g?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+p}}return s}};var ru=(n,e)=>({getNodeTypes:t=>{switch(e){case"Zephyr":return fw().getNodeTypes(n,t)}}});var hw=z(Q()),yp=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(yp):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:hw.FoldingRangeKind.Region},...n.nodes.flatMap(yp)];function pw(n){return n.rootDocument.nodes.flatMap(yp)}var Zi=z(Q());function gA(n){if(!n||!(n.ast instanceof Se)&&!(n.ast instanceof Ge))return[];let e=t=>t.nodeType?.bindingsPath?[Zi.Location.create(`file://${t.nodeType.bindingsPath}`,Zi.Range.create(Zi.Position.create(0,0),Zi.Position.create(0,0)))]:[];return n.item instanceof be&&!Ze(n.ast)?e(n.item):n.ast instanceof Ge&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Se&&n.ast.linksTo?e(n.ast.linksTo):[]}async function mw(n,e,t){return dt(n,e,i=>[...gA(i)],t)}var os=require("path"),ve=[],Ri,bp,Po=new WeakMap,yA=n=>{let e=Po.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},ut=async()=>{await kw,await Promise.all(ve.map(yA))},Tp=n=>{let e=gw(n);return ve.filter(t=>!e.some(i=>i===t))},gw=n=>ve.filter(e=>{let t=n.contexts?.find(i=>i.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(i=>e.overlays.some(r=>r===i))}),bA=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes),i=(await e.getAllParsers()).flatMap(r=>r.cPreprocessorParser.dtsIncludes);return t.length?t.every(r=>i.some(s=>s.reolvedPath===r.reolvedPath&&s.firstToken.pos.col===r.firstToken.pos.col&&s.firstToken.pos.len===r.firstToken.pos.len&&s.firstToken.pos.line===r.firstToken.pos.line&&s.lastToken.pos.col===r.lastToken.pos.col&&s.lastToken.pos.len===r.lastToken.pos.len&&s.lastToken.pos.line===r.lastToken.pos.line)):e.getContextFiles().some(r=>r===n.parser.uri)},yw=async n=>{let e=Tp(ie),t=await gw(ie),i=await fc(e);if(ve.indexOf(n)===-1)return;let r=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(ve.indexOf(n)===-1)return;let s=await Promise.all(i.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await bA(a.context,c)})))),o=i.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&r.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&(o.forEach(a=>{kp(a),Po.delete(a),console.log(`cleaning up context with ID ${a.name} and uri ${a.parser.uri}`)}),ve=ve.filter(a=>o.indexOf(a)===-1))},ue=(0,ge.createConnection)(ge.ProposedFeatures.all),Hn=new ge.TextDocuments(cc),Sp=!0,vp=!1,bw=!1;ue.onInitialize(n=>{let e=n.capabilities;Sp=!!(e.workspace&&e.workspace.configuration),vp=!!(e.workspace&&e.workspace.workspaceFolders),bw=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:ge.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[ge.CodeActionKind.QuickFix,ge.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:lc,tokenModifiers:uc},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return vp&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});ue.onInitialized(()=>{Sp&&ue.client.register(ge.DidChangeConfigurationNotification.type,{}),vp&&ue.workspace.onDidChangeWorkspaceFolders(n=>{ue.console.log("Workspace folder change event received")})});var Tw={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},ie=Tw,vw=new Map,Sw=!1,kw=new Promise(n=>{let e=setInterval(()=>{Sw&&(n(),clearInterval(e))},100)});ue.onDidChangeConfiguration(n=>{if(Sw=!0,!n.settings)return;console.log("Configuration changed",n),Sp&&vw.clear();let e=ie;ie={...Tw,...n.settings?.devicetree},ie.contexts?.forEach((r,s)=>{if(r.cwd||ie.cwd){let o=r.cwd??ie.cwd;r.includePaths??=ie.defaultIncludePaths,r.zephyrBindings??=ie.defaultIncludePaths,r.bindingType??=ie.defaultBindingType,o&&r.bindingType==="Zephyr"&&(!r.zephyrBindings||r.zephyrBindings.length===0)&&(r.zephyrBindings=["./zephyr/dts/bindings"]),r.zephyrBindings=r.zephyrBindings?.map(a=>(0,os.resolve)(o,a)),r.includePaths=r.includePaths?.map(a=>(0,os.resolve)(o,a)),r.dtsFile=(0,os.resolve)(o,r.dtsFile)}});let t=Tp(e);ve=[],Po=new WeakMap,ie.contexts?.forEach((r,s)=>{let o=r.bindingType,a=new qr(r.dtsFile,r.includePaths??[],o?ru(r.zephyrBindings??[],o):void 0,r.overlays,r.ctxName);ve.push(a),console.log(`New context with ID ${a.name} for ${r.dtsFile}`)});let i=Ew();ve=[...ve,...t.map(r=>{let s=ie.defaultBindingType,o=new qr(r.parser.uri,i.defaultIncludePaths,s?ru(i.defaultZephyrBindings,s):void 0);return console.log(`New context with ID ${o.name} for ${r.parser.uri}`),o})],t=Tp(ie),t.forEach(yw),bp&&Do(bp,!0),bw&&ue.languages.diagnostics.refresh()});var Ew=()=>{let n=(ie.defaultIncludePaths??[]).map(t=>ie.cwd?(0,os.resolve)(ie.cwd,t):t);ie.cwd&&ie.defaultBindingType==="Zephyr"&&!ie.defaultZephyrBindings&&(ie.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(ie.defaultZephyrBindings??[]).map(t=>ie.cwd?(0,os.resolve)(ie.cwd,t):t);return{defaultIncludePaths:n,defaultZephyrBindings:e}};Hn.onDidClose(n=>{ue.sendDiagnostics({uri:n.document.uri,version:Hn.get(n.document.uri)?.version,diagnostics:[]}),vw.delete(n.document.uri)});Hn.onDidOpen(async n=>{ue.sendDiagnostics({uri:n.document.uri,version:Hn.get(n.document.uri)?.version,diagnostics:(await TA(n.document.uri)).items??[]})});var TA=async n=>{n=n.replace("file://",""),await ut();let e=await Ri;return{kind:ge.DocumentDiagnosticReportKind.Full,items:e?await Nw(e,n):[{severity:ge.DiagnosticSeverity.Warning,range:ge.Range.create(ge.Position.create(0,0),ge.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}},vA=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include"}},SA=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`}}).join(" or "),kA=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";default:return"TODO"}},EA=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 10:return"INTRO first value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),wA=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";default:return"TODO"}};Hn.onDidChangeContent(async n=>{console.log("Content changed");let e=n.document.uri.replace("file://","");hi().renewLexer(e,n.document.getText()),await kw;let t=await aT(ve,e);if(t.length)t.forEach(i=>{Po.get(i.context)?.abort.abort();let r=new AbortController,s=new Promise(o=>{setTimeout(async()=>{if(r.signal.aborted){o();return}let a=performance.now();su.delete(i.context);let c=ww(i.context);await i.context.reevaluate(e),kp(i.context,c),Ep(i.context).then(l=>{l.items.map(u=>({uri:u.uri,version:u.version??void 0,diagnostics:u.items})).forEach(u=>{ue.sendDiagnostics(u)})}),o(),console.log("reevaluate",performance.now()-a)},50)});Po.set(i.context,{abort:r,promise:s})});else{if(ie.allowAdhocContexts===!1)return;let i=ie.defaultBindingType,r=Ew(),s=new qr(e,r.defaultIncludePaths,i?ru(r.defaultZephyrBindings,i):void 0);console.log(`New ad hoc context with ID ${s.name} for ${e}`),ve.push(s),Do(e),await s.parser.stable,yw(s)}});var ww=n=>n.getContextFiles().map(e=>({uri:`file://${e}`,version:Hn.get(`file://${e}`)?.version,diagnostics:[]})),kp=(n,e=ww(n))=>{e.forEach(t=>{ue.sendDiagnostics({uri:`file://${t}`,version:Hn.get(`file://${t}`)?.version,diagnostics:[]})})},Ep=async n=>({items:[...await Promise.all(n.getContextFiles().map(async t=>{let i=await Nw(n,t);return{uri:`file://${t}`,kind:ge.DocumentDiagnosticReportKind.Full,items:i,version:Hn.get(`file://${t}`)?.version??null}}))]});ue.languages.diagnostics.onWorkspace(async()=>{await ut();let n=await Ri;return n?Ep(n):{items:[]}});var su=new WeakMap;async function Nw(n,e){let t=performance.now(),i=su.get(n);if(i){let r=i.get(e);if(r)return r}else su.set(n,new Map);try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:a.issues?a.issues.map(vA).join(" or "):"",source:"devicetree",data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:a.issues,edit:a.edit}}};r.push(c)}),(await n.getContextIssues()??[]).filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:SA(a),source:"devicetree",tags:a.tags,relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(kA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))]};r.push(c)}),(await n.getRuntime())?.typesIssues.filter(a=>a.astElement.uri===e).forEach(a=>{let c={severity:a.severity,range:ne(a.astElement),message:EA(a),relatedInformation:[...a.linkedTo.map(l=>({message:a.issues.map(wA).join(" or "),location:{uri:`file://${l.uri}`,range:ne(l)}}))],source:"devicetree",tags:a.tags,data:{firstToken:{pos:a.astElement.firstToken.pos,tokens:a.astElement.firstToken.tokens,value:a.astElement.firstToken.value},lastToken:{pos:a.astElement.lastToken.pos,tokens:a.astElement.lastToken.tokens,value:a.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:a.issues,edit:a.edit}}};r.push(c)}),console.log("diagnostics",e,performance.now()-t),su.get(n)?.set(e,r),r):[{severity:ge.DiagnosticSeverity.Warning,range:ge.Range.create(ge.Position.create(0,0),ge.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}ue.onDidChangeWatchedFiles(n=>{ue.console.log("We received a file change event")});ue.onCompletion(async n=>(await ut(),ve?[...await sv(n,ve,ie.preferredContext),...await gv(n,ve,ie.preferredContext)]:[]));ue.onCompletionResolve(n=>n);Hn.listen(ue);ue.listen();var Do=async(n,e=!1)=>{if(!e&&ie.autoChangeContext===!1)return;bp=n,await ut();let t=await Ri;Ri=Ui(ve,n,ie.preferredContext).then(r=>r?.context);let i=await Ri;t!==i&&(t&&kp(t),i&&Ep(i).then(r=>{r.items.map(s=>({uri:s.uri,version:s.version??void 0,diagnostics:s.items})).forEach(s=>{ue.sendDiagnostics(s)})}),console.log(`(ID: ${i?.name??-1}) activeContext:`,i?.parser.uri),ve.forEach((r,s)=>{console.log(`Context with ID ${r.name} for ${r.parser.uri}`)}))};ue.onDocumentSymbol(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let i=await(await Ri)?.parser;return i?i.getDocumentSymbols(e):[]});ue.onWorkspaceSymbol(async()=>{await ut();let n=await Ri;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ue.languages.semanticTokens.on(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let t=new ge.SemanticTokensBuilder,i=await Ui(ve,e,ie.preferredContext),r=i?.context.isInContext(e);return!i||!r?{data:[]}:(i.context.parser.buildSemanticTokens(t,e),t.build())});ue.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await ut(),(await Ui(ve,e,ie.preferredContext))?.context.getDocumentLinks(e)});ue.onPrepareRename(async n=>(await ut(),fv(n,ve,ie.lockRenameEdits??[],ie.preferredContext)));ue.onRenameRequest(async n=>(await ut(),uv(n,ve,ie.preferredContext)));ue.onReferences(async n=>(await ut(),ov(n,ve,ie.preferredContext)));ue.onDefinition(async n=>{let e=n.textDocument.uri.replace("file://","");await ut();let i=(await(await Ui(ve,e,ie.preferredContext))?.context.getDocumentLinks(e,n.position))?.filter(r=>r.target).map(r=>ge.Location.create(r.target,r.range))??[];return i.length?i:dv(n,ve,ie.preferredContext)});ue.onDeclaration(async n=>(await ut(),hv(n,ve,ie.preferredContext)));ue.onCodeAction(async n=>pv(n));ue.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await ut();let t=await Ui(ve,e,ie.preferredContext);return t?yT(n,t.context):[]});ue.onHover(async n=>(await ut(),(await yv(n,ve,ie.preferredContext)).at(0)));ue.onRequest("devicetree/contexts",async()=>(await ut(),ve.map(n=>n.parser.uri)));ue.onFoldingRanges(async n=>{await ut();let e=n.textDocument.uri.replace("file://","");Do(e);let t=await Ri,i=t?.isInContext(e);return!t||!i?[]:pw(t.parser)});ue.onTypeDefinition(async n=>(await ut(),mw(n,ve)));