devicetree-language-server 0.0.9 → 0.1.1

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 +23 -1
  2. package/dist/server.js +171 -153
  3. package/package.json +6 -2
package/dist/server.js CHANGED
@@ -1,186 +1,193 @@
1
1
  #!/usr/bin/env node
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(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.thenable=Ye.typedArray=Ye.stringArray=Ye.array=Ye.func=Ye.error=Ye.number=Ye.string=Ye.boolean=void 0;function Iw(n){return n===!0||n===!1}Ye.boolean=Iw;function Cp(n){return typeof n=="string"||n instanceof String}Ye.string=Cp;function Lw(n){return typeof n=="number"||n instanceof Number}Ye.number=Lw;function xw(n){return n instanceof Error}Ye.error=xw;function Op(n){return typeof n=="function"}Ye.func=Op;function Ap(n){return Array.isArray(n)}Ye.array=Ap;function Mw(n){return Ap(n)&&n.every(e=>Cp(e))}Ye.stringArray=Mw;function qw(n,e){return Array.isArray(n)&&n.every(e)}Ye.typedArray=qw;function Fw(n){return n&&Op(n.then)}Ye.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,_,y=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(){_||y.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(y.size===0)return;let S=y.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=y.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)){y.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 Ee=v.get(I);if(Ee!==void 0){Ee.cancel(),ir(S);return}else R.add(I)}ou(y,S)}finally{cs()}};function Lo(S){if(An())return;function I(se,we,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,we,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function B(se,we,fe){let je={jsonrpc:c,id:S.id,error:se.toJson()};Ai(je,we,fe),e.write(je).catch(()=>r.error("Sending response failed."))}function W(se,we,fe){se===void 0&&(se=null);let je={jsonrpc:c,id:S.id,result:se};Ai(je,we,fe),e.write(je).catch(()=>r.error("Sending response failed."))}Bo(S);let Ee=u.get(S.method),ye,Ce;Ee&&(ye=Ee.type,Ce=Ee.handler);let Le=Date.now();if(Ce||l){let se=S.id??String(Date.now()),we=ia.is(ce.receiver)?ce.receiver.createCancellationTokenSource(se):ce.receiver.createCancellationTokenSource(S);S.id!==null&&R.has(S.id)&&we.cancel(),S.id!==null&&v.set(se,we);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(we.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,we.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,we.token)}else l&&(fe=l(S.method,S.params,we.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)}
2
+ "use strict";var OO=Object.create;var th=Object.defineProperty;var AO=Object.getOwnPropertyDescriptor;var IO=Object.getOwnPropertyNames;var MO=Object.getPrototypeOf,$O=Object.prototype.hasOwnProperty;var w=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),LO=(n,e)=>{for(var t in e)th(n,t,{get:e[t],enumerable:!0})},xO=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of IO(e))!$O.call(n,s)&&s!==t&&th(n,s,{get:()=>e[s],enumerable:!(r=AO(e,s))||r.enumerable});return n};var G=(n,e,t)=>(t=n!=null?OO(MO(n)):{},xO(e||!n||!n.__esModule?th(t,"default",{value:n,enumerable:!0}):t,n));var Zc=w(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.thenable=at.typedArray=at.stringArray=at.array=at.func=at.error=at.number=at.string=at.boolean=void 0;function qO(n){return n===!0||n===!1}at.boolean=qO;function Nv(n){return typeof n=="string"||n instanceof String}at.string=Nv;function jO(n){return typeof n=="number"||n instanceof Number}at.number=jO;function FO(n){return n instanceof Error}at.error=FO;function Pv(n){return typeof n=="function"}at.func=Pv;function Rv(n){return Array.isArray(n)}at.array=Rv;function BO(n){return Rv(n)&&n.every(e=>Nv(e))}at.stringArray=BO;function UO(n,e){return Array.isArray(n)&&n.every(e)}at.typedArray=UO;function VO(n){return n&&Pv(n.then)}at.thenable=VO});var yi=w(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.stringArray=Lt.array=Lt.func=Lt.error=Lt.number=Lt.string=Lt.boolean=void 0;function WO(n){return n===!0||n===!1}Lt.boolean=WO;function Dv(n){return typeof n=="string"||n instanceof String}Lt.string=Dv;function HO(n){return typeof n=="number"||n instanceof Number}Lt.number=HO;function KO(n){return n instanceof Error}Lt.error=KO;function zO(n){return typeof n=="function"}Lt.func=zO;function Cv(n){return Array.isArray(n)}Lt.array=Cv;function GO(n){return Cv(n)&&n.every(e=>Dv(e))}Lt.stringArray=GO});var Nh=w(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.Message=z.NotificationType9=z.NotificationType8=z.NotificationType7=z.NotificationType6=z.NotificationType5=z.NotificationType4=z.NotificationType3=z.NotificationType2=z.NotificationType1=z.NotificationType0=z.NotificationType=z.RequestType9=z.RequestType8=z.RequestType7=z.RequestType6=z.RequestType5=z.RequestType4=z.RequestType3=z.RequestType2=z.RequestType1=z.RequestType=z.RequestType0=z.AbstractMessageSignature=z.ParameterStructures=z.ResponseError=z.ErrorCodes=void 0;var Cs=yi(),nh;(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})(nh||(z.ErrorCodes=nh={}));var rh=class n extends Error{constructor(e,t,r){super(t),this.code=Cs.number(e)?e:nh.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};z.ResponseError=rh;var Xt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};z.ParameterStructures=Xt;Xt.auto=new Xt("auto");Xt.byPosition=new Xt("byPosition");Xt.byName=new Xt("byName");var We=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Xt.auto}};z.AbstractMessageSignature=We;var sh=class extends We{constructor(e){super(e,0)}};z.RequestType0=sh;var ih=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType=ih;var oh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.RequestType1=oh;var ah=class extends We{constructor(e){super(e,2)}};z.RequestType2=ah;var ch=class extends We{constructor(e){super(e,3)}};z.RequestType3=ch;var lh=class extends We{constructor(e){super(e,4)}};z.RequestType4=lh;var uh=class extends We{constructor(e){super(e,5)}};z.RequestType5=uh;var dh=class extends We{constructor(e){super(e,6)}};z.RequestType6=dh;var fh=class extends We{constructor(e){super(e,7)}};z.RequestType7=fh;var hh=class extends We{constructor(e){super(e,8)}};z.RequestType8=hh;var ph=class extends We{constructor(e){super(e,9)}};z.RequestType9=ph;var mh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType=mh;var gh=class extends We{constructor(e){super(e,0)}};z.NotificationType0=gh;var yh=class extends We{constructor(e,t=Xt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};z.NotificationType1=yh;var bh=class extends We{constructor(e){super(e,2)}};z.NotificationType2=bh;var vh=class extends We{constructor(e){super(e,3)}};z.NotificationType3=vh;var Th=class extends We{constructor(e){super(e,4)}};z.NotificationType4=Th;var _h=class extends We{constructor(e){super(e,5)}};z.NotificationType5=_h;var Sh=class extends We{constructor(e){super(e,6)}};z.NotificationType6=Sh;var wh=class extends We{constructor(e){super(e,7)}};z.NotificationType7=wh;var kh=class extends We{constructor(e){super(e,8)}};z.NotificationType8=kh;var Eh=class extends We{constructor(e){super(e,9)}};z.NotificationType9=Eh;var Ov;(function(n){function e(s){let i=s;return i&&Cs.string(i.method)&&(Cs.string(i.id)||Cs.number(i.id))}n.isRequest=e;function t(s){let i=s;return i&&Cs.string(i.method)&&s.id===void 0}n.isNotification=t;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(Cs.string(i.id)||Cs.number(i.id)||i.id===null)}n.isResponse=r})(Ov||(z.Message=Ov={}))});var Rh=w(Br=>{"use strict";var Av;Object.defineProperty(Br,"__esModule",{value:!0});Br.LRUCache=Br.LinkedMap=Br.Touch=void 0;var xt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(xt||(Br.Touch=xt={}));var el=class{constructor(){this[Av]="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=xt.None){let r=this._map.get(e);if(r)return t!==xt.None&&this.touch(r,t),r.value}set(e,t,r=xt.None){let s=this._map.get(e);if(s)s.value=t,r!==xt.None&&this.touch(s,r);else{switch(s={key:e,value:t,next:void 0,previous:void 0},r){case xt.None:this.addItemLast(s);break;case xt.First:this.addItemFirst(s);break;case xt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),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 r=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}[(Av=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,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,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.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!==xt.First&&t!==xt.Last)){if(t===xt.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===xt.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};Br.LinkedMap=el;var Ph=class extends el{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=xt.AsNew){return super.get(e,t)}peek(e){return super.get(e,xt.None)}set(e,t){return super.set(e,t,xt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Br.LRUCache=Ph});var Mv=w(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.Disposable=void 0;var Iv;(function(n){function e(t){return{dispose:t}}n.create=e})(Iv||(tl.Disposable=Iv={}))});var Ur=w(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Dh;function Ch(){if(Dh===void 0)throw new Error("No runtime abstraction layer installed");return Dh}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Dh=t}n.install=e})(Ch||(Ch={}));Oh.default=Ch});var vi=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Emitter=bi.Event=void 0;var YO=Ur(),$v;(function(n){let e={dispose(){}};n.None=function(){return e}})($v||(bi.Event=$v={}));var Ah=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)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=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{t.push(r[i].apply(s[i],e))}catch(a){(0,YO.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},nl=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new Ah),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};bi.Emitter=nl;nl._noop=function(){}});var il=w(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CancellationTokenSource=Ti.CancellationToken=void 0;var JO=Ur(),XO=yi(),Ih=vi(),rl;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ih.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ih.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||XO.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(rl||(Ti.CancellationToken=rl={}));var QO=Object.freeze(function(n,e){let t=(0,JO.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),sl=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?QO:(this._emitter||(this._emitter=new Ih.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Mh=class{get token(){return this._token||(this._token=new sl),this._token}cancel(){this._token?this._token.cancel():this._token=rl.Cancelled}dispose(){this._token?this._token instanceof sl&&this._token.dispose():this._token=rl.None}};Ti.CancellationTokenSource=Mh});var Lv=w(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.SharedArrayReceiverStrategy=_i.SharedArraySenderStrategy=void 0;var ZO=il(),Wo;(function(n){n.Continue=0,n.Cancelled=1})(Wo||(Wo={}));var $h=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=Wo.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Wo.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};_i.SharedArraySenderStrategy=$h;var Lh=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Wo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},xh=class{constructor(e){this.token=new Lh(e)}cancel(){}dispose(){}},qh=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new ZO.CancellationTokenSource:new xh(t)}};_i.SharedArrayReceiverStrategy=qh});var Fh=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.Semaphore=void 0;var eA=Ur(),jh=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,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,eA.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(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};ol.Semaphore=jh});var qv=w(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ReadableStreamMessageReader=Vr.AbstractMessageReader=Vr.MessageReader=void 0;var Uh=Ur(),Si=yi(),Bh=vi(),tA=Fh(),xv;(function(n){function e(t){let r=t;return r&&Si.func(r.listen)&&Si.func(r.dispose)&&Si.func(r.onError)&&Si.func(r.onClose)&&Si.func(r.onPartialMessage)}n.is=e})(xv||(Vr.MessageReader=xv={}));var al=class{constructor(){this.errorEmitter=new Bh.Emitter,this.closeEmitter=new Bh.Emitter,this.partialMessageEmitter=new Bh.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: ${Si.string(e.message)?e.message:"unknown"}`)}};Vr.AbstractMessageReader=al;var Vh;(function(n){function e(t){let r,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(i=t.contentDecoder,o.set(i.name,i)),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,Uh.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Vh||(Vh={}));var Wh=class extends al{constructor(e,t){super(),this.readable=e,this.options=Vh.fromOptions(t),this.buffer=(0,Uh.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new tA.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(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
3
+ ${JSON.stringify(Object.fromEntries(r))}`));return}let i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).catch(r=>{this.fireError(r)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Uh.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))}};Vr.ReadableStreamMessageReader=Wh});var Vv=w(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.WriteableStreamMessageWriter=Wr.AbstractMessageWriter=Wr.MessageWriter=void 0;var jv=Ur(),Ho=yi(),nA=Fh(),Fv=vi(),rA="Content-Length: ",Bv=`\r
4
+ `,Uv;(function(n){function e(t){let r=t;return r&&Ho.func(r.dispose)&&Ho.func(r.onClose)&&Ho.func(r.onError)&&Ho.func(r.write)}n.is=e})(Uv||(Wr.MessageWriter=Uv={}));var cl=class{constructor(){this.errorEmitter=new Fv.Emitter,this.closeEmitter=new Fv.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,r])}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: ${Ho.string(e.message)?e.message:"unknown"}`)}};Wr.AbstractMessageWriter=cl;var Hh;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,jv.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,jv.default)().applicationJson.encoder}}n.fromOptions=e})(Hh||(Hh={}));var Kh=class extends cl{constructor(e,t){super(),this.writable=e,this.options=Hh.fromOptions(t),this.errorCount=0,this.writeSemaphore=new nA.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let s=[];return s.push(rA,r.byteLength.toString(),Bv),s.push(Bv),this.doWrite(e,s,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};Wr.WriteableStreamMessageWriter=Kh});var Wv=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.AbstractMessageBuffer=void 0;var sA=13,iA=10,oA=`\r
5
+ `,zh=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,r=0,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case sA:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case iA:switch(t){case 1:t=2;break;case 3:t=4,s++;break e;default:t=0}break;default:t=0}s++}i+=l.byteLength,r++}if(t!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(oA);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 f=u.substr(0,d),m=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,m)}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 i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);t.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else t.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return t}};ll.AbstractMessageBuffer=zh});var Yv=w(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.createMessageConnection=ie.ConnectionOptions=ie.MessageStrategy=ie.CancellationStrategy=ie.CancellationSenderStrategy=ie.CancellationReceiverStrategy=ie.RequestCancellationReceiverStrategy=ie.IdCancellationReceiverStrategy=ie.ConnectionStrategy=ie.ConnectionError=ie.ConnectionErrors=ie.LogTraceNotification=ie.SetTraceNotification=ie.TraceFormat=ie.TraceValues=ie.Trace=ie.NullLogger=ie.ProgressType=ie.ProgressToken=void 0;var Hv=Ur(),Ze=yi(),Q=Nh(),Kv=Rh(),Ko=vi(),Gh=il(),Yo;(function(n){n.type=new Q.NotificationType("$/cancelRequest")})(Yo||(Yo={}));var Yh;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Yh||(ie.ProgressToken=Yh={}));var zo;(function(n){n.type=new Q.NotificationType("$/progress")})(zo||(zo={}));var Jh=class{constructor(){}};ie.ProgressType=Jh;var Xh;(function(n){function e(t){return Ze.func(t)}n.is=e})(Xh||(Xh={}));ie.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ne;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(Ne||(ie.Trace=Ne={}));var zv;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(zv||(ie.TraceValues=zv={}));(function(n){function e(r){if(!Ze.string(r))return n.Off;switch(r=r.toLowerCase(),r){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(r){switch(r){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})(Ne||(ie.Trace=Ne={}));var dn;(function(n){n.Text="text",n.JSON="json"})(dn||(ie.TraceFormat=dn={}));(function(n){function e(t){return Ze.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(dn||(ie.TraceFormat=dn={}));var Qh;(function(n){n.type=new Q.NotificationType("$/setTrace")})(Qh||(ie.SetTraceNotification=Qh={}));var ul;(function(n){n.type=new Q.NotificationType("$/logTrace")})(ul||(ie.LogTraceNotification=ul={}));var Go;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(Go||(ie.ConnectionErrors=Go={}));var wi=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};ie.ConnectionError=wi;var Zh;(function(n){function e(t){let r=t;return r&&Ze.func(r.cancelUndispatched)}n.is=e})(Zh||(ie.ConnectionStrategy=Zh={}));var dl;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&Ze.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Ze.func(r.dispose))}n.is=e})(dl||(ie.IdCancellationReceiverStrategy=dl={}));var ep;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&Ze.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Ze.func(r.dispose))}n.is=e})(ep||(ie.RequestCancellationReceiverStrategy=ep={}));var fl;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Gh.CancellationTokenSource}});function e(t){return dl.is(t)||ep.is(t)}n.is=e})(fl||(ie.CancellationReceiverStrategy=fl={}));var hl;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(Yo.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&Ze.func(r.sendCancellation)&&Ze.func(r.cleanup)}n.is=e})(hl||(ie.CancellationSenderStrategy=hl={}));var pl;(function(n){n.Message=Object.freeze({receiver:fl.Message,sender:hl.Message});function e(t){let r=t;return r&&fl.is(r.receiver)&&hl.is(r.sender)}n.is=e})(pl||(ie.CancellationStrategy=pl={}));var ml;(function(n){function e(t){let r=t;return r&&Ze.func(r.handleMessage)}n.is=e})(ml||(ie.MessageStrategy=ml={}));var Gv;(function(n){function e(t){let r=t;return r&&(pl.is(r.cancellationStrategy)||Zh.is(r.connectionStrategy)||ml.is(r.messageStrategy))}n.is=e})(Gv||(ie.ConnectionOptions=Gv={}));var xn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(xn||(xn={}));function aA(n,e,t,r){let s=t!==void 0?t:ie.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,m=new Map,T,g=new Kv.LinkedMap,S=new Map,k=new Set,v=new Map,b=Ne.Off,R=dn.Text,O,L=xn.New,V=new Ko.Emitter,j=new Ko.Emitter,re=new Ko.Emitter,Oe=new Ko.Emitter,yt=new Ko.Emitter,de=r&&r.cancellationStrategy?r.cancellationStrategy:pl.Message;function yn(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function jr(E){return E===null?"res-unknown-"+(++a).toString():"res-"+E.toString()}function xc(){return"not-"+(++o).toString()}function eh(E,M){Q.Message.isRequest(M)?E.set(yn(M.id),M):Q.Message.isResponse(M)?E.set(jr(M.id),M):E.set(xc(),M)}function qc(E){}function qo(){return L===xn.Listening}function Ps(){return L===xn.Closed}function kr(){return L===xn.Disposed}function fi(){(L===xn.New||L===xn.Listening)&&(L=xn.Closed,j.fire(void 0))}function Rs(E){V.fire([E,void 0,void 0])}function jc(E){V.fire(E)}n.onClose(fi),n.onError(Rs),e.onClose(fi),e.onError(jc);function jo(){T||g.size===0||(T=(0,Hv.default)().timer.setImmediate(()=>{T=void 0,Fc()}))}function Fo(E){Q.Message.isRequest(E)?Uc(E):Q.Message.isNotification(E)?Wc(E):Q.Message.isResponse(E)?Vc(E):hi(E)}function Fc(){if(g.size===0)return;let E=g.shift();try{let M=r?.messageStrategy;ml.is(M)?M.handleMessage(E,Fo):Fo(E)}finally{jo()}}let Bc=E=>{try{if(Q.Message.isNotification(E)&&E.method===Yo.type.method){let M=E.params.id,F=yn(M),W=g.get(F);if(Q.Message.isRequest(W)){let Re=r?.connectionStrategy,Ve=Re&&Re.cancelUndispatched?Re.cancelUndispatched(W,qc):void 0;if(Ve&&(Ve.error!==void 0||Ve.result!==void 0)){g.delete(F),v.delete(M),Ve.id=W.id,Ds(Ve,E.method,Date.now()),e.write(Ve).catch(()=>s.error("Sending response for canceled message failed."));return}}let Ae=v.get(M);if(Ae!==void 0){Ae.cancel(),pi(E);return}else k.add(M)}eh(g,E)}finally{jo()}};function Uc(E){if(kr())return;function M(fe,$e,_e){let tt={jsonrpc:c,id:E.id};fe instanceof Q.ResponseError?tt.error=fe.toJson():tt.result=fe===void 0?null:fe,Ds(tt,$e,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}function F(fe,$e,_e){let tt={jsonrpc:c,id:E.id,error:fe.toJson()};Ds(tt,$e,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}function W(fe,$e,_e){fe===void 0&&(fe=null);let tt={jsonrpc:c,id:E.id,result:fe};Ds(tt,$e,_e),e.write(tt).catch(()=>s.error("Sending response failed."))}zc(E);let Ae=u.get(E.method),Re,Ve;Ae&&(Re=Ae.type,Ve=Ae.handler);let Ye=Date.now();if(Ve||l){let fe=E.id??String(Date.now()),$e=dl.is(de.receiver)?de.receiver.createCancellationTokenSource(fe):de.receiver.createCancellationTokenSource(E);E.id!==null&&k.has(E.id)&&$e.cancel(),E.id!==null&&v.set(fe,$e);try{let _e;if(Ve)if(E.params===void 0){if(Re!==void 0&&Re.numberOfParams!==0){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Re.numberOfParams} params but received none.`),E.method,Ye);return}_e=Ve($e.token)}else if(Array.isArray(E.params)){if(Re!==void 0&&Re.parameterStructures===Q.ParameterStructures.byName){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,Ye);return}_e=Ve(...E.params,$e.token)}else{if(Re!==void 0&&Re.parameterStructures===Q.ParameterStructures.byPosition){F(new Q.ResponseError(Q.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,Ye);return}_e=Ve(E.params,$e.token)}else l&&(_e=l(E.method,E.params,$e.token));let tt=_e;_e?tt.then?tt.then(_t=>{v.delete(fe),M(_t,E.method,Ye)},_t=>{v.delete(fe),_t instanceof Q.ResponseError?F(_t,E.method,Ye):_t&&Ze.string(_t.message)?F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${_t.message}`),E.method,Ye):F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,Ye)}):(v.delete(fe),M(_e,E.method,Ye)):(v.delete(fe),W(_e,E.method,Ye))}catch(_e){v.delete(fe),_e instanceof Q.ResponseError?M(_e,E.method,Ye):_e&&Ze.string(_e.message)?F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${_e.message}`),E.method,Ye):F(new Q.ResponseError(Q.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,Ye)}}else F(new Q.ResponseError(Q.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,Ye)}function Vc(E){if(!kr())if(E.id===null)E.error?s.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(E.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let M=E.id,F=S.get(M);if(Gc(E,F),F!==void 0){S.delete(M);try{if(E.error){let W=E.error;F.reject(new Q.ResponseError(W.code,W.message,W.data))}else if(E.result!==void 0)F.resolve(E.result);else throw new Error("Should never happen.")}catch(W){W.message?s.error(`Response handler '${F.method}' failed with message: ${W.message}`):s.error(`Response handler '${F.method}' failed unexpectedly.`)}}}}function Wc(E){if(kr())return;let M,F;if(E.method===Yo.type.method){let W=E.params.id;k.delete(W),pi(E);return}else{let W=f.get(E.method);W&&(F=W.handler,M=W.type)}if(F||d)try{if(pi(E),F)if(E.params===void 0)M!==void 0&&M.numberOfParams!==0&&M.parameterStructures!==Q.ParameterStructures.byName&&s.error(`Notification ${E.method} defines ${M.numberOfParams} params but received none.`),F();else if(Array.isArray(E.params)){let W=E.params;E.method===zo.type.method&&W.length===2&&Yh.is(W[0])?F({token:W[0],value:W[1]}):(M!==void 0&&(M.parameterStructures===Q.ParameterStructures.byName&&s.error(`Notification ${E.method} defines parameters by name but received parameters by position`),M.numberOfParams!==E.params.length&&s.error(`Notification ${E.method} defines ${M.numberOfParams} params but received ${W.length} arguments`)),F(...W))}else M!==void 0&&M.parameterStructures===Q.ParameterStructures.byPosition&&s.error(`Notification ${E.method} defines parameters by position but received parameters by name`),F(E.params);else d&&d(E.method,E.params)}catch(W){W.message?s.error(`Notification handler '${E.method}' failed with message: ${W.message}`):s.error(`Notification handler '${E.method}' failed unexpectedly.`)}else re.fire(E)}function hi(E){if(!E){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(E,null,4)}`);let M=E;if(Ze.string(M.id)||Ze.number(M.id)){let F=M.id,W=S.get(F);W&&W.reject(new Error("The received response has neither a result nor an error property."))}}function Mn(E){if(E!=null)switch(b){case Ne.Verbose:return JSON.stringify(E,null,4);case Ne.Compact:return JSON.stringify(E);default:return}}function Hc(E){if(!(b===Ne.Off||!O))if(R===dn.Text){let M;(b===Ne.Verbose||b===Ne.Compact)&&E.params&&(M=`Params: ${Mn(E.params)}
9
9
 
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)}
10
+ `),O.log(`Sending request '${E.method} - (${E.id})'.`,M)}else Er("send-request",E)}function Kc(E){if(!(b===Ne.Off||!O))if(R===dn.Text){let M;(b===Ne.Verbose||b===Ne.Compact)&&(E.params?M=`Params: ${Mn(E.params)}
11
11
 
12
- `:I=`No parameters provided.
12
+ `:M=`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: ${Zt(S.error.data)}
14
+ `),O.log(`Sending notification '${E.method}'.`,M)}else Er("send-notification",E)}function Ds(E,M,F){if(!(b===Ne.Off||!O))if(R===dn.Text){let W;(b===Ne.Verbose||b===Ne.Compact)&&(E.error&&E.error.data?W=`Error data: ${Mn(E.error.data)}
15
15
 
16
- `:S.result?W=`Result: ${Zt(S.result)}
16
+ `:E.result?W=`Result: ${Mn(E.result)}
17
17
 
18
- `:S.error===void 0&&(W=`No result returned.
18
+ `:E.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 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)}
20
+ `)),O.log(`Sending response '${M} - (${E.id})'. Processing request took ${Date.now()-F}ms`,W)}else Er("send-response",E)}function zc(E){if(!(b===Ne.Off||!O))if(R===dn.Text){let M;(b===Ne.Verbose||b===Ne.Compact)&&E.params&&(M=`Params: ${Mn(E.params)}
21
21
 
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)}
22
+ `),O.log(`Received request '${E.method} - (${E.id})'.`,M)}else Er("receive-request",E)}function pi(E){if(!(b===Ne.Off||!O||E.method===ul.type.method))if(R===dn.Text){let M;(b===Ne.Verbose||b===Ne.Compact)&&(E.params?M=`Params: ${Mn(E.params)}
23
23
 
24
- `:I=`No parameters provided.
24
+ `:M=`No parameters provided.
25
25
 
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)}
26
+ `),O.log(`Received notification '${E.method}'.`,M)}else Er("receive-notification",E)}function Gc(E,M){if(!(b===Ne.Off||!O))if(R===dn.Text){let F;if((b===Ne.Verbose||b===Ne.Compact)&&(E.error&&E.error.data?F=`Error data: ${Mn(E.error.data)}
27
27
 
28
- `:S.result?B=`Result: ${Zt(S.result)}
28
+ `:E.result?F=`Result: ${Mn(E.result)}
29
29
 
30
- `:S.error===void 0&&(B=`No result returned.
30
+ `:E.error===void 0&&(F=`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 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 Ee=0;Ee<I.length&&Ee<W;Ee++)B.push(mn(I[Ee]));if(I.length<W)for(let Ee=I.length;Ee<W;Ee++)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,we=se-Ce;switch(we){case 0:W=void 0;break;case 1:W=rr(Le,I[Ce]);break;default:if(Le===X.ParameterStructures.byName)throw new Error(`Received ${we} 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 Ee={jsonrpc:c,method:B,params:W};return Fo(Ee),e.write(Ee).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,Ee;if(qe.string(S)){B=S;let se=I[0],we=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(we)&&(nt=nt-1,Ee=we);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 we=S.numberOfParams;Ee=Zu.CancellationToken.is(se[we])?se[we]:void 0}let ye=s++,Ce;Ee&&(Ce=Ee.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,we)=>{let fe=Lt=>{se(Lt),ce.sender.cleanup(ye),Ce?.dispose()},je=Lt=>{we(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,Ee=xt.Text;B!==void 0&&(qe.boolean(B)?W=B:(W=B.sendNotification||!1,Ee=B.traceFormat||xt.Text)),T=S,N=Ee,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,y=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 y;(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})(y||(e.DiagnosticRelatedInformation=y={}));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,y.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 Ee;(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})(Ee||(e.InlineValueText=Ee={}));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 we;(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})(we||(e.InlayHintLabelPart=we={}));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,we.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=[`
32
+ `)),M){let W=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";O.log(`Received response '${M.method} - (${E.id})' in ${Date.now()-M.timerStart}ms.${W}`,F)}else O.log(`Received response ${E.id} without active response promise.`,F)}else Er("receive-response",E)}function Er(E,M){if(!O||b===Ne.Off)return;let F={isLSPMessage:!0,type:E,message:M,timestamp:Date.now()};O.log(F)}function Fr(){if(Ps())throw new wi(Go.Closed,"Connection is closed.");if(kr())throw new wi(Go.Disposed,"Connection is disposed.")}function Yc(){if(qo())throw new wi(Go.AlreadyListening,"Connection is already listening")}function Jc(){if(!qo())throw new Error("Call listen() first.")}function er(E){return E===void 0?null:E}function Bo(E){if(E!==null)return E}function Uo(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function mi(E,M){switch(E){case Q.ParameterStructures.auto:return Uo(M)?Bo(M):[er(M)];case Q.ParameterStructures.byName:if(!Uo(M))throw new Error("Received parameters by name but param is not an object literal.");return Bo(M);case Q.ParameterStructures.byPosition:return[er(M)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Vo(E,M){let F,W=E.numberOfParams;switch(W){case 0:F=void 0;break;case 1:F=mi(E.parameterStructures,M[0]);break;default:F=[];for(let Ae=0;Ae<M.length&&Ae<W;Ae++)F.push(er(M[Ae]));if(M.length<W)for(let Ae=M.length;Ae<W;Ae++)F.push(null);break}return F}let Nr={sendNotification:(E,...M)=>{Fr();let F,W;if(Ze.string(E)){F=E;let Re=M[0],Ve=0,Ye=Q.ParameterStructures.auto;Q.ParameterStructures.is(Re)&&(Ve=1,Ye=Re);let fe=M.length,$e=fe-Ve;switch($e){case 0:W=void 0;break;case 1:W=mi(Ye,M[Ve]);break;default:if(Ye===Q.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);W=M.slice(Ve,fe).map(_e=>er(_e));break}}else{let Re=M;F=E.method,W=Vo(E,Re)}let Ae={jsonrpc:c,method:F,params:W};return Kc(Ae),e.write(Ae).catch(Re=>{throw s.error("Sending notification failed."),Re})},onNotification:(E,M)=>{Fr();let F;return Ze.func(E)?d=E:M&&(Ze.string(E)?(F=E,f.set(E,{type:void 0,handler:M})):(F=E.method,f.set(E.method,{type:E,handler:M}))),{dispose:()=>{F!==void 0?f.delete(F):d=void 0}}},onProgress:(E,M,F)=>{if(m.has(M))throw new Error(`Progress handler for token ${M} already registered`);return m.set(M,F),{dispose:()=>{m.delete(M)}}},sendProgress:(E,M,F)=>Nr.sendNotification(zo.type,{token:M,value:F}),onUnhandledProgress:Oe.event,sendRequest:(E,...M)=>{Fr(),Jc();let F,W,Ae;if(Ze.string(E)){F=E;let fe=M[0],$e=M[M.length-1],_e=0,tt=Q.ParameterStructures.auto;Q.ParameterStructures.is(fe)&&(_e=1,tt=fe);let _t=M.length;Gh.CancellationToken.is($e)&&(_t=_t-1,Ae=$e);let un=_t-_e;switch(un){case 0:W=void 0;break;case 1:W=mi(tt,M[_e]);break;default:if(tt===Q.ParameterStructures.byName)throw new Error(`Received ${un} parameters for 'by Name' request parameter structure.`);W=M.slice(_e,_t).map(Xc=>er(Xc));break}}else{let fe=M;F=E.method,W=Vo(E,fe);let $e=E.numberOfParams;Ae=Gh.CancellationToken.is(fe[$e])?fe[$e]:void 0}let Re=i++,Ve;Ae&&(Ve=Ae.onCancellationRequested(()=>{let fe=de.sender.sendCancellation(Nr,Re);return fe===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${Re}`),Promise.resolve()):fe.catch(()=>{s.log(`Sending cancellation messages for id ${Re} failed`)})}));let Ye={jsonrpc:c,id:Re,method:F,params:W};return Hc(Ye),typeof de.sender.enableCancellation=="function"&&de.sender.enableCancellation(Ye),new Promise(async(fe,$e)=>{let _e=un=>{fe(un),de.sender.cleanup(Re),Ve?.dispose()},tt=un=>{$e(un),de.sender.cleanup(Re),Ve?.dispose()},_t={method:F,timerStart:Date.now(),resolve:_e,reject:tt};try{await e.write(Ye),S.set(Re,_t)}catch(un){throw s.error("Sending request failed."),_t.reject(new Q.ResponseError(Q.ErrorCodes.MessageWriteError,un.message?un.message:"Unknown reason")),un}})},onRequest:(E,M)=>{Fr();let F=null;return Xh.is(E)?(F=void 0,l=E):Ze.string(E)?(F=null,M!==void 0&&(F=E,u.set(E,{handler:M,type:void 0}))):M!==void 0&&(F=E.method,u.set(E.method,{type:E,handler:M})),{dispose:()=>{F!==null&&(F!==void 0?u.delete(F):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(E,M,F)=>{let W=!1,Ae=dn.Text;F!==void 0&&(Ze.boolean(F)?W=F:(W=F.sendNotification||!1,Ae=F.traceFormat||dn.Text)),b=E,R=Ae,b===Ne.Off?O=void 0:O=M,W&&!Ps()&&!kr()&&await Nr.sendNotification(Qh.type,{value:Ne.toString(E)})},onError:V.event,onClose:j.event,onUnhandledNotification:re.event,onDispose:yt.event,end:()=>{e.end()},dispose:()=>{if(kr())return;L=xn.Disposed,yt.fire(void 0);let E=new Q.ResponseError(Q.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of S.values())M.reject(E);S=new Map,v=new Map,k=new Set,g=new Kv.LinkedMap,Ze.func(e.dispose)&&e.dispose(),Ze.func(n.dispose)&&n.dispose()},listen:()=>{Fr(),Yc(),L=xn.Listening,n.listen(Bc)},inspect:()=>{(0,Hv.default)().console.log("inspect")}};return Nr.onNotification(ul.type,E=>{if(b===Ne.Off||!O)return;let M=b===Ne.Verbose||b===Ne.Compact;O.log(E.message,M?E.verbose:void 0)}),Nr.onNotification(zo.type,E=>{let M=m.get(E.token);M?M(E.value):Oe.fire(E)}),Nr}ie.createMessageConnection=aA});var gl=w(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.ProgressType=I.ProgressToken=I.createMessageConnection=I.NullLogger=I.ConnectionOptions=I.ConnectionStrategy=I.AbstractMessageBuffer=I.WriteableStreamMessageWriter=I.AbstractMessageWriter=I.MessageWriter=I.ReadableStreamMessageReader=I.AbstractMessageReader=I.MessageReader=I.SharedArrayReceiverStrategy=I.SharedArraySenderStrategy=I.CancellationToken=I.CancellationTokenSource=I.Emitter=I.Event=I.Disposable=I.LRUCache=I.Touch=I.LinkedMap=I.ParameterStructures=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.ErrorCodes=I.ResponseError=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType0=I.RequestType=I.Message=I.RAL=void 0;I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=void 0;var je=Nh();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return je.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return je.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return je.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return je.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return je.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return je.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return je.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return je.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return je.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return je.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return je.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return je.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return je.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return je.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return je.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return je.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return je.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return je.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return je.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return je.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return je.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return je.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return je.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return je.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return je.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return je.ParameterStructures}});var tp=Rh();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return tp.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return tp.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return tp.Touch}});var cA=Mv();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return cA.Disposable}});var Jv=vi();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return Jv.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return Jv.Emitter}});var Xv=il();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return Xv.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return Xv.CancellationToken}});var Qv=Lv();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Qv.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Qv.SharedArrayReceiverStrategy}});var np=qv();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return np.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return np.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return np.ReadableStreamMessageReader}});var rp=Vv();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return rp.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return rp.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return rp.WriteableStreamMessageWriter}});var lA=Wv();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return lA.AbstractMessageBuffer}});var Ct=Yv();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Ct.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Ct.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Ct.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Ct.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Ct.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Ct.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Ct.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Ct.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Ct.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Ct.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Ct.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Ct.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Ct.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ct.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ct.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Ct.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Ct.MessageStrategy}});var uA=Ur();I.RAL=uA.default});var tT=w(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var Zv=require("util"),Rr=gl(),yl=class n extends Rr.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 Zv.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)}};yl.emptyBuffer=Buffer.allocUnsafe(0);var sp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Rr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Rr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Rr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Rr.Disposable.create(()=>this.stream.off("data",e))}},ip=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Rr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Rr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Rr.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},eT=Object.freeze({messageBuffer:Object.freeze({create:n=>new yl(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 Zv.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new sp(n),asWritableStream:n=>new ip(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let r=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(r)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let r=setInterval(n,e,...t);return{dispose:()=>clearInterval(r)}}})});function op(){return eT}(function(n){function e(){Rr.RAL.install(eT)}n.install=e})(op||(op={}));ap.default=op});var Is=w(me=>{"use strict";var dA=me&&me.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),fA=me&&me.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dA(e,n,t)};Object.defineProperty(me,"__esModule",{value:!0});me.createMessageConnection=me.createServerSocketTransport=me.createClientSocketTransport=me.createServerPipeTransport=me.createClientPipeTransport=me.generateRandomPipeName=me.StreamMessageWriter=me.StreamMessageReader=me.SocketMessageWriter=me.SocketMessageReader=me.PortMessageWriter=me.PortMessageReader=me.IPCMessageWriter=me.IPCMessageReader=void 0;var ki=tT();ki.default.install();var nT=require("path"),hA=require("os"),pA=require("crypto"),Tl=require("net"),fn=gl();fA(gl(),me);var cp=class extends fn.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),fn.Disposable.create(()=>this.process.off("message",e))}};me.IPCMessageReader=cp;var lp=class extends fn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",r=>this.fireError(r)),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(){}};me.IPCMessageWriter=lp;var up=class extends fn.AbstractMessageReader{constructor(e){super(),this.onData=new fn.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)}};me.PortMessageReader=up;var dp=class extends fn.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(){}};me.PortMessageWriter=dp;var Os=class extends fn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,ki.default)().stream.asReadableStream(e),t)}};me.SocketMessageReader=Os;var As=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,ki.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};me.SocketMessageWriter=As;var bl=class extends fn.ReadableStreamMessageReader{constructor(e,t){super((0,ki.default)().stream.asReadableStream(e),t)}};me.StreamMessageReader=bl;var vl=class extends fn.WriteableStreamMessageWriter{constructor(e,t){super((0,ki.default)().stream.asWritableStream(e),t)}};me.StreamMessageWriter=vl;var rT=process.env.XDG_RUNTIME_DIR,mA=new Map([["linux",107],["darwin",103]]);function gA(){let n=(0,pA.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;rT?e=nT.join(rT,`vscode-ipc-${n}.sock`):e=nT.join(hA.tmpdir(),`vscode-${n}.sock`);let t=mA.get(process.platform);return t!==void 0&&e.length>t&&(0,ki.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}me.generateRandomPipeName=gA;function yA(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Tl.createServer)(a=>{o.close(),t([new Os(a,e),new As(a,e)])});o.on("error",i),o.listen(n,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}me.createClientPipeTransport=yA;function bA(n,e="utf-8"){let t=(0,Tl.createConnection)(n);return[new Os(t,e),new As(t,e)]}me.createServerPipeTransport=bA;function vA(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,Tl.createServer)(a=>{o.close(),t([new Os(a,e),new As(a,e)])});o.on("error",i),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}me.createClientSocketTransport=vA;function TA(n,e="utf-8"){let t=(0,Tl.createConnection)(n,"127.0.0.1");return[new Os(t,e),new As(t,e)]}me.createServerSocketTransport=TA;function _A(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function SA(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function wA(n,e,t,r){t||(t=fn.NullLogger);let s=_A(n)?new bl(n):n,i=SA(e)?new vl(e):e;return fn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,fn.createMessageConnection)(s,i,t,r)}me.createMessageConnection=wA});var fp=w((EH,sT)=>{"use strict";sT.exports=Is()});var Sl=w((iT,_l)=>{(function(n){if(typeof _l=="object"&&typeof _l.exports=="object"){var e=n(require,iT);e!==void 0&&(_l.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(p){function N(P){return typeof P=="string"}p.is=N})(t||(e.DocumentUri=t={}));var r;(function(p){function N(P){return typeof P=="string"}p.is=N})(r||(e.URI=r={}));var s;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&p.MIN_VALUE<=P&&P<=p.MAX_VALUE}p.is=N})(s||(e.integer=s={}));var i;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&p.MIN_VALUE<=P&&P<=p.MAX_VALUE}p.is=N})(i||(e.uinteger=i={}));var o;(function(p){function N(y,h){return y===Number.MAX_VALUE&&(y=i.MAX_VALUE),h===Number.MAX_VALUE&&(h=i.MAX_VALUE),{line:y,character:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.uinteger(h.line)&&C.uinteger(h.character)}p.is=P})(o||(e.Position=o={}));var a;(function(p){function N(y,h,D,$){if(C.uinteger(y)&&C.uinteger(h)&&C.uinteger(D)&&C.uinteger($))return{start:o.create(y,h),end:o.create(D,$)};if(o.is(y)&&o.is(h))return{start:y,end:h};throw new Error("Range#create called with invalid arguments[".concat(y,", ").concat(h,", ").concat(D,", ").concat($,"]"))}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&o.is(h.start)&&o.is(h.end)}p.is=P})(a||(e.Range=a={}));var c;(function(p){function N(y,h){return{uri:y,range:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&(C.string(h.uri)||C.undefined(h.uri))}p.is=P})(c||(e.Location=c={}));var l;(function(p){function N(y,h,D,$){return{targetUri:y,targetRange:h,targetSelectionRange:D,originSelectionRange:$}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.targetRange)&&C.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||C.undefined(h.originSelectionRange))}p.is=P})(l||(e.LocationLink=l={}));var u;(function(p){function N(y,h,D,$){return{red:y,green:h,blue:D,alpha:$}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.numberRange(h.red,0,1)&&C.numberRange(h.green,0,1)&&C.numberRange(h.blue,0,1)&&C.numberRange(h.alpha,0,1)}p.is=P})(u||(e.Color=u={}));var d;(function(p){function N(y,h){return{range:y,color:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&u.is(h.color)}p.is=P})(d||(e.ColorInformation=d={}));var f;(function(p){function N(y,h,D){return{label:y,textEdit:h,additionalTextEdits:D}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.string(h.label)&&(C.undefined(h.textEdit)||O.is(h))&&(C.undefined(h.additionalTextEdits)||C.typedArray(h.additionalTextEdits,O.is))}p.is=P})(f||(e.ColorPresentation=f={}));var m;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(m||(e.FoldingRangeKind=m={}));var T;(function(p){function N(y,h,D,$,se,nt){var qe={startLine:y,endLine:h};return C.defined(D)&&(qe.startCharacter=D),C.defined($)&&(qe.endCharacter=$),C.defined(se)&&(qe.kind=se),C.defined(nt)&&(qe.collapsedText=nt),qe}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.uinteger(h.startLine)&&C.uinteger(h.startLine)&&(C.undefined(h.startCharacter)||C.uinteger(h.startCharacter))&&(C.undefined(h.endCharacter)||C.uinteger(h.endCharacter))&&(C.undefined(h.kind)||C.string(h.kind))}p.is=P})(T||(e.FoldingRange=T={}));var g;(function(p){function N(y,h){return{location:y,message:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&c.is(h.location)&&C.string(h.message)}p.is=P})(g||(e.DiagnosticRelatedInformation=g={}));var S;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(S||(e.DiagnosticSeverity=S={}));var k;(function(p){p.Unnecessary=1,p.Deprecated=2})(k||(e.DiagnosticTag=k={}));var v;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&C.string(y.href)}p.is=N})(v||(e.CodeDescription=v={}));var b;(function(p){function N(y,h,D,$,se,nt){var qe={range:y,message:h};return C.defined(D)&&(qe.severity=D),C.defined($)&&(qe.code=$),C.defined(se)&&(qe.source=se),C.defined(nt)&&(qe.relatedInformation=nt),qe}p.create=N;function P(y){var h,D=y;return C.defined(D)&&a.is(D.range)&&C.string(D.message)&&(C.number(D.severity)||C.undefined(D.severity))&&(C.integer(D.code)||C.string(D.code)||C.undefined(D.code))&&(C.undefined(D.codeDescription)||C.string((h=D.codeDescription)===null||h===void 0?void 0:h.href))&&(C.string(D.source)||C.undefined(D.source))&&(C.undefined(D.relatedInformation)||C.typedArray(D.relatedInformation,g.is))}p.is=P})(b||(e.Diagnostic=b={}));var R;(function(p){function N(y,h){for(var D=[],$=2;$<arguments.length;$++)D[$-2]=arguments[$];var se={title:y,command:h};return C.defined(D)&&D.length>0&&(se.arguments=D),se}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.title)&&C.string(h.command)}p.is=P})(R||(e.Command=R={}));var O;(function(p){function N(D,$){return{range:D,newText:$}}p.replace=N;function P(D,$){return{range:{start:D,end:D},newText:$}}p.insert=P;function y(D){return{range:D,newText:""}}p.del=y;function h(D){var $=D;return C.objectLiteral($)&&C.string($.newText)&&a.is($.range)}p.is=h})(O||(e.TextEdit=O={}));var L;(function(p){function N(y,h,D){var $={label:y};return h!==void 0&&($.needsConfirmation=h),D!==void 0&&($.description=D),$}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&C.string(h.label)&&(C.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(C.string(h.description)||h.description===void 0)}p.is=P})(L||(e.ChangeAnnotation=L={}));var V;(function(p){function N(P){var y=P;return C.string(y)}p.is=N})(V||(e.ChangeAnnotationIdentifier=V={}));var j;(function(p){function N(D,$,se){return{range:D,newText:$,annotationId:se}}p.replace=N;function P(D,$,se){return{range:{start:D,end:D},newText:$,annotationId:se}}p.insert=P;function y(D,$){return{range:D,newText:"",annotationId:$}}p.del=y;function h(D){var $=D;return O.is($)&&(L.is($.annotationId)||V.is($.annotationId))}p.is=h})(j||(e.AnnotatedTextEdit=j={}));var re;(function(p){function N(y,h){return{textDocument:y,edits:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&Ps.is(h.textDocument)&&Array.isArray(h.edits)}p.is=P})(re||(e.TextDocumentEdit=re={}));var Oe;(function(p){function N(y,h,D){var $={kind:"create",uri:y};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&($.options=h),D!==void 0&&($.annotationId=D),$}p.create=N;function P(y){var h=y;return h&&h.kind==="create"&&C.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(Oe||(e.CreateFile=Oe={}));var yt;(function(p){function N(y,h,D,$){var se={kind:"rename",oldUri:y,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(se.options=D),$!==void 0&&(se.annotationId=$),se}p.create=N;function P(y){var h=y;return h&&h.kind==="rename"&&C.string(h.oldUri)&&C.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(yt||(e.RenameFile=yt={}));var de;(function(p){function N(y,h,D){var $={kind:"delete",uri:y};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&($.options=h),D!==void 0&&($.annotationId=D),$}p.create=N;function P(y){var h=y;return h&&h.kind==="delete"&&C.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||C.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||C.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||V.is(h.annotationId))}p.is=P})(de||(e.DeleteFile=de={}));var yn;(function(p){function N(P){var y=P;return y&&(y.changes!==void 0||y.documentChanges!==void 0)&&(y.documentChanges===void 0||y.documentChanges.every(function(h){return C.string(h.kind)?Oe.is(h)||yt.is(h)||de.is(h):re.is(h)}))}p.is=N})(yn||(e.WorkspaceEdit=yn={}));var jr=function(){function p(N,P){this.edits=N,this.changeAnnotations=P}return p.prototype.insert=function(N,P,y){var h,D;if(y===void 0?h=O.insert(N,P):V.is(y)?(D=y,h=j.insert(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.insert(N,P,D)),this.edits.push(h),D!==void 0)return D},p.prototype.replace=function(N,P,y){var h,D;if(y===void 0?h=O.replace(N,P):V.is(y)?(D=y,h=j.replace(N,P,y)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(y),h=j.replace(N,P,D)),this.edits.push(h),D!==void 0)return D},p.prototype.delete=function(N,P){var y,h;if(P===void 0?y=O.del(N):V.is(P)?(h=P,y=j.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),h=this.changeAnnotations.manage(P),y=j.del(N,h)),this.edits.push(y),h!==void 0)return h},p.prototype.add=function(N){this.edits.push(N)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),xc=function(){function p(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(N,P){var y;if(V.is(N)?y=N:(y=this.nextId(),P=N),this._annotations[y]!==void 0)throw new Error("Id ".concat(y," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(y));return this._annotations[y]=P,this._size++,y},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),eh=function(){function p(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new xc(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(y){if(re.is(y)){var h=new jr(y.edits,P._changeAnnotations);P._textEditChanges[y.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(y){var h=new jr(N.changes[y]);P._textEditChanges[y]=h})):this._workspaceEdit={}}return Object.defineProperty(p.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}),p.prototype.getTextEditChange=function(N){if(Ps.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},y=this._textEditChanges[P.uri];if(!y){var h=[],D={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(D),y=new jr(h,this._changeAnnotations),this._textEditChanges[P.uri]=y}return y}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var y=this._textEditChanges[N];if(!y){var h=[];this._workspaceEdit.changes[N]=h,y=new jr(h),this._textEditChanges[N]=y}return y}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new xc,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||V.is(P)?h=P:y=P;var D,$;if(h===void 0?D=Oe.create(N,y):($=V.is(h)?h:this._changeAnnotations.manage(h),D=Oe.create(N,y,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p.prototype.renameFile=function(N,P,y,h){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;L.is(y)||V.is(y)?D=y:h=y;var $,se;if(D===void 0?$=yt.create(N,P,h):(se=V.is(D)?D:this._changeAnnotations.manage(D),$=yt.create(N,P,h,se)),this._workspaceEdit.documentChanges.push($),se!==void 0)return se},p.prototype.deleteFile=function(N,P,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;L.is(P)||V.is(P)?h=P:y=P;var D,$;if(h===void 0?D=de.create(N,y):($=V.is(h)?h:this._changeAnnotations.manage(h),D=de.create(N,y,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p}();e.WorkspaceChange=eh;var qc;(function(p){function N(y){return{uri:y}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)}p.is=P})(qc||(e.TextDocumentIdentifier=qc={}));var qo;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&C.integer(h.version)}p.is=P})(qo||(e.VersionedTextDocumentIdentifier=qo={}));var Ps;(function(p){function N(y,h){return{uri:y,version:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&(h.version===null||C.integer(h.version))}p.is=P})(Ps||(e.OptionalVersionedTextDocumentIdentifier=Ps={}));var kr;(function(p){function N(y,h,D,$){return{uri:y,languageId:h,version:D,text:$}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.string(h.uri)&&C.string(h.languageId)&&C.integer(h.version)&&C.string(h.text)}p.is=P})(kr||(e.TextDocumentItem=kr={}));var fi;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function N(P){var y=P;return y===p.PlainText||y===p.Markdown}p.is=N})(fi||(e.MarkupKind=fi={}));var Rs;(function(p){function N(P){var y=P;return C.objectLiteral(P)&&fi.is(y.kind)&&C.string(y.value)}p.is=N})(Rs||(e.MarkupContent=Rs={}));var jc;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(jc||(e.CompletionItemKind=jc={}));var jo;(function(p){p.PlainText=1,p.Snippet=2})(jo||(e.InsertTextFormat=jo={}));var Fo;(function(p){p.Deprecated=1})(Fo||(e.CompletionItemTag=Fo={}));var Fc;(function(p){function N(y,h,D){return{newText:y,insert:h,replace:D}}p.create=N;function P(y){var h=y;return h&&C.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}p.is=P})(Fc||(e.InsertReplaceEdit=Fc={}));var Bc;(function(p){p.asIs=1,p.adjustIndentation=2})(Bc||(e.InsertTextMode=Bc={}));var Uc;(function(p){function N(P){var y=P;return y&&(C.string(y.detail)||y.detail===void 0)&&(C.string(y.description)||y.description===void 0)}p.is=N})(Uc||(e.CompletionItemLabelDetails=Uc={}));var Vc;(function(p){function N(P){return{label:P}}p.create=N})(Vc||(e.CompletionItem=Vc={}));var Wc;(function(p){function N(P,y){return{items:P||[],isIncomplete:!!y}}p.create=N})(Wc||(e.CompletionList=Wc={}));var hi;(function(p){function N(y){return y.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=N;function P(y){var h=y;return C.string(h)||C.objectLiteral(h)&&C.string(h.language)&&C.string(h.value)}p.is=P})(hi||(e.MarkedString=hi={}));var Mn;(function(p){function N(P){var y=P;return!!y&&C.objectLiteral(y)&&(Rs.is(y.contents)||hi.is(y.contents)||C.typedArray(y.contents,hi.is))&&(P.range===void 0||a.is(P.range))}p.is=N})(Mn||(e.Hover=Mn={}));var Hc;(function(p){function N(P,y){return y?{label:P,documentation:y}:{label:P}}p.create=N})(Hc||(e.ParameterInformation=Hc={}));var Kc;(function(p){function N(P,y){for(var h=[],D=2;D<arguments.length;D++)h[D-2]=arguments[D];var $={label:P};return C.defined(y)&&($.documentation=y),C.defined(h)?$.parameters=h:$.parameters=[],$}p.create=N})(Kc||(e.SignatureInformation=Kc={}));var Ds;(function(p){p.Text=1,p.Read=2,p.Write=3})(Ds||(e.DocumentHighlightKind=Ds={}));var zc;(function(p){function N(P,y){var h={range:P};return C.number(y)&&(h.kind=y),h}p.create=N})(zc||(e.DocumentHighlight=zc={}));var pi;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(pi||(e.SymbolKind=pi={}));var Gc;(function(p){p.Deprecated=1})(Gc||(e.SymbolTag=Gc={}));var Er;(function(p){function N(P,y,h,D,$){var se={name:P,kind:y,location:{uri:D,range:h}};return $&&(se.containerName=$),se}p.create=N})(Er||(e.SymbolInformation=Er={}));var Fr;(function(p){function N(P,y,h,D){return D!==void 0?{name:P,kind:y,location:{uri:h,range:D}}:{name:P,kind:y,location:{uri:h}}}p.create=N})(Fr||(e.WorkspaceSymbol=Fr={}));var Yc;(function(p){function N(y,h,D,$,se,nt){var qe={name:y,detail:h,kind:D,range:$,selectionRange:se};return nt!==void 0&&(qe.children=nt),qe}p.create=N;function P(y){var h=y;return h&&C.string(h.name)&&C.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||C.string(h.detail))&&(h.deprecated===void 0||C.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}p.is=P})(Yc||(e.DocumentSymbol=Yc={}));var Jc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Jc||(e.CodeActionKind=Jc={}));var er;(function(p){p.Invoked=1,p.Automatic=2})(er||(e.CodeActionTriggerKind=er={}));var Bo;(function(p){function N(y,h,D){var $={diagnostics:y};return h!=null&&($.only=h),D!=null&&($.triggerKind=D),$}p.create=N;function P(y){var h=y;return C.defined(h)&&C.typedArray(h.diagnostics,b.is)&&(h.only===void 0||C.typedArray(h.only,C.string))&&(h.triggerKind===void 0||h.triggerKind===er.Invoked||h.triggerKind===er.Automatic)}p.is=P})(Bo||(e.CodeActionContext=Bo={}));var Uo;(function(p){function N(y,h,D){var $={title:y},se=!0;return typeof h=="string"?(se=!1,$.kind=h):R.is(h)?$.command=h:$.edit=h,se&&D!==void 0&&($.kind=D),$}p.create=N;function P(y){var h=y;return h&&C.string(h.title)&&(h.diagnostics===void 0||C.typedArray(h.diagnostics,b.is))&&(h.kind===void 0||C.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||C.boolean(h.isPreferred))&&(h.edit===void 0||yn.is(h.edit))}p.is=P})(Uo||(e.CodeAction=Uo={}));var mi;(function(p){function N(y,h){var D={range:y};return C.defined(h)&&(D.data=h),D}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.command)||R.is(h.command))}p.is=P})(mi||(e.CodeLens=mi={}));var Vo;(function(p){function N(y,h){return{tabSize:y,insertSpaces:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&C.uinteger(h.tabSize)&&C.boolean(h.insertSpaces)}p.is=P})(Vo||(e.FormattingOptions=Vo={}));var Nr;(function(p){function N(y,h,D){return{range:y,target:h,data:D}}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.target)||C.string(h.target))}p.is=P})(Nr||(e.DocumentLink=Nr={}));var E;(function(p){function N(y,h){return{range:y,parent:h}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||p.is(h.parent))}p.is=P})(E||(e.SelectionRange=E={}));var M;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})(M||(e.SemanticTokenTypes=M={}));var F;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(F||(e.SemanticTokenModifiers=F={}));var W;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&(y.resultId===void 0||typeof y.resultId=="string")&&Array.isArray(y.data)&&(y.data.length===0||typeof y.data[0]=="number")}p.is=N})(W||(e.SemanticTokens=W={}));var Ae;(function(p){function N(y,h){return{range:y,text:h}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&C.string(h.text)}p.is=P})(Ae||(e.InlineValueText=Ae={}));var Re;(function(p){function N(y,h,D){return{range:y,variableName:h,caseSensitiveLookup:D}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&C.boolean(h.caseSensitiveLookup)&&(C.string(h.variableName)||h.variableName===void 0)}p.is=P})(Re||(e.InlineValueVariableLookup=Re={}));var Ve;(function(p){function N(y,h){return{range:y,expression:h}}p.create=N;function P(y){var h=y;return h!=null&&a.is(h.range)&&(C.string(h.expression)||h.expression===void 0)}p.is=P})(Ve||(e.InlineValueEvaluatableExpression=Ve={}));var Ye;(function(p){function N(y,h){return{frameId:y,stoppedLocation:h}}p.create=N;function P(y){var h=y;return C.defined(h)&&a.is(y.stoppedLocation)}p.is=P})(Ye||(e.InlineValueContext=Ye={}));var fe;(function(p){p.Type=1,p.Parameter=2;function N(P){return P===1||P===2}p.is=N})(fe||(e.InlayHintKind=fe={}));var $e;(function(p){function N(y){return{value:y}}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&(h.tooltip===void 0||C.string(h.tooltip)||Rs.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}p.is=P})($e||(e.InlayHintLabelPart=$e={}));var _e;(function(p){function N(y,h,D){var $={position:y,label:h};return D!==void 0&&($.kind=D),$}p.create=N;function P(y){var h=y;return C.objectLiteral(h)&&o.is(h.position)&&(C.string(h.label)||C.typedArray(h.label,$e.is))&&(h.kind===void 0||fe.is(h.kind))&&h.textEdits===void 0||C.typedArray(h.textEdits,O.is)&&(h.tooltip===void 0||C.string(h.tooltip)||Rs.is(h.tooltip))&&(h.paddingLeft===void 0||C.boolean(h.paddingLeft))&&(h.paddingRight===void 0||C.boolean(h.paddingRight))}p.is=P})(_e||(e.InlayHint=_e={}));var tt;(function(p){function N(P){return{kind:"snippet",value:P}}p.createSnippet=N})(tt||(e.StringValue=tt={}));var _t;(function(p){function N(P,y,h,D){return{insertText:P,filterText:y,range:h,command:D}}p.create=N})(_t||(e.InlineCompletionItem=_t={}));var un;(function(p){function N(P){return{items:P}}p.create=N})(un||(e.InlineCompletionList=un={}));var Xc;(function(p){p.Invoked=0,p.Automatic=1})(Xc||(e.InlineCompletionTriggerKind=Xc={}));var _v;(function(p){function N(P,y){return{range:P,text:y}}p.create=N})(_v||(e.SelectedCompletionInfo=_v={}));var Sv;(function(p){function N(P,y){return{triggerKind:P,selectedCompletionInfo:y}}p.create=N})(Sv||(e.InlineCompletionContext=Sv={}));var wv;(function(p){function N(P){var y=P;return C.objectLiteral(y)&&r.is(y.uri)&&C.string(y.name)}p.is=N})(wv||(e.WorkspaceFolder=wv={})),e.EOL=[`
33
33
  `,`\r
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
- `,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,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(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.objectLiteral=Ke.typedArray=Ke.stringArray=Ke.array=Ke.func=Ke.error=Ke.number=Ke.string=Ke.boolean=void 0;function TN(n){return n===!0||n===!1}Ke.boolean=TN;function fm(n){return typeof n=="string"||n instanceof String}Ke.string=fm;function vN(n){return typeof n=="number"||n instanceof Number}Ke.number=vN;function SN(n){return n instanceof Error}Ke.error=SN;function kN(n){return typeof n=="function"}Ke.func=kN;function dm(n){return Array.isArray(n)}Ke.array=dm;function EN(n){return dm(n)&&n.every(e=>fm(e))}Ke.stringArray=EN;function wN(n,e){return Array.isArray(n)&&n.every(e)}Ke.typedArray=wN;function NN(n){return n!==null&&typeof n=="object"}Ke.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(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var F=xe(),Vg=pa(),it=ma(),DN=mm();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return DN.ImplementationRequest}});var RN=bm();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return RN.TypeDefinitionRequest}});var Jy=Sm();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Jy.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Jy.DidChangeWorkspaceFoldersNotification}});var CN=wm();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return CN.ConfigurationRequest}});var Zy=Pm();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return Zy.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return Zy.ColorPresentationRequest}});var eb=Cm();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return eb.FoldingRangeRefreshRequest}});var ON=Im();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return ON.DeclarationRequest}});var AN=Mm();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return AN.SelectionRangeRequest}});var Cf=jm();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return Cf.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Cf.WorkDoneProgressCancelNotification}});var Of=Vm();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Of.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Of.CallHierarchyPrepareRequest}});var wr=Xm();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return wr.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return wr.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return wr.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return wr.SemanticTokensRegistrationType}});var IN=Zm();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return IN.ShowDocumentRequest}});var LN=ng();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return LN.LinkedEditingRangeRequest}});var qi=ug();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return qi.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return qi.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return qi.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return qi.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return qi.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return qi.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return qi.WillDeleteFilesRequest}});var Af=mg();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Af.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Af.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Af.MonikerRequest}});var If=Tg();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return If.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return If.TypeHierarchySupertypesRequest}});var tb=kg();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return tb.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return tb.InlineValueRefreshRequest}});var Lf=_g();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return Lf.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Lf.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Lf.InlayHintRefreshRequest}});var Ss=Ig();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ss.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ss.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ss.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ss.DiagnosticRefreshRequest}});var yn=jg();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return yn.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return yn.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return yn.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return yn.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return yn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return yn.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return yn.DidCloseNotebookDocumentNotification}});var xN=Wg();Object.defineProperty(b,"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||(b.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||(b.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||(b.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||(b.DocumentSelector=Rf={}));var Hg;(function(n){n.method="client/registerCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Hg||(b.RegistrationRequest=Hg={}));var Yg;(function(n){n.method="client/unregisterCapability",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(Yg||(b.UnregistrationRequest=Yg={}));var Kg;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(Kg||(b.ResourceOperationKind=Kg={}));var zg;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(zg||(b.FailureHandlingKind=zg={}));var Gg;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(Gg||(b.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||(b.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||(b.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||(b.WorkDoneProgressOptions=Jg={}));var Zg;(function(n){n.method="initialize",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Zg||(b.InitializeRequest=Zg={}));var ey;(function(n){n.unknownProtocolVersion=1})(ey||(b.InitializeErrorCodes=ey={}));var ty;(function(n){n.method="initialized",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ty||(b.InitializedNotification=ty={}));var ny;(function(n){n.method="shutdown",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType0(n.method)})(ny||(b.ShutdownRequest=ny={}));var iy;(function(n){n.method="exit",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType0(n.method)})(iy||(b.ExitNotification=iy={}));var ry;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(ry||(b.DidChangeConfigurationNotification=ry={}));var sy;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(sy||(b.MessageType=sy={}));var oy;(function(n){n.method="window/showMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(oy||(b.ShowMessageNotification=oy={}));var ay;(function(n){n.method="window/showMessageRequest",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType(n.method)})(ay||(b.ShowMessageRequest=ay={}));var cy;(function(n){n.method="window/logMessage",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(cy||(b.LogMessageNotification=cy={}));var ly;(function(n){n.method="telemetry/event",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(ly||(b.TelemetryEventNotification=ly={}));var uy;(function(n){n.None=0,n.Full=1,n.Incremental=2})(uy||(b.TextDocumentSyncKind=uy={}));var fy;(function(n){n.method="textDocument/didOpen",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(fy||(b.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||(b.TextDocumentContentChangeEvent=dy={}));var hy;(function(n){n.method="textDocument/didChange",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(hy||(b.DidChangeTextDocumentNotification=hy={}));var py;(function(n){n.method="textDocument/didClose",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(py||(b.DidCloseTextDocumentNotification=py={}));var my;(function(n){n.method="textDocument/didSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(my||(b.DidSaveTextDocumentNotification=my={}));var gy;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(gy||(b.TextDocumentSaveReason=gy={}));var yy;(function(n){n.method="textDocument/willSave",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(yy||(b.WillSaveTextDocumentNotification=yy={}));var by;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(by||(b.WillSaveTextDocumentWaitUntilRequest=by={}));var Ty;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolNotificationType(n.method)})(Ty||(b.DidChangeWatchedFilesNotification=Ty={}));var vy;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(vy||(b.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||(b.RelativePattern=Sy={}));var ky;(function(n){n.Create=1,n.Change=2,n.Delete=4})(ky||(b.WatchKind=ky={}));var Ey;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolNotificationType(n.method)})(Ey||(b.PublishDiagnosticsNotification=Ey={}));var wy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(wy||(b.CompletionTriggerKind=wy={}));var Ny;(function(n){n.method="textDocument/completion",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ny||(b.CompletionRequest=Ny={}));var _y;(function(n){n.method="completionItem/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(_y||(b.CompletionResolveRequest=_y={}));var Py;(function(n){n.method="textDocument/hover",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Py||(b.HoverRequest=Py={}));var Dy;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(Dy||(b.SignatureHelpTriggerKind=Dy={}));var Ry;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ry||(b.SignatureHelpRequest=Ry={}));var Cy;(function(n){n.method="textDocument/definition",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Cy||(b.DefinitionRequest=Cy={}));var Oy;(function(n){n.method="textDocument/references",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Oy||(b.ReferencesRequest=Oy={}));var Ay;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ay||(b.DocumentHighlightRequest=Ay={}));var Iy;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Iy||(b.DocumentSymbolRequest=Iy={}));var Ly;(function(n){n.method="textDocument/codeAction",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Ly||(b.CodeActionRequest=Ly={}));var xy;(function(n){n.method="codeAction/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(xy||(b.CodeActionResolveRequest=xy={}));var My;(function(n){n.method="workspace/symbol",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(My||(b.WorkspaceSymbolRequest=My={}));var qy;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(qy||(b.WorkspaceSymbolResolveRequest=qy={}));var Fy;(function(n){n.method="textDocument/codeLens",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Fy||(b.CodeLensRequest=Fy={}));var By;(function(n){n.method="codeLens/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(By||(b.CodeLensResolveRequest=By={}));var jy;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType0(n.method)})(jy||(b.CodeLensRefreshRequest=jy={}));var Uy;(function(n){n.method="textDocument/documentLink",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Uy||(b.DocumentLinkRequest=Uy={}));var $y;(function(n){n.method="documentLink/resolve",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})($y||(b.DocumentLinkResolveRequest=$y={}));var Wy;(function(n){n.method="textDocument/formatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Wy||(b.DocumentFormattingRequest=Wy={}));var Vy;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Vy||(b.DocumentRangeFormattingRequest=Vy={}));var Hy;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Hy||(b.DocumentRangesFormattingRequest=Hy={}));var Yy;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Yy||(b.DocumentOnTypeFormattingRequest=Yy={}));var Ky;(function(n){n.Identifier=1})(Ky||(b.PrepareSupportDefaultBehavior=Ky={}));var zy;(function(n){n.method="textDocument/rename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(zy||(b.RenameRequest=zy={}));var Gy;(function(n){n.method="textDocument/prepareRename",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Gy||(b.PrepareRenameRequest=Gy={}));var Xy;(function(n){n.method="workspace/executeCommand",n.messageDirection=F.MessageDirection.clientToServer,n.type=new F.ProtocolRequestType(n.method)})(Xy||(b.ExecuteCommandRequest=Xy={}));var Qy;(function(n){n.method="workspace/applyEdit",n.messageDirection=F.MessageDirection.serverToClient,n.type=new F.ProtocolRequestType("workspace/applyEdit")})(Qy||(b.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 y=[];for(let R of u)y.push(this.getNotebookCell(R));let w=[];for(let R of p)w.push(this.getNotebookCell(R));(_.length>0||y.length>0||d.length>0||w.length>0)&&(g.cells={added:_,removed:y,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 _,y,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=>(y=v,{dispose:()=>{y=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(y){let T=y(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 Je=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=Je(),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(`
34
+ `,"\r"];var kv;(function(p){function N(D,$,se,nt){return new CO(D,$,se,nt)}p.create=N;function P(D){var $=D;return!!(C.defined($)&&C.string($.uri)&&(C.undefined($.languageId)||C.string($.languageId))&&C.uinteger($.lineCount)&&C.func($.getText)&&C.func($.positionAt)&&C.func($.offsetAt))}p.is=P;function y(D,$){for(var se=D.getText(),nt=h($,function(gi,Qc){var Ev=gi.range.start.line-Qc.range.start.line;return Ev===0?gi.range.start.character-Qc.range.start.character:Ev}),qe=se.length,$n=nt.length-1;$n>=0;$n--){var Ln=nt[$n],Pr=D.offsetAt(Ln.range.start),pe=D.offsetAt(Ln.range.end);if(pe<=qe)se=se.substring(0,Pr)+Ln.newText+se.substring(pe,se.length);else throw new Error("Overlapping edit");qe=Pr}return se}p.applyEdits=y;function h(D,$){if(D.length<=1)return D;var se=D.length/2|0,nt=D.slice(0,se),qe=D.slice(se);h(nt,$),h(qe,$);for(var $n=0,Ln=0,Pr=0;$n<nt.length&&Ln<qe.length;){var pe=$(nt[$n],qe[Ln]);pe<=0?D[Pr++]=nt[$n++]:D[Pr++]=qe[Ln++]}for(;$n<nt.length;)D[Pr++]=nt[$n++];for(;Ln<qe.length;)D[Pr++]=qe[Ln++];return D}})(kv||(e.TextDocument=kv={}));var CO=function(){function p(N,P,y,h){this._uri=N,this._languageId=P,this._version=y,this._content=h,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(N){if(N){var P=this.offsetAt(N.start),y=this.offsetAt(N.end);return this._content.substring(P,y)}return this._content},p.prototype.update=function(N,P){this._content=N.text,this._version=P,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],P=this._content,y=!0,h=0;h<P.length;h++){y&&(N.push(h),y=!1);var D=P.charAt(h);y=D==="\r"||D===`
35
+ `,D==="\r"&&h+1<P.length&&P.charAt(h+1)===`
36
+ `&&h++}y&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},p.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),y=0,h=P.length;if(h===0)return o.create(0,N);for(;y<h;){var D=Math.floor((y+h)/2);P[D]>N?h=D:y=D+1}var $=y-1;return o.create($,N-P[$])},p.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var y=P[N.line],h=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(y+N.character,h),y)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),C;(function(p){var N=Object.prototype.toString;function P(pe){return typeof pe<"u"}p.defined=P;function y(pe){return typeof pe>"u"}p.undefined=y;function h(pe){return pe===!0||pe===!1}p.boolean=h;function D(pe){return N.call(pe)==="[object String]"}p.string=D;function $(pe){return N.call(pe)==="[object Number]"}p.number=$;function se(pe,gi,Qc){return N.call(pe)==="[object Number]"&&gi<=pe&&pe<=Qc}p.numberRange=se;function nt(pe){return N.call(pe)==="[object Number]"&&-2147483648<=pe&&pe<=2147483647}p.integer=nt;function qe(pe){return N.call(pe)==="[object Number]"&&0<=pe&&pe<=2147483647}p.uinteger=qe;function $n(pe){return N.call(pe)==="[object Function]"}p.func=$n;function Ln(pe){return pe!==null&&typeof pe=="object"}p.objectLiteral=Ln;function Pr(pe,gi){return Array.isArray(pe)&&pe.every(gi)}p.typedArray=Pr})(C||(C={}))})});var Je=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ProtocolNotificationType=Qt.ProtocolNotificationType0=Qt.ProtocolRequestType=Qt.ProtocolRequestType0=Qt.RegistrationType=Qt.MessageDirection=void 0;var Ei=Is(),oT;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(oT||(Qt.MessageDirection=oT={}));var hp=class{constructor(e){this.method=e}};Qt.RegistrationType=hp;var pp=class extends Ei.RequestType0{constructor(e){super(e)}};Qt.ProtocolRequestType0=pp;var mp=class extends Ei.RequestType{constructor(e){super(e,Ei.ParameterStructures.byName)}};Qt.ProtocolRequestType=mp;var gp=class extends Ei.NotificationType0{constructor(e){super(e)}};Qt.ProtocolNotificationType0=gp;var yp=class extends Ei.NotificationType{constructor(e){super(e,Ei.ParameterStructures.byName)}};Qt.ProtocolNotificationType=yp});var wl=w(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.objectLiteral=ct.typedArray=ct.stringArray=ct.array=ct.func=ct.error=ct.number=ct.string=ct.boolean=void 0;function kA(n){return n===!0||n===!1}ct.boolean=kA;function aT(n){return typeof n=="string"||n instanceof String}ct.string=aT;function EA(n){return typeof n=="number"||n instanceof Number}ct.number=EA;function NA(n){return n instanceof Error}ct.error=NA;function PA(n){return typeof n=="function"}ct.func=PA;function cT(n){return Array.isArray(n)}ct.array=cT;function RA(n){return cT(n)&&n.every(e=>aT(e))}ct.stringArray=RA;function DA(n,e){return Array.isArray(n)&&n.every(e)}ct.typedArray=DA;function CA(n){return n!==null&&typeof n=="object"}ct.objectLiteral=CA});var dT=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.ImplementationRequest=void 0;var lT=Je(),uT;(function(n){n.method="textDocument/implementation",n.messageDirection=lT.MessageDirection.clientToServer,n.type=new lT.ProtocolRequestType(n.method)})(uT||(kl.ImplementationRequest=uT={}))});var pT=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.TypeDefinitionRequest=void 0;var fT=Je(),hT;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=fT.MessageDirection.clientToServer,n.type=new fT.ProtocolRequestType(n.method)})(hT||(El.TypeDefinitionRequest=hT={}))});var yT=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.DidChangeWorkspaceFoldersNotification=Ni.WorkspaceFoldersRequest=void 0;var Nl=Je(),mT;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Nl.MessageDirection.serverToClient,n.type=new Nl.ProtocolRequestType0(n.method)})(mT||(Ni.WorkspaceFoldersRequest=mT={}));var gT;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=Nl.MessageDirection.clientToServer,n.type=new Nl.ProtocolNotificationType(n.method)})(gT||(Ni.DidChangeWorkspaceFoldersNotification=gT={}))});var TT=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.ConfigurationRequest=void 0;var bT=Je(),vT;(function(n){n.method="workspace/configuration",n.messageDirection=bT.MessageDirection.serverToClient,n.type=new bT.ProtocolRequestType(n.method)})(vT||(Pl.ConfigurationRequest=vT={}))});var wT=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ColorPresentationRequest=Pi.DocumentColorRequest=void 0;var Rl=Je(),_T;(function(n){n.method="textDocument/documentColor",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(_T||(Pi.DocumentColorRequest=_T={}));var ST;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=Rl.MessageDirection.clientToServer,n.type=new Rl.ProtocolRequestType(n.method)})(ST||(Pi.ColorPresentationRequest=ST={}))});var NT=w(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.FoldingRangeRefreshRequest=Ri.FoldingRangeRequest=void 0;var Dl=Je(),kT;(function(n){n.method="textDocument/foldingRange",n.messageDirection=Dl.MessageDirection.clientToServer,n.type=new Dl.ProtocolRequestType(n.method)})(kT||(Ri.FoldingRangeRequest=kT={}));var ET;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=Dl.MessageDirection.serverToClient,n.type=new Dl.ProtocolRequestType0(n.method)})(ET||(Ri.FoldingRangeRefreshRequest=ET={}))});var DT=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.DeclarationRequest=void 0;var PT=Je(),RT;(function(n){n.method="textDocument/declaration",n.messageDirection=PT.MessageDirection.clientToServer,n.type=new PT.ProtocolRequestType(n.method)})(RT||(Cl.DeclarationRequest=RT={}))});var AT=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.SelectionRangeRequest=void 0;var CT=Je(),OT;(function(n){n.method="textDocument/selectionRange",n.messageDirection=CT.MessageDirection.clientToServer,n.type=new CT.ProtocolRequestType(n.method)})(OT||(Ol.SelectionRangeRequest=OT={}))});var LT=w(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.WorkDoneProgressCancelNotification=Hr.WorkDoneProgressCreateRequest=Hr.WorkDoneProgress=void 0;var OA=Is(),Al=Je(),IT;(function(n){n.type=new OA.ProgressType;function e(t){return t===n.type}n.is=e})(IT||(Hr.WorkDoneProgress=IT={}));var MT;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=Al.MessageDirection.serverToClient,n.type=new Al.ProtocolRequestType(n.method)})(MT||(Hr.WorkDoneProgressCreateRequest=MT={}));var $T;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=Al.MessageDirection.clientToServer,n.type=new Al.ProtocolNotificationType(n.method)})($T||(Hr.WorkDoneProgressCancelNotification=$T={}))});var FT=w(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CallHierarchyOutgoingCallsRequest=Kr.CallHierarchyIncomingCallsRequest=Kr.CallHierarchyPrepareRequest=void 0;var Di=Je(),xT;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(xT||(Kr.CallHierarchyPrepareRequest=xT={}));var qT;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(qT||(Kr.CallHierarchyIncomingCallsRequest=qT={}));var jT;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=Di.MessageDirection.clientToServer,n.type=new Di.ProtocolRequestType(n.method)})(jT||(Kr.CallHierarchyOutgoingCallsRequest=jT={}))});var KT=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.SemanticTokensRefreshRequest=Zt.SemanticTokensRangeRequest=Zt.SemanticTokensDeltaRequest=Zt.SemanticTokensRequest=Zt.SemanticTokensRegistrationType=Zt.TokenFormat=void 0;var Dr=Je(),BT;(function(n){n.Relative="relative"})(BT||(Zt.TokenFormat=BT={}));var Jo;(function(n){n.method="textDocument/semanticTokens",n.type=new Dr.RegistrationType(n.method)})(Jo||(Zt.SemanticTokensRegistrationType=Jo={}));var UT;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(UT||(Zt.SemanticTokensRequest=UT={}));var VT;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(VT||(Zt.SemanticTokensDeltaRequest=VT={}));var WT;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Dr.MessageDirection.clientToServer,n.type=new Dr.ProtocolRequestType(n.method),n.registrationMethod=Jo.method})(WT||(Zt.SemanticTokensRangeRequest=WT={}));var HT;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Dr.MessageDirection.serverToClient,n.type=new Dr.ProtocolRequestType0(n.method)})(HT||(Zt.SemanticTokensRefreshRequest=HT={}))});var YT=w(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.ShowDocumentRequest=void 0;var zT=Je(),GT;(function(n){n.method="window/showDocument",n.messageDirection=zT.MessageDirection.serverToClient,n.type=new zT.ProtocolRequestType(n.method)})(GT||(Il.ShowDocumentRequest=GT={}))});var QT=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.LinkedEditingRangeRequest=void 0;var JT=Je(),XT;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=JT.MessageDirection.clientToServer,n.type=new JT.ProtocolRequestType(n.method)})(XT||(Ml.LinkedEditingRangeRequest=XT={}))});var o_=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.WillDeleteFilesRequest=qt.DidDeleteFilesNotification=qt.DidRenameFilesNotification=qt.WillRenameFilesRequest=qt.DidCreateFilesNotification=qt.WillCreateFilesRequest=qt.FileOperationPatternKind=void 0;var bn=Je(),ZT;(function(n){n.file="file",n.folder="folder"})(ZT||(qt.FileOperationPatternKind=ZT={}));var e_;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(e_||(qt.WillCreateFilesRequest=e_={}));var t_;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(t_||(qt.DidCreateFilesNotification=t_={}));var n_;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(n_||(qt.WillRenameFilesRequest=n_={}));var r_;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(r_||(qt.DidRenameFilesNotification=r_={}));var s_;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolNotificationType(n.method)})(s_||(qt.DidDeleteFilesNotification=s_={}));var i_;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=bn.MessageDirection.clientToServer,n.type=new bn.ProtocolRequestType(n.method)})(i_||(qt.WillDeleteFilesRequest=i_={}))});var d_=w(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.MonikerRequest=zr.MonikerKind=zr.UniquenessLevel=void 0;var a_=Je(),c_;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(c_||(zr.UniquenessLevel=c_={}));var l_;(function(n){n.$import="import",n.$export="export",n.local="local"})(l_||(zr.MonikerKind=l_={}));var u_;(function(n){n.method="textDocument/moniker",n.messageDirection=a_.MessageDirection.clientToServer,n.type=new a_.ProtocolRequestType(n.method)})(u_||(zr.MonikerRequest=u_={}))});var m_=w(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.TypeHierarchySubtypesRequest=Gr.TypeHierarchySupertypesRequest=Gr.TypeHierarchyPrepareRequest=void 0;var Ci=Je(),f_;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(f_||(Gr.TypeHierarchyPrepareRequest=f_={}));var h_;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(h_||(Gr.TypeHierarchySupertypesRequest=h_={}));var p_;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=Ci.MessageDirection.clientToServer,n.type=new Ci.ProtocolRequestType(n.method)})(p_||(Gr.TypeHierarchySubtypesRequest=p_={}))});var b_=w(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.InlineValueRefreshRequest=Oi.InlineValueRequest=void 0;var $l=Je(),g_;(function(n){n.method="textDocument/inlineValue",n.messageDirection=$l.MessageDirection.clientToServer,n.type=new $l.ProtocolRequestType(n.method)})(g_||(Oi.InlineValueRequest=g_={}));var y_;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=$l.MessageDirection.serverToClient,n.type=new $l.ProtocolRequestType0(n.method)})(y_||(Oi.InlineValueRefreshRequest=y_={}))});var S_=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.InlayHintRefreshRequest=Yr.InlayHintResolveRequest=Yr.InlayHintRequest=void 0;var Ai=Je(),v_;(function(n){n.method="textDocument/inlayHint",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(v_||(Yr.InlayHintRequest=v_={}));var T_;(function(n){n.method="inlayHint/resolve",n.messageDirection=Ai.MessageDirection.clientToServer,n.type=new Ai.ProtocolRequestType(n.method)})(T_||(Yr.InlayHintResolveRequest=T_={}));var __;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=Ai.MessageDirection.serverToClient,n.type=new Ai.ProtocolRequestType0(n.method)})(__||(Yr.InlayHintRefreshRequest=__={}))});var D_=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DiagnosticRefreshRequest=vn.WorkspaceDiagnosticRequest=vn.DocumentDiagnosticRequest=vn.DocumentDiagnosticReportKind=vn.DiagnosticServerCancellationData=void 0;var R_=Is(),AA=wl(),Ii=Je(),w_;(function(n){function e(t){let r=t;return r&&AA.boolean(r.retriggerRequest)}n.is=e})(w_||(vn.DiagnosticServerCancellationData=w_={}));var k_;(function(n){n.Full="full",n.Unchanged="unchanged"})(k_||(vn.DocumentDiagnosticReportKind=k_={}));var E_;(function(n){n.method="textDocument/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new R_.ProgressType})(E_||(vn.DocumentDiagnosticRequest=E_={}));var N_;(function(n){n.method="workspace/diagnostic",n.messageDirection=Ii.MessageDirection.clientToServer,n.type=new Ii.ProtocolRequestType(n.method),n.partialResult=new R_.ProgressType})(N_||(vn.WorkspaceDiagnosticRequest=N_={}));var P_;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=Ii.MessageDirection.serverToClient,n.type=new Ii.ProtocolRequestType0(n.method)})(P_||(vn.DiagnosticRefreshRequest=P_={}))});var L_=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DidCloseNotebookDocumentNotification=rt.DidSaveNotebookDocumentNotification=rt.DidChangeNotebookDocumentNotification=rt.NotebookCellArrayChange=rt.DidOpenNotebookDocumentNotification=rt.NotebookDocumentSyncRegistrationType=rt.NotebookDocument=rt.NotebookCell=rt.ExecutionSummary=rt.NotebookCellKind=void 0;var Xo=Sl(),qn=wl(),tr=Je(),bp;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(bp||(rt.NotebookCellKind=bp={}));var vp;(function(n){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}n.create=e;function t(s){let i=s;return qn.objectLiteral(i)&&Xo.uinteger.is(i.executionOrder)&&(i.success===void 0||qn.boolean(i.success))}n.is=t;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}n.equals=r})(vp||(rt.ExecutionSummary=vp={}));var Ll;(function(n){function e(i,o){return{kind:i,document:o}}n.create=e;function t(i){let o=i;return qn.objectLiteral(o)&&bp.is(o.kind)&&Xo.DocumentUri.is(o.document)&&(o.metadata===void 0||qn.objectLiteral(o.metadata))}n.is=t;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!vp.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(qn.objectLiteral(i)&&qn.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(Ll||(rt.NotebookCell=Ll={}));var C_;(function(n){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}n.create=e;function t(r){let s=r;return qn.objectLiteral(s)&&qn.string(s.uri)&&Xo.integer.is(s.version)&&qn.typedArray(s.cells,Ll.is)}n.is=t})(C_||(rt.NotebookDocument=C_={}));var Mi;(function(n){n.method="notebookDocument/sync",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.RegistrationType(n.method)})(Mi||(rt.NotebookDocumentSyncRegistrationType=Mi={}));var O_;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(O_||(rt.DidOpenNotebookDocumentNotification=O_={}));var A_;(function(n){function e(r){let s=r;return qn.objectLiteral(s)&&Xo.uinteger.is(s.start)&&Xo.uinteger.is(s.deleteCount)&&(s.cells===void 0||qn.typedArray(s.cells,Ll.is))}n.is=e;function t(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}n.create=t})(A_||(rt.NotebookCellArrayChange=A_={}));var I_;(function(n){n.method="notebookDocument/didChange",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(I_||(rt.DidChangeNotebookDocumentNotification=I_={}));var M_;(function(n){n.method="notebookDocument/didSave",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})(M_||(rt.DidSaveNotebookDocumentNotification=M_={}));var $_;(function(n){n.method="notebookDocument/didClose",n.messageDirection=tr.MessageDirection.clientToServer,n.type=new tr.ProtocolNotificationType(n.method),n.registrationMethod=Mi.method})($_||(rt.DidCloseNotebookDocumentNotification=$_={}))});var j_=w(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.InlineCompletionRequest=void 0;var x_=Je(),q_;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=x_.MessageDirection.clientToServer,n.type=new x_.ProtocolRequestType(n.method)})(q_||(xl.InlineCompletionRequest=q_={}))});var QS=w(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRefreshRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangesFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.InlineCompletionRequest=_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=void 0;var q=Je(),F_=Sl(),St=wl(),IA=dT();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return IA.ImplementationRequest}});var MA=pT();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return MA.TypeDefinitionRequest}});var GS=yT();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return GS.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return GS.DidChangeWorkspaceFoldersNotification}});var $A=TT();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return $A.ConfigurationRequest}});var YS=wT();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return YS.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return YS.ColorPresentationRequest}});var JS=NT();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return JS.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return JS.FoldingRangeRefreshRequest}});var LA=DT();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return LA.DeclarationRequest}});var xA=AT();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return xA.SelectionRangeRequest}});var kp=LT();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return kp.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return kp.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return kp.WorkDoneProgressCancelNotification}});var Ep=FT();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ep.CallHierarchyPrepareRequest}});var $i=KT();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return $i.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return $i.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return $i.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return $i.SemanticTokensRegistrationType}});var qA=YT();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return qA.ShowDocumentRequest}});var jA=QT();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return jA.LinkedEditingRangeRequest}});var Ms=o_();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ms.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ms.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ms.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ms.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ms.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ms.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ms.WillDeleteFilesRequest}});var Np=d_();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return Np.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return Np.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return Np.MonikerRequest}});var Pp=m_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Pp.TypeHierarchySupertypesRequest}});var XS=b_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return XS.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return XS.InlineValueRefreshRequest}});var Rp=S_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return Rp.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Rp.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Rp.InlayHintRefreshRequest}});var Qo=D_();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Qo.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Qo.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Qo.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Qo.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Qo.DiagnosticRefreshRequest}});var nr=L_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return nr.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return nr.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return nr.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return nr.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return nr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return nr.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return nr.DidCloseNotebookDocumentNotification}});var FA=j_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return FA.InlineCompletionRequest}});var Tp;(function(n){function e(t){let r=t;return St.string(r)||St.string(r.language)||St.string(r.scheme)||St.string(r.pattern)}n.is=e})(Tp||(_.TextDocumentFilter=Tp={}));var _p;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(St.string(r.notebookType)||St.string(r.scheme)||St.string(r.pattern))}n.is=e})(_p||(_.NotebookDocumentFilter=_p={}));var Sp;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(St.string(r.notebook)||_p.is(r.notebook))&&(r.language===void 0||St.string(r.language))}n.is=e})(Sp||(_.NotebookCellTextDocumentFilter=Sp={}));var wp;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let r of t)if(!St.string(r)&&!Tp.is(r)&&!Sp.is(r))return!1;return!0}n.is=e})(wp||(_.DocumentSelector=wp={}));var B_;(function(n){n.method="client/registerCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(B_||(_.RegistrationRequest=B_={}));var U_;(function(n){n.method="client/unregisterCapability",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(U_||(_.UnregistrationRequest=U_={}));var V_;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(V_||(_.ResourceOperationKind=V_={}));var W_;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(W_||(_.FailureHandlingKind=W_={}));var H_;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(H_||(_.PositionEncodingKind=H_={}));var K_;(function(n){function e(t){let r=t;return r&&St.string(r.id)&&r.id.length>0}n.hasId=e})(K_||(_.StaticRegistrationOptions=K_={}));var z_;(function(n){function e(t){let r=t;return r&&(r.documentSelector===null||wp.is(r.documentSelector))}n.is=e})(z_||(_.TextDocumentRegistrationOptions=z_={}));var G_;(function(n){function e(r){let s=r;return St.objectLiteral(s)&&(s.workDoneProgress===void 0||St.boolean(s.workDoneProgress))}n.is=e;function t(r){let s=r;return s&&St.boolean(s.workDoneProgress)}n.hasWorkDoneProgress=t})(G_||(_.WorkDoneProgressOptions=G_={}));var Y_;(function(n){n.method="initialize",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(Y_||(_.InitializeRequest=Y_={}));var J_;(function(n){n.unknownProtocolVersion=1})(J_||(_.InitializeErrorCodes=J_={}));var X_;(function(n){n.method="initialized",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(X_||(_.InitializedNotification=X_={}));var Q_;(function(n){n.method="shutdown",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType0(n.method)})(Q_||(_.ShutdownRequest=Q_={}));var Z_;(function(n){n.method="exit",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType0(n.method)})(Z_||(_.ExitNotification=Z_={}));var eS;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(eS||(_.DidChangeConfigurationNotification=eS={}));var tS;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(tS||(_.MessageType=tS={}));var nS;(function(n){n.method="window/showMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(nS||(_.ShowMessageNotification=nS={}));var rS;(function(n){n.method="window/showMessageRequest",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType(n.method)})(rS||(_.ShowMessageRequest=rS={}));var sS;(function(n){n.method="window/logMessage",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(sS||(_.LogMessageNotification=sS={}));var iS;(function(n){n.method="telemetry/event",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(iS||(_.TelemetryEventNotification=iS={}));var oS;(function(n){n.None=0,n.Full=1,n.Incremental=2})(oS||(_.TextDocumentSyncKind=oS={}));var aS;(function(n){n.method="textDocument/didOpen",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(aS||(_.DidOpenTextDocumentNotification=aS={}));var cS;(function(n){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}n.isIncremental=e;function t(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}n.isFull=t})(cS||(_.TextDocumentContentChangeEvent=cS={}));var lS;(function(n){n.method="textDocument/didChange",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(lS||(_.DidChangeTextDocumentNotification=lS={}));var uS;(function(n){n.method="textDocument/didClose",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(uS||(_.DidCloseTextDocumentNotification=uS={}));var dS;(function(n){n.method="textDocument/didSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(dS||(_.DidSaveTextDocumentNotification=dS={}));var fS;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(fS||(_.TextDocumentSaveReason=fS={}));var hS;(function(n){n.method="textDocument/willSave",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(hS||(_.WillSaveTextDocumentNotification=hS={}));var pS;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(pS||(_.WillSaveTextDocumentWaitUntilRequest=pS={}));var mS;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolNotificationType(n.method)})(mS||(_.DidChangeWatchedFilesNotification=mS={}));var gS;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(gS||(_.FileChangeType=gS={}));var yS;(function(n){function e(t){let r=t;return St.objectLiteral(r)&&(F_.URI.is(r.baseUri)||F_.WorkspaceFolder.is(r.baseUri))&&St.string(r.pattern)}n.is=e})(yS||(_.RelativePattern=yS={}));var bS;(function(n){n.Create=1,n.Change=2,n.Delete=4})(bS||(_.WatchKind=bS={}));var vS;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolNotificationType(n.method)})(vS||(_.PublishDiagnosticsNotification=vS={}));var TS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(TS||(_.CompletionTriggerKind=TS={}));var _S;(function(n){n.method="textDocument/completion",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(_S||(_.CompletionRequest=_S={}));var SS;(function(n){n.method="completionItem/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(SS||(_.CompletionResolveRequest=SS={}));var wS;(function(n){n.method="textDocument/hover",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(wS||(_.HoverRequest=wS={}));var kS;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(kS||(_.SignatureHelpTriggerKind=kS={}));var ES;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(ES||(_.SignatureHelpRequest=ES={}));var NS;(function(n){n.method="textDocument/definition",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(NS||(_.DefinitionRequest=NS={}));var PS;(function(n){n.method="textDocument/references",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(PS||(_.ReferencesRequest=PS={}));var RS;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(RS||(_.DocumentHighlightRequest=RS={}));var DS;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(DS||(_.DocumentSymbolRequest=DS={}));var CS;(function(n){n.method="textDocument/codeAction",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(CS||(_.CodeActionRequest=CS={}));var OS;(function(n){n.method="codeAction/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(OS||(_.CodeActionResolveRequest=OS={}));var AS;(function(n){n.method="workspace/symbol",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(AS||(_.WorkspaceSymbolRequest=AS={}));var IS;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(IS||(_.WorkspaceSymbolResolveRequest=IS={}));var MS;(function(n){n.method="textDocument/codeLens",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(MS||(_.CodeLensRequest=MS={}));var $S;(function(n){n.method="codeLens/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})($S||(_.CodeLensResolveRequest=$S={}));var LS;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType0(n.method)})(LS||(_.CodeLensRefreshRequest=LS={}));var xS;(function(n){n.method="textDocument/documentLink",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(xS||(_.DocumentLinkRequest=xS={}));var qS;(function(n){n.method="documentLink/resolve",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(qS||(_.DocumentLinkResolveRequest=qS={}));var jS;(function(n){n.method="textDocument/formatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(jS||(_.DocumentFormattingRequest=jS={}));var FS;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(FS||(_.DocumentRangeFormattingRequest=FS={}));var BS;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(BS||(_.DocumentRangesFormattingRequest=BS={}));var US;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(US||(_.DocumentOnTypeFormattingRequest=US={}));var VS;(function(n){n.Identifier=1})(VS||(_.PrepareSupportDefaultBehavior=VS={}));var WS;(function(n){n.method="textDocument/rename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(WS||(_.RenameRequest=WS={}));var HS;(function(n){n.method="textDocument/prepareRename",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(HS||(_.PrepareRenameRequest=HS={}));var KS;(function(n){n.method="workspace/executeCommand",n.messageDirection=q.MessageDirection.clientToServer,n.type=new q.ProtocolRequestType(n.method)})(KS||(_.ExecuteCommandRequest=KS={}));var zS;(function(n){n.method="workspace/applyEdit",n.messageDirection=q.MessageDirection.serverToClient,n.type=new q.ProtocolRequestType("workspace/applyEdit")})(zS||(_.ApplyWorkspaceEditRequest=zS={}))});var ew=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.createProtocolConnection=void 0;var ZS=Is();function BA(n,e,t,r){return ZS.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,ZS.createMessageConnection)(n,e,t,r)}ql.createProtocolConnection=BA});var nw=w(en=>{"use strict";var UA=en&&en.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),jl=en&&en.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&UA(e,n,t)};Object.defineProperty(en,"__esModule",{value:!0});en.LSPErrorCodes=en.createProtocolConnection=void 0;jl(Is(),en);jl(Sl(),en);jl(Je(),en);jl(QS(),en);var VA=ew();Object.defineProperty(en,"createProtocolConnection",{enumerable:!0,get:function(){return VA.createProtocolConnection}});var tw;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(tw||(en.LSPErrorCodes=tw={}))});var st=w(rr=>{"use strict";var WA=rr&&rr.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),rw=rr&&rr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&WA(e,n,t)};Object.defineProperty(rr,"__esModule",{value:!0});rr.createProtocolConnection=void 0;var HA=fp();rw(fp(),rr);rw(nw(),rr);function KA(n,e,t,r){return(0,HA.createMessageConnection)(n,e,t,r)}rr.createProtocolConnection=KA});var Dp=w(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.generateUuid=Tn.parse=Tn.isUUID=Tn.v4=Tn.empty=void 0;var Zo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ea=class n extends Zo{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(""))}};ea._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ea._timeHighBits=["8","9","a","b"];Tn.empty=new Zo("00000000-0000-0000-0000-000000000000");function sw(){return new ea}Tn.v4=sw;var zA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function iw(n){return zA.test(n)}Tn.isUUID=iw;function GA(n){if(!iw(n))throw new Error("invalid uuid");return new Zo(n)}Tn.parse=GA;function YA(){return sw().asHex()}Tn.generateUuid=YA});var ow=w(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.attachPartialResult=Xr.ProgressFeature=Xr.attachWorkDone=void 0;var Jr=st(),JA=Dp(),$s=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,r,s){let i={kind:"begin",title:e,percentage:t,message:r,cancellable:s};this._connection.sendProgress(Jr.WorkDoneProgress.type,this._token,i)}report(e,t){let r={kind:"report"};typeof e=="number"?(r.percentage=e,t!==void 0&&(r.message=t)):r.message=e,this._connection.sendProgress(Jr.WorkDoneProgress.type,this._token,r)}done(){n.Instances.delete(this._token),this._connection.sendProgress(Jr.WorkDoneProgress.type,this._token,{kind:"end"})}};$s.Instances=new Map;var Fl=class extends $s{constructor(e,t){super(e,t),this._source=new Jr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ta=class{constructor(){}begin(){}report(){}done(){}},Bl=class extends ta{constructor(){super(),this._source=new Jr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function XA(n,e){if(e===void 0||e.workDoneToken===void 0)return new ta;let t=e.workDoneToken;return delete e.workDoneToken,new $s(n,t)}Xr.attachWorkDone=XA;var QA=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Jr.WorkDoneProgressCancelNotification.type,t=>{let r=$s.Instances.get(t.token);(r instanceof Fl||r instanceof Bl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ta:new $s(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,JA.generateUuid)();return this.connection.sendRequest(Jr.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Fl(this.connection,e))}else return Promise.resolve(new Bl)}};Xr.ProgressFeature=QA;var Cp;(function(n){n.type=new Jr.ProgressType})(Cp||(Cp={}));var Op=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Cp.type,this._token,e)}};function ZA(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Op(n,t)}Xr.attachPartialResult=ZA});var aw=w(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ConfigurationFeature=void 0;var eI=st(),tI=Zc(),nI=n=>class extends n{getConfiguration(e){return e?tI.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(eI.ConfigurationRequest.type,t).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ul.ConfigurationFeature=nI});var cw=w(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.WorkspaceFoldersFeature=void 0;var Vl=st(),rI=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Vl.Emitter,this.connection.onNotification(Vl.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Vl.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(Vl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Wl.WorkspaceFoldersFeature=rI});var lw=w(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.CallHierarchyFeature=void 0;var Ap=st(),sI=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ap.CallHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Ap.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onOutgoingCalls:e=>{let t=Ap.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Hl.CallHierarchyFeature=sI});var Mp=w(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.SemanticTokensBuilder=Qr.SemanticTokensDiff=Qr.SemanticTokensFeature=void 0;var Kl=st(),iI=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Kl.SemanticTokensRefreshRequest.type),on:e=>{let t=Kl.SemanticTokensRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onDelta:e=>{let t=Kl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onRange:e=>{let t=Kl.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Qr.SemanticTokensFeature=iI;var zl=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,r=0;for(;r<t&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<t&&r<e){let s=e-1,i=t-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<t?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Qr.SemanticTokensDiff=zl;var Ip=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,r,s,i){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++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,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 zl(this._prevData,this._data).computeDiff()}:this.build()}};Qr.SemanticTokensBuilder=Ip});var uw=w(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.ShowDocumentFeature=void 0;var oI=st(),aI=n=>class extends n{showDocument(e){return this.connection.sendRequest(oI.ShowDocumentRequest.type,e)}};Gl.ShowDocumentFeature=aI});var dw=w(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.FileOperationsFeature=void 0;var Li=st(),cI=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(Li.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(Li.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(Li.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(Li.WillCreateFilesRequest.type,(t,r)=>e(t,r))}onWillRenameFiles(e){return this.connection.onRequest(Li.WillRenameFilesRequest.type,(t,r)=>e(t,r))}onWillDeleteFiles(e){return this.connection.onRequest(Li.WillDeleteFilesRequest.type,(t,r)=>e(t,r))}};Yl.FileOperationsFeature=cI});var fw=w(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.LinkedEditingRangeFeature=void 0;var lI=st(),uI=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(lI.LinkedEditingRangeRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0))}};Jl.LinkedEditingRangeFeature=uI});var hw=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.TypeHierarchyFeature=void 0;var $p=st(),dI=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest($p.TypeHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=$p.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onSubtypes:e=>{let t=$p.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Xl.TypeHierarchyFeature=dI});var mw=w(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.InlineValueFeature=void 0;var pw=st(),fI=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(pw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(pw.InlineValueRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Ql.InlineValueFeature=fI});var yw=w(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.FoldingRangeFeature=void 0;var gw=st(),hI=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(gw.FoldingRangeRefreshRequest.type),on:e=>{let t=gw.FoldingRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Zl.FoldingRangeFeature=hI});var bw=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.InlayHintFeature=void 0;var Lp=st(),pI=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Lp.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Lp.InlayHintRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Lp.InlayHintResolveRequest.type,(t,r)=>e(t,r))}}};eu.InlayHintFeature=pI});var vw=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.DiagnosticFeature=void 0;var na=st(),mI=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(na.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(na.DocumentDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(na.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(na.WorkspaceDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(na.WorkspaceDiagnosticRequest.partialResult,t)))}}};tu.DiagnosticFeature=mI});var qp=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.TextDocuments=void 0;var Ls=st(),xp=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ls.Emitter,this._onDidOpen=new Ls.Emitter,this._onDidClose=new Ls.Emitter,this._onDidSave=new Ls.Emitter,this._onWillSave=new Ls.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=Ls.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),t.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),t.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),Ls.Disposable.create(()=>{t.forEach(r=>r.dispose())})}};nu.TextDocuments=xp});var Fp=w(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.NotebookDocuments=xi.NotebookSyncFeature=void 0;var _n=st(),Tw=qp(),gI=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(_n.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(_n.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(_n.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(_n.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};xi.NotebookSyncFeature=gI;var ru=class n{onDidOpenTextDocument(e){return this.openHandler=e,_n.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,_n.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,_n.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}};ru.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var jp=class{constructor(e){e instanceof Tw.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Tw.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new _n.Emitter,this._onDidChange=new _n.Emitter,this._onDidSave=new _n.Emitter,this._onDidClose=new _n.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,r=this.notebookCellMap.get(t);return r&&r[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 ru,r=[];return r.push(this.cellTextDocuments.listen(t)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)t.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let k=c.cells;if(k.structure!==void 0){let v=k.structure.array;if(i.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),k.structure.didOpen!==void 0)for(let b of k.structure.didOpen)t.openTextDocument({textDocument:b}),l.push(b.uri);if(k.structure.didClose)for(let b of k.structure.didClose)t.closeTextDocument({textDocument:b}),u.push(b.uri)}if(k.data!==void 0){let v=new Map(k.data.map(b=>[b.document,b]));for(let b=0;b<=i.cells.length;b++){let R=v.get(i.cells[b].document);if(R!==void 0){let O=i.cells.splice(b,1,R);if(d.push({old:O[0],new:R}),v.delete(R.document),v.size===0)break}}}if(k.textContent!==void 0)for(let v of k.textContent)t.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),f.push(v.document.uri)}this.updateCellMap(i);let m={notebookDocument:i};a&&(m.metadata={old:o,new:i.metadata});let T=[];for(let k of l)T.push(this.getNotebookCell(k));let g=[];for(let k of u)g.push(this.getNotebookCell(k));let S=[];for(let k of f)S.push(this.getNotebookCell(k));(T.length>0||g.length>0||d.length>0||S.length>0)&&(m.cells={added:T,removed:g,changed:{data:d,textContent:S}}),(m.metadata!==void 0||m.cells!==void 0)&&this._onDidChange.fire(m)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),_n.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};xi.NotebookDocuments=jp});var _w=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.MonikerFeature=void 0;var yI=st(),bI=n=>class extends n{get moniker(){return{on:e=>{let t=yI.MonikerRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};su.MonikerFeature=bI});var Kp=w(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.createConnection=Se.combineFeatures=Se.combineNotebooksFeatures=Se.combineLanguagesFeatures=Se.combineWorkspaceFeatures=Se.combineWindowFeatures=Se.combineClientFeatures=Se.combineTracerFeatures=Se.combineTelemetryFeatures=Se.combineConsoleFeatures=Se._NotebooksImpl=Se._LanguagesImpl=Se.BulkUnregistration=Se.BulkRegistration=Se.ErrorMessageTracker=void 0;var U=st(),Sn=Zc(),Up=Dp(),ne=ow(),vI=aw(),TI=cw(),_I=lw(),SI=Mp(),wI=uw(),kI=dw(),EI=fw(),NI=hw(),PI=mw(),RI=yw(),DI=bw(),CI=vw(),OI=Fp(),AI=_w();function Bp(n){if(n!==null)return n}var Vp=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)})}};Se.ErrorMessageTracker=Vp;var iu=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")})}},Wp=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 r={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Bp)}showWarningMessage(e,...t){let r={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Bp)}showInformationMessage(e,...t){let r={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Bp)}},Sw=(0,wI.ShowDocumentFeature)((0,ne.ProgressFeature)(Wp)),ww;(function(n){function e(){return new ou}n.create=e})(ww||(Se.BulkRegistration=ww={}));var ou=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let r=Sn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=Up.generateUuid();this._registrations.push({id:s,method:r,registerOptions:t||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},kw;(function(n){function e(){return new ra(void 0,[])}n.create=e})(kw||(Se.BulkUnregistration=kw={}));var ra=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Sn.string(e)?e:e.method,r=this._unregistrations.get(t);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},au=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,r){return e instanceof ou?this.registerMany(e):e instanceof ra?this.registerSingle1(e,t,r):this.registerSingle2(e,t)}registerSingle1(e,t,r){let s=Sn.string(t)?t:t.method,i=Up.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,t){let r=Sn.string(e)?e:e.method,s=Up.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let r={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,r).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 ra(this._connection,t.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Hp=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(s){return s&&!!s.edit}let r=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,r)}},Ew=(0,kI.FileOperationsFeature)((0,TI.WorkspaceFoldersFeature)((0,vI.ConfigurationFeature)(Hp))),cu=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(()=>{})}},lu=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")})}},uu=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,ne.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,ne.attachPartialResult)(this.connection,t)}};Se._LanguagesImpl=uu;var Nw=(0,RI.FoldingRangeFeature)((0,AI.MonikerFeature)((0,CI.DiagnosticFeature)((0,DI.InlayHintFeature)((0,PI.InlineValueFeature)((0,NI.TypeHierarchyFeature)((0,EI.LinkedEditingRangeFeature)((0,SI.SemanticTokensFeature)((0,_I.CallHierarchyFeature)(uu))))))))),du=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,ne.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,ne.attachPartialResult)(this.connection,t)}};Se._NotebooksImpl=du;var Pw=(0,OI.NotebookSyncFeature)(du);function Rw(n,e){return function(t){return e(n(t))}}Se.combineConsoleFeatures=Rw;function Dw(n,e){return function(t){return e(n(t))}}Se.combineTelemetryFeatures=Dw;function Cw(n,e){return function(t){return e(n(t))}}Se.combineTracerFeatures=Cw;function Ow(n,e){return function(t){return e(n(t))}}Se.combineClientFeatures=Ow;function Aw(n,e){return function(t){return e(n(t))}}Se.combineWindowFeatures=Aw;function Iw(n,e){return function(t){return e(n(t))}}Se.combineWorkspaceFeatures=Iw;function Mw(n,e){return function(t){return e(n(t))}}Se.combineLanguagesFeatures=Mw;function $w(n,e){return function(t){return e(n(t))}}Se.combineNotebooksFeatures=$w;function II(n,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(n.console,e.console,Rw),tracer:t(n.tracer,e.tracer,Cw),telemetry:t(n.telemetry,e.telemetry,Dw),client:t(n.client,e.client,Ow),window:t(n.window,e.window,Aw),workspace:t(n.workspace,e.workspace,Iw),languages:t(n.languages,e.languages,Mw),notebooks:t(n.notebooks,e.notebooks,$w)}}Se.combineFeatures=II;function MI(n,e,t){let r=t&&t.console?new(t.console(iu)):new iu,s=n(r);r.rawAttach(s);let i=t&&t.tracer?new(t.tracer(cu)):new cu,o=t&&t.telemetry?new(t.telemetry(lu)):new lu,a=t&&t.client?new(t.client(au)):new au,c=t&&t.window?new(t.window(Sw)):new Sw,l=t&&t.workspace?new(t.workspace(Ew)):new Ew,u=t&&t.languages?new(t.languages(Nw)):new Nw,d=t&&t.notebooks?new(t.notebooks(Pw)):new Pw,f=[r,i,o,a,c,l,u,d];function m(v){return v instanceof Promise?v:Sn.thenable(v)?new Promise((b,R)=>{v.then(O=>b(O),O=>R(O))}):Promise.resolve(v)}let T,g,S,k={listen:()=>s.listen(),sendRequest:(v,...b)=>s.sendRequest(Sn.string(v)?v:v.method,...b),onRequest:(v,b)=>s.onRequest(v,b),sendNotification:(v,b)=>{let R=Sn.string(v)?v:v.method;return s.sendNotification(R,b)},onNotification:(v,b)=>s.onNotification(v,b),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:v=>(g=v,{dispose:()=>{g=void 0}}),onInitialized:v=>s.onNotification(U.InitializedNotification.type,v),onShutdown:v=>(T=v,{dispose:()=>{T=void 0}}),onExit:v=>(S=v,{dispose:()=>{S=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:v=>s.onNotification(U.DidChangeConfigurationNotification.type,v),onDidChangeWatchedFiles:v=>s.onNotification(U.DidChangeWatchedFilesNotification.type,v),__textDocumentSync:void 0,onDidOpenTextDocument:v=>s.onNotification(U.DidOpenTextDocumentNotification.type,v),onDidChangeTextDocument:v=>s.onNotification(U.DidChangeTextDocumentNotification.type,v),onDidCloseTextDocument:v=>s.onNotification(U.DidCloseTextDocumentNotification.type,v),onWillSaveTextDocument:v=>s.onNotification(U.WillSaveTextDocumentNotification.type,v),onWillSaveTextDocumentWaitUntil:v=>s.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,v),onDidSaveTextDocument:v=>s.onNotification(U.DidSaveTextDocumentNotification.type,v),sendDiagnostics:v=>s.sendNotification(U.PublishDiagnosticsNotification.type,v),onHover:v=>s.onRequest(U.HoverRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onCompletion:v=>s.onRequest(U.CompletionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCompletionResolve:v=>s.onRequest(U.CompletionResolveRequest.type,v),onSignatureHelp:v=>s.onRequest(U.SignatureHelpRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDeclaration:v=>s.onRequest(U.DeclarationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDefinition:v=>s.onRequest(U.DefinitionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onTypeDefinition:v=>s.onRequest(U.TypeDefinitionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onImplementation:v=>s.onRequest(U.ImplementationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onReferences:v=>s.onRequest(U.ReferencesRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentHighlight:v=>s.onRequest(U.DocumentHighlightRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentSymbol:v=>s.onRequest(U.DocumentSymbolRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onWorkspaceSymbol:v=>s.onRequest(U.WorkspaceSymbolRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onWorkspaceSymbolResolve:v=>s.onRequest(U.WorkspaceSymbolResolveRequest.type,v),onCodeAction:v=>s.onRequest(U.CodeActionRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCodeActionResolve:v=>s.onRequest(U.CodeActionResolveRequest.type,(b,R)=>v(b,R)),onCodeLens:v=>s.onRequest(U.CodeLensRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onCodeLensResolve:v=>s.onRequest(U.CodeLensResolveRequest.type,(b,R)=>v(b,R)),onDocumentFormatting:v=>s.onRequest(U.DocumentFormattingRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDocumentRangeFormatting:v=>s.onRequest(U.DocumentRangeFormattingRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onDocumentOnTypeFormatting:v=>s.onRequest(U.DocumentOnTypeFormattingRequest.type,(b,R)=>v(b,R)),onRenameRequest:v=>s.onRequest(U.RenameRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),onPrepareRename:v=>s.onRequest(U.PrepareRenameRequest.type,(b,R)=>v(b,R)),onDocumentLinks:v=>s.onRequest(U.DocumentLinkRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onDocumentLinkResolve:v=>s.onRequest(U.DocumentLinkResolveRequest.type,(b,R)=>v(b,R)),onDocumentColor:v=>s.onRequest(U.DocumentColorRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onColorPresentation:v=>s.onRequest(U.ColorPresentationRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onFoldingRanges:v=>s.onRequest(U.FoldingRangeRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onSelectionRanges:v=>s.onRequest(U.SelectionRangeRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),(0,ne.attachPartialResult)(s,b))),onExecuteCommand:v=>s.onRequest(U.ExecuteCommandRequest.type,(b,R)=>v(b,R,(0,ne.attachWorkDone)(s,b),void 0)),dispose:()=>s.dispose()};for(let v of f)v.attach(k);return s.onRequest(U.InitializeRequest.type,v=>{e.initialize(v),Sn.string(v.trace)&&(i.trace=U.Trace.fromString(v.trace));for(let b of f)b.initialize(v.capabilities);if(g){let b=g(v,new U.CancellationTokenSource().token,(0,ne.attachWorkDone)(s,v),void 0);return m(b).then(R=>{if(R instanceof U.ResponseError)return R;let O=R;O||(O={capabilities:{}});let L=O.capabilities;L||(L={},O.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Sn.number(k.__textDocumentSync)?k.__textDocumentSync:U.TextDocumentSyncKind.None:!Sn.number(L.textDocumentSync)&&!Sn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Sn.number(k.__textDocumentSync)?k.__textDocumentSync:U.TextDocumentSyncKind.None);for(let V of f)V.fillServerCapabilities(L);return O})}else{let b={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(b.capabilities);return b}}),s.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,T)return T(new U.CancellationTokenSource().token)}),s.onNotification(U.ExitNotification.type,()=>{try{S&&S()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(U.SetTraceNotification.type,v=>{i.trace=U.Trace.fromString(v.value)}),k}Se.createConnection=MI});var Lw=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.resolveModulePath=tn.FileSystem=tn.resolveGlobalYarnPath=tn.resolveGlobalNodePath=tn.resolve=tn.uriToFilePath=void 0;var $I=require("url"),jn=require("path"),zp=require("fs"),Xp=require("child_process");function LI(n){let e=$I.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var r=0,s=t.length;r<s;r++)t[r]=decodeURIComponent(t[r]);if(process.platform==="win32"&&t.length>1){let i=t[0],o=t[1];i.length===0&&o.length>1&&o[1]===":"&&t.shift()}return jn.normalize(t.join("/"))}tn.uriToFilePath=LI;function Gp(){return process.platform==="win32"}function fu(n,e,t,r){let s="NODE_PATH",i=["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&&zp.existsSync(e)&&(l[s]?l[s]=e+jn.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Xp.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}tn.resolve=fu;function Yp(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:t};Gp()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,Xp.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){n&&n("'npm config get prefix' didn't return a value.");return}let o=i.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Gp()?jn.join(o,"node_modules"):jn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}tn.resolveGlobalNodePath=Yp;function xI(n){let e="yarn",t={encoding:"utf8"};Gp()&&(e="yarn.cmd",t.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,Xp.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){n&&(n("'yarn global dir' didn't return a value."),s.stderr&&n(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return jn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}tn.resolveGlobalYarnPath=xI;var Jp;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!zp.existsSync(__filename.toUpperCase())||!zp.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function r(s,i){return t()?jn.normalize(i).indexOf(jn.normalize(s))===0:jn.normalize(i).toLowerCase().indexOf(jn.normalize(s).toLowerCase())===0}n.isParent=r})(Jp||(tn.FileSystem=Jp={}));function qI(n,e,t,r){return t?(jn.isAbsolute(t)||(t=jn.join(n,t)),fu(e,t,t,r).then(s=>Jp.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>fu(e,Yp(r),n,r))):fu(e,Yp(r),n,r)}tn.resolveModulePath=qI});var Qp=w((IK,xw)=>{"use strict";xw.exports=st()});var qw=w(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.InlineCompletionFeature=void 0;var jI=st(),FI=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(jI.InlineCompletionRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};hu.InlineCompletionFeature=FI});var Bw=w(jt=>{"use strict";var BI=jt&&jt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Fw=jt&&jt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&BI(e,n,t)};Object.defineProperty(jt,"__esModule",{value:!0});jt.ProposedFeatures=jt.NotebookDocuments=jt.TextDocuments=jt.SemanticTokensBuilder=void 0;var UI=Mp();Object.defineProperty(jt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return UI.SemanticTokensBuilder}});var VI=qw();Fw(st(),jt);var WI=qp();Object.defineProperty(jt,"TextDocuments",{enumerable:!0,get:function(){return WI.TextDocuments}});var HI=Fp();Object.defineProperty(jt,"NotebookDocuments",{enumerable:!0,get:function(){return HI.NotebookDocuments}});Fw(Kp(),jt);var jw;(function(n){n.all={__brand:"features",languages:VI.InlineCompletionFeature}})(jw||(jt.ProposedFeatures=jw={}))});var X=w(wn=>{"use strict";var KI=wn&&wn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Hw=wn&&wn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&KI(e,n,t)};Object.defineProperty(wn,"__esModule",{value:!0});wn.createConnection=wn.Files=void 0;var Uw=require("node:util"),Zp=Zc(),zI=Kp(),sa=Lw(),xs=Qp();Hw(Qp(),wn);Hw(Bw(),wn);var Vw;(function(n){n.uriToFilePath=sa.uriToFilePath,n.resolveGlobalNodePath=sa.resolveGlobalNodePath,n.resolveGlobalYarnPath=sa.resolveGlobalYarnPath,n.resolve=sa.resolve,n.resolveModulePath=sa.resolveModulePath})(Vw||(wn.Files=Vw={}));var Ww;function pu(){if(Ww!==void 0)try{Ww.end()}catch{}}var qi=!1,Kw;function GI(){let n="--clientProcessId";function e(t){try{let r=parseInt(t);isNaN(r)||(Kw=setInterval(()=>{try{process.kill(r,0)}catch{pu(),process.exit(qi?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let r=process.argv[t];if(r===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=r.split("=");s[0]===n&&e(s[1])}}}GI();var YI={initialize:n=>{let e=n.processId;Zp.number(e)&&Kw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(qi?0:1)}},3e3)},get shutdownReceived(){return qi},set shutdownReceived(n){qi=n},exit:n=>{pu(),process.exit(n)}};function JI(n,e,t,r){let s,i,o,a;return n!==void 0&&n.__brand==="features"&&(s=n,n=e,e=t,t=r),xs.ConnectionStrategy.is(n)||xs.ConnectionOptions.is(n)?a=n:(i=n,o=e,a=t),XI(i,o,a,s)}wn.createConnection=JI;function XI(n,e,t,r){let s=!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 f=u[d];if(f==="--node-ipc"){n=new xs.IPCMessageReader(process),e=new xs.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,n=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,xs.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,xs.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(Zp.func(n.read)&&Zp.func(n.on)){let c=n;c.on("end",()=>{pu(),process.exit(qi?0:1)}),c.on("close",()=>{pu(),process.exit(qi?0:1)})}let a=c=>{let l=(0,xs.createProtocolConnection)(n,e,c,t);return s&&QI(c),l};return(0,zI.createConnection)(a,YI,r)}function QI(n){function e(r){return r.map(s=>typeof s=="string"?s:(0,Uw.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)n.error("Assertion failed");else{let[o,...a]=i;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=t.get(i)??0;o+=1,t.set(i,o),n.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){n.log(e(s))},console.dir=function(s,i){n.log((0,Uw.inspect)(s,i))},console.log=function(...s){n.log(e(s))},console.error=function(...s){n.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),n.log(`${o}
37
+ ${i}`)},console.warn=function(...s){n.warn(e(s))}}});var Gw=w((qK,zw)=>{"use strict";zw.exports=X()});var ye=w(At=>{"use strict";var lm=Symbol.for("yaml.alias"),gE=Symbol.for("yaml.document"),Yu=Symbol.for("yaml.map"),yE=Symbol.for("yaml.pair"),um=Symbol.for("yaml.scalar"),Ju=Symbol.for("yaml.seq"),Or=Symbol.for("yaml.node.type"),IM=n=>!!n&&typeof n=="object"&&n[Or]===lm,MM=n=>!!n&&typeof n=="object"&&n[Or]===gE,$M=n=>!!n&&typeof n=="object"&&n[Or]===Yu,LM=n=>!!n&&typeof n=="object"&&n[Or]===yE,bE=n=>!!n&&typeof n=="object"&&n[Or]===um,xM=n=>!!n&&typeof n=="object"&&n[Or]===Ju;function vE(n){if(n&&typeof n=="object")switch(n[Or]){case Yu:case Ju:return!0}return!1}function qM(n){if(n&&typeof n=="object")switch(n[Or]){case lm:case Yu:case um:case Ju:return!0}return!1}var jM=n=>(bE(n)||vE(n))&&!!n.anchor;At.ALIAS=lm;At.DOC=gE;At.MAP=Yu;At.NODE_TYPE=Or;At.PAIR=yE;At.SCALAR=um;At.SEQ=Ju;At.hasAnchor=jM;At.isAlias=IM;At.isCollection=vE;At.isDocument=MM;At.isMap=$M;At.isNode=qM;At.isPair=LM;At.isScalar=bE;At.isSeq=xM});var da=w(dm=>{"use strict";var vt=ye(),rn=Symbol("break visit"),TE=Symbol("skip children"),dr=Symbol("remove node");function Xu(n,e){let t=_E(e);vt.isDocument(n)?no(null,n.contents,t,Object.freeze([n]))===dr&&(n.contents=null):no(null,n,t,Object.freeze([]))}Xu.BREAK=rn;Xu.SKIP=TE;Xu.REMOVE=dr;function no(n,e,t,r){let s=SE(n,e,t,r);if(vt.isNode(s)||vt.isPair(s))return wE(n,r,s),no(n,s,t,r);if(typeof s!="symbol"){if(vt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=no(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===rn)return rn;o===dr&&(e.items.splice(i,1),i-=1)}}}else if(vt.isPair(e)){r=Object.freeze(r.concat(e));let i=no("key",e.key,t,r);if(i===rn)return rn;i===dr&&(e.key=null);let o=no("value",e.value,t,r);if(o===rn)return rn;o===dr&&(e.value=null)}}return s}async function Qu(n,e){let t=_E(e);vt.isDocument(n)?await ro(null,n.contents,t,Object.freeze([n]))===dr&&(n.contents=null):await ro(null,n,t,Object.freeze([]))}Qu.BREAK=rn;Qu.SKIP=TE;Qu.REMOVE=dr;async function ro(n,e,t,r){let s=await SE(n,e,t,r);if(vt.isNode(s)||vt.isPair(s))return wE(n,r,s),ro(n,s,t,r);if(typeof s!="symbol"){if(vt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await ro(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===rn)return rn;o===dr&&(e.items.splice(i,1),i-=1)}}}else if(vt.isPair(e)){r=Object.freeze(r.concat(e));let i=await ro("key",e.key,t,r);if(i===rn)return rn;i===dr&&(e.key=null);let o=await ro("value",e.value,t,r);if(o===rn)return rn;o===dr&&(e.value=null)}}return s}function _E(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 SE(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(vt.isMap(e))return t.Map?.(n,e,r);if(vt.isSeq(e))return t.Seq?.(n,e,r);if(vt.isPair(e))return t.Pair?.(n,e,r);if(vt.isScalar(e))return t.Scalar?.(n,e,r);if(vt.isAlias(e))return t.Alias?.(n,e,r)}function wE(n,e,t){let r=e[e.length-1];if(vt.isCollection(r))r.items[n]=t;else if(vt.isPair(r))n==="key"?r.key=t:r.value=t;else if(vt.isDocument(r))r.contents=t;else{let s=vt.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}dm.visit=Xu;dm.visitAsync=Qu});var fm=w(EE=>{"use strict";var kE=ye(),FM=da(),BM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},UM=n=>n.replace(/[!,[\]{}]/g,e=>BM[e]),fa=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 r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!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[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+UM(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&kE.isNode(e.contents)){let i={};FM.visit(e.contents,(o,a)=>{kE.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
38
+ `)}};fa.defaultYaml={explicit:!1,version:"1.2"};fa.defaultTags={"!!":"tag:yaml.org,2002:"};EE.Directives=fa});var Zu=w(ha=>{"use strict";var NE=ye(),VM=da();function WM(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 PE(n){let e=new Set;return VM.visit(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function RE(n,e){for(let t=1;;++t){let r=`${n}${t}`;if(!e.has(r))return r}}function HM(n,e){let t=[],r=new Map,s=null;return{onAnchor:i=>{t.push(i),s||(s=PE(n));let o=RE(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(NE.isScalar(o.node)||NE.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=i,a}}},sourceObjects:r}}ha.anchorIsValid=WM;ha.anchorNames=PE;ha.createNodeAnchors=HM;ha.findNewAnchor=RE});var hm=w(DE=>{"use strict";function pa(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=pa(n,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=pa(n,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=pa(n,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=pa(n,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return n.call(e,t,r)}DE.applyReviver=pa});var os=w(OE=>{"use strict";var KM=ye();function CE(n,e,t){if(Array.isArray(n))return n.map((r,s)=>CE(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!KM.hasAnchor(n))return n.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=i=>{r.res=i,delete t.onCreate};let s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!t?.keep?Number(n):n}OE.toJS=CE});var ed=w(IE=>{"use strict";var zM=hm(),AE=ye(),GM=os(),pm=class{constructor(e){Object.defineProperty(this,AE.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:r,onAnchor:s,reviver:i}={}){if(!AE.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 r=="number"?r:100},a=GM.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?zM.applyReviver(i,{"":a},"",a):a}};IE.NodeBase=pm});var ma=w($E=>{"use strict";var YM=Zu(),ME=da(),td=ye(),JM=ed(),XM=os(),mm=class extends JM.NodeBase{constructor(e){super(td.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return ME.visit(e,{Node:(r,s)=>{if(s===this)return ME.visit.BREAK;s.anchor===this.source&&(t=s)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=t,o=this.resolve(s);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(XM.toJS(o,null,t),a=r.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=nd(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,r){let s=`*${this.source}`;if(e){if(YM.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function nd(n,e,t){if(td.isAlias(e)){let r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(td.isCollection(e)){let r=0;for(let s of e.items){let i=nd(n,s,t);i>r&&(r=i)}return r}else if(td.isPair(e)){let r=nd(n,e.key,t),s=nd(n,e.value,t);return Math.max(r,s)}return 1}$E.Alias=mm});var gt=w(gm=>{"use strict";var QM=ye(),ZM=ed(),e$=os(),t$=n=>!n||typeof n!="function"&&typeof n!="object",as=class extends ZM.NodeBase{constructor(e){super(QM.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:e$.toJS(this.value,e,t)}toString(){return String(this.value)}};as.BLOCK_FOLDED="BLOCK_FOLDED";as.BLOCK_LITERAL="BLOCK_LITERAL";as.PLAIN="PLAIN";as.QUOTE_DOUBLE="QUOTE_DOUBLE";as.QUOTE_SINGLE="QUOTE_SINGLE";gm.Scalar=as;gm.isScalarValue=t$});var ga=w(xE=>{"use strict";var n$=ma(),Vs=ye(),LE=gt(),r$="tag:yaml.org,2002:";function s$(n,e,t){if(e){let r=t.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(r=>r.identify?.(n)&&!r.format)}function i$(n,e,t){if(Vs.isDocument(n)&&(n=n.contents),Vs.isNode(n))return n;if(Vs.isPair(n)){let d=t.schema[Vs.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:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(r&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=s(n)),new n$.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=r$+e.slice(2));let l=s$(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new LE.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[Vs.MAP]:Symbol.iterator in Object(n)?o[Vs.SEQ]:o[Vs.MAP]}i&&(i(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 LE.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}xE.createNode=i$});var sd=w(rd=>{"use strict";var o$=ga(),fr=ye(),a$=ed();function ym(n,e,t){let r=t;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return o$.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var qE=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,bm=class extends a$.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(r=>fr.isNode(r)||fr.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(qE(e))this.add(t);else{let[r,...s]=e,i=this.get(r,!0);if(fr.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,ym(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let s=this.get(t,!0);if(fr.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!t&&fr.isScalar(i)?i.value:i:fr.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!fr.isPair(t))return!1;let r=t.value;return r==null||e&&fr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let s=this.get(t,!0);return fr.isCollection(s)?s.hasIn(r):!1}setIn(e,t){let[r,...s]=e;if(s.length===0)this.set(r,t);else{let i=this.get(r,!0);if(fr.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,ym(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};rd.Collection=bm;rd.collectionFromPath=ym;rd.isEmptyPath=qE});var ya=w(id=>{"use strict";var c$=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function vm(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var l$=(n,e,t)=>n.endsWith(`
39
+ `)?vm(t,e):t.includes(`
40
40
  `)?`
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,y=-1,w=-1,R=-1;t===Dd&&(y=Uv(n,y,e.length),y!==-1&&(d=y+c));for(let T;T=n[y+=1];){if(t===Qc&&T==="\\"){switch(w=y,n[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}R=y}if(T===`
42
- `)t===Dd&&(y=Uv(n,y,e.length)),d=y+e.length+c,p=void 0;else{if(T===" "&&g&&g!==" "&&g!==`
43
- `&&g!==" "){let N=n[y+1];N&&N!==" "&&N!==`
44
- `&&N!==" "&&(p=y)}if(y>=d)if(p)l.push(p),d=p+c,p=void 0;else if(t===Qc){for(;g===" "||g===" ";)g=T,T=n[y+=1],_=!0;let N=y>R+1?y-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=Je(),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)+`
41
+ `+vm(t,e):(n.endsWith(" ")?"":" ")+t;id.indentComment=vm;id.lineComment=l$;id.stringifyComment=c$});var FE=w(ba=>{"use strict";var u$="flow",Tm="block",od="quoted";function d$(n,e,t="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return n;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(n.length<=c)return n;let l=[],u={},d=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f,m,T=!1,g=-1,S=-1,k=-1;t===Tm&&(g=jE(n,g,e.length),g!==-1&&(d=g+c));for(let b;b=n[g+=1];){if(t===od&&b==="\\"){switch(S=g,n[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}k=g}if(b===`
42
+ `)t===Tm&&(g=jE(n,g,e.length)),d=g+e.length+c,f=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
43
+ `&&m!==" "){let R=n[g+1];R&&R!==" "&&R!==`
44
+ `&&R!==" "&&(f=g)}if(g>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===od){for(;m===" "||m===" ";)m=b,b=n[g+=1],T=!0;let R=g>k+1?g-2:S-1;if(u[R])return n;l.push(R),u[R]=!0,d=R+c,f=void 0}else T=!0}m=b}if(T&&a&&a(),l.length===0)return n;o&&o();let v=n.slice(0,l[0]);for(let b=0;b<l.length;++b){let R=l[b],O=l[b+1]||n.length;R===0?v=`
45
+ ${e}${n.slice(0,O)}`:(t===od&&u[R]&&(v+=`${n[R]}\\`),v+=`
46
+ ${e}${n.slice(R+1,O)}`)}return v}function jE(n,e,t){let r=e,s=e+1,i=n[s];for(;i===" "||i===" ";)if(e<s+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
47
+ `);r=e,s=e+1,i=n[s]}return r}ba.FOLD_BLOCK=Tm;ba.FOLD_FLOW=u$;ba.FOLD_QUOTED=od;ba.foldFlowLines=d$});var Ta=w(BE=>{"use strict";var Wn=gt(),cs=FE(),cd=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),ld=n=>/^(%|---|\.\.\.)/m.test(n);function f$(n,e,t){if(!e||e<0)return!1;let r=e-t,s=n.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(n[i]===`
48
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function va(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(ld(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(r||t[c+2]==='"'||t.length<s)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: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(`(^|(?<!
51
+ `,c+=2;o+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,r?o:cs.foldFlowLines(o,i,cs.FOLD_QUOTED,cd(e,!1))}function _m(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
52
+ `)||/[ \t]\n|\n[ \t]/.test(n))return va(n,e);let t=e.indent||(ld(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
53
+ ${t}`)+"'";return e.implicitKey?r:cs.foldFlowLines(r,t,cs.FOLD_FLOW,cd(e,!1))}function so(n,e){let{singleQuote:t}=e.options,r;if(t===!1)r=va;else{let s=n.includes('"'),i=n.includes("'");s&&!i?r=_m:i&&!s?r=va:r=t?_m:va}return r(n,e)}var Sm;try{Sm=new RegExp(`(^|(?<!
54
54
  ))
55
55
  +(?!
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?`|
56
+ |$)`,"g")}catch{Sm=/\n+(?!\n|$)/g}function ad({comment:n,type:e,value:t},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return so(t,r);let l=r.indent||(r.forceBlockIndent||ld(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===Wn.Scalar.BLOCK_FOLDED?!1:e===Wn.Scalar.BLOCK_LITERAL?!0:!f$(t,c,l.length);if(!t)return u?`|
57
57
  `:`>
58
- `;let d,p;for(p=t.length;p>0;--p){let L=t[p-1];if(L!==`
59
- `&&L!==" "&&L!==" ")break}let g=t.substring(p),_=g.indexOf(`
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(Cd,`$&${l}`));let y=!1,w,R=-1;for(w=0;w<t.length;++w){let L=t[w];if(L===" ")y=!0;else if(L===`
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=(y?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=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
- ${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${N}
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=y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.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=Je(),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,y=!1,w=Hv.stringify(n,t,()=>_=!0,()=>y=!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)):y&&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),y=!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,()=>y=!0),q=" ";if(p||R||v){if(q=R?`
72
- `:"",v){let H=l(v);q+=`
73
- ${Vs.indentComment(H,t.indent)}`}L===""&&!t.inFlow?q===`
74
- `&&(q=`
75
-
76
- `):q+=`
77
- ${t.indent}`}else if(!g&&$n.isCollection(e)){let H=L[0],j=L.indexOf(`
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
- ${t.indent}`)}}else(L===""||L[0]===`
80
- `)&&(q="");return w+=q+L,t.inFlow?N&&i&&i():T&&!N?w+=Vs.lineComment(w,t.indent,l(T)):y&&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=Je(),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 y=e[_],w=null;if(Hi.isNode(y))!d&&y.spaceBefore&&p.push(""),cl(t,p,y.commentBefore,d),y.comment&&(w=y.comment);else if(Hi.isPair(y)){let v=Hi.isNode(y.key)?y.key:null;v&&(!d&&v.spaceBefore&&p.push(""),cl(t,p,v.commentBefore,d))}d=!1;let R=eS.stringify(y,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 y=p[_];g+=y?`
81
- ${c}${y}`:`
82
- `}}return n?(g+=`
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 y=n[_],w=null;if(Hi.isNode(y))y.spaceBefore&&d.push(""),cl(e,d,y.commentBefore,!1),y.comment&&(w=y.comment);else if(Hi.isPair(y)){let v=Hi.isNode(y.key)?y.key:null;v&&(v.spaceBefore&&d.push(""),cl(e,d,v.commentBefore,!1),v.comment&&(l=!0));let T=Hi.isNode(y.value)?y.value:null;T?(T.comment&&(w=T.comment),T.commentBefore&&(l=!0)):y.value==null&&v?.comment&&(w=v.comment)}w&&(l=!0);let R=eS.stringify(y,c,()=>w=null);_<n.length-1&&(R+=","),w&&(R+=al.lineComment(R,i,a(w))),!l&&(d.length>u||R.includes(`
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((y,w)=>y+w.length+2,2);l=e.options.lineWidth>0&&_>e.options.lineWidth}if(l){let _=p;for(let y of d)_+=y?`
85
- ${s}${r}${y}`:`
86
- `;return`${_}
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=Je();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=Je(),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=Je(),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=Je(),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=Je(),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=Je(),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=Je(),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=Je(),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
- ${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]=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=Je();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=Je(),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(`
58
+ `;let d,f;for(f=t.length;f>0;--f){let O=t[f-1];if(O!==`
59
+ `&&O!==" "&&O!==" ")break}let m=t.substring(f),T=m.indexOf(`
60
+ `);T===-1?d="-":t===m||T!==m.length-1?(d="+",i&&i()):d="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
61
+ `&&(m=m.slice(0,-1)),m=m.replace(Sm,`$&${l}`));let g=!1,S,k=-1;for(S=0;S<t.length;++S){let O=t[S];if(O===" ")g=!0;else if(O===`
62
+ `)k=S;else break}let v=t.substring(0,k<S?k+1:S);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let R=(g?l?"2":"1":"")+d;if(n&&(R+=" "+a(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let O=t.replace(/\n+/g,`
63
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,V=cd(r,!0);o!=="folded"&&e!==Wn.Scalar.BLOCK_FOLDED&&(V.onOverflow=()=>{L=!0});let j=cs.foldFlowLines(`${v}${O}${m}`,l,cs.FOLD_BLOCK,V);if(!L)return`>${R}
64
+ ${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${R}
65
+ ${l}${v}${t}${m}`}function h$(n,e,t,r){let{type:s,value:i}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
66
+ `)||u&&/[[\]{},]/.test(i))return so(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
67
+ `)?so(i,e):ad(n,e,t,r);if(!a&&!u&&s!==Wn.Scalar.PLAIN&&i.includes(`
68
+ `))return ad(n,e,t,r);if(ld(i)){if(c==="")return e.forceBlockIndent=!0,ad(n,e,t,r);if(a&&c===l)return so(i,e)}let d=i.replace(/\n+/g,`$&
69
+ ${c}`);if(o){let f=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:m,tags:T}=e.doc.schema;if(T.some(f)||m?.some(f))return so(i,e)}return a?d:cs.foldFlowLines(d,c,cs.FOLD_FLOW,cd(e,!1))}function p$(n,e,t,r){let{implicitKey:s,inFlow:i}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==Wn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Wn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Wn.Scalar.BLOCK_FOLDED:case Wn.Scalar.BLOCK_LITERAL:return s||i?so(o.value,e):ad(o,e,t,r);case Wn.Scalar.QUOTE_DOUBLE:return va(o.value,e);case Wn.Scalar.QUOTE_SINGLE:return _m(o.value,e);case Wn.Scalar.PLAIN:return h$(o,e,t,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=s&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}BE.stringifyString=p$});var _a=w(wm=>{"use strict";var m$=Zu(),ls=ye(),g$=ya(),y$=Ta();function b$(n,e){let t=Object.assign({blockQuote:!0,commentString:g$.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),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function v$(n,e){if(e.tag){let s=n.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,r;if(ls.isScalar(e)){r=e.value;let s=n.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}t=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,t=n.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!t){let s=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${s} value`)}return t}function T$(n,e,{anchors:t,doc:r}){if(!r.directives)return"";let s=[],i=(ls.isScalar(n)||ls.isCollection(n))&&n.anchor;i&&m$.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&s.push(r.directives.tagString(o)),s.join(" ")}function _$(n,e,t,r){if(ls.isPair(n))return n.toString(e,t,r);if(ls.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 s,i=ls.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>s=c});s||(s=v$(e.doc.schema.tags,i));let o=T$(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,t,r):ls.isScalar(i)?y$.stringifyString(i,e,t,r):i.toString(e,t,r);return o?ls.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
+ ${e.indent}${a}`:a}wm.createStringifyContext=b$;wm.stringify=_$});var HE=w(WE=>{"use strict";var Ar=ye(),UE=gt(),VE=_a(),Sa=ya();function S$({key:n,value:e},t,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,f=Ar.isNode(n)&&n.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Ar.isCollection(n)||!Ar.isNode(n)&&typeof n=="object"){let V="With simple keys, collection cannot be used as a key value";throw new Error(V)}}let m=!d&&(!n||f&&e==null&&!t.inFlow||Ar.isCollection(n)||(Ar.isScalar(n)?n.type===UE.Scalar.BLOCK_FOLDED||n.type===UE.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(d||!i),indent:a+c});let T=!1,g=!1,S=VE.stringify(n,t,()=>T=!0,()=>g=!0);if(!m&&!t.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return T&&r&&r(),S===""?"?":m?`? ${S}`:S}else if(i&&!d||e==null&&m)return S=`? ${S}`,f&&!T?S+=Sa.lineComment(S,t.indent,l(f)):g&&s&&s(),S;T&&(f=null),m?(f&&(S+=Sa.lineComment(S,t.indent,l(f))),S=`? ${S}
71
+ ${a}:`):(S=`${S}:`,f&&(S+=Sa.lineComment(S,t.indent,l(f))));let k,v,b;Ar.isNode(e)?(k=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(k=!1,v=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&Ar.isScalar(e)&&(t.indentAtStart=S.length+1),g=!1,!u&&c.length>=2&&!t.inFlow&&!m&&Ar.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let R=!1,O=VE.stringify(e,t,()=>R=!0,()=>g=!0),L=" ";if(f||k||v){if(L=k?`
72
+ `:"",v){let V=l(v);L+=`
73
+ ${Sa.indentComment(V,t.indent)}`}O===""&&!t.inFlow?L===`
74
+ `&&(L=`
75
+
76
+ `):L+=`
77
+ ${t.indent}`}else if(!m&&Ar.isCollection(e)){let V=O[0],j=O.indexOf(`
78
+ `),re=j!==-1,Oe=t.inFlow??e.flow??e.items.length===0;if(re||!Oe){let yt=!1;if(re&&(V==="&"||V==="!")){let de=O.indexOf(" ");V==="&"&&de!==-1&&de<j&&O[de+1]==="!"&&(de=O.indexOf(" ",de+1)),(de===-1||j<de)&&(yt=!0)}yt||(L=`
79
+ ${t.indent}`)}}else(O===""||O[0]===`
80
+ `)&&(L="");return S+=L+O,t.inFlow?R&&r&&r():b&&!R?S+=Sa.lineComment(S,t.indent,l(b)):g&&s&&s(),S}WE.stringifyPair=S$});var Em=w(km=>{"use strict";function w$(n,...e){n==="debug"&&console.log(...e)}function k$(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}km.debug=w$;km.warn=k$});var hd=w(fd=>{"use strict";var wa=ye(),KE=gt(),ud="<<",dd={identify:n=>n===ud||typeof n=="symbol"&&n.description===ud,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new KE.Scalar(Symbol(ud)),{addToJSMap:zE}),stringify:()=>ud},E$=(n,e)=>(dd.identify(e)||wa.isScalar(e)&&(!e.type||e.type===KE.Scalar.PLAIN)&&dd.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===dd.tag&&t.default);function zE(n,e,t){if(t=n&&wa.isAlias(t)?t.resolve(n.doc):t,wa.isSeq(t))for(let r of t.items)Nm(n,e,r);else if(Array.isArray(t))for(let r of t)Nm(n,e,r);else Nm(n,e,t)}function Nm(n,e,t){let r=n&&wa.isAlias(t)?t.resolve(n.doc):t;if(!wa.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,n,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}fd.addMergeToJSMap=zE;fd.isMergeKey=E$;fd.merge=dd});var Rm=w(JE=>{"use strict";var N$=Em(),GE=hd(),P$=_a(),YE=ye(),Pm=os();function R$(n,e,{key:t,value:r}){if(YE.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(GE.isMergeKey(n,t))GE.addMergeToJSMap(n,e,r);else{let s=Pm.toJS(t,"",n);if(e instanceof Map)e.set(s,Pm.toJS(r,s,n));else if(e instanceof Set)e.add(s);else{let i=D$(t,s,n),o=Pm.toJS(r,i,n);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function D$(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(YE.isNode(n)&&t?.doc){let r=P$.createStringifyContext(t.doc,{});r.anchors=new Set;for(let i of t.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=n.toString(r);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),N$.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}JE.addPairToJSMap=R$});var us=w(Dm=>{"use strict";var XE=ga(),C$=HE(),O$=Rm(),pd=ye();function A$(n,e,t){let r=XE.createNode(n,void 0,t),s=XE.createNode(e,void 0,t);return new md(r,s)}var md=class n{constructor(e,t=null){Object.defineProperty(this,pd.NODE_TYPE,{value:pd.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return pd.isNode(t)&&(t=t.clone(e)),pd.isNode(r)&&(r=r.clone(e)),new n(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return O$.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?C$.stringifyPair(this,e,t,r):JSON.stringify(this)}};Dm.Pair=md;Dm.createPair=A$});var Cm=w(ZE=>{"use strict";var Ws=ye(),QE=_a(),gd=ya();function I$(n,e,t){return(e.inFlow??n.flow?$$:M$)(n,e,t)}function M$({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:i,type:null}),d=!1,f=[];for(let T=0;T<e.length;++T){let g=e[T],S=null;if(Ws.isNode(g))!d&&g.spaceBefore&&f.push(""),yd(t,f,g.commentBefore,d),g.comment&&(S=g.comment);else if(Ws.isPair(g)){let v=Ws.isNode(g.key)?g.key:null;v&&(!d&&v.spaceBefore&&f.push(""),yd(t,f,v.commentBefore,d))}d=!1;let k=QE.stringify(g,u,()=>S=null,()=>d=!0);S&&(k+=gd.lineComment(k,i,l(S))),d&&S&&(d=!1),f.push(r+k)}let m;if(f.length===0)m=s.start+s.end;else{m=f[0];for(let T=1;T<f.length;++T){let g=f[T];m+=g?`
81
+ ${c}${g}`:`
82
+ `}}return n?(m+=`
83
+ `+gd.indentComment(l(n),c),a&&a()):d&&o&&o(),m}function $$({items:n},e,{flowChars:t,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let T=0;T<n.length;++T){let g=n[T],S=null;if(Ws.isNode(g))g.spaceBefore&&d.push(""),yd(e,d,g.commentBefore,!1),g.comment&&(S=g.comment);else if(Ws.isPair(g)){let v=Ws.isNode(g.key)?g.key:null;v&&(v.spaceBefore&&d.push(""),yd(e,d,v.commentBefore,!1),v.comment&&(l=!0));let b=Ws.isNode(g.value)?g.value:null;b?(b.comment&&(S=b.comment),b.commentBefore&&(l=!0)):g.value==null&&v?.comment&&(S=v.comment)}S&&(l=!0);let k=QE.stringify(g,c,()=>S=null);T<n.length-1&&(k+=","),S&&(k+=gd.lineComment(k,r,a(S))),!l&&(d.length>u||k.includes(`
84
+ `))&&(l=!0),d.push(k),u=d.length}let{start:f,end:m}=t;if(d.length===0)return f+m;if(!l){let T=d.reduce((g,S)=>g+S.length+2,2);l=e.options.lineWidth>0&&T>e.options.lineWidth}if(l){let T=f;for(let g of d)T+=g?`
85
+ ${i}${s}${g}`:`
86
+ `;return`${T}
87
+ ${s}${m}`}else return`${f}${o}${d.join(" ")}${o}${m}`}function yd({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=gd.indentComment(e(r),n);t.push(i.trimStart())}}ZE.stringifyCollection=I$});var fs=w(Am=>{"use strict";var L$=Cm(),x$=Rm(),q$=sd(),ds=ye(),bd=us(),j$=gt();function ka(n,e){let t=ds.isScalar(e)?e.value:e;for(let r of n)if(ds.isPair(r)&&(r.key===e||r.key===t||ds.isScalar(r.key)&&r.key.value===t))return r}var Om=class extends q$.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ds.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(t,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(bd.createPair(c,l,r))};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 r;ds.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new bd.Pair(e,e?.value):r=new bd.Pair(e.key,e.value);let s=ka(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);ds.isScalar(s.value)&&j$.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=ka(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=ka(this.items,e)?.value;return(!t&&ds.isScalar(s)?s.value:s)??void 0}has(e){return!!ka(this.items,e)}set(e,t){this.add(new bd.Pair(e,t),!0)}toJSON(e,t,r){let s=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)x$.addPairToJSMap(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!ds.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),L$.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};Am.YAMLMap=Om;Am.findPair=ka});var io=w(tN=>{"use strict";var F$=ye(),eN=fs(),B$={collection:"map",default:!0,nodeClass:eN.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return F$.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>eN.YAMLMap.from(n,e,t)};tN.map=B$});var hs=w(nN=>{"use strict";var U$=ga(),V$=Cm(),W$=sd(),Td=ye(),H$=gt(),K$=os(),Im=class extends W$.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Td.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=vd(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=vd(e);if(typeof r!="number")return;let s=this.items[r];return!t&&Td.isScalar(s)?s.value:s}has(e){let t=vd(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=vd(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];Td.isScalar(s)&&H$.isScalarValue(t)?s.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let s=0;for(let i of this.items)r.push(K$.toJS(i,String(s++),t));return r}toString(e,t,r){return e?V$.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let c=t instanceof Set?a:String(o++);a=s.call(t,c,a)}i.items.push(U$.createNode(a,void 0,r))}}return i}};function vd(n){let e=Td.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}nN.YAMLSeq=Im});var oo=w(sN=>{"use strict";var z$=ye(),rN=hs(),G$={collection:"seq",default:!0,nodeClass:rN.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return z$.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>rN.YAMLSeq.from(n,e,t)};sN.seq=G$});var Ea=w(iN=>{"use strict";var Y$=Ta(),J$={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),Y$.stringifyString(n,e,t,r)}};iN.string=J$});var _d=w(cN=>{"use strict";var oN=gt(),aN={identify:n=>n==null,createNode:()=>new oN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new oN.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&aN.test.test(n)?n:e.options.nullStr};cN.nullTag=aN});var Mm=w(uN=>{"use strict";var X$=gt(),lN={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new X$.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&lN.test.test(n)){let r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};uN.boolTag=lN});var ao=w(dN=>{"use strict";function Q$({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}dN.stringifyNumber=Q$});var Lm=w(Sd=>{"use strict";var Z$=gt(),$m=ao(),e1={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:$m.stringifyNumber},t1={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():$m.stringifyNumber(n)}},n1={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 Z$.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:$m.stringifyNumber};Sd.float=n1;Sd.floatExp=t1;Sd.floatNaN=e1});var qm=w(kd=>{"use strict";var fN=ao(),wd=n=>typeof n=="bigint"||Number.isInteger(n),xm=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function hN(n,e,t){let{value:r}=n;return wd(r)&&r>=0?t+r.toString(e):fN.stringifyNumber(n)}var r1={identify:n=>wd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>xm(n,2,8,t),stringify:n=>hN(n,8,"0o")},s1={identify:wd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>xm(n,0,10,t),stringify:fN.stringifyNumber},i1={identify:n=>wd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>xm(n,2,16,t),stringify:n=>hN(n,16,"0x")};kd.int=s1;kd.intHex=i1;kd.intOct=r1});var mN=w(pN=>{"use strict";var o1=io(),a1=_d(),c1=oo(),l1=Ea(),u1=Mm(),jm=Lm(),Fm=qm(),d1=[o1.map,c1.seq,l1.string,a1.nullTag,u1.boolTag,Fm.intOct,Fm.int,Fm.intHex,jm.floatNaN,jm.floatExp,jm.float];pN.schema=d1});var bN=w(yN=>{"use strict";var f1=gt(),h1=io(),p1=oo();function gN(n){return typeof n=="bigint"||Number.isInteger(n)}var Ed=({value:n})=>JSON.stringify(n),m1=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ed},{identify:n=>n==null,createNode:()=>new f1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ed},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ed},{identify:gN,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})=>gN(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:Ed}],g1={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},y1=[h1.map,p1.seq].concat(m1,g1);yN.schema=y1});var Um=w(vN=>{"use strict";var Bm=gt(),b1=Ta(),v1={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,"")),r=new Uint8Array(t.length);for(let s=0;s<t.length;++s)r[s]=t.charCodeAt(s);return r}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},r,s,i){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=Bm.Scalar.BLOCK_LITERAL),e!==Bm.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===Bm.Scalar.BLOCK_LITERAL?`
88
+ `:" ")}return b1.stringifyString({comment:n,type:e,value:a},r,s,i)}};vN.binary=v1});var Rd=w(Pd=>{"use strict";var Nd=ye(),Vm=us(),T1=gt(),_1=hs();function TN(n,e){if(Nd.isSeq(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!Nd.isPair(r)){if(Nd.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new Vm.Pair(new T1.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
89
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
90
+ ${i.comment}`:r.comment}r=s}n.items[t]=Nd.isPair(r)?r:new Vm.Pair(r)}}else e("Expected a sequence for this tag");return n}function _N(n,e,t){let{replacer:r}=t,s=new _1.YAMLSeq(n);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),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;s.items.push(Vm.createPair(a,c,t))}return s}var S1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:TN,createNode:_N};Pd.createPairs=_N;Pd.pairs=S1;Pd.resolvePairs=TN});var Km=w(Hm=>{"use strict";var SN=ye(),Wm=os(),Na=fs(),w1=hs(),wN=Rd(),Hs=class n extends w1.YAMLSeq{constructor(){super(),this.add=Na.YAMLMap.prototype.add.bind(this),this.delete=Na.YAMLMap.prototype.delete.bind(this),this.get=Na.YAMLMap.prototype.get.bind(this),this.has=Na.YAMLMap.prototype.has.bind(this),this.set=Na.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let s of this.items){let i,o;if(SN.isPair(s)?(i=Wm.toJS(s.key,"",t),o=Wm.toJS(s.value,i,t)):i=Wm.toJS(s,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let s=wN.createPairs(e,t,r),i=new this;return i.items=s.items,i}};Hs.tag="tag:yaml.org,2002:omap";var k1={collection:"seq",identify:n=>n instanceof Map,nodeClass:Hs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=wN.resolvePairs(n,e),r=[];for(let{key:s}of t.items)SN.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Hs,t)},createNode:(n,e,t)=>Hs.from(n,e,t)};Hm.YAMLOMap=Hs;Hm.omap=k1});var RN=w(zm=>{"use strict";var kN=gt();function EN({value:n,source:e},t){return e&&(n?NN:PN).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var NN={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 kN.Scalar(!0),stringify:EN},PN={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 kN.Scalar(!1),stringify:EN};zm.falseTag=PN;zm.trueTag=NN});var DN=w(Dd=>{"use strict";var E1=gt(),Gm=ao(),N1={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:Gm.stringifyNumber},P1={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():Gm.stringifyNumber(n)}},R1={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 E1.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Gm.stringifyNumber};Dd.float=R1;Dd.floatExp=P1;Dd.floatNaN=N1});var ON=w(Ra=>{"use strict";var CN=ao(),Pa=n=>typeof n=="bigint"||Number.isInteger(n);function Cd(n,e,t,{intAsBigInt:r}){let s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){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 s==="-"?BigInt(-1)*o:o}let i=parseInt(n,t);return s==="-"?-1*i:i}function Ym(n,e,t){let{value:r}=n;if(Pa(r)){let s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return CN.stringifyNumber(n)}var D1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Cd(n,2,2,t),stringify:n=>Ym(n,2,"0b")},C1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Cd(n,1,8,t),stringify:n=>Ym(n,8,"0")},O1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Cd(n,0,10,t),stringify:CN.stringifyNumber},A1={identify:Pa,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Cd(n,2,16,t),stringify:n=>Ym(n,16,"0x")};Ra.int=O1;Ra.intBin=D1;Ra.intHex=A1;Ra.intOct=C1});var Xm=w(Jm=>{"use strict";var Id=ye(),Od=us(),Ad=fs(),Ks=class n extends Ad.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Id.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Od.Pair(e.key,null):t=new Od.Pair(e,null),Ad.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=Ad.findPair(this.items,e);return!t&&Id.isPair(r)?Id.isScalar(r.key)?r.key.value:r.key:r}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 r=Ad.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new Od.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(Od.createPair(o,null,r));return i}};Ks.tag="tag:yaml.org,2002:set";var I1={collection:"map",identify:n=>n instanceof Set,nodeClass:Ks,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Ks.from(n,e,t),resolve(n,e){if(Id.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new Ks,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};Jm.YAMLSet=Ks;Jm.set=I1});var Zm=w(Md=>{"use strict";var M1=ao();function Qm(n,e){let t=n[0],r=t==="-"||t==="+"?n.substring(1):n,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function AN(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return M1.stringifyNumber(n);let r="";e<0&&(r="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var $1={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})=>Qm(n,t),stringify:AN},L1={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=>Qm(n,!1),stringify:AN},IN={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(IN.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Qm(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$/,"")};Md.floatTime=L1;Md.intTime=$1;Md.timestamp=IN});var LN=w($N=>{"use strict";var x1=io(),q1=_d(),j1=oo(),F1=Ea(),B1=Um(),MN=RN(),eg=DN(),$d=ON(),U1=hd(),V1=Km(),W1=Rd(),H1=Xm(),tg=Zm(),K1=[x1.map,j1.seq,F1.string,q1.nullTag,MN.trueTag,MN.falseTag,$d.intBin,$d.intOct,$d.int,$d.intHex,eg.floatNaN,eg.floatExp,eg.float,B1.binary,U1.merge,V1.omap,W1.pairs,H1.set,tg.intTime,tg.floatTime,tg.timestamp];$N.schema=K1});var KN=w(sg=>{"use strict";var FN=io(),z1=_d(),BN=oo(),G1=Ea(),Y1=Mm(),ng=Lm(),rg=qm(),J1=mN(),X1=bN(),UN=Um(),Da=hd(),VN=Km(),WN=Rd(),xN=LN(),HN=Xm(),Ld=Zm(),qN=new Map([["core",J1.schema],["failsafe",[FN.map,BN.seq,G1.string]],["json",X1.schema],["yaml11",xN.schema],["yaml-1.1",xN.schema]]),jN={binary:UN.binary,bool:Y1.boolTag,float:ng.float,floatExp:ng.floatExp,floatNaN:ng.floatNaN,floatTime:Ld.floatTime,int:rg.int,intHex:rg.intHex,intOct:rg.intOct,intTime:Ld.intTime,map:FN.map,merge:Da.merge,null:z1.nullTag,omap:VN.omap,pairs:WN.pairs,seq:BN.seq,set:HN.set,timestamp:Ld.timestamp},Q1={"tag:yaml.org,2002:binary":UN.binary,"tag:yaml.org,2002:merge":Da.merge,"tag:yaml.org,2002:omap":VN.omap,"tag:yaml.org,2002:pairs":WN.pairs,"tag:yaml.org,2002:set":HN.set,"tag:yaml.org,2002:timestamp":Ld.timestamp};function Z1(n,e,t){let r=qN.get(e);if(r&&!n)return t&&!r.includes(Da.merge)?r.concat(Da.merge):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{let i=Array.from(qN.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(Da.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?jN[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(jN).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}sg.coreKnownTags=Q1;sg.getTags=Z1});var ag=w(zN=>{"use strict";var ig=ye(),eL=io(),tL=oo(),nL=Ea(),xd=KN(),rL=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,og=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?xd.getTags(e,"compat"):e?xd.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?xd.coreKnownTags:{},this.tags=xd.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,ig.MAP,{value:eL.map}),Object.defineProperty(this,ig.SCALAR,{value:nL.string}),Object.defineProperty(this,ig.SEQ,{value:tL.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?rL:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};zN.Schema=og});var YN=w(GN=>{"use strict";var sL=ye(),cg=_a(),Ca=ya();function iL(n,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");let s=cg.createStringifyContext(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=i(n.commentBefore);t.unshift(Ca.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(sL.isNode(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){let u=i(n.contents.commentBefore);t.push(Ca.indentComment(u,""))}s.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=cg.stringify(n.contents,s,()=>a=null,c);a&&(l+=Ca.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(cg.stringify(n.contents,s));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
91
+ `)?(t.push("..."),t.push(Ca.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(Ca.indentComment(i(c),"")))}return t.join(`
92
92
  `)+`
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},y=aC.createNode(e,u,_);return a&&Gt.isCollection(y)&&(y.flow=!0),p(),y}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
- `),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+=`:
93
+ `}GN.stringifyDocument=iL});var Oa=w(JN=>{"use strict";var oL=ma(),co=sd(),En=ye(),aL=us(),cL=os(),lL=ag(),uL=YN(),lg=Zu(),dL=hm(),fL=ga(),ug=fm(),dg=class n{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:r===void 0&&t&&(r=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ug.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(n.prototype,{[En.NODE_TYPE]:{value:En.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=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){lo(this.contents)&&this.contents.add(e)}addIn(e,t){lo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=lg.anchorNames(this);e.anchor=!t||r.has(t)?lg.findNewAnchor(t||"a",r):t}return new oL.Alias(e.anchor)}createNode(e,t,r){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let S=v=>typeof v=="number"||v instanceof String||v instanceof Number,k=t.filter(S).map(String);k.length>0&&(t=t.concat(k)),s=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:m}=lg.createNodeAnchors(this,o||"a"),T={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=fL.createNode(e,u,T);return a&&En.isCollection(g)&&(g.flow=!0),f(),g}createPair(e,t,r={}){let s=this.createNode(e,null,r),i=this.createNode(t,null,r);return new aL.Pair(s,i)}delete(e){return lo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return co.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):lo(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return En.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return co.isEmptyPath(e)?!t&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return co.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=co.collectionFromPath(this.schema,[e],t):lo(this.contents)&&this.contents.set(e,t)}setIn(e,t){co.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=co.collectionFromPath(this.schema,Array.from(e),t):lo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ug.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ug.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new lL.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=cL.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?dL.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 uL.stringifyDocument(this,e)}};function lo(n){if(En.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}JN.Document=dg});var Ma=w(Ia=>{"use strict";var Aa=class extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}},fg=class extends Aa{constructor(e,t,r){super("YAMLParseError",e,t,r)}},hg=class extends Aa{constructor(e,t,r){super("YAMLWarning",e,t,r)}},hL=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:s}=t.linePos[0];t.message+=` at line ${r}, column ${s}`;let i=s-1,o=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
94
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);t.message+=`:
95
95
 
96
96
  ${o}
97
97
  ${l}
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,y=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),y&&(l&&j.type!=="comment"&&j.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),j.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&j.source.includes(" ")&&(y=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"),y&&(l&&y.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(y,"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,y=sk.resolveProps(d,{indicator:"explicit-key-ind",next:p??g?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),w=!y.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)),!y.anchor&&!y.tag&&!g){l=y.end,y.comment&&(a.comment?a.comment+=`
100
- `+y.comment:a.comment=y.comment);continue}(y.newlineAfterProp||pC.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==i.indent&&r(c,"BAD_INDENT",ak);t.atKey=!0;let R=y.end,v=p?n(t,p,y,r):e(t,R,d,null,y,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&&y.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,y=d;if(g&&g.source===p)y=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(_,y,t.options.strict,r);w.comment&&(l.comment?l.comment+=`
105
- `+w.comment:l.comment=w.comment),l.range=[i.offset,y,w.offset]}else l.range=[i.offset,y,y];return l}mk.resolveFlowCollection=DC});var bk=C(yk=>{"use strict";var RC=le(),CC=Je(),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=Je();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 y=o.length-1;y>=0;--y){let w=o[y][1];if(w===""||w==="\r")a=y;else break}if(a===0){let y=r.chomp==="+"&&o.length>0?`
106
- `.repeat(Math.max(1,o.length-1)):"",w=i+r.length;return e.source&&(w+=e.source.length),{value:y,type:s,comment:r.comment,range:[i,w,w]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let y=0;y<a;++y){let[w,R]=o[y];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=y,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 y=o.length-1;y>=a;--y)o[y][0].length>c&&(a=y+1);let d="",p="",g=!1;for(let y=0;y<u;++y)d+=o[y][0].slice(c)+`
107
- `;for(let y=u;y<a;++y){let[w,R]=o[y];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
- `):w.length>c||R[0]===" "?(p===" "?p=`
109
- `:!g&&p===`
110
- `&&(p=`
111
-
112
- `),d+=p+w.slice(c)+R,p=`
113
- `,g=!0):R===""?p===`
98
+ `}};Ia.YAMLError=Aa;Ia.YAMLParseError=fg;Ia.YAMLWarning=hg;Ia.prettifyError=hL});var $a=w(XN=>{"use strict";function pL(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",m=!1,T=!1,g=null,S=null,k=null,v=null,b=null,R=null,O=null;for(let j of n)switch(T&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&i(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T=!1),g&&(l&&j.type!=="comment"&&j.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),j.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&j.source.includes(" ")&&(g=j),u=!0;break;case"comment":{u||i(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let re=j.source.substring(1)||" ";d?d+=f+re:d=re,f="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:f+=j.source,l=!0,m=!0,(S||k)&&(v=j),u=!0;break;case"anchor":S&&i(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&i(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=j,O===null&&(O=j.offset),l=!1,u=!1,T=!0;break;case"tag":{k&&i(j,"MULTIPLE_TAGS","A node can have at most one tag"),k=j,O===null&&(O=j.offset),l=!1,u=!1,T=!0;break}case t:(S||k)&&i(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),R&&i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),R=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&i(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=j,l=!1,u=!1;break}default:i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let L=n[n.length-1],V=L?L.offset+L.source.length:s;return T&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:R,spaceBefore:c,comment:d,hasNewline:m,anchor:S,tag:k,newlineAfterProp:v,end:V,start:O??V}}XN.resolveProps=pL});var qd=w(QN=>{"use strict";function pg(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(pg(e.key)||pg(e.value))return!0}return!1;default:return!0}}QN.containsNewline=pg});var mg=w(ZN=>{"use strict";var mL=qd();function gL(n,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&mL.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ZN.flowIndentCheck=gL});var gg=w(tP=>{"use strict";var eP=ye();function yL(n,e,t){let{uniqueKeys:r}=n.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||eP.isScalar(i)&&eP.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}tP.mapIncludes=yL});var aP=w(oP=>{"use strict";var nP=us(),bL=fs(),rP=$a(),vL=qd(),sP=mg(),TL=gg(),iP="All mapping items must start at the same column";function _L({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??bL.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:m,value:T}=u,g=rP.resolveProps(d,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!g.found;if(S){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&s(c,"BAD_INDENT",iP)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
100
+ `+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||vL.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",iP);t.atKey=!0;let k=g.end,v=f?n(t,f,g,s):e(t,k,d,null,g,s);t.schema.compat&&sP.flowIndentCheck(r.indent,f,s),t.atKey=!1,TL.mapIncludes(t,a.items,v)&&s(k,"DUPLICATE_KEY","Map keys must be unique");let b=rP.resolveProps(m??[],{indicator:"map-value-ind",next:T,offset:v.range[2],onError:s,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=b.end,b.found){S&&(T?.type==="block-map"&&!b.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&g.start<b.found.offset-1024&&s(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=T?n(t,T,b,s):e(t,c,m,null,b,s);t.schema.compat&&sP.flowIndentCheck(r.indent,T,s),c=R.range[2];let O=new nP.Pair(v,R);t.options.keepSourceTokens&&(O.srcToken=u),a.items.push(O)}else{S&&s(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(v.comment?v.comment+=`
101
+ `+b.comment:v.comment=b.comment);let R=new nP.Pair(v);t.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}oP.resolveBlockMap=_L});var lP=w(cP=>{"use strict";var SL=hs(),wL=$a(),kL=mg();function EL({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??SL.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=wL.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let m=d?n(t,d,f,s):e(t,f.end,u,null,f,s);t.schema.compat&&kL.flowIndentCheck(r.indent,d,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}cP.resolveBlockSeq=EL});var uo=w(uP=>{"use strict";function NL(n,e,t,r){let s="";if(n){let i=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}uP.resolveEnd=NL});var pP=w(hP=>{"use strict";var PL=ye(),RL=us(),dP=fs(),DL=hs(),CL=uo(),fP=$a(),OL=qd(),AL=gg(),yg="Block collections are not allowed within flow collections",bg=n=>n&&(n.type==="block-map"||n.type==="block-seq");function IL({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?dP.YAMLMap:DL.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){let k=r.items[S],{start:v,key:b,sep:R,value:O}=k,L=fP.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:b??R?.[0],offset:d,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!R&&!O){S===0&&L.comma?s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<r.items.length-1&&s(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(l.comment?l.comment+=`
102
+ `+L.comment:l.comment=L.comment),d=L.end;continue}!o&&t.options.strict&&OL.containsNewline(b)&&s(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)L.comma&&s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||s(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let V="";e:for(let j of v)switch(j.type){case"comma":case"space":break;case"comment":V=j.source.substring(1);break e;default:break e}if(V){let j=l.items[l.items.length-1];PL.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
103
+ `+V:j.comment=V,L.comment=L.comment.substring(V.length+1)}}if(!o&&!R&&!L.found){let V=O?n(t,O,L,s):e(t,L.end,R,null,L,s);l.items.push(V),d=V.range[2],bg(O)&&s(V.range,"BLOCK_IN_FLOW",yg)}else{t.atKey=!0;let V=L.end,j=b?n(t,b,L,s):e(t,V,v,null,L,s);bg(b)&&s(j.range,"BLOCK_IN_FLOW",yg),t.atKey=!1;let re=fP.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:O,offset:j.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(re.found){if(!o&&!L.found&&t.options.strict){if(R)for(let de of R){if(de===re.found)break;if(de.type==="newline"){s(de,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<re.found.offset-1024&&s(re.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source&&O.source[0]===":"?s(O,"MISSING_CHAR",`Missing space after : in ${a}`):s(re.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Oe=O?n(t,O,re,s):re.found?e(t,re.end,R,null,re,s):null;Oe?bg(O)&&s(Oe.range,"BLOCK_IN_FLOW",yg):re.comment&&(j.comment?j.comment+=`
104
+ `+re.comment:j.comment=re.comment);let yt=new RL.Pair(j,Oe);if(t.options.keepSourceTokens&&(yt.srcToken=k),o){let de=l;AL.mapIncludes(t,de.items,j)&&s(V,"DUPLICATE_KEY","Map keys must be unique"),de.items.push(yt)}else{let de=new dP.YAMLMap(t.schema);de.flow=!0,de.items.push(yt);let yn=(Oe??j).range;de.range=[j.range[0],yn[1],yn[2]],l.items.push(de)}d=Oe?Oe.range[2]:re.end}}let f=o?"}":"]",[m,...T]=r.end,g=d;if(m&&m.source===f)g=m.offset+m.source.length;else{let S=a[0].toUpperCase()+a.substring(1),k=u?`${S} must end with a ${f}`:`${S} in block collection must be sufficiently indented and end with a ${f}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&T.unshift(m)}if(T.length>0){let S=CL.resolveEnd(T,g,t.options.strict,s);S.comment&&(l.comment?l.comment+=`
105
+ `+S.comment:l.comment=S.comment),l.range=[r.offset,g,S.offset]}else l.range=[r.offset,g,g];return l}hP.resolveFlowCollection=IL});var gP=w(mP=>{"use strict";var ML=ye(),$L=gt(),LL=fs(),xL=hs(),qL=aP(),jL=lP(),FL=pP();function vg(n,e,t,r,s,i){let o=t.type==="block-map"?qL.resolveBlockMap(n,e,t,r,i):t.type==="block-seq"?jL.resolveBlockSeq(n,e,t,r,i):FL.resolveFlowCollection(n,e,t,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function BL(n,e,t,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=r,T=f&&i?f.offset>i.offset?f:i:f??i;T&&(!m||m.offset<T.offset)&&s(T,"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(!i||!o||o==="!"||o===LL.YAMLMap.tagName&&a==="map"||o===xL.YAMLSeq.tagName&&a==="seq")return vg(n,e,t,s,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vg(n,e,t,s,o)}let l=vg(n,e,t,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=ML.isNode(u)?u:new $L.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}mP.composeCollection=BL});var _g=w(yP=>{"use strict";var Tg=gt();function UL(n,e,t){let r=e.offset,s=VL(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?Tg.Scalar.BLOCK_FOLDED:Tg.Scalar.BLOCK_LITERAL,o=e.source?WL(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let S=o[g][1];if(S===""||S==="\r")a=g;else break}if(a===0){let g=s.chomp==="+"&&o.length>0?`
106
+ `.repeat(Math.max(1,o.length-1)):"",S=r+s.length;return e.source&&(S+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,S,S]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let g=0;g<a;++g){let[S,k]=o[g];if(k===""||k==="\r")s.indent===0&&S.length>c&&(c=S.length);else{S.length<c&&t(l+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=S.length),u=g,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=S.length+k.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let d="",f="",m=!1;for(let g=0;g<u;++g)d+=o[g][0].slice(c)+`
107
+ `;for(let g=u;g<a;++g){let[S,k]=o[g];l+=S.length+k.length+1;let v=k[k.length-1]==="\r";if(v&&(k=k.slice(0,-1)),k&&S.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-k.length-(v?2:1),"BAD_INDENT",R),S=""}i===Tg.Scalar.BLOCK_LITERAL?(d+=f+S.slice(c)+k,f=`
108
+ `):S.length>c||k[0]===" "?(f===" "?f=`
109
+ `:!m&&f===`
110
+ `&&(f=`
111
+
112
+ `),d+=f+S.slice(c)+k,f=`
113
+ `,m=!0):k===""?f===`
114
114
  `?d+=`
115
- `:p=`
116
- `:(d+=p+R,p=" ",g=!1)}switch(r.chomp){case"-":break;case"+":for(let y=a;y<o.length;++y)d+=`
117
- `+o[y][0].slice(c);d[d.length-1]!==`
115
+ `:f=`
116
+ `:(d+=f+k,f=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)d+=`
117
+ `+o[g][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 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 y=g.source;y&&typeof y=="string"&&(d+=y.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=Je(),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?
120
+ `}let T=r+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[r,T,T]}}function VL({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let f=1;f<s.length;++f){let m=s[f];if(!a&&(m==="-"||m==="+"))a=m;else{let T=Number(m);!o&&T?o=T:c===-1&&(c=n+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",d=s.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":l=!0;case"newline":d+=m.source.length;break;case"comment":t&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let T=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",T);let g=m.source;g&&typeof g=="string"&&(d+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function WL(n){let e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),i=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}yP.resolveBlockScalar=UL});var wg=w(vP=>{"use strict";var Sg=gt(),HL=uo();function KL(n,e,t){let{offset:r,type:s,source:i,end:o}=n,a,c,l=(f,m,T)=>t(r+f,m,T);switch(s){case"scalar":a=Sg.Scalar.PLAIN,c=zL(i,l);break;case"single-quoted-scalar":a=Sg.Scalar.QUOTE_SINGLE,c=GL(i,l);break;case"double-quoted-scalar":a=Sg.Scalar.QUOTE_DOUBLE,c=YL(i,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,d=HL.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function zL(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}`),bP(n)}function GL(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),bP(n.slice(1,-1)).replace(/''/g,"'")}function bP(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
121
121
  `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
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
- `?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 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
- `))if(r===`
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
- `)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+=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
- `&&!(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 HC(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
131
- `||i==="\r")&&!(i==="\r"&&n[e+2]!==`
132
- `);)i===`
122
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let s=r[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(n);)r[1]===""?i===`
123
+ `?s+=i:i=`
124
+ `:(s+=i+r[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(n),s+i+(r?.[1]??"")}function YL(n,e){let t="";for(let r=1;r<n.length-1;++r){let s=n[r];if(!(s==="\r"&&n[r+1]===`
125
+ `))if(s===`
126
+ `){let{fold:i,offset:o}=JL(n,r);t+=i,r=o}else if(s==="\\"){let i=n[++r],o=XL[i];if(o)t+=o;else if(i===`
127
+ `)for(i=n[r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="\r"&&n[r+1]===`
128
+ `)for(i=n[++r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=QL(n,r+1,a,e),r+=a}else{let a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=r,o=n[r+1];for(;o===" "||o===" ";)o=n[++r+1];o!==`
129
+ `&&!(o==="\r"&&n[r+2]===`
130
+ `)&&(t+=r>i?n.slice(i,r+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function JL(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
131
+ `||r==="\r")&&!(r==="\r"&&n[e+2]!==`
132
+ `);)r===`
133
133
  `&&(t+=`
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=Je(),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?`
134
+ `),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}var XL={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 QL(n,e,t,r){let s=n.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}vP.resolveFlowScalar=KL});var SP=w(_P=>{"use strict";var zs=ye(),TP=gt(),ZL=_g(),ex=wg();function tx(n,e,t,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?ZL.resolveBlockScalar(n,e,r):ex.resolveFlowScalar(e,n.options.strict,r),c=t?n.directives.tagName(t.source,d=>r(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[zs.SCALAR]:c?l=nx(n.schema,s,c,t,r):e.type==="scalar"?l=rx(n,s,e,r):l=n.schema[zs.SCALAR];let u;try{let d=l.resolve(s,f=>r(t??e,"TAG_RESOLVE_FAILED",f),n.options);u=zs.isScalar(d)?d:new TP.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(t??e,"TAG_RESOLVE_FAILED",f),u=new TP.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function nx(n,e,t,r,s){if(t==="!")return n[zs.SCALAR];let i=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)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):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[zs.SCALAR])}function rx({atKey:n,directives:e,schema:t},r,s,i){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[zs.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(r))??t[zs.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}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}_P.composeScalar=tx});var kP=w(wP=>{"use strict";function sx(n,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++r];s?.type==="space";)n+=s.source.length,s=e[++r];break}}return n}wP.emptyScalarPosition=sx});var PP=w(Eg=>{"use strict";var ix=ma(),ox=ye(),ax=gP(),EP=SP(),cx=uo(),lx=kP(),ux={composeNode:NP,composeEmptyNode:kg};function NP(n,e,t,r){let s=n.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=dx(n,e,r),(a||c)&&r(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=EP.composeScalar(n,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=ax.composeCollection(ux,n,e,t,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=kg(n,e.offset,void 0,null,t,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!ox.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function kg(n,e,t,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:lx.emptyScalarPosition(e,t,r),indent:-1,source:""},d=EP.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")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function dx({options:n},{offset:e,source:t,end:r},s){let i=new ix.Alias(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=cx.resolveEnd(r,o,n.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Eg.composeEmptyNode=kg;Eg.composeNode=NP});var CP=w(DP=>{"use strict";var fx=Oa(),RP=PP(),hx=uo(),px=$a();function mx(n,e,{offset:t,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},n),c=new fx.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=px.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?RP.composeNode(l,s,u,o):RP.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=hx.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,d,f.offset],c}DP.composeDoc=mx});var Pg=w(IP=>{"use strict";var gx=fm(),yx=Oa(),La=Ma(),OP=ye(),bx=CP(),vx=uo();function xa(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 AP(n){let e="",t=!1,r=!1;for(let s=0;s<n.length;++s){let i=n[s];switch(i[0]){case"#":e+=(e===""?"":r?`
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 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
- ${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: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:`
138
+ `)+(i.substring(1)||" "),t=!0,r=!1;break;case"%":n[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var Ng=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,s,i)=>{let o=xa(t);i?this.warnings.push(new La.YAMLWarning(o,r,s)):this.errors.push(new La.YAMLParseError(o,r,s))},this.directives=new gx.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:s}=AP(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
139
+ ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(OP.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];OP.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
140
+ ${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
141
+ ${o}`:r}}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:AP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,s)=>{let i=xa(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=bx.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,r=new La.YAMLParseError(xa(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new La.YAMLParseError(xa(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=vx.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
142
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new La.YAMLParseError(xa(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 r=Object.assign({_directives:this.directives},this.options),s=new yx.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};IP.Composer=Ng});var LP=w(jd=>{"use strict";var Tx=_g(),_x=wg(),Sx=Ma(),MP=Ta();function wx(n,e=!0,t){if(n){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,i,o);else throw new Sx.YAMLParseError([a,a+1],i,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return _x.resolveFlowScalar(n,e,r);case"block-scalar":return Tx.resolveBlockScalar({options:{strict:e}},n,r)}}return null}function kx(n,e){let{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=MP.stringifyString({type:o,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,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 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
- `),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}];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`
145
+ `,f=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return $P(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
146
+ `}),{type:"block-scalar",offset:i,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function Ex(n,e,t={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in n?n.indent:null;if(r&&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=MP.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Nx(n,c);break;case'"':Rg(n,c,"double-quoted-scalar");break;case"'":Rg(n,c,"single-quoted-scalar");break;default:Rg(n,c,"scalar")}}function Nx(n,e){let t=e.indexOf(`
147
+ `),r=e.substring(0,t),s=e.substring(t+1)+`
148
+ `;if(n.type==="block-scalar"){let i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,n.source=s}else{let{offset:i}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];$P(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:s})}}function $P(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 Rg(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 r=n.props.slice(1),s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(let i of r)i.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
150
+ `};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{let r="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:r,source:e,end:s})}}}jd.createScalarToken=kx;jd.resolveAsScalar=wx;jd.setScalarValue=Ex});var qP=w(xP=>{"use strict";var Px=n=>"type"in n?Bd(n):Fd(n);function Bd(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Bd(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Fd(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Fd(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Fd(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 Fd({start:n,key:e,sep:t,value:r}){let s="";for(let i of n)s+=i.source;if(e&&(s+=Bd(e)),t)for(let i of t)s+=i.source;return r&&(s+=Bd(r)),s}xP.stringify=Px});var UP=w(BP=>{"use strict";var Dg=Symbol("break visit"),Rx=Symbol("skip children"),jP=Symbol("remove item");function Gs(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),FP(Object.freeze([]),n,e)}Gs.BREAK=Dg;Gs.SKIP=Rx;Gs.REMOVE=jP;Gs.itemAtPath=(n,e)=>{let t=n;for(let[r,s]of e){let i=t?.[r];if(i&&"items"in i)t=i.items[s];else return}return t};Gs.parentCollection=(n,e)=>{let t=Gs.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],s=t?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function FP(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=FP(Object.freeze(n.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Dg)return Dg;a===jP&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}BP.visit=Gs});var Ud=w(sn=>{"use strict";var Cg=LP(),Dx=qP(),Cx=UP(),Og="\uFEFF",Ag="",Ig="",Mg="",Ox=n=>!!n&&"items"in n,Ax=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Ix(n){switch(n){case Og:return"<BOM>";case Ag:return"<DOC>";case Ig:return"<FLOW_END>";case Mg:return"<SCALAR>";default:return JSON.stringify(n)}}function Mx(n){switch(n){case Og:return"byte-order-mark";case Ag:return"doc-mode";case Ig:return"flow-error-end";case Mg: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=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===`
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}sn.createScalarToken=Cg.createScalarToken;sn.resolveAsScalar=Cg.resolveAsScalar;sn.setScalarValue=Cg.setScalarValue;sn.stringify=Dx.stringify;sn.visit=Cx.visit;sn.BOM=Og;sn.DOCUMENT=Ag;sn.FLOW_END=Ig;sn.SCALAR=Mg;sn.isCollection=Ox;sn.isScalar=Ax;sn.prettyToken=Ix;sn.tokenType=Mx});var xg=w(WP=>{"use strict";var qa=Ud();function Hn(n){switch(n){case void 0:case" ":case`
153
+ `:case"\r":case" ":return!0;default:return!1}}var VP=new Set("0123456789ABCDEFabcdef"),$x=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vd=new Set(",[]{}"),Lx=new Set(` ,[]{}
154
+ \r `),$g=n=>!n||Lx.has(n),Lg=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 r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}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
- `:!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
- `||!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==="...")&&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
- `,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=>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
- `: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
- `)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
- `,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
- `;)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 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
- `?(i+=1,r=`
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===`
156
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let s=this.buffer[r+e+1];if(s===`
157
+ `||!s&&!this.atEnd)return e+r+1}return t===`
158
+ `||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Hn(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]===qa.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),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 qa.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==="...")&&Hn(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&&!Hn(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===":")&&Hn(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,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($g),"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,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Hn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield qa.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"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($g),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Hn(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 i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),s=r.indexOf(`
160
+ `,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
161
+ `,i)}s!==-1&&(t=s-(r[s-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=>Hn(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
162
+ `:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
163
+ `)break}default:break e}if(!r&&!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 i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
164
+ `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
165
+ `;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
166
+ `&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield qa.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(Hn(i)||e&&Vd.has(i))break;t=r}else if(Hn(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
167
+ `?(r+=1,s=`
168
+ `,i=this.buffer[r+1]):t=r),i==="#"||e&&Vd.has(i))break;if(s===`
169
+ `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Vd.has(s))break;t=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield qa.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 r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.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($g))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Hn(t)||e&&Vd.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(;!Hn(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($x.has(t))t=this.buffer[++e];else if(t==="%"&&VP.has(this.buffer[e+1])&&VP.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)}};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(`
171
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};WP.Lexer=Lg});var jg=w(HP=>{"use strict";var qg=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let i=t+r>>1;this.lineStarts[i]<e?t=i+1:r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};HP.LineCounter=qg});var Bg=w(JP=>{"use strict";var KP=Ud(),xx=xg();function Ys(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function zP(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 YP(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 Wd(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 fo(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 GP(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!Ys(e.start,"explicit-key-ind")&&!Ys(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,YP(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 Fg=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 xx.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",KP.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=KP.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 r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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 r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&GP(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&zP(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.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":{zP(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=Wd(this.peek(2)),r=fo(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}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(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(`
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 r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&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&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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):s||t.value?(i.push(this.sourceToken),e.items.push({start:i,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(Ys(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(YP(t.key)&&!Ys(t.sep,"newline")){let o=fo(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 i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(Ys(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=fo(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||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ys(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);s||t.value?(e.items.push({start:i,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){r&&o.type!=="block-seq"&&e.items.push({start:i}),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 r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.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||Ys(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.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 s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=Wd(r),i=fo(s);GP(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:i,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=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=Je(),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]),y=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=y<_;T&&(R*=-1,v=r0);var N=p.some(n0);g=[];for(var L=_;v(L,y);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),Ve=n=>e=>e?.value&&n===e.value?"yes":G_(n)(e),Se=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()),ze=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 ze?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)}},ke=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}`),Ge=(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=>Ge(l.lastToken))),e instanceof he){let l=e.name&&e.openScope?Ge(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?Ge(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?Ge(e.lastToken.prevToken,0):[];return o.push(...c),o},Z_=(n,e,t,i)=>{let r=[];if(r.push(...Ge(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 ze||n instanceof ai?(n.openBracket&&r.push(...Ge(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(...Ge(n.closeBracket,0))):n?.lastToken&&i&&r.push(...Ge(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?[]:Ge(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?[]:Ge(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(...Ge(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=>Ge(o.lastToken))),n.values){if(n.propertyName){i.push(...Ge(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&i.push(...Ge(a))}i.push(...nP(n.values,e,t))}let s=n.lastToken.value===";"&&n.lastToken.prevToken?Ge(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=Ge(n.keyword.lastToken);i.push(...s);let o=n.lastToken.value===";"&&n.lastToken.prevToken?Ge(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=Ge(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(...Ge(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(...Ge(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(`
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=Wd(e),r=fo(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Wd(e),r=fo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.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())}}};JP.Parser=Fg});var t0=w(Fa=>{"use strict";var XP=Pg(),qx=Oa(),ja=Ma(),jx=Em(),Fx=ye(),Bx=jg(),QP=Bg();function ZP(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Bx.LineCounter||null,prettyErrors:e}}function Ux(n,e={}){let{lineCounter:t,prettyErrors:r}=ZP(e),s=new QP.Parser(t?.addNewLine),i=new XP.Composer(e),o=Array.from(i.compose(s.parse(n)));if(r&&t)for(let a of o)a.errors.forEach(ja.prettifyError(n,t)),a.warnings.forEach(ja.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function e0(n,e={}){let{lineCounter:t,prettyErrors:r}=ZP(e),s=new QP.Parser(t?.addNewLine),i=new XP.Composer(e),o=null;for(let a of i.compose(s.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ja.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(ja.prettifyError(n,t)),o.warnings.forEach(ja.prettifyError(n,t))),o}function Vx(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=e0(n,t);if(!s)return null;if(s.warnings.forEach(i=>jx.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},t))}function Wx(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return Fx.isDocument(n)&&!r?n.toString(t):new qx.Document(n,r,t).toString(t)}Fa.parse=Vx;Fa.parseAllDocuments=Ux;Fa.parseDocument=e0;Fa.stringify=Wx});var Vg=w(De=>{"use strict";var Hx=Pg(),Kx=Oa(),zx=ag(),Ug=Ma(),Gx=ma(),ps=ye(),Yx=us(),Jx=gt(),Xx=fs(),Qx=hs(),Zx=Ud(),eq=xg(),tq=jg(),nq=Bg(),Hd=t0(),n0=da();De.Composer=Hx.Composer;De.Document=Kx.Document;De.Schema=zx.Schema;De.YAMLError=Ug.YAMLError;De.YAMLParseError=Ug.YAMLParseError;De.YAMLWarning=Ug.YAMLWarning;De.Alias=Gx.Alias;De.isAlias=ps.isAlias;De.isCollection=ps.isCollection;De.isDocument=ps.isDocument;De.isMap=ps.isMap;De.isNode=ps.isNode;De.isPair=ps.isPair;De.isScalar=ps.isScalar;De.isSeq=ps.isSeq;De.Pair=Yx.Pair;De.Scalar=Jx.Scalar;De.YAMLMap=Xx.YAMLMap;De.YAMLSeq=Qx.YAMLSeq;De.CST=Zx;De.Lexer=eq.Lexer;De.LineCounter=tq.LineCounter;De.Parser=nq.Parser;De.parse=Hd.parse;De.parseAllDocuments=Hd.parseAllDocuments;De.parseDocument=Hd.parseDocument;De.stringify=Hd.stringify;De.visit=n0.visit;De.visitAsync=n0.visitAsync});var a0=w((IQ,o0)=>{"use strict";o0.exports=s0;function s0(n,e,t){n instanceof RegExp&&(n=r0(n,t)),e instanceof RegExp&&(e=r0(e,t));var r=i0(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}function r0(n,e){var t=e.match(n);return t?t[0]:null}s0.range=i0;function i0(n,e,t){var r,s,i,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(r=[],i=t.length;u>=0&&!a;)u==c?(r.push(u),c=t.indexOf(n,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var m0=w((MQ,p0)=>{var c0=a0();p0.exports=iq;var l0="\0SLASH"+Math.random()+"\0",u0="\0OPEN"+Math.random()+"\0",Hg="\0CLOSE"+Math.random()+"\0",d0="\0COMMA"+Math.random()+"\0",f0="\0PERIOD"+Math.random()+"\0";function Wg(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function rq(n){return n.split("\\\\").join(l0).split("\\{").join(u0).split("\\}").join(Hg).split("\\,").join(d0).split("\\.").join(f0)}function sq(n){return n.split(l0).join("\\").split(u0).join("{").split(Hg).join("}").split(d0).join(",").split(f0).join(".")}function h0(n){if(!n)return[""];var e=[],t=c0("{","}",n);if(!t)return n.split(",");var r=t.pre,s=t.body,i=t.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=h0(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function iq(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Ba(rq(n),!0).map(sq)):[]}function oq(n){return"{"+n+"}"}function aq(n){return/^-?0\d/.test(n)}function cq(n,e){return n<=e}function lq(n,e){return n>=e}function Ba(n,e){var t=[],r=c0("{","}",n);if(!r)return[n];var s=r.pre,i=r.post.length?Ba(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(n=r.pre+"{"+r.body+Hg+r.post,Ba(n)):[n];var f;if(u)f=r.body.split(/\.\./);else if(f=h0(r.body),f.length===1&&(f=Ba(f[0],!1).map(oq),f.length===1))return i.map(function(Oe){return r.pre+f[0]+Oe});var m;if(u){var T=Wg(f[0]),g=Wg(f[1]),S=Math.max(f[0].length,f[1].length),k=f.length==3?Math.abs(Wg(f[2])):1,v=cq,b=g<T;b&&(k*=-1,v=lq);var R=f.some(aq);m=[];for(var O=T;v(O,g);O+=k){var L;if(l)L=String.fromCharCode(O),L==="\\"&&(L="");else if(L=String(O),R){var V=S-L.length;if(V>0){var j=new Array(V+1).join("0");O<0?L="-"+j+L.slice(1):L=j+L}}m.push(L)}}else{m=[];for(var re=0;re<f.length;re++)m.push.apply(m,Ba(f[re],!1))}for(var re=0;re<m.length;re++)for(var o=0;o<i.length;o++){var a=s+m[re]+i[o];(!e||u||a)&&t.push(a)}}return t}});var ic=w(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.regexpCode=ve.getEsmExportName=ve.getProperty=ve.safeStringify=ve.stringify=ve.strConcat=ve.addCodeArg=ve.str=ve._=ve.nil=ve._Code=ve.Name=ve.IDENTIFIER=ve._CodeOrName=void 0;var rc=class{};ve._CodeOrName=rc;ve.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Zs=class extends rc{constructor(e){if(super(),!ve.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ve.Name=Zs;var Dn=class extends rc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>(r instanceof Zs&&(t[r.str]=(t[r.str]||0)+1),t),{})}};ve._Code=Dn;ve.nil=new Dn("");function nR(n,...e){let t=[n[0]],r=0;for(;r<e.length;)uy(t,e[r]),t.push(n[++r]);return new Dn(t)}ve._=nR;var ly=new Dn("+");function rR(n,...e){let t=[sc(n[0])],r=0;for(;r<e.length;)t.push(ly),uy(t,e[r]),t.push(ly,sc(n[++r]));return yj(t),new Dn(t)}ve.str=rR;function uy(n,e){e instanceof Dn?n.push(...e._items):e instanceof Zs?n.push(e):n.push(Tj(e))}ve.addCodeArg=uy;function yj(n){let e=1;for(;e<n.length-1;){if(n[e]===ly){let t=bj(n[e-1],n[e+1]);if(t!==void 0){n.splice(e-1,3,t);continue}n[e++]="+"}e++}}function bj(n,e){if(e==='""')return n;if(n==='""')return e;if(typeof n=="string")return e instanceof Zs||n[n.length-1]!=='"'?void 0:typeof e!="string"?`${n.slice(0,-1)}${e}"`:e[0]==='"'?n.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(n instanceof Zs))return`"${n}${e.slice(1)}`}function vj(n,e){return e.emptyStr()?n:n.emptyStr()?e:rR`${n}${e}`}ve.strConcat=vj;function Tj(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:sc(Array.isArray(n)?n.join(","):n)}function _j(n){return new Dn(sc(n))}ve.stringify=_j;function sc(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ve.safeStringify=sc;function Sj(n){return typeof n=="string"&&ve.IDENTIFIER.test(n)?new Dn(`.${n}`):nR`[${n}]`}ve.getProperty=Sj;function wj(n){if(typeof n=="string"&&ve.IDENTIFIER.test(n))return new Dn(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}ve.getEsmExportName=wj;function kj(n){return new Dn(n.toString())}ve.regexpCode=kj});var hy=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ValueScope=an.ValueScopeName=an.Scope=an.varKinds=an.UsedValueState=void 0;var on=ic(),dy=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ff;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(ff||(an.UsedValueState=ff={}));an.varKinds={const:new on.Name("const"),let:new on.Name("let"),var:new on.Name("var")};var hf=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof on.Name?e:this.name(e)}name(e){return new on.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(!((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};an.Scope=hf;var pf=class extends on.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,on._)`.${new on.Name(t)}[${r}]`}};an.ValueScopeName=pf;var Ej=(0,on._)`\n`,fy=class extends hf{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ej:on.nil}}get(){return this._scope}name(e){return new pf(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,on._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,r)}_reduceValues(e,t,r={},s){let i=on.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ff.Started);let u=t(l);if(u){let d=this.opts.es5?an.varKinds.var:an.varKinds.const;i=(0,on._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,on._)`${i}${u}${this.opts._n}`;else throw new dy(l);c.set(l,ff.Completed)})}return i}};an.ValueScope=fy});var ae=w(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var ge=ic(),Jn=hy(),vs=ic();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return vs.Name}});var bf=hy();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return bf.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return bf.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return bf.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return bf.varKinds}});le.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var $r=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},py=class extends $r{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Jn.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Eo(this.rhs,e,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},mf=class extends $r{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Eo(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return yf(e,this.rhs)}},my=class extends mf{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},gy=class extends $r{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},yy=class extends $r{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},by=class extends $r{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vy=class extends $r{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Eo(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},oc=class extends $r{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,t)||(Nj(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ni(e,t.names),{})}},Lr=class extends oc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Ty=class extends oc{},ko=class extends Lr{};ko.kind="else";var ei=class n extends Lr{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new ko(r):r}if(t)return e===!1?t instanceof n?t:t.nodes:this.nodes.length?this:new n(sR(e),t instanceof n?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Eo(this.condition,e,t),this}get names(){let e=super.names;return yf(e,this.condition),this.else&&ni(e,this.else.names),e}};ei.kind="if";var ti=class extends Lr{};ti.kind="for";var _y=class extends ti{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=Eo(this.iteration,e,t),this}get names(){return ni(super.names,this.iteration.names)}},Sy=class extends ti{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?Jn.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${t} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=yf(super.names,this.from);return yf(e,this.to)}},gf=class extends ti{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=Eo(this.iterable,e,t),this}get names(){return ni(super.names,this.iterable.names)}},ac=class extends Lr{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};ac.kind="func";var cc=class extends oc{render(e){return"return "+super.render(e)}};cc.kind="return";var wy=class extends Lr{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ni(e,this.catch.names),this.finally&&ni(e,this.finally.names),e}},lc=class extends Lr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};lc.kind="catch";var uc=class extends Lr{render(e){return"finally"+super.render(e)}};uc.kind="finally";var ky=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
176
+ `:""},this._extScope=e,this._scope=new Jn.Scope({parent:e}),this._nodes=[new Ty]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let i=this._scope.toName(t);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new py(e,i,r)),i}const(e,t,r){return this._def(Jn.varKinds.const,e,t,r)}let(e,t,r){return this._def(Jn.varKinds.let,e,t,r)}var(e,t,r){return this._def(Jn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new mf(e,t,r))}add(e,t){return this._leafNode(new my(e,le.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==ge.nil&&this._leafNode(new vy(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,ge.addCodeArg)(t,s));return t.push("}"),new ge._Code(t)}if(e,t,r){if(this._blockNode(new ei(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ei(e))}else(){return this._elseNode(new ko)}endIf(){return this._endBlockNode(ei,ko)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _y(e),t)}forRange(e,t,r,s,i=this.opts.es5?Jn.varKinds.var:Jn.varKinds.let){let o=this._scope.toName(e);return this._for(new Sy(i,o,t,r),()=>s(o))}forOf(e,t,r,s=Jn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,ge._)`${o}.length`,a=>{this.var(i,(0,ge._)`${o}[${a}]`),r(i)})}return this._for(new gf("of",s,i,t),()=>r(i))}forIn(e,t,r,s=this.opts.es5?Jn.varKinds.var:Jn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ge._)`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new gf("in",s,i,t),()=>r(i))}endFor(){return this._endBlockNode(ti)}label(e){return this._leafNode(new gy(e))}break(e){return this._leafNode(new yy(e))}return(e){let t=new cc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(cc)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new wy;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new lc(i),t(i)}return r&&(this._currNode=s.finally=new uc,this.code(r)),this._endBlockNode(lc,uc)}throw(e){return this._leafNode(new by(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=ge.nil,r,s){return this._blockNode(new ac(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(ac)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ei))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};le.CodeGen=ky;function ni(n,e){for(let t in e)n[t]=(n[t]||0)+(e[t]||0);return n}function yf(n,e){return e instanceof ge._CodeOrName?ni(n,e.names):n}function Eo(n,e,t){if(n instanceof ge.Name)return r(n);if(!s(n))return n;return new ge._Code(n._items.reduce((i,o)=>(o instanceof ge.Name&&(o=r(o)),o instanceof ge._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof ge._Code&&i._items.some(o=>o instanceof ge.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function Nj(n,e){for(let t in e)n[t]=(n[t]||0)-(e[t]||0)}function sR(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,ge._)`!${Ey(n)}`}le.not=sR;var Pj=iR(le.operators.AND);function Rj(...n){return n.reduce(Pj)}le.and=Rj;var Dj=iR(le.operators.OR);function Cj(...n){return n.reduce(Dj)}le.or=Cj;function iR(n){return(e,t)=>e===ge.nil?t:t===ge.nil?e:(0,ge._)`${Ey(e)} ${n} ${Ey(t)}`}function Ey(n){return n instanceof ge.Name?n:(0,ge._)`(${n})`}});var he=w(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Le=ae(),Oj=ic();function Aj(n){let e={};for(let t of n)e[t]=!0;return e}ue.toHash=Aj;function Ij(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(cR(n,e),!lR(e,n.self.RULES.all))}ue.alwaysValidSchema=Ij;function cR(n,e=n.schema){let{opts:t,self:r}=n;if(!t.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||fR(n,`unknown keyword: "${i}"`)}ue.checkUnknownRules=cR;function lR(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(e[t])return!0;return!1}ue.schemaHasRules=lR;function Mj(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(t!=="$ref"&&e.all[t])return!0;return!1}ue.schemaHasRulesButRef=Mj;function $j({topSchemaRef:n,schemaPath:e},t,r,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Le._)`${t}`}return(0,Le._)`${n}${e}${(0,Le.getProperty)(r)}`}ue.schemaRefOrVal=$j;function Lj(n){return uR(decodeURIComponent(n))}ue.unescapeFragment=Lj;function xj(n){return encodeURIComponent(Py(n))}ue.escapeFragment=xj;function Py(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Py;function uR(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=uR;function qj(n,e){if(Array.isArray(n))for(let t of n)e(t);else e(n)}ue.eachItem=qj;function oR({mergeNames:n,mergeToName:e,mergeValues:t,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Le.Name?(i instanceof Le.Name?n(s,i,o):e(s,i,o),o):i instanceof Le.Name?(e(s,o,i),i):t(i,o);return a===Le.Name&&!(c instanceof Le.Name)?r(s,c):c}}ue.mergeEvaluated={props:oR({mergeNames:(n,e,t)=>n.if((0,Le._)`${t} !== true && ${e} !== undefined`,()=>{n.if((0,Le._)`${e} === true`,()=>n.assign(t,!0),()=>n.assign(t,(0,Le._)`${t} || {}`).code((0,Le._)`Object.assign(${t}, ${e})`))}),mergeToName:(n,e,t)=>n.if((0,Le._)`${t} !== true`,()=>{e===!0?n.assign(t,!0):(n.assign(t,(0,Le._)`${t} || {}`),Ry(n,t,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:dR}),items:oR({mergeNames:(n,e,t)=>n.if((0,Le._)`${t} !== true && ${e} !== undefined`,()=>n.assign(t,(0,Le._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(n,e,t)=>n.if((0,Le._)`${t} !== true`,()=>n.assign(t,e===!0?!0:(0,Le._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function dR(n,e){if(e===!0)return n.var("props",!0);let t=n.var("props",(0,Le._)`{}`);return e!==void 0&&Ry(n,t,e),t}ue.evaluatedPropsToName=dR;function Ry(n,e,t){Object.keys(t).forEach(r=>n.assign((0,Le._)`${e}${(0,Le.getProperty)(r)}`,!0))}ue.setEvaluated=Ry;var aR={};function jj(n,e){return n.scopeValue("func",{ref:e,code:aR[e.code]||(aR[e.code]=new Oj._Code(e.code))})}ue.useFunc=jj;var Ny;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(Ny||(ue.Type=Ny={}));function Fj(n,e,t){if(n instanceof Le.Name){let r=e===Ny.Num;return t?r?(0,Le._)`"[" + ${n} + "]"`:(0,Le._)`"['" + ${n} + "']"`:r?(0,Le._)`"/" + ${n}`:(0,Le._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Le.getProperty)(n).toString():"/"+Py(n)}ue.getErrorPath=Fj;function fR(n,e,t=n.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);n.self.logger.warn(e)}}ue.checkStrictMode=fR});var Cn=w(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});var Ut=ae(),Bj={data:new Ut.Name("data"),valCxt:new Ut.Name("valCxt"),instancePath:new Ut.Name("instancePath"),parentData:new Ut.Name("parentData"),parentDataProperty:new Ut.Name("parentDataProperty"),rootData:new Ut.Name("rootData"),dynamicAnchors:new Ut.Name("dynamicAnchors"),vErrors:new Ut.Name("vErrors"),errors:new Ut.Name("errors"),this:new Ut.Name("this"),self:new Ut.Name("self"),scope:new Ut.Name("scope"),json:new Ut.Name("json"),jsonPos:new Ut.Name("jsonPos"),jsonLen:new Ut.Name("jsonLen"),jsonPart:new Ut.Name("jsonPart")};Dy.default=Bj});var dc=w(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.extendErrors=Vt.resetErrorsCount=Vt.reportExtraError=Vt.reportError=Vt.keyword$DataError=Vt.keywordError=void 0;var be=ae(),vf=he(),Yt=Cn();Vt.keywordError={message:({keyword:n})=>(0,be.str)`must pass "${n}" keyword validation`};Vt.keyword$DataError={message:({keyword:n,schemaType:e})=>e?(0,be.str)`"${n}" keyword must be ${e} ($data)`:(0,be.str)`"${n}" keyword is invalid ($data)`};function Uj(n,e=Vt.keywordError,t,r){let{it:s}=n,{gen:i,compositeRule:o,allErrors:a}=s,c=mR(n,e,t);r??(o||a)?hR(i,c):pR(s,(0,be._)`[${c}]`)}Vt.reportError=Uj;function Vj(n,e=Vt.keywordError,t){let{it:r}=n,{gen:s,compositeRule:i,allErrors:o}=r,a=mR(n,e,t);hR(s,a),i||o||pR(r,Yt.default.vErrors)}Vt.reportExtraError=Vj;function Wj(n,e){n.assign(Yt.default.errors,e),n.if((0,be._)`${Yt.default.vErrors} !== null`,()=>n.if(e,()=>n.assign((0,be._)`${Yt.default.vErrors}.length`,e),()=>n.assign(Yt.default.vErrors,null)))}Vt.resetErrorsCount=Wj;function Hj({gen:n,keyword:e,schemaValue:t,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=n.name("err");n.forRange("i",s,Yt.default.errors,a=>{n.const(o,(0,be._)`${Yt.default.vErrors}[${a}]`),n.if((0,be._)`${o}.instancePath === undefined`,()=>n.assign((0,be._)`${o}.instancePath`,(0,be.strConcat)(Yt.default.instancePath,i.errorPath))),n.assign((0,be._)`${o}.schemaPath`,(0,be.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(n.assign((0,be._)`${o}.schema`,t),n.assign((0,be._)`${o}.data`,r))})}Vt.extendErrors=Hj;function hR(n,e){let t=n.const("err",e);n.if((0,be._)`${Yt.default.vErrors} === null`,()=>n.assign(Yt.default.vErrors,(0,be._)`[${t}]`),(0,be._)`${Yt.default.vErrors}.push(${t})`),n.code((0,be._)`${Yt.default.errors}++`)}function pR(n,e){let{gen:t,validateName:r,schemaEnv:s}=n;s.$async?t.throw((0,be._)`new ${n.ValidationError}(${e})`):(t.assign((0,be._)`${r}.errors`,e),t.return(!1))}var ri={keyword:new be.Name("keyword"),schemaPath:new be.Name("schemaPath"),params:new be.Name("params"),propertyName:new be.Name("propertyName"),message:new be.Name("message"),schema:new be.Name("schema"),parentSchema:new be.Name("parentSchema")};function mR(n,e,t){let{createErrors:r}=n.it;return r===!1?(0,be._)`{}`:Kj(n,e,t)}function Kj(n,e,t={}){let{gen:r,it:s}=n,i=[zj(s,t),Gj(n,t)];return Yj(n,e,i),r.object(...i)}function zj({errorPath:n},{instancePath:e}){let t=e?(0,be.str)`${n}${(0,vf.getErrorPath)(e,vf.Type.Str)}`:n;return[Yt.default.instancePath,(0,be.strConcat)(Yt.default.instancePath,t)]}function Gj({keyword:n,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:r}){let s=r?e:(0,be.str)`${e}/${n}`;return t&&(s=(0,be.str)`${s}${(0,vf.getErrorPath)(t,vf.Type.Str)}`),[ri.schemaPath,s]}function Yj(n,{params:e,message:t},r){let{keyword:s,data:i,schemaValue:o,it:a}=n,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([ri.keyword,s],[ri.params,typeof e=="function"?e(n):e||(0,be._)`{}`]),c.messages&&r.push([ri.message,typeof t=="function"?t(n):t]),c.verbose&&r.push([ri.schema,o],[ri.parentSchema,(0,be._)`${u}${d}`],[Yt.default.data,i]),l&&r.push([ri.propertyName,l])}});var yR=w(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.boolOrEmptySchema=No.topBoolOrEmptySchema=void 0;var Jj=dc(),Xj=ae(),Qj=Cn(),Zj={message:"boolean schema is false"};function eF(n){let{gen:e,schema:t,validateName:r}=n;t===!1?gR(n,!1):typeof t=="object"&&t.$async===!0?e.return(Qj.default.data):(e.assign((0,Xj._)`${r}.errors`,null),e.return(!0))}No.topBoolOrEmptySchema=eF;function tF(n,e){let{gen:t,schema:r}=n;r===!1?(t.var(e,!1),gR(n)):t.var(e,!0)}No.boolOrEmptySchema=tF;function gR(n,e){let{gen:t,data:r}=n,s={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,Jj.reportError)(s,Zj,void 0,e)}});var Cy=w(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getRules=Po.isJSONType=void 0;var nF=["string","number","integer","boolean","null","object","array"],rF=new Set(nF);function sF(n){return typeof n=="string"&&rF.has(n)}Po.isJSONType=sF;function iF(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}Po.getRules=iF});var Oy=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.shouldUseRule=Ts.shouldUseGroup=Ts.schemaHasRulesForType=void 0;function oF({schema:n,self:e},t){let r=e.RULES.types[t];return r&&r!==!0&&bR(n,r)}Ts.schemaHasRulesForType=oF;function bR(n,e){return e.rules.some(t=>vR(n,t))}Ts.shouldUseGroup=bR;function vR(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}Ts.shouldUseRule=vR});var fc=w(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.reportTypeError=Wt.checkDataTypes=Wt.checkDataType=Wt.coerceAndCheckDataType=Wt.getJSONTypes=Wt.getSchemaTypes=Wt.DataType=void 0;var aF=Cy(),cF=Oy(),lF=dc(),ce=ae(),TR=he(),Ro;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(Ro||(Wt.DataType=Ro={}));function uF(n){let e=_R(n.type);if(e.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&e.push("null")}return e}Wt.getSchemaTypes=uF;function _R(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(aF.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Wt.getJSONTypes=_R;function dF(n,e){let{gen:t,data:r,opts:s}=n,i=fF(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,cF.schemaHasRulesForType)(n,e[0]));if(o){let a=Iy(e,r,s.strictNumbers,Ro.Wrong);t.if(a,()=>{i.length?hF(n,e,i):My(n)})}return o}Wt.coerceAndCheckDataType=dF;var SR=new Set(["string","number","integer","boolean","null"]);function fF(n,e){return e?n.filter(t=>SR.has(t)||e==="array"&&t==="array"):[]}function hF(n,e,t){let{gen:r,data:s,opts:i}=n,o=r.let("dataType",(0,ce._)`typeof ${s}`),a=r.let("coerced",(0,ce._)`undefined`);i.coerceTypes==="array"&&r.if((0,ce._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,ce._)`${s}[0]`).assign(o,(0,ce._)`typeof ${s}`).if(Iy(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,ce._)`${a} !== undefined`);for(let l of t)(SR.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),My(n),r.endIf(),r.if((0,ce._)`${a} !== undefined`,()=>{r.assign(s,a),pF(n,a)});function c(l){switch(l){case"string":r.elseIf((0,ce._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ce._)`"" + ${s}`).elseIf((0,ce._)`${s} === null`).assign(a,(0,ce._)`""`);return;case"number":r.elseIf((0,ce._)`${o} == "boolean" || ${s} === null
177
+ || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,ce._)`+${s}`);return;case"integer":r.elseIf((0,ce._)`${o} === "boolean" || ${s} === null
178
+ || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,ce._)`+${s}`);return;case"boolean":r.elseIf((0,ce._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,ce._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":r.elseIf((0,ce._)`${s} === "" || ${s} === 0 || ${s} === false`),r.assign(a,null);return;case"array":r.elseIf((0,ce._)`${o} === "string" || ${o} === "number"
179
+ || ${o} === "boolean" || ${s} === null`).assign(a,(0,ce._)`[${s}]`)}}}function pF({gen:n,parentData:e,parentDataProperty:t},r){n.if((0,ce._)`${e} !== undefined`,()=>n.assign((0,ce._)`${e}[${t}]`,r))}function Ay(n,e,t,r=Ro.Correct){let s=r===Ro.Correct?ce.operators.EQ:ce.operators.NEQ,i;switch(n){case"null":return(0,ce._)`${e} ${s} null`;case"array":i=(0,ce._)`Array.isArray(${e})`;break;case"object":i=(0,ce._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,ce._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,ce._)`typeof ${e} ${s} ${n}`}return r===Ro.Correct?i:(0,ce.not)(i);function o(a=ce.nil){return(0,ce.and)((0,ce._)`typeof ${e} == "number"`,a,t?(0,ce._)`isFinite(${e})`:ce.nil)}}Wt.checkDataType=Ay;function Iy(n,e,t,r){if(n.length===1)return Ay(n[0],e,t,r);let s,i=(0,TR.toHash)(n);if(i.array&&i.object){let o=(0,ce._)`typeof ${e} != "object"`;s=i.null?o:(0,ce._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=ce.nil;i.number&&delete i.integer;for(let o in i)s=(0,ce.and)(s,Ay(o,e,t,r));return s}Wt.checkDataTypes=Iy;var mF={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,ce._)`{type: ${n}}`:(0,ce._)`{type: ${e}}`};function My(n){let e=gF(n);(0,lF.reportError)(e,mF)}Wt.reportTypeError=My;function gF(n){let{gen:e,data:t,schema:r}=n,s=(0,TR.schemaRefOrVal)(n,r,"type");return{gen:e,keyword:"type",data:t,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:n}}});var kR=w(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.assignDefaults=void 0;var Do=ae(),yF=he();function bF(n,e){let{properties:t,items:r}=n.schema;if(e==="object"&&t)for(let s in t)wR(n,s,t[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>wR(n,i,s.default))}Tf.assignDefaults=bF;function wR(n,e,t){let{gen:r,compositeRule:s,data:i,opts:o}=n;if(t===void 0)return;let a=(0,Do._)`${i}${(0,Do.getProperty)(e)}`;if(s){(0,yF.checkStrictMode)(n,`default is ignored for: ${a}`);return}let c=(0,Do._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Do._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,Do._)`${a} = ${(0,Do.stringify)(t)}`)}});var On=w(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.validateUnion=Me.validateArray=Me.usePattern=Me.callValidateCode=Me.schemaProperties=Me.allSchemaProperties=Me.noPropertyInData=Me.propertyInData=Me.isOwnProperty=Me.hasPropFunc=Me.reportMissingProp=Me.checkMissingProp=Me.checkReportMissingProp=void 0;var ze=ae(),$y=he(),_s=Cn(),vF=he();function TF(n,e){let{gen:t,data:r,it:s}=n;t.if(xy(t,r,e,s.opts.ownProperties),()=>{n.setParams({missingProperty:(0,ze._)`${e}`},!0),n.error()})}Me.checkReportMissingProp=TF;function _F({gen:n,data:e,it:{opts:t}},r,s){return(0,ze.or)(...r.map(i=>(0,ze.and)(xy(n,e,i,t.ownProperties),(0,ze._)`${s} = ${i}`)))}Me.checkMissingProp=_F;function SF(n,e){n.setParams({missingProperty:e},!0),n.error()}Me.reportMissingProp=SF;function ER(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ze._)`Object.prototype.hasOwnProperty`})}Me.hasPropFunc=ER;function Ly(n,e,t){return(0,ze._)`${ER(n)}.call(${e}, ${t})`}Me.isOwnProperty=Ly;function wF(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} !== undefined`;return r?(0,ze._)`${s} && ${Ly(n,e,t)}`:s}Me.propertyInData=wF;function xy(n,e,t,r){let s=(0,ze._)`${e}${(0,ze.getProperty)(t)} === undefined`;return r?(0,ze.or)(s,(0,ze.not)(Ly(n,e,t))):s}Me.noPropertyInData=xy;function NR(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}Me.allSchemaProperties=NR;function kF(n,e){return NR(e).filter(t=>!(0,$y.alwaysValidSchema)(n,e[t]))}Me.schemaProperties=kF;function EF({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,ze._)`${n}, ${e}, ${r}${s}`:e,d=[[_s.default.instancePath,(0,ze.strConcat)(_s.default.instancePath,i)],[_s.default.parentData,o.parentData],[_s.default.parentDataProperty,o.parentDataProperty],[_s.default.rootData,_s.default.rootData]];o.opts.dynamicRef&&d.push([_s.default.dynamicAnchors,_s.default.dynamicAnchors]);let f=(0,ze._)`${u}, ${t.object(...d)}`;return c!==ze.nil?(0,ze._)`${a}.call(${c}, ${f})`:(0,ze._)`${a}(${f})`}Me.callValidateCode=EF;var NF=(0,ze._)`new RegExp`;function PF({gen:n,it:{opts:e}},t){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,r);return n.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ze._)`${s.code==="new RegExp"?NF:(0,vF.useFunc)(n,s)}(${t}, ${r})`})}Me.usePattern=PF;function RF(n){let{gen:e,data:t,keyword:r,it:s}=n,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,ze._)`${t}.length`);e.forRange("i",0,c,l=>{n.subschema({keyword:r,dataProp:l,dataPropType:$y.Type.Num},i),e.if((0,ze.not)(i),a)})}}Me.validateArray=RF;function DF(n){let{gen:e,schema:t,keyword:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,$y.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let u=n.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ze._)`${o} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,ze.not)(o))})),n.result(o,()=>n.reset(),()=>n.error(!0))}Me.validateUnion=DF});var DR=w(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.validateKeywordUsage=gr.validSchemaType=gr.funcKeywordCode=gr.macroKeywordCode=void 0;var Jt=ae(),si=Cn(),CF=On(),OF=dc();function AF(n,e){let{gen:t,keyword:r,schema:s,parentSchema:i,it:o}=n,a=e.macro.call(o.self,s,i,o),c=RR(t,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");n.subschema({schema:a,schemaPath:Jt.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),n.pass(l,()=>n.error(!0))}gr.macroKeywordCode=AF;function IF(n,e){var t;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=n;$F(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=RR(r,s,l),d=r.let("valid");n.block$data(d,f),n.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)g(),e.modifying&&PR(n),S(()=>n.error());else{let k=e.async?m():T();e.modifying&&PR(n),S(()=>MF(n,k))}}function m(){let k=r.let("ruleErrs",null);return r.try(()=>g((0,Jt._)`await `),v=>r.assign(d,!1).if((0,Jt._)`${v} instanceof ${c.ValidationError}`,()=>r.assign(k,(0,Jt._)`${v}.errors`),()=>r.throw(v))),k}function T(){let k=(0,Jt._)`${u}.errors`;return r.assign(k,null),g(Jt.nil),k}function g(k=e.async?(0,Jt._)`await `:Jt.nil){let v=c.opts.passContext?si.default.this:si.default.self,b=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,Jt._)`${k}${(0,CF.callValidateCode)(n,u,v,b)}`,e.modifying)}function S(k){var v;r.if((0,Jt.not)((v=e.valid)!==null&&v!==void 0?v:d),k)}}gr.funcKeywordCode=IF;function PR(n){let{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,Jt._)`${r.parentData}[${r.parentDataProperty}]`))}function MF(n,e){let{gen:t}=n;t.if((0,Jt._)`Array.isArray(${e})`,()=>{t.assign(si.default.vErrors,(0,Jt._)`${si.default.vErrors} === null ? ${e} : ${si.default.vErrors}.concat(${e})`).assign(si.default.errors,(0,Jt._)`${si.default.vErrors}.length`),(0,OF.extendErrors)(n)},()=>n.error())}function $F({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function RR(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Jt.stringify)(t)})}function LF(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n>"u")}gr.validSchemaType=LF;function xF({schema:n,opts:e,self:t,errSchemaPath:r},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(n,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(n[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}gr.validateKeywordUsage=xF});var OR=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.extendSubschemaMode=Ss.extendSubschemaData=Ss.getSubschema=void 0;var yr=ae(),CR=he();function qF(n,{keyword:e,schemaProp:t,schema:r,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,yr._)`${n.schemaPath}${(0,yr.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,yr._)`${n.schemaPath}${(0,yr.getProperty)(e)}${(0,yr.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,CR.escapeFragment)(t)}`}}if(r!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ss.getSubschema=qF;function jF(n,e,{dataProp:t,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,yr._)`${e.data}${(0,yr.getProperty)(t)}`,!0);c(f),n.errorPath=(0,yr.str)`${l}${(0,CR.getErrorPath)(t,r,d.jsPropertySyntax)}`,n.parentDataProperty=(0,yr._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(s!==void 0){let l=s instanceof yr.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(n.propertyName=o)}i&&(n.dataTypes=i);function c(l){n.data=l,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,l]}}Ss.extendSubschemaData=jF;function FF(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(n.compositeRule=r),s!==void 0&&(n.createErrors=s),i!==void 0&&(n.allErrors=i),n.jtdDiscriminator=e,n.jtdMetadata=t}Ss.extendSubschemaMode=FF});var qy=w((z8,AR)=>{"use strict";AR.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var MR=w((G8,IR)=>{"use strict";var ws=IR.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};_f(e,r,s,n,"",n)};ws.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ws.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ws.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ws.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _f(n,e,t,r,s,i,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,s,i,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in ws.arrayKeywords)for(var f=0;f<d.length;f++)_f(n,e,t,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in ws.propsKeywords){if(d&&typeof d=="object")for(var m in d)_f(n,e,t,d[m],s+"/"+u+"/"+BF(m),i,s,u,r,m)}else(u in ws.keywords||n.allKeys&&!(u in ws.skipKeywords))&&_f(n,e,t,d,s+"/"+u,i,s,u,r)}t(r,s,i,o,a,c,l)}}function BF(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}});var hc=w(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.getSchemaRefs=cn.resolveUrl=cn.normalizeId=cn._getFullPath=cn.getFullPath=cn.inlineRef=void 0;var UF=he(),VF=qy(),WF=MR(),HF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function KF(n,e=!0){return typeof n=="boolean"?!0:e===!0?!jy(n):e?$R(n)<=e:!1}cn.inlineRef=KF;var zF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jy(n){for(let e in n){if(zF.has(e))return!0;let t=n[e];if(Array.isArray(t)&&t.some(jy)||typeof t=="object"&&jy(t))return!0}return!1}function $R(n){let e=0;for(let t in n){if(t==="$ref")return 1/0;if(e++,!HF.has(t)&&(typeof n[t]=="object"&&(0,UF.eachItem)(n[t],r=>e+=$R(r)),e===1/0))return 1/0}return e}function LR(n,e="",t){t!==!1&&(e=Co(e));let r=n.parse(e);return xR(n,r)}cn.getFullPath=LR;function xR(n,e){return n.serialize(e).split("#")[0]+"#"}cn._getFullPath=xR;var GF=/#\/?$/;function Co(n){return n?n.replace(GF,""):""}cn.normalizeId=Co;function YF(n,e,t){return t=Co(t),n.resolve(e,t)}cn.resolveUrl=YF;var JF=/^[a-z_][-a-z0-9._]*$/i;function XF(n,e){if(typeof n=="boolean")return{};let{schemaId:t,uriResolver:r}=this.opts,s=Co(n[t]||e),i={"":s},o=LR(r,s,!1),a={},c=new Set;return WF(n,{allKeys:!0},(d,f,m,T)=>{if(T===void 0)return;let g=o+f,S=i[T];typeof d[t]=="string"&&(S=k.call(this,d[t])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),i[f]=S;function k(b){let R=this.opts.uriResolver.resolve;if(b=Co(S?R(S,b):b),c.has(b))throw u(b);c.add(b);let O=this.refs[b];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?l(d,O.schema,b):b!==Co(g)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=g),b}function v(b){if(typeof b=="string"){if(!JF.test(b))throw new Error(`invalid anchor "${b}"`);k.call(this,`#${b}`)}}}),a;function l(d,f,m){if(f!==void 0&&!VF(d,f))throw u(m)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}cn.getSchemaRefs=XF});var gc=w(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.getData=ks.KeywordCxt=ks.validateFunctionCode=void 0;var UR=yR(),qR=fc(),By=Oy(),Sf=fc(),QF=kR(),mc=DR(),Fy=OR(),K=ae(),te=Cn(),ZF=hc(),xr=he(),pc=dc();function eB(n){if(HR(n)&&(KR(n),WR(n))){rB(n);return}VR(n,()=>(0,UR.topBoolOrEmptySchema)(n))}ks.validateFunctionCode=eB;function VR({gen:n,validateName:e,schema:t,schemaEnv:r,opts:s},i){s.code.es5?n.func(e,(0,K._)`${te.default.data}, ${te.default.valCxt}`,r.$async,()=>{n.code((0,K._)`"use strict"; ${jR(t,s)}`),nB(n,s),n.code(i)}):n.func(e,(0,K._)`${te.default.data}, ${tB(s)}`,r.$async,()=>n.code(jR(t,s)).code(i))}function tB(n){return(0,K._)`{${te.default.instancePath}="", ${te.default.parentData}, ${te.default.parentDataProperty}, ${te.default.rootData}=${te.default.data}${n.dynamicRef?(0,K._)`, ${te.default.dynamicAnchors}={}`:K.nil}}={}`}function nB(n,e){n.if(te.default.valCxt,()=>{n.var(te.default.instancePath,(0,K._)`${te.default.valCxt}.${te.default.instancePath}`),n.var(te.default.parentData,(0,K._)`${te.default.valCxt}.${te.default.parentData}`),n.var(te.default.parentDataProperty,(0,K._)`${te.default.valCxt}.${te.default.parentDataProperty}`),n.var(te.default.rootData,(0,K._)`${te.default.valCxt}.${te.default.rootData}`),e.dynamicRef&&n.var(te.default.dynamicAnchors,(0,K._)`${te.default.valCxt}.${te.default.dynamicAnchors}`)},()=>{n.var(te.default.instancePath,(0,K._)`""`),n.var(te.default.parentData,(0,K._)`undefined`),n.var(te.default.parentDataProperty,(0,K._)`undefined`),n.var(te.default.rootData,te.default.data),e.dynamicRef&&n.var(te.default.dynamicAnchors,(0,K._)`{}`)})}function rB(n){let{schema:e,opts:t,gen:r}=n;VR(n,()=>{t.$comment&&e.$comment&&GR(n),cB(n),r.let(te.default.vErrors,null),r.let(te.default.errors,0),t.unevaluated&&sB(n),zR(n),dB(n)})}function sB(n){let{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,K._)`${t}.evaluated`),e.if((0,K._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,K._)`${n.evaluated}.props`,(0,K._)`undefined`)),e.if((0,K._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,K._)`${n.evaluated}.items`,(0,K._)`undefined`))}function jR(n,e){let t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,K._)`/*# sourceURL=${t} */`:K.nil}function iB(n,e){if(HR(n)&&(KR(n),WR(n))){oB(n,e);return}(0,UR.boolOrEmptySchema)(n,e)}function WR({schema:n,self:e}){if(typeof n=="boolean")return!n;for(let t in n)if(e.RULES.all[t])return!0;return!1}function HR(n){return typeof n.schema!="boolean"}function oB(n,e){let{schema:t,gen:r,opts:s}=n;s.$comment&&t.$comment&&GR(n),lB(n),uB(n);let i=r.const("_errs",te.default.errors);zR(n,i),r.var(e,(0,K._)`${i} === ${te.default.errors}`)}function KR(n){(0,xr.checkUnknownRules)(n),aB(n)}function zR(n,e){if(n.opts.jtd)return FR(n,[],!1,e);let t=(0,qR.getSchemaTypes)(n.schema),r=(0,qR.coerceAndCheckDataType)(n,t);FR(n,t,!r,e)}function aB(n){let{schema:e,errSchemaPath:t,opts:r,self:s}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,xr.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function cB(n){let{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,xr.checkStrictMode)(n,"default is ignored in the schema root")}function lB(n){let e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,ZF.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function uB(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function GR({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:s}){let i=t.$comment;if(s.$comment===!0)n.code((0,K._)`${te.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,K.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,K._)`${te.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function dB(n){let{gen:e,schemaEnv:t,validateName:r,ValidationError:s,opts:i}=n;t.$async?e.if((0,K._)`${te.default.errors} === 0`,()=>e.return(te.default.data),()=>e.throw((0,K._)`new ${s}(${te.default.vErrors})`)):(e.assign((0,K._)`${r}.errors`,te.default.vErrors),i.unevaluated&&fB(n),e.return((0,K._)`${te.default.errors} === 0`))}function fB({gen:n,evaluated:e,props:t,items:r}){t instanceof K.Name&&n.assign((0,K._)`${e}.props`,t),r instanceof K.Name&&n.assign((0,K._)`${e}.items`,r)}function FR(n,e,t,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=n,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,xr.schemaHasRulesButRef)(i,u))){s.block(()=>JR(n,"$ref",u.all.$ref.definition));return}c.jtd||hB(n,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,By.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Sf.checkDataType)(f.type,o,c.strictNumbers)),BR(n,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Sf.reportTypeError)(n)),s.endIf()):BR(n,f),a||s.if((0,K._)`${te.default.errors} === ${r||0}`))}}function BR(n,e){let{gen:t,schema:r,opts:{useDefaults:s}}=n;s&&(0,QF.assignDefaults)(n,e.type),t.block(()=>{for(let i of e.rules)(0,By.shouldUseRule)(r,i)&&JR(n,i.keyword,i.definition,e.type)})}function hB(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(pB(n,e),n.opts.allowUnionTypes||mB(n,e),gB(n,n.dataTypes))}function pB(n,e){if(e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{YR(n.dataTypes,t)||Uy(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),bB(n,e)}}function mB(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Uy(n,"use allowUnionTypes to allow union type keyword")}function gB(n,e){let t=n.self.RULES.all;for(let r in t){let s=t[r];if(typeof s=="object"&&(0,By.shouldUseRule)(n.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>yB(e,o))&&Uy(n,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function yB(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function YR(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function bB(n,e){let t=[];for(let r of n.dataTypes)YR(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function Uy(n,e){let t=n.schemaEnv.baseId+n.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,xr.checkStrictMode)(n,e,n.opts.strictTypes)}var wf=class{constructor(e,t,r){if((0,mc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,xr.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",XR(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,mc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",te.default.errors))}result(e,t,r){this.failResult((0,K.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,K.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,K._)`${t} !== undefined && (${(0,K.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?pc.reportExtraError:pc.reportError)(this,this.def.error,t)}$dataError(){(0,pc.reportError)(this,this.def.$dataError||pc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,pc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=K.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=K.nil,t=K.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,K.or)((0,K._)`${s} === undefined`,t)),e!==K.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==K.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:i}=this;return(0,K.or)(o(),a());function o(){if(r.length){if(!(t instanceof K.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,K._)`${(0,Sf.checkDataTypes)(c,t,i.opts.strictNumbers,Sf.DataType.Wrong)}`}return K.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,K._)`!${c}(${t})`}return K.nil}}subschema(e,t){let r=(0,Fy.getSubschema)(this.it,e);(0,Fy.extendSubschemaData)(r,this.it,e),(0,Fy.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return iB(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=xr.mergeEvaluated.props(s,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=xr.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,K.Name)),!0}};ks.KeywordCxt=wf;function JR(n,e,t,r){let s=new wf(n,t,e);"code"in t?t.code(s,r):s.$data&&t.validate?(0,mc.funcKeywordCode)(s,t):"macro"in t?(0,mc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,mc.funcKeywordCode)(s,t)}var vB=/^\/(?:[^~]|~0|~1)*$/,TB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function XR(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let s,i;if(n==="")return te.default.rootData;if(n[0]==="/"){if(!vB.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);s=n,i=te.default.rootData}else{let l=TB.exec(n);if(!l)throw new Error(`Invalid JSON-pointer: ${n}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return r[e-u]}if(u>e)throw new Error(c("data",u));if(i=t[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,K._)`${i}${(0,K.getProperty)((0,xr.unescapeJsonPointer)(l))}`,o=(0,K._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ks.getData=XR});var kf=w(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});var Vy=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Wy.default=Vy});var yc=w(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var Hy=hc(),Ky=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Hy.resolveUrl)(e,t,r),this.missingSchema=(0,Hy.normalizeId)((0,Hy.getFullPath)(e,this.missingRef))}};zy.default=Ky});var bc=w(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.resolveSchema=An.getCompilingSchema=An.resolveRef=An.compileSchema=An.SchemaEnv=void 0;var Xn=ae(),_B=kf(),ii=Cn(),Qn=hc(),QR=he(),SB=gc(),Oo=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Qn.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};An.SchemaEnv=Oo;function Yy(n){let e=ZR.call(this,n);if(e)return e;let t=(0,Qn.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Xn.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;n.$async&&(a=o.scopeValue("Error",{ref:_B.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");n.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ii.default.data,parentData:ii.default.parentData,parentDataProperty:ii.default.parentDataProperty,dataNames:[ii.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Xn.stringify)(n.schema)}:{ref:n.schema}),validateName:c,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Xn.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(n),(0,SB.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(ii.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,n));let m=new Function(`${ii.default.self}`,`${ii.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=n.schema,m.schemaEnv=n,n.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:T,items:g}=l;m.evaluated={props:T instanceof Xn.Name?void 0:T,items:g instanceof Xn.Name?void 0:g,dynamicProps:T instanceof Xn.Name,dynamicItems:g instanceof Xn.Name},m.source&&(m.source.evaluated=(0,Xn.stringify)(m.evaluated))}return n.validate=m,n}catch(d){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(n)}}An.compileSchema=Yy;function wB(n,e,t){var r;t=(0,Qn.resolveUrl)(this.opts.uriResolver,e,t);let s=n.refs[t];if(s)return s;let i=NB.call(this,n,t);if(i===void 0){let o=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;o&&(i=new Oo({schema:o,schemaId:a,root:n,baseId:e}))}if(i!==void 0)return n.refs[t]=kB.call(this,i)}An.resolveRef=wB;function kB(n){return(0,Qn.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Yy.call(this,n)}function ZR(n){for(let e of this._compilations)if(EB(e,n))return e}An.getCompilingSchema=ZR;function EB(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function NB(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Ef.call(this,n,e)}function Ef(n,e){let t=this.opts.uriResolver.parse(e),r=(0,Qn._getFullPath)(this.opts.uriResolver,t),s=(0,Qn.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===s)return Gy.call(this,t,n);let i=(0,Qn.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Ef.call(this,n,o);return typeof a?.schema!="object"?void 0:Gy.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Yy.call(this,o),i===(0,Qn.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Qn.resolveUrl)(this.opts.uriResolver,s,l)),new Oo({schema:a,schemaId:c,root:n,baseId:s})}return Gy.call(this,t,o)}}An.resolveSchema=Ef;var PB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gy(n,{baseId:e,schema:t,root:r}){var s;if(((s=n.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,QR.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!PB.has(a)&&l&&(e=(0,Qn.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,QR.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Qn.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Ef.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new Oo({schema:t,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var eD=w((eZ,RB)=>{RB.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var nD=w((tZ,tD)=>{"use strict";var DB={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};tD.exports={HEX:DB}});var uD=w((nZ,lD)=>{"use strict";var{HEX:CB}=nD(),OB=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function oD(n){if(cD(n,".")<3)return{host:n,isIPV4:!1};let e=n.match(OB)||[],[t]=e;return t?{host:IB(t,"."),isIPV4:!0}:{host:n,isIPV4:!1}}function Jy(n,e=!1){let t="",r=!0;for(let s of n){if(CB[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(t+=s)}return e&&t.length===0&&(t="0"),t}function AB(n){let e=0,t={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=Jy(s);if(l!==void 0)r.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<n.length;l++){let u=n[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,r.push(":"),e>7){t.error=!0;break}l-1>=0&&n[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?t.zone=s.join(""):a?r.push(s.join("")):r.push(Jy(s))),t.address=r.join(""),t}function aD(n){if(cD(n,":")<2)return{host:n,isIPV6:!1};let e=AB(n);if(e.error)return{host:n,isIPV6:!1};{let t=e.address,r=e.address;return e.zone&&(t+="%"+e.zone,r+="%25"+e.zone),{host:t,escapedHost:r,isIPV6:!0}}}function IB(n,e){let t="",r=!0,s=n.length;for(let i=0;i<s;i++){let o=n[i];o==="0"&&r?(i+1<=s&&n[i+1]===e||i+1===s)&&(t+=o,r=!1):(o===e?r=!0:r=!1,t+=o)}return t}function cD(n,e){let t=0;for(let r=0;r<n.length;r++)n[r]===e&&t++;return t}var rD=/^\.\.?\//u,sD=/^\/\.(?:\/|$)/u,iD=/^\/\.\.(?:\/|$)/u,MB=/^\/?(?:.|\n)*?(?=\/|$)/u;function $B(n){let e=[];for(;n.length;)if(n.match(rD))n=n.replace(rD,"");else if(n.match(sD))n=n.replace(sD,"/");else if(n.match(iD))n=n.replace(iD,"/"),e.pop();else if(n==="."||n==="..")n="";else{let t=n.match(MB);if(t){let r=t[0];n=n.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function LB(n,e){let t=e!==!0?escape:unescape;return n.scheme!==void 0&&(n.scheme=t(n.scheme)),n.userinfo!==void 0&&(n.userinfo=t(n.userinfo)),n.host!==void 0&&(n.host=t(n.host)),n.path!==void 0&&(n.path=t(n.path)),n.query!==void 0&&(n.query=t(n.query)),n.fragment!==void 0&&(n.fragment=t(n.fragment)),n}function xB(n){let e=[];if(n.userinfo!==void 0&&(e.push(n.userinfo),e.push("@")),n.host!==void 0){let t=unescape(n.host),r=oD(t);if(r.isIPV4)t=r.host;else{let s=aD(r.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=n.host}e.push(t)}return(typeof n.port=="number"||typeof n.port=="string")&&(e.push(":"),e.push(String(n.port))),e.length?e.join(""):void 0}lD.exports={recomposeAuthority:xB,normalizeComponentEncoding:LB,removeDotSegments:$B,normalizeIPv4:oD,normalizeIPv6:aD,stringArrayToHexStripped:Jy}});var gD=w((rZ,mD)=>{"use strict";var qB=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,jB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function dD(n){return typeof n.secure=="boolean"?n.secure:String(n.scheme).toLowerCase()==="wss"}function fD(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function hD(n){let e=String(n.scheme).toLowerCase()==="https";return(n.port===(e?443:80)||n.port==="")&&(n.port=void 0),n.path||(n.path="/"),n}function FB(n){return n.secure=dD(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function BB(n){if((n.port===(dD(n)?443:80)||n.port==="")&&(n.port=void 0),typeof n.secure=="boolean"&&(n.scheme=n.secure?"wss":"ws",n.secure=void 0),n.resourceName){let[e,t]=n.resourceName.split("?");n.path=e&&e!=="/"?e:void 0,n.query=t,n.resourceName=void 0}return n.fragment=void 0,n}function UB(n,e){if(!n.path)return n.error="URN can not be parsed",n;let t=n.path.match(jB);if(t){let r=e.scheme||n.scheme||"urn";n.nid=t[1].toLowerCase(),n.nss=t[2];let s=`${r}:${e.nid||n.nid}`,i=Xy[s];n.path=void 0,i&&(n=i.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n}function VB(n,e){let t=e.scheme||n.scheme||"urn",r=n.nid.toLowerCase(),s=`${t}:${e.nid||r}`,i=Xy[s];i&&(n=i.serialize(n,e));let o=n,a=n.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function WB(n,e){let t=n;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!qB.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function HB(n){let e=n;return e.nss=(n.uuid||"").toLowerCase(),e}var pD={scheme:"http",domainHost:!0,parse:fD,serialize:hD},KB={scheme:"https",domainHost:pD.domainHost,parse:fD,serialize:hD},Nf={scheme:"ws",domainHost:!0,parse:FB,serialize:BB},zB={scheme:"wss",domainHost:Nf.domainHost,parse:Nf.parse,serialize:Nf.serialize},GB={scheme:"urn",parse:UB,serialize:VB,skipNormalize:!0},YB={scheme:"urn:uuid",parse:WB,serialize:HB,skipNormalize:!0},Xy={http:pD,https:KB,ws:Nf,wss:zB,urn:GB,"urn:uuid":YB};mD.exports=Xy});var bD=w((sZ,Rf)=>{"use strict";var{normalizeIPv6:JB,normalizeIPv4:XB,removeDotSegments:vc,recomposeAuthority:QB,normalizeComponentEncoding:Pf}=uD(),Qy=gD();function ZB(n,e){return typeof n=="string"?n=br(qr(n,e),e):typeof n=="object"&&(n=qr(br(n,e),e)),n}function eU(n,e,t){let r=Object.assign({scheme:"null"},t),s=yD(qr(n,r),qr(e,r),r,!0);return br(s,{...r,skipEscape:!0})}function yD(n,e,t,r){let s={};return r||(n=qr(br(n,t),t),e=qr(br(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=vc(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=vc(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=vc(e.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?s.path="/"+e.path:n.path?s.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=vc(s.path)),s.query=e.query):(s.path=n.path,e.query!==void 0?s.query=e.query:s.query=n.query),s.userinfo=n.userinfo,s.host=n.host,s.port=n.port),s.scheme=n.scheme),s.fragment=e.fragment,s}function tU(n,e,t){return typeof n=="string"?(n=unescape(n),n=br(Pf(qr(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=br(Pf(n,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=br(Pf(qr(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=br(Pf(e,!0),{...t,skipEscape:!0})),n.toLowerCase()===e.toLowerCase()}function br(n,e){let t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},r=Object.assign({},e),s=[],i=Qy[(r.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,r),t.path!==void 0&&(r.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),r.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=QB(t);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=vc(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var nU=Array.from({length:127},(n,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function rU(n){let e=0;for(let t=0,r=n.length;t<r;++t)if(e=n.charCodeAt(t),e>126||nU[e])return!0;return!1}var sU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function qr(n,e){let t=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=n.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);let o=n.match(sU);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=XB(r.host);if(c.isIPV4===!1){let l=JB(c.host);r.host=l.host.toLowerCase(),i=l.isIPV6}else r.host=c.host,i=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");let a=Qy[(t.scheme||r.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&rU(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),s&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var Zy={SCHEMES:Qy,normalize:ZB,resolve:eU,resolveComponents:yD,equal:tU,serialize:br,parse:qr};Rf.exports=Zy;Rf.exports.default=Zy;Rf.exports.fastUri=Zy});var TD=w(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var vD=bD();vD.code='require("ajv/dist/runtime/uri").default';eb.default=vD});var RD=w(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.CodeGen=Mt.Name=Mt.nil=Mt.stringify=Mt.str=Mt._=Mt.KeywordCxt=void 0;var iU=gc();Object.defineProperty(Mt,"KeywordCxt",{enumerable:!0,get:function(){return iU.KeywordCxt}});var Ao=ae();Object.defineProperty(Mt,"_",{enumerable:!0,get:function(){return Ao._}});Object.defineProperty(Mt,"str",{enumerable:!0,get:function(){return Ao.str}});Object.defineProperty(Mt,"stringify",{enumerable:!0,get:function(){return Ao.stringify}});Object.defineProperty(Mt,"nil",{enumerable:!0,get:function(){return Ao.nil}});Object.defineProperty(Mt,"Name",{enumerable:!0,get:function(){return Ao.Name}});Object.defineProperty(Mt,"CodeGen",{enumerable:!0,get:function(){return Ao.CodeGen}});var oU=kf(),ED=yc(),aU=Cy(),Tc=bc(),cU=ae(),_c=hc(),Df=fc(),nb=he(),_D=eD(),lU=TD(),ND=(n,e)=>new RegExp(n,e);ND.code="new RegExp";var uU=["removeAdditional","useDefaults","coerceTypes"],dU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),fU={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},hU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},SD=200;function pU(n){var e,t,r,s,i,o,a,c,l,u,d,f,m,T,g,S,k,v,b,R,O,L,V,j,re;let Oe=n.strict,yt=(e=n.code)===null||e===void 0?void 0:e.optimize,de=yt===!0||yt===void 0?1:yt||0,yn=(r=(t=n.code)===null||t===void 0?void 0:t.regExp)!==null&&r!==void 0?r:ND,jr=(s=n.uriResolver)!==null&&s!==void 0?s:lU.default;return{strictSchema:(o=(i=n.strictSchema)!==null&&i!==void 0?i:Oe)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=n.strictNumbers)!==null&&a!==void 0?a:Oe)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=n.strictTypes)!==null&&l!==void 0?l:Oe)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=n.strictTuples)!==null&&d!==void 0?d:Oe)!==null&&f!==void 0?f:"log",strictRequired:(T=(m=n.strictRequired)!==null&&m!==void 0?m:Oe)!==null&&T!==void 0?T:!1,code:n.code?{...n.code,optimize:de,regExp:yn}:{optimize:de,regExp:yn},loopRequired:(g=n.loopRequired)!==null&&g!==void 0?g:SD,loopEnum:(S=n.loopEnum)!==null&&S!==void 0?S:SD,meta:(k=n.meta)!==null&&k!==void 0?k:!0,messages:(v=n.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=n.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(R=n.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(O=n.addUsedSchema)!==null&&O!==void 0?O:!0,validateSchema:(L=n.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(V=n.validateFormats)!==null&&V!==void 0?V:!0,unicodeRegExp:(j=n.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(re=n.int32range)!==null&&re!==void 0?re:!0,uriResolver:jr}}var Sc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...pU(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new cU.ValueScope({scope:{},prefixes:dU,es5:t,lines:r}),this.logger=TU(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,aU.getRules)(),wD.call(this,fU,e,"NOT SUPPORTED"),wD.call(this,hU,e,"DEPRECATED","warn"),this._metaOpts=bU.call(this),e.formats&&gU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&yU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),mU.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=_D;r==="id"&&(s={..._D},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof ED.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,t)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,_c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=kD.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:r}=this.opts,s=new Tc.SchemaEnv({schema:{},schemaId:r});if(t=Tc.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=kD.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,_c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string")r=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(SU.call(this,r,t),!t)return(0,nb.eachItem)(r,i=>tb.call(this,i)),this;kU.call(this,t);let s={...t,type:(0,Df.getJSONTypes)(t.type),schemaType:(0,Df.getJSONTypes)(t.schemaType)};return(0,nb.eachItem)(r,s.type.length===0?i=>tb.call(this,i,s):i=>s.type.forEach(o=>tb.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=PD(u))}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];(!t||t.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;r=(0,_c.normalizeId)(o||r);let l=_c.getSchemaRefs.call(this,e,r);return c=new Tc.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:l}),this._cache.set(c.schema,c),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Tc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Tc.compileSchema.call(this,e)}finally{this.opts=t}}};Sc.ValidationError=oU.default;Sc.MissingRefError=ED.default;Mt.default=Sc;function wD(n,e,t,r="error"){for(let s in n){let i=s;i in e&&this.logger[r](`${t}: option ${s}. ${n[i]}`)}}function kD(n){return n=(0,_c.normalizeId)(n),this.schemas[n]||this.refs[n]}function mU(){let n=this.opts.schemas;if(n)if(Array.isArray(n))this.addSchema(n);else for(let e in n)this.addSchema(n[e],e)}function gU(){for(let n in this.opts.formats){let e=this.opts.formats[n];e&&this.addFormat(n,e)}}function yU(n){if(Array.isArray(n)){this.addVocabulary(n);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in n){let t=n[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function bU(){let n={...this.opts};for(let e of uU)delete n[e];return n}var vU={log(){},warn(){},error(){}};function TU(n){if(n===!1)return vU;if(n===void 0)return console;if(n.log&&n.warn&&n.error)return n;throw new Error("logger must implement log, warn and error methods")}var _U=/^[a-z_$][a-z0-9_$:-]*$/i;function SU(n,e){let{RULES:t}=this;if((0,nb.eachItem)(n,r=>{if(t.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!_U.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function tb(n,e,t){var r;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[n]=!0,!e)return;let a={keyword:n,definition:{...e,type:(0,Df.getJSONTypes)(e.type),schemaType:(0,Df.getJSONTypes)(e.schemaType)}};e.before?wU.call(this,o,a,e.before):o.rules.push(a),i.all[n]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function wU(n,e,t){let r=n.rules.findIndex(s=>s.keyword===t);r>=0?n.rules.splice(r,0,e):(n.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function kU(n){let{metaSchema:e}=n;e!==void 0&&(n.$data&&this.opts.$data&&(e=PD(e)),n.validateSchema=this.compile(e,!0))}var EU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function PD(n){return{anyOf:[n,EU]}}});var DD=w(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var NU={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rb.default=NU});var Af=w(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.callRef=oi.getValidate=void 0;var PU=yc(),CD=On(),ln=ae(),Io=Cn(),OD=bc(),Cf=he(),RU={keyword:"$ref",schemaType:"string",code(n){let{gen:e,schema:t,it:r}=n,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=OD.resolveRef.call(c,l,s,t);if(u===void 0)throw new PU.default(r.opts.uriResolver,s,t);if(u instanceof OD.SchemaEnv)return f(u);return m(u);function d(){if(i===l)return Of(n,o,i,i.$async);let T=e.scopeValue("root",{ref:l});return Of(n,(0,ln._)`${T}.validate`,l,l.$async)}function f(T){let g=AD(n,T);Of(n,g,T,T.$async)}function m(T){let g=e.scopeValue("schema",a.code.source===!0?{ref:T,code:(0,ln.stringify)(T)}:{ref:T}),S=e.name("valid"),k=n.subschema({schema:T,dataTypes:[],schemaPath:ln.nil,topSchemaRef:g,errSchemaPath:t},S);n.mergeEvaluated(k),n.ok(S)}}};function AD(n,e){let{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,ln._)`${t.scopeValue("wrapper",{ref:e})}.validate`}oi.getValidate=AD;function Of(n,e,t,r){let{gen:s,it:i}=n,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?Io.default.this:ln.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let T=s.let("valid");s.try(()=>{s.code((0,ln._)`await ${(0,CD.callValidateCode)(n,e,l)}`),m(e),o||s.assign(T,!0)},g=>{s.if((0,ln._)`!(${g} instanceof ${i.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(T,!1)}),n.ok(T)}function d(){n.result((0,CD.callValidateCode)(n,e,l),()=>m(e),()=>f(e))}function f(T){let g=(0,ln._)`${T}.errors`;s.assign(Io.default.vErrors,(0,ln._)`${Io.default.vErrors} === null ? ${g} : ${Io.default.vErrors}.concat(${g})`),s.assign(Io.default.errors,(0,ln._)`${Io.default.vErrors}.length`)}function m(T){var g;if(!i.opts.unevaluated)return;let S=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(i.props!==!0)if(S&&!S.dynamicProps)S.props!==void 0&&(i.props=Cf.mergeEvaluated.props(s,S.props,i.props));else{let k=s.var("props",(0,ln._)`${T}.evaluated.props`);i.props=Cf.mergeEvaluated.props(s,k,i.props,ln.Name)}if(i.items!==!0)if(S&&!S.dynamicItems)S.items!==void 0&&(i.items=Cf.mergeEvaluated.items(s,S.items,i.items));else{let k=s.var("items",(0,ln._)`${T}.evaluated.items`);i.items=Cf.mergeEvaluated.items(s,k,i.items,ln.Name)}}}oi.callRef=Of;oi.default=RU});var ID=w(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var DU=DD(),CU=Af(),OU=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DU.default,CU.default];sb.default=OU});var MD=w(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var If=ae(),Es=If.operators,Mf={maximum:{okStr:"<=",ok:Es.LTE,fail:Es.GT},minimum:{okStr:">=",ok:Es.GTE,fail:Es.LT},exclusiveMaximum:{okStr:"<",ok:Es.LT,fail:Es.GTE},exclusiveMinimum:{okStr:">",ok:Es.GT,fail:Es.LTE}},AU={message:({keyword:n,schemaCode:e})=>(0,If.str)`must be ${Mf[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,If._)`{comparison: ${Mf[n].okStr}, limit: ${e}}`},IU={keyword:Object.keys(Mf),type:"number",schemaType:"number",$data:!0,error:AU,code(n){let{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,If._)`${t} ${Mf[e].fail} ${r} || isNaN(${t})`)}};ib.default=IU});var $D=w(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var wc=ae(),MU={message:({schemaCode:n})=>(0,wc.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,wc._)`{multipleOf: ${n}}`},$U={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:MU,code(n){let{gen:e,data:t,schemaCode:r,it:s}=n,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,wc._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,wc._)`${o} !== parseInt(${o})`;n.fail$data((0,wc._)`(${r} === 0 || (${o} = ${t}/${r}, ${a}))`)}};ob.default=$U});var xD=w(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});function LD(n){let e=n.length,t=0,r=0,s;for(;r<e;)t++,s=n.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=n.charCodeAt(r),(s&64512)===56320&&r++);return t}ab.default=LD;LD.code='require("ajv/dist/runtime/ucs2length").default'});var qD=w(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var ai=ae(),LU=he(),xU=xD(),qU={message({keyword:n,schemaCode:e}){let t=n==="maxLength"?"more":"fewer";return(0,ai.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:n})=>(0,ai._)`{limit: ${n}}`},jU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qU,code(n){let{keyword:e,data:t,schemaCode:r,it:s}=n,i=e==="maxLength"?ai.operators.GT:ai.operators.LT,o=s.opts.unicode===!1?(0,ai._)`${t}.length`:(0,ai._)`${(0,LU.useFunc)(n.gen,xU.default)}(${t})`;n.fail$data((0,ai._)`${o} ${i} ${r}`)}};cb.default=jU});var jD=w(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var FU=On(),$f=ae(),BU={message:({schemaCode:n})=>(0,$f.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,$f._)`{pattern: ${n}}`},UU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:BU,code(n){let{data:e,$data:t,schema:r,schemaCode:s,it:i}=n,o=i.opts.unicodeRegExp?"u":"",a=t?(0,$f._)`(new RegExp(${s}, ${o}))`:(0,FU.usePattern)(n,r);n.fail$data((0,$f._)`!${a}.test(${e})`)}};lb.default=UU});var FD=w(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var kc=ae(),VU={message({keyword:n,schemaCode:e}){let t=n==="maxProperties"?"more":"fewer";return(0,kc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,kc._)`{limit: ${n}}`},WU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:VU,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxProperties"?kc.operators.GT:kc.operators.LT;n.fail$data((0,kc._)`Object.keys(${t}).length ${s} ${r}`)}};ub.default=WU});var BD=w(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var Ec=On(),Nc=ae(),HU=he(),KU={message:({params:{missingProperty:n}})=>(0,Nc.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,Nc._)`{missingProperty: ${n}}`},zU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:KU,code(n){let{gen:e,schema:t,schemaCode:r,data:s,$data:i,it:o}=n,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let m=n.parentSchema.properties,{definedProperties:T}=n.it;for(let g of t)if(m?.[g]===void 0&&!T.has(g)){let S=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${g}" is not defined at "${S}" (strictRequired)`;(0,HU.checkStrictMode)(o,k,o.opts.strictRequired)}}function l(){if(c||i)n.block$data(Nc.nil,d);else for(let m of t)(0,Ec.checkReportMissingProp)(n,m)}function u(){let m=e.let("missing");if(c||i){let T=e.let("valid",!0);n.block$data(T,()=>f(m,T)),n.ok(T)}else e.if((0,Ec.checkMissingProp)(n,t,m)),(0,Ec.reportMissingProp)(n,m),e.else()}function d(){e.forOf("prop",r,m=>{n.setParams({missingProperty:m}),e.if((0,Ec.noPropertyInData)(e,s,m,a.ownProperties),()=>n.error())})}function f(m,T){n.setParams({missingProperty:m}),e.forOf(m,r,()=>{e.assign(T,(0,Ec.propertyInData)(e,s,m,a.ownProperties)),e.if((0,Nc.not)(T),()=>{n.error(),e.break()})},Nc.nil)}}};db.default=zU});var UD=w(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var Pc=ae(),GU={message({keyword:n,schemaCode:e}){let t=n==="maxItems"?"more":"fewer";return(0,Pc.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,Pc._)`{limit: ${n}}`},YU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GU,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxItems"?Pc.operators.GT:Pc.operators.LT;n.fail$data((0,Pc._)`${t}.length ${s} ${r}`)}};fb.default=YU});var Lf=w(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var VD=qy();VD.code='require("ajv/dist/runtime/equal").default';hb.default=VD});var WD=w(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=fc(),$t=ae(),JU=he(),XU=Lf(),QU={message:({params:{i:n,j:e}})=>(0,$t.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,$t._)`{i: ${n}, j: ${e}}`},ZU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:QU,code(n){let{gen:e,data:t,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=n;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,pb.getSchemaTypes)(i.items):[];n.block$data(c,u,(0,$t._)`${o} === false`),n.ok(c);function u(){let T=e.let("i",(0,$t._)`${t}.length`),g=e.let("j");n.setParams({i:T,j:g}),e.assign(c,!0),e.if((0,$t._)`${T} > 1`,()=>(d()?f:m)(T,g))}function d(){return l.length>0&&!l.some(T=>T==="object"||T==="array")}function f(T,g){let S=e.name("item"),k=(0,pb.checkDataTypes)(l,S,a.opts.strictNumbers,pb.DataType.Wrong),v=e.const("indices",(0,$t._)`{}`);e.for((0,$t._)`;${T}--;`,()=>{e.let(S,(0,$t._)`${t}[${T}]`),e.if(k,(0,$t._)`continue`),l.length>1&&e.if((0,$t._)`typeof ${S} == "string"`,(0,$t._)`${S} += "_"`),e.if((0,$t._)`typeof ${v}[${S}] == "number"`,()=>{e.assign(g,(0,$t._)`${v}[${S}]`),n.error(),e.assign(c,!1).break()}).code((0,$t._)`${v}[${S}] = ${T}`)})}function m(T,g){let S=(0,JU.useFunc)(e,XU.default),k=e.name("outer");e.label(k).for((0,$t._)`;${T}--;`,()=>e.for((0,$t._)`${g} = ${T}; ${g}--;`,()=>e.if((0,$t._)`${S}(${t}[${T}], ${t}[${g}])`,()=>{n.error(),e.assign(c,!1).break(k)})))}}};mb.default=ZU});var HD=w(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var gb=ae(),eV=he(),tV=Lf(),nV={message:"must be equal to constant",params:({schemaCode:n})=>(0,gb._)`{allowedValue: ${n}}`},rV={keyword:"const",$data:!0,error:nV,code(n){let{gen:e,data:t,$data:r,schemaCode:s,schema:i}=n;r||i&&typeof i=="object"?n.fail$data((0,gb._)`!${(0,eV.useFunc)(e,tV.default)}(${t}, ${s})`):n.fail((0,gb._)`${i} !== ${t}`)}};yb.default=rV});var KD=w(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var Rc=ae(),sV=he(),iV=Lf(),oV={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,Rc._)`{allowedValues: ${n}}`},aV={keyword:"enum",schemaType:"array",$data:!0,error:oV,code(n){let{gen:e,data:t,$data:r,schema:s,schemaCode:i,it:o}=n;if(!r&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,sV.useFunc)(e,iV.default)),u;if(a||r)u=e.let("valid"),n.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let m=e.const("vSchema",i);u=(0,Rc.or)(...s.map((T,g)=>f(m,g)))}n.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,m=>e.if((0,Rc._)`${l()}(${t}, ${m})`,()=>e.assign(u,!0).break()))}function f(m,T){let g=s[T];return typeof g=="object"&&g!==null?(0,Rc._)`${l()}(${t}, ${m}[${T}])`:(0,Rc._)`${t} === ${g}`}}};bb.default=aV});var zD=w(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var cV=MD(),lV=$D(),uV=qD(),dV=jD(),fV=FD(),hV=BD(),pV=UD(),mV=WD(),gV=HD(),yV=KD(),bV=[cV.default,lV.default,uV.default,dV.default,fV.default,hV.default,pV.default,mV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gV.default,yV.default];vb.default=bV});var _b=w(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.validateAdditionalItems=void 0;var ci=ae(),Tb=he(),vV={message:({params:{len:n}})=>(0,ci.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,ci._)`{limit: ${n}}`},TV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vV,code(n){let{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,Tb.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}GD(n,r)}};function GD(n,e){let{gen:t,schema:r,data:s,keyword:i,it:o}=n;o.items=!0;let a=t.const("len",(0,ci._)`${s}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,ci._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,Tb.alwaysValidSchema)(o,r)){let l=t.var("valid",(0,ci._)`${a} <= ${e.length}`);t.if((0,ci.not)(l),()=>c(l)),n.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{n.subschema({keyword:i,dataProp:u,dataPropType:Tb.Type.Num},l),o.allErrors||t.if((0,ci.not)(l),()=>t.break())})}}Dc.validateAdditionalItems=GD;Dc.default=TV});var Sb=w(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.validateTuple=void 0;var YD=ae(),xf=he(),_V=On(),SV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){let{schema:e,it:t}=n;if(Array.isArray(e))return JD(n,"additionalItems",e);t.items=!0,!(0,xf.alwaysValidSchema)(t,e)&&n.ok((0,_V.validateArray)(n))}};function JD(n,e,t=n.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=n;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=xf.mergeEvaluated.items(r,t.length,a.items));let c=r.name("valid"),l=r.const("len",(0,YD._)`${i}.length`);t.forEach((d,f)=>{(0,xf.alwaysValidSchema)(a,d)||(r.if((0,YD._)`${l} > ${f}`,()=>n.subschema({keyword:o,schemaProp:f,dataProp:f},c)),n.ok(c))});function u(d){let{opts:f,errSchemaPath:m}=a,T=t.length,g=T===d.minItems&&(T===d.maxItems||d[e]===!1);if(f.strictTuples&&!g){let S=`"${o}" is ${T}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,xf.checkStrictMode)(a,S,f.strictTuples)}}}Cc.validateTuple=JD;Cc.default=SV});var XD=w(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var wV=Sb(),kV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,wV.validateTuple)(n,"items")};wb.default=kV});var ZD=w(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var QD=ae(),EV=he(),NV=On(),PV=_b(),RV={message:({params:{len:n}})=>(0,QD.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,QD._)`{limit: ${n}}`},DV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RV,code(n){let{schema:e,parentSchema:t,it:r}=n,{prefixItems:s}=t;r.items=!0,!(0,EV.alwaysValidSchema)(r,e)&&(s?(0,PV.validateAdditionalItems)(n,s):n.ok((0,NV.validateArray)(n)))}};kb.default=DV});var eC=w(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var In=ae(),qf=he(),CV={message:({params:{min:n,max:e}})=>e===void 0?(0,In.str)`must contain at least ${n} valid item(s)`:(0,In.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,In._)`{minContains: ${n}}`:(0,In._)`{minContains: ${n}, maxContains: ${e}}`},OV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:CV,code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n,o,a,{minContains:c,maxContains:l}=r;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,In._)`${s}.length`);if(n.setParams({min:o,max:a}),a===void 0&&o===0){(0,qf.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,qf.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,qf.alwaysValidSchema)(i,t)){let g=(0,In._)`${u} >= ${o}`;a!==void 0&&(g=(0,In._)`${g} && ${u} <= ${a}`),n.pass(g);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?m(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,In._)`${s}.length > 0`,f)):(e.let(d,!1),f()),n.result(d,()=>n.reset());function f(){let g=e.name("_valid"),S=e.let("count",0);m(g,()=>e.if(g,()=>T(S)))}function m(g,S){e.forRange("i",0,u,k=>{n.subschema({keyword:"contains",dataProp:k,dataPropType:qf.Type.Num,compositeRule:!0},g),S()})}function T(g){e.code((0,In._)`${g}++`),a===void 0?e.if((0,In._)`${g} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,In._)`${g} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,In._)`${g} >= ${o}`,()=>e.assign(d,!0)))}}};Eb.default=OV});var jf=w(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.validateSchemaDeps=vr.validatePropertyDeps=vr.error=void 0;var Nb=ae(),AV=he(),Oc=On();vr.error={message:({params:{property:n,depsCount:e,deps:t}})=>{let r=e===1?"property":"properties";return(0,Nb.str)`must have ${r} ${t} when property ${n} is present`},params:({params:{property:n,depsCount:e,deps:t,missingProperty:r}})=>(0,Nb._)`{property: ${n},
180
+ missingProperty: ${r},
181
+ depsCount: ${e},
182
+ deps: ${t}}`};var IV={keyword:"dependencies",type:"object",schemaType:"object",error:vr.error,code(n){let[e,t]=MV(n);tC(n,e),nC(n,t)}};function MV({schema:n}){let e={},t={};for(let r in n){if(r==="__proto__")continue;let s=Array.isArray(n[r])?e:t;s[r]=n[r]}return[e,t]}function tC(n,e=n.schema){let{gen:t,data:r,it:s}=n;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Oc.propertyInData)(t,r,o,s.opts.ownProperties);n.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Oc.checkReportMissingProp)(n,l)}):(t.if((0,Nb._)`${c} && (${(0,Oc.checkMissingProp)(n,a,i)})`),(0,Oc.reportMissingProp)(n,i),t.else())}}vr.validatePropertyDeps=tC;function nC(n,e=n.schema){let{gen:t,data:r,keyword:s,it:i}=n,o=t.name("valid");for(let a in e)(0,AV.alwaysValidSchema)(i,e[a])||(t.if((0,Oc.propertyInData)(t,r,a,i.opts.ownProperties),()=>{let c=n.subschema({keyword:s,schemaProp:a},o);n.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),n.ok(o))}vr.validateSchemaDeps=nC;vr.default=IV});var sC=w(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var rC=ae(),$V=he(),LV={message:"property name must be valid",params:({params:n})=>(0,rC._)`{propertyName: ${n.propertyName}}`},xV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:LV,code(n){let{gen:e,schema:t,data:r,it:s}=n;if((0,$V.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",r,o=>{n.setParams({propertyName:o}),n.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,rC.not)(i),()=>{n.error(!0),s.allErrors||e.break()})}),n.ok(i)}};Pb.default=xV});var Db=w(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Ff=On(),Zn=ae(),qV=Cn(),Bf=he(),jV={message:"must NOT have additional properties",params:({params:n})=>(0,Zn._)`{additionalProperty: ${n.additionalProperty}}`},FV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jV,code(n){let{gen:e,schema:t,parentSchema:r,data:s,errsCount:i,it:o}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Bf.alwaysValidSchema)(o,t))return;let l=(0,Ff.allSchemaProperties)(r.properties),u=(0,Ff.allSchemaProperties)(r.patternProperties);d(),n.ok((0,Zn._)`${i} === ${qV.default.errors}`);function d(){e.forIn("key",s,S=>{!l.length&&!u.length?T(S):e.if(f(S),()=>T(S))})}function f(S){let k;if(l.length>8){let v=(0,Bf.schemaRefOrVal)(o,r.properties,"properties");k=(0,Ff.isOwnProperty)(e,v,S)}else l.length?k=(0,Zn.or)(...l.map(v=>(0,Zn._)`${S} === ${v}`)):k=Zn.nil;return u.length&&(k=(0,Zn.or)(k,...u.map(v=>(0,Zn._)`${(0,Ff.usePattern)(n,v)}.test(${S})`))),(0,Zn.not)(k)}function m(S){e.code((0,Zn._)`delete ${s}[${S}]`)}function T(S){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){m(S);return}if(t===!1){n.setParams({additionalProperty:S}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,Bf.alwaysValidSchema)(o,t)){let k=e.name("valid");c.removeAdditional==="failing"?(g(S,k,!1),e.if((0,Zn.not)(k),()=>{n.reset(),m(S)})):(g(S,k),a||e.if((0,Zn.not)(k),()=>e.break()))}}function g(S,k,v){let b={keyword:"additionalProperties",dataProp:S,dataPropType:Bf.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(b,k)}}};Rb.default=FV});var aC=w(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var BV=gc(),iC=On(),Cb=he(),oC=Db(),UV={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&oC.default.code(new BV.KeywordCxt(i,oC.default,"additionalProperties"));let o=(0,iC.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Cb.mergeEvaluated.props(e,(0,Cb.toHash)(o),i.props));let a=o.filter(d=>!(0,Cb.alwaysValidSchema)(i,t[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,iC.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),n.it.definedProperties.add(d),n.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Ob.default=UV});var dC=w(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var cC=On(),Uf=ae(),lC=he(),uC=he(),VV={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,data:r,parentSchema:s,it:i}=n,{opts:o}=i,a=(0,cC.allSchemaProperties)(t),c=a.filter(g=>(0,lC.alwaysValidSchema)(i,t[g]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof Uf.Name)&&(i.props=(0,uC.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let g of a)l&&m(g),i.allErrors?T(g):(e.var(u,!0),T(g),e.if(u))}function m(g){for(let S in l)new RegExp(g).test(S)&&(0,lC.checkStrictMode)(i,`property ${S} matches pattern ${g} (use allowMatchingProperties)`)}function T(g){e.forIn("key",r,S=>{e.if((0,Uf._)`${(0,cC.usePattern)(n,g)}.test(${S})`,()=>{let k=c.includes(g);k||n.subschema({keyword:"patternProperties",schemaProp:g,dataProp:S,dataPropType:uC.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,Uf._)`${d}[${S}]`,!0):!k&&!i.allErrors&&e.if((0,Uf.not)(u),()=>e.break())})})}}};Ab.default=VV});var fC=w(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var WV=he(),HV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:e,schema:t,it:r}=n;if((0,WV.alwaysValidSchema)(r,t)){n.fail();return}let s=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};Ib.default=HV});var hC=w(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var KV=On(),zV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:KV.validateUnion,error:{message:"must match a schema in anyOf"}};Mb.default=zV});var pC=w($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Vf=ae(),GV=he(),YV={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,Vf._)`{passingSchemas: ${n.passing}}`},JV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YV,code(n){let{gen:e,schema:t,parentSchema:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");n.setParams({passing:a}),e.block(l),n.result(o,()=>n.reset(),()=>n.error(!0));function l(){i.forEach((u,d)=>{let f;(0,GV.alwaysValidSchema)(s,u)?e.var(c,!0):f=n.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Vf._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Vf._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&n.mergeEvaluated(f,Vf.Name)})})}}};$b.default=JV});var mC=w(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var XV=he(),QV={keyword:"allOf",schemaType:"array",code(n){let{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,XV.alwaysValidSchema)(r,i))return;let a=n.subschema({keyword:"allOf",schemaProp:o},s);n.ok(s),n.mergeEvaluated(a)})}};Lb.default=QV});var bC=w(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var Wf=ae(),yC=he(),ZV={message:({params:n})=>(0,Wf.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Wf._)`{failingKeyword: ${n.ifClause}}`},e2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ZV,code(n){let{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,yC.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=gC(r,"then"),i=gC(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),n.reset(),s&&i){let u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,Wf.not)(a),l("else"));n.pass(o,()=>n.error(!0));function c(){let u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function l(u,d){return()=>{let f=n.subschema({keyword:u},a);e.assign(o,a),n.mergeValidEvaluated(f,o),d?e.assign(d,(0,Wf._)`${u}`):n.setParams({ifClause:u})}}}};function gC(n,e){let t=n.schema[e];return t!==void 0&&!(0,yC.alwaysValidSchema)(n,t)}xb.default=e2});var vC=w(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var t2=he(),n2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,t2.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};qb.default=n2});var TC=w(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var r2=_b(),s2=XD(),i2=Sb(),o2=ZD(),a2=eC(),c2=jf(),l2=sC(),u2=Db(),d2=aC(),f2=dC(),h2=fC(),p2=hC(),m2=pC(),g2=mC(),y2=bC(),b2=vC();function v2(n=!1){let e=[h2.default,p2.default,m2.default,g2.default,y2.default,b2.default,l2.default,u2.default,c2.default,d2.default,f2.default];return n?e.push(s2.default,o2.default):e.push(r2.default,i2.default),e.push(a2.default),e}jb.default=v2});var _C=w(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var ot=ae(),T2={message:({schemaCode:n})=>(0,ot.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,ot._)`{format: ${n}}`},_2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:T2,code(n,e){let{gen:t,data:r,$data:s,schema:i,schemaCode:o,it:a}=n,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():m();function f(){let T=t.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=t.const("fDef",(0,ot._)`${T}[${o}]`),S=t.let("fType"),k=t.let("format");t.if((0,ot._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(S,(0,ot._)`${g}.type || "string"`).assign(k,(0,ot._)`${g}.validate`),()=>t.assign(S,(0,ot._)`"string"`).assign(k,g)),n.fail$data((0,ot.or)(v(),b()));function v(){return c.strictSchema===!1?ot.nil:(0,ot._)`${o} && !${k}`}function b(){let R=u.$async?(0,ot._)`(${g}.async ? await ${k}(${r}) : ${k}(${r}))`:(0,ot._)`${k}(${r})`,O=(0,ot._)`(typeof ${k} == "function" ? ${R} : ${k}.test(${r}))`;return(0,ot._)`${k} && ${k} !== true && ${S} === ${e} && !${O}`}}function m(){let T=d.formats[i];if(!T){v();return}if(T===!0)return;let[g,S,k]=b(T);g===e&&n.pass(R());function v(){if(c.strictSchema===!1){d.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function b(O){let L=O instanceof RegExp?(0,ot.regexpCode)(O):c.code.formats?(0,ot._)`${c.code.formats}${(0,ot.getProperty)(i)}`:void 0,V=t.scopeValue("formats",{key:i,ref:O,code:L});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,ot._)`${V}.validate`]:["string",O,V]}function R(){if(typeof T=="object"&&!(T instanceof RegExp)&&T.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ot._)`await ${k}(${r})`}return typeof S=="function"?(0,ot._)`${k}(${r})`:(0,ot._)`${k}.test(${r})`}}}};Fb.default=_2});var SC=w(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var S2=_C(),w2=[S2.default];Bb.default=w2});var wC=w(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.contentVocabulary=Mo.metadataVocabulary=void 0;Mo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var EC=w(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var k2=ID(),E2=zD(),N2=TC(),P2=SC(),kC=wC(),R2=[k2.default,E2.default,(0,N2.default)(),P2.default,kC.metadataVocabulary,kC.contentVocabulary];Ub.default=R2});var Wb=w(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.dynamicAnchor=void 0;var Vb=ae(),D2=Cn(),NC=bc(),C2=Af(),O2={keyword:"$dynamicAnchor",schemaType:"string",code:n=>PC(n,n.schema)};function PC(n,e){let{gen:t,it:r}=n;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Vb._)`${D2.default.dynamicAnchors}${(0,Vb.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:A2(n);t.if((0,Vb._)`!${s}`,()=>t.assign(s,i))}Ac.dynamicAnchor=PC;function A2(n){let{schemaEnv:e,schema:t,self:r}=n.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new NC.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return NC.compileSchema.call(r,l),(0,C2.getValidate)(n,l)}Ac.default=O2});var Hb=w(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.dynamicRef=void 0;var RC=ae(),I2=Cn(),DC=Af(),M2={keyword:"$dynamicRef",schemaType:"string",code:n=>CC(n,n.schema)};function CC(n,e){let{gen:t,keyword:r,it:s}=n;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),n.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,RC._)`${I2.default.dynamicAnchors}${(0,RC.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,DC.callRef)(n,c),t.let(l,!0)}):()=>(0,DC.callRef)(n,c)}}Ic.dynamicRef=CC;Ic.default=M2});var OC=w(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var $2=Wb(),L2=he(),x2={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,$2.dynamicAnchor)(n,""):(0,L2.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};Kb.default=x2});var AC=w(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var q2=Hb(),j2={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,q2.dynamicRef)(n,n.schema)};zb.default=j2});var IC=w(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var F2=Wb(),B2=Hb(),U2=OC(),V2=AC(),W2=[F2.default,B2.default,U2.default,V2.default];Gb.default=W2});var $C=w(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var MC=jf(),H2={keyword:"dependentRequired",type:"object",schemaType:"object",error:MC.error,code:n=>(0,MC.validatePropertyDeps)(n)};Yb.default=H2});var LC=w(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var K2=jf(),z2={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,K2.validateSchemaDeps)(n)};Jb.default=z2});var xC=w(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var G2=he(),Y2={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:e,it:t}){e.contains===void 0&&(0,G2.checkStrictMode)(t,`"${n}" without "contains" is ignored`)}};Xb.default=Y2});var qC=w(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var J2=$C(),X2=LC(),Q2=xC(),Z2=[J2.default,X2.default,Q2.default];Qb.default=Z2});var FC=w(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var Ns=ae(),jC=he(),eW=Cn(),tW={message:"must NOT have unevaluated properties",params:({params:n})=>(0,Ns._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`},nW={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:tW,code(n){let{gen:e,schema:t,data:r,errsCount:s,it:i}=n;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Ns.Name?e.if((0,Ns._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,n.ok((0,Ns._)`${s} === ${eW.default.errors}`);function c(d){if(t===!1){n.setParams({unevaluatedProperty:d}),n.error(),o||e.break();return}if(!(0,jC.alwaysValidSchema)(i,t)){let f=e.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:jC.Type.Str},f),o||e.if((0,Ns.not)(f),()=>e.break())}}function l(d,f){return(0,Ns._)`!${d} || !${d}[${f}]`}function u(d,f){let m=[];for(let T in d)d[T]===!0&&m.push((0,Ns._)`${f} !== ${T}`);return(0,Ns.and)(...m)}}};Zb.default=nW});var UC=w(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});var li=ae(),BC=he(),rW={message:({params:{len:n}})=>(0,li.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,li._)`{limit: ${n}}`},sW={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:rW,code(n){let{gen:e,schema:t,data:r,it:s}=n,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,li._)`${r}.length`);if(t===!1)n.setParams({len:i}),n.fail((0,li._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,BC.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,li._)`${o} <= ${i}`);e.if((0,li.not)(c),()=>a(c,i)),n.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{n.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:BC.Type.Num},c),s.allErrors||e.if((0,li.not)(c),()=>e.break())})}}};ev.default=sW});var VC=w(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var iW=FC(),oW=UC(),aW=[iW.default,oW.default];tv.default=aW});var HC=w(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DiscrError=void 0;var WC;(function(n){n.Tag="tag",n.Mapping="mapping"})(WC||(Hf.DiscrError=WC={}))});var zC=w(rv=>{"use strict";Object.defineProperty(rv,"__esModule",{value:!0});var $o=ae(),nv=HC(),KC=bc(),cW=yc(),lW=he(),uW={message:({params:{discrError:n,tagName:e}})=>n===nv.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,$o._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},dW={keyword:"discriminator",type:"object",schemaType:"object",error:uW,code(n){let{gen:e,data:t,schema:r,parentSchema:s,it:i}=n,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,$o._)`${t}${(0,$o.getProperty)(a)}`);e.if((0,$o._)`typeof ${l} == "string"`,()=>u(),()=>n.error(!1,{discrError:nv.DiscrError.Tag,tag:l,tagName:a})),n.ok(c);function u(){let m=f();e.if(!1);for(let T in m)e.elseIf((0,$o._)`${l} === ${T}`),e.assign(c,d(m[T]));e.else(),n.error(!1,{discrError:nv.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(m){let T=e.name("valid"),g=n.subschema({keyword:"oneOf",schemaProp:m},T);return n.mergeEvaluated(g,$o.Name),T}function f(){var m;let T={},g=k(s),S=!0;for(let R=0;R<o.length;R++){let O=o[R];if(O?.$ref&&!(0,lW.schemaHasRulesButRef)(O,i.self.RULES)){let V=O.$ref;if(O=KC.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,V),O instanceof KC.SchemaEnv&&(O=O.schema),O===void 0)throw new cW.default(i.opts.uriResolver,i.baseId,V)}let L=(m=O?.properties)===null||m===void 0?void 0:m[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);S=S&&(g||k(O)),v(L,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return T;function k({required:R}){return Array.isArray(R)&&R.includes(a)}function v(R,O){if(R.const)b(R.const,O);else if(R.enum)for(let L of R.enum)b(L,O);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(R,O){if(typeof R!="string"||R in T)throw new Error(`discriminator: "${a}" values must be unique strings`);T[R]=O}}}};rv.default=dW});var GC=w((s5,fW)=>{fW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var YC=w((i5,hW)=>{hW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var JC=w((o5,pW)=>{pW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var XC=w((a5,mW)=>{mW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var QC=w((c5,gW)=>{gW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var ZC=w((l5,yW)=>{yW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var eO=w((u5,bW)=>{bW.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var tO=w(sv=>{"use strict";Object.defineProperty(sv,"__esModule",{value:!0});var vW=GC(),TW=YC(),_W=JC(),SW=XC(),wW=QC(),kW=ZC(),EW=eO(),NW=["/properties"];function PW(n){return[vW,TW,_W,SW,e(this,wW),kW,e(this,EW)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,r){return n?t.$dataMetaSchema(r,NW):r}}sv.default=PW});var nO=w((Ge,ov)=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.MissingRefError=Ge.ValidationError=Ge.CodeGen=Ge.Name=Ge.nil=Ge.stringify=Ge.str=Ge._=Ge.KeywordCxt=Ge.Ajv2019=void 0;var RW=RD(),DW=EC(),CW=IC(),OW=qC(),AW=VC(),IW=zC(),MW=tO(),iv="https://json-schema.org/draft/2019-09/schema",Lo=class extends RW.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(CW.default),DW.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(OW.default),this.addVocabulary(AW.default),this.opts.discriminator&&this.addKeyword(IW.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(MW.default.call(this,e),this.refs["http://json-schema.org/schema"]=iv)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(iv)?iv:void 0)}};Ge.Ajv2019=Lo;ov.exports=Ge=Lo;ov.exports.Ajv2019=Lo;Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=Lo;var $W=gc();Object.defineProperty(Ge,"KeywordCxt",{enumerable:!0,get:function(){return $W.KeywordCxt}});var xo=ae();Object.defineProperty(Ge,"_",{enumerable:!0,get:function(){return xo._}});Object.defineProperty(Ge,"str",{enumerable:!0,get:function(){return xo.str}});Object.defineProperty(Ge,"stringify",{enumerable:!0,get:function(){return xo.stringify}});Object.defineProperty(Ge,"nil",{enumerable:!0,get:function(){return xo.nil}});Object.defineProperty(Ge,"Name",{enumerable:!0,get:function(){return xo.Name}});Object.defineProperty(Ge,"CodeGen",{enumerable:!0,get:function(){return xo.CodeGen}});var LW=kf();Object.defineProperty(Ge,"ValidationError",{enumerable:!0,get:function(){return LW.default}});var xW=yc();Object.defineProperty(Ge,"MissingRefError",{enumerable:!0,get:function(){return xW.default}})});var Ce=G(Gw());var mu=class n{constructor(e,t,r,s){this._uri=e,this._languageId=t,this._version=r,this._content=s,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),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(let r of e)if(n.isIncremental(r)){let s=Jw(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=Yw(r.text,!1,i);if(c-a===u.length)for(let f=0,m=u.length;f<m;f++)l[f+a+1]=u[f];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=r.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,m=l.length;f<m;f++)l[f]=l[f]+d}else if(n.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Yw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,s=t.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);t[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}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}},gu;(function(n){function e(s,i,o,a){return new mu(s,i,o,a)}n.create=e;function t(s,i,o){if(s instanceof mu)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(s,i){let o=s.getText(),a=em(i.map(ZI),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=s.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=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=r})(gu||(gu={}));function em(n,e){if(n.length<=1)return n;let t=n.length/2|0,r=n.slice(0,t),s=n.slice(t);em(r,e),em(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?n[a++]=r[i++]:n[a++]=s[o++];for(;i<r.length;)n[a++]=r[i++];for(;o<s.length;)n[a++]=s[o++];return n}function Yw(n,e,t=0){let r=e?[t]:[];for(let s=0;s<n.length;s++){let i=n.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<n.length&&n.charCodeAt(s+1)===10&&s++,r.push(t+s+1))}return r}function Jw(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 ZI(n){let e=Jw(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var yu=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],bu=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Xw=G(X());var tm=(n,e,t=!0,r=!0)=>({start:{line:n?.pos.line??0,character:t?n?.pos.col??0:(n?.pos.col??0)+(n?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}}),oe=n=>tm(n.tokenIndexes.start,n.tokenIndexes.end),Qw=" ",Zw=n=>{Qw=n},ji=()=>Qw,qs=n=>yu.findIndex(e=>e===n),js=n=>bu.findIndex(e=>e===n),hn=(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)),ek=(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),tk=(n,e,t)=>{if(!n)return!1;let s=n.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var sr=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>hn(i,e,t));return r},A=(n,e,t=Xw.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>({issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a}),nk=n=>[...n].sort((t,r)=>{if(t.sortKey===void 0||r.sortKey===void 0)throw new Error("Sort keys must be set");if(t.sortKey!==r.sortKey)return t.sortKey-r.sortKey;if(!t.tokenIndexes?.end||!r.tokenIndexes?.end)throw new Error("Must have token indexes");return t.tokenIndexes.end.pos.line!==r.tokenIndexes.end.pos.line?t.tokenIndexes.end.pos.line-r.tokenIndexes.end.pos.line:t.tokenIndexes.end.pos.col-r.tokenIndexes.end.pos.col});async function Ot(n,e,t,r){let s=n.textDocument.uri.replace("file://",""),i=Fs(e,s,r);if(!i)return[];console.time("search");let a=(await i.context.getRuntime()).getDeepestAstNode(s,n.position),c=a?.ast?.firstToken.sortKey;return console.timeEnd("search"),t(a,u=>{let d=n.position;return u.uri===s?!!(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 J(n,e){return{start:n,end:e??n}}var x=(n,e)=>n?.tokens.some(t=>t===e),Xe=n=>e=>e?.value&&n===e.value?"yes":eM(n)(e),Pe=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",eM=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",ir=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&n.uri===e.uri,pn=(n,e)=>!!n&&!!e&&ir(n,e)&&n.pos.col+n.pos.len===e.pos.col,vu=n=>n.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),Fs=(n,e,t)=>vu(n).sort(s=>s.context.name===t?-1:0).find(s=>s.files.some(i=>i===e)),rk=(n,e)=>vu(n).filter(r=>r.files.some(s=>s===e));var Fi=G(X()),B=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(r=>r.getDocumentSymbols(e)??[]);if(this.uri!==e)return[];let t=oe(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(t=>t.getWorkspaceSymbols()??[]);let e=oe(this);return[{location:Fi.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===Fi.SymbolKind.File||t.kind===Fi.SymbolKind.Class||t.kind===Fi.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(qs(this.semanticTokenType),js(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 Bi=G(X());var ck=G(X());var sk=G(X()),lt=class extends B{constructor(t,r){super(r);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:sk.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}};var ok=G(X());var ik=G(X());var or=class extends B{toJson(){return-1}},ia=class extends or{constructor(t,r){super();this.expression=t;this.join=r;this.addChild(t),r&&(this.addChild(r.operator),this.addChild(r.expression))}addExpression(t,r){this.addChild(t),this.addChild(r)}toString(){return`(${this.children.map(t=>t.toString()).join(" ")})`}};var wt=class extends or{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:ik.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(){return this.value.toString()}toJson(){return this.value}};var ut=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:ok.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(t=>t.value instanceof wt)){let t=new ArrayBuffer(8),r=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}};var ak=G(X()),Zr=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:ak.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(t=>t.toString()).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}};var Fe=class extends B{constructor(t,r){super(r);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}},Qe=class extends B{constructor(t,r=[]){super();this.propertyName=t;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:ck.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),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 lt?t.value.value:t.value instanceof ut?t.value.values.map(r=>r.value instanceof wt?r.value.value:NaN):t.value instanceof Zr?t.value.values.map(r=>r.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 lk=G(X()),ar=class extends B{constructor(t,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:t,kind:lk.SymbolKind.Function}}};var kn=class extends ar{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 He=class extends ar{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 Be=class n extends B{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Ht)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 kn)}addNodeChild(e){this.addChild(e)}},Ht=class extends Be{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Bi.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Qe)}get deleteProperties(){return this.children.filter(e=>e instanceof He)}get nodes(){return this.children.filter(e=>e instanceof we)}get pathName(){return"/"}},kt=class extends Be{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:Bi.SymbolKind.Class},t.forEach(r=>{super.addChild(r)})}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:Bi.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 we)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof Qe)}get deleteProperties(){return this.children.filter(t=>t instanceof He)}},we=class n extends Be{constructor(t=[],r){super();this.labels=t;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Bi.SymbolKind.Class},r&&this.addChild(r),t.forEach(s=>{this.addChild(s)})}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:Bi.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 Qe)}get deleteProperties(){return this.children.filter(t=>t instanceof He)}},Tu=class extends B{constructor(t,r){super(r);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address.toString(16)}},Ie=class extends B{constructor(t,r,s){super(r);this.name=t;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(t){if(this._address)throw new Error("Address can only be set once");t&&(this.lastToken=void 0,this._address=t,t.forEach(r=>this.addChild(r)))}toString(){return this._address!==void 0?`${this.name}@${this._address.map(t=>t.toString()).join(",")}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(qs("type"),js("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{t(qs("decorator"),js("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}};var uk=G(X()),ke=class extends B{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:uk.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}};var lr=G(X());var bt=n=>n instanceof ar?!0:n instanceof Be?!1:n.parentNode?bt(n.parentNode):!1;var Ui=n=>[...n.filter(t=>t instanceof we||t instanceof kt).map(t=>t instanceof we?t.name:t.labelReference)].filter(t=>!!t);var ft=G(X());var dk=G(X());var Cr=class extends B{constructor(){super();this._pathParts=[]}addPath(t,r){this._pathParts.push(t),r&&this.addChild(r),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},Fn=class extends B{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:dk.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}};var et=G(X());var _u=G(X());var fk=require("path"),es=class extends B{constructor(t,r){super();this.keyword=t;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:_u.SymbolKind.File},this.addChild(t),this.addChild(r)}get reolvedPath(){return this._reolvedPath}set reolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:_u.SymbolKind.File},this._reolvedPath=t}},Vi=class extends B{constructor(t,r,s){super(s);this._path=t;this.relative=r;this.docSymbolsMeta={name:(0,fk.basename)(this.path),kind:_u.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var cr=class extends B{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var tM=async(n,e,t)=>{let r=et.Position.create(n.pos.line,n.pos.col),s=t.find(i=>hn(i,e,r));if(s)return sr(s,e,r)},nm=n=>{if(n)return n instanceof Be?n:nm(n?.parentNode)},Hi=(n,e,t=0)=>!e||e.uri!==n?t:Hi(n,nm(e.parentNode),t+1),nM=(n,e)=>async t=>{let r=await tM(t.firstToken,e,n);return!r||r===t||t.allDescendants.some(i=>i===r)?0:r instanceof Be?Hi(e,nm(r)):void 0};async function hk(n,e){let t=[],r=n.textDocument.uri.replace("file://",""),s=(await e.getRuntime()).fileTopMostAst(r);return t.push(...(await Promise.all(s.flatMap(async i=>await pk(n,i,r,nM(s,r))))).flat()),t}var Bs=(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 et.TextEdit.replace(et.Range.create(et.Position.create(n.prevToken.pos.line,n.prevToken.pos.col+n.prevToken.pos.len),et.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
183
+ `))}},Wi=(n,e,t,r="")=>{if(n.pos.line===n.prevToken?.pos.line)return et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,n.pos.col),et.Position.create(n.pos.line,n.pos.col)),`
184
+ ${r}${"".padStart(e*t.length,t)}`)},ts=(n,e,t,r="")=>et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,0),et.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${r}`),dt=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let r=Bs(n.nextToken,0);if(!r)throw new Error("remove new LinesEdit must be defined");return[et.TextEdit.insert(et.Position.create(n.pos.line,n.pos.col+n.pos.len),"".padEnd(e," ")),r]}return n.nextToken.pos.col-(n.pos.col+n.pos.len)===e?[]:[et.TextEdit.replace(et.Range.create(et.Position.create(n.pos.line,n.pos.col+n.pos.len),et.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},rM=async(n,e,t,r,s,i)=>{if(e.uri!==t)return[];let o=[],a=Wi(e.firstToken,r,s);if(a)o.push(a);else{o.push(ts(e.firstToken,r,s));let l=Bs(e.firstToken);l&&o.push(l)}if(e instanceof we||e instanceof kt)if(o.push(...e.labels.flatMap(l=>dt(l.lastToken))),e instanceof we){let l=e.name&&e.openScope?dt(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?dt(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>pk(n,l,t,i,r+1)))).flat()),e.closeScope){let l=Wi(e.closeScope,r,s);if(l)o.push(l);else{o.push(ts(e.closeScope,r,s));let u=Bs(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?dt(e.lastToken.prevToken,0):[];return o.push(...c),o},sM=(n,e,t,r)=>{let s=[];if(s.push(...dt(n.lastToken,r?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let i=Bs(n.firstToken);i&&s.push(i),s.push(ts(n.firstToken,e+1,t))}return n.value,s},iM=(n,e,t,r)=>{let s=[];return n instanceof ut||n instanceof Zr?(n.openBracket&&s.push(...dt(n.openBracket,0)),s.push(...n.values.flatMap((i,o)=>sM(i,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&s.push(...dt(n.closeBracket,0))):n?.lastToken&&r&&s.push(...dt(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),s},oM=(n,e,t,r)=>{let s=[];return s.push(...n.startLabels.flatMap((i,o)=>o+1===n.startLabels.length?[]:dt(i.lastToken))),s.push(...iM(n.value,e,t,!r||n.endLabels.length>0)),s.push(...n.endLabels.flatMap((i,o)=>o+1===n.endLabels.length?[]:dt(i.lastToken))),s},aM=(n,e,t)=>{let r=[],s=i=>{if(i&&hn(n,n.uri,et.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return n.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)r.push(...dt(a,1));else if(c?.firstToken){let l=Bs(c?.firstToken);l&&r.push(l),r.push(ts(c?.firstToken,e+1,t))}}}),[...r,...n.values.flatMap((i,o)=>i?oM(i,e,t,o+1===n.values.length):[])]},cM=(n,e,t)=>{let r=[],s=Wi(n.firstToken,e,t);if(s)r.push(s);else{r.push(ts(n.firstToken,e,t));let o=Bs(n.firstToken);o&&r.push(o)}if(r.push(...n.labels.flatMap(o=>dt(o.lastToken))),n.values){if(n.propertyName){r.push(...dt(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&r.push(...dt(a))}r.push(...aM(n.values,e,t))}let i=n.lastToken.value===";"&&n.lastToken.prevToken?dt(n.lastToken.prevToken,0):[];return r.push(...i),r},lM=(n,e,t)=>{let r=[],s=Wi(n.firstToken,e,t);s?r.push(s):r.push(ts(n.firstToken,e,t));let i=dt(n.keyword.lastToken);r.push(...i);let o=n.lastToken.value===";"&&n.lastToken.prevToken?dt(n.lastToken.prevToken,0):[];return r.push(...o),r},uM=(n,e,t,r)=>{if(t===void 0)return[];if(n.uri!==e)return[];let s=[],i=Wi(n.firstToken,t,r);i?s.push(i):s.push(ts(n.firstToken,t,r));let o=dt(n.keyword.lastToken);return s.push(...o),s},dM=(n,e,t)=>{let r=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&r.push(...dt(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return r.push(...dt(n.firstToken.prevToken)),r;if(e===void 0)return r;let s=n.firstToken.value.startsWith("*")?" ":"",i=Wi(n.firstToken,e,t,s);if(i)r.push(i);else{r.push(ts(n.firstToken,e,t,s));let o=Bs(n.firstToken);o&&r.push(o)}return r},pk=async(n,e,t,r,s=0)=>{let i=n.options.tabSize,a=n.options.insertSpaces?"".padStart(i," "):" ";return Zw(a),e instanceof Be?rM(n,e,t,s,a,r):e instanceof Qe?cM(e,s,a):e instanceof ar?lM(e,s,a):e instanceof es?uM(e,t,await r(e),a):e instanceof cr?dM(e,await r(e),a):[]};var Y=class{constructor(e,t,r="optional",s=void 0,i=[],o){this.name=e;this.type=t;this.def=s;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:ft.MarkupKind.Markdown,value:[...this.description?["### Description",this.description.join(`
178
185
 
179
186
  `)]:[],...this.examples?["### Example",this.examples.join(`
180
187
 
181
188
  `)]:[]].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=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 ze?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 ze)))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 ze){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 ze){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 ze){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 {
189
+ `)});typeof r!="function"?this.required=()=>r:this.required=r,typeof i!="function"?this.values=()=>s&&i.indexOf(s)===-1?[s,...i]:i:this.values=i}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name(e)}validateProperty(e,t,r,s){let i=this.required(t);if(s){if(i==="omitted")return[A(11,s.ast,ft.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(i==="required"){let l=e.getOrderedNodeAst(t),u=Ui(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((f,m)=>{let T=f.openScope??u[m].lastToken;return A(0,u[m],ft.DiagnosticSeverity.Error,[],[],[r],ft.TextEdit.insert(ft.Position.create(T.pos.line,T.pos.col+1),`
190
+ ${"".padEnd(Hi(u[m].uri,f)*ji().length,ji())}${r}${d};`))})]}return[]}let o=fM(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(m=>m==u)||l.some(m=>m==5)&&(u===3||u===5)||l.some(m=>m==4)&&(u===1||u===2))){let m=[];l.forEach(T=>{switch(T){case 0:m.push(1);break;case 3:m.push(2);break;case 5:m.push(3);break;case 1:m.push(5);break;case 2:m.push(6);break;case 4:m.push(7);break}}),m.length&&a.push(A(m,d,ft.DiagnosticSeverity.Error,[],[],[s.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,s.ast.values??s.ast,ft.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(A(3,s.ast.values?.values[d]??s.ast))})}else if(this.type[0].types.some(l=>l===5)?o.some(l=>c([5],l,s.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,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(l=>l!==0)?a.push(A(8,s.ast.propertyName??s.ast,ft.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(l=>!!l),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value),a.length===0&&(a.push(...this.additionalTypeCheck?.(s)??[]),this.values(s).length&&this.type[0].types.some(l=>l===3))){let l=s.ast.values?.values[0]?.value;this.values(s).some(u=>l.value===u)||a.push(A(9,s.ast.values?.values[0]?.value??s.ast,ft.DiagnosticSeverity.Error,[],[],[this.values(s).map(u=>`'${u}'`).join(" or ")]))}return a}getPropertyCompletionItems(e){let t=this.type.at(e.ast.values?.values.length??0);return t?.types.some(r=>r===3)?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(r=>({label:`"${r}"`,kind:ft.CompletionItemKind.Variable,sortText:r===this.def?`A${r}`:`Z${r}`})):t?.types.some(r=>r===1||r===2)?this.values(e).map(r=>({label:`<${r}>`,kind:ft.CompletionItemKind.Variable,sortText:r===this.def?`A${r}`:`Z${r}`})):[]}},fM=n=>n.ast.values?n.ast.values.values.map(e=>hM(e)):[0],hM=n=>n?n.value instanceof lt?3:n.value instanceof ut?n.value.values.length===1?1:n.value.values.length===2?2:4:n.value instanceof ke||n.value instanceof Fn?1:6:7,oa=class{},Ki=class extends oa{constructor(){super(...arguments);this._properties=[]}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof lt&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(A(22,c,ft.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[ft.DiagnosticTag.Unnecessary]))),s;let a=this.properties.flatMap(c=>{if(typeof c.name=="string"){let d=r.getProperty(c.name);return c.validateProperty(t,r,c.name,d)}let l=r.property.filter(d=>c.getNameMatch(d.name)),u=this.properties.filter(d=>d!==c)??[];return l.filter(d=>u.some(f=>f.getNameMatch(d.name)))?[]:l.flatMap(d=>c.validateProperty(t,r,d.name,d))});return[...s,...a]}get properties(){return this._properties}addProperty(t){Array.isArray(t)?t.forEach(r=>this._properties.push(r)):this._properties.push(t),this._properties.sort(r=>typeof r.name=="string"?1:0)}get childNodeType(){return this._childNodeType}set childNodeType(t){t&&(t.bindingsPath=this.bindingsPath,this._childNodeType=t)}getOnPropertyHover(t){let r=this.properties.find(s=>s.getNameMatch(t));return r?.onHover.bind(r)()}getPropertyListCompletionItems(t){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(t)!=="omitted"&&typeof r.name=="string").map(r=>{let s=t&&r.required(t),i=!!t.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:ft.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var Bn=class extends B{constructor(t,r,s,i){super();this.startLabels=t;this.value=r;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Kt=n=>{if(!n?.values.some(e=>!(e?.value instanceof ut)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},Ue=(n,e,t)=>{let r=n.ast.values?.values.at(e)?.value;if(r instanceof ut){let s=r.values.at(t);if(s?.value instanceof wt)return s.value.value}},Un=(n,e,t=0)=>{if(n instanceof Bn){if(n?.value instanceof ut){let r=n.value.values.at(t);if(r?.value instanceof wt)return e.getPhandle(r.value.value);if(r?.value instanceof ke)return r.value.linksTo;if(r?.value instanceof Fn)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof wt)return e.getPhandle(n.value);if(n instanceof ke)return n.linksTo;if(n instanceof Fn)return n.path?.pathParts.at(-1)?.linksTo}},mk=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof ut){let r=t.values.at(0)?.value;if(r instanceof wt)return{cellsProperty:e,node:n,value:r.value}}return{cellsProperty:e,node:n}},H=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var gk=()=>{let n=new Y("compatible",H(5));return n.description=["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 zi=G(X()),yk=()=>{let n=new Y("device_type",H(3),void 0,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 lt&&t.value!==e.parent.name)return e.parent.name==="cpu"?[A(12,e.ast,zi.DiagnosticSeverity.Error,[],[],[e.name])]:[A(13,e.ast,zi.DiagnosticSeverity.Error,[],[],[e.name])]}return[A(14,e.ast,zi.DiagnosticSeverity.Hint,[],[zi.DiagnosticTag.Deprecated],[e.name])]});return n.description=["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 bk=()=>{let n=new Y("#interrupt-cells",H(1));return n.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var vk=()=>{let n=new Y("interrupt-controller",H(0),"optional");return n.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var Tk=()=>{let n=new Y("interrupt-parent",H(1));return n.description=["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 _k=G(X()),Sk=()=>{let n=new Y("interrupts",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupt-parent"),i=r.root;return(s?Un(s?.ast.values?.values.at(0),i):r.parent)?t:s?(t.push(A(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(A(16,e.ast,_k.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.description=["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 Gi=G(X()),wk=()=>{let n=new Y("interrupts-extended",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=r.getProperty("interrupts");s&&t.push(A(15,s.ast,Gi.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=r.getProperty("interrupt-parent");i&&t.push(A(15,i.ast,Gi.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=r.root,a=Kt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=Un(a[c],o);if(!l)return t.push(A(18,a[c],Gi.DiagnosticSeverity.Error)),t;let u=mk(l);if(!u.cellsProperty)return t.push(A(16,e.ast,Gi.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],Gi.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.description=["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 kk=()=>{let n=new Y("dma-noncoherent",H(0));return n.description=["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 Ek=()=>{let n=new Y("dma-coherent",H(0));return n.description=["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 Nk=G(X()),Pk=()=>{let n=new Y("dma-ranges",H([0,4]),"optional",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ue(s,0,0)??1:1,c=i?Ue(i,0,0)??2:2,l=o?Ue(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(A(20,r.at(r.length-r.length%(c+l+a))??e.ast,Nk.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.description=["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 Rk=G(X()),Dk=()=>{let n=new Y("ranges",H([0,4]),"optional",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r?.length)return[];let s=e.parent?.getProperty("#size-cells"),i=e.parent?.getProperty("#address-cells"),o=e.parent.parent?.getProperty("#address-cells"),a=s?Ue(s,0,0)??1:1,c=i?Ue(i,0,0)??2:2,l=o?Ue(o,0,0)??2:2;return(r.length===0||r.length%(c+l+a)!==0)&&t.push(A(20,r.at(r.length-r.length%(c+l+a))??e.ast,Rk.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.description=["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
191
  compatible = "simple-bus";
185
192
  #address-cells = <1>;
186
193
  #size-cells = <1>;
@@ -195,7 +202,7 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
195
202
  };
196
203
  };`,"```"].join(`
197
204
  `),"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 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 {
205
+ `),"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 Ck=()=>{let n=new Y("virtual-reg",H(1));return n.description=["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 Su=G(X()),Ok=()=>{let n=new Y("reg",H(4),e=>e.address!==void 0?"required":"omitted",void 0,[],e=>{let t=[],r=Kt(e.ast.values);if(!r)return[];let s=e.parent.parent?.getProperty("#size-cells"),i=e.parent.parent?.getProperty("#address-cells"),o=s?Ue(s,0,0)??1:1,a=i?Ue(i,0,0)??2:2;if(r.length===0||r.length%(o+a)!==0)return t.push(A(20,r.at(r.length-r.length%(o+a))??e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:a},()=>"address"),...Array.from({length:o},()=>"cell")].join(" ")}>`])),t;for(let c=0;c<r.length;c+=o+a){let l=new ArrayBuffer(a*4),u=new DataView(l);r.slice(0,a).map((d,f)=>Ue(e,0,f)??0).forEach((d,f)=>{u.setUint32(f*4,d)}),e.parent.address&&e.parent.address?.length>1?e.parent.address?.forEach((d,f)=>{u.getUint32(f*4)!==d&&t.push(A(10,e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name]))}):e.parent.address?.length===1&&(a===2&&u.getBigUint64(0)!==BigInt(e.parent.address[0])||a===1&&u.getUint32(0)!==e.parent.address[0])&&t.push(A(10,e.ast,Su.DiagnosticSeverity.Error,[],[],[e.name]))}return t});return 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 Ak=()=>new Y("#size-cells",H(1),"optional",1);var Ik=()=>{let n=new Y("#address-cells",H(1),"optional",2);return n.description=["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
206
  #address-cells = <1>;
200
207
  #size-cells = <1>;
201
208
  serial@4600 {
@@ -206,8 +213,8 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
206
213
  interrupt-parent = <&ipic>;
207
214
  };
208
215
  };`,"```"].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 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 {
216
+ `),"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 Mk=()=>{let n=new Y("status",H(3),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.description=[`The status property indicates the operational status of a device.
217
+ The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var $k=G(X()),Lk=()=>{let n=new Y("phandle",H(1),"optional",void 0,[],e=>{let t=Ue(e,0,0);if(t){let r=e.parent.root.getAllPhandle(t);if(r.length>1&&r.at(-1)===e.parent)return[A(19,e.ast.values?.values.at(0)??e.ast,$k.DiagnosticSeverity.Error,r.slice(0,-1).flatMap(s=>s.getProperty("phandle")?.ast).filter(s=>!!s),[],[e.name])]}return[]});return n.description=["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
218
  phandle = <1>;
212
219
  interrupt-controller;
213
220
  reg = <0x10000000 0x100>;
@@ -215,18 +222,29 @@ ${"".padEnd(pc(u[g].uri,p)*ad().length,ad())}${i}${d};`))})]}return[]}let o=aP(r
215
222
  `),"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
223
  interrupt-parent = <1>;
217
224
  };`,"```"].join(`
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 y=Re(g,0,0),w=Re(_,0,0);if(y==null||w==null)break;if(c+=y+w,s.length<c){let R=l+u+1+y+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:y},()=>"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 ze))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 ze){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 ze){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
- `:""}${this.properties.map(e=>e.toString()).join(`
225
+ `)],n};var xk=()=>{let n=new Y("model",H(3));return n.description=["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 wu=G(X()),qk=()=>{let n=new Y("name",H(3),"optional",void 0,[],e=>[A(14,e.ast,wu.DiagnosticSeverity.Warning,[],[wu.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var Yi=G(X());var jk=()=>{let n=new Y("interrupt-map",H(4),"optional",void 0,[],e=>{let t=[],r=e.parent,s=e.parent.root,i=Kt(e.ast.values);if(!i?.length)return[];let o=r.getProperty("#address-cells"),a=r.getProperty("#interrupt-cells");if(!a)return t.push(A(16,e.ast,Yi.DiagnosticSeverity.Error,[...r.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`])),t;let c=0;for(;c<i.length;){let l=o?Ue(o,0,0):2,u=Ue(a,0,0);if(l==null||u==null)return t;let d=0;if(c+=l+u,i.length<c+1){let k=l+u+1;t.push(A(21,i[i.length-1],Yi.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((i.length-d)%k===0?k:(i.length-d)%k).join(" ")}`]));break}let f=Un(i[c],s);if(!f){t.push(A(18,i[c],Yi.DiagnosticSeverity.Error));break}let m=f.getProperty("#address-cells"),T=f.getProperty("#interrupt-cells");if(!T){t.push(A(16,i[c],Yi.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${r.path.slice(1).join("/")}`]));break}c++;let g=m?Ue(m,0,0):2,S=Ue(T,0,0);if(g==null||S==null)break;if(c+=g+S,i.length<c){let k=l+u+1+g+S;t.push(A(21,i[i.length-1],Yi.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:l},()=>"ChildAddress"),...Array.from({length:u},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:g},()=>"ParentUnitAddress"),...Array.from({length:S},()=>"ParentInterruptSpecifier")].slice((i.length-d)%k===0?k:(i.length-d)%k).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=Ue(o,0,0),f=Ue(a,0,0);if(d==null||f==null||!(u.value instanceof ut))return t}return t});return n.description=["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 Fk=()=>{let n=new Y("interrupt-map-mask",H(4));return n.description=["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 Ji=G(X()),Bk=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map"),H(4),"optional",void 0,[],e=>{let t=e.name.split("-map",1)[0],r=[],s=e.parent,i=e.parent.root,o=s.getProperty(`#${t}-cells`);if(!o)return r.push(A(16,e.ast,Ji.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;let a=Ue(o,0,0);if(a==null)return r;let c=Kt(e.ast.values);if(!c?.length)return[];let l=0,u=0;for(;l<c.length;){if(l+=a,c.length<l+1){let T=a+1;r.push(A(21,c[c.length-1],Ji.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((c.length-u)%T===0?T:(c.length-u)%T).join(" ")}`]));break}let d=Un(c[l],i);if(!d){r.push(A(18,c[l],Ji.DiagnosticSeverity.Error));break}let f=d.getProperty(`#${t}-cells`);if(!f)return r.push(A(16,c[l],Ji.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[e.name,`#${t}-cells`,`/${s.path.slice(1).join("/")}`])),r;l++;let m=Ue(f,0,0);if(m==null)break;if(l+=m,c.length<l){let T=a+1+m;r.push(A(21,c[c.length-1],Ji.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:a},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:m},()=>"ParentSpecifier")].slice((c.length-u)%T===0?T:(c.length-u)%T).join(" ")}`]));break}u=l}return r});return n.description=["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 Uk=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-mask"),H(4));return n.description=["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 Vk=()=>{let n=new Y(e=>e.startsWith("interrupt-")?!1:!!e.endsWith("-map-pass-thru"),H(4));return n.description=["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 Wk=()=>{let n=new Y(e=>e.startsWith("#address-")||e.startsWith("#interrupt-")||e.startsWith("#size-")?!1:e.startsWith("#")&&!!e.endsWith("-cells"),H(1));return n.list=!0,n.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function ns(){let n=new Ki;return n.addProperty([gk(),xk(),Lk(),Mk(),Ik(),Ak(),Ok(),Ck(),Dk(),Pk(),Ek(),kk(),qk(),yk(),Sk(),Tk(),wk(),bk(),vk(),jk(),Fk(),Bk(),Uk(),Vk(),Wk()]),n}var Ee=class n{constructor(e,t,r,s=null){this.bindingLoader=e;this.name=t;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this._nodeTypes=[ns()];s?.addNode(this)}static toJson(e){let t={};return e.property.forEach(r=>t[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>t[r.fullName]=n.toJson(r)),t}get nodeTypes(){let e=this.parent?.nodeType?.childNodeType;return e?[e]:this._nodeTypes??[ns()]}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 Ui([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let r=[...this.definitions,...this.referencedBy].find(s=>hn(s,e,t));if(r){let s=this.deletes.map(c=>({item:this,ast:sr(c,e,t)})).find(c=>hn(c.ast,e,t));if(s)return s;let i=[...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===";"?hn(c.ast,e,t):ek(c.ast,e,t));if(i)return i.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=sr(r,e,t);return{item:this,ast:a}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof we).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.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.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){return[...this.property.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:lr.DiagnosticSeverity.Hint,astElement:e.property.ast,linkedTo:[e.by],tags:[lr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]},...e.property.allReplaced.map(t=>({issues:[6],severity:lr.DiagnosticSeverity.Hint,astElement:t.ast,linkedTo:[e.by],tags:[lr.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof we),...e.node.referencedBy].flatMap(t=>({issues:[7],severity:lr.DiagnosticSeverity.Hint,astElement:t,linkedTo:[e.by],tags:[lr.DiagnosticTag.Deprecated],templateStrings:[t instanceof we?t.name.toString():t.labelReference.label.value]}))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get property(){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(r=>r.name===e&&(r.address===t||r.address?.every((s,i)=>t?.at(i)===s)))}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,r){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===r||r?.every((o,a)=>i.address?.at(a)===o)));s!==-1&&(this._deletedNodes.push({node:this._nodes[s],by:t}),this._nodes.splice(s,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 ut){let r=t.values[0].value;if(r instanceof wt&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof ut){let r=t.values[0].value;if(r instanceof wt&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,t,r=!0){let s=r||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===t||o.address?.every((a,c)=>t?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,t){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:t}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(r=>r.name===e.name);if(t===-1)this._properties.push(e);else{let r=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[ns()])}getChild(e,t=!0){let r=[...e];r.splice(0,1);let s=r[0].split("@"),i=s[0],o=s[1]!==void 0?s[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(i,o,t);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!t(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}toString(){return`${this.labels.map(e=>e.toString()).join(" ")} ${this.fullName} {${this.property.length?`
226
+ `:""}${this.property.map(e=>e.toString()).join(`
220
227
  `)}${this.nodes.length?`
221
228
  ${this.nodes.map(e=>`${e.fullName}{ /* ... */ };`).join(`
222
229
  `)}`:""}
223
- };`}toMarkupContent(){return{kind:En.MarkupKind.Markdown,value:["### Current State","```devicetree",this.toString(),"```",...this.nodeType?.description?["### Description",this.nodeType?.description]:[]].join(`
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}:`}},Xe=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 Qe=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
230
+ };`}toMarkupContent(){return{kind:lr.MarkupKind.Markdown,value:["### Current State","```devicetree",this.toString(),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
231
+ `)}}};var Eu=G(X());var rm=G(X());var rs=class extends B{constructor(t,r){super(r);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:rm.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.value}:`}},ht=class extends B{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value,kind:rm.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let r=this.parentNode;if(!(r instanceof ke&&r.linksTo)){super.buildSemanticTokens(t);return}t(qs("type"),js("declaration"),{start:this.firstToken,end:this.lastToken})}};var pt=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){return{item:this,ast:sr(this.ast,e,t)}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof rs)}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:Eu.DiagnosticSeverity.Hint,astElement:this.replaces.ast,linkedTo:[this.ast],tags:[Eu.DiagnosticTag.Unnecessary],templateStrings:[this.name]}]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}};var Kk=G(X());var Pu=require("fs");var Nu=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
232
  `,`
226
- `).split(/\n/).map(i=>`${i}
233
+ `).split(/\n/).map(r=>`${r}
227
234
  `),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 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(Se));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 y=new kn(G(p,a()));g.push(y),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([Se(45),Se(45),Se(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.currentToken;if(!i)return this.popStack(),!1;let r=i,s=i;if(M(i,26))this.moveToNextToken;else{let y=this.checkConcurrentTokens([Se(13),Ve("include"),Se(13)]);if(y.length!==3)return this.popStack(),!1;r=y[0],s=y.at(-1)}let o=r?.pos.line,a=new st(G(r,s));i=this.moveToNextToken;let c=i,l=!!M(i,21);if(!c||!l&&!M(i,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=i?.value??"";else for(;this.currentToken?.pos.line===o&&!M(this.currentToken,4);)u+=this.currentToken?.value??"",i=this.moveToNextToken;let d=new Cr(u,l,G(c,i)),p=new ci(a,d);this.dtsIncludes.push(p),l||(this.currentToken?.pos.line!==o||!M(this.currentToken,4)?this._issues.push(A(12,p)):(i=this.moveToNextToken,d.lastToken=i)),this.mergeStack();let g=this.peekIndex(),_=this.resolveInclude(p);if(p.reolvedPath=_,_||this._issues.push(A(36,p.path,tv.DiagnosticSeverity.Warning)),_&&!_.endsWith(".h")){hi().requestTokens(_,!0);let y=new n(_,this.incudes,this.macros);await y.stable,this.tokens.splice(t,g-t,...y.tokens),this.nodes.push(...y.nodes),this.dtsIncludes.push(...y.dtsIncludes)}else this.tokens.splice(t,g-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(Se));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([Se(49)]);if(r.length){let o=this.consumeAnyConcurrentTokens([19,20].map(Se)),a=o.length?Number.parseInt(o.map(l=>l.value).join(""),16):NaN,c=new ke(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 ke(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(Se));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(Se));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 Xe(i,G(t[0],t.at(-1)));return this.mergeStack(),r}isLabelAssign(t){this.enqueueToStack();let i=this.consumeAnyConcurrentTokens([19,47,48].map(Se));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 Xe(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([Se(13),Ve("d"),Ve("ts"),Se(16),Ve("v"),Ve("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([Se(13),Ve("omit"),Se(16),Ve("if"),Se(16),Ve("no"),Se(16),Ve("ref"),Se(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([Se(13),Ve("d"),Ve("e"),Ve("lete"),Se(16),Ve("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([Se(13),Ve("d"),Ve("e"),Ve("lete"),Se(16),Ve("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 ze(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([Ve("0"),Ve("x")]);if(t.length!==2){this.popStack();return}let i=this.consumeAnyConcurrentTokens([19,20].map(Se));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(Se));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(Se));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 ke){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 Qe(e,t)),e.children.forEach(r=>this.processChild(r,t,i))}processDeleteNode(e,t,i){if(e.nodeNameOrRef instanceof ke&&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 Qe)||!(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} {
235
+ `)&&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 r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===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 r=this._tokens.at(-1);return t&&!r?.tokens.some(s=>s===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},r=this._tokens.at(-1);t.prevToken=r,r&&(r.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 r=this.lineNumber,s=this.columnNumber,i=this.getString(t[0]);return this.pushToken({tokens:[21],value:i,pos:{col:s-1,line:r,len:i.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 Hk,sm=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(r=>({...r}));return t.forEach((r,s)=>{r.prevToken=t[s-1],r.nextToken=t[s+1]}),t}needsRenew(e,t){return this.fileMap.get(e)?.text!==t}renewLexer(e,t){if(!e||!(0,Pu.existsSync)(e))return[];try{t??=(0,Pu.readFileSync)(e).toString();let r=new Nu(t,e);return this.fileMap.set(e,r),n.clone(r.tokens)}catch{}return[]}requestTokens(e,t){let r=this.fileMap.get(e)?.tokens;return!r&&t?[...this.renewLexer(e)]:n.clone(r??[])}reset(e){this.fileMap.delete(e)}};function Vn(){return Hk??=new sm,Hk}var Ru=class n{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new Ee(this.context.bindingLoader,"/");this.labelsUsedCache=new Map}static{this.getFileTopMostAst=(e,t)=>e.uri===t?[e]:e.children.flatMap(r=>n.getFileTopMostAst(r,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 s=this.fileTopMostAst(e).find(i=>hn(i,e,t)||tk(Vn().requestTokens(e,!1),i,t));if(s instanceof kt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:sr(s,e,t)}}else if(s instanceof Ht&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof we&&s.path){let i=n.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:sr(s,e,t)}}static getNodeFromPath(e,t,r=!0){if(e.length===0)return t;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=t.getNode(i,a,r);return l?n.getNodeFromPath(c,l,r):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof Be)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{t.has(r.label.label.value)?t.get(r.label.label.value)?.push(r):t.set(r.label.label.value,[r])}),Array.from(t).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof Ee);if(!s.every(a=>a&&a.owner===i?.owner)||!i){let a=s.filter(c=>!(c&&c.owner===i?.owner));e.push(A(4,s.at(0).label,Kk.DiagnosticSeverity.Error,s.slice(1).map(c=>c.label),[],[s.at(0).label.label.value]))}}}),e}get typesIssues(){let e=t=>[...t.nodeType?.getIssue(this,t)??[],...t.nodes.flatMap(r=>e(r))];return e(this.rootNode)}getOrderedNodeAst(e){return nk([...e.definitions,...e.referencedBy])}};var mt=class extends B{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var zk=G(X()),Du=class extends B{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:zk.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(t=>t?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(t=>t?.toJson())}};var Gk=G(X()),Cu=class extends B{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:Gk.SymbolKind.Function}}};var ur=class extends B{constructor(t,r){super();this.value=t;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(){return`${this.labels.map(t=>t.toString()).join(" ")}${this.value?.toString()??"NULL"}`}};var im=G(X());var Ou=class extends or{constructor(t,r,s){super(r);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:im.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Au=class extends or{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:im.SymbolKind.Function,range:oe(this),selectionRange:oe(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(t)??[])}]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}};var Yk=G(X());var Xi=class extends or{constructor(t,r){super(r);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:Yk.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Iu=class extends B{constructor(t,r){super(r);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var ss=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||this.currentToken?.uri!==e.uri)return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(t){let o=new B(J(s,i));this._issues.push(A(22,o))}return i};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(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=pn(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=pn(r,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 r=[],s=(i,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;r.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),r.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!e.length){this.popStack();return}let t=e.map(s=>s.value).join("");if(!t.match(/^[_A-Za-z]/)){this.popStack();return}let r=new Xi(t,J(e[0],e.at(-1)));return this.mergeStack(),r}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,r;if(x(e,40)?(r="&",x(this.currentToken,40)&&(r="&&",t=this.moveToNextToken)):x(e,10)?(r="!",x(this.currentToken,0)&&(r="==",t=this.moveToNextToken)):x(e,8)?(r="|",x(this.currentToken,8)&&(r="||",t=this.moveToNextToken)):x(e,9)?r="^":x(e,4)?(r=">",x(this.currentToken,4)?(r="<<",t=this.moveToNextToken):x(this.currentToken,0)&&(r=">=",t=this.moveToNextToken)):x(e,5)?(r=">",x(this.currentToken,5)?(r=">>",t=this.moveToNextToken):x(this.currentToken,0)&&(r="<=",t=this.moveToNextToken)):x(e,15)?r="+":x(e,16)?r="-":x(e,17)?r="*":x(e,13)?r="/":x(e,18)?r="%":x(e,46)&&x(this.currentToken,46)&&(r="##",t=this.moveToNextToken),r){let s=new Iu(r,J(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=[],o=[];for(o[0]=[];!t(this.currentToken);){let l=this.moveToNextToken;if(r?.(l)&&(o[o.length]=[]),l&&(i.push(l),o[o.length-1].push(l)),e(this.currentToken)){let u=this.parseScopedBlock(e,t,r);u&&(i.push(u),o[o.length-1].push(u.startToken,...u.splitTokens.flat(),u.endToken))}}let a=this.moveToNextToken,c={startToken:s,items:i,splitTokens:o,endToken:a};return this.mergeStack(),c}getTokenIndex(e){return e?this.tokens.findIndex(t=>t===e):-1}};var om=require("fs"),Qi=require("path");var $u=class n extends ss{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let r=0;r<this.tokens.length;r++){let s=n.processBlockComments(this.tokens,r)||n.processLineComments(this.tokens,r);s&&(r=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=Vn().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,r){let s=[],i=()=>(s.push(r++),t[r]),o=()=>t[r],a=()=>t[r-1],c=o(),l=c;if(!c||!x(c,13)||(l=i(),!x(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!x(a(),17)||!x(o(),13)||!pn(a(),o())),d=l.pos.line,f=c,m=[];l=i();do{if(o()?.pos.line!==d){let g=new cr(J(f,a()));m.push(g),d=o().pos.line??0,f=o()}l=i()}while(r<t.length&&!u());let T=new cr(J(f,o()));return m.push(T),i(),{comments:m,tokenUsed:s,index:r-1}}static processLineComments(t,r){let s=[];if(!x(t[r],13)||t.length===r+1||!x(t[r+1],13)||!pn(t[r],t[r+1]))return;let i=[];for(;t[r].pos.line===t.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=t[s.at(-1)],a=new cr(J(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var Lu=class extends B{constructor(t,r){super(t);this.content=r}toString(){let t=this.content.filter(r=>!x(r,14));return t.map((r,s)=>{let i=r.value;return r.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-r.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},xu=class extends B{constructor(t,r,s){super();this.keyword=t;this.identifier=r;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Xi?this.identifier.name:this.identifier.functionName.name}toString(){return[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" ")}};var Jk=G(X());var qu=class extends mt{toString(){return"..."}},ju=class extends B{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return this.uri!==t?[]:[{name:this.functionName.name,kind:Jk.SymbolKind.Function,range:oe(this),selectionRange:oe(this),children:this.params.flatMap(r=>r.getDocumentSymbols(t))}]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var ca=class extends B{constructor(e){super(e)}},Fu=class extends B{constructor(t,r){super();this.keyword=t;this.content=r;this.addChild(t)}},la=class extends Fu{constructor(t,r,s){super(t,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},Bu=class extends la{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Uu=class extends Fu{};var Vu=class extends B{constructor(t,r,s){super();this.ifDef=t;this.endIf=r;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier?.name)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var Xk=G(X()),Wu=class n extends ss{constructor(t,r,s=new Map){super();this.uri=t;this.incudes=r;this.macros=s;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o))}reset(){super.reset(),this.macros.clear(),Array.from(this.macroSnapShot).forEach(([t,r])=>this.macros.set(t,r)),this.nodes=[],this.dtsIncludes=[]}async reparse(){let t=this.stable;return this.parsing=new Promise(r=>{t.then(()=>{this.reset(),this.parse().then(r)})}),this.parsing}async parse(){let t=new $u(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.prevToken.uri!==this.currentToken?.uri)){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,s=this.currentToken?.uri,i=await this.processInclude()||this.processDefinitions()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!x(r,25))return this.popStack(),!1;let s=new mt(J(r)),i=this.isFunctionDefinition()||this.processCIdentifier();if(!i)return this._issues.push(A(30,s)),this.mergeStack(),!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Lu(J(o[0],o.at(-1)),o));let c=new xu(s,i,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=[],r=this.prevToken;for(;ir(r,this.currentToken)||r&&x(r,14)&&r.pos.line+1===this.currentToken?.pos.line;)r=this.moveToNextToken,r&&t.push(r);return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let r=this.moveToNextToken;if(!x(r,42)){this.popStack();return}let s=[],i=this.processCIdentifier()||this.processVariadic();for(;i;)s.push(i),!x(this.currentToken,24)&&!x(this.currentToken,43)?this._issues.push(A(28,i)):x(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier()||this.processVariadic();let o=new ju(t,s);return x(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(A(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(45),Pe(45),Pe(45)]);if(t.length!==3){this.popStack();return}let r=new qu(J(t[0],t.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let t=this.peekIndex(),r=this.parseScopedBlock(s=>{let i=this.getTokenIndex(s)-1;return!!s&&[33,34].some(o=>x(s,o))&&!ir(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[37].some(o=>x(s,o))&&!ir(this.tokens.at(i),s)},s=>{let i=this.getTokenIndex(s)-1;return!!s&&[36].some(o=>x(s,o))&&!ir(this.tokens.at(i),s)});if(r&&(x(r.startToken,33)||x(r.startToken,34))){let s;x(r.startToken,33)?s=this.processIfDefBlock(r,(o,a,c)=>new la(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>new Bu(o,a??null,c)),this.nodes.push(s),s.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,r){this.enqueueToStack();let s=new mt(J(t.startToken)),i=new mt(J(t.endToken));this.positionStack[this.positionStack.length-1]=this.getTokenIndex(t.startToken)+1;let o=this.processCIdentifier();o||this._issues.push(A(31,s));let a=this.getTokenIndex(t.splitTokens[0].at(-1)),c=new ca(J(this.currentToken,this.tokens[a])),l=r(s,o??null,c),u;if(t.splitTokens.length>1){let f=this.getTokenIndex(t.splitTokens[1][0]),m=new mt(J(this.tokens[f])),T=new ca(J(this.tokens[f+1],t.splitTokens[1].at(-1)));u=new Uu(m,T)}let d=new Vu(l,i,u);return this.mergeStack(),d}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,Qi.resolve)((0,Qi.dirname)(t.uri),t.path.path),...this.incudes.map(r=>(0,Qi.resolve)(r,t.path.path))].find(r=>(0,om.existsSync)(r)):this.incudes.map(r=>(0,Qi.resolve)(r,t.path.path)).find(r=>(0,om.existsSync)(r))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if(x(r,26))this.moveToNextToken;else{let g=this.checkConcurrentTokens([Pe(13),Xe("include"),Pe(13)]);if(g.length!==3)return this.popStack(),!1;s=g[0],i=g.at(-1)}let o=s,a=new mt(J(s,i));r=this.moveToNextToken;let c=r,l=!!x(r,21);if(!c||!l&&!x(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!x(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new Vi(u,l,J(c,r)),f=new es(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!x(this.currentToken,4)?this._issues.push(A(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let m=this.peekIndex(),T=this.resolveInclude(f);if(f.reolvedPath=T,T||this._issues.push(A(36,f.path,Xk.DiagnosticSeverity.Warning)),T&&!T.endsWith(".h")){Vn().requestTokens(T,!0);let g=new n(T,this.incudes,this.macros);await g.stable,this.tokens.splice(t,m-t,...g.tokens),this.nodes.push(...g.nodes),this.dtsIncludes.push(...g.dtsIncludes)}else this.tokens.splice(t,m-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var Qk=G(X()),Hu=class extends B{constructor(t,r,s){super();this.keyword=t;this.startAddress=r;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:Qk.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var Zk=G(X()),Ku=class extends B{constructor(t,r){super();this.keyword=t;this.bitsSize=r;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:Zk.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var eE=G(X()),ua=class extends ss{constructor(t,r,s=new Map){super();this.uri=t;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new Be;this.unhandledStatements=new Ht;this.cPreprocessorParser=new Wu(this.uri,this.incudes,s)}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 Be,this._issues=[],this.unhandledStatements=new Ht}async reparse(){let t=performance.now(),r=this.stable;return this.parsing=new Promise(s=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),s()})}),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 r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new B(J(s));this._issues.push(A(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(A(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(A(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!x(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!x(s,i))return this.popStack(),!1;let o=new Ht;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let r=this.currentToken;if(x(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new B(J(s));this._issues.push(A(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return x(this.currentToken,3)||x(this.currentToken,1)}endStatement(t=!0){let r=this.currentToken;if(!x(r,1)){let s=this.prevToken;if(s&&t){let i=new B(J(this.prevToken));return this._issues.push(A(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;x(this.currentToken,1);){let t=this.moveToNextToken;if(t){let r=new B(J(t));this._issues.push(A(23,r))}}}processNode(t,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,r)||this.isProperty(t)||this.isDeleteNode(t,r)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new B(J(o));this._issues.push(A(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let r=[],s=this.isLabelAssign(t);for(;s;)r.push(s),s=this.isLabelAssign(t);return r}isChildNode(t,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new kt(i):new we(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!x(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(A(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof kt?(c.labelReference=a,l=!0):o&&c instanceof we&&(l=o.address!==void 0,c.name=o),x(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}processNodeAddress(){let t=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(Pe)),s=r.length?Number.parseInt(r.map(o=>o.value).join(""),16):NaN;if(t){if(Number.isNaN(s)){let o=new B(J(t));this._issues.push(A(8,o))}else if(!Number.isNaN(s)&&!pn(t,r[0])){let o=new B(J(t,r.at(0)));this._issues.push(A(29,o))}}return new Tu(s,J(r[0]??this.prevToken,r.at(-1)))}processNodeAddresse(t){this.enqueueToStack();let r=this.checkConcurrentTokens([Pe(49)]);if(r.length){if(!pn(t.lastToken,r[0])){let o=new B(J(t.lastToken,r[0]));this._issues.push(A(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),x(this.currentToken,24)){if(this.prevToken&&!pn(this.prevToken,this.currentToken)){let o=new B(J(this.prevToken,this.currentToken));this._issues.push(A(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Pe));if(!t.length){this.popStack();return}let r=t.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Ie(r,J(t[0],t.at(-1))),i=this.processNodeAddresse(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Pe));if(!t.length){this.popStack();return}let r=new Fe(t.map(s=>s.value).join(""),J(t[0],t.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!t.length){this.popStack();return}let r=t.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new ht(r,J(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Pe));if(!r.length){this.popStack();return}let s=r.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&x(i,50),a=new rs(new ht(s,J(r[0],r.at(-1))),J(r[0],o?i:r.at(-1)));if(o){let c=r.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.col+c.pos.len)&&this._issues.push(A(29,new B(J(c,i)))),this.moveToNextToken}else if(t)this._issues.push(A(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(x(this.currentToken,2)||x(this.currentToken,49))return this.popStack(),!1;let i=new Qe(s,r),o;x(this.currentToken,0)?(this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(A(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,t.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("ts"),Pe(16),Xe("v"),Xe("1")]);if(t.length!==6)return this.popStack(),!1;let r=t[0],s=r,i=new mt;i.firstToken=r;let o=new Cu(i);if(this.others.push(o),x(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(A(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("memreserve")]);if(t.length!==2)return this.popStack(),!1;let r=new mt;r.firstToken=t[0];let i=t[0];x(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(A(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new Hu(r,o,a);return this.others.push(c),o||this._issues.push(A(37,r)),a||this._issues.push(A(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("b"),Xe("its")]);if(t.length!==3){this.popStack();return}let r=new mt;r.firstToken=t[0];let i=t[0];x(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(A(21,r)));let o=this.processDec(),a=new Ku(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(A(40,o)):this._issues.push(A(39,r)),this._issues.push(A(41,a,eE.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([Pe(13),Xe("omit"),Pe(16),Xe("if"),Pe(16),Xe("no"),Pe(16),Xe("ref"),Pe(13)]);if(t.length!==9){this.popStack();return}let r=new mt(J(t[0],t.at(-1)));return this.mergeStack(),r}isDeleteNode(t,r){this.enqueueToStack();let s=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("e"),Xe("lete"),Pe(16),Xe("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new mt;if(a.firstToken=i,s.length===1&&!x(this.currentToken,2)){this._issues.push(A(25,a)),a.lastToken=s.at(-1);let d=new kn(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(A(c.startsWith("/delete-n")?34:25,a)):x(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(A(21,a));let l=new kn(a);if(ir(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(A(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(A(7,f));let m=d||f?void 0:this.isNodeName();m&&r==="Ref"&&this._issues.push(A(10,m)),!d&&!m&&!f&&this._issues.push(A([7,10],l)),l.nodeNameOrRef=d??f??m??null}else r==="Name"?this._issues.push(A(7,a)):r==="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 r=this.checkConcurrentTokens([Pe(13),Xe("d"),Xe("e"),Xe("lete"),Pe(16),Xe("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new mt;if(o.firstToken=s,r.length===1&&!x(this.currentToken,2)){this._issues.push(A(25,o)),o.lastToken=r.at(-1);let u=new He(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(A(a.startsWith("/delete-p")?35:25,o)):x(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(A(21,o));let c=new He(o);if(ir(o.tokenIndexes?.end,s)){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),r=this.processNodePathRef();if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new Bn(t,r,s);return this.mergeStack(),i}processValue(t){this.enqueueToStack();let s=(()=>{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(;!x(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=x(this.currentToken,24);if(d)this.moveToNextToken;else if(!ir(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let m=new B(J(u,this.currentToken));this._issues.push(A(0,m))}if(!d&&f===null)break;if(l&&!d&&f){let m=new B(J(l));this._issues.push(A(28,m))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new Du(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!x(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let s=r.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new lt(s,J(r));r.value.match(/["']$/)||this._issues.push(A(r.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new Bn(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(x(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new Bn(r,o,a,s);x(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(A(12,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,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!x(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.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 Zr(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(A(14,a)));let c=new Bn(t,a,o);x(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=r,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let r=t(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new ut(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new ur(s,r);return this.mergeStack(),i}processHex(){this.enqueueToStack();let t=this.checkConcurrentTokens([Xe("0"),Xe("x")]);if(t.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(Pe));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(o=>o.value).join(""),16),i=new wt(s,J(t[0],r.at(-1)));return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Pe));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new wt(s,J(r[0],r.at(-1))),o=new ur(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new ur(s,r);return this.mergeStack(),i}processDec(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19].map(Pe));if(!t.length){this.popStack();return}let r=Number.parseInt(t.map(i=>i.value).join(""),10),s=new wt(r,J(t[0],t.at(-1)));return this.mergeStack(),s}processLabeledExpression(t=!0,r=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression();if(!i){this.popStack();return}let o=new ur(i,s);return this.mergeStack(),o}isFunctionCall(){this.enqueueToStack();let t=this.processCIdentifier();if(!t){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}let s=new Au(t,r);return this.mergeStack(),s}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.processExpression();if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new Bn(t,r,s);return this.mergeStack(),i}processExpression(){this.enqueueToStack();let t=!1,r,s;x(this.currentToken,42)&&(t=!0,r=this.moveToNextToken,s=r);let i=this.isFunctionCall()||this.processCIdentifier()||this.processHex()||this.processDec();if(!i){this.popStack();return}if(t){let o=this.isOperator();for(;o;){let a=this.processExpression();a?i instanceof ia?i.addExpression(o,a):i=new ia(i,{operator:o,expression:a}):this._issues.push(A(27,o)),o=this.isOperator()}x(this.currentToken,43)?s=this.moveToNextToken:this._issues.push(A(26,o??i))}return this.mergeStack(),i}processMacroCallParams(){return x(this.currentToken,42)?this.parseScopedBlock(s=>!!x(s,42),s=>!!x(s,43),s=>!!x(s,24))?.splitTokens.map((s,i)=>{if(s.length===0||x(s[0],24)&&s.length===1)return null;let o=i?s.slice(1):s;return new Ou(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(""),J(o[0],o.at(-1)),i)}):void 0}isLabelRef(t){this.enqueueToStack();let r=this.currentToken;if(x(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new ke(null);return this._issues.push(A(18,t??o)),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.col+r.pos.len)&&this._issues.push(A(29,new B(J(r,s.firstToken))));let i=new ke(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(t);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new Bn(r,s,i);return this.mergeStack(),o}processRefValue(t,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!x(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new ur(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(A([18,9],r));let l=new ur(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new ur(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,r=new Cr){this.enqueueToStack();let s;if(x(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(A(19,new B(J(this.prevToken))))}let i=this.isNodeName();return i||this._issues.push(A(7,new B(J(s??this.prevToken)))),r.addPath(i??null,s?new B(J(s)):void 0),this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,r=t;if(!x(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!x(r,2)){this.popStack();return}let i=this.processNodePath(),o=new Fn(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!pn(l.lastToken,c)){this._issues.push(A(29,new B(J(l.lastToken,c))));return}if(u===0&&s&&!pn(s,l?.firstToken)){this._issues.push(A(29,new B(J(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!pn(l.lastToken,d.firstToken)&&this._issues.push(A(29,new B(J(l.lastToken,d?.firstToken))))}),x(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(A(3,new B(J(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof es)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Zi=G(X());var tE=require("fs"),nE=require("path");var eo=class{constructor(e,t,r,s=[],i){this.includePaths=t;this.bindingLoader=r;this._issues=[];this.overlays=[];this.overlays=Array.isArray(s)?s:[s],this.overlays.filter(tE.existsSync),this.parser=new ua(e,t),this.name=i??(0,nE.basename)(e),this.overlayParsers=this.overlays?.map(o=>new ua(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 s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>i.ast.uri===e&&(!t||hn(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof lt&&l.compatible===o.value.value);return c?{range:oe(o.value),target:`file://${c.bindingsPath}`}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>i.uri===e&&(!t||hn(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:oe(i.path),target:`file://${o}`}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],r=t(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof ke){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(A(3,o,Zi.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof Cr){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 f=a?.getNode(d.name,d.address?.map(m=>m.address),!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(A(8,d,Zi.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(m=>m?.linksTo).map(m=>m?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}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 Ru(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof cr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>r.sortKey=s),this.linkPropertiesLabelsAndNodePaths(t),console.log("evaluate",performance.now()-e),t}processRoot(e,t){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,t.rootNode,t)}}processChild(e,t,r){e instanceof Be?this.processDtcBaseNode(e,t,r):e instanceof Qe?this.processDtcProperty(e,t,r):e instanceof kn?this.processDeleteNode(e,t,r):e instanceof He&&this.processDeleteProperty(e,t,r)}checkNodeUniqueNames(e,t){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.address===void 0||c.address.every((l,u)=>a.address?.at(u)?.address===l))),s=t.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof we&&o.name)r(i.map(a=>({name:a.name,address:a.address?.map(c=>c.address)})),o.name)&&this._issues.push(A(2,o.name)),i.push(o.name);else if(o instanceof kn&&o.nodeNameOrRef instanceof Ie){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.address?.map(u=>u.address)})),c)))}})}processDtcBaseNode(e,t,r){e instanceof Ht?this.processDtcRootNode(e,r):e instanceof we?this.processDtcChildNode(e,t,r):e instanceof kt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((r,s)=>r instanceof Qe&&s instanceof He||s instanceof Qe&&r instanceof He?0:s instanceof Qe?1:0).forEach(r=>this.processChild(r,t.rootNode,t))}processDtcChildNode(e,t,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new Ee(this.bindingLoader,e.name.name,e.name.address?.map(a=>a.address),t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,t,r))}processDtcRefNode(e,t){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=t.rootNode.getChild(s),e.labelReference.linksTo=r,e.labels.forEach(i=>i.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(i=>{t.labelsUsedCache.set(i.label.value,s)}),r?(t.references.push(e),this.checkNodeUniqueNames(e,r)):t.unlinkedRefNodes.push(e)):(this._issues.push(A(3,e.labelReference,Zi.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof Be&&i instanceof Be?0:s instanceof Be?-1:0).forEach(s=>this.processChild(s,r??new Ee(this.bindingLoader,""),t))}processDtcProperty(e,t,r){e.propertyName?.name&&t.addProperty(new pt(e,t)),e.children.forEach(s=>this.processChild(s,t,r))}processDeleteNode(e,t,r){if(e.nodeNameOrRef instanceof Ie&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(s=>s.address)))this._issues.push(A(5,e.nodeNameOrRef));else{t.deletes.push(e);let s=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.address?.map(i=>i.address));e.nodeNameOrRef.linksTo=s,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.address?.map(i=>i.address)),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof ke&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),t.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(A(3,e.nodeNameOrRef,Zi.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Fn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.address?.map(m=>m.address),!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}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||(r.unlinkedDeletes.push(e),c&&this._issues.push(A(8,c,Zi.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=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Be&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,r))}processDeleteProperty(e,t,r){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(s=>this.processChild(s,t,r))}};var Et=G(X());var rE=require("fs"),to=require("path");function pM(n){if(!n||!(n.ast instanceof Vi))return[];let e=r=>r.flatMap(s=>(0,rE.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,to.join)((0,to.relative)(s,i.parentPath),i.name)}`,kind:Et.CompletionItemKind.File})));if(n.ast.relative)return e([(0,to.dirname)(n.ast.uri)]);let t=n.runtime.context.includePaths;return e(t)}var zu=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>zu(t.node,e)),...n.nodes.flatMap(t=>zu(t,e))],am=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>am(t.node,e)),...n.nodes.flatMap(t=>am(t,e))];function mM(n,e){if(!n||!(n.item instanceof pt)||!(n.ast instanceof ke))return[];let t=r=>am(r,e);return Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Method}))}function gM(n,e){if(!n||n.item!==null||!(n.ast instanceof ke)||!(n.ast.parentNode instanceof kt))return[];let t=r=>zu(r,e).filter(s=>e(s));return[...Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
229
236
  $1
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 ke||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 Qe&&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 ke)&&!(n.ast instanceof Xe))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 ke)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 Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&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 Qe&&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 Xe))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 Xe&&e.ast.parentNode instanceof pe&&e.ast.parentNode.linksTo?i(e.ast.parentNode.linksTo):[]}function lv(n){if(!n||!(n.ast instanceof ke))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 ke)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 ke&&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 Qe&&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 ke)&&!(n.ast instanceof Xe))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 Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&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 Qe&&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 ke)&&!(n.ast instanceof Xe))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 Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof ke&&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 Qe)||!(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 Qe&&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 Qe?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 ke){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 Qe&&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 y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){l=!0,s++;continue}if(y==="]"&&o&&!c){u=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!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){y>d?i.push(fo(d)+"-"+fo(y)):y===d&&i.push(fo(y)),d="",s++;continue}if(n.startsWith("-]",s+1)){i.push(fo(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=y,s+=2;continue}i.push(fo(y)),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 y=i[0].length===2?i[0].slice(-1):i[0];return[o0(y),!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 y=e.charAt(g++);if(s||y==="\\"){s=!s,_+=y;continue}if(o){g===a+1?(y==="^"||y==="!")&&(c=!0):y==="]"&&!(g===a+2&&c)&&(o=!1),_+=y;continue}else if(y==="["){o=!0,a=g,c=!1,_+=y;continue}if(!r.noext&&SE(y)&&e.charAt(g)==="("){t.push(_),_="";let w=new n(y,t);g=n.#y(e,w,g,r),t.push(w);continue}_+=y}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[_,y,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,y=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=y?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 y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),w=!y&&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:y?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
- 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 y;if(typeof u=="string"?(y=d===u,this.debug("string match",u,d,y)):(y=u.test(d),this.debug("pattern match",u,d,y)),!y)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:y,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=y,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=(y,w=!1)=>{let{aborted:R}=o.signal,v=i.ignoreFetchAbort&&y!==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&&(y===void 0?T.__staleWhileFetching?this.#r[t]=T.__staleWhileFetching:this.#O(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,y,c.options))),y},u=y=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=y),d(y)),d=y=>{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 y},p=(y,w)=>{let R=this.#o?.(e,s,c);R&&R instanceof Promise&&R.then(v=>y(v===void 0?void 0:v),w),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(y(void 0),i.allowStaleOnFetchAbort&&(y=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:y,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,y);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,y),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"),He=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;[He]=!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[He])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[He])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[He]||(!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[He]}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[He])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[He]&&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!==He&&this[He])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[He])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(He,()=>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(He,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(He,u),this.pause(),s({value:d,done:!!this[Wn]})},l=()=>{this.off("error",a),this.off("data",c),this.off(He,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(He,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(He,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(He,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[He])return e?this.emit("error",e):this.emit(He),this;this[He]=!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(He),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:y,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=y,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 y=u--;l=l.child(_,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).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 y=_.length;if(!y)return p();let w=()=>{--y===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):y||d()},y=!0;g.readdirCB(_,!0),y=!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 y of _)(!s||s(y))&&(a.write(i?y:y.fullpath())||(p=!0));u--;for(let y of _){let w=y;if(y.isSymbolicLink()){if(!(r&&(w=y.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 y=[s,o,a,c,""].join("/"),w=[u,d,p,g,""].join("/");this.#e=[y,...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 ke)&&!(n.ast instanceof Xe))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 Xe&&n.ast.parentNode instanceof pe&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof ke&&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)));
237
+ };`,kind:Et.CompletionItemKind.Value,insertTextFormat:Et.InsertTextFormat.Snippet}))]}function yM(n,e){let t=s=>s?s.parentNode instanceof kt||s.parentNode instanceof Ht||s.parentNode instanceof we?!1:t(s.parentNode):!0;if(!n||n.item!==null||!bt(n.ast)||!t(n.ast))return[];let r=s=>zu(s,e).filter(i=>e(i));return n.ast instanceof mt?r(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(n.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:`${s}`,kind:Et.CompletionItemKind.Variable}))}function bM(n,e){if(!n||!(n.item instanceof Ee)||n.item===null)return[];let t=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof we)).filter(s=>e(s));return n.ast instanceof Ie||n.ast instanceof kn?Array.from(new Set(t(n.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",insertText:"/delete-node/$1;",kind:Et.CompletionItemKind.Keyword,insertTextFormat:Et.InsertTextFormat.Snippet,sortText:"~"}]:[]}function vM(n,e){if(!n||!(n.item instanceof Ee))return[];let t=r=>[...r.property,...r.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return n.ast instanceof Fe||n.ast instanceof He?Array.from(new Set(t(n.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:Et.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:Et.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:Et.InsertTextFormat.Snippet}]:[]}function TM(n,e){let t=n?.ast instanceof Cr?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof Cr))return[];let r=t.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!bt(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:Et.CompletionItemKind.Variable}))}async function sE(n,e,t){return Ot(n,e,(r,s)=>[...vM(r,s),...bM(r,s),...yM(r,s),...TM(r,s),...gM(r,s),...mM(r,s),...pM(r)],t)}var Us=G(X());function _M(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof Qe)return Us.Location.create(`file://${s.uri}`,oe(s.propertyName??s));if(s instanceof He)return Us.Location.create(`file://${s.uri}`,oe(s.propertyName??s))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Ee&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function SM(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof ht))return[];let e=t=>[...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions].map(r=>{if(r instanceof we)return Us.Location.create(`file://${r.uri}`,oe(r.name??r));if(r instanceof Ie)return Us.Location.create(`file://${r.uri}`,oe(r));if(r instanceof ke)return Us.Location.create(`file://${r.uri}`,oe(r.label??r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?bt(n.ast)?[...e(n.ast.linksTo),Us.Location.create(`file://${n.ast.uri}`,oe(n.ast))]:e(n.ast.linksTo):[]}async function iE(n,e,t){return Ot(n,e,r=>[...SM(r),..._M(r)],t)}var is=G(X());function oE(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof Qe||s instanceof He)&&s.propertyName)return is.Location.create(`file://${s.uri}`,oe(s.propertyName))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Ee&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function aE(n,e){if(!e||!(e.ast instanceof ht))return[];"newName"in n&&(e.ast.parentNode instanceof ke&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof rs&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof we).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return is.Location.create(`file://${i.uri}`,oe(i))}).filter(i=>i);return e.item instanceof Ee&&!bt(e.ast)?r(e.item):e.ast instanceof ht&&e.ast.parentNode instanceof ke&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function cE(n){if(!n||!(n.ast instanceof Ie))return[];let e=t=>[...t.linkedNodeNamePaths,...t.definitions].map(r=>{if(r instanceof we&&r.name)return is.Location.create(`file://${r.uri}`,oe(r.name));if(r instanceof Ie)return is.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof Ie&&n.ast.linksTo?bt(n.ast)?[...e(n.ast.linksTo),is.Location.create(`file://${n.ast.uri}`,oe(n.ast))]:e(n.ast.linksTo):[]}async function lE(n,e,t){let r={};return(await Ot(n,e,i=>[...cE(i),...aE(n,i),...oE(i)],t)).forEach(i=>{r[i.uri]??=[],r[i.uri].push(is.TextEdit.replace(i.range,n.newName))}),{changes:r}}async function uE(n,e,t,r){let s=await Ot(n,e,i=>[...cE(i),...aE(n,i),...oE(i)],r);if(s.some(i=>t.some(o=>i.uri.replace("file://","").startsWith(o))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!s.length}}var Gu=G(X());function wM(n){if(!n||n.item===null||!(n.ast instanceof Fe))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof Qe)return Gu.Location.create(`file://${s.uri}`,oe(s.propertyName??s))}).filter(s=>s);if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Ee&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function kM(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof ht))return[];let e=t=>[...t.definitions,...t.referencedBy].map(r=>{if(r instanceof we)return Gu.Location.create(`file://${r.uri}`,oe(r));if(r instanceof kt)return Gu.Location.create(`file://${r.uri}`,oe(r))}).filter(r=>r);return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?e(n.ast.linksTo):[]}async function dE(n,e,t){return Ot(n,e,r=>[...kM(r),...wM(r)],t)}var cm=G(X());function EM(n){if(!n||n.item===null||!(n.ast instanceof Fe))return;let e=r=>r.replaces?e(r.replaces):r,t=r=>cm.Location.create(`file://${r.ast.uri}`,oe(r.ast.propertyName??r.ast));if(n.item instanceof pt&&n.ast instanceof Fe)return t(e(n.item));if(n.item instanceof Ee&&n.ast instanceof Fe&&n.ast.parentNode instanceof He){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(e(r))}}function NM(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof ht))return;let e=t=>{let r=t.definitions.at(0);return r?cm.Location.create(`file://${r.uri}`,oe(r)):void 0};if(n.item instanceof Ee&&!bt(n.ast))return e(n.item);if(n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Ie&&n.ast.linksTo)return e(n.ast.linksTo)}async function fE(n,e,t){return(await Ot(n,e,r=>[NM(r)||EM(r)],t)).at(0)}var ee=G(X());var PM=(n,e,t,r,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(ee.Range.create(ee.Position.create(r.range.start.line,n.pos.col+n.pos.len),ee.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ee.TextEdit.insert(ee.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},RM=(n,e,t,r,s,i,o)=>{if(!i)return[];switch(t){case 0:return[{title:o??`Add Property "${i.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}];case 26:return i?[{title:o??"TODO",diagnostics:[r],kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[i]}}}]:[];default:return}};function hE(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>PM(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>RM(c.firstToken,c.lastToken,l,a,n.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===ee.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==ee.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return r.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)}),[...s,...t.map(a=>({...a,kind:ee.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:ee.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ee.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}function DM(n){if(!n||!(n.item instanceof pt)||!(n.ast instanceof Qe&&(n.ast.values||n.ast.values===null)))return[];let e=n.item.parent.nodeType;return e instanceof Ki?e.properties.find(t=>t.name===n.item?.name)?.getPropertyCompletionItems(n.item)??[]:[]}function CM(n){if(!n||!(n.item instanceof pt&&n.ast instanceof Fe&&n.item.ast.values==null||n.item instanceof Ee)||bt(n.ast))return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return n.item instanceof pt?e(n.item.parent):e(n.item)}async function pE(n,e,t){return Ot(n,e,r=>[...DM(r),...CM(r)],t)}function OM(n){if(n?.item instanceof Ee)return{contents:n.item.toMarkupContent(),range:oe(n.ast)};if(n?.ast instanceof Ie){let e=n.ast.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}if(n?.ast.parentNode instanceof ke){let e=n.ast.parentNode.linksTo;if(e)return{contents:e.toMarkupContent(),range:oe(n.ast)}}}function AM(n){if(n?.item instanceof pt&&n.ast instanceof Fe){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:oe(n.ast)}}}function mE(n,e,t){return Ot(n,e,r=>[OM(r)||AM(r)],t)}var cv=G(Vg());var w0=G(m0(),1);var Ua=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var uq={"[: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]},Va=n=>n.replace(/[[\]\\-]/g,"\\$&"),dq=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),g0=n=>n.join(""),y0=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<n.length;){let g=n.charAt(i);if((g==="!"||g==="^")&&i===t+1){l=!0,i++;continue}if(g==="]"&&o&&!c){u=i+1;break}if(o=!0,g==="\\"&&!c){c=!0,i++;continue}if(g==="["&&!c){for(let[S,[k,v,b]]of Object.entries(uq))if(n.startsWith(S,i)){if(d)return["$.",!1,n.length-t,!0];i+=S.length,b?s.push(k):r.push(k),a=a||v;continue e}}if(c=!1,d){g>d?r.push(Va(d)+"-"+Va(g)):g===d&&r.push(Va(g)),d="",i++;continue}if(n.startsWith("-]",i+1)){r.push(Va(g+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=g,i+=2;continue}r.push(Va(g)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,n.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[dq(g),!1,u-t,!1]}let f="["+(l?"^":"")+g0(r)+"]",m="["+(l?"":"^")+g0(s)+"]";return[r.length&&s.length?"("+f+"|"+m+")":r.length?f:m,a,u-t,!0]};var Kn=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var fq=new Set(["!","?","+","*","@"]),b0=n=>fq.has(n),hq="(?!(?:^|/)\\.\\.?(?:$|/))",Kd="(?!\\.)",pq=new Set(["[","."]),mq=new Set(["..","."]),gq=new Set("().*{}+?[]^$\\!"),yq=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kg="[^/]",v0=Kg+"*?",T0=Kg+"+?",ho=class n{type;#e;#t;#i=!1;#r=[];#o;#T;#l;#d=!1;#a;#c;#s=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#T=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)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.#r.map(e=>String(e)).join("|")+")":this.#c=this.#r.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#o;for(;r;){for(let s=t.#T+1;!r.type&&s<r.#r.length;s++)for(let i of e.#r){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#r[s])}t=r,r=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.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#T===0)return!0;let e=this.#o;for(let t=0;t<this.#T;t++){let r=e.#r[t];if(!(r instanceof n&&r.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.#r.length:0;return this.#T===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 r of this.#r)t.copyIn(r);return t}static#y(e,t,r,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let m=r,T="";for(;m<e.length;){let g=e.charAt(m++);if(i||g==="\\"){i=!i,T+=g;continue}if(o){m===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(m===a+2&&c)&&(o=!1),T+=g;continue}else if(g==="["){o=!0,a=m,c=!1,T+=g;continue}if(!s.noext&&b0(g)&&e.charAt(m)==="("){t.push(T),T="";let S=new n(g,t);m=n.#y(e,S,m,s),t.push(S);continue}T+=g}return t.push(T),m}let l=r+1,u=new n(null,t),d=[],f="";for(;l<e.length;){let m=e.charAt(l++);if(i||m==="\\"){i=!i,f+=m;continue}if(o){l===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(l===a+2&&c)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=l,c=!1,f+=m;continue}if(b0(m)&&e.charAt(l)==="("){u.push(f),f="";let T=new n(m,u);u.push(T),l=n.#y(e,T,l,s);continue}if(m==="|"){u.push(f),f="",d.push(u),u=new n(null,t);continue}if(m===")")return f===""&&t.#r.length===0&&(t.#s=!0),u.push(f),f="",t.push(...d,u),l;f+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new n(null,void 0,t);return n.#y(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"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.#r.map(m=>{let[T,g,S,k]=typeof m=="string"?n.#f(m,this.#t,c):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||k,T}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&mq.has(this.#r[0]))){let T=pq,g=t&&T.has(l.charAt(0))||l.startsWith("\\.")&&T.has(l.charAt(2))||l.startsWith("\\.\\.")&&T.has(l.charAt(4)),S=!t&&!e&&T.has(l.charAt(0));u=g?hq:S?Kd:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,Kn(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#h(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,Kn(this.toString()),!1,!1]}let o=!r||e||t||!Kd?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!t?Kd:"")+T0;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Kd:"")+v0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,Kn(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(gq.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=y0(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){r&&e==="*"?i+=T0:i+=v0,t=!0;continue}if(c==="?"){i+=Kg,t=!0;continue}i+=yq(c)}return[i,Kn(e),!!t,o]}};var po=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var zt=(n,e,t={})=>(Ua(e),!t.nocomment&&e.charAt(0)==="#"?!1:new mn(e,t).match(n)),bq=/^\*+([^+@!?\*\[\(]*)$/,vq=n=>e=>!e.startsWith(".")&&e.endsWith(n),Tq=n=>e=>e.endsWith(n),_q=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),Sq=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),wq=/^\*+\.\*+$/,kq=n=>!n.startsWith(".")&&n.includes("."),Eq=n=>n!=="."&&n!==".."&&n.includes("."),Nq=/^\.\*+$/,Pq=n=>n!=="."&&n!==".."&&n.startsWith("."),Rq=/^\*+$/,Dq=n=>n.length!==0&&!n.startsWith("."),Cq=n=>n.length!==0&&n!=="."&&n!=="..",Oq=/^\?+([^+@!?\*\[\(]*)?$/,Aq=([n,e=""])=>{let t=k0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Iq=([n,e=""])=>{let t=E0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},Mq=([n,e=""])=>{let t=E0([n]);return e?r=>t(r)&&r.endsWith(e):t},$q=([n,e=""])=>{let t=k0([n]);return e?r=>t(r)&&r.endsWith(e):t},k0=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},E0=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},N0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",_0={win32:{sep:"\\"},posix:{sep:"/"}},Lq=N0==="win32"?_0.win32.sep:_0.posix.sep;zt.sep=Lq;var It=Symbol("globstar **");zt.GLOBSTAR=It;var xq="[^/]",qq=xq+"*?",jq="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Fq="(?:(?!(?:\\/|^)\\.).)*?",Bq=(n,e={})=>t=>zt(t,n,e);zt.filter=Bq;var Nn=(n,e={})=>Object.assign({},n,e),Uq=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return zt;let e=zt;return Object.assign((r,s,i={})=>e(r,s,Nn(n,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Nn(n,i))}static defaults(s){return e.defaults(Nn(n,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Nn(n,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Nn(n,i))}},unescape:(r,s={})=>e.unescape(r,Nn(n,s)),escape:(r,s={})=>e.escape(r,Nn(n,s)),filter:(r,s={})=>e.filter(r,Nn(n,s)),defaults:r=>e.defaults(Nn(n,r)),makeRe:(r,s={})=>e.makeRe(r,Nn(n,s)),braceExpand:(r,s={})=>e.braceExpand(r,Nn(n,s)),match:(r,s,i={})=>e.match(r,s,Nn(n,i)),sep:e.sep,GLOBSTAR:It})};zt.defaults=Uq;var P0=(n,e={})=>(Ua(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,w0.default)(n));zt.braceExpand=P0;var Vq=(n,e={})=>new mn(n,e).makeRe();zt.makeRe=Vq;var Wq=(n,e,t={})=>{let r=new mn(e,t);return n=n.filter(s=>r.match(s)),r.options.nonull&&!n.length&&n.push(e),n};zt.match=Wq;var S0=/[?*]|[+@!]\(.*?\)|\[|\]/,Hq=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Ua(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||N0,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=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!S0.test(i[2]))&&!S0.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][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 r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],l=r[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let u=r.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<t.length;)if(e[s]===t[i])o.push(a==="b"?t[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(r&&t[i]==="**"&&e[s]===t[i+1])o.push(t[i]),i++;else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[i]),s++,i++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),k=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!k&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,R=v?3:k?0:void 0;if(typeof b=="number"&&typeof R=="number"){let[O,L]=[e[b],t[R]];O.toLowerCase()===L.toLowerCase()&&(t[R]=O,R>b?t=t.slice(R):b>R&&(e=e.slice(b)))}}let{optimizationLevel:i=1}=this.options;i>=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===It){this.debug("GLOBSTAR",[t,u,d]);var f=o,m=a+1;if(m===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var T=e[f];if(this.debug(`
238
+ globstar while`,e,f,t,m,T),this.matchOne(e.slice(f),t.slice(m),r))return this.debug("globstar found match!",f,c,T),!0;if(T==="."||T===".."||!s.dot&&T.charAt(0)==="."){this.debug("dot detected!",e,f,t,m);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
239
+ >>> no match, partial?`,e,f,t,m),f===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return P0(this.pattern,this.options)}parse(e){Ua(e);let t=this.options;if(e==="**")return It;if(e==="")return"";let r,s=null;(r=e.match(Rq))?s=t.dot?Cq:Dq:(r=e.match(bq))?s=(t.nocase?t.dot?Sq:_q:t.dot?Tq:vq)(r[1]):(r=e.match(Oq))?s=(t.nocase?t.dot?Iq:Aq:t.dot?Mq:$q)(r):(r=e.match(wq))?s=t.dot?Eq:kq:(r=e.match(Nq))&&(s=Pq);let i=ho.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}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,r=t.noglobstar?qq:t.dot?jq:Fq,s=new Set(t.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?Hq(u):u===It?It:u._src});return l.forEach((u,d)=>{let f=l[d+1],m=l[d-1];u!==It||m===It||(m===void 0?f!==void 0&&f!==It?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=m+"(?:\\/|"+r+")?":f!==It&&(l[d-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=It))}),l.filter(u=>u!==It).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].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 r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return zt.defaults(e).Minimatch}};zt.AST=ho;zt.Minimatch=mn;zt.escape=po;zt.unescape=Kn;var X0=require("node:url");var mo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,D0=new Set,zg=typeof process=="object"&&process?process:{},C0=(n,e,t,r)=>{typeof zg.emitWarning=="function"?zg.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},zd=globalThis.AbortController,R0=globalThis.AbortSignal;if(typeof zd>"u"){R0=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},zd=class{constructor(){e()}signal=new R0;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let n=zg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,C0("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 Kq=n=>!D0.has(n),e8=Symbol("type"),ms=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),O0=n=>ms(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?go:null:null,go=class extends Array{constructor(e){super(e),this.fill(0)}},Gg=class n{heap;length;static#e=!1;static create(e){let t=O0(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}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]}},Wa=class n{#e;#t;#i;#r;#o;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#g;#y;#h;#f;#w;#m;#k;#E;#v;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#v,sizes:e.#k,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#f},free:e.#w,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,r,s,i)=>e.#q(t,r,s,i),moveToTail:t=>e.#F(t),indexes:t=>e.#P(t),rindexes:t=>e.#R(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#T}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:T=0,sizeCalculation:g,fetchMethod:S,memoMethod:k,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:O,ignoreFetchAbort:L}=e;if(t!==0&&!ms(t))throw new TypeError("max option must be a nonnegative integer");let V=t?O0(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=T||this.#t,this.sizeCalculation=g,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(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=k,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=S,this.#S=!!S,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#s=new Array(t).fill(void 0),this.#g=new V(t),this.#y=new V(t),this.#h=0,this.#f=0,this.#w=Gg.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#r=u,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#_=!!this.#i,this.#p=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!ms(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ms(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ms(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!ms(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}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";Kq(j)&&(D0.add(j),C0("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}#D(){let e=new go(this.#e),t=new go(this.#e);this.#v=e,this.#E=t,this.#A=(i,o,a=mo.now())=>{if(t[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(i)&&this.#O(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{t[i]=e[i]!==0?mo.now():0},this.#n=(i,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=r||s();let l=i.now-c;i.remainingTTL=a-l}};let r=0,s=()=>{let i=mo.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#b=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#n=()=>{};#A=()=>{};#b=()=>!1;#C(){let e=new go(this.#e);this.#d=0,this.#k=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#$=(t,r,s,i)=>{if(this.#u(r))return 0;if(!ms(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,t),!ms(s))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 s},this.#M=(t,r,s)=>{if(e[t]=r,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#x(!0)}this.#d+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#M=(e,t,r)=>{};#$=(e,t,r,s)=>{if(r||s)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.#f;!(!this.#L(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#L(t)||((e||!this.#b(t))&&(yield t),t===this.#f));)t=this.#g[t]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#c[e];t!==void 0&&!this.#u(this.#s[e])&&(yield t)}}*values(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#R()){let s=this.#s[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#R({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 r=this.#s[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#v&&this.#E){let o=this.#v[t],a=this.#E[t];if(o&&a){let c=o-(mo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#k&&(i.size=this.#k[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#c[t],s=this.#s[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#v&&this.#E){o.ttl=this.#v[t];let a=mo.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=mo.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#$(e,t,r.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.#f:this.#w.length!==0?this.#w.pop():this.#l===this.#e?this.#x(!1):this.#l,this.#c[d]=e,this.#s[d]=t,this.#a.set(e,d),this.#g[this.#f]=d,this.#y[d]=this.#f,this.#f=d,this.#l++,this.#M(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(t!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=f;m!==void 0&&!o&&(this.#_&&this.#i?.(m,e,"set"),this.#p&&this.#m?.push([m,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]));if(this.#I(d),this.#M(d,u,c),this.#s[d]=t,c){c.set="replace";let m=f&&this.#u(f)?f.__staleWhileFetching:f;m!==void 0&&(c.oldValue=m)}}else c&&(c.set="update")}if(s!==0&&!this.#v&&this.#D(),this.#v&&(l||this.#A(d,s,i),c&&this.#n(c,d)),!o&&this.#p&&this.#m){let f=this.#m,m;for(;m=f?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#x(!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.#r?.(...t)}}}#x(e){let t=this.#h,r=this.#c[t],s=this.#s[t];return this.#S&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(s,r,"evict"),this.#p&&this.#m?.push([s,r,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#s[t]=void 0,this.#w.push(t)),this.#l===1?(this.#h=this.#f=0,this.#w.length=0):this.#h=this.#g[t],this.#a.delete(r),this.#l--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,i=this.#a.get(e);if(i!==void 0){let o=this.#s[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(i))s&&(s.has="stale",this.#n(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#n(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!r&&this.#b(s))return;let i=this.#s[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,t,r,s){let i=t===void 0?void 0:this.#s[t];if(this.#u(i))return i;let o=new zd,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(g,S=!1)=>{let{aborted:k}=o.signal,v=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(k&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,v&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),k&&!v&&!S)return d(o.signal.reason);let b=m;return this.#s[t]===m&&(g===void 0?b.__staleWhileFetching?this.#s[t]=b.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),d(g)),d=g=>{let{aborted:S}=o.signal,k=S&&r.allowStaleOnFetchAbort,v=k||r.allowStaleOnFetchRejection,b=v||r.noDeleteOnFetchRejection,R=m;if(this.#s[t]===m&&(!b||R.__staleWhileFetching===void 0?this.#O(e,"fetch"):k||(this.#s[t]=R.__staleWhileFetching)),v)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw g},f=(g,S)=>{let k=this.#o?.(e,i,c);k&&k instanceof Promise&&k.then(v=>g(v===void 0?void 0:v),S),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=v=>l(v,!0)))})};r.status&&(r.status.fetchDispatched=!0);let m=new Promise(f).then(l,u),T=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,T,{...c.options,status:void 0}),t=this.#a.get(e)):this.#s[t]=T,T}#u(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof zd}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=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:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:k,signal:v}=t;if(!this.#S)return k&&(k.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:k});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:T,ignoreFetchAbort:m,status:k,signal:v},R=this.#a.get(e);if(R===void 0){k&&(k.fetch="miss");let O=this.#q(e,R,b,g);return O.__returned=O}else{let O=this.#s[R];if(this.#u(O)){let Oe=r&&O.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",Oe&&(k.returnedStale=!0)),Oe?O.__staleWhileFetching:O.__returned=O}let L=this.#b(R);if(!S&&!L)return k&&(k.fetch="hit"),this.#F(R),s&&this.#N(R),k&&this.#n(k,R),O;let V=this.#q(e,R,b,g),re=V.__staleWhileFetching!==void 0&&r;return k&&(k.fetch=L?"stale":"refresh",re&&L&&(k.returnedStale=!0)),re?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#T;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=t,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=r(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#s[a],l=this.#u(c);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#O(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,t){this.#y[t]=e,this.#g[e]=t}#F(e){e!==this.#f&&(e===this.#h?this.#h=this.#g[e]:this.#j(this.#y[e],this.#g[e]),this.#j(this.#f,e),this.#f=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(t);else{this.#I(s);let i=this.#s[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#p)&&(this.#_&&this.#i?.(i,e,t),this.#p&&this.#m?.push([i,e,t])),this.#a.delete(e),this.#c[s]=void 0,this.#s[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#h)this.#h=this.#g[s];else{let o=this.#y[s];this.#g[o]=this.#g[s];let a=this.#g[s];this.#y[a]=this.#y[s]}this.#l--,this.#w.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#r?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let r=this.#s[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#_&&this.#i?.(r,s,e),this.#p&&this.#m?.push([r,s,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#v&&this.#E&&(this.#v.fill(0),this.#E.fill(0)),this.#k&&this.#k.fill(0),this.#h=0,this.#f=0,this.#w.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};var vo=require("node:path"),B0=require("node:url"),mr=require("fs"),nj=G(require("node:fs"),1),bs=require("node:fs/promises");var ef=require("node:events"),ty=G(require("node:stream"),1),L0=require("node:string_decoder"),A0=typeof process=="object"&&process?process:{stdout:null,stderr:null},zq=n=>!!n&&typeof n=="object"&&(n instanceof ys||n instanceof ty.default||Gq(n)||Yq(n)),Gq=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ty.default.Writable.prototype.pipe,Yq=n=>!!n&&typeof n=="object"&&n instanceof ef.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",Ir=Symbol("EOF"),Mr=Symbol("maybeEmitEnd"),gs=Symbol("emittedEnd"),Gd=Symbol("emittingEnd"),Ha=Symbol("emittedError"),Yd=Symbol("closed"),I0=Symbol("read"),Jd=Symbol("flush"),M0=Symbol("flushChunk"),zn=Symbol("encoding"),yo=Symbol("decoder"),Nt=Symbol("flowing"),Ka=Symbol("paused"),bo=Symbol("resume"),Pt=Symbol("buffer"),Gt=Symbol("pipes"),Rt=Symbol("bufferLength"),Yg=Symbol("bufferPush"),Xd=Symbol("bufferShift"),Ft=Symbol("objectMode"),it=Symbol("destroyed"),Jg=Symbol("error"),Xg=Symbol("emitData"),$0=Symbol("emitEnd"),Qg=Symbol("emitEnd2"),hr=Symbol("async"),Zg=Symbol("abort"),Qd=Symbol("aborted"),za=Symbol("signal"),Js=Symbol("dataListeners"),gn=Symbol("discarded"),Ga=n=>Promise.resolve().then(n),Jq=n=>n(),Xq=n=>n==="end"||n==="finish"||n==="prefinish",Qq=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,Zq=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Zd=class{src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[bo](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ey=class extends Zd{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},ej=n=>!!n.objectMode,tj=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",ys=class extends ef.EventEmitter{[Nt]=!1;[Ka]=!1;[Gt]=[];[Pt]=[];[Ft];[zn];[hr];[yo];[Ir]=!1;[gs]=!1;[Gd]=!1;[Yd]=!1;[Ha]=null;[Rt]=0;[it]=!1;[za];[Qd]=!1;[Js]=0;[gn]=!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");ej(t)?(this[Ft]=!0,this[zn]=null):tj(t)?(this[zn]=t.encoding,this[Ft]=!1):(this[Ft]=!1,this[zn]=null),this[hr]=!!t.async,this[yo]=this[zn]?new L0.StringDecoder(this[zn]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Pt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Gt]});let{signal:r}=t;r&&(this[za]=r,r.aborted?this[Zg]():r.addEventListener("abort",()=>this[Zg]()))}get bufferLength(){return this[Rt]}get encoding(){return this[zn]}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[Ft]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[hr]}set async(e){this[hr]=this[hr]||!!e}[Zg](){this[Qd]=!0,this.emit("abort",this[za]?.reason),this.destroy(this[za]?.reason)}get aborted(){return this[Qd]}set aborted(e){}write(e,t,r){if(this[Qd])return!1;if(this[Ir])throw new Error("write after end");if(this[it])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[hr]?Ga:Jq;if(!this[Ft]&&!Buffer.isBuffer(e)){if(Zq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Qq(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ft]?(this[Nt]&&this[Rt]!==0&&this[Jd](!0),this[Nt]?this.emit("data",e):this[Yg](e),this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt]):e.length?(typeof e=="string"&&!(t===this[zn]&&!this[yo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zn]&&(e=this[yo].write(e)),this[Nt]&&this[Rt]!==0&&this[Jd](!0),this[Nt]?this.emit("data",e):this[Yg](e),this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt]):(this[Rt]!==0&&this.emit("readable"),r&&s(r),this[Nt])}read(e){if(this[it])return null;if(this[gn]=!1,this[Rt]===0||e===0||e&&e>this[Rt])return this[Mr](),null;this[Ft]&&(e=null),this[Pt].length>1&&!this[Ft]&&(this[Pt]=[this[zn]?this[Pt].join(""):Buffer.concat(this[Pt],this[Rt])]);let t=this[I0](e||null,this[Pt][0]);return this[Mr](),t}[I0](e,t){if(this[Ft])this[Xd]();else{let r=t;e===r.length||e===null?this[Xd]():typeof r=="string"?(this[Pt][0]=r.slice(e),t=r.slice(0,e),this[Rt]-=e):(this[Pt][0]=r.subarray(e),t=r.subarray(0,e),this[Rt]-=e)}return this.emit("data",t),!this[Pt].length&&!this[Ir]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Ir]=!0,this.writable=!1,(this[Nt]||!this[Ka])&&this[Mr](),this}[bo](){this[it]||(!this[Js]&&!this[Gt].length&&(this[gn]=!0),this[Ka]=!1,this[Nt]=!0,this.emit("resume"),this[Pt].length?this[Jd]():this[Ir]?this[Mr]():this.emit("drain"))}resume(){return this[bo]()}pause(){this[Nt]=!1,this[Ka]=!0,this[gn]=!1}get destroyed(){return this[it]}get flowing(){return this[Nt]}get paused(){return this[Ka]}[Yg](e){this[Ft]?this[Rt]+=1:this[Rt]+=e.length,this[Pt].push(e)}[Xd](){return this[Ft]?this[Rt]-=1:this[Rt]-=this[Pt][0].length,this[Pt].shift()}[Jd](e=!1){do;while(this[M0](this[Xd]())&&this[Pt].length);!e&&!this[Pt].length&&!this[Ir]&&this.emit("drain")}[M0](e){return this.emit("data",e),this[Nt]}pipe(e,t){if(this[it])return e;this[gn]=!1;let r=this[gs];return t=t||{},e===A0.stdout||e===A0.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[Gt].push(t.proxyErrors?new ey(this,e,t):new Zd(this,e,t)),this[hr]?Ga(()=>this[bo]()):this[bo]()),e}unpipe(e){let t=this[Gt].find(r=>r.dest===e);t&&(this[Gt].length===1?(this[Nt]&&this[Js]===0&&(this[Nt]=!1),this[Gt]=[]):this[Gt].splice(this[Gt].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[gn]=!1,this[Js]++,!this[Gt].length&&!this[Nt]&&this[bo]();else if(e==="readable"&&this[Rt]!==0)super.emit("readable");else if(Xq(e)&&this[gs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ha]){let s=t;this[hr]?Ga(()=>s.call(this,this[Ha])):s.call(this,this[Ha])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Js]=this.listeners("data").length,this[Js]===0&&!this[gn]&&!this[Gt].length&&(this[Nt]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Js]=0,!this[gn]&&!this[Gt].length&&(this[Nt]=!1)),t}get emittedEnd(){return this[gs]}[Mr](){!this[Gd]&&!this[gs]&&!this[it]&&this[Pt].length===0&&this[Ir]&&(this[Gd]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yd]&&this.emit("close"),this[Gd]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==it&&this[it])return!1;if(e==="data")return!this[Ft]&&!r?!1:this[hr]?(Ga(()=>this[Xg](r)),!0):this[Xg](r);if(e==="end")return this[$0]();if(e==="close"){if(this[Yd]=!0,!this[gs]&&!this[it])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[Ha]=r,super.emit(Jg,r);let i=!this[za]||this.listeners("error").length?super.emit("error",r):!1;return this[Mr](),i}else if(e==="resume"){let i=super.emit("resume");return this[Mr](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...t);return this[Mr](),s}[Xg](e){for(let r of this[Gt])r.dest.write(e)===!1&&this.pause();let t=this[gn]?!1:super.emit("data",e);return this[Mr](),t}[$0](){return this[gs]?!1:(this[gs]=!0,this.readable=!1,this[hr]?(Ga(()=>this[Qg]()),!0):this[Qg]())}[Qg](){if(this[yo]){let t=this[yo].end();if(t){for(let r of this[Gt])r.dest.write(t);this[gn]||super.emit("data",t)}}for(let t of this[Gt])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ft]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Ft]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Ft])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[zn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(it,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[gn]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Ir])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(it,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(it,u),this.pause(),i({value:d,done:!!this[Ir]})},l=()=>{this.off("error",a),this.off("data",c),this.off(it,u),t(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(it,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[gn]=!1;let e=!1,t=()=>(this.pause(),this.off(Jg,t),this.off(it,t),this.off("end",t),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(Jg,t),this.once(it,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[it])return e?this.emit("error",e):this.emit(it),this;this[it]=!0,this[gn]=!0,this[Pt].length=0,this[Rt]=0;let t=this;return typeof t.close=="function"&&!this[Yd]&&t.close(),e?this.emit("error",e):this.emit(it),this}static get isStream(){return zq}};var rj=mr.realpathSync.native,Ja={lstatSync:mr.lstatSync,readdir:mr.readdir,readdirSync:mr.readdirSync,readlinkSync:mr.readlinkSync,realpathSync:rj,promises:{lstat:bs.lstat,readdir:bs.readdir,readlink:bs.readlink,realpath:bs.realpath}},U0=n=>!n||n===Ja||n===nj?Ja:{...Ja,...n,promises:{...Ja.promises,...n.promises||{}}},V0=/^\\\\\?\\([a-z]:)\\?$/i,sj=n=>n.replace(/\//g,"\\").replace(V0,"$1\\"),ij=/[\\\/]/,Rn=0,W0=1,H0=2,pr=4,K0=6,z0=8,Xs=10,G0=12,Pn=15,Ya=~Pn,ny=16,x0=32,Xa=64,Gn=128,tf=256,rf=512,q0=Xa|Gn|rf,oj=1023,ry=n=>n.isFile()?z0:n.isDirectory()?pr:n.isSymbolicLink()?Xs:n.isCharacterDevice()?H0:n.isBlockDevice()?K0:n.isSocket()?G0:n.isFIFO()?W0:Rn,j0=new Map,Qa=n=>{let e=j0.get(n);if(e)return e;let t=n.normalize("NFKD");return j0.set(n,t),t},F0=new Map,nf=n=>{let e=F0.get(n);if(e)return e;let t=Qa(n.toLowerCase());return F0.set(n,t),t},sf=class extends Wa{constructor(){super({max:256})}},sy=class extends Wa{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},Y0=Symbol("PathScurry setAsCwd"),Bt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#T;get gid(){return this.#T}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#s;get blocks(){return this.#s}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#f;get birthtimeMs(){return this.#f}#w;get atime(){return this.#w}#m;get mtime(){return this.#m}#k;get ctime(){return this.#k}#E;get birthtime(){return this.#E}#v;#_;#S;#p;#D;#N;#n;#A;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Rn,r,s,i,o,a){this.name=e,this.#v=i?nf(e):Qa(e),this.#n=t&oj,this.nocase=i,this.roots=s,this.root=r||this,this.#A=o,this.#S=a.fullpath,this.#D=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=U0(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#A}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(s):this.#I(s)}#I(e){let t=this;for(let r of e)t=t.child(r);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&=~ny,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?nf(e):Qa(e);for(let c of r)if(c.#v===s)return c;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,Rn,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Gn),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,t=this.parent;if(!t)return this.#D=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&Pn)===Rn}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&Pn)===z0}isDirectory(){return(this.#n&Pn)===pr}isCharacterDevice(){return(this.#n&Pn)===H0}isBlockDevice(){return(this.#n&Pn)===K0}isFIFO(){return(this.#n&Pn)===W0}isSocket(){return(this.#n&Pn)===G0}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&x0?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&Pn;return!(e!==Rn&&e!==Xs||this.#n&tf||this.#n&Gn)}calledReaddir(){return!!(this.#n&ny)}isENOENT(){return!!(this.#n&Gn)}isNamed(e){return this.nocase?this.#v===nf(e):this.#v===Qa(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()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#b=r}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()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#b=r}catch(t){this.#u(t.code);return}}#M(e){this.#n|=ny;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#n&Gn||(this.#n=(this.#n|Gn)&Ya,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#R(){this.#n|=rf,this.#L()}#L(){if(this.#n&Xa)return;let e=this.#n;(e&Pn)===pr&&(e&=Ya),this.#n=e|Xa,this.#P()}#x(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#$():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#$()}#u(e=""){let t=this.#n;t|=tf,e==="ENOENT"&&(t|=Gn),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ya),this.#n=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,t){return this.#O(e,t)||this.#F(e,t)}#F(e,t){let r=ry(e),s=this.newChild(e.name,r,{parent:this}),i=s.#n&Pn;return i!==pr&&i!==Xs&&i!==Rn&&(s.#n|=Xa),t.unshift(s),t.provisional++,s}#O(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?nf(e.name):Qa(e.name))===s.#v)return this.#B(e,s,r,t)}}#B(e,t,r,s){let i=t.name;return t.#n=t.#n&Ya|ry(e),i!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#n&Gn)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#n&Gn)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#H(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:m,mtime:T,mtimeMs:g,nlink:S,rdev:k,size:v,uid:b}=e;this.#w=t,this.#g=r,this.#E=s,this.#f=i,this.#d=o,this.#s=a,this.#k=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=m,this.#m=T,this.#y=g,this.#r=S,this.#l=k,this.#c=v,this.#o=b;let R=ry(e);this.#n=this.#n&Ya|R|x0,R!==Rn&&R!==pr&&R!==Xs&&(this.#n|=Xa)}#V=[];#W=!1;#K(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);t?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#W)return;this.#W=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#x(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#M(r)}this.#K(r.slice(0,r.provisional))})}#U;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.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#M(e)}catch(s){this.#x(s.code),e.provisional=0}this.#U=void 0,r()}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 r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(r,e);this.#M(e)}catch(r){this.#x(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&q0)return!1;let e=Pn&this.#n;return e===Rn||e===pr||e===Xs}shouldWalk(e,t){return(this.#n&pr)===pr&&!(this.#n&q0)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((rf|tf|Gn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#C)return this.#C;if(!((rf|tf|Gn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[Y0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#D=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#D=void 0,s.#N=void 0,s=s.parent}},of=class n extends Bt{sep="\\";splitSep=ij;constructor(e,t=Rn,r,s,i,o,a){super(e,t,r,s,i,o,a)}newChild(e,t=Rn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return vo.win32.parse(e).root}getRoot(e){if(e=sj(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new To(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(V0,"$1\\"),e===t}},af=class n extends Bt{splitSep="/";sep="/";constructor(e,t=Rn,r,s,i,o,a){super(e,t,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Rn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},cf=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=Ja}={}){this.#r=U0(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,B0.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new sf,this.#t=new sf,this.#i=new sy(i);let c=a.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,m=!1;for(let T of c){let g=u--;l=l.child(T,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:f+=(m?"":d)+T}),m=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}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 Bt||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.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 Bt||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((m,T)=>{if(m)return f(m);let g=T.length;if(!g)return f();let S=()=>{--g===0&&f()};for(let k of T)(!i||i(k))&&a.push(r?k:k.fullpath()),s&&k.isSymbolicLink()?k.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(c,o)?l(v,S):S()):k.shouldWalk(c,o)?l(k,S):S()},!0)},u=e;return new Promise((d,f)=>{l(u,m=>{if(m)return f(m);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(r?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(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 Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield r?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(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 Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new ys({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let m=l.shift();if(!m){u===0&&a.end();return}u++,c.add(m);let T=(S,k,v=!1)=>{if(S)return a.emit("error",S);if(s&&!v){let b=[];for(let R of k)R.isSymbolicLink()&&b.push(R.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>T(null,k,!0));return}}for(let b of k)b&&(!i||i(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of k){let R=b.realpathCached()||b;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):g||d()},g=!0;m.readdirCB(T,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Bt||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new ys({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let m=l.shift();if(!m){u===0&&a.end();return}u++,c.add(m);let T=m.readdirSync();for(let g of T)(!i||i(g))&&(a.write(r?g:g.fullpath())||(f=!0));u--;for(let g of T){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(c,o)&&l.push(S)}}f&&!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[Y0](t)}},To=class extends cf{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,vo.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return vo.win32.parse(e).root.toUpperCase()}newRoot(e){return new of(this.rootPath,pr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},_o=class extends cf{sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,vo.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new af(this.rootPath,pr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Za=class extends _o{constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},i8=process.platform==="win32"?of:af,J0=process.platform==="win32"?To:process.platform==="darwin"?Za:_o;var aj=n=>n.length>=1,cj=n=>n.length>=1,So=class n{#e;#t;#i;length;#r;#o;#T;#l;#d;#a;#c=!0;constructor(e,t,r,s){if(!aj(e))throw new TypeError("empty pattern list");if(!cj(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,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,m,...T]=this.#t;l[0]===""&&(l.shift(),T.shift());let g=[i,o,a,c,""].join("/"),S=[u,d,f,m,""].join("/");this.#e=[g,...l],this.#t=[S,...T],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===It}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#T=this.#T||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#t,this.#i+1,this.#r),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#r==="win32"&&this.#i===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.#r==="win32"&&this.#i===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.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var lj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",wo=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:i,platform:o=lj}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new mn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],i=t.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new So(s,i,0,this.platform),a=new mn(o.globString(),this.mmopts),c=i[i.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(),r=`${t}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var iy=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 r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},oy=class{store=new Map;add(e,t,r){let s=(t?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},ay=class{store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.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())}},ec=class n{hasWalkedCache;matches=new oy;subwalks=new ay;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new iy}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===It){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let m=s.parent||s;f?this.hasWalkedCache.hasWalked(m,f)||this.subwalks.add(m,f):this.matches.add(m,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===It?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var uj=(n,e)=>typeof n=="string"?new wo([n],e):Array.isArray(n)?new wo(n,e):n,lf=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=uj(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(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 r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,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.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new ec(this.opts),r)}walkCB2(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())i++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new ec(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},tc=class extends lf{matches=new Set;constructor(e,t,r){super(e,t,r)}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}},nc=class extends lf{results;constructor(e,t,r){super(e,t,r),this.results=new ys({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 dj=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Yn=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,X0.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||dj,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"?To:t.platform==="darwin"?Za:t.platform?_o:J0;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new mn(c,s)),[o,a]=i.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 So(c,u,0,this.platform)})}async walk(){return[...await new tc(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 tc(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 nc(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 nc(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 cy=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new mn(t,e).hasMagic())return!0;return!1};function uf(n,e={}){return new Yn(n,e).streamSync()}function Z0(n,e={}){return new Yn(n,e).stream()}function eR(n,e={}){return new Yn(n,e).walkSync()}async function Q0(n,e={}){return new Yn(n,e).walk()}function df(n,e={}){return new Yn(n,e).iterateSync()}function tR(n,e={}){return new Yn(n,e).iterate()}var fj=uf,hj=Object.assign(Z0,{sync:uf}),pj=df,mj=Object.assign(tR,{sync:df}),gj=Object.assign(eR,{stream:uf,iterate:df}),Qs=Object.assign(Q0,{glob:Q0,globSync:eR,sync:gj,globStream:Z0,stream:hj,globStreamSync:uf,streamSync:fj,globIterate:tR,iterate:mj,globIterateSync:df,iterateSync:pj,Glob:Yn,hasMagic:cy,escape:po,unescape:Kn});Qs.glob=Qs;var lv=require("path"),uv=require("fs");var iO=G(nO());var av={};LO(av,{$id:()=>jW,$schema:()=>qW,default:()=>WW,definitions:()=>BW,properties:()=>VW,title:()=>FW,type:()=>UW});var qW="http://json-schema.org/draft-07/schema#",jW="http://json-schema.org/draft-07/schema#",FW="Core schema meta-schema",BW={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},UW=["object","boolean"],VW={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},WW={$schema:qW,$id:jW,title:FW,definitions:BW,type:UW,properties:VW,default:!0};var Tt=G(X());var Kf=class extends oa{constructor(t,r){super();this.ajv=t;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof lt&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(A(22,c,Tt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[Tt.DiagnosticTag.Unnecessary]))),s;let a=Ee.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...HW(t,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.path.join("/")}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.path.join("/")}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let r=(this.validate?.schema).properties?.[t];if(r&&typeof r=="object"&&"description"in r)return{kind:Tt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
240
+
241
+ `):r.description]:[]].join(`
242
+ `)}}getPropertyListCompletionItems(t){let r=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return r.map(i=>{let o=t&&s.some(l=>l===i),a=!!t.property.some(l=>i===l.name),c="a";return o?c=a?"Y":"A":c=a?"Z":"B",{label:`${i}`,kind:Tt.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},HW=(n,e,t,r)=>{let s=KW(t,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],Tt.TextEdit.del(tm(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=i.getProperty(e.instancePath.split("/")[1]);return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=n.getOrderedNodeAst(i),c=Ui(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return A(0,c[u],Tt.DiagnosticSeverity.Error,[],[],[o],Tt.TextEdit.insert(Tt.Position.create(d.pos.line,d.pos.col+1),`
243
+ ${"".padEnd(Hi(c[u].uri,l)*ji().length,ji())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
244
+ ${e.params.allowedValues.join(`
245
+ `)}
246
+ ${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[A(26,o.ast,Tt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[A(26,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
247
+ ${JSON.stringify(e)}
248
+ ${r}`])]:[A(26,s.node.definitions[0]instanceof Ht?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
249
+ ${JSON.stringify(e)}
250
+ ${r}`])]},KW=(n,e)=>rO(n,e.split("/").filter(t=>t)),rO=(n,e)=>{if(e.length===0)return{node:n,remainingInstancePath:""};let t=e[0].split("@"),r=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=n.getNode(r,s);return i?rO(i,e.slice(1)):{node:n,property:n.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var dv=class n{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof lt)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){Qs.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,lv.resolve)(e,s);try{let i=cv.default.parse((0,uv.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){Qs.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,lv.resolve)(e,s);try{let i=cv.default.parse((0,uv.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,r){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new iO.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(av),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),n.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Kf(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}},sO,oO=()=>(sO??=new dv,sO);var uO=G(Vg());var Mc=require("path"),dO=require("fs");var Tr=G(X()),zW=n=>{switch(n){case"string":return H(3);case"int":return H(1);case"boolean":return H(0);case"array":return H(4);case"uint8-array":return H(6);case"string-array":return H(5);case"phandle":return H(1);case"phandles":return H(4);case"phandle-array":return H(4);case"path":return H([3,1]);case"compound":return H(8)}},aO=(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}},zf=(n,e)=>{if(e=e.include.reduce((t,r)=>{let s=n.find(i=>(0,Mc.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return t.include=t.include.filter(o=>o!==r),GW(n,s,t,i)??t}return console.warn(`Unable to find ${r}`),t},e),e["child-binding"]&&(e["child-binding"].include=fO(e["child-binding"].include),e["child-binding"]=zf(n,e["child-binding"])),!e.include.length)return e},GW=(n,e,t,r=[])=>{let s=zf(n,e),i=zf(n,t);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(T=>T===d)?{}:s.properties?.[d]??{},m=i.properties?.[d]??{};a={...a,[d]:{...f,...m}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],m=i[d]??[];i[d]=Array.from([...f,...m])}),i},fO=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],fv=class n{constructor(){this.typeCache=[];this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof lt)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let r=n.getNodeCompatible(t);if(!r)return[ns()];let s=this.typeCache.filter(o=>e.some(a=>r.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));if(s.length)return s;this.loadTypeAndCache(e);let i=this.typeCache.filter(o=>e.some(a=>r.some(c=>c===o.compatible)&&o.bindingsPath?.startsWith(a)));return i.length?i:[ns()]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=Qs.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,Mc.resolve)(t,o);try{let a=uO.default.parse((0,dO.readFileSync)(o,"utf-8"));return{...a,include:fO(a.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>zf(s,o)).filter(o=>!!o&&!o.include.length);this.typeCache.push(...YW(i))})}},cO,hO=()=>(cO??=new fv,cO),YW=n=>n.map(pO),pO=n=>{let e=ns();e.compatible=n.compatible??(n.filePath?(0,Mc.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 r=Object.keys(n).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:n[s]}));return n.properties&&Object.keys(n.properties).forEach(s=>{let i=n.properties[s];JW(e,s,i),e.cellsValues=r}),n["child-binding"]&&(e.childNodeType=pO(n["child-binding"]),e.childNodeType.bindingsPath=e.bindingsPath),e},JW=(n,e,t)=>{let r=n.properties.find(s=>typeof s.name=="string"&&s.getNameMatch(e));if(r){r.required=()=>t.required?"required":"optional",r.values=()=>t.enum??[],r.constValue=aO(t.type,t.const);let s=r.additionalTypeCheck;r.additionalTypeCheck=i=>[...lO(t,e)(i),...s?.(i)??[]]}else{let s=new Y(e,zW(t.type),t.required?"required":"optional",void 0,t.enum,lO(t,e));s.description=t.description?[t.description]:void 0,s.constValue=aO(t.type,t.const),n.addProperty(s)}},lO=(n,e)=>{let t=n;return r=>{let s=r.parent.root,i=[];if(t.const){let o=r.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)||i.push(A(25,r.ast.values??r.ast,Tr.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${t.type}" with value: ${t.const}`]))}}if(t.deprecated&&i.push(A(14,r.ast,Tr.DiagnosticSeverity.Warning,[],[Tr.DiagnosticTag.Deprecated],[r.name])),(t.type==="phandle"||t.type==="phandles"||t.type==="path")&&Kt(r.ast.values)?.forEach(a=>{Un(a,s)||i.push(A(23,a,Tr.DiagnosticSeverity.Error))}),t.type==="path"&&r.ast.values?.values.at(0)?.value instanceof lt){let o=r.ast.values?.values.at(0)?.value,a=[];o.value.split("/").every(c=>{let l=s.getNode(c);return l?a.push(c):i.push(A(24,o,Tr.DiagnosticSeverity.Error,[],[],[c,`/${a.join("/")}`])),!l})}if(t.type==="phandle-array"){let o=Kt(r.ast.values),a=0;for(;o&&a<o.length;){let c=o.at(a),l=Un(c,s);if(!l){i.push(A(23,c??r.ast,Tr.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){i.push(A(16,r.ast,Tr.DiagnosticSeverity.Error,[...l.nodeNameOrLabelRef],[],[r.name,`#${u}-cells`,`/${l.path.slice(1).join("/")}`]));break}let f=d?Ue(d,0,0)??0:0;if(1+f>o.length-a){let m=l.nodeType?.cellsValues?.find(T=>T.specifier===u)?.values;i.push(A(20,c??r.ast,Tr.DiagnosticSeverity.Error,[],[],[r.name,`<${["phandel",...m??[],...Array.from({length:f-(m?.length??0)},()=>"cell")].join(" ")}>`]));break}a+=1+f}}return i}};var Gf=(n,e)=>({getNodeTypes:async t=>{switch(e){case"Zephyr":return hO().getNodeTypes(n.zephyrBindings,t);case"DevicetreeOrg":return oO().getNodeTypes(n.deviceOrgBindingsMetaSchema,n.deviceOrgTreeBindings,t)}}});var mO=G(X()),hv=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(hv):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:mO.FoldingRangeKind.Region},...n.nodes.flatMap(hv)];function gO(n){return n.rootDocument.nodes.flatMap(hv)}var di=G(X());function XW(n){if(!n||!(n.ast instanceof Ie)&&!(n.ast instanceof ht))return[];let e=t=>t.nodeType?.bindingsPath?[di.Location.create(`file://${t.nodeType.bindingsPath}`,di.Range.create(di.Position.create(0,0),di.Position.create(0,0)))]:[];return n.item instanceof Ee&&!bt(n.ast)?e(n.item):n.ast instanceof ht&&n.ast.parentNode instanceof ke&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Ie&&n.ast.linksTo?e(n.ast.linksTo):[]}async function yO(n,e,t){return Ot(n,e,r=>[...XW(r)],t)}var _r=require("path");var Jf=require("fs");var QW=(n,e)=>{Vn().reset(n),Vn().requestTokens(n,!0),e(n)},Yf=class{constructor(e,t,r){this.file=e;this.cb=t;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),QW(e,t)},(0,Jf.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Jf.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var xe=[],Sr,pv,$c=new WeakMap,Xf=new Map,mv=n=>{xe.some(e=>e===n)||(xe.push(n),bO(n))},bO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>{e.endsWith(".h")||(Xf.has(e)||Xf.set(e,new Yf(e,vv,t=>!!wr.get(`file://${t}`))),Xf.get(e)?.watch())})},yv=async n=>{let e=xe.indexOf(n);e!==-1&&(Zf(n),$c.delete(n),console.log(`cleaning up context with ID ${n.name} and uri ${n.parser.uri}`),xe.splice(e,1),vO(n))},vO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>Xf.get(e)?.unwatch())},ZW=n=>{let e=$c.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},Dt=async()=>{await PO,await Promise.all(xe.map(ZW))},Qf=n=>{let e=TO(n);return xe.filter(t=>!e.some(r=>r===t))},TO=n=>xe.filter(e=>{let t=n.contexts?.find(r=>r.dtsFile===e.parser.uri);return!!t&&t.overlays?.every(r=>e.overlays.some(s=>s===r))}),eH=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes);return t.length?t.every(s=>r.some(i=>i.reolvedPath===s.reolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>s===n.parser.uri)},_O=n=>Qf(Z).indexOf(n)!==-1,SO=async n=>{if(!_O(n))return;let e=Qf(Z),t=await TO(Z),r=await vu(e),s=[...n.overlayParsers.map(a=>a.uri),n.parser.uri,...n.parser.includes.map(a=>a.reolvedPath)];if(xe.indexOf(n)===-1)return;let i=await Promise.all(r.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await eH(a.context,c)})))),o=r.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==n&&a.context.parser.uri===n.parser.uri&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(yv)},Te=(0,Ce.createConnection)(Ce.ProposedFeatures.all),wr=new Ce.TextDocuments(gu),bv=!0,gv=!1,wO=!1;Te.onInitialize(n=>{let e=n.capabilities;bv=!!(e.workspace&&e.workspace.configuration),gv=!!(e.workspace&&e.workspace.workspaceFolders),wO=!!e.workspace?.diagnostics?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Ce.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Ce.CodeActionKind.QuickFix,Ce.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:yu,tokenModifiers:bu},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return gv&&(t.capabilities.workspace={workspaceFolders:{supported:!0}}),t});Te.onInitialized(()=>{bv&&Te.client.register(Ce.DidChangeConfigurationNotification.type,{}),gv&&Te.workspace.onDidChangeWorkspaceFolders(n=>{Te.console.log("Workspace folder change event received")})});var kO={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],lockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},Z=kO,EO=new Map,NO=!1,PO=new Promise(n=>{let e=setInterval(()=>{NO&&(n(),clearInterval(e))},100)});Te.onDidChangeConfiguration(n=>{if(NO=!0,!n.settings)return;console.log("Configuration changed",n),bv&&EO.clear();let e=Z;Z={...kO,...n.settings?.devicetree},Z.contexts?.forEach((s,i)=>{if(s.cwd||Z.cwd){let o=s.cwd??Z.cwd;s.includePaths??=Z.defaultIncludePaths,s.zephyrBindings??=Z.defaultIncludePaths,s.bindingType??=Z.defaultBindingType,s.deviceOrgTreeBindings??=Z.defaultDeviceOrgTreeBindings,s.deviceOrgBindingsMetaSchema??=Z.defaultDeviceOrgBindingsMetaSchema,o&&s.bindingType==="Zephyr"&&(!s.zephyrBindings||s.zephyrBindings.length===0)&&(s.zephyrBindings=["./zephyr/dts/bindings"]),s.zephyrBindings=s.zephyrBindings?.map(a=>(0,_r.resolve)(o,a)),s.deviceOrgTreeBindings=s.deviceOrgTreeBindings?.map(a=>(0,_r.resolve)(o,a)),s.deviceOrgBindingsMetaSchema=s.deviceOrgBindingsMetaSchema?.map(a=>(0,_r.resolve)(o,a)),s.includePaths=s.includePaths?.map(a=>(0,_r.resolve)(o,a)),s.dtsFile=(0,_r.resolve)(o,s.dtsFile)}});let t=Qf(e);xe.forEach(yv),$c=new WeakMap,Z.contexts?.forEach((s,i)=>{let o=s.bindingType,a=new eo(s.dtsFile,s.includePaths??[],o?Gf({zephyrBindings:s.zephyrBindings??[],deviceOrgBindingsMetaSchema:s.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:s.deviceOrgTreeBindings??[]},o):void 0,s.overlays,s.ctxName);mv(a),console.log(`New context with ID ${a.name} for ${s.dtsFile}`)});let r=RO();t.map(s=>{let i=Z.defaultBindingType,o=new eo(s.parser.uri,r.defaultIncludePaths,i?Gf({zephyrBindings:r.defaultZephyrBindings,deviceOrgBindingsMetaSchema:r.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:r.defaultDeviceOrgTreeBindings},i):void 0);return console.log(`New context with ID ${o.name} for ${s.parser.uri}`),o}).forEach(mv),t=Qf(Z),t.forEach(SO),pv&&Lc(pv,!0),wO&&Te.languages.diagnostics.refresh()});var RO=()=>{let n=(Z.defaultIncludePaths??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s);Z.cwd&&Z.defaultBindingType==="Zephyr"&&!Z.defaultZephyrBindings&&(Z.defaultZephyrBindings=["./zephyr/dts/bindings"]);let e=(Z.defaultZephyrBindings??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s),t=(Z.defaultDeviceOrgBindingsMetaSchema??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s),r=(Z.defaultDeviceOrgTreeBindings??[]).map(s=>Z.cwd?(0,_r.resolve)(Z.cwd,s):s);return{defaultIncludePaths:n,defaultZephyrBindings:e,defaultDeviceOrgBindingsMetaSchema:t,defaultDeviceOrgTreeBindings:r}};wr.onDidClose(n=>{let e=n.document.uri.replace("file://",""),t=Sr;if(!t)return;(t?.getContextFiles()??[]).filter(i=>i!==e).some(i=>wr.get(`file://${i}`))||(_O(t)?yv(t):Zf(t),Sr=void 0),EO.delete(n.document.uri)});wr.onDidOpen(async n=>{await Dt();let e=Sr,t=n.document.uri.replace("file://","");e||Te.sendDiagnostics({uri:n.document.uri,version:wr.get(n.document.uri)?.version,diagnostics:[{severity:Ce.DiagnosticSeverity.Warning,range:Ce.Range.create(Ce.Position.create(0,0),Ce.Position.create(0,0)),message:"File has no context",source:"devicetree"}]}),vv(t)});var tH=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";case 37:return"Expedted start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},nH=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 "),rH=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"}},sH=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];case 26:return n.templateStrings[0]}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),iH=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"}},vv=async n=>{await PO;let e=rk(xe,n);if(e.length)e.forEach(t=>{$c.get(t.context)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=DO(t.context);vO(t.context),await t.context.reevaluate(n),bO(t.context),Zf(t.context,a),Tv(t.context).then(c=>{c.items.map(l=>({uri:l.uri,version:l.version??void 0,diagnostics:l.items})).forEach(l=>{Te.sendDiagnostics(l)})}),i(),console.log("reevaluate",performance.now()-o)},50)});$c.set(t.context,{abort:r,promise:s})});else{if(Z.allowAdhocContexts===!1)return;let t=Z.defaultBindingType,r=RO(),s=new eo(n,r.defaultIncludePaths,t?Gf({zephyrBindings:r.defaultZephyrBindings,deviceOrgBindingsMetaSchema:r.defaultDeviceOrgBindingsMetaSchema,deviceOrgTreeBindings:r.defaultDeviceOrgTreeBindings},t):void 0);console.log(`New ad hoc context with ID ${s.name} for ${n}`),mv(s),Lc(n),await s.parser.stable,SO(s)}};wr.onDidChangeContent(async n=>{let e=n.document.uri.replace("file://",""),t=n.document.getText(),r=Vn();r.needsRenew(e,t)&&(console.log("Content changed"),r.renewLexer(e,t),vv(e))});var DO=n=>n.getContextFiles().map(e=>({uri:`file://${e}`,version:wr.get(`file://${e}`)?.version,diagnostics:[]})),Zf=(n,e=DO(n))=>{e.forEach(t=>{Te.sendDiagnostics({uri:t.uri,version:wr.get(t.uri)?.version,diagnostics:[]})})},Tv=async n=>(await n.stable(),{items:[...await Promise.all(n.getContextFiles().map(async t=>{let r=await oH(n,t);return{uri:`file://${t}`,kind:Ce.DocumentDiagnosticReportKind.Full,items:r,version:wr.get(`file://${t}`)?.version??null}}))]});Te.languages.diagnostics.onWorkspace(async()=>{await Dt();let n=Sr;return n?Tv(n):{items:[]}});async function oH(n,e){let t=performance.now();try{let r=[];return n.isInContext(e)?(n.parser.issues.filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:o.issues?o.issues.map(tH).join(" or "):"",source:"devicetree",data:{firstToken:{pos:o.astElement.firstToken.pos,tokens:o.astElement.firstToken.tokens,value:o.astElement.firstToken.value},lastToken:{pos:o.astElement.lastToken.pos,tokens:o.astElement.lastToken.tokens,value:o.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:o.issues,edit:o.edit,codeActionTitle:o.codeActionTitle}}};r.push(a)}),(await n.getContextIssues()??[]).filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:nH(o),source:"devicetree",tags:o.tags,relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(rH).join(" or "),location:{uri:`file://${c.uri}`,range:oe(c)}}))]};r.push(a)}),(await n.getRuntime())?.typesIssues.filter(o=>o.astElement.uri===e).forEach(o=>{let a={severity:o.severity,range:oe(o.astElement),message:sH(o),relatedInformation:[...o.linkedTo.map(c=>({message:o.issues.map(iH).join(" or "),location:{uri:`file://${c.uri}`,range:oe(c)}}))],source:"devicetree",tags:o.tags,data:{firstToken:{pos:o.astElement.firstToken.pos,tokens:o.astElement.firstToken.tokens,value:o.astElement.firstToken.value},lastToken:{pos:o.astElement.lastToken.pos,tokens:o.astElement.lastToken.tokens,value:o.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:o.issues,edit:o.edit,codeActionTitle:o.codeActionTitle}}};r.push(a)}),console.log("diagnostics",e,performance.now()-t),r):[{severity:Ce.DiagnosticSeverity.Warning,range:Ce.Range.create(Ce.Position.create(0,0),Ce.Position.create(0,0)),message:"File not in use by the active context",source:"devicetree"}]}catch(r){throw console.error(r),r}}Te.onDidChangeWatchedFiles(n=>{Te.console.log("We received a file change event")});Te.onCompletion(async n=>(await Dt(),xe?[...await sE(n,xe,Z.preferredContext),...await pE(n,xe,Z.preferredContext)]:[]));Te.onCompletionResolve(n=>n);wr.listen(Te);Te.listen();var Lc=async(n,e=!1)=>{if(!e&&Z.autoChangeContext===!1)return;pv=n,await Dt();let t=Sr;Sr=Fs(xe,n,Z.preferredContext)?.context;let r=Sr;t!==r&&(t&&Zf(t),r&&Tv(r).then(s=>{s.items.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(i=>{Te.sendDiagnostics(i)})}),console.log(`(ID: ${r?.name??-1}) activeContext:`,r?.parser.uri),xe.forEach((s,i)=>{console.log(`Context with ID ${s.name} for ${s.parser.uri}`)}))};Te.onDocumentSymbol(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let r=await Sr?.parser;return r?r.getDocumentSymbols(e):[]});Te.onWorkspaceSymbol(async()=>{await Dt();let n=Sr;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});Te.languages.semanticTokens.on(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=new Ce.SemanticTokensBuilder,r=await Fs(xe,e,Z.preferredContext),s=r?.context.isInContext(e);return!r||!s?{data:[]}:(r.context.parser.buildSemanticTokens(t,e),t.build())});Te.onDocumentLinks(async n=>{let e=n.textDocument.uri.replace("file://","");return await Dt(),(await Fs(xe,e,Z.preferredContext))?.context.getDocumentLinks(e)});Te.onPrepareRename(async n=>(await Dt(),uE(n,xe,Z.lockRenameEdits??[],Z.preferredContext)));Te.onRenameRequest(async n=>(await Dt(),lE(n,xe,Z.preferredContext)));Te.onReferences(async n=>(await Dt(),iE(n,xe,Z.preferredContext)));Te.onDefinition(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let r=(await(await Fs(xe,e,Z.preferredContext))?.context.getDocumentLinks(e,n.position))?.filter(s=>s.target).map(s=>Ce.Location.create(s.target,s.range))??[];return r.length?r:dE(n,xe,Z.preferredContext)});Te.onDeclaration(async n=>(await Dt(),fE(n,xe,Z.preferredContext)));Te.onCodeAction(async n=>hE(n));Te.onDocumentFormatting(async n=>{let e=n.textDocument.uri.replace("file://","");await Dt();let t=await Fs(xe,e,Z.preferredContext);return t?hk(n,t.context):[]});Te.onHover(async n=>(await Dt(),(await mE(n,xe,Z.preferredContext)).at(0)));Te.onRequest("devicetree/contexts",async()=>(await Dt(),xe.map(n=>n.parser.uri)));Te.onFoldingRanges(async n=>{await Dt();let e=n.textDocument.uri.replace("file://","");await Lc(e);let t=Sr,r=t?.isInContext(e);return!t||!r?[]:gO(t.parser)});Te.onTypeDefinition(async n=>(await Dt(),yO(n,xe)));