devicetree-language-server 0.5.4 → 0.5.5
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.
- package/README.md +92 -0
- package/dist/server.js +150 -150
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var _B=Object.create;var $m=Object.defineProperty;var SB=Object.getOwnPropertyDescriptor;var NB=Object.getOwnPropertyNames;var PB=Object.getPrototypeOf,RB=Object.prototype.hasOwnProperty;var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),EB=(t,e)=>{for(var r in e)$m(t,r,{get:e[r],enumerable:!0})},wB=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of NB(e))!RB.call(t,i)&&i!==r&&$m(t,i,{get:()=>e[i],enumerable:!(n=SB(e,i))||n.enumerable});return t};var M=(t,e,r)=>(r=t!=null?_B(PB(t)):{},wB(e||!t||!t.__esModule?$m(r,"default",{value:t,enumerable:!0}):r,t));var Wu=P(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.thenable=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function kB(t){return t===!0||t===!1}xt.boolean=kB;function VS(t){return typeof t=="string"||t instanceof String}xt.string=VS;function CB(t){return typeof t=="number"||t instanceof Number}xt.number=CB;function DB(t){return t instanceof Error}xt.error=DB;function zS(t){return typeof t=="function"}xt.func=zS;function WS(t){return Array.isArray(t)}xt.array=WS;function AB(t){return WS(t)&&t.every(e=>VS(e))}xt.stringArray=AB;function IB(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=IB;function OB(t){return t&&zS(t.then)}xt.thenable=OB});var Ro=P(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.stringArray=ar.array=ar.func=ar.error=ar.number=ar.string=ar.boolean=void 0;function xB(t){return t===!0||t===!1}ar.boolean=xB;function GS(t){return typeof t=="string"||t instanceof String}ar.string=GS;function MB(t){return typeof t=="number"||t instanceof Number}ar.number=MB;function qB(t){return t instanceof Error}ar.error=qB;function LB(t){return typeof t=="function"}ar.func=LB;function YS(t){return Array.isArray(t)}ar.array=YS;function $B(t){return YS(t)&&t.every(e=>GS(e))}ar.stringArray=$B});var lg=P(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.Message=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var Ls=Ro(),Bm;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Bm||(ae.ErrorCodes=Bm={}));var Fm=class t extends Error{constructor(e,r,n){super(r),this.code=Ls.number(e)?e:Bm.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ae.ResponseError=Fm;var Er=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ae.ParameterStructures=Er;Er.auto=new Er("auto");Er.byPosition=new Er("byPosition");Er.byName=new Er("byName");var ft=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Er.auto}};ae.AbstractMessageSignature=ft;var jm=class extends ft{constructor(e){super(e,0)}};ae.RequestType0=jm;var Um=class extends ft{constructor(e,r=Er.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType=Um;var Hm=class extends ft{constructor(e,r=Er.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=Hm;var Vm=class extends ft{constructor(e){super(e,2)}};ae.RequestType2=Vm;var zm=class extends ft{constructor(e){super(e,3)}};ae.RequestType3=zm;var Wm=class extends ft{constructor(e){super(e,4)}};ae.RequestType4=Wm;var Gm=class extends ft{constructor(e){super(e,5)}};ae.RequestType5=Gm;var Ym=class extends ft{constructor(e){super(e,6)}};ae.RequestType6=Ym;var Km=class extends ft{constructor(e){super(e,7)}};ae.RequestType7=Km;var Xm=class extends ft{constructor(e){super(e,8)}};ae.RequestType8=Xm;var Jm=class extends ft{constructor(e){super(e,9)}};ae.RequestType9=Jm;var Qm=class extends ft{constructor(e,r=Er.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Qm;var Zm=class extends ft{constructor(e){super(e,0)}};ae.NotificationType0=Zm;var eg=class extends ft{constructor(e,r=Er.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=eg;var tg=class extends ft{constructor(e){super(e,2)}};ae.NotificationType2=tg;var rg=class extends ft{constructor(e){super(e,3)}};ae.NotificationType3=rg;var ng=class extends ft{constructor(e){super(e,4)}};ae.NotificationType4=ng;var ig=class extends ft{constructor(e){super(e,5)}};ae.NotificationType5=ig;var sg=class extends ft{constructor(e){super(e,6)}};ae.NotificationType6=sg;var og=class extends ft{constructor(e){super(e,7)}};ae.NotificationType7=og;var ag=class extends ft{constructor(e){super(e,8)}};ae.NotificationType8=ag;var cg=class extends ft{constructor(e){super(e,9)}};ae.NotificationType9=cg;var KS;(function(t){function e(i){let s=i;return s&&Ls.string(s.method)&&(Ls.string(s.id)||Ls.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&Ls.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Ls.string(s.id)||Ls.number(s.id)||s.id===null)}t.isResponse=n})(KS||(ae.Message=KS={}))});var dg=P(Fi=>{"use strict";var XS;Object.defineProperty(Fi,"__esModule",{value:!0});Fi.LRUCache=Fi.LinkedMap=Fi.Touch=void 0;var cr;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(cr||(Fi.Touch=cr={}));var Gu=class{constructor(){this[XS]="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,r=cr.None){let n=this._map.get(e);if(n)return r!==cr.None&&this.touch(n,r),n.value}set(e,r,n=cr.None){let i=this._map.get(e);if(i)i.value=r,n!==cr.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case cr.None:this.addItemLast(i);break;case cr.First:this.addItemFirst(i);break;case cr.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(XS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==cr.First&&r!==cr.Last)){if(r===cr.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===cr.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Fi.LinkedMap=Gu;var ug=class extends Gu{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=cr.AsNew){return super.get(e,r)}peek(e){return super.get(e,cr.None)}set(e,r){return super.set(e,r,cr.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Fi.LRUCache=ug});var QS=P(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.Disposable=void 0;var JS;(function(t){function e(r){return{dispose:r}}t.create=e})(JS||(Yu.Disposable=JS={}))});var ji=P(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});var fg;function pg(){if(fg===void 0)throw new Error("No runtime abstraction layer installed");return fg}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");fg=r}t.install=e})(pg||(pg={}));hg.default=pg});var wo=P(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.Emitter=Eo.Event=void 0;var BB=ji(),ZS;(function(t){let e={dispose(){}};t.None=function(){return e}})(ZS||(Eo.Event=ZS={}));var mg=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)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 r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=n.length;s<o;s++)try{r.push(n[s].apply(i[s],e))}catch(a){(0,BB.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ku=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new mg),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Eo.Emitter=Ku;Ku._noop=function(){}});var Qu=P(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.CancellationTokenSource=ko.CancellationToken=void 0;var FB=ji(),jB=Ro(),gg=wo(),Xu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:gg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gg.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||jB.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Xu||(ko.CancellationToken=Xu={}));var UB=Object.freeze(function(t,e){let r=(0,FB.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Ju=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?UB:(this._emitter||(this._emitter=new gg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},yg=class{get token(){return this._token||(this._token=new Ju),this._token}cancel(){this._token?this._token.cancel():this._token=Xu.Cancelled}dispose(){this._token?this._token instanceof Ju&&this._token.dispose():this._token=Xu.None}};ko.CancellationTokenSource=yg});var eN=P(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.SharedArrayReceiverStrategy=Co.SharedArraySenderStrategy=void 0;var HB=Qu(),cc;(function(t){t.Continue=0,t.Cancelled=1})(cc||(cc={}));var vg=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=cc.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,cc.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Co.SharedArraySenderStrategy=vg;var Tg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===cc.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},bg=class{constructor(e){this.token=new Tg(e)}cancel(){}dispose(){}},_g=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new HB.CancellationTokenSource:new bg(r)}};Co.SharedArrayReceiverStrategy=_g});var Ng=P(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.Semaphore=void 0;var VB=ji(),Sg=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,VB.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Zu.Semaphore=Sg});var rN=P(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.ReadableStreamMessageReader=Ui.AbstractMessageReader=Ui.MessageReader=void 0;var Rg=ji(),Do=Ro(),Pg=wo(),zB=Ng(),tN;(function(t){function e(r){let n=r;return n&&Do.func(n.listen)&&Do.func(n.dispose)&&Do.func(n.onError)&&Do.func(n.onClose)&&Do.func(n.onPartialMessage)}t.is=e})(tN||(Ui.MessageReader=tN={}));var ed=class{constructor(){this.errorEmitter=new Pg.Emitter,this.closeEmitter=new Pg.Emitter,this.partialMessageEmitter=new Pg.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: ${Do.string(e.message)?e.message:"unknown"}`)}};Ui.AbstractMessageReader=ed;var Eg;(function(t){function e(r){let n,i,s,o=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)o.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Rg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(Eg||(Eg={}));var wg=class extends ed{constructor(e,r){super(),this.readable=e,this.options=Eg.fromOptions(r),this.buffer=(0,Rg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new zB.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,
|
|
4
|
-
`,
|
|
5
|
-
`,
|
|
6
|
-
${u}`);let f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}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 r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};
|
|
7
|
-
${JSON.stringify(
|
|
8
|
-
${JSON.stringify(
|
|
2
|
+
"use strict";var hB=Object.create;var Dm=Object.defineProperty;var mB=Object.getOwnPropertyDescriptor;var gB=Object.getOwnPropertyNames;var yB=Object.getPrototypeOf,vB=Object.prototype.hasOwnProperty;var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),TB=(t,e)=>{for(var r in e)Dm(t,r,{get:e[r],enumerable:!0})},bB=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gB(e))!vB.call(t,i)&&i!==r&&Dm(t,i,{get:()=>e[i],enumerable:!(n=mB(e,i))||n.enumerable});return t};var L=(t,e,r)=>(r=t!=null?hB(yB(t)):{},bB(e||!t||!t.__esModule?Dm(r,"default",{value:t,enumerable:!0}):r,t));var $u=R(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.thenable=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function _B(t){return t===!0||t===!1}xt.boolean=_B;function MS(t){return typeof t=="string"||t instanceof String}xt.string=MS;function SB(t){return typeof t=="number"||t instanceof Number}xt.number=SB;function NB(t){return t instanceof Error}xt.error=NB;function qS(t){return typeof t=="function"}xt.func=qS;function LS(t){return Array.isArray(t)}xt.array=LS;function RB(t){return LS(t)&&t.every(e=>MS(e))}xt.stringArray=RB;function PB(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=PB;function kB(t){return t&&qS(t.then)}xt.thenable=kB});var bo=R(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.stringArray=sr.array=sr.func=sr.error=sr.number=sr.string=sr.boolean=void 0;function EB(t){return t===!0||t===!1}sr.boolean=EB;function $S(t){return typeof t=="string"||t instanceof String}sr.string=$S;function wB(t){return typeof t=="number"||t instanceof Number}sr.number=wB;function CB(t){return t instanceof Error}sr.error=CB;function DB(t){return typeof t=="function"}sr.func=DB;function BS(t){return Array.isArray(t)}sr.array=BS;function AB(t){return BS(t)&&t.every(e=>$S(e))}sr.stringArray=AB});var tg=R(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.Message=ae.NotificationType9=ae.NotificationType8=ae.NotificationType7=ae.NotificationType6=ae.NotificationType5=ae.NotificationType4=ae.NotificationType3=ae.NotificationType2=ae.NotificationType1=ae.NotificationType0=ae.NotificationType=ae.RequestType9=ae.RequestType8=ae.RequestType7=ae.RequestType6=ae.RequestType5=ae.RequestType4=ae.RequestType3=ae.RequestType2=ae.RequestType1=ae.RequestType=ae.RequestType0=ae.AbstractMessageSignature=ae.ParameterStructures=ae.ResponseError=ae.ErrorCodes=void 0;var Os=bo(),Am;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Am||(ae.ErrorCodes=Am={}));var Im=class t extends Error{constructor(e,r,n){super(r),this.code=Os.number(e)?e:Am.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ae.ResponseError=Im;var Rr=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ae.ParameterStructures=Rr;Rr.auto=new Rr("auto");Rr.byPosition=new Rr("byPosition");Rr.byName=new Rr("byName");var dt=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Rr.auto}};ae.AbstractMessageSignature=dt;var Om=class extends dt{constructor(e){super(e,0)}};ae.RequestType0=Om;var xm=class extends dt{constructor(e,r=Rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType=xm;var Mm=class extends dt{constructor(e,r=Rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.RequestType1=Mm;var qm=class extends dt{constructor(e){super(e,2)}};ae.RequestType2=qm;var Lm=class extends dt{constructor(e){super(e,3)}};ae.RequestType3=Lm;var $m=class extends dt{constructor(e){super(e,4)}};ae.RequestType4=$m;var Bm=class extends dt{constructor(e){super(e,5)}};ae.RequestType5=Bm;var Fm=class extends dt{constructor(e){super(e,6)}};ae.RequestType6=Fm;var jm=class extends dt{constructor(e){super(e,7)}};ae.RequestType7=jm;var Um=class extends dt{constructor(e){super(e,8)}};ae.RequestType8=Um;var Hm=class extends dt{constructor(e){super(e,9)}};ae.RequestType9=Hm;var Vm=class extends dt{constructor(e,r=Rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType=Vm;var zm=class extends dt{constructor(e){super(e,0)}};ae.NotificationType0=zm;var Wm=class extends dt{constructor(e,r=Rr.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ae.NotificationType1=Wm;var Gm=class extends dt{constructor(e){super(e,2)}};ae.NotificationType2=Gm;var Ym=class extends dt{constructor(e){super(e,3)}};ae.NotificationType3=Ym;var Km=class extends dt{constructor(e){super(e,4)}};ae.NotificationType4=Km;var Xm=class extends dt{constructor(e){super(e,5)}};ae.NotificationType5=Xm;var Jm=class extends dt{constructor(e){super(e,6)}};ae.NotificationType6=Jm;var Qm=class extends dt{constructor(e){super(e,7)}};ae.NotificationType7=Qm;var Zm=class extends dt{constructor(e){super(e,8)}};ae.NotificationType8=Zm;var eg=class extends dt{constructor(e){super(e,9)}};ae.NotificationType9=eg;var FS;(function(t){function e(i){let s=i;return s&&Os.string(s.method)&&(Os.string(s.id)||Os.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&Os.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Os.string(s.id)||Os.number(s.id)||s.id===null)}t.isResponse=n})(FS||(ae.Message=FS={}))});var ng=R(qi=>{"use strict";var jS;Object.defineProperty(qi,"__esModule",{value:!0});qi.LRUCache=qi.LinkedMap=qi.Touch=void 0;var or;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(or||(qi.Touch=or={}));var Bu=class{constructor(){this[jS]="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,r=or.None){let n=this._map.get(e);if(n)return r!==or.None&&this.touch(n,r),n.value}set(e,r,n=or.None){let i=this._map.get(e);if(i)i.value=r,n!==or.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case or.None:this.addItemLast(i);break;case or.First:this.addItemFirst(i);break;case or.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.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,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(jS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.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 r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==or.First&&r!==or.Last)){if(r===or.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===or.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};qi.LinkedMap=Bu;var rg=class extends Bu{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),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,r=or.AsNew){return super.get(e,r)}peek(e){return super.get(e,or.None)}set(e,r){return super.set(e,r,or.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};qi.LRUCache=rg});var HS=R(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.Disposable=void 0;var US;(function(t){function e(r){return{dispose:r}}t.create=e})(US||(Fu.Disposable=US={}))});var Li=R(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});var ig;function sg(){if(ig===void 0)throw new Error("No runtime abstraction layer installed");return ig}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");ig=r}t.install=e})(sg||(sg={}));og.default=sg});var So=R(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.Emitter=_o.Event=void 0;var IB=Li(),VS;(function(t){let e={dispose(){}};t.None=function(){return e}})(VS||(_o.Event=VS={}));var ag=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)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 r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,o=n.length;s<o;s++)try{r.push(n[s].apply(i[s],e))}catch(a){(0,IB.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ju=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new ag),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};_o.Emitter=ju;ju._noop=function(){}});var Vu=R(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.CancellationTokenSource=No.CancellationToken=void 0;var OB=Li(),xB=bo(),cg=So(),Uu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:cg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:cg.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||xB.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Uu||(No.CancellationToken=Uu={}));var MB=Object.freeze(function(t,e){let r=(0,OB.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),Hu=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?MB:(this._emitter||(this._emitter=new cg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},lg=class{get token(){return this._token||(this._token=new Hu),this._token}cancel(){this._token?this._token.cancel():this._token=Uu.Cancelled}dispose(){this._token?this._token instanceof Hu&&this._token.dispose():this._token=Uu.None}};No.CancellationTokenSource=lg});var zS=R(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.SharedArrayReceiverStrategy=Ro.SharedArraySenderStrategy=void 0;var qB=Vu(),ec;(function(t){t.Continue=0,t.Cancelled=1})(ec||(ec={}));var ug=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=ec.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,ec.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ro.SharedArraySenderStrategy=ug;var dg=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===ec.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},fg=class{constructor(e){this.token=new dg(e)}cancel(){}dispose(){}},pg=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new qB.CancellationTokenSource:new fg(r)}};Ro.SharedArrayReceiverStrategy=pg});var mg=R(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Semaphore=void 0;var LB=Li(),hg=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((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,LB.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 r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};zu.Semaphore=hg});var GS=R($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.ReadableStreamMessageReader=$i.AbstractMessageReader=$i.MessageReader=void 0;var yg=Li(),Po=bo(),gg=So(),$B=mg(),WS;(function(t){function e(r){let n=r;return n&&Po.func(n.listen)&&Po.func(n.dispose)&&Po.func(n.onError)&&Po.func(n.onClose)&&Po.func(n.onPartialMessage)}t.is=e})(WS||($i.MessageReader=WS={}));var Wu=class{constructor(){this.errorEmitter=new gg.Emitter,this.closeEmitter=new gg.Emitter,this.partialMessageEmitter=new gg.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: ${Po.string(e.message)?e.message:"unknown"}`)}};$i.AbstractMessageReader=Wu;var vg;(function(t){function e(r){let n,i,s,o=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let l of r.contentDecoders)o.set(l.name,l);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let l of r.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,yg.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(vg||(vg={}));var Tg=class extends Wu{constructor(e,r){super(),this.readable=e,this.options=vg.fromOptions(r),this.buffer=(0,yg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new $B.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 r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,yg.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};$i.ReadableStreamMessageReader=Tg});var QS=R(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.WriteableStreamMessageWriter=Bi.AbstractMessageWriter=Bi.MessageWriter=void 0;var YS=Li(),tc=bo(),BB=mg(),KS=So(),FB="Content-Length: ",XS=`\r
|
|
4
|
+
`,JS;(function(t){function e(r){let n=r;return n&&tc.func(n.dispose)&&tc.func(n.onClose)&&tc.func(n.onError)&&tc.func(n.write)}t.is=e})(JS||(Bi.MessageWriter=JS={}));var Gu=class{constructor(){this.errorEmitter=new KS.Emitter,this.closeEmitter=new KS.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}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: ${tc.string(e.message)?e.message:"unknown"}`)}};Bi.AbstractMessageWriter=Gu;var bg;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,YS.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,YS.default)().applicationJson.encoder}}t.fromOptions=e})(bg||(bg={}));var _g=class extends Gu{constructor(e,r){super(),this.writable=e,this.options=bg.fromOptions(r),this.errorCount=0,this.writeSemaphore=new BB.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(FB,n.byteLength.toString(),XS),i.push(XS),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Bi.WriteableStreamMessageWriter=_g});var ZS=R(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.AbstractMessageBuffer=void 0;var jB=13,UB=10,HB=`\r
|
|
5
|
+
`,Sg=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(i=0;i<l.length;){switch(l[i]){case jB:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case UB:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=l.byteLength,n++}if(r!==4)return;let o=this._read(s+i),a=new Map,c=this.toString(o,"ascii").split(HB);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),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}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 r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Yu.AbstractMessageBuffer=Sg});var iN=R(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createMessageConnection=ye.ConnectionOptions=ye.MessageStrategy=ye.CancellationStrategy=ye.CancellationSenderStrategy=ye.CancellationReceiverStrategy=ye.RequestCancellationReceiverStrategy=ye.IdCancellationReceiverStrategy=ye.ConnectionStrategy=ye.ConnectionError=ye.ConnectionErrors=ye.LogTraceNotification=ye.SetTraceNotification=ye.TraceFormat=ye.TraceValues=ye.Trace=ye.NullLogger=ye.ProgressType=ye.ProgressToken=void 0;var eN=Li(),bt=bo(),ue=tg(),tN=ng(),rc=So(),Ng=Vu(),sc;(function(t){t.type=new ue.NotificationType("$/cancelRequest")})(sc||(sc={}));var Rg;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Rg||(ye.ProgressToken=Rg={}));var nc;(function(t){t.type=new ue.NotificationType("$/progress")})(nc||(nc={}));var Pg=class{constructor(){}};ye.ProgressType=Pg;var kg;(function(t){function e(r){return bt.func(r)}t.is=e})(kg||(kg={}));ye.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ze;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ze||(ye.Trace=ze={}));var rN;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(rN||(ye.TraceValues=rN={}));(function(t){function e(n){if(!bt.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ze||(ye.Trace=ze={}));var jr;(function(t){t.Text="text",t.JSON="json"})(jr||(ye.TraceFormat=jr={}));(function(t){function e(r){return bt.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(jr||(ye.TraceFormat=jr={}));var Eg;(function(t){t.type=new ue.NotificationType("$/setTrace")})(Eg||(ye.SetTraceNotification=Eg={}));var Ku;(function(t){t.type=new ue.NotificationType("$/logTrace")})(Ku||(ye.LogTraceNotification=Ku={}));var ic;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ic||(ye.ConnectionErrors=ic={}));var ko=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ye.ConnectionError=ko;var wg;(function(t){function e(r){let n=r;return n&&bt.func(n.cancelUndispatched)}t.is=e})(wg||(ye.ConnectionStrategy=wg={}));var Xu;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Xu||(ye.IdCancellationReceiverStrategy=Xu={}));var Cg;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&bt.func(n.createCancellationTokenSource)&&(n.dispose===void 0||bt.func(n.dispose))}t.is=e})(Cg||(ye.RequestCancellationReceiverStrategy=Cg={}));var Ju;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Ng.CancellationTokenSource}});function e(r){return Xu.is(r)||Cg.is(r)}t.is=e})(Ju||(ye.CancellationReceiverStrategy=Ju={}));var Qu;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(sc.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&bt.func(n.sendCancellation)&&bt.func(n.cleanup)}t.is=e})(Qu||(ye.CancellationSenderStrategy=Qu={}));var Zu;(function(t){t.Message=Object.freeze({receiver:Ju.Message,sender:Qu.Message});function e(r){let n=r;return n&&Ju.is(n.receiver)&&Qu.is(n.sender)}t.is=e})(Zu||(ye.CancellationStrategy=Zu={}));var ed;(function(t){function e(r){let n=r;return n&&bt.func(n.handleMessage)}t.is=e})(ed||(ye.MessageStrategy=ed={}));var nN;(function(t){function e(r){let n=r;return n&&(Zu.is(n.cancellationStrategy)||wg.is(n.connectionStrategy)||ed.is(n.messageStrategy))}t.is=e})(nN||(ye.ConnectionOptions=nN={}));var Pn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Pn||(Pn={}));function VB(t,e,r,n){let i=r!==void 0?r:ye.NullLogger,s=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,p=new Map,g,h=new tN.LinkedMap,v=new Map,S=new Set,_=new Map,T=ze.Off,P=jr.Text,C,$=Pn.New,F=new rc.Emitter,U=new rc.Emitter,me=new rc.Emitter,Xe=new rc.Emitter,Ft=new rc.Emitter,Ne=n&&n.cancellationStrategy?n.cancellationStrategy:Zu.Message;function Kr(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+k.toString()}function xi(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function Su(){return"not-"+(++o).toString()}function Cm(k,M){ue.Message.isRequest(M)?k.set(Kr(M.id),M):ue.Message.isResponse(M)?k.set(xi(M.id),M):k.set(Su(),M)}function Nu(k){}function Ya(){return $===Pn.Listening}function Ds(){return $===Pn.Closed}function fi(){return $===Pn.Disposed}function mo(){($===Pn.New||$===Pn.Listening)&&($=Pn.Closed,U.fire(void 0))}function As(k){F.fire([k,void 0,void 0])}function Ru(k){F.fire(k)}t.onClose(mo),t.onError(As),e.onClose(mo),e.onError(Ru);function Ka(){g||h.size===0||(g=(0,eN.default)().timer.setImmediate(()=>{g=void 0,Pu()}))}function Xa(k){ue.Message.isRequest(k)?Eu(k):ue.Message.isNotification(k)?Cu(k):ue.Message.isResponse(k)?wu(k):go(k)}function Pu(){if(h.size===0)return;let k=h.shift();try{let M=n?.messageStrategy;ed.is(M)?M.handleMessage(k,Xa):Xa(k)}finally{Ka()}}let ku=k=>{try{if(ue.Message.isNotification(k)&&k.method===sc.type.method){let M=k.params.id,Y=Kr(M),re=h.get(Y);if(ue.Message.isRequest(re)){let We=n?.connectionStrategy,ut=We&&We.cancelUndispatched?We.cancelUndispatched(re,Nu):void 0;if(ut&&(ut.error!==void 0||ut.result!==void 0)){h.delete(Y),_.delete(M),ut.id=re.id,Is(ut,k.method,Date.now()),e.write(ut).catch(()=>i.error("Sending response for canceled message failed."));return}}let Je=_.get(M);if(Je!==void 0){Je.cancel(),yo(k);return}else S.add(M)}Cm(h,k)}finally{Ka()}};function Eu(k){if(fi())return;function M(Re,et,Be){let Rt={jsonrpc:c,id:k.id};Re instanceof ue.ResponseError?Rt.error=Re.toJson():Rt.result=Re===void 0?null:Re,Is(Rt,et,Be),e.write(Rt).catch(()=>i.error("Sending response failed."))}function Y(Re,et,Be){let Rt={jsonrpc:c,id:k.id,error:Re.toJson()};Is(Rt,et,Be),e.write(Rt).catch(()=>i.error("Sending response failed."))}function re(Re,et,Be){Re===void 0&&(Re=null);let Rt={jsonrpc:c,id:k.id,result:Re};Is(Rt,et,Be),e.write(Rt).catch(()=>i.error("Sending response failed."))}Iu(k);let Je=u.get(k.method),We,ut;Je&&(We=Je.type,ut=Je.handler);let vt=Date.now();if(ut||l){let Re=k.id??String(Date.now()),et=Xu.is(Ne.receiver)?Ne.receiver.createCancellationTokenSource(Re):Ne.receiver.createCancellationTokenSource(k);k.id!==null&&S.has(k.id)&&et.cancel(),k.id!==null&&_.set(Re,et);try{let Be;if(ut)if(k.params===void 0){if(We!==void 0&&We.numberOfParams!==0){Y(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${k.method} defines ${We.numberOfParams} params but received none.`),k.method,vt);return}Be=ut(et.token)}else if(Array.isArray(k.params)){if(We!==void 0&&We.parameterStructures===ue.ParameterStructures.byName){Y(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,vt);return}Be=ut(...k.params,et.token)}else{if(We!==void 0&&We.parameterStructures===ue.ParameterStructures.byPosition){Y(new ue.ResponseError(ue.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,vt);return}Be=ut(k.params,et.token)}else l&&(Be=l(k.method,k.params,et.token));let Rt=Be;Be?Rt.then?Rt.then(Ht=>{_.delete(Re),M(Ht,k.method,vt)},Ht=>{_.delete(Re),Ht instanceof ue.ResponseError?Y(Ht,k.method,vt):Ht&&bt.string(Ht.message)?Y(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Ht.message}`),k.method,vt):Y(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,vt)}):(_.delete(Re),M(Be,k.method,vt)):(_.delete(Re),re(Be,k.method,vt))}catch(Be){_.delete(Re),Be instanceof ue.ResponseError?M(Be,k.method,vt):Be&&bt.string(Be.message)?Y(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Be.message}`),k.method,vt):Y(new ue.ResponseError(ue.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,vt)}}else Y(new ue.ResponseError(ue.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,vt)}function wu(k){if(!fi())if(k.id===null)k.error?i.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(k.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let M=k.id,Y=v.get(M);if(Ou(k,Y),Y!==void 0){v.delete(M);try{if(k.error){let re=k.error;Y.reject(new ue.ResponseError(re.code,re.message,re.data))}else if(k.result!==void 0)Y.resolve(k.result);else throw new Error("Should never happen.")}catch(re){re.message?i.error(`Response handler '${Y.method}' failed with message: ${re.message}`):i.error(`Response handler '${Y.method}' failed unexpectedly.`)}}}}function Cu(k){if(fi())return;let M,Y;if(k.method===sc.type.method){let re=k.params.id;S.delete(re),yo(k);return}else{let re=f.get(k.method);re&&(Y=re.handler,M=re.type)}if(Y||d)try{if(yo(k),Y)if(k.params===void 0)M!==void 0&&M.numberOfParams!==0&&M.parameterStructures!==ue.ParameterStructures.byName&&i.error(`Notification ${k.method} defines ${M.numberOfParams} params but received none.`),Y();else if(Array.isArray(k.params)){let re=k.params;k.method===nc.type.method&&re.length===2&&Rg.is(re[0])?Y({token:re[0],value:re[1]}):(M!==void 0&&(M.parameterStructures===ue.ParameterStructures.byName&&i.error(`Notification ${k.method} defines parameters by name but received parameters by position`),M.numberOfParams!==k.params.length&&i.error(`Notification ${k.method} defines ${M.numberOfParams} params but received ${re.length} arguments`)),Y(...re))}else M!==void 0&&M.parameterStructures===ue.ParameterStructures.byPosition&&i.error(`Notification ${k.method} defines parameters by position but received parameters by name`),Y(k.params);else d&&d(k.method,k.params)}catch(re){re.message?i.error(`Notification handler '${k.method}' failed with message: ${re.message}`):i.error(`Notification handler '${k.method}' failed unexpectedly.`)}else me.fire(k)}function go(k){if(!k){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(k,null,4)}`);let M=k;if(bt.string(M.id)||bt.number(M.id)){let Y=M.id,re=v.get(Y);re&&re.reject(new Error("The received response has neither a result nor an error property."))}}function Sn(k){if(k!=null)switch(T){case ze.Verbose:return JSON.stringify(k,null,4);case ze.Compact:return JSON.stringify(k);default:return}}function Du(k){if(!(T===ze.Off||!C))if(P===jr.Text){let M;(T===ze.Verbose||T===ze.Compact)&&k.params&&(M=`Params: ${Sn(k.params)}
|
|
9
9
|
|
|
10
|
-
`),C.log(`Sending request '${
|
|
10
|
+
`),C.log(`Sending request '${k.method} - (${k.id})'.`,M)}else pi("send-request",k)}function Au(k){if(!(T===ze.Off||!C))if(P===jr.Text){let M;(T===ze.Verbose||T===ze.Compact)&&(k.params?M=`Params: ${Sn(k.params)}
|
|
11
11
|
|
|
12
|
-
`:
|
|
12
|
+
`:M=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),C.log(`Sending notification '${
|
|
14
|
+
`),C.log(`Sending notification '${k.method}'.`,M)}else pi("send-notification",k)}function Is(k,M,Y){if(!(T===ze.Off||!C))if(P===jr.Text){let re;(T===ze.Verbose||T===ze.Compact)&&(k.error&&k.error.data?re=`Error data: ${Sn(k.error.data)}
|
|
15
15
|
|
|
16
|
-
`:
|
|
16
|
+
`:k.result?re=`Result: ${Sn(k.result)}
|
|
17
17
|
|
|
18
|
-
`:
|
|
18
|
+
`:k.error===void 0&&(re=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),C.log(`Sending response '${
|
|
20
|
+
`)),C.log(`Sending response '${M} - (${k.id})'. Processing request took ${Date.now()-Y}ms`,re)}else pi("send-response",k)}function Iu(k){if(!(T===ze.Off||!C))if(P===jr.Text){let M;(T===ze.Verbose||T===ze.Compact)&&k.params&&(M=`Params: ${Sn(k.params)}
|
|
21
21
|
|
|
22
|
-
`),C.log(`Received request '${
|
|
22
|
+
`),C.log(`Received request '${k.method} - (${k.id})'.`,M)}else pi("receive-request",k)}function yo(k){if(!(T===ze.Off||!C||k.method===Ku.type.method))if(P===jr.Text){let M;(T===ze.Verbose||T===ze.Compact)&&(k.params?M=`Params: ${Sn(k.params)}
|
|
23
23
|
|
|
24
|
-
`:
|
|
24
|
+
`:M=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),C.log(`Received notification '${
|
|
26
|
+
`),C.log(`Received notification '${k.method}'.`,M)}else pi("receive-notification",k)}function Ou(k,M){if(!(T===ze.Off||!C))if(P===jr.Text){let Y;if((T===ze.Verbose||T===ze.Compact)&&(k.error&&k.error.data?Y=`Error data: ${Sn(k.error.data)}
|
|
27
27
|
|
|
28
|
-
`:
|
|
28
|
+
`:k.result?Y=`Result: ${Sn(k.result)}
|
|
29
29
|
|
|
30
|
-
`:
|
|
30
|
+
`:k.error===void 0&&(Y=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),q){let re=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";C.log(`Received response '${q.method} - (${E.id})' in ${Date.now()-q.timerStart}ms.${re}`,K)}else C.log(`Received response ${E.id} without active response promise.`,K)}else mi("receive-response",E)}function mi(E,q){if(!C||T===ze.Off)return;let K={isLSPMessage:!0,type:E,message:q,timestamp:Date.now()};C.log(K)}function Bi(){if(xs())throw new Ao(fc.Closed,"Connection is closed.");if(hi())throw new Ao(fc.Disposed,"Connection is disposed.")}function Uu(){if(rc())throw new Ao(fc.AlreadyListening,"Connection is already listening")}function Hu(){if(!rc())throw new Error("Call listen() first.")}function zn(E){return E===void 0?null:E}function sc(E){if(E!==null)return E}function oc(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function No(E,q){switch(E){case de.ParameterStructures.auto:return oc(q)?sc(q):[zn(q)];case de.ParameterStructures.byName:if(!oc(q))throw new Error("Received parameters by name but param is not an object literal.");return sc(q);case de.ParameterStructures.byPosition:return[zn(q)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function ac(E,q){let K,re=E.numberOfParams;switch(re){case 0:K=void 0;break;case 1:K=No(E.parameterStructures,q[0]);break;default:K=[];for(let Qe=0;Qe<q.length&&Qe<re;Qe++)K.push(zn(q[Qe]));if(q.length<re)for(let Qe=q.length;Qe<re;Qe++)K.push(null);break}return K}let gi={sendNotification:(E,...q)=>{Bi();let K,re;if(_t.string(E)){K=E;let We=q[0],dt=0,Tt=de.ParameterStructures.auto;de.ParameterStructures.is(We)&&(dt=1,Tt=We);let Pe=q.length,tt=Pe-dt;switch(tt){case 0:re=void 0;break;case 1:re=No(Tt,q[dt]);break;default:if(Tt===de.ParameterStructures.byName)throw new Error(`Received ${tt} parameters for 'by Name' notification parameter structure.`);re=q.slice(dt,Pe).map(Be=>zn(Be));break}}else{let We=q;K=E.method,re=ac(E,We)}let Qe={jsonrpc:c,method:K,params:re};return Bu(Qe),e.write(Qe).catch(We=>{throw i.error("Sending notification failed."),We})},onNotification:(E,q)=>{Bi();let K;return _t.func(E)?d=E:q&&(_t.string(E)?(K=E,f.set(E,{type:void 0,handler:q})):(K=E.method,f.set(E.method,{type:E,handler:q}))),{dispose:()=>{K!==void 0?f.delete(K):d=void 0}}},onProgress:(E,q,K)=>{if(p.has(q))throw new Error(`Progress handler for token ${q} already registered`);return p.set(q,K),{dispose:()=>{p.delete(q)}}},sendProgress:(E,q,K)=>gi.sendNotification(dc.type,{token:q,value:K}),onUnhandledProgress:Je.event,sendRequest:(E,...q)=>{Bi(),Hu();let K,re,Qe;if(_t.string(E)){K=E;let Pe=q[0],tt=q[q.length-1],Be=0,Rt=de.ParameterStructures.auto;de.ParameterStructures.is(Pe)&&(Be=1,Rt=Pe);let zt=q.length;Ag.CancellationToken.is(tt)&&(zt=zt-1,Qe=tt);let Hr=zt-Be;switch(Hr){case 0:re=void 0;break;case 1:re=No(Rt,q[Be]);break;default:if(Rt===de.ParameterStructures.byName)throw new Error(`Received ${Hr} parameters for 'by Name' request parameter structure.`);re=q.slice(Be,zt).map(Vu=>zn(Vu));break}}else{let Pe=q;K=E.method,re=ac(E,Pe);let tt=E.numberOfParams;Qe=Ag.CancellationToken.is(Pe[tt])?Pe[tt]:void 0}let We=s++,dt;Qe&&(dt=Qe.onCancellationRequested(()=>{let Pe=Ne.sender.sendCancellation(gi,We);return Pe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${We}`),Promise.resolve()):Pe.catch(()=>{i.log(`Sending cancellation messages for id ${We} failed`)})}));let Tt={jsonrpc:c,id:We,method:K,params:re};return $u(Tt),typeof Ne.sender.enableCancellation=="function"&&Ne.sender.enableCancellation(Tt),new Promise(async(Pe,tt)=>{let Be=Hr=>{Pe(Hr),Ne.sender.cleanup(We),dt?.dispose()},Rt=Hr=>{tt(Hr),Ne.sender.cleanup(We),dt?.dispose()},zt={method:K,timerStart:Date.now(),resolve:Be,reject:Rt};try{await e.write(Tt),v.set(We,zt)}catch(Hr){throw i.error("Sending request failed."),zt.reject(new de.ResponseError(de.ErrorCodes.MessageWriteError,Hr.message?Hr.message:"Unknown reason")),Hr}})},onRequest:(E,q)=>{Bi();let K=null;return xg.is(E)?(K=void 0,l=E):_t.string(E)?(K=null,q!==void 0&&(K=E,u.set(E,{handler:q,type:void 0}))):q!==void 0&&(K=E.method,u.set(E.method,{type:E,handler:q})),{dispose:()=>{K!==null&&(K!==void 0?u.delete(K):l=void 0)}}},hasPendingResponse:()=>v.size>0,trace:async(E,q,K)=>{let re=!1,Qe=Vr.Text;K!==void 0&&(_t.boolean(K)?re=K:(re=K.sendNotification||!1,Qe=K.traceFormat||Vr.Text)),T=E,R=Qe,T===ze.Off?C=void 0:C=q,re&&!xs()&&!hi()&&await gi.sendNotification(Mg.type,{value:ze.toString(E)})},onError:U.event,onClose:H.event,onUnhandledNotification:me.event,onDispose:Ft.event,end:()=>{e.end()},dispose:()=>{if(hi())return;B=Rn.Disposed,Ft.fire(void 0);let E=new de.ResponseError(de.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let q of v.values())q.reject(E);v=new Map,_=new Map,S=new Set,h=new uN.LinkedMap,_t.func(e.dispose)&&e.dispose(),_t.func(t.dispose)&&t.dispose()},listen:()=>{Bi(),Uu(),B=Rn.Listening,t.listen(xu)},inspect:()=>{(0,lN.default)().console.log("inspect")}};return gi.onNotification(nd.type,E=>{if(T===ze.Off||!C)return;let q=T===ze.Verbose||T===ze.Compact;C.log(E.message,q?E.verbose:void 0)}),gi.onNotification(dc.type,E=>{let q=p.get(E.token);q?q(E.value):Je.fire(E)}),gi}ye.createMessageConnection=JB});var ld=P(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 ct=lg();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return ct.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return ct.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return ct.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return ct.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return ct.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return ct.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return ct.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return ct.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return ct.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return ct.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return ct.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return ct.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return ct.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return ct.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return ct.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return ct.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return ct.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return ct.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return ct.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return ct.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return ct.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return ct.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return ct.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return ct.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return ct.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return ct.ParameterStructures}});var $g=dg();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return $g.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return $g.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return $g.Touch}});var QB=QS();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return QB.Disposable}});var hN=wo();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return hN.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return hN.Emitter}});var mN=Qu();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return mN.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return mN.CancellationToken}});var gN=eN();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return gN.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return gN.SharedArrayReceiverStrategy}});var Bg=rN();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return Bg.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return Bg.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Bg.ReadableStreamMessageReader}});var Fg=aN();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return Fg.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return Fg.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Fg.WriteableStreamMessageWriter}});var ZB=cN();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return ZB.AbstractMessageBuffer}});var er=pN();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return er.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return er.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return er.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return er.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return er.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return er.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return er.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return er.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return er.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return er.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return er.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return er.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return er.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return er.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return er.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return er.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return er.MessageStrategy}});var eF=ji();O.RAL=eF.default});var TN=P(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var yN=require("util"),vi=ld(),ud=class t extends vi.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new yN.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};ud.emptyBuffer=Buffer.allocUnsafe(0);var jg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),vi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),vi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),vi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),vi.Disposable.create(()=>this.stream.off("data",e))}},Ug=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),vi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),vi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),vi.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},vN=Object.freeze({messageBuffer:Object.freeze({create:t=>new ud(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new yN.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new jg(t),asWritableStream:t=>new Ug(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Hg(){return vN}(function(t){function e(){vi.RAL.install(vN)}t.install=e})(Hg||(Hg={}));Vg.default=Hg});var Fs=P(Ce=>{"use strict";var tF=Ce&&Ce.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rF=Ce&&Ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tF(e,t,r)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.createMessageConnection=Ce.createServerSocketTransport=Ce.createClientSocketTransport=Ce.createServerPipeTransport=Ce.createClientPipeTransport=Ce.generateRandomPipeName=Ce.StreamMessageWriter=Ce.StreamMessageReader=Ce.SocketMessageWriter=Ce.SocketMessageReader=Ce.PortMessageWriter=Ce.PortMessageReader=Ce.IPCMessageWriter=Ce.IPCMessageReader=void 0;var Io=TN();Io.default.install();var bN=require("path"),nF=require("os"),iF=require("crypto"),pd=require("net"),zr=ld();rF(ld(),Ce);var zg=class extends zr.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),zr.Disposable.create(()=>this.process.off("message",e))}};Ce.IPCMessageReader=zg;var Wg=class extends zr.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ce.IPCMessageWriter=Wg;var Gg=class extends zr.AbstractMessageReader{constructor(e){super(),this.onData=new zr.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ce.PortMessageReader=Gg;var Yg=class extends zr.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ce.PortMessageWriter=Yg;var $s=class extends zr.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,Io.default)().stream.asReadableStream(e),r)}};Ce.SocketMessageReader=$s;var Bs=class extends zr.WriteableStreamMessageWriter{constructor(e,r){super((0,Io.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ce.SocketMessageWriter=Bs;var dd=class extends zr.ReadableStreamMessageReader{constructor(e,r){super((0,Io.default)().stream.asReadableStream(e),r)}};Ce.StreamMessageReader=dd;var fd=class extends zr.WriteableStreamMessageWriter{constructor(e,r){super((0,Io.default)().stream.asWritableStream(e),r)}};Ce.StreamMessageWriter=fd;var _N=process.env.XDG_RUNTIME_DIR,sF=new Map([["linux",107],["darwin",103]]);function oF(){let t=(0,iF.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;_N?e=bN.join(_N,`vscode-ipc-${t}.sock`):e=bN.join(nF.tmpdir(),`vscode-${t}.sock`);let r=sF.get(process.platform);return r!==void 0&&e.length>r&&(0,Io.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Ce.generateRandomPipeName=oF;function aF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,pd.createServer)(a=>{o.close(),r([new $s(a,e),new Bs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ce.createClientPipeTransport=aF;function cF(t,e="utf-8"){let r=(0,pd.createConnection)(t);return[new $s(r,e),new Bs(r,e)]}Ce.createServerPipeTransport=cF;function lF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,pd.createServer)(a=>{o.close(),r([new $s(a,e),new Bs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ce.createClientSocketTransport=lF;function uF(t,e="utf-8"){let r=(0,pd.createConnection)(t,"127.0.0.1");return[new $s(r,e),new Bs(r,e)]}Ce.createServerSocketTransport=uF;function dF(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function fF(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function pF(t,e,r,n){r||(r=zr.NullLogger);let i=dF(t)?new dd(t):t,s=fF(e)?new fd(e):e;return zr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,zr.createMessageConnection)(i,s,r,n)}Ce.createMessageConnection=pF});var Kg=P((o6,SN)=>{"use strict";SN.exports=Fs()});var md=P((NN,hd)=>{(function(t){if(typeof hd=="object"&&typeof hd.exports=="object"){var e=t(require,NN);e!==void 0&&(hd.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,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 r;(function(g){function w(k){return typeof k=="string"}g.is=w})(r||(e.DocumentUri=r={}));var n;(function(g){function w(k){return typeof k=="string"}g.is=w})(n||(e.URI=n={}));var i;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function w(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=w})(i||(e.integer=i={}));var s;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function w(k){return typeof k=="number"&&g.MIN_VALUE<=k&&k<=g.MAX_VALUE}g.is=w})(s||(e.uinteger=s={}));var o;(function(g){function w(b,m){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:b,character:m}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}g.is=k})(o||(e.Position=o={}));var a;(function(g){function w(b,m,D,L){if(A.uinteger(b)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(L))return{start:o.create(b,m),end:o.create(D,L)};if(o.is(b)&&o.is(m))return{start:b,end:m};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(m,", ").concat(D,", ").concat(L,"]"))}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}g.is=k})(a||(e.Range=a={}));var c;(function(g){function w(b,m){return{uri:b,range:m}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}g.is=k})(c||(e.Location=c={}));var l;(function(g){function w(b,m,D,L){return{targetUri:b,targetRange:m,targetSelectionRange:D,originSelectionRange:L}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&a.is(m.targetRange)&&A.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||A.undefined(m.originSelectionRange))}g.is=k})(l||(e.LocationLink=l={}));var u;(function(g){function w(b,m,D,L){return{red:b,green:m,blue:D,alpha:L}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&A.numberRange(m.red,0,1)&&A.numberRange(m.green,0,1)&&A.numberRange(m.blue,0,1)&&A.numberRange(m.alpha,0,1)}g.is=k})(u||(e.Color=u={}));var d;(function(g){function w(b,m){return{range:b,color:m}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}g.is=k})(d||(e.ColorInformation=d={}));var f;(function(g){function w(b,m,D){return{label:b,textEdit:m,additionalTextEdits:D}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.undefined(m.textEdit)||C.is(m))&&(A.undefined(m.additionalTextEdits)||A.typedArray(m.additionalTextEdits,C.is))}g.is=k})(f||(e.ColorPresentation=f={}));var p;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(p||(e.FoldingRangeKind=p={}));var y;(function(g){function w(b,m,D,L,ge,Et){var at={startLine:b,endLine:m};return A.defined(D)&&(at.startCharacter=D),A.defined(L)&&(at.endCharacter=L),A.defined(ge)&&(at.kind=ge),A.defined(Et)&&(at.collapsedText=Et),at}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.startLine)&&A.uinteger(m.startLine)&&(A.undefined(m.startCharacter)||A.uinteger(m.startCharacter))&&(A.undefined(m.endCharacter)||A.uinteger(m.endCharacter))&&(A.undefined(m.kind)||A.string(m.kind))}g.is=k})(y||(e.FoldingRange=y={}));var h;(function(g){function w(b,m){return{location:b,message:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}g.is=k})(h||(e.DiagnosticRelatedInformation=h={}));var v;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(v||(e.DiagnosticSeverity=v={}));var S;(function(g){g.Unnecessary=1,g.Deprecated=2})(S||(e.DiagnosticTag=S={}));var _;(function(g){function w(k){var b=k;return A.objectLiteral(b)&&A.string(b.href)}g.is=w})(_||(e.CodeDescription=_={}));var T;(function(g){function w(b,m,D,L,ge,Et){var at={range:b,message:m};return A.defined(D)&&(at.severity=D),A.defined(L)&&(at.code=L),A.defined(ge)&&(at.source=ge),A.defined(Et)&&(at.relatedInformation=Et),at}g.create=w;function k(b){var m,D=b;return A.defined(D)&&a.is(D.range)&&A.string(D.message)&&(A.number(D.severity)||A.undefined(D.severity))&&(A.integer(D.code)||A.string(D.code)||A.undefined(D.code))&&(A.undefined(D.codeDescription)||A.string((m=D.codeDescription)===null||m===void 0?void 0:m.href))&&(A.string(D.source)||A.undefined(D.source))&&(A.undefined(D.relatedInformation)||A.typedArray(D.relatedInformation,h.is))}g.is=k})(T||(e.Diagnostic=T={}));var R;(function(g){function w(b,m){for(var D=[],L=2;L<arguments.length;L++)D[L-2]=arguments[L];var ge={title:b,command:m};return A.defined(D)&&D.length>0&&(ge.arguments=D),ge}g.create=w;function k(b){var m=b;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}g.is=k})(R||(e.Command=R={}));var C;(function(g){function w(D,L){return{range:D,newText:L}}g.replace=w;function k(D,L){return{range:{start:D,end:D},newText:L}}g.insert=k;function b(D){return{range:D,newText:""}}g.del=b;function m(D){var L=D;return A.objectLiteral(L)&&A.string(L.newText)&&a.is(L.range)}g.is=m})(C||(e.TextEdit=C={}));var B;(function(g){function w(b,m,D){var L={label:b};return m!==void 0&&(L.needsConfirmation=m),D!==void 0&&(L.description=D),L}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(A.string(m.description)||m.description===void 0)}g.is=k})(B||(e.ChangeAnnotation=B={}));var U;(function(g){function w(k){var b=k;return A.string(b)}g.is=w})(U||(e.ChangeAnnotationIdentifier=U={}));var H;(function(g){function w(D,L,ge){return{range:D,newText:L,annotationId:ge}}g.replace=w;function k(D,L,ge){return{range:{start:D,end:D},newText:L,annotationId:ge}}g.insert=k;function b(D,L){return{range:D,newText:"",annotationId:L}}g.del=b;function m(D){var L=D;return C.is(L)&&(B.is(L.annotationId)||U.is(L.annotationId))}g.is=m})(H||(e.AnnotatedTextEdit=H={}));var me;(function(g){function w(b,m){return{textDocument:b,edits:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&xs.is(m.textDocument)&&Array.isArray(m.edits)}g.is=k})(me||(e.TextDocumentEdit=me={}));var Je;(function(g){function w(b,m,D){var L={kind:"create",uri:b};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(L.options=m),D!==void 0&&(L.annotationId=D),L}g.create=w;function k(b){var m=b;return m&&m.kind==="create"&&A.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||U.is(m.annotationId))}g.is=k})(Je||(e.CreateFile=Je={}));var Ft;(function(g){function w(b,m,D,L){var ge={kind:"rename",oldUri:b,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ge.options=D),L!==void 0&&(ge.annotationId=L),ge}g.create=w;function k(b){var m=b;return m&&m.kind==="rename"&&A.string(m.oldUri)&&A.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||U.is(m.annotationId))}g.is=k})(Ft||(e.RenameFile=Ft={}));var Ne;(function(g){function w(b,m,D){var L={kind:"delete",uri:b};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(L.options=m),D!==void 0&&(L.annotationId=D),L}g.create=w;function k(b){var m=b;return m&&m.kind==="delete"&&A.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||A.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||A.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||U.is(m.annotationId))}g.is=k})(Ne||(e.DeleteFile=Ne={}));var Xr;(function(g){function w(k){var b=k;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(m){return A.string(m.kind)?Je.is(m)||Ft.is(m)||Ne.is(m):me.is(m)}))}g.is=w})(Xr||(e.WorkspaceEdit=Xr={}));var $i=function(){function g(w,k){this.edits=w,this.changeAnnotations=k}return g.prototype.insert=function(w,k,b){var m,D;if(b===void 0?m=C.insert(w,k):U.is(b)?(D=b,m=H.insert(w,k,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=H.insert(w,k,D)),this.edits.push(m),D!==void 0)return D},g.prototype.replace=function(w,k,b){var m,D;if(b===void 0?m=C.replace(w,k):U.is(b)?(D=b,m=H.replace(w,k,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=H.replace(w,k,D)),this.edits.push(m),D!==void 0)return D},g.prototype.delete=function(w,k){var b,m;if(k===void 0?b=C.del(w):U.is(k)?(m=k,b=H.del(w,k)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(k),b=H.del(w,m)),this.edits.push(b),m!==void 0)return m},g.prototype.add=function(w){this.edits.push(w)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(w){if(w===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),Du=function(){function g(w){this._annotations=w===void 0?Object.create(null):w,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(w,k){var b;if(U.is(w)?b=w:(b=this.nextId(),k=w),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(k===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=k,this._size++,b},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),Lm=function(){function g(w){var k=this;this._textEditChanges=Object.create(null),w!==void 0?(this._workspaceEdit=w,w.documentChanges?(this._changeAnnotations=new Du(w.changeAnnotations),w.changeAnnotations=this._changeAnnotations.all(),w.documentChanges.forEach(function(b){if(me.is(b)){var m=new $i(b.edits,k._changeAnnotations);k._textEditChanges[b.textDocument.uri]=m}})):w.changes&&Object.keys(w.changes).forEach(function(b){var m=new $i(w.changes[b]);k._textEditChanges[b]=m})):this._workspaceEdit={}}return Object.defineProperty(g.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}),g.prototype.getTextEditChange=function(w){if(xs.is(w)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var k={uri:w.uri,version:w.version},b=this._textEditChanges[k.uri];if(!b){var m=[],D={textDocument:k,edits:m};this._workspaceEdit.documentChanges.push(D),b=new $i(m,this._changeAnnotations),this._textEditChanges[k.uri]=b}return b}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var b=this._textEditChanges[w];if(!b){var m=[];this._workspaceEdit.changes[w]=m,b=new $i(m),this._textEditChanges[w]=b}return b}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Du,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(w,k,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(k)||U.is(k)?m=k:b=k;var D,L;if(m===void 0?D=Je.create(w,b):(L=U.is(m)?m:this._changeAnnotations.manage(m),D=Je.create(w,b,L)),this._workspaceEdit.documentChanges.push(D),L!==void 0)return L},g.prototype.renameFile=function(w,k,b,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;B.is(b)||U.is(b)?D=b:m=b;var L,ge;if(D===void 0?L=Ft.create(w,k,m):(ge=U.is(D)?D:this._changeAnnotations.manage(D),L=Ft.create(w,k,m,ge)),this._workspaceEdit.documentChanges.push(L),ge!==void 0)return ge},g.prototype.deleteFile=function(w,k,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;B.is(k)||U.is(k)?m=k:b=k;var D,L;if(m===void 0?D=Ne.create(w,b):(L=U.is(m)?m:this._changeAnnotations.manage(m),D=Ne.create(w,b,L)),this._workspaceEdit.documentChanges.push(D),L!==void 0)return L},g}();e.WorkspaceChange=Lm;var Au;(function(g){function w(b){return{uri:b}}g.create=w;function k(b){var m=b;return A.defined(m)&&A.string(m.uri)}g.is=k})(Au||(e.TextDocumentIdentifier=Au={}));var rc;(function(g){function w(b,m){return{uri:b,version:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}g.is=k})(rc||(e.VersionedTextDocumentIdentifier=rc={}));var xs;(function(g){function w(b,m){return{uri:b,version:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}g.is=k})(xs||(e.OptionalVersionedTextDocumentIdentifier=xs={}));var hi;(function(g){function w(b,m,D,L){return{uri:b,languageId:m,version:D,text:L}}g.create=w;function k(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}g.is=k})(hi||(e.TextDocumentItem=hi={}));var bo;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function w(k){var b=k;return b===g.PlainText||b===g.Markdown}g.is=w})(bo||(e.MarkupKind=bo={}));var Ms;(function(g){function w(k){var b=k;return A.objectLiteral(k)&&bo.is(b.kind)&&A.string(b.value)}g.is=w})(Ms||(e.MarkupContent=Ms={}));var Iu;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(Iu||(e.CompletionItemKind=Iu={}));var nc;(function(g){g.PlainText=1,g.Snippet=2})(nc||(e.InsertTextFormat=nc={}));var ic;(function(g){g.Deprecated=1})(ic||(e.CompletionItemTag=ic={}));var Ou;(function(g){function w(b,m,D){return{newText:b,insert:m,replace:D}}g.create=w;function k(b){var m=b;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}g.is=k})(Ou||(e.InsertReplaceEdit=Ou={}));var xu;(function(g){g.asIs=1,g.adjustIndentation=2})(xu||(e.InsertTextMode=xu={}));var Mu;(function(g){function w(k){var b=k;return b&&(A.string(b.detail)||b.detail===void 0)&&(A.string(b.description)||b.description===void 0)}g.is=w})(Mu||(e.CompletionItemLabelDetails=Mu={}));var qu;(function(g){function w(k){return{label:k}}g.create=w})(qu||(e.CompletionItem=qu={}));var Lu;(function(g){function w(k,b){return{items:k||[],isIncomplete:!!b}}g.create=w})(Lu||(e.CompletionList=Lu={}));var _o;(function(g){function w(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=w;function k(b){var m=b;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}g.is=k})(_o||(e.MarkedString=_o={}));var Sn;(function(g){function w(k){var b=k;return!!b&&A.objectLiteral(b)&&(Ms.is(b.contents)||_o.is(b.contents)||A.typedArray(b.contents,_o.is))&&(k.range===void 0||a.is(k.range))}g.is=w})(Sn||(e.Hover=Sn={}));var $u;(function(g){function w(k,b){return b?{label:k,documentation:b}:{label:k}}g.create=w})($u||(e.ParameterInformation=$u={}));var Bu;(function(g){function w(k,b){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var L={label:k};return A.defined(b)&&(L.documentation=b),A.defined(m)?L.parameters=m:L.parameters=[],L}g.create=w})(Bu||(e.SignatureInformation=Bu={}));var qs;(function(g){g.Text=1,g.Read=2,g.Write=3})(qs||(e.DocumentHighlightKind=qs={}));var Fu;(function(g){function w(k,b){var m={range:k};return A.number(b)&&(m.kind=b),m}g.create=w})(Fu||(e.DocumentHighlight=Fu={}));var So;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(So||(e.SymbolKind=So={}));var ju;(function(g){g.Deprecated=1})(ju||(e.SymbolTag=ju={}));var mi;(function(g){function w(k,b,m,D,L){var ge={name:k,kind:b,location:{uri:D,range:m}};return L&&(ge.containerName=L),ge}g.create=w})(mi||(e.SymbolInformation=mi={}));var Bi;(function(g){function w(k,b,m,D){return D!==void 0?{name:k,kind:b,location:{uri:m,range:D}}:{name:k,kind:b,location:{uri:m}}}g.create=w})(Bi||(e.WorkspaceSymbol=Bi={}));var Uu;(function(g){function w(b,m,D,L,ge,Et){var at={name:b,detail:m,kind:D,range:L,selectionRange:ge};return Et!==void 0&&(at.children=Et),at}g.create=w;function k(b){var m=b;return m&&A.string(m.name)&&A.number(m.kind)&&a.is(m.range)&&a.is(m.selectionRange)&&(m.detail===void 0||A.string(m.detail))&&(m.deprecated===void 0||A.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}g.is=k})(Uu||(e.DocumentSymbol=Uu={}));var Hu;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(Hu||(e.CodeActionKind=Hu={}));var zn;(function(g){g.Invoked=1,g.Automatic=2})(zn||(e.CodeActionTriggerKind=zn={}));var sc;(function(g){function w(b,m,D){var L={diagnostics:b};return m!=null&&(L.only=m),D!=null&&(L.triggerKind=D),L}g.create=w;function k(b){var m=b;return A.defined(m)&&A.typedArray(m.diagnostics,T.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===zn.Invoked||m.triggerKind===zn.Automatic)}g.is=k})(sc||(e.CodeActionContext=sc={}));var oc;(function(g){function w(b,m,D){var L={title:b},ge=!0;return typeof m=="string"?(ge=!1,L.kind=m):R.is(m)?L.command=m:L.edit=m,ge&&D!==void 0&&(L.kind=D),L}g.create=w;function k(b){var m=b;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,T.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||R.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Xr.is(m.edit))}g.is=k})(oc||(e.CodeAction=oc={}));var No;(function(g){function w(b,m){var D={range:b};return A.defined(m)&&(D.data=m),D}g.create=w;function k(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||R.is(m.command))}g.is=k})(No||(e.CodeLens=No={}));var ac;(function(g){function w(b,m){return{tabSize:b,insertSpaces:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}g.is=k})(ac||(e.FormattingOptions=ac={}));var gi;(function(g){function w(b,m,D){return{range:b,target:m,data:D}}g.create=w;function k(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}g.is=k})(gi||(e.DocumentLink=gi={}));var E;(function(g){function w(b,m){return{range:b,parent:m}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||g.is(m.parent))}g.is=k})(E||(e.SelectionRange=E={}));var q;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(q||(e.SemanticTokenTypes=q={}));var K;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(K||(e.SemanticTokenModifiers=K={}));var re;(function(g){function w(k){var b=k;return A.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}g.is=w})(re||(e.SemanticTokens=re={}));var Qe;(function(g){function w(b,m){return{range:b,text:m}}g.create=w;function k(b){var m=b;return m!=null&&a.is(m.range)&&A.string(m.text)}g.is=k})(Qe||(e.InlineValueText=Qe={}));var We;(function(g){function w(b,m,D){return{range:b,variableName:m,caseSensitiveLookup:D}}g.create=w;function k(b){var m=b;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}g.is=k})(We||(e.InlineValueVariableLookup=We={}));var dt;(function(g){function w(b,m){return{range:b,expression:m}}g.create=w;function k(b){var m=b;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}g.is=k})(dt||(e.InlineValueEvaluatableExpression=dt={}));var Tt;(function(g){function w(b,m){return{frameId:b,stoppedLocation:m}}g.create=w;function k(b){var m=b;return A.defined(m)&&a.is(b.stoppedLocation)}g.is=k})(Tt||(e.InlineValueContext=Tt={}));var Pe;(function(g){g.Type=1,g.Parameter=2;function w(k){return k===1||k===2}g.is=w})(Pe||(e.InlayHintKind=Pe={}));var tt;(function(g){function w(b){return{value:b}}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||Ms.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||R.is(m.command))}g.is=k})(tt||(e.InlayHintLabelPart=tt={}));var Be;(function(g){function w(b,m,D){var L={position:b,label:m};return D!==void 0&&(L.kind=D),L}g.create=w;function k(b){var m=b;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,tt.is))&&(m.kind===void 0||Pe.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||Ms.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}g.is=k})(Be||(e.InlayHint=Be={}));var Rt;(function(g){function w(k){return{kind:"snippet",value:k}}g.createSnippet=w})(Rt||(e.StringValue=Rt={}));var zt;(function(g){function w(k,b,m,D){return{insertText:k,filterText:b,range:m,command:D}}g.create=w})(zt||(e.InlineCompletionItem=zt={}));var Hr;(function(g){function w(k){return{items:k}}g.create=w})(Hr||(e.InlineCompletionList=Hr={}));var Vu;(function(g){g.Invoked=0,g.Automatic=1})(Vu||(e.InlineCompletionTriggerKind=Vu={}));var BS;(function(g){function w(k,b){return{range:k,text:b}}g.create=w})(BS||(e.SelectedCompletionInfo=BS={}));var FS;(function(g){function w(k,b){return{triggerKind:k,selectedCompletionInfo:b}}g.create=w})(FS||(e.InlineCompletionContext=FS={}));var jS;(function(g){function w(k){var b=k;return A.objectLiteral(b)&&n.is(b.uri)&&A.string(b.name)}g.is=w})(jS||(e.WorkspaceFolder=jS={})),e.EOL=[`
|
|
32
|
+
`)),M){let re=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";C.log(`Received response '${M.method} - (${k.id})' in ${Date.now()-M.timerStart}ms.${re}`,Y)}else C.log(`Received response ${k.id} without active response promise.`,Y)}else pi("receive-response",k)}function pi(k,M){if(!C||T===ze.Off)return;let Y={isLSPMessage:!0,type:k,message:M,timestamp:Date.now()};C.log(Y)}function Mi(){if(Ds())throw new ko(ic.Closed,"Connection is closed.");if(fi())throw new ko(ic.Disposed,"Connection is disposed.")}function xu(){if(Ya())throw new ko(ic.AlreadyListening,"Connection is already listening")}function Mu(){if(!Ya())throw new Error("Call listen() first.")}function Vn(k){return k===void 0?null:k}function Ja(k){if(k!==null)return k}function Qa(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function vo(k,M){switch(k){case ue.ParameterStructures.auto:return Qa(M)?Ja(M):[Vn(M)];case ue.ParameterStructures.byName:if(!Qa(M))throw new Error("Received parameters by name but param is not an object literal.");return Ja(M);case ue.ParameterStructures.byPosition:return[Vn(M)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function Za(k,M){let Y,re=k.numberOfParams;switch(re){case 0:Y=void 0;break;case 1:Y=vo(k.parameterStructures,M[0]);break;default:Y=[];for(let Je=0;Je<M.length&&Je<re;Je++)Y.push(Vn(M[Je]));if(M.length<re)for(let Je=M.length;Je<re;Je++)Y.push(null);break}return Y}let hi={sendNotification:(k,...M)=>{Mi();let Y,re;if(bt.string(k)){Y=k;let We=M[0],ut=0,vt=ue.ParameterStructures.auto;ue.ParameterStructures.is(We)&&(ut=1,vt=We);let Re=M.length,et=Re-ut;switch(et){case 0:re=void 0;break;case 1:re=vo(vt,M[ut]);break;default:if(vt===ue.ParameterStructures.byName)throw new Error(`Received ${et} parameters for 'by Name' notification parameter structure.`);re=M.slice(ut,Re).map(Be=>Vn(Be));break}}else{let We=M;Y=k.method,re=Za(k,We)}let Je={jsonrpc:c,method:Y,params:re};return Au(Je),e.write(Je).catch(We=>{throw i.error("Sending notification failed."),We})},onNotification:(k,M)=>{Mi();let Y;return bt.func(k)?d=k:M&&(bt.string(k)?(Y=k,f.set(k,{type:void 0,handler:M})):(Y=k.method,f.set(k.method,{type:k,handler:M}))),{dispose:()=>{Y!==void 0?f.delete(Y):d=void 0}}},onProgress:(k,M,Y)=>{if(p.has(M))throw new Error(`Progress handler for token ${M} already registered`);return p.set(M,Y),{dispose:()=>{p.delete(M)}}},sendProgress:(k,M,Y)=>hi.sendNotification(nc.type,{token:M,value:Y}),onUnhandledProgress:Xe.event,sendRequest:(k,...M)=>{Mi(),Mu();let Y,re,Je;if(bt.string(k)){Y=k;let Re=M[0],et=M[M.length-1],Be=0,Rt=ue.ParameterStructures.auto;ue.ParameterStructures.is(Re)&&(Be=1,Rt=Re);let Ht=M.length;Ng.CancellationToken.is(et)&&(Ht=Ht-1,Je=et);let Fr=Ht-Be;switch(Fr){case 0:re=void 0;break;case 1:re=vo(Rt,M[Be]);break;default:if(Rt===ue.ParameterStructures.byName)throw new Error(`Received ${Fr} parameters for 'by Name' request parameter structure.`);re=M.slice(Be,Ht).map(qu=>Vn(qu));break}}else{let Re=M;Y=k.method,re=Za(k,Re);let et=k.numberOfParams;Je=Ng.CancellationToken.is(Re[et])?Re[et]:void 0}let We=s++,ut;Je&&(ut=Je.onCancellationRequested(()=>{let Re=Ne.sender.sendCancellation(hi,We);return Re===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${We}`),Promise.resolve()):Re.catch(()=>{i.log(`Sending cancellation messages for id ${We} failed`)})}));let vt={jsonrpc:c,id:We,method:Y,params:re};return Du(vt),typeof Ne.sender.enableCancellation=="function"&&Ne.sender.enableCancellation(vt),new Promise(async(Re,et)=>{let Be=Fr=>{Re(Fr),Ne.sender.cleanup(We),ut?.dispose()},Rt=Fr=>{et(Fr),Ne.sender.cleanup(We),ut?.dispose()},Ht={method:Y,timerStart:Date.now(),resolve:Be,reject:Rt};try{await e.write(vt),v.set(We,Ht)}catch(Fr){throw i.error("Sending request failed."),Ht.reject(new ue.ResponseError(ue.ErrorCodes.MessageWriteError,Fr.message?Fr.message:"Unknown reason")),Fr}})},onRequest:(k,M)=>{Mi();let Y=null;return kg.is(k)?(Y=void 0,l=k):bt.string(k)?(Y=null,M!==void 0&&(Y=k,u.set(k,{handler:M,type:void 0}))):M!==void 0&&(Y=k.method,u.set(k.method,{type:k,handler:M})),{dispose:()=>{Y!==null&&(Y!==void 0?u.delete(Y):l=void 0)}}},hasPendingResponse:()=>v.size>0,trace:async(k,M,Y)=>{let re=!1,Je=jr.Text;Y!==void 0&&(bt.boolean(Y)?re=Y:(re=Y.sendNotification||!1,Je=Y.traceFormat||jr.Text)),T=k,P=Je,T===ze.Off?C=void 0:C=M,re&&!Ds()&&!fi()&&await hi.sendNotification(Eg.type,{value:ze.toString(k)})},onError:F.event,onClose:U.event,onUnhandledNotification:me.event,onDispose:Ft.event,end:()=>{e.end()},dispose:()=>{if(fi())return;$=Pn.Disposed,Ft.fire(void 0);let k=new ue.ResponseError(ue.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let M of v.values())M.reject(k);v=new Map,_=new Map,S=new Set,h=new tN.LinkedMap,bt.func(e.dispose)&&e.dispose(),bt.func(t.dispose)&&t.dispose()},listen:()=>{Mi(),xu(),$=Pn.Listening,t.listen(ku)},inspect:()=>{(0,eN.default)().console.log("inspect")}};return hi.onNotification(Ku.type,k=>{if(T===ze.Off||!C)return;let M=T===ze.Verbose||T===ze.Compact;C.log(k.message,M?k.verbose:void 0)}),hi.onNotification(nc.type,k=>{let M=p.get(k.token);M?M(k.value):Xe.fire(k)}),hi}ye.createMessageConnection=VB});var td=R(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 at=tg();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return at.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return at.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return at.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return at.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return at.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return at.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return at.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return at.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return at.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return at.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return at.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return at.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return at.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return at.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return at.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return at.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return at.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return at.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return at.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return at.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return at.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return at.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return at.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return at.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return at.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return at.ParameterStructures}});var Dg=ng();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return Dg.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return Dg.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return Dg.Touch}});var zB=HS();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return zB.Disposable}});var sN=So();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return sN.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return sN.Emitter}});var oN=Vu();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return oN.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return oN.CancellationToken}});var aN=zS();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return aN.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return aN.SharedArrayReceiverStrategy}});var Ag=GS();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return Ag.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return Ag.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ag.ReadableStreamMessageReader}});var Ig=QS();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return Ig.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ig.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ig.WriteableStreamMessageWriter}});var WB=ZS();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return WB.AbstractMessageBuffer}});var Qt=iN();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return Qt.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return Qt.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return Qt.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return Qt.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return Qt.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return Qt.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return Qt.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return Qt.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return Qt.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return Qt.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return Qt.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return Qt.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return Qt.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Qt.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Qt.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return Qt.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return Qt.MessageStrategy}});var GB=Li();O.RAL=GB.default});var uN=R(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});var cN=require("util"),gi=td(),rd=class t extends gi.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new cN.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};rd.emptyBuffer=Buffer.allocUnsafe(0);var Og=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),gi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),gi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),gi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),gi.Disposable.create(()=>this.stream.off("data",e))}},xg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),gi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),gi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),gi.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},lN=Object.freeze({messageBuffer:Object.freeze({create:t=>new rd(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new cN.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new Og(t),asWritableStream:t=>new xg(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Mg(){return lN}(function(t){function e(){gi.RAL.install(lN)}t.install=e})(Mg||(Mg={}));qg.default=Mg});var qs=R(Ce=>{"use strict";var YB=Ce&&Ce.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KB=Ce&&Ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YB(e,t,r)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.createMessageConnection=Ce.createServerSocketTransport=Ce.createClientSocketTransport=Ce.createServerPipeTransport=Ce.createClientPipeTransport=Ce.generateRandomPipeName=Ce.StreamMessageWriter=Ce.StreamMessageReader=Ce.SocketMessageWriter=Ce.SocketMessageReader=Ce.PortMessageWriter=Ce.PortMessageReader=Ce.IPCMessageWriter=Ce.IPCMessageReader=void 0;var Eo=uN();Eo.default.install();var dN=require("path"),XB=require("os"),JB=require("crypto"),sd=require("net"),Ur=td();KB(td(),Ce);var Lg=class extends Ur.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Ur.Disposable.create(()=>this.process.off("message",e))}};Ce.IPCMessageReader=Lg;var $g=class extends Ur.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ce.IPCMessageWriter=$g;var Bg=class extends Ur.AbstractMessageReader{constructor(e){super(),this.onData=new Ur.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ce.PortMessageReader=Bg;var Fg=class extends Ur.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ce.PortMessageWriter=Fg;var xs=class extends Ur.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,Eo.default)().stream.asReadableStream(e),r)}};Ce.SocketMessageReader=xs;var Ms=class extends Ur.WriteableStreamMessageWriter{constructor(e,r){super((0,Eo.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ce.SocketMessageWriter=Ms;var nd=class extends Ur.ReadableStreamMessageReader{constructor(e,r){super((0,Eo.default)().stream.asReadableStream(e),r)}};Ce.StreamMessageReader=nd;var id=class extends Ur.WriteableStreamMessageWriter{constructor(e,r){super((0,Eo.default)().stream.asWritableStream(e),r)}};Ce.StreamMessageWriter=id;var fN=process.env.XDG_RUNTIME_DIR,QB=new Map([["linux",107],["darwin",103]]);function ZB(){let t=(0,JB.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;fN?e=dN.join(fN,`vscode-ipc-${t}.sock`):e=dN.join(XB.tmpdir(),`vscode-${t}.sock`);let r=QB.get(process.platform);return r!==void 0&&e.length>r&&(0,Eo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Ce.generateRandomPipeName=ZB;function eF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,sd.createServer)(a=>{o.close(),r([new xs(a,e),new Ms(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ce.createClientPipeTransport=eF;function tF(t,e="utf-8"){let r=(0,sd.createConnection)(t);return[new xs(r,e),new Ms(r,e)]}Ce.createServerPipeTransport=tF;function rF(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let o=(0,sd.createServer)(a=>{o.close(),r([new xs(a,e),new Ms(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n})})})}Ce.createClientSocketTransport=rF;function nF(t,e="utf-8"){let r=(0,sd.createConnection)(t,"127.0.0.1");return[new xs(r,e),new Ms(r,e)]}Ce.createServerSocketTransport=nF;function iF(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function sF(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function oF(t,e,r,n){r||(r=Ur.NullLogger);let i=iF(t)?new nd(t):t,s=sF(e)?new id(e):e;return Ur.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Ur.createMessageConnection)(i,s,r,n)}Ce.createMessageConnection=oF});var jg=R((ZJ,pN)=>{"use strict";pN.exports=qs()});var ad=R((hN,od)=>{(function(t){if(typeof od=="object"&&typeof od.exports=="object"){var e=t(require,hN);e!==void 0&&(od.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,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 r;(function(y){function E(w){return typeof w=="string"}y.is=E})(r||(e.DocumentUri=r={}));var n;(function(y){function E(w){return typeof w=="string"}y.is=E})(n||(e.URI=n={}));var i;(function(y){y.MIN_VALUE=-2147483648,y.MAX_VALUE=2147483647;function E(w){return typeof w=="number"&&y.MIN_VALUE<=w&&w<=y.MAX_VALUE}y.is=E})(i||(e.integer=i={}));var s;(function(y){y.MIN_VALUE=0,y.MAX_VALUE=2147483647;function E(w){return typeof w=="number"&&y.MIN_VALUE<=w&&w<=y.MAX_VALUE}y.is=E})(s||(e.uinteger=s={}));var o;(function(y){function E(b,m){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),m===Number.MAX_VALUE&&(m=s.MAX_VALUE),{line:b,character:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.line)&&A.uinteger(m.character)}y.is=w})(o||(e.Position=o={}));var a;(function(y){function E(b,m,D,q){if(A.uinteger(b)&&A.uinteger(m)&&A.uinteger(D)&&A.uinteger(q))return{start:o.create(b,m),end:o.create(D,q)};if(o.is(b)&&o.is(m))return{start:b,end:m};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(m,", ").concat(D,", ").concat(q,"]"))}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&o.is(m.start)&&o.is(m.end)}y.is=w})(a||(e.Range=a={}));var c;(function(y){function E(b,m){return{uri:b,range:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(A.string(m.uri)||A.undefined(m.uri))}y.is=w})(c||(e.Location=c={}));var l;(function(y){function E(b,m,D,q){return{targetUri:b,targetRange:m,targetSelectionRange:D,originSelectionRange:q}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.targetRange)&&A.string(m.targetUri)&&a.is(m.targetSelectionRange)&&(a.is(m.originSelectionRange)||A.undefined(m.originSelectionRange))}y.is=w})(l||(e.LocationLink=l={}));var u;(function(y){function E(b,m,D,q){return{red:b,green:m,blue:D,alpha:q}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.numberRange(m.red,0,1)&&A.numberRange(m.green,0,1)&&A.numberRange(m.blue,0,1)&&A.numberRange(m.alpha,0,1)}y.is=w})(u||(e.Color=u={}));var d;(function(y){function E(b,m){return{range:b,color:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&u.is(m.color)}y.is=w})(d||(e.ColorInformation=d={}));var f;(function(y){function E(b,m,D){return{label:b,textEdit:m,additionalTextEdits:D}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.undefined(m.textEdit)||C.is(m))&&(A.undefined(m.additionalTextEdits)||A.typedArray(m.additionalTextEdits,C.is))}y.is=w})(f||(e.ColorPresentation=f={}));var p;(function(y){y.Comment="comment",y.Imports="imports",y.Region="region"})(p||(e.FoldingRangeKind=p={}));var g;(function(y){function E(b,m,D,q,ge,Pt){var ot={startLine:b,endLine:m};return A.defined(D)&&(ot.startCharacter=D),A.defined(q)&&(ot.endCharacter=q),A.defined(ge)&&(ot.kind=ge),A.defined(Pt)&&(ot.collapsedText=Pt),ot}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.uinteger(m.startLine)&&A.uinteger(m.startLine)&&(A.undefined(m.startCharacter)||A.uinteger(m.startCharacter))&&(A.undefined(m.endCharacter)||A.uinteger(m.endCharacter))&&(A.undefined(m.kind)||A.string(m.kind))}y.is=w})(g||(e.FoldingRange=g={}));var h;(function(y){function E(b,m){return{location:b,message:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&c.is(m.location)&&A.string(m.message)}y.is=w})(h||(e.DiagnosticRelatedInformation=h={}));var v;(function(y){y.Error=1,y.Warning=2,y.Information=3,y.Hint=4})(v||(e.DiagnosticSeverity=v={}));var S;(function(y){y.Unnecessary=1,y.Deprecated=2})(S||(e.DiagnosticTag=S={}));var _;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&A.string(b.href)}y.is=E})(_||(e.CodeDescription=_={}));var T;(function(y){function E(b,m,D,q,ge,Pt){var ot={range:b,message:m};return A.defined(D)&&(ot.severity=D),A.defined(q)&&(ot.code=q),A.defined(ge)&&(ot.source=ge),A.defined(Pt)&&(ot.relatedInformation=Pt),ot}y.create=E;function w(b){var m,D=b;return A.defined(D)&&a.is(D.range)&&A.string(D.message)&&(A.number(D.severity)||A.undefined(D.severity))&&(A.integer(D.code)||A.string(D.code)||A.undefined(D.code))&&(A.undefined(D.codeDescription)||A.string((m=D.codeDescription)===null||m===void 0?void 0:m.href))&&(A.string(D.source)||A.undefined(D.source))&&(A.undefined(D.relatedInformation)||A.typedArray(D.relatedInformation,h.is))}y.is=w})(T||(e.Diagnostic=T={}));var P;(function(y){function E(b,m){for(var D=[],q=2;q<arguments.length;q++)D[q-2]=arguments[q];var ge={title:b,command:m};return A.defined(D)&&D.length>0&&(ge.arguments=D),ge}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.title)&&A.string(m.command)}y.is=w})(P||(e.Command=P={}));var C;(function(y){function E(D,q){return{range:D,newText:q}}y.replace=E;function w(D,q){return{range:{start:D,end:D},newText:q}}y.insert=w;function b(D){return{range:D,newText:""}}y.del=b;function m(D){var q=D;return A.objectLiteral(q)&&A.string(q.newText)&&a.is(q.range)}y.is=m})(C||(e.TextEdit=C={}));var $;(function(y){function E(b,m,D){var q={label:b};return m!==void 0&&(q.needsConfirmation=m),D!==void 0&&(q.description=D),q}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&A.string(m.label)&&(A.boolean(m.needsConfirmation)||m.needsConfirmation===void 0)&&(A.string(m.description)||m.description===void 0)}y.is=w})($||(e.ChangeAnnotation=$={}));var F;(function(y){function E(w){var b=w;return A.string(b)}y.is=E})(F||(e.ChangeAnnotationIdentifier=F={}));var U;(function(y){function E(D,q,ge){return{range:D,newText:q,annotationId:ge}}y.replace=E;function w(D,q,ge){return{range:{start:D,end:D},newText:q,annotationId:ge}}y.insert=w;function b(D,q){return{range:D,newText:"",annotationId:q}}y.del=b;function m(D){var q=D;return C.is(q)&&($.is(q.annotationId)||F.is(q.annotationId))}y.is=m})(U||(e.AnnotatedTextEdit=U={}));var me;(function(y){function E(b,m){return{textDocument:b,edits:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&Ds.is(m.textDocument)&&Array.isArray(m.edits)}y.is=w})(me||(e.TextDocumentEdit=me={}));var Xe;(function(y){function E(b,m,D){var q={kind:"create",uri:b};return m!==void 0&&(m.overwrite!==void 0||m.ignoreIfExists!==void 0)&&(q.options=m),D!==void 0&&(q.annotationId=D),q}y.create=E;function w(b){var m=b;return m&&m.kind==="create"&&A.string(m.uri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||F.is(m.annotationId))}y.is=w})(Xe||(e.CreateFile=Xe={}));var Ft;(function(y){function E(b,m,D,q){var ge={kind:"rename",oldUri:b,newUri:m};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(ge.options=D),q!==void 0&&(ge.annotationId=q),ge}y.create=E;function w(b){var m=b;return m&&m.kind==="rename"&&A.string(m.oldUri)&&A.string(m.newUri)&&(m.options===void 0||(m.options.overwrite===void 0||A.boolean(m.options.overwrite))&&(m.options.ignoreIfExists===void 0||A.boolean(m.options.ignoreIfExists)))&&(m.annotationId===void 0||F.is(m.annotationId))}y.is=w})(Ft||(e.RenameFile=Ft={}));var Ne;(function(y){function E(b,m,D){var q={kind:"delete",uri:b};return m!==void 0&&(m.recursive!==void 0||m.ignoreIfNotExists!==void 0)&&(q.options=m),D!==void 0&&(q.annotationId=D),q}y.create=E;function w(b){var m=b;return m&&m.kind==="delete"&&A.string(m.uri)&&(m.options===void 0||(m.options.recursive===void 0||A.boolean(m.options.recursive))&&(m.options.ignoreIfNotExists===void 0||A.boolean(m.options.ignoreIfNotExists)))&&(m.annotationId===void 0||F.is(m.annotationId))}y.is=w})(Ne||(e.DeleteFile=Ne={}));var Kr;(function(y){function E(w){var b=w;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(m){return A.string(m.kind)?Xe.is(m)||Ft.is(m)||Ne.is(m):me.is(m)}))}y.is=E})(Kr||(e.WorkspaceEdit=Kr={}));var xi=function(){function y(E,w){this.edits=E,this.changeAnnotations=w}return y.prototype.insert=function(E,w,b){var m,D;if(b===void 0?m=C.insert(E,w):F.is(b)?(D=b,m=U.insert(E,w,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=U.insert(E,w,D)),this.edits.push(m),D!==void 0)return D},y.prototype.replace=function(E,w,b){var m,D;if(b===void 0?m=C.replace(E,w):F.is(b)?(D=b,m=U.replace(E,w,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),m=U.replace(E,w,D)),this.edits.push(m),D!==void 0)return D},y.prototype.delete=function(E,w){var b,m;if(w===void 0?b=C.del(E):F.is(w)?(m=w,b=U.del(E,w)):(this.assertChangeAnnotations(this.changeAnnotations),m=this.changeAnnotations.manage(w),b=U.del(E,m)),this.edits.push(b),m!==void 0)return m},y.prototype.add=function(E){this.edits.push(E)},y.prototype.all=function(){return this.edits},y.prototype.clear=function(){this.edits.splice(0,this.edits.length)},y.prototype.assertChangeAnnotations=function(E){if(E===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},y}(),Su=function(){function y(E){this._annotations=E===void 0?Object.create(null):E,this._counter=0,this._size=0}return y.prototype.all=function(){return this._annotations},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),y.prototype.manage=function(E,w){var b;if(F.is(E)?b=E:(b=this.nextId(),w=E),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(w===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=w,this._size++,b},y.prototype.nextId=function(){return this._counter++,this._counter.toString()},y}(),Cm=function(){function y(E){var w=this;this._textEditChanges=Object.create(null),E!==void 0?(this._workspaceEdit=E,E.documentChanges?(this._changeAnnotations=new Su(E.changeAnnotations),E.changeAnnotations=this._changeAnnotations.all(),E.documentChanges.forEach(function(b){if(me.is(b)){var m=new xi(b.edits,w._changeAnnotations);w._textEditChanges[b.textDocument.uri]=m}})):E.changes&&Object.keys(E.changes).forEach(function(b){var m=new xi(E.changes[b]);w._textEditChanges[b]=m})):this._workspaceEdit={}}return Object.defineProperty(y.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}),y.prototype.getTextEditChange=function(E){if(Ds.is(E)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var w={uri:E.uri,version:E.version},b=this._textEditChanges[w.uri];if(!b){var m=[],D={textDocument:w,edits:m};this._workspaceEdit.documentChanges.push(D),b=new xi(m,this._changeAnnotations),this._textEditChanges[w.uri]=b}return b}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var b=this._textEditChanges[E];if(!b){var m=[];this._workspaceEdit.changes[E]=m,b=new xi(m),this._textEditChanges[E]=b}return b}},y.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Su,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},y.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},y.prototype.createFile=function(E,w,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;$.is(w)||F.is(w)?m=w:b=w;var D,q;if(m===void 0?D=Xe.create(E,b):(q=F.is(m)?m:this._changeAnnotations.manage(m),D=Xe.create(E,b,q)),this._workspaceEdit.documentChanges.push(D),q!==void 0)return q},y.prototype.renameFile=function(E,w,b,m){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;$.is(b)||F.is(b)?D=b:m=b;var q,ge;if(D===void 0?q=Ft.create(E,w,m):(ge=F.is(D)?D:this._changeAnnotations.manage(D),q=Ft.create(E,w,m,ge)),this._workspaceEdit.documentChanges.push(q),ge!==void 0)return ge},y.prototype.deleteFile=function(E,w,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m;$.is(w)||F.is(w)?m=w:b=w;var D,q;if(m===void 0?D=Ne.create(E,b):(q=F.is(m)?m:this._changeAnnotations.manage(m),D=Ne.create(E,b,q)),this._workspaceEdit.documentChanges.push(D),q!==void 0)return q},y}();e.WorkspaceChange=Cm;var Nu;(function(y){function E(b){return{uri:b}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)}y.is=w})(Nu||(e.TextDocumentIdentifier=Nu={}));var Ya;(function(y){function E(b,m){return{uri:b,version:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.integer(m.version)}y.is=w})(Ya||(e.VersionedTextDocumentIdentifier=Ya={}));var Ds;(function(y){function E(b,m){return{uri:b,version:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&(m.version===null||A.integer(m.version))}y.is=w})(Ds||(e.OptionalVersionedTextDocumentIdentifier=Ds={}));var fi;(function(y){function E(b,m,D,q){return{uri:b,languageId:m,version:D,text:q}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.string(m.uri)&&A.string(m.languageId)&&A.integer(m.version)&&A.string(m.text)}y.is=w})(fi||(e.TextDocumentItem=fi={}));var mo;(function(y){y.PlainText="plaintext",y.Markdown="markdown";function E(w){var b=w;return b===y.PlainText||b===y.Markdown}y.is=E})(mo||(e.MarkupKind=mo={}));var As;(function(y){function E(w){var b=w;return A.objectLiteral(w)&&mo.is(b.kind)&&A.string(b.value)}y.is=E})(As||(e.MarkupContent=As={}));var Ru;(function(y){y.Text=1,y.Method=2,y.Function=3,y.Constructor=4,y.Field=5,y.Variable=6,y.Class=7,y.Interface=8,y.Module=9,y.Property=10,y.Unit=11,y.Value=12,y.Enum=13,y.Keyword=14,y.Snippet=15,y.Color=16,y.File=17,y.Reference=18,y.Folder=19,y.EnumMember=20,y.Constant=21,y.Struct=22,y.Event=23,y.Operator=24,y.TypeParameter=25})(Ru||(e.CompletionItemKind=Ru={}));var Ka;(function(y){y.PlainText=1,y.Snippet=2})(Ka||(e.InsertTextFormat=Ka={}));var Xa;(function(y){y.Deprecated=1})(Xa||(e.CompletionItemTag=Xa={}));var Pu;(function(y){function E(b,m,D){return{newText:b,insert:m,replace:D}}y.create=E;function w(b){var m=b;return m&&A.string(m.newText)&&a.is(m.insert)&&a.is(m.replace)}y.is=w})(Pu||(e.InsertReplaceEdit=Pu={}));var ku;(function(y){y.asIs=1,y.adjustIndentation=2})(ku||(e.InsertTextMode=ku={}));var Eu;(function(y){function E(w){var b=w;return b&&(A.string(b.detail)||b.detail===void 0)&&(A.string(b.description)||b.description===void 0)}y.is=E})(Eu||(e.CompletionItemLabelDetails=Eu={}));var wu;(function(y){function E(w){return{label:w}}y.create=E})(wu||(e.CompletionItem=wu={}));var Cu;(function(y){function E(w,b){return{items:w||[],isIncomplete:!!b}}y.create=E})(Cu||(e.CompletionList=Cu={}));var go;(function(y){function E(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}y.fromPlainText=E;function w(b){var m=b;return A.string(m)||A.objectLiteral(m)&&A.string(m.language)&&A.string(m.value)}y.is=w})(go||(e.MarkedString=go={}));var Sn;(function(y){function E(w){var b=w;return!!b&&A.objectLiteral(b)&&(As.is(b.contents)||go.is(b.contents)||A.typedArray(b.contents,go.is))&&(w.range===void 0||a.is(w.range))}y.is=E})(Sn||(e.Hover=Sn={}));var Du;(function(y){function E(w,b){return b?{label:w,documentation:b}:{label:w}}y.create=E})(Du||(e.ParameterInformation=Du={}));var Au;(function(y){function E(w,b){for(var m=[],D=2;D<arguments.length;D++)m[D-2]=arguments[D];var q={label:w};return A.defined(b)&&(q.documentation=b),A.defined(m)?q.parameters=m:q.parameters=[],q}y.create=E})(Au||(e.SignatureInformation=Au={}));var Is;(function(y){y.Text=1,y.Read=2,y.Write=3})(Is||(e.DocumentHighlightKind=Is={}));var Iu;(function(y){function E(w,b){var m={range:w};return A.number(b)&&(m.kind=b),m}y.create=E})(Iu||(e.DocumentHighlight=Iu={}));var yo;(function(y){y.File=1,y.Module=2,y.Namespace=3,y.Package=4,y.Class=5,y.Method=6,y.Property=7,y.Field=8,y.Constructor=9,y.Enum=10,y.Interface=11,y.Function=12,y.Variable=13,y.Constant=14,y.String=15,y.Number=16,y.Boolean=17,y.Array=18,y.Object=19,y.Key=20,y.Null=21,y.EnumMember=22,y.Struct=23,y.Event=24,y.Operator=25,y.TypeParameter=26})(yo||(e.SymbolKind=yo={}));var Ou;(function(y){y.Deprecated=1})(Ou||(e.SymbolTag=Ou={}));var pi;(function(y){function E(w,b,m,D,q){var ge={name:w,kind:b,location:{uri:D,range:m}};return q&&(ge.containerName=q),ge}y.create=E})(pi||(e.SymbolInformation=pi={}));var Mi;(function(y){function E(w,b,m,D){return D!==void 0?{name:w,kind:b,location:{uri:m,range:D}}:{name:w,kind:b,location:{uri:m}}}y.create=E})(Mi||(e.WorkspaceSymbol=Mi={}));var xu;(function(y){function E(b,m,D,q,ge,Pt){var ot={name:b,detail:m,kind:D,range:q,selectionRange:ge};return Pt!==void 0&&(ot.children=Pt),ot}y.create=E;function w(b){var m=b;return m&&A.string(m.name)&&A.number(m.kind)&&a.is(m.range)&&a.is(m.selectionRange)&&(m.detail===void 0||A.string(m.detail))&&(m.deprecated===void 0||A.boolean(m.deprecated))&&(m.children===void 0||Array.isArray(m.children))&&(m.tags===void 0||Array.isArray(m.tags))}y.is=w})(xu||(e.DocumentSymbol=xu={}));var Mu;(function(y){y.Empty="",y.QuickFix="quickfix",y.Refactor="refactor",y.RefactorExtract="refactor.extract",y.RefactorInline="refactor.inline",y.RefactorRewrite="refactor.rewrite",y.Source="source",y.SourceOrganizeImports="source.organizeImports",y.SourceFixAll="source.fixAll"})(Mu||(e.CodeActionKind=Mu={}));var Vn;(function(y){y.Invoked=1,y.Automatic=2})(Vn||(e.CodeActionTriggerKind=Vn={}));var Ja;(function(y){function E(b,m,D){var q={diagnostics:b};return m!=null&&(q.only=m),D!=null&&(q.triggerKind=D),q}y.create=E;function w(b){var m=b;return A.defined(m)&&A.typedArray(m.diagnostics,T.is)&&(m.only===void 0||A.typedArray(m.only,A.string))&&(m.triggerKind===void 0||m.triggerKind===Vn.Invoked||m.triggerKind===Vn.Automatic)}y.is=w})(Ja||(e.CodeActionContext=Ja={}));var Qa;(function(y){function E(b,m,D){var q={title:b},ge=!0;return typeof m=="string"?(ge=!1,q.kind=m):P.is(m)?q.command=m:q.edit=m,ge&&D!==void 0&&(q.kind=D),q}y.create=E;function w(b){var m=b;return m&&A.string(m.title)&&(m.diagnostics===void 0||A.typedArray(m.diagnostics,T.is))&&(m.kind===void 0||A.string(m.kind))&&(m.edit!==void 0||m.command!==void 0)&&(m.command===void 0||P.is(m.command))&&(m.isPreferred===void 0||A.boolean(m.isPreferred))&&(m.edit===void 0||Kr.is(m.edit))}y.is=w})(Qa||(e.CodeAction=Qa={}));var vo;(function(y){function E(b,m){var D={range:b};return A.defined(m)&&(D.data=m),D}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.command)||P.is(m.command))}y.is=w})(vo||(e.CodeLens=vo={}));var Za;(function(y){function E(b,m){return{tabSize:b,insertSpaces:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&A.uinteger(m.tabSize)&&A.boolean(m.insertSpaces)}y.is=w})(Za||(e.FormattingOptions=Za={}));var hi;(function(y){function E(b,m,D){return{range:b,target:m,data:D}}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(m.range)&&(A.undefined(m.target)||A.string(m.target))}y.is=w})(hi||(e.DocumentLink=hi={}));var k;(function(y){function E(b,m){return{range:b,parent:m}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&a.is(m.range)&&(m.parent===void 0||y.is(m.parent))}y.is=w})(k||(e.SelectionRange=k={}));var M;(function(y){y.namespace="namespace",y.type="type",y.class="class",y.enum="enum",y.interface="interface",y.struct="struct",y.typeParameter="typeParameter",y.parameter="parameter",y.variable="variable",y.property="property",y.enumMember="enumMember",y.event="event",y.function="function",y.method="method",y.macro="macro",y.keyword="keyword",y.modifier="modifier",y.comment="comment",y.string="string",y.number="number",y.regexp="regexp",y.operator="operator",y.decorator="decorator"})(M||(e.SemanticTokenTypes=M={}));var Y;(function(y){y.declaration="declaration",y.definition="definition",y.readonly="readonly",y.static="static",y.deprecated="deprecated",y.abstract="abstract",y.async="async",y.modification="modification",y.documentation="documentation",y.defaultLibrary="defaultLibrary"})(Y||(e.SemanticTokenModifiers=Y={}));var re;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}y.is=E})(re||(e.SemanticTokens=re={}));var Je;(function(y){function E(b,m){return{range:b,text:m}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&A.string(m.text)}y.is=w})(Je||(e.InlineValueText=Je={}));var We;(function(y){function E(b,m,D){return{range:b,variableName:m,caseSensitiveLookup:D}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&A.boolean(m.caseSensitiveLookup)&&(A.string(m.variableName)||m.variableName===void 0)}y.is=w})(We||(e.InlineValueVariableLookup=We={}));var ut;(function(y){function E(b,m){return{range:b,expression:m}}y.create=E;function w(b){var m=b;return m!=null&&a.is(m.range)&&(A.string(m.expression)||m.expression===void 0)}y.is=w})(ut||(e.InlineValueEvaluatableExpression=ut={}));var vt;(function(y){function E(b,m){return{frameId:b,stoppedLocation:m}}y.create=E;function w(b){var m=b;return A.defined(m)&&a.is(b.stoppedLocation)}y.is=w})(vt||(e.InlineValueContext=vt={}));var Re;(function(y){y.Type=1,y.Parameter=2;function E(w){return w===1||w===2}y.is=E})(Re||(e.InlayHintKind=Re={}));var et;(function(y){function E(b){return{value:b}}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&(m.tooltip===void 0||A.string(m.tooltip)||As.is(m.tooltip))&&(m.location===void 0||c.is(m.location))&&(m.command===void 0||P.is(m.command))}y.is=w})(et||(e.InlayHintLabelPart=et={}));var Be;(function(y){function E(b,m,D){var q={position:b,label:m};return D!==void 0&&(q.kind=D),q}y.create=E;function w(b){var m=b;return A.objectLiteral(m)&&o.is(m.position)&&(A.string(m.label)||A.typedArray(m.label,et.is))&&(m.kind===void 0||Re.is(m.kind))&&m.textEdits===void 0||A.typedArray(m.textEdits,C.is)&&(m.tooltip===void 0||A.string(m.tooltip)||As.is(m.tooltip))&&(m.paddingLeft===void 0||A.boolean(m.paddingLeft))&&(m.paddingRight===void 0||A.boolean(m.paddingRight))}y.is=w})(Be||(e.InlayHint=Be={}));var Rt;(function(y){function E(w){return{kind:"snippet",value:w}}y.createSnippet=E})(Rt||(e.StringValue=Rt={}));var Ht;(function(y){function E(w,b,m,D){return{insertText:w,filterText:b,range:m,command:D}}y.create=E})(Ht||(e.InlineCompletionItem=Ht={}));var Fr;(function(y){function E(w){return{items:w}}y.create=E})(Fr||(e.InlineCompletionList=Fr={}));var qu;(function(y){y.Invoked=0,y.Automatic=1})(qu||(e.InlineCompletionTriggerKind=qu={}));var DS;(function(y){function E(w,b){return{range:w,text:b}}y.create=E})(DS||(e.SelectedCompletionInfo=DS={}));var AS;(function(y){function E(w,b){return{triggerKind:w,selectedCompletionInfo:b}}y.create=E})(AS||(e.InlineCompletionContext=AS={}));var IS;(function(y){function E(w){var b=w;return A.objectLiteral(b)&&n.is(b.uri)&&A.string(b.name)}y.is=E})(IS||(e.WorkspaceFolder=IS={})),e.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var
|
|
35
|
-
`,D==="\r"&&m+1<
|
|
36
|
-
`&&m++}b&&k.length>0&&w.push(k.length),this._lineOffsets=w}return this._lineOffsets},g.prototype.positionAt=function(w){w=Math.max(Math.min(w,this._content.length),0);var k=this.getLineOffsets(),b=0,m=k.length;if(m===0)return o.create(0,w);for(;b<m;){var D=Math.floor((b+m)/2);k[D]>w?m=D:b=D+1}var L=b-1;return o.create(L,w-k[L])},g.prototype.offsetAt=function(w){var k=this.getLineOffsets();if(w.line>=k.length)return this._content.length;if(w.line<0)return 0;var b=k[w.line],m=w.line+1<k.length?k[w.line+1]:this._content.length;return Math.max(Math.min(b+w.character,m),b)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var w=Object.prototype.toString;function k(ke){return typeof ke<"u"}g.defined=k;function b(ke){return typeof ke>"u"}g.undefined=b;function m(ke){return ke===!0||ke===!1}g.boolean=m;function D(ke){return w.call(ke)==="[object String]"}g.string=D;function L(ke){return w.call(ke)==="[object Number]"}g.number=L;function ge(ke,Po,zu){return w.call(ke)==="[object Number]"&&Po<=ke&&ke<=zu}g.numberRange=ge;function Et(ke){return w.call(ke)==="[object Number]"&&-2147483648<=ke&&ke<=2147483647}g.integer=Et;function at(ke){return w.call(ke)==="[object Number]"&&0<=ke&&ke<=2147483647}g.uinteger=at;function Nn(ke){return w.call(ke)==="[object Function]"}g.func=Nn;function Pn(ke){return ke!==null&&typeof ke=="object"}g.objectLiteral=Pn;function yi(ke,Po){return Array.isArray(ke)&&ke.every(Po)}g.typedArray=yi})(A||(A={}))})});var bt=P(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.ProtocolNotificationType=wr.ProtocolNotificationType0=wr.ProtocolRequestType=wr.ProtocolRequestType0=wr.RegistrationType=wr.MessageDirection=void 0;var Oo=Fs(),PN;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(PN||(wr.MessageDirection=PN={}));var Xg=class{constructor(e){this.method=e}};wr.RegistrationType=Xg;var Jg=class extends Oo.RequestType0{constructor(e){super(e)}};wr.ProtocolRequestType0=Jg;var Qg=class extends Oo.RequestType{constructor(e){super(e,Oo.ParameterStructures.byName)}};wr.ProtocolRequestType=Qg;var Zg=class extends Oo.NotificationType0{constructor(e){super(e)}};wr.ProtocolNotificationType0=Zg;var ey=class extends Oo.NotificationType{constructor(e){super(e,Oo.ParameterStructures.byName)}};wr.ProtocolNotificationType=ey});var gd=P(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.objectLiteral=Mt.typedArray=Mt.stringArray=Mt.array=Mt.func=Mt.error=Mt.number=Mt.string=Mt.boolean=void 0;function hF(t){return t===!0||t===!1}Mt.boolean=hF;function RN(t){return typeof t=="string"||t instanceof String}Mt.string=RN;function mF(t){return typeof t=="number"||t instanceof Number}Mt.number=mF;function gF(t){return t instanceof Error}Mt.error=gF;function yF(t){return typeof t=="function"}Mt.func=yF;function EN(t){return Array.isArray(t)}Mt.array=EN;function vF(t){return EN(t)&&t.every(e=>RN(e))}Mt.stringArray=vF;function TF(t,e){return Array.isArray(t)&&t.every(e)}Mt.typedArray=TF;function bF(t){return t!==null&&typeof t=="object"}Mt.objectLiteral=bF});var CN=P(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.ImplementationRequest=void 0;var wN=bt(),kN;(function(t){t.method="textDocument/implementation",t.messageDirection=wN.MessageDirection.clientToServer,t.type=new wN.ProtocolRequestType(t.method)})(kN||(yd.ImplementationRequest=kN={}))});var IN=P(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.TypeDefinitionRequest=void 0;var DN=bt(),AN;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=DN.MessageDirection.clientToServer,t.type=new DN.ProtocolRequestType(t.method)})(AN||(vd.TypeDefinitionRequest=AN={}))});var MN=P(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.DidChangeWorkspaceFoldersNotification=xo.WorkspaceFoldersRequest=void 0;var Td=bt(),ON;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Td.MessageDirection.serverToClient,t.type=new Td.ProtocolRequestType0(t.method)})(ON||(xo.WorkspaceFoldersRequest=ON={}));var xN;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Td.MessageDirection.clientToServer,t.type=new Td.ProtocolNotificationType(t.method)})(xN||(xo.DidChangeWorkspaceFoldersNotification=xN={}))});var $N=P(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.ConfigurationRequest=void 0;var qN=bt(),LN;(function(t){t.method="workspace/configuration",t.messageDirection=qN.MessageDirection.serverToClient,t.type=new qN.ProtocolRequestType(t.method)})(LN||(bd.ConfigurationRequest=LN={}))});var jN=P(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.ColorPresentationRequest=Mo.DocumentColorRequest=void 0;var _d=bt(),BN;(function(t){t.method="textDocument/documentColor",t.messageDirection=_d.MessageDirection.clientToServer,t.type=new _d.ProtocolRequestType(t.method)})(BN||(Mo.DocumentColorRequest=BN={}));var FN;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=_d.MessageDirection.clientToServer,t.type=new _d.ProtocolRequestType(t.method)})(FN||(Mo.ColorPresentationRequest=FN={}))});var VN=P(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.FoldingRangeRefreshRequest=qo.FoldingRangeRequest=void 0;var Sd=bt(),UN;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Sd.MessageDirection.clientToServer,t.type=new Sd.ProtocolRequestType(t.method)})(UN||(qo.FoldingRangeRequest=UN={}));var HN;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Sd.MessageDirection.serverToClient,t.type=new Sd.ProtocolRequestType0(t.method)})(HN||(qo.FoldingRangeRefreshRequest=HN={}))});var GN=P(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.DeclarationRequest=void 0;var zN=bt(),WN;(function(t){t.method="textDocument/declaration",t.messageDirection=zN.MessageDirection.clientToServer,t.type=new zN.ProtocolRequestType(t.method)})(WN||(Nd.DeclarationRequest=WN={}))});var XN=P(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.SelectionRangeRequest=void 0;var YN=bt(),KN;(function(t){t.method="textDocument/selectionRange",t.messageDirection=YN.MessageDirection.clientToServer,t.type=new YN.ProtocolRequestType(t.method)})(KN||(Pd.SelectionRangeRequest=KN={}))});var eP=P(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.WorkDoneProgressCancelNotification=Vi.WorkDoneProgressCreateRequest=Vi.WorkDoneProgress=void 0;var _F=Fs(),Rd=bt(),JN;(function(t){t.type=new _F.ProgressType;function e(r){return r===t.type}t.is=e})(JN||(Vi.WorkDoneProgress=JN={}));var QN;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Rd.MessageDirection.serverToClient,t.type=new Rd.ProtocolRequestType(t.method)})(QN||(Vi.WorkDoneProgressCreateRequest=QN={}));var ZN;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Rd.MessageDirection.clientToServer,t.type=new Rd.ProtocolNotificationType(t.method)})(ZN||(Vi.WorkDoneProgressCancelNotification=ZN={}))});var iP=P(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.CallHierarchyOutgoingCallsRequest=zi.CallHierarchyIncomingCallsRequest=zi.CallHierarchyPrepareRequest=void 0;var Lo=bt(),tP;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(tP||(zi.CallHierarchyPrepareRequest=tP={}));var rP;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(rP||(zi.CallHierarchyIncomingCallsRequest=rP={}));var nP;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Lo.MessageDirection.clientToServer,t.type=new Lo.ProtocolRequestType(t.method)})(nP||(zi.CallHierarchyOutgoingCallsRequest=nP={}))});var uP=P(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.SemanticTokensRefreshRequest=kr.SemanticTokensRangeRequest=kr.SemanticTokensDeltaRequest=kr.SemanticTokensRequest=kr.SemanticTokensRegistrationType=kr.TokenFormat=void 0;var Ti=bt(),sP;(function(t){t.Relative="relative"})(sP||(kr.TokenFormat=sP={}));var hc;(function(t){t.method="textDocument/semanticTokens",t.type=new Ti.RegistrationType(t.method)})(hc||(kr.SemanticTokensRegistrationType=hc={}));var oP;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Ti.MessageDirection.clientToServer,t.type=new Ti.ProtocolRequestType(t.method),t.registrationMethod=hc.method})(oP||(kr.SemanticTokensRequest=oP={}));var aP;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Ti.MessageDirection.clientToServer,t.type=new Ti.ProtocolRequestType(t.method),t.registrationMethod=hc.method})(aP||(kr.SemanticTokensDeltaRequest=aP={}));var cP;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Ti.MessageDirection.clientToServer,t.type=new Ti.ProtocolRequestType(t.method),t.registrationMethod=hc.method})(cP||(kr.SemanticTokensRangeRequest=cP={}));var lP;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Ti.MessageDirection.serverToClient,t.type=new Ti.ProtocolRequestType0(t.method)})(lP||(kr.SemanticTokensRefreshRequest=lP={}))});var pP=P(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.ShowDocumentRequest=void 0;var dP=bt(),fP;(function(t){t.method="window/showDocument",t.messageDirection=dP.MessageDirection.serverToClient,t.type=new dP.ProtocolRequestType(t.method)})(fP||(Ed.ShowDocumentRequest=fP={}))});var gP=P(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.LinkedEditingRangeRequest=void 0;var hP=bt(),mP;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=hP.MessageDirection.clientToServer,t.type=new hP.ProtocolRequestType(t.method)})(mP||(wd.LinkedEditingRangeRequest=mP={}))});var PP=P(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.WillDeleteFilesRequest=lr.DidDeleteFilesNotification=lr.DidRenameFilesNotification=lr.WillRenameFilesRequest=lr.DidCreateFilesNotification=lr.WillCreateFilesRequest=lr.FileOperationPatternKind=void 0;var Jr=bt(),yP;(function(t){t.file="file",t.folder="folder"})(yP||(lr.FileOperationPatternKind=yP={}));var vP;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(vP||(lr.WillCreateFilesRequest=vP={}));var TP;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(TP||(lr.DidCreateFilesNotification=TP={}));var bP;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(bP||(lr.WillRenameFilesRequest=bP={}));var _P;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(_P||(lr.DidRenameFilesNotification=_P={}));var SP;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolNotificationType(t.method)})(SP||(lr.DidDeleteFilesNotification=SP={}));var NP;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Jr.MessageDirection.clientToServer,t.type=new Jr.ProtocolRequestType(t.method)})(NP||(lr.WillDeleteFilesRequest=NP={}))});var CP=P(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.MonikerRequest=Wi.MonikerKind=Wi.UniquenessLevel=void 0;var RP=bt(),EP;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(EP||(Wi.UniquenessLevel=EP={}));var wP;(function(t){t.$import="import",t.$export="export",t.local="local"})(wP||(Wi.MonikerKind=wP={}));var kP;(function(t){t.method="textDocument/moniker",t.messageDirection=RP.MessageDirection.clientToServer,t.type=new RP.ProtocolRequestType(t.method)})(kP||(Wi.MonikerRequest=kP={}))});var OP=P(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.TypeHierarchySubtypesRequest=Gi.TypeHierarchySupertypesRequest=Gi.TypeHierarchyPrepareRequest=void 0;var $o=bt(),DP;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=$o.MessageDirection.clientToServer,t.type=new $o.ProtocolRequestType(t.method)})(DP||(Gi.TypeHierarchyPrepareRequest=DP={}));var AP;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=$o.MessageDirection.clientToServer,t.type=new $o.ProtocolRequestType(t.method)})(AP||(Gi.TypeHierarchySupertypesRequest=AP={}));var IP;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=$o.MessageDirection.clientToServer,t.type=new $o.ProtocolRequestType(t.method)})(IP||(Gi.TypeHierarchySubtypesRequest=IP={}))});var qP=P(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.InlineValueRefreshRequest=Bo.InlineValueRequest=void 0;var kd=bt(),xP;(function(t){t.method="textDocument/inlineValue",t.messageDirection=kd.MessageDirection.clientToServer,t.type=new kd.ProtocolRequestType(t.method)})(xP||(Bo.InlineValueRequest=xP={}));var MP;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=kd.MessageDirection.serverToClient,t.type=new kd.ProtocolRequestType0(t.method)})(MP||(Bo.InlineValueRefreshRequest=MP={}))});var FP=P(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.InlayHintRefreshRequest=Yi.InlayHintResolveRequest=Yi.InlayHintRequest=void 0;var Fo=bt(),LP;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Fo.MessageDirection.clientToServer,t.type=new Fo.ProtocolRequestType(t.method)})(LP||(Yi.InlayHintRequest=LP={}));var $P;(function(t){t.method="inlayHint/resolve",t.messageDirection=Fo.MessageDirection.clientToServer,t.type=new Fo.ProtocolRequestType(t.method)})($P||(Yi.InlayHintResolveRequest=$P={}));var BP;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Fo.MessageDirection.serverToClient,t.type=new Fo.ProtocolRequestType0(t.method)})(BP||(Yi.InlayHintRefreshRequest=BP={}))});var GP=P(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DiagnosticRefreshRequest=Qr.WorkspaceDiagnosticRequest=Qr.DocumentDiagnosticRequest=Qr.DocumentDiagnosticReportKind=Qr.DiagnosticServerCancellationData=void 0;var WP=Fs(),SF=gd(),jo=bt(),jP;(function(t){function e(r){let n=r;return n&&SF.boolean(n.retriggerRequest)}t.is=e})(jP||(Qr.DiagnosticServerCancellationData=jP={}));var UP;(function(t){t.Full="full",t.Unchanged="unchanged"})(UP||(Qr.DocumentDiagnosticReportKind=UP={}));var HP;(function(t){t.method="textDocument/diagnostic",t.messageDirection=jo.MessageDirection.clientToServer,t.type=new jo.ProtocolRequestType(t.method),t.partialResult=new WP.ProgressType})(HP||(Qr.DocumentDiagnosticRequest=HP={}));var VP;(function(t){t.method="workspace/diagnostic",t.messageDirection=jo.MessageDirection.clientToServer,t.type=new jo.ProtocolRequestType(t.method),t.partialResult=new WP.ProgressType})(VP||(Qr.WorkspaceDiagnosticRequest=VP={}));var zP;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=jo.MessageDirection.serverToClient,t.type=new jo.ProtocolRequestType0(t.method)})(zP||(Qr.DiagnosticRefreshRequest=zP={}))});var eR=P(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.DidCloseNotebookDocumentNotification=wt.DidSaveNotebookDocumentNotification=wt.DidChangeNotebookDocumentNotification=wt.NotebookCellArrayChange=wt.DidOpenNotebookDocumentNotification=wt.NotebookDocumentSyncRegistrationType=wt.NotebookDocument=wt.NotebookCell=wt.ExecutionSummary=wt.NotebookCellKind=void 0;var mc=md(),En=gd(),Wn=bt(),ty;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(ty||(wt.NotebookCellKind=ty={}));var ry;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return En.objectLiteral(s)&&mc.uinteger.is(s.executionOrder)&&(s.success===void 0||En.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(ry||(wt.ExecutionSummary=ry={}));var Cd;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function r(s){let o=s;return En.objectLiteral(o)&&ty.is(o.kind)&&mc.DocumentUri.is(o.document)&&(o.metadata===void 0||En.objectLiteral(o.metadata))}t.is=r;function n(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)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!ry.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(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(!i(s[l],o[l]))return!1}if(En.objectLiteral(s)&&En.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!i(s[f],o[f]))return!1}}return!0}})(Cd||(wt.NotebookCell=Cd={}));var YP;(function(t){function e(n,i,s,o){return{uri:n,notebookType:i,version:s,cells:o}}t.create=e;function r(n){let i=n;return En.objectLiteral(i)&&En.string(i.uri)&&mc.integer.is(i.version)&&En.typedArray(i.cells,Cd.is)}t.is=r})(YP||(wt.NotebookDocument=YP={}));var Uo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.RegistrationType(t.method)})(Uo||(wt.NotebookDocumentSyncRegistrationType=Uo={}));var KP;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=Uo.method})(KP||(wt.DidOpenNotebookDocumentNotification=KP={}));var XP;(function(t){function e(n){let i=n;return En.objectLiteral(i)&&mc.uinteger.is(i.start)&&mc.uinteger.is(i.deleteCount)&&(i.cells===void 0||En.typedArray(i.cells,Cd.is))}t.is=e;function r(n,i,s){let o={start:n,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=r})(XP||(wt.NotebookCellArrayChange=XP={}));var JP;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=Uo.method})(JP||(wt.DidChangeNotebookDocumentNotification=JP={}));var QP;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=Uo.method})(QP||(wt.DidSaveNotebookDocumentNotification=QP={}));var ZP;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method),t.registrationMethod=Uo.method})(ZP||(wt.DidCloseNotebookDocumentNotification=ZP={}))});var nR=P(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.InlineCompletionRequest=void 0;var tR=bt(),rR;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=tR.MessageDirection.clientToServer,t.type=new tR.ProtocolRequestType(t.method)})(rR||(Dd.InlineCompletionRequest=rR={}))});var gE=P(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.WorkspaceSymbolRequest=N.CodeActionResolveRequest=N.CodeActionRequest=N.DocumentSymbolRequest=N.DocumentHighlightRequest=N.ReferencesRequest=N.DefinitionRequest=N.SignatureHelpRequest=N.SignatureHelpTriggerKind=N.HoverRequest=N.CompletionResolveRequest=N.CompletionRequest=N.CompletionTriggerKind=N.PublishDiagnosticsNotification=N.WatchKind=N.RelativePattern=N.FileChangeType=N.DidChangeWatchedFilesNotification=N.WillSaveTextDocumentWaitUntilRequest=N.WillSaveTextDocumentNotification=N.TextDocumentSaveReason=N.DidSaveTextDocumentNotification=N.DidCloseTextDocumentNotification=N.DidChangeTextDocumentNotification=N.TextDocumentContentChangeEvent=N.DidOpenTextDocumentNotification=N.TextDocumentSyncKind=N.TelemetryEventNotification=N.LogMessageNotification=N.ShowMessageRequest=N.ShowMessageNotification=N.MessageType=N.DidChangeConfigurationNotification=N.ExitNotification=N.ShutdownRequest=N.InitializedNotification=N.InitializeErrorCodes=N.InitializeRequest=N.WorkDoneProgressOptions=N.TextDocumentRegistrationOptions=N.StaticRegistrationOptions=N.PositionEncodingKind=N.FailureHandlingKind=N.ResourceOperationKind=N.UnregistrationRequest=N.RegistrationRequest=N.DocumentSelector=N.NotebookCellTextDocumentFilter=N.NotebookDocumentFilter=N.TextDocumentFilter=void 0;N.MonikerRequest=N.MonikerKind=N.UniquenessLevel=N.WillDeleteFilesRequest=N.DidDeleteFilesNotification=N.WillRenameFilesRequest=N.DidRenameFilesNotification=N.WillCreateFilesRequest=N.DidCreateFilesNotification=N.FileOperationPatternKind=N.LinkedEditingRangeRequest=N.ShowDocumentRequest=N.SemanticTokensRegistrationType=N.SemanticTokensRefreshRequest=N.SemanticTokensRangeRequest=N.SemanticTokensDeltaRequest=N.SemanticTokensRequest=N.TokenFormat=N.CallHierarchyPrepareRequest=N.CallHierarchyOutgoingCallsRequest=N.CallHierarchyIncomingCallsRequest=N.WorkDoneProgressCancelNotification=N.WorkDoneProgressCreateRequest=N.WorkDoneProgress=N.SelectionRangeRequest=N.DeclarationRequest=N.FoldingRangeRefreshRequest=N.FoldingRangeRequest=N.ColorPresentationRequest=N.DocumentColorRequest=N.ConfigurationRequest=N.DidChangeWorkspaceFoldersNotification=N.WorkspaceFoldersRequest=N.TypeDefinitionRequest=N.ImplementationRequest=N.ApplyWorkspaceEditRequest=N.ExecuteCommandRequest=N.PrepareRenameRequest=N.RenameRequest=N.PrepareSupportDefaultBehavior=N.DocumentOnTypeFormattingRequest=N.DocumentRangesFormattingRequest=N.DocumentRangeFormattingRequest=N.DocumentFormattingRequest=N.DocumentLinkResolveRequest=N.DocumentLinkRequest=N.CodeLensRefreshRequest=N.CodeLensResolveRequest=N.CodeLensRequest=N.WorkspaceSymbolResolveRequest=void 0;N.InlineCompletionRequest=N.DidCloseNotebookDocumentNotification=N.DidSaveNotebookDocumentNotification=N.DidChangeNotebookDocumentNotification=N.NotebookCellArrayChange=N.DidOpenNotebookDocumentNotification=N.NotebookDocumentSyncRegistrationType=N.NotebookDocument=N.NotebookCell=N.ExecutionSummary=N.NotebookCellKind=N.DiagnosticRefreshRequest=N.WorkspaceDiagnosticRequest=N.DocumentDiagnosticRequest=N.DocumentDiagnosticReportKind=N.DiagnosticServerCancellationData=N.InlayHintRefreshRequest=N.InlayHintResolveRequest=N.InlayHintRequest=N.InlineValueRefreshRequest=N.InlineValueRequest=N.TypeHierarchySupertypesRequest=N.TypeHierarchySubtypesRequest=N.TypeHierarchyPrepareRequest=void 0;var z=bt(),iR=md(),Wt=gd(),NF=CN();Object.defineProperty(N,"ImplementationRequest",{enumerable:!0,get:function(){return NF.ImplementationRequest}});var PF=IN();Object.defineProperty(N,"TypeDefinitionRequest",{enumerable:!0,get:function(){return PF.TypeDefinitionRequest}});var fE=MN();Object.defineProperty(N,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return fE.WorkspaceFoldersRequest}});Object.defineProperty(N,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return fE.DidChangeWorkspaceFoldersNotification}});var RF=$N();Object.defineProperty(N,"ConfigurationRequest",{enumerable:!0,get:function(){return RF.ConfigurationRequest}});var pE=jN();Object.defineProperty(N,"DocumentColorRequest",{enumerable:!0,get:function(){return pE.DocumentColorRequest}});Object.defineProperty(N,"ColorPresentationRequest",{enumerable:!0,get:function(){return pE.ColorPresentationRequest}});var hE=VN();Object.defineProperty(N,"FoldingRangeRequest",{enumerable:!0,get:function(){return hE.FoldingRangeRequest}});Object.defineProperty(N,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return hE.FoldingRangeRefreshRequest}});var EF=GN();Object.defineProperty(N,"DeclarationRequest",{enumerable:!0,get:function(){return EF.DeclarationRequest}});var wF=XN();Object.defineProperty(N,"SelectionRangeRequest",{enumerable:!0,get:function(){return wF.SelectionRangeRequest}});var ay=eP();Object.defineProperty(N,"WorkDoneProgress",{enumerable:!0,get:function(){return ay.WorkDoneProgress}});Object.defineProperty(N,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ay.WorkDoneProgressCreateRequest}});Object.defineProperty(N,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ay.WorkDoneProgressCancelNotification}});var cy=iP();Object.defineProperty(N,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return cy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(N,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return cy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(N,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return cy.CallHierarchyPrepareRequest}});var Ho=uP();Object.defineProperty(N,"TokenFormat",{enumerable:!0,get:function(){return Ho.TokenFormat}});Object.defineProperty(N,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ho.SemanticTokensRequest}});Object.defineProperty(N,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ho.SemanticTokensDeltaRequest}});Object.defineProperty(N,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ho.SemanticTokensRangeRequest}});Object.defineProperty(N,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ho.SemanticTokensRefreshRequest}});Object.defineProperty(N,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ho.SemanticTokensRegistrationType}});var kF=pP();Object.defineProperty(N,"ShowDocumentRequest",{enumerable:!0,get:function(){return kF.ShowDocumentRequest}});var CF=gP();Object.defineProperty(N,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return CF.LinkedEditingRangeRequest}});var js=PP();Object.defineProperty(N,"FileOperationPatternKind",{enumerable:!0,get:function(){return js.FileOperationPatternKind}});Object.defineProperty(N,"DidCreateFilesNotification",{enumerable:!0,get:function(){return js.DidCreateFilesNotification}});Object.defineProperty(N,"WillCreateFilesRequest",{enumerable:!0,get:function(){return js.WillCreateFilesRequest}});Object.defineProperty(N,"DidRenameFilesNotification",{enumerable:!0,get:function(){return js.DidRenameFilesNotification}});Object.defineProperty(N,"WillRenameFilesRequest",{enumerable:!0,get:function(){return js.WillRenameFilesRequest}});Object.defineProperty(N,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return js.DidDeleteFilesNotification}});Object.defineProperty(N,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return js.WillDeleteFilesRequest}});var ly=CP();Object.defineProperty(N,"UniquenessLevel",{enumerable:!0,get:function(){return ly.UniquenessLevel}});Object.defineProperty(N,"MonikerKind",{enumerable:!0,get:function(){return ly.MonikerKind}});Object.defineProperty(N,"MonikerRequest",{enumerable:!0,get:function(){return ly.MonikerRequest}});var uy=OP();Object.defineProperty(N,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return uy.TypeHierarchyPrepareRequest}});Object.defineProperty(N,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return uy.TypeHierarchySubtypesRequest}});Object.defineProperty(N,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return uy.TypeHierarchySupertypesRequest}});var mE=qP();Object.defineProperty(N,"InlineValueRequest",{enumerable:!0,get:function(){return mE.InlineValueRequest}});Object.defineProperty(N,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return mE.InlineValueRefreshRequest}});var dy=FP();Object.defineProperty(N,"InlayHintRequest",{enumerable:!0,get:function(){return dy.InlayHintRequest}});Object.defineProperty(N,"InlayHintResolveRequest",{enumerable:!0,get:function(){return dy.InlayHintResolveRequest}});Object.defineProperty(N,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return dy.InlayHintRefreshRequest}});var gc=GP();Object.defineProperty(N,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return gc.DiagnosticServerCancellationData}});Object.defineProperty(N,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return gc.DocumentDiagnosticReportKind}});Object.defineProperty(N,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return gc.DocumentDiagnosticRequest}});Object.defineProperty(N,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return gc.WorkspaceDiagnosticRequest}});Object.defineProperty(N,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return gc.DiagnosticRefreshRequest}});var Gn=eR();Object.defineProperty(N,"NotebookCellKind",{enumerable:!0,get:function(){return Gn.NotebookCellKind}});Object.defineProperty(N,"ExecutionSummary",{enumerable:!0,get:function(){return Gn.ExecutionSummary}});Object.defineProperty(N,"NotebookCell",{enumerable:!0,get:function(){return Gn.NotebookCell}});Object.defineProperty(N,"NotebookDocument",{enumerable:!0,get:function(){return Gn.NotebookDocument}});Object.defineProperty(N,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Gn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(N,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidOpenNotebookDocumentNotification}});Object.defineProperty(N,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Gn.NotebookCellArrayChange}});Object.defineProperty(N,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidChangeNotebookDocumentNotification}});Object.defineProperty(N,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidSaveNotebookDocumentNotification}});Object.defineProperty(N,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Gn.DidCloseNotebookDocumentNotification}});var DF=nR();Object.defineProperty(N,"InlineCompletionRequest",{enumerable:!0,get:function(){return DF.InlineCompletionRequest}});var ny;(function(t){function e(r){let n=r;return Wt.string(n)||Wt.string(n.language)||Wt.string(n.scheme)||Wt.string(n.pattern)}t.is=e})(ny||(N.TextDocumentFilter=ny={}));var iy;(function(t){function e(r){let n=r;return Wt.objectLiteral(n)&&(Wt.string(n.notebookType)||Wt.string(n.scheme)||Wt.string(n.pattern))}t.is=e})(iy||(N.NotebookDocumentFilter=iy={}));var sy;(function(t){function e(r){let n=r;return Wt.objectLiteral(n)&&(Wt.string(n.notebook)||iy.is(n.notebook))&&(n.language===void 0||Wt.string(n.language))}t.is=e})(sy||(N.NotebookCellTextDocumentFilter=sy={}));var oy;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Wt.string(n)&&!ny.is(n)&&!sy.is(n))return!1;return!0}t.is=e})(oy||(N.DocumentSelector=oy={}));var sR;(function(t){t.method="client/registerCapability",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(sR||(N.RegistrationRequest=sR={}));var oR;(function(t){t.method="client/unregisterCapability",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(oR||(N.UnregistrationRequest=oR={}));var aR;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(aR||(N.ResourceOperationKind=aR={}));var cR;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(cR||(N.FailureHandlingKind=cR={}));var lR;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(lR||(N.PositionEncodingKind=lR={}));var uR;(function(t){function e(r){let n=r;return n&&Wt.string(n.id)&&n.id.length>0}t.hasId=e})(uR||(N.StaticRegistrationOptions=uR={}));var dR;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||oy.is(n.documentSelector))}t.is=e})(dR||(N.TextDocumentRegistrationOptions=dR={}));var fR;(function(t){function e(n){let i=n;return Wt.objectLiteral(i)&&(i.workDoneProgress===void 0||Wt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Wt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(fR||(N.WorkDoneProgressOptions=fR={}));var pR;(function(t){t.method="initialize",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(pR||(N.InitializeRequest=pR={}));var hR;(function(t){t.unknownProtocolVersion=1})(hR||(N.InitializeErrorCodes=hR={}));var mR;(function(t){t.method="initialized",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(mR||(N.InitializedNotification=mR={}));var gR;(function(t){t.method="shutdown",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType0(t.method)})(gR||(N.ShutdownRequest=gR={}));var yR;(function(t){t.method="exit",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType0(t.method)})(yR||(N.ExitNotification=yR={}));var vR;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(vR||(N.DidChangeConfigurationNotification=vR={}));var TR;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(TR||(N.MessageType=TR={}));var bR;(function(t){t.method="window/showMessage",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(bR||(N.ShowMessageNotification=bR={}));var _R;(function(t){t.method="window/showMessageRequest",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType(t.method)})(_R||(N.ShowMessageRequest=_R={}));var SR;(function(t){t.method="window/logMessage",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(SR||(N.LogMessageNotification=SR={}));var NR;(function(t){t.method="telemetry/event",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(NR||(N.TelemetryEventNotification=NR={}));var PR;(function(t){t.None=0,t.Full=1,t.Incremental=2})(PR||(N.TextDocumentSyncKind=PR={}));var RR;(function(t){t.method="textDocument/didOpen",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(RR||(N.DidOpenTextDocumentNotification=RR={}));var ER;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(ER||(N.TextDocumentContentChangeEvent=ER={}));var wR;(function(t){t.method="textDocument/didChange",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(wR||(N.DidChangeTextDocumentNotification=wR={}));var kR;(function(t){t.method="textDocument/didClose",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(kR||(N.DidCloseTextDocumentNotification=kR={}));var CR;(function(t){t.method="textDocument/didSave",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(CR||(N.DidSaveTextDocumentNotification=CR={}));var DR;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(DR||(N.TextDocumentSaveReason=DR={}));var AR;(function(t){t.method="textDocument/willSave",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(AR||(N.WillSaveTextDocumentNotification=AR={}));var IR;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(IR||(N.WillSaveTextDocumentWaitUntilRequest=IR={}));var OR;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolNotificationType(t.method)})(OR||(N.DidChangeWatchedFilesNotification=OR={}));var xR;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(xR||(N.FileChangeType=xR={}));var MR;(function(t){function e(r){let n=r;return Wt.objectLiteral(n)&&(iR.URI.is(n.baseUri)||iR.WorkspaceFolder.is(n.baseUri))&&Wt.string(n.pattern)}t.is=e})(MR||(N.RelativePattern=MR={}));var qR;(function(t){t.Create=1,t.Change=2,t.Delete=4})(qR||(N.WatchKind=qR={}));var LR;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolNotificationType(t.method)})(LR||(N.PublishDiagnosticsNotification=LR={}));var $R;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})($R||(N.CompletionTriggerKind=$R={}));var BR;(function(t){t.method="textDocument/completion",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(BR||(N.CompletionRequest=BR={}));var FR;(function(t){t.method="completionItem/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(FR||(N.CompletionResolveRequest=FR={}));var jR;(function(t){t.method="textDocument/hover",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(jR||(N.HoverRequest=jR={}));var UR;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(UR||(N.SignatureHelpTriggerKind=UR={}));var HR;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(HR||(N.SignatureHelpRequest=HR={}));var VR;(function(t){t.method="textDocument/definition",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(VR||(N.DefinitionRequest=VR={}));var zR;(function(t){t.method="textDocument/references",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(zR||(N.ReferencesRequest=zR={}));var WR;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(WR||(N.DocumentHighlightRequest=WR={}));var GR;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(GR||(N.DocumentSymbolRequest=GR={}));var YR;(function(t){t.method="textDocument/codeAction",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(YR||(N.CodeActionRequest=YR={}));var KR;(function(t){t.method="codeAction/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(KR||(N.CodeActionResolveRequest=KR={}));var XR;(function(t){t.method="workspace/symbol",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(XR||(N.WorkspaceSymbolRequest=XR={}));var JR;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(JR||(N.WorkspaceSymbolResolveRequest=JR={}));var QR;(function(t){t.method="textDocument/codeLens",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(QR||(N.CodeLensRequest=QR={}));var ZR;(function(t){t.method="codeLens/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(ZR||(N.CodeLensResolveRequest=ZR={}));var eE;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType0(t.method)})(eE||(N.CodeLensRefreshRequest=eE={}));var tE;(function(t){t.method="textDocument/documentLink",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(tE||(N.DocumentLinkRequest=tE={}));var rE;(function(t){t.method="documentLink/resolve",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(rE||(N.DocumentLinkResolveRequest=rE={}));var nE;(function(t){t.method="textDocument/formatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(nE||(N.DocumentFormattingRequest=nE={}));var iE;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(iE||(N.DocumentRangeFormattingRequest=iE={}));var sE;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(sE||(N.DocumentRangesFormattingRequest=sE={}));var oE;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(oE||(N.DocumentOnTypeFormattingRequest=oE={}));var aE;(function(t){t.Identifier=1})(aE||(N.PrepareSupportDefaultBehavior=aE={}));var cE;(function(t){t.method="textDocument/rename",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(cE||(N.RenameRequest=cE={}));var lE;(function(t){t.method="textDocument/prepareRename",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(lE||(N.PrepareRenameRequest=lE={}));var uE;(function(t){t.method="workspace/executeCommand",t.messageDirection=z.MessageDirection.clientToServer,t.type=new z.ProtocolRequestType(t.method)})(uE||(N.ExecuteCommandRequest=uE={}));var dE;(function(t){t.method="workspace/applyEdit",t.messageDirection=z.MessageDirection.serverToClient,t.type=new z.ProtocolRequestType("workspace/applyEdit")})(dE||(N.ApplyWorkspaceEditRequest=dE={}))});var vE=P(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.createProtocolConnection=void 0;var yE=Fs();function AF(t,e,r,n){return yE.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,yE.createMessageConnection)(t,e,r,n)}Ad.createProtocolConnection=AF});var bE=P(Cr=>{"use strict";var IF=Cr&&Cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Id=Cr&&Cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IF(e,t,r)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.LSPErrorCodes=Cr.createProtocolConnection=void 0;Id(Fs(),Cr);Id(md(),Cr);Id(bt(),Cr);Id(gE(),Cr);var OF=vE();Object.defineProperty(Cr,"createProtocolConnection",{enumerable:!0,get:function(){return OF.createProtocolConnection}});var TE;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(TE||(Cr.LSPErrorCodes=TE={}))});var kt=P(Yn=>{"use strict";var xF=Yn&&Yn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_E=Yn&&Yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xF(e,t,r)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createProtocolConnection=void 0;var MF=Kg();_E(Kg(),Yn);_E(bE(),Yn);function qF(t,e,r,n){return(0,MF.createMessageConnection)(t,e,r,n)}Yn.createProtocolConnection=qF});var fy=P(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.generateUuid=Zr.parse=Zr.isUUID=Zr.v4=Zr.empty=void 0;var yc=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},vc=class t extends yc{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};vc._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];vc._timeHighBits=["8","9","a","b"];Zr.empty=new yc("00000000-0000-0000-0000-000000000000");function SE(){return new vc}Zr.v4=SE;var LF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function NE(t){return LF.test(t)}Zr.isUUID=NE;function $F(t){if(!NE(t))throw new Error("invalid uuid");return new yc(t)}Zr.parse=$F;function BF(){return SE().asHex()}Zr.generateUuid=BF});var PE=P(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.attachPartialResult=Xi.ProgressFeature=Xi.attachWorkDone=void 0;var Ki=kt(),FF=fy(),Us=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ki.WorkDoneProgress.type,this._token,{kind:"end"})}};Us.Instances=new Map;var Od=class extends Us{constructor(e,r){super(e,r),this._source=new Ki.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Tc=class{constructor(){}begin(){}report(){}done(){}},xd=class extends Tc{constructor(){super(),this._source=new Ki.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function jF(t,e){if(e===void 0||e.workDoneToken===void 0)return new Tc;let r=e.workDoneToken;return delete e.workDoneToken,new Us(t,r)}Xi.attachWorkDone=jF;var UF=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ki.WorkDoneProgressCancelNotification.type,r=>{let n=Us.Instances.get(r.token);(n instanceof Od||n instanceof xd)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Tc:new Us(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,FF.generateUuid)();return this.connection.sendRequest(Ki.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Od(this.connection,e))}else return Promise.resolve(new xd)}};Xi.ProgressFeature=UF;var py;(function(t){t.type=new Ki.ProgressType})(py||(py={}));var hy=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(py.type,this._token,e)}};function HF(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new hy(t,r)}Xi.attachPartialResult=HF});var RE=P(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ConfigurationFeature=void 0;var VF=kt(),zF=Wu(),WF=t=>class extends t{getConfiguration(e){return e?zF.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(VF.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Md.ConfigurationFeature=WF});var EE=P(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.WorkspaceFoldersFeature=void 0;var qd=kt(),GF=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new qd.Emitter,this.connection.onNotification(qd.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(qd.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(qd.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ld.WorkspaceFoldersFeature=GF});var wE=P($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.CallHierarchyFeature=void 0;var my=kt(),YF=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(my.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=my.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=my.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};$d.CallHierarchyFeature=YF});var yy=P(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.SemanticTokensBuilder=Ji.SemanticTokensDiff=Ji.SemanticTokensFeature=void 0;var Bd=kt(),KF=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Bd.SemanticTokensRefreshRequest.type),on:e=>{let r=Bd.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Bd.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Bd.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Ji.SemanticTokensFeature=KF;var Fd=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let o=i-n+1,a=this.modifiedSequence.slice(n,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Ji.SemanticTokensDiff=Fd;var gy=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,r,n,i,s){let o=e,a=r;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++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}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 Fd(this._prevData,this._data).computeDiff()}:this.build()}};Ji.SemanticTokensBuilder=gy});var kE=P(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.ShowDocumentFeature=void 0;var XF=kt(),JF=t=>class extends t{showDocument(e){return this.connection.sendRequest(XF.ShowDocumentRequest.type,e)}};jd.ShowDocumentFeature=JF});var CE=P(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.FileOperationsFeature=void 0;var Vo=kt(),QF=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Vo.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Vo.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Vo.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Vo.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Vo.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Vo.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Ud.FileOperationsFeature=QF});var DE=P(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.LinkedEditingRangeFeature=void 0;var ZF=kt(),ej=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(ZF.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Hd.LinkedEditingRangeFeature=ej});var AE=P(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.TypeHierarchyFeature=void 0;var vy=kt(),tj=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(vy.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=vy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=vy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Vd.TypeHierarchyFeature=tj});var OE=P(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.InlineValueFeature=void 0;var IE=kt(),rj=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(IE.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(IE.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};zd.InlineValueFeature=rj});var ME=P(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.FoldingRangeFeature=void 0;var xE=kt(),nj=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(xE.FoldingRangeRefreshRequest.type),on:e=>{let r=xE.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Wd.FoldingRangeFeature=nj});var qE=P(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.InlayHintFeature=void 0;var Ty=kt(),ij=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Ty.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Ty.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(Ty.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Gd.InlayHintFeature=ij});var LE=P(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.DiagnosticFeature=void 0;var bc=kt(),sj=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(bc.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(bc.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(bc.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(bc.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(bc.WorkspaceDiagnosticRequest.partialResult,r)))}}};Yd.DiagnosticFeature=sj});var _y=P(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.TextDocuments=void 0;var Hs=kt(),by=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Hs.Emitter,this._onDidOpen=new Hs.Emitter,this._onDidClose=new Hs.Emitter,this._onDidSave=new Hs.Emitter,this._onWillSave=new Hs.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=Hs.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Hs.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};Kd.TextDocuments=by});var Ny=P(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.NotebookDocuments=zo.NotebookSyncFeature=void 0;var en=kt(),$E=_y(),oj=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(en.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(en.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(en.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(en.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};zo.NotebookSyncFeature=oj;var Xd=class t{onDidOpenTextDocument(e){return this.openHandler=e,en.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,en.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,en.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Xd.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Sy=class{constructor(e){e instanceof $E.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new $E.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new en.Emitter,this._onDidChange=new en.Emitter,this._onDidSave=new en.Emitter,this._onDidClose=new en.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[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 r=new Xd,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let S=c.cells;if(S.structure!==void 0){let _=S.structure.array;if(s.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),S.structure.didOpen!==void 0)for(let T of S.structure.didOpen)r.openTextDocument({textDocument:T}),l.push(T.uri);if(S.structure.didClose)for(let T of S.structure.didClose)r.closeTextDocument({textDocument:T}),u.push(T.uri)}if(S.data!==void 0){let _=new Map(S.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let R=_.get(s.cells[T].document);if(R!==void 0){let C=s.cells.splice(T,1,R);if(d.push({old:C[0],new:R}),_.delete(R.document),_.size===0)break}}}if(S.textContent!==void 0)for(let _ of S.textContent)r.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),f.push(_.document.uri)}this.updateCellMap(s);let p={notebookDocument:s};a&&(p.metadata={old:o,new:s.metadata});let y=[];for(let S of l)y.push(this.getNotebookCell(S));let h=[];for(let S of u)h.push(this.getNotebookCell(S));let v=[];for(let S of f)v.push(this.getNotebookCell(S));(y.length>0||h.length>0||d.length>0||v.length>0)&&(p.cells={added:y,removed:h,changed:{data:d,textContent:v}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),en.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};zo.NotebookDocuments=Sy});var BE=P(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.MonikerFeature=void 0;var aj=kt(),cj=t=>class extends t{get moniker(){return{on:e=>{let r=aj.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Jd.MonikerFeature=cj});var Cy=P(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.createConnection=Fe.combineFeatures=Fe.combineNotebooksFeatures=Fe.combineLanguagesFeatures=Fe.combineWorkspaceFeatures=Fe.combineWindowFeatures=Fe.combineClientFeatures=Fe.combineTracerFeatures=Fe.combineTelemetryFeatures=Fe.combineConsoleFeatures=Fe._NotebooksImpl=Fe._LanguagesImpl=Fe.BulkUnregistration=Fe.BulkRegistration=Fe.ErrorMessageTracker=void 0;var X=kt(),tn=Wu(),Ry=fy(),he=PE(),lj=RE(),uj=EE(),dj=wE(),fj=yy(),pj=kE(),hj=CE(),mj=DE(),gj=AE(),yj=OE(),vj=ME(),Tj=qE(),bj=LE(),_j=Ny(),Sj=BE();function Py(t){if(t!==null)return t}var Ey=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Fe.ErrorMessageTracker=Ey;var Qd=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(X.MessageType.Error,e)}warn(e){this.send(X.MessageType.Warning,e)}info(e){this.send(X.MessageType.Info,e)}log(e){this.send(X.MessageType.Log,e)}debug(e){this.send(X.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(X.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,X.RAL)().console.error("Sending log message failed")})}},wy=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,...r){let n={type:X.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(Py)}showWarningMessage(e,...r){let n={type:X.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(Py)}showInformationMessage(e,...r){let n={type:X.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(X.ShowMessageRequest.type,n).then(Py)}},FE=(0,pj.ShowDocumentFeature)((0,he.ProgressFeature)(wy)),jE;(function(t){function e(){return new Zd}t.create=e})(jE||(Fe.BulkRegistration=jE={}));var Zd=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=tn.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=Ry.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},UE;(function(t){function e(){return new _c(void 0,[])}t.create=e})(UE||(Fe.BulkUnregistration=UE={}));var _c=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(X.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=tn.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(X.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},ef=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,r,n){return e instanceof Zd?this.registerMany(e):e instanceof _c?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=tn.string(r)?r:r.method,s=Ry.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(X.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=tn.string(e)?e:e.method,i=Ry.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(X.RegistrationRequest.type,s).then(o=>X.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(X.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(X.RegistrationRequest.type,r).then(()=>new _c(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},ky=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(X.ApplyWorkspaceEditRequest.type,n)}},HE=(0,hj.FileOperationsFeature)((0,uj.WorkspaceFoldersFeature)((0,lj.ConfigurationFeature)(ky))),tf=class{constructor(){this._trace=X.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,r){this._trace!==X.Trace.Off&&this.connection.sendNotification(X.LogTraceNotification.type,{message:e,verbose:this._trace===X.Trace.Verbose?r:void 0}).catch(()=>{})}},rf=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(X.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},nf=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Fe._LanguagesImpl=nf;var VE=(0,vj.FoldingRangeFeature)((0,Sj.MonikerFeature)((0,bj.DiagnosticFeature)((0,Tj.InlayHintFeature)((0,yj.InlineValueFeature)((0,gj.TypeHierarchyFeature)((0,mj.LinkedEditingRangeFeature)((0,fj.SemanticTokensFeature)((0,dj.CallHierarchyFeature)(nf))))))))),sf=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Fe._NotebooksImpl=sf;var zE=(0,_j.NotebookSyncFeature)(sf);function WE(t,e){return function(r){return e(t(r))}}Fe.combineConsoleFeatures=WE;function GE(t,e){return function(r){return e(t(r))}}Fe.combineTelemetryFeatures=GE;function YE(t,e){return function(r){return e(t(r))}}Fe.combineTracerFeatures=YE;function KE(t,e){return function(r){return e(t(r))}}Fe.combineClientFeatures=KE;function XE(t,e){return function(r){return e(t(r))}}Fe.combineWindowFeatures=XE;function JE(t,e){return function(r){return e(t(r))}}Fe.combineWorkspaceFeatures=JE;function QE(t,e){return function(r){return e(t(r))}}Fe.combineLanguagesFeatures=QE;function ZE(t,e){return function(r){return e(t(r))}}Fe.combineNotebooksFeatures=ZE;function Nj(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:r(t.console,e.console,WE),tracer:r(t.tracer,e.tracer,YE),telemetry:r(t.telemetry,e.telemetry,GE),client:r(t.client,e.client,KE),window:r(t.window,e.window,XE),workspace:r(t.workspace,e.workspace,JE),languages:r(t.languages,e.languages,QE),notebooks:r(t.notebooks,e.notebooks,ZE)}}Fe.combineFeatures=Nj;function Pj(t,e,r){let n=r&&r.console?new(r.console(Qd)):new Qd,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(tf)):new tf,o=r&&r.telemetry?new(r.telemetry(rf)):new rf,a=r&&r.client?new(r.client(ef)):new ef,c=r&&r.window?new(r.window(FE)):new FE,l=r&&r.workspace?new(r.workspace(HE)):new HE,u=r&&r.languages?new(r.languages(VE)):new VE,d=r&&r.notebooks?new(r.notebooks(zE)):new zE,f=[n,s,o,a,c,l,u,d];function p(_){return _ instanceof Promise?_:tn.thenable(_)?new Promise((T,R)=>{_.then(C=>T(C),C=>R(C))}):Promise.resolve(_)}let y,h,v,S={listen:()=>i.listen(),sendRequest:(_,...T)=>i.sendRequest(tn.string(_)?_:_.method,...T),onRequest:(_,T)=>i.onRequest(_,T),sendNotification:(_,T)=>{let R=tn.string(_)?_:_.method;return i.sendNotification(R,T)},onNotification:(_,T)=>i.onNotification(_,T),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:_=>(h=_,{dispose:()=>{h=void 0}}),onInitialized:_=>i.onNotification(X.InitializedNotification.type,_),onShutdown:_=>(y=_,{dispose:()=>{y=void 0}}),onExit:_=>(v=_,{dispose:()=>{v=void 0}}),get console(){return n},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:_=>i.onNotification(X.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>i.onNotification(X.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>i.onNotification(X.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>i.onNotification(X.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>i.onNotification(X.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>i.onNotification(X.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>i.onRequest(X.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>i.onNotification(X.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>i.sendNotification(X.PublishDiagnosticsNotification.type,_),onHover:_=>i.onRequest(X.HoverRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),onCompletion:_=>i.onRequest(X.CompletionRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCompletionResolve:_=>i.onRequest(X.CompletionResolveRequest.type,_),onSignatureHelp:_=>i.onRequest(X.SignatureHelpRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),onDeclaration:_=>i.onRequest(X.DeclarationRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDefinition:_=>i.onRequest(X.DefinitionRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onTypeDefinition:_=>i.onRequest(X.TypeDefinitionRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onImplementation:_=>i.onRequest(X.ImplementationRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onReferences:_=>i.onRequest(X.ReferencesRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentHighlight:_=>i.onRequest(X.DocumentHighlightRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentSymbol:_=>i.onRequest(X.DocumentSymbolRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onWorkspaceSymbol:_=>i.onRequest(X.WorkspaceSymbolRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onWorkspaceSymbolResolve:_=>i.onRequest(X.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>i.onRequest(X.CodeActionRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCodeActionResolve:_=>i.onRequest(X.CodeActionResolveRequest.type,(T,R)=>_(T,R)),onCodeLens:_=>i.onRequest(X.CodeLensRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCodeLensResolve:_=>i.onRequest(X.CodeLensResolveRequest.type,(T,R)=>_(T,R)),onDocumentFormatting:_=>i.onRequest(X.DocumentFormattingRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),onDocumentRangeFormatting:_=>i.onRequest(X.DocumentRangeFormattingRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),onDocumentOnTypeFormatting:_=>i.onRequest(X.DocumentOnTypeFormattingRequest.type,(T,R)=>_(T,R)),onRenameRequest:_=>i.onRequest(X.RenameRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),onPrepareRename:_=>i.onRequest(X.PrepareRenameRequest.type,(T,R)=>_(T,R)),onDocumentLinks:_=>i.onRequest(X.DocumentLinkRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentLinkResolve:_=>i.onRequest(X.DocumentLinkResolveRequest.type,(T,R)=>_(T,R)),onDocumentColor:_=>i.onRequest(X.DocumentColorRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onColorPresentation:_=>i.onRequest(X.ColorPresentationRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onFoldingRanges:_=>i.onRequest(X.FoldingRangeRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onSelectionRanges:_=>i.onRequest(X.SelectionRangeRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onExecuteCommand:_=>i.onRequest(X.ExecuteCommandRequest.type,(T,R)=>_(T,R,(0,he.attachWorkDone)(i,T),void 0)),dispose:()=>i.dispose()};for(let _ of f)_.attach(S);return i.onRequest(X.InitializeRequest.type,_=>{e.initialize(_),tn.string(_.trace)&&(s.trace=X.Trace.fromString(_.trace));for(let T of f)T.initialize(_.capabilities);if(h){let T=h(_,new X.CancellationTokenSource().token,(0,he.attachWorkDone)(i,_),void 0);return p(T).then(R=>{if(R instanceof X.ResponseError)return R;let C=R;C||(C={capabilities:{}});let B=C.capabilities;B||(B={},C.capabilities=B),B.textDocumentSync===void 0||B.textDocumentSync===null?B.textDocumentSync=tn.number(S.__textDocumentSync)?S.__textDocumentSync:X.TextDocumentSyncKind.None:!tn.number(B.textDocumentSync)&&!tn.number(B.textDocumentSync.change)&&(B.textDocumentSync.change=tn.number(S.__textDocumentSync)?S.__textDocumentSync:X.TextDocumentSyncKind.None);for(let U of f)U.fillServerCapabilities(B);return C})}else{let T={capabilities:{textDocumentSync:X.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(T.capabilities);return T}}),i.onRequest(X.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new X.CancellationTokenSource().token)}),i.onNotification(X.ExitNotification.type,()=>{try{v&&v()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(X.SetTraceNotification.type,_=>{s.trace=X.Trace.fromString(_.value)}),S}Fe.createConnection=Pj});var ew=P(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.resolveModulePath=Dr.FileSystem=Dr.resolveGlobalYarnPath=Dr.resolveGlobalNodePath=Dr.resolve=Dr.uriToFilePath=void 0;var Rj=require("url"),wn=require("path"),Dy=require("fs"),xy=require("child_process");function Ej(t){let e=Rj.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift()}return wn.normalize(r.join("/"))}Dr.uriToFilePath=Ej;function Ay(){return process.platform==="win32"}function of(t,e,r,n){let i="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&&Dy.existsSync(e)&&(l[i]?l[i]=e+wn.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,xy.fork)("",[],{cwd:r,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} 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: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}Dr.resolve=of;function Iy(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Ay()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,xy.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Ay()?wn.join(o,"node_modules"):wn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Dr.resolveGlobalNodePath=Iy;function wj(t){let e="yarn",r={encoding:"utf8"};Ay()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,xy.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.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 wn.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}Dr.resolveGlobalYarnPath=wj;var Oy;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Dy.existsSync(__filename.toUpperCase())||!Dy.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?wn.normalize(s).indexOf(wn.normalize(i))===0:wn.normalize(s).toLowerCase().indexOf(wn.normalize(i).toLowerCase())===0}t.isParent=n})(Oy||(Dr.FileSystem=Oy={}));function kj(t,e,r,n){return r?(wn.isAbsolute(r)||(r=wn.join(t,r)),of(e,r,r,n).then(i=>Oy.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>of(e,Iy(n),t,n))):of(e,Iy(n),t,n)}Dr.resolveModulePath=kj});var My=P((hQ,tw)=>{"use strict";tw.exports=kt()});var rw=P(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.InlineCompletionFeature=void 0;var Cj=kt(),Dj=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(Cj.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};af.InlineCompletionFeature=Dj});var sw=P(ur=>{"use strict";var Aj=ur&&ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iw=ur&&ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Aj(e,t,r)};Object.defineProperty(ur,"__esModule",{value:!0});ur.ProposedFeatures=ur.NotebookDocuments=ur.TextDocuments=ur.SemanticTokensBuilder=void 0;var Ij=yy();Object.defineProperty(ur,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Ij.SemanticTokensBuilder}});var Oj=rw();iw(kt(),ur);var xj=_y();Object.defineProperty(ur,"TextDocuments",{enumerable:!0,get:function(){return xj.TextDocuments}});var Mj=Ny();Object.defineProperty(ur,"NotebookDocuments",{enumerable:!0,get:function(){return Mj.NotebookDocuments}});iw(Cy(),ur);var nw;(function(t){t.all={__brand:"features",languages:Oj.InlineCompletionFeature}})(nw||(ur.ProposedFeatures=nw={}))});var F=P(rn=>{"use strict";var qj=rn&&rn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lw=rn&&rn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qj(e,t,r)};Object.defineProperty(rn,"__esModule",{value:!0});rn.createConnection=rn.Files=void 0;var ow=require("node:util"),qy=Wu(),Lj=Cy(),Sc=ew(),Vs=My();lw(My(),rn);lw(sw(),rn);var aw;(function(t){t.uriToFilePath=Sc.uriToFilePath,t.resolveGlobalNodePath=Sc.resolveGlobalNodePath,t.resolveGlobalYarnPath=Sc.resolveGlobalYarnPath,t.resolve=Sc.resolve,t.resolveModulePath=Sc.resolveModulePath})(aw||(rn.Files=aw={}));var cw;function cf(){if(cw!==void 0)try{cw.end()}catch{}}var Wo=!1,uw;function $j(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(uw=setInterval(()=>{try{process.kill(n,0)}catch{cf(),process.exit(Wo?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}$j();var Bj={initialize:t=>{let e=t.processId;qy.number(e)&&uw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Wo?0:1)}},3e3)},get shutdownReceived(){return Wo},set shutdownReceived(t){Wo=t},exit:t=>{cf(),process.exit(t)}};function Fj(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Vs.ConnectionStrategy.is(t)||Vs.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),jj(s,o,a,i)}rn.createConnection=Fj;function jj(t,e,r,n){let i=!1;if(!t&&!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"){t=new Vs.IPCMessageReader(process),e=new Vs.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=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 s=f.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,Vs.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,Vs.createServerPipeTransport)(l);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(qy.func(t.read)&&qy.func(t.on)){let c=t;c.on("end",()=>{cf(),process.exit(Wo?0:1)}),c.on("close",()=>{cf(),process.exit(Wo?0:1)})}let a=c=>{let l=(0,Vs.createProtocolConnection)(t,e,c,r);return i&&Uj(c),l};return(0,Lj.createConnection)(a,Bj,n)}function Uj(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,ow.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=r.get(s)??0;o+=1,r.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,ow.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
|
37
|
-
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var
|
|
38
|
-
`)}};
|
|
39
|
-
`)?
|
|
34
|
+
`,"\r"];var OS;(function(y){function E(D,q,ge,Pt){return new pB(D,q,ge,Pt)}y.create=E;function w(D){var q=D;return!!(A.defined(q)&&A.string(q.uri)&&(A.undefined(q.languageId)||A.string(q.languageId))&&A.uinteger(q.lineCount)&&A.func(q.getText)&&A.func(q.positionAt)&&A.func(q.offsetAt))}y.is=w;function b(D,q){for(var ge=D.getText(),Pt=m(q,function(To,Lu){var xS=To.range.start.line-Lu.range.start.line;return xS===0?To.range.start.character-Lu.range.start.character:xS}),ot=ge.length,Nn=Pt.length-1;Nn>=0;Nn--){var Rn=Pt[Nn],mi=D.offsetAt(Rn.range.start),we=D.offsetAt(Rn.range.end);if(we<=ot)ge=ge.substring(0,mi)+Rn.newText+ge.substring(we,ge.length);else throw new Error("Overlapping edit");ot=mi}return ge}y.applyEdits=b;function m(D,q){if(D.length<=1)return D;var ge=D.length/2|0,Pt=D.slice(0,ge),ot=D.slice(ge);m(Pt,q),m(ot,q);for(var Nn=0,Rn=0,mi=0;Nn<Pt.length&&Rn<ot.length;){var we=q(Pt[Nn],ot[Rn]);we<=0?D[mi++]=Pt[Nn++]:D[mi++]=ot[Rn++]}for(;Nn<Pt.length;)D[mi++]=Pt[Nn++];for(;Rn<ot.length;)D[mi++]=ot[Rn++];return D}})(OS||(e.TextDocument=OS={}));var pB=function(){function y(E,w,b,m){this._uri=E,this._languageId=w,this._version=b,this._content=m,this._lineOffsets=void 0}return Object.defineProperty(y.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),y.prototype.getText=function(E){if(E){var w=this.offsetAt(E.start),b=this.offsetAt(E.end);return this._content.substring(w,b)}return this._content},y.prototype.update=function(E,w){this._content=E.text,this._version=w,this._lineOffsets=void 0},y.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var E=[],w=this._content,b=!0,m=0;m<w.length;m++){b&&(E.push(m),b=!1);var D=w.charAt(m);b=D==="\r"||D===`
|
|
35
|
+
`,D==="\r"&&m+1<w.length&&w.charAt(m+1)===`
|
|
36
|
+
`&&m++}b&&w.length>0&&E.push(w.length),this._lineOffsets=E}return this._lineOffsets},y.prototype.positionAt=function(E){E=Math.max(Math.min(E,this._content.length),0);var w=this.getLineOffsets(),b=0,m=w.length;if(m===0)return o.create(0,E);for(;b<m;){var D=Math.floor((b+m)/2);w[D]>E?m=D:b=D+1}var q=b-1;return o.create(q,E-w[q])},y.prototype.offsetAt=function(E){var w=this.getLineOffsets();if(E.line>=w.length)return this._content.length;if(E.line<0)return 0;var b=w[E.line],m=E.line+1<w.length?w[E.line+1]:this._content.length;return Math.max(Math.min(b+E.character,m),b)},Object.defineProperty(y.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),y}(),A;(function(y){var E=Object.prototype.toString;function w(we){return typeof we<"u"}y.defined=w;function b(we){return typeof we>"u"}y.undefined=b;function m(we){return we===!0||we===!1}y.boolean=m;function D(we){return E.call(we)==="[object String]"}y.string=D;function q(we){return E.call(we)==="[object Number]"}y.number=q;function ge(we,To,Lu){return E.call(we)==="[object Number]"&&To<=we&&we<=Lu}y.numberRange=ge;function Pt(we){return E.call(we)==="[object Number]"&&-2147483648<=we&&we<=2147483647}y.integer=Pt;function ot(we){return E.call(we)==="[object Number]"&&0<=we&&we<=2147483647}y.uinteger=ot;function Nn(we){return E.call(we)==="[object Function]"}y.func=Nn;function Rn(we){return we!==null&&typeof we=="object"}y.objectLiteral=Rn;function mi(we,To){return Array.isArray(we)&&we.every(To)}y.typedArray=mi})(A||(A={}))})});var Tt=R(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.ProtocolNotificationType=Pr.ProtocolNotificationType0=Pr.ProtocolRequestType=Pr.ProtocolRequestType0=Pr.RegistrationType=Pr.MessageDirection=void 0;var wo=qs(),mN;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(mN||(Pr.MessageDirection=mN={}));var Ug=class{constructor(e){this.method=e}};Pr.RegistrationType=Ug;var Hg=class extends wo.RequestType0{constructor(e){super(e)}};Pr.ProtocolRequestType0=Hg;var Vg=class extends wo.RequestType{constructor(e){super(e,wo.ParameterStructures.byName)}};Pr.ProtocolRequestType=Vg;var zg=class extends wo.NotificationType0{constructor(e){super(e)}};Pr.ProtocolNotificationType0=zg;var Wg=class extends wo.NotificationType{constructor(e){super(e,wo.ParameterStructures.byName)}};Pr.ProtocolNotificationType=Wg});var cd=R(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.objectLiteral=Mt.typedArray=Mt.stringArray=Mt.array=Mt.func=Mt.error=Mt.number=Mt.string=Mt.boolean=void 0;function aF(t){return t===!0||t===!1}Mt.boolean=aF;function gN(t){return typeof t=="string"||t instanceof String}Mt.string=gN;function cF(t){return typeof t=="number"||t instanceof Number}Mt.number=cF;function lF(t){return t instanceof Error}Mt.error=lF;function uF(t){return typeof t=="function"}Mt.func=uF;function yN(t){return Array.isArray(t)}Mt.array=yN;function dF(t){return yN(t)&&t.every(e=>gN(e))}Mt.stringArray=dF;function fF(t,e){return Array.isArray(t)&&t.every(e)}Mt.typedArray=fF;function pF(t){return t!==null&&typeof t=="object"}Mt.objectLiteral=pF});var bN=R(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.ImplementationRequest=void 0;var vN=Tt(),TN;(function(t){t.method="textDocument/implementation",t.messageDirection=vN.MessageDirection.clientToServer,t.type=new vN.ProtocolRequestType(t.method)})(TN||(ld.ImplementationRequest=TN={}))});var NN=R(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.TypeDefinitionRequest=void 0;var _N=Tt(),SN;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=_N.MessageDirection.clientToServer,t.type=new _N.ProtocolRequestType(t.method)})(SN||(ud.TypeDefinitionRequest=SN={}))});var kN=R(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.DidChangeWorkspaceFoldersNotification=Co.WorkspaceFoldersRequest=void 0;var dd=Tt(),RN;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=dd.MessageDirection.serverToClient,t.type=new dd.ProtocolRequestType0(t.method)})(RN||(Co.WorkspaceFoldersRequest=RN={}));var PN;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=dd.MessageDirection.clientToServer,t.type=new dd.ProtocolNotificationType(t.method)})(PN||(Co.DidChangeWorkspaceFoldersNotification=PN={}))});var CN=R(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.ConfigurationRequest=void 0;var EN=Tt(),wN;(function(t){t.method="workspace/configuration",t.messageDirection=EN.MessageDirection.serverToClient,t.type=new EN.ProtocolRequestType(t.method)})(wN||(fd.ConfigurationRequest=wN={}))});var IN=R(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ColorPresentationRequest=Do.DocumentColorRequest=void 0;var pd=Tt(),DN;(function(t){t.method="textDocument/documentColor",t.messageDirection=pd.MessageDirection.clientToServer,t.type=new pd.ProtocolRequestType(t.method)})(DN||(Do.DocumentColorRequest=DN={}));var AN;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=pd.MessageDirection.clientToServer,t.type=new pd.ProtocolRequestType(t.method)})(AN||(Do.ColorPresentationRequest=AN={}))});var MN=R(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.FoldingRangeRefreshRequest=Ao.FoldingRangeRequest=void 0;var hd=Tt(),ON;(function(t){t.method="textDocument/foldingRange",t.messageDirection=hd.MessageDirection.clientToServer,t.type=new hd.ProtocolRequestType(t.method)})(ON||(Ao.FoldingRangeRequest=ON={}));var xN;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=hd.MessageDirection.serverToClient,t.type=new hd.ProtocolRequestType0(t.method)})(xN||(Ao.FoldingRangeRefreshRequest=xN={}))});var $N=R(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.DeclarationRequest=void 0;var qN=Tt(),LN;(function(t){t.method="textDocument/declaration",t.messageDirection=qN.MessageDirection.clientToServer,t.type=new qN.ProtocolRequestType(t.method)})(LN||(md.DeclarationRequest=LN={}))});var jN=R(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.SelectionRangeRequest=void 0;var BN=Tt(),FN;(function(t){t.method="textDocument/selectionRange",t.messageDirection=BN.MessageDirection.clientToServer,t.type=new BN.ProtocolRequestType(t.method)})(FN||(gd.SelectionRangeRequest=FN={}))});var zN=R(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.WorkDoneProgressCancelNotification=Fi.WorkDoneProgressCreateRequest=Fi.WorkDoneProgress=void 0;var hF=qs(),yd=Tt(),UN;(function(t){t.type=new hF.ProgressType;function e(r){return r===t.type}t.is=e})(UN||(Fi.WorkDoneProgress=UN={}));var HN;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=yd.MessageDirection.serverToClient,t.type=new yd.ProtocolRequestType(t.method)})(HN||(Fi.WorkDoneProgressCreateRequest=HN={}));var VN;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=yd.MessageDirection.clientToServer,t.type=new yd.ProtocolNotificationType(t.method)})(VN||(Fi.WorkDoneProgressCancelNotification=VN={}))});var KN=R(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.CallHierarchyOutgoingCallsRequest=ji.CallHierarchyIncomingCallsRequest=ji.CallHierarchyPrepareRequest=void 0;var Io=Tt(),WN;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(WN||(ji.CallHierarchyPrepareRequest=WN={}));var GN;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(GN||(ji.CallHierarchyIncomingCallsRequest=GN={}));var YN;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Io.MessageDirection.clientToServer,t.type=new Io.ProtocolRequestType(t.method)})(YN||(ji.CallHierarchyOutgoingCallsRequest=YN={}))});var tR=R(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.SemanticTokensRefreshRequest=kr.SemanticTokensRangeRequest=kr.SemanticTokensDeltaRequest=kr.SemanticTokensRequest=kr.SemanticTokensRegistrationType=kr.TokenFormat=void 0;var yi=Tt(),XN;(function(t){t.Relative="relative"})(XN||(kr.TokenFormat=XN={}));var oc;(function(t){t.method="textDocument/semanticTokens",t.type=new yi.RegistrationType(t.method)})(oc||(kr.SemanticTokensRegistrationType=oc={}));var JN;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(JN||(kr.SemanticTokensRequest=JN={}));var QN;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(QN||(kr.SemanticTokensDeltaRequest=QN={}));var ZN;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=yi.MessageDirection.clientToServer,t.type=new yi.ProtocolRequestType(t.method),t.registrationMethod=oc.method})(ZN||(kr.SemanticTokensRangeRequest=ZN={}));var eR;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=yi.MessageDirection.serverToClient,t.type=new yi.ProtocolRequestType0(t.method)})(eR||(kr.SemanticTokensRefreshRequest=eR={}))});var iR=R(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.ShowDocumentRequest=void 0;var rR=Tt(),nR;(function(t){t.method="window/showDocument",t.messageDirection=rR.MessageDirection.serverToClient,t.type=new rR.ProtocolRequestType(t.method)})(nR||(vd.ShowDocumentRequest=nR={}))});var aR=R(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.LinkedEditingRangeRequest=void 0;var sR=Tt(),oR;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=sR.MessageDirection.clientToServer,t.type=new sR.ProtocolRequestType(t.method)})(oR||(Td.LinkedEditingRangeRequest=oR={}))});var mR=R(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.WillDeleteFilesRequest=ar.DidDeleteFilesNotification=ar.DidRenameFilesNotification=ar.WillRenameFilesRequest=ar.DidCreateFilesNotification=ar.WillCreateFilesRequest=ar.FileOperationPatternKind=void 0;var Xr=Tt(),cR;(function(t){t.file="file",t.folder="folder"})(cR||(ar.FileOperationPatternKind=cR={}));var lR;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolRequestType(t.method)})(lR||(ar.WillCreateFilesRequest=lR={}));var uR;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolNotificationType(t.method)})(uR||(ar.DidCreateFilesNotification=uR={}));var dR;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolRequestType(t.method)})(dR||(ar.WillRenameFilesRequest=dR={}));var fR;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolNotificationType(t.method)})(fR||(ar.DidRenameFilesNotification=fR={}));var pR;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolNotificationType(t.method)})(pR||(ar.DidDeleteFilesNotification=pR={}));var hR;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Xr.MessageDirection.clientToServer,t.type=new Xr.ProtocolRequestType(t.method)})(hR||(ar.WillDeleteFilesRequest=hR={}))});var bR=R(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.MonikerRequest=Ui.MonikerKind=Ui.UniquenessLevel=void 0;var gR=Tt(),yR;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(yR||(Ui.UniquenessLevel=yR={}));var vR;(function(t){t.$import="import",t.$export="export",t.local="local"})(vR||(Ui.MonikerKind=vR={}));var TR;(function(t){t.method="textDocument/moniker",t.messageDirection=gR.MessageDirection.clientToServer,t.type=new gR.ProtocolRequestType(t.method)})(TR||(Ui.MonikerRequest=TR={}))});var RR=R(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.TypeHierarchySubtypesRequest=Hi.TypeHierarchySupertypesRequest=Hi.TypeHierarchyPrepareRequest=void 0;var Oo=Tt(),_R;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(_R||(Hi.TypeHierarchyPrepareRequest=_R={}));var SR;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(SR||(Hi.TypeHierarchySupertypesRequest=SR={}));var NR;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Oo.MessageDirection.clientToServer,t.type=new Oo.ProtocolRequestType(t.method)})(NR||(Hi.TypeHierarchySubtypesRequest=NR={}))});var ER=R(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.InlineValueRefreshRequest=xo.InlineValueRequest=void 0;var bd=Tt(),PR;(function(t){t.method="textDocument/inlineValue",t.messageDirection=bd.MessageDirection.clientToServer,t.type=new bd.ProtocolRequestType(t.method)})(PR||(xo.InlineValueRequest=PR={}));var kR;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=bd.MessageDirection.serverToClient,t.type=new bd.ProtocolRequestType0(t.method)})(kR||(xo.InlineValueRefreshRequest=kR={}))});var AR=R(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.InlayHintRefreshRequest=Vi.InlayHintResolveRequest=Vi.InlayHintRequest=void 0;var Mo=Tt(),wR;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(wR||(Vi.InlayHintRequest=wR={}));var CR;(function(t){t.method="inlayHint/resolve",t.messageDirection=Mo.MessageDirection.clientToServer,t.type=new Mo.ProtocolRequestType(t.method)})(CR||(Vi.InlayHintResolveRequest=CR={}));var DR;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Mo.MessageDirection.serverToClient,t.type=new Mo.ProtocolRequestType0(t.method)})(DR||(Vi.InlayHintRefreshRequest=DR={}))});var $R=R(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.DiagnosticRefreshRequest=Jr.WorkspaceDiagnosticRequest=Jr.DocumentDiagnosticRequest=Jr.DocumentDiagnosticReportKind=Jr.DiagnosticServerCancellationData=void 0;var LR=qs(),mF=cd(),qo=Tt(),IR;(function(t){function e(r){let n=r;return n&&mF.boolean(n.retriggerRequest)}t.is=e})(IR||(Jr.DiagnosticServerCancellationData=IR={}));var OR;(function(t){t.Full="full",t.Unchanged="unchanged"})(OR||(Jr.DocumentDiagnosticReportKind=OR={}));var xR;(function(t){t.method="textDocument/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new LR.ProgressType})(xR||(Jr.DocumentDiagnosticRequest=xR={}));var MR;(function(t){t.method="workspace/diagnostic",t.messageDirection=qo.MessageDirection.clientToServer,t.type=new qo.ProtocolRequestType(t.method),t.partialResult=new LR.ProgressType})(MR||(Jr.WorkspaceDiagnosticRequest=MR={}));var qR;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=qo.MessageDirection.serverToClient,t.type=new qo.ProtocolRequestType0(t.method)})(qR||(Jr.DiagnosticRefreshRequest=qR={}))});var zR=R(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.DidCloseNotebookDocumentNotification=kt.DidSaveNotebookDocumentNotification=kt.DidChangeNotebookDocumentNotification=kt.NotebookCellArrayChange=kt.DidOpenNotebookDocumentNotification=kt.NotebookDocumentSyncRegistrationType=kt.NotebookDocument=kt.NotebookCell=kt.ExecutionSummary=kt.NotebookCellKind=void 0;var ac=ad(),kn=cd(),zn=Tt(),Gg;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Gg||(kt.NotebookCellKind=Gg={}));var Yg;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return kn.objectLiteral(s)&&ac.uinteger.is(s.executionOrder)&&(s.success===void 0||kn.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Yg||(kt.ExecutionSummary=Yg={}));var _d;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function r(s){let o=s;return kn.objectLiteral(o)&&Gg.is(o.kind)&&ac.DocumentUri.is(o.document)&&(o.metadata===void 0||kn.objectLiteral(o.metadata))}t.is=r;function n(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)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Yg.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(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(!i(s[l],o[l]))return!1}if(kn.objectLiteral(s)&&kn.objectLiteral(o)){let l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!i(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!i(s[f],o[f]))return!1}}return!0}})(_d||(kt.NotebookCell=_d={}));var BR;(function(t){function e(n,i,s,o){return{uri:n,notebookType:i,version:s,cells:o}}t.create=e;function r(n){let i=n;return kn.objectLiteral(i)&&kn.string(i.uri)&&ac.integer.is(i.version)&&kn.typedArray(i.cells,_d.is)}t.is=r})(BR||(kt.NotebookDocument=BR={}));var Lo;(function(t){t.method="notebookDocument/sync",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.RegistrationType(t.method)})(Lo||(kt.NotebookDocumentSyncRegistrationType=Lo={}));var FR;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(FR||(kt.DidOpenNotebookDocumentNotification=FR={}));var jR;(function(t){function e(n){let i=n;return kn.objectLiteral(i)&&ac.uinteger.is(i.start)&&ac.uinteger.is(i.deleteCount)&&(i.cells===void 0||kn.typedArray(i.cells,_d.is))}t.is=e;function r(n,i,s){let o={start:n,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=r})(jR||(kt.NotebookCellArrayChange=jR={}));var UR;(function(t){t.method="notebookDocument/didChange",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(UR||(kt.DidChangeNotebookDocumentNotification=UR={}));var HR;(function(t){t.method="notebookDocument/didSave",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(HR||(kt.DidSaveNotebookDocumentNotification=HR={}));var VR;(function(t){t.method="notebookDocument/didClose",t.messageDirection=zn.MessageDirection.clientToServer,t.type=new zn.ProtocolNotificationType(t.method),t.registrationMethod=Lo.method})(VR||(kt.DidCloseNotebookDocumentNotification=VR={}))});var YR=R(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.InlineCompletionRequest=void 0;var WR=Tt(),GR;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=WR.MessageDirection.clientToServer,t.type=new WR.ProtocolRequestType(t.method)})(GR||(Sd.InlineCompletionRequest=GR={}))});var ak=R(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.WorkspaceSymbolRequest=N.CodeActionResolveRequest=N.CodeActionRequest=N.DocumentSymbolRequest=N.DocumentHighlightRequest=N.ReferencesRequest=N.DefinitionRequest=N.SignatureHelpRequest=N.SignatureHelpTriggerKind=N.HoverRequest=N.CompletionResolveRequest=N.CompletionRequest=N.CompletionTriggerKind=N.PublishDiagnosticsNotification=N.WatchKind=N.RelativePattern=N.FileChangeType=N.DidChangeWatchedFilesNotification=N.WillSaveTextDocumentWaitUntilRequest=N.WillSaveTextDocumentNotification=N.TextDocumentSaveReason=N.DidSaveTextDocumentNotification=N.DidCloseTextDocumentNotification=N.DidChangeTextDocumentNotification=N.TextDocumentContentChangeEvent=N.DidOpenTextDocumentNotification=N.TextDocumentSyncKind=N.TelemetryEventNotification=N.LogMessageNotification=N.ShowMessageRequest=N.ShowMessageNotification=N.MessageType=N.DidChangeConfigurationNotification=N.ExitNotification=N.ShutdownRequest=N.InitializedNotification=N.InitializeErrorCodes=N.InitializeRequest=N.WorkDoneProgressOptions=N.TextDocumentRegistrationOptions=N.StaticRegistrationOptions=N.PositionEncodingKind=N.FailureHandlingKind=N.ResourceOperationKind=N.UnregistrationRequest=N.RegistrationRequest=N.DocumentSelector=N.NotebookCellTextDocumentFilter=N.NotebookDocumentFilter=N.TextDocumentFilter=void 0;N.MonikerRequest=N.MonikerKind=N.UniquenessLevel=N.WillDeleteFilesRequest=N.DidDeleteFilesNotification=N.WillRenameFilesRequest=N.DidRenameFilesNotification=N.WillCreateFilesRequest=N.DidCreateFilesNotification=N.FileOperationPatternKind=N.LinkedEditingRangeRequest=N.ShowDocumentRequest=N.SemanticTokensRegistrationType=N.SemanticTokensRefreshRequest=N.SemanticTokensRangeRequest=N.SemanticTokensDeltaRequest=N.SemanticTokensRequest=N.TokenFormat=N.CallHierarchyPrepareRequest=N.CallHierarchyOutgoingCallsRequest=N.CallHierarchyIncomingCallsRequest=N.WorkDoneProgressCancelNotification=N.WorkDoneProgressCreateRequest=N.WorkDoneProgress=N.SelectionRangeRequest=N.DeclarationRequest=N.FoldingRangeRefreshRequest=N.FoldingRangeRequest=N.ColorPresentationRequest=N.DocumentColorRequest=N.ConfigurationRequest=N.DidChangeWorkspaceFoldersNotification=N.WorkspaceFoldersRequest=N.TypeDefinitionRequest=N.ImplementationRequest=N.ApplyWorkspaceEditRequest=N.ExecuteCommandRequest=N.PrepareRenameRequest=N.RenameRequest=N.PrepareSupportDefaultBehavior=N.DocumentOnTypeFormattingRequest=N.DocumentRangesFormattingRequest=N.DocumentRangeFormattingRequest=N.DocumentFormattingRequest=N.DocumentLinkResolveRequest=N.DocumentLinkRequest=N.CodeLensRefreshRequest=N.CodeLensResolveRequest=N.CodeLensRequest=N.WorkspaceSymbolResolveRequest=void 0;N.InlineCompletionRequest=N.DidCloseNotebookDocumentNotification=N.DidSaveNotebookDocumentNotification=N.DidChangeNotebookDocumentNotification=N.NotebookCellArrayChange=N.DidOpenNotebookDocumentNotification=N.NotebookDocumentSyncRegistrationType=N.NotebookDocument=N.NotebookCell=N.ExecutionSummary=N.NotebookCellKind=N.DiagnosticRefreshRequest=N.WorkspaceDiagnosticRequest=N.DocumentDiagnosticRequest=N.DocumentDiagnosticReportKind=N.DiagnosticServerCancellationData=N.InlayHintRefreshRequest=N.InlayHintResolveRequest=N.InlayHintRequest=N.InlineValueRefreshRequest=N.InlineValueRequest=N.TypeHierarchySupertypesRequest=N.TypeHierarchySubtypesRequest=N.TypeHierarchyPrepareRequest=void 0;var V=Tt(),KR=ad(),Vt=cd(),gF=bN();Object.defineProperty(N,"ImplementationRequest",{enumerable:!0,get:function(){return gF.ImplementationRequest}});var yF=NN();Object.defineProperty(N,"TypeDefinitionRequest",{enumerable:!0,get:function(){return yF.TypeDefinitionRequest}});var nk=kN();Object.defineProperty(N,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return nk.WorkspaceFoldersRequest}});Object.defineProperty(N,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return nk.DidChangeWorkspaceFoldersNotification}});var vF=CN();Object.defineProperty(N,"ConfigurationRequest",{enumerable:!0,get:function(){return vF.ConfigurationRequest}});var ik=IN();Object.defineProperty(N,"DocumentColorRequest",{enumerable:!0,get:function(){return ik.DocumentColorRequest}});Object.defineProperty(N,"ColorPresentationRequest",{enumerable:!0,get:function(){return ik.ColorPresentationRequest}});var sk=MN();Object.defineProperty(N,"FoldingRangeRequest",{enumerable:!0,get:function(){return sk.FoldingRangeRequest}});Object.defineProperty(N,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return sk.FoldingRangeRefreshRequest}});var TF=$N();Object.defineProperty(N,"DeclarationRequest",{enumerable:!0,get:function(){return TF.DeclarationRequest}});var bF=jN();Object.defineProperty(N,"SelectionRangeRequest",{enumerable:!0,get:function(){return bF.SelectionRangeRequest}});var Zg=zN();Object.defineProperty(N,"WorkDoneProgress",{enumerable:!0,get:function(){return Zg.WorkDoneProgress}});Object.defineProperty(N,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Zg.WorkDoneProgressCreateRequest}});Object.defineProperty(N,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Zg.WorkDoneProgressCancelNotification}});var ey=KN();Object.defineProperty(N,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return ey.CallHierarchyIncomingCallsRequest}});Object.defineProperty(N,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return ey.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(N,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return ey.CallHierarchyPrepareRequest}});var $o=tR();Object.defineProperty(N,"TokenFormat",{enumerable:!0,get:function(){return $o.TokenFormat}});Object.defineProperty(N,"SemanticTokensRequest",{enumerable:!0,get:function(){return $o.SemanticTokensRequest}});Object.defineProperty(N,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return $o.SemanticTokensDeltaRequest}});Object.defineProperty(N,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return $o.SemanticTokensRangeRequest}});Object.defineProperty(N,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return $o.SemanticTokensRefreshRequest}});Object.defineProperty(N,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return $o.SemanticTokensRegistrationType}});var _F=iR();Object.defineProperty(N,"ShowDocumentRequest",{enumerable:!0,get:function(){return _F.ShowDocumentRequest}});var SF=aR();Object.defineProperty(N,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return SF.LinkedEditingRangeRequest}});var Ls=mR();Object.defineProperty(N,"FileOperationPatternKind",{enumerable:!0,get:function(){return Ls.FileOperationPatternKind}});Object.defineProperty(N,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Ls.DidCreateFilesNotification}});Object.defineProperty(N,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Ls.WillCreateFilesRequest}});Object.defineProperty(N,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Ls.DidRenameFilesNotification}});Object.defineProperty(N,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Ls.WillRenameFilesRequest}});Object.defineProperty(N,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Ls.DidDeleteFilesNotification}});Object.defineProperty(N,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Ls.WillDeleteFilesRequest}});var ty=bR();Object.defineProperty(N,"UniquenessLevel",{enumerable:!0,get:function(){return ty.UniquenessLevel}});Object.defineProperty(N,"MonikerKind",{enumerable:!0,get:function(){return ty.MonikerKind}});Object.defineProperty(N,"MonikerRequest",{enumerable:!0,get:function(){return ty.MonikerRequest}});var ry=RR();Object.defineProperty(N,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return ry.TypeHierarchyPrepareRequest}});Object.defineProperty(N,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return ry.TypeHierarchySubtypesRequest}});Object.defineProperty(N,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return ry.TypeHierarchySupertypesRequest}});var ok=ER();Object.defineProperty(N,"InlineValueRequest",{enumerable:!0,get:function(){return ok.InlineValueRequest}});Object.defineProperty(N,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return ok.InlineValueRefreshRequest}});var ny=AR();Object.defineProperty(N,"InlayHintRequest",{enumerable:!0,get:function(){return ny.InlayHintRequest}});Object.defineProperty(N,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ny.InlayHintResolveRequest}});Object.defineProperty(N,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ny.InlayHintRefreshRequest}});var cc=$R();Object.defineProperty(N,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return cc.DiagnosticServerCancellationData}});Object.defineProperty(N,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return cc.DocumentDiagnosticReportKind}});Object.defineProperty(N,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return cc.DocumentDiagnosticRequest}});Object.defineProperty(N,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return cc.WorkspaceDiagnosticRequest}});Object.defineProperty(N,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return cc.DiagnosticRefreshRequest}});var Wn=zR();Object.defineProperty(N,"NotebookCellKind",{enumerable:!0,get:function(){return Wn.NotebookCellKind}});Object.defineProperty(N,"ExecutionSummary",{enumerable:!0,get:function(){return Wn.ExecutionSummary}});Object.defineProperty(N,"NotebookCell",{enumerable:!0,get:function(){return Wn.NotebookCell}});Object.defineProperty(N,"NotebookDocument",{enumerable:!0,get:function(){return Wn.NotebookDocument}});Object.defineProperty(N,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Wn.NotebookDocumentSyncRegistrationType}});Object.defineProperty(N,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Wn.DidOpenNotebookDocumentNotification}});Object.defineProperty(N,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Wn.NotebookCellArrayChange}});Object.defineProperty(N,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Wn.DidChangeNotebookDocumentNotification}});Object.defineProperty(N,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Wn.DidSaveNotebookDocumentNotification}});Object.defineProperty(N,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Wn.DidCloseNotebookDocumentNotification}});var NF=YR();Object.defineProperty(N,"InlineCompletionRequest",{enumerable:!0,get:function(){return NF.InlineCompletionRequest}});var Kg;(function(t){function e(r){let n=r;return Vt.string(n)||Vt.string(n.language)||Vt.string(n.scheme)||Vt.string(n.pattern)}t.is=e})(Kg||(N.TextDocumentFilter=Kg={}));var Xg;(function(t){function e(r){let n=r;return Vt.objectLiteral(n)&&(Vt.string(n.notebookType)||Vt.string(n.scheme)||Vt.string(n.pattern))}t.is=e})(Xg||(N.NotebookDocumentFilter=Xg={}));var Jg;(function(t){function e(r){let n=r;return Vt.objectLiteral(n)&&(Vt.string(n.notebook)||Xg.is(n.notebook))&&(n.language===void 0||Vt.string(n.language))}t.is=e})(Jg||(N.NotebookCellTextDocumentFilter=Jg={}));var Qg;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Vt.string(n)&&!Kg.is(n)&&!Jg.is(n))return!1;return!0}t.is=e})(Qg||(N.DocumentSelector=Qg={}));var XR;(function(t){t.method="client/registerCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(XR||(N.RegistrationRequest=XR={}));var JR;(function(t){t.method="client/unregisterCapability",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(JR||(N.UnregistrationRequest=JR={}));var QR;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(QR||(N.ResourceOperationKind=QR={}));var ZR;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(ZR||(N.FailureHandlingKind=ZR={}));var eP;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(eP||(N.PositionEncodingKind=eP={}));var tP;(function(t){function e(r){let n=r;return n&&Vt.string(n.id)&&n.id.length>0}t.hasId=e})(tP||(N.StaticRegistrationOptions=tP={}));var rP;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Qg.is(n.documentSelector))}t.is=e})(rP||(N.TextDocumentRegistrationOptions=rP={}));var nP;(function(t){function e(n){let i=n;return Vt.objectLiteral(i)&&(i.workDoneProgress===void 0||Vt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Vt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(nP||(N.WorkDoneProgressOptions=nP={}));var iP;(function(t){t.method="initialize",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(iP||(N.InitializeRequest=iP={}));var sP;(function(t){t.unknownProtocolVersion=1})(sP||(N.InitializeErrorCodes=sP={}));var oP;(function(t){t.method="initialized",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(oP||(N.InitializedNotification=oP={}));var aP;(function(t){t.method="shutdown",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType0(t.method)})(aP||(N.ShutdownRequest=aP={}));var cP;(function(t){t.method="exit",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType0(t.method)})(cP||(N.ExitNotification=cP={}));var lP;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(lP||(N.DidChangeConfigurationNotification=lP={}));var uP;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(uP||(N.MessageType=uP={}));var dP;(function(t){t.method="window/showMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(dP||(N.ShowMessageNotification=dP={}));var fP;(function(t){t.method="window/showMessageRequest",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType(t.method)})(fP||(N.ShowMessageRequest=fP={}));var pP;(function(t){t.method="window/logMessage",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(pP||(N.LogMessageNotification=pP={}));var hP;(function(t){t.method="telemetry/event",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(hP||(N.TelemetryEventNotification=hP={}));var mP;(function(t){t.None=0,t.Full=1,t.Incremental=2})(mP||(N.TextDocumentSyncKind=mP={}));var gP;(function(t){t.method="textDocument/didOpen",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(gP||(N.DidOpenTextDocumentNotification=gP={}));var yP;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(yP||(N.TextDocumentContentChangeEvent=yP={}));var vP;(function(t){t.method="textDocument/didChange",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(vP||(N.DidChangeTextDocumentNotification=vP={}));var TP;(function(t){t.method="textDocument/didClose",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(TP||(N.DidCloseTextDocumentNotification=TP={}));var bP;(function(t){t.method="textDocument/didSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(bP||(N.DidSaveTextDocumentNotification=bP={}));var _P;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(_P||(N.TextDocumentSaveReason=_P={}));var SP;(function(t){t.method="textDocument/willSave",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(SP||(N.WillSaveTextDocumentNotification=SP={}));var NP;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(NP||(N.WillSaveTextDocumentWaitUntilRequest=NP={}));var RP;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolNotificationType(t.method)})(RP||(N.DidChangeWatchedFilesNotification=RP={}));var PP;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(PP||(N.FileChangeType=PP={}));var kP;(function(t){function e(r){let n=r;return Vt.objectLiteral(n)&&(KR.URI.is(n.baseUri)||KR.WorkspaceFolder.is(n.baseUri))&&Vt.string(n.pattern)}t.is=e})(kP||(N.RelativePattern=kP={}));var EP;(function(t){t.Create=1,t.Change=2,t.Delete=4})(EP||(N.WatchKind=EP={}));var wP;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolNotificationType(t.method)})(wP||(N.PublishDiagnosticsNotification=wP={}));var CP;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(CP||(N.CompletionTriggerKind=CP={}));var DP;(function(t){t.method="textDocument/completion",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(DP||(N.CompletionRequest=DP={}));var AP;(function(t){t.method="completionItem/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(AP||(N.CompletionResolveRequest=AP={}));var IP;(function(t){t.method="textDocument/hover",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(IP||(N.HoverRequest=IP={}));var OP;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(OP||(N.SignatureHelpTriggerKind=OP={}));var xP;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(xP||(N.SignatureHelpRequest=xP={}));var MP;(function(t){t.method="textDocument/definition",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(MP||(N.DefinitionRequest=MP={}));var qP;(function(t){t.method="textDocument/references",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(qP||(N.ReferencesRequest=qP={}));var LP;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(LP||(N.DocumentHighlightRequest=LP={}));var $P;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})($P||(N.DocumentSymbolRequest=$P={}));var BP;(function(t){t.method="textDocument/codeAction",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(BP||(N.CodeActionRequest=BP={}));var FP;(function(t){t.method="codeAction/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(FP||(N.CodeActionResolveRequest=FP={}));var jP;(function(t){t.method="workspace/symbol",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(jP||(N.WorkspaceSymbolRequest=jP={}));var UP;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(UP||(N.WorkspaceSymbolResolveRequest=UP={}));var HP;(function(t){t.method="textDocument/codeLens",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(HP||(N.CodeLensRequest=HP={}));var VP;(function(t){t.method="codeLens/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(VP||(N.CodeLensResolveRequest=VP={}));var zP;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType0(t.method)})(zP||(N.CodeLensRefreshRequest=zP={}));var WP;(function(t){t.method="textDocument/documentLink",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(WP||(N.DocumentLinkRequest=WP={}));var GP;(function(t){t.method="documentLink/resolve",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(GP||(N.DocumentLinkResolveRequest=GP={}));var YP;(function(t){t.method="textDocument/formatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(YP||(N.DocumentFormattingRequest=YP={}));var KP;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(KP||(N.DocumentRangeFormattingRequest=KP={}));var XP;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(XP||(N.DocumentRangesFormattingRequest=XP={}));var JP;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(JP||(N.DocumentOnTypeFormattingRequest=JP={}));var QP;(function(t){t.Identifier=1})(QP||(N.PrepareSupportDefaultBehavior=QP={}));var ZP;(function(t){t.method="textDocument/rename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(ZP||(N.RenameRequest=ZP={}));var ek;(function(t){t.method="textDocument/prepareRename",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(ek||(N.PrepareRenameRequest=ek={}));var tk;(function(t){t.method="workspace/executeCommand",t.messageDirection=V.MessageDirection.clientToServer,t.type=new V.ProtocolRequestType(t.method)})(tk||(N.ExecuteCommandRequest=tk={}));var rk;(function(t){t.method="workspace/applyEdit",t.messageDirection=V.MessageDirection.serverToClient,t.type=new V.ProtocolRequestType("workspace/applyEdit")})(rk||(N.ApplyWorkspaceEditRequest=rk={}))});var lk=R(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.createProtocolConnection=void 0;var ck=qs();function RF(t,e,r,n){return ck.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,ck.createMessageConnection)(t,e,r,n)}Nd.createProtocolConnection=RF});var dk=R(Er=>{"use strict";var PF=Er&&Er.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rd=Er&&Er.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PF(e,t,r)};Object.defineProperty(Er,"__esModule",{value:!0});Er.LSPErrorCodes=Er.createProtocolConnection=void 0;Rd(qs(),Er);Rd(ad(),Er);Rd(Tt(),Er);Rd(ak(),Er);var kF=lk();Object.defineProperty(Er,"createProtocolConnection",{enumerable:!0,get:function(){return kF.createProtocolConnection}});var uk;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(uk||(Er.LSPErrorCodes=uk={}))});var wt=R(Gn=>{"use strict";var EF=Gn&&Gn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fk=Gn&&Gn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EF(e,t,r)};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createProtocolConnection=void 0;var wF=jg();fk(jg(),Gn);fk(dk(),Gn);function CF(t,e,r,n){return(0,wF.createMessageConnection)(t,e,r,n)}Gn.createProtocolConnection=CF});var iy=R(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.generateUuid=Qr.parse=Qr.isUUID=Qr.v4=Qr.empty=void 0;var lc=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},uc=class t extends lc{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};uc._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];uc._timeHighBits=["8","9","a","b"];Qr.empty=new lc("00000000-0000-0000-0000-000000000000");function pk(){return new uc}Qr.v4=pk;var DF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hk(t){return DF.test(t)}Qr.isUUID=hk;function AF(t){if(!hk(t))throw new Error("invalid uuid");return new lc(t)}Qr.parse=AF;function IF(){return pk().asHex()}Qr.generateUuid=IF});var mk=R(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.attachPartialResult=Wi.ProgressFeature=Wi.attachWorkDone=void 0;var zi=wt(),OF=iy(),$s=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(zi.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(zi.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(zi.WorkDoneProgress.type,this._token,{kind:"end"})}};$s.Instances=new Map;var Pd=class extends $s{constructor(e,r){super(e,r),this._source=new zi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},dc=class{constructor(){}begin(){}report(){}done(){}},kd=class extends dc{constructor(){super(),this._source=new zi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function xF(t,e){if(e===void 0||e.workDoneToken===void 0)return new dc;let r=e.workDoneToken;return delete e.workDoneToken,new $s(t,r)}Wi.attachWorkDone=xF;var MF=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(zi.WorkDoneProgressCancelNotification.type,r=>{let n=$s.Instances.get(r.token);(n instanceof Pd||n instanceof kd)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new dc:new $s(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,OF.generateUuid)();return this.connection.sendRequest(zi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Pd(this.connection,e))}else return Promise.resolve(new kd)}};Wi.ProgressFeature=MF;var sy;(function(t){t.type=new zi.ProgressType})(sy||(sy={}));var oy=class{constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(sy.type,this._token,e)}};function qF(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new oy(t,r)}Wi.attachPartialResult=qF});var gk=R(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.ConfigurationFeature=void 0;var LF=wt(),$F=$u(),BF=t=>class extends t{getConfiguration(e){return e?$F.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(LF.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Ed.ConfigurationFeature=BF});var yk=R(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.WorkspaceFoldersFeature=void 0;var wd=wt(),FF=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new wd.Emitter,this.connection.onNotification(wd.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(wd.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(wd.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Cd.WorkspaceFoldersFeature=FF});var vk=R(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.CallHierarchyFeature=void 0;var ay=wt(),jF=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ay.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=ay.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=ay.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Dd.CallHierarchyFeature=jF});var ly=R(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.SemanticTokensBuilder=Gi.SemanticTokensDiff=Gi.SemanticTokensFeature=void 0;var Ad=wt(),UF=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ad.SemanticTokensRefreshRequest.type),on:e=>{let r=Ad.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Ad.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Ad.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Gi.SemanticTokensFeature=UF;var Id=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n<r&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<r&&n<e){let i=e-1,s=r-1;for(;i>=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<n||s<n)&&(i++,s++);let o=i-n+1,a=this.modifiedSequence.slice(n,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:a}]}else return n<r?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};Gi.SemanticTokensDiff=Id;var cy=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,r,n,i,s){let o=e,a=r;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++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}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 Id(this._prevData,this._data).computeDiff()}:this.build()}};Gi.SemanticTokensBuilder=cy});var Tk=R(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.ShowDocumentFeature=void 0;var HF=wt(),VF=t=>class extends t{showDocument(e){return this.connection.sendRequest(HF.ShowDocumentRequest.type,e)}};Od.ShowDocumentFeature=VF});var bk=R(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.FileOperationsFeature=void 0;var Bo=wt(),zF=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Bo.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Bo.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Bo.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Bo.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Bo.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Bo.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};xd.FileOperationsFeature=zF});var _k=R(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.LinkedEditingRangeFeature=void 0;var WF=wt(),GF=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(WF.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Md.LinkedEditingRangeFeature=GF});var Sk=R(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.TypeHierarchyFeature=void 0;var uy=wt(),YF=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(uy.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=uy.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=uy.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};qd.TypeHierarchyFeature=YF});var Rk=R(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.InlineValueFeature=void 0;var Nk=wt(),KF=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Nk.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Nk.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Ld.InlineValueFeature=KF});var kk=R($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.FoldingRangeFeature=void 0;var Pk=wt(),XF=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Pk.FoldingRangeRefreshRequest.type),on:e=>{let r=Pk.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};$d.FoldingRangeFeature=XF});var Ek=R(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.InlayHintFeature=void 0;var dy=wt(),JF=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(dy.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(dy.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(dy.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Bd.InlayHintFeature=JF});var wk=R(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.DiagnosticFeature=void 0;var fc=wt(),QF=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(fc.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(fc.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(fc.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(fc.WorkspaceDiagnosticRequest.partialResult,r)))}}};Fd.DiagnosticFeature=QF});var py=R(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.TextDocuments=void 0;var Bs=wt(),fy=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Bs.Emitter,this._onDidOpen=new Bs.Emitter,this._onDidClose=new Bs.Emitter,this._onDidSave=new Bs.Emitter,this._onWillSave=new Bs.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=Bs.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),Bs.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};jd.TextDocuments=fy});var my=R(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.NotebookDocuments=Fo.NotebookSyncFeature=void 0;var Zr=wt(),Ck=py(),ZF=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Zr.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Zr.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Zr.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Zr.DidCloseNotebookDocumentNotification.type,r=>{e(r)})}}};Fo.NotebookSyncFeature=ZF;var Ud=class t{onDidOpenTextDocument(e){return this.openHandler=e,Zr.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Zr.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Zr.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Ud.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var hy=class{constructor(e){e instanceof Ck.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Ck.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Zr.Emitter,this._onDidChange=new Zr.Emitter,this._onDidSave=new Zr.Emitter,this._onDidClose=new Zr.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[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 r=new Ud,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,c=i.change;c.metadata!==void 0&&(a=!0,s.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let S=c.cells;if(S.structure!==void 0){let _=S.structure.array;if(s.cells.splice(_.start,_.deleteCount,..._.cells!==void 0?_.cells:[]),S.structure.didOpen!==void 0)for(let T of S.structure.didOpen)r.openTextDocument({textDocument:T}),l.push(T.uri);if(S.structure.didClose)for(let T of S.structure.didClose)r.closeTextDocument({textDocument:T}),u.push(T.uri)}if(S.data!==void 0){let _=new Map(S.data.map(T=>[T.document,T]));for(let T=0;T<=s.cells.length;T++){let P=_.get(s.cells[T].document);if(P!==void 0){let C=s.cells.splice(T,1,P);if(d.push({old:C[0],new:P}),_.delete(P.document),_.size===0)break}}}if(S.textContent!==void 0)for(let _ of S.textContent)r.changeTextDocument({textDocument:_.document,contentChanges:_.changes}),f.push(_.document.uri)}this.updateCellMap(s);let p={notebookDocument:s};a&&(p.metadata={old:o,new:s.metadata});let g=[];for(let S of l)g.push(this.getNotebookCell(S));let h=[];for(let S of u)h.push(this.getNotebookCell(S));let v=[];for(let S of f)v.push(this.getNotebookCell(S));(g.length>0||h.length>0||d.length>0||v.length>0)&&(p.cells={added:g,removed:h,changed:{data:d,textContent:v}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Zr.Disposable.create(()=>{n.forEach(i=>i.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Fo.NotebookDocuments=hy});var Dk=R(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.MonikerFeature=void 0;var ej=wt(),tj=t=>class extends t{get moniker(){return{on:e=>{let r=ej.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Hd.MonikerFeature=tj});var _y=R(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.createConnection=Fe.combineFeatures=Fe.combineNotebooksFeatures=Fe.combineLanguagesFeatures=Fe.combineWorkspaceFeatures=Fe.combineWindowFeatures=Fe.combineClientFeatures=Fe.combineTracerFeatures=Fe.combineTelemetryFeatures=Fe.combineConsoleFeatures=Fe._NotebooksImpl=Fe._LanguagesImpl=Fe.BulkUnregistration=Fe.BulkRegistration=Fe.ErrorMessageTracker=void 0;var K=wt(),en=$u(),yy=iy(),he=mk(),rj=gk(),nj=yk(),ij=vk(),sj=ly(),oj=Tk(),aj=bk(),cj=_k(),lj=Sk(),uj=Rk(),dj=kk(),fj=Ek(),pj=wk(),hj=my(),mj=Dk();function gy(t){if(t!==null)return t}var vy=class{constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Fe.ErrorMessageTracker=vy;var Vd=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(K.MessageType.Error,e)}warn(e){this.send(K.MessageType.Warning,e)}info(e){this.send(K.MessageType.Info,e)}log(e){this.send(K.MessageType.Log,e)}debug(e){this.send(K.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(K.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,K.RAL)().console.error("Sending log message failed")})}},Ty=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,...r){let n={type:K.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(gy)}showWarningMessage(e,...r){let n={type:K.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(gy)}showInformationMessage(e,...r){let n={type:K.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(K.ShowMessageRequest.type,n).then(gy)}},Ak=(0,oj.ShowDocumentFeature)((0,he.ProgressFeature)(Ty)),Ik;(function(t){function e(){return new zd}t.create=e})(Ik||(Fe.BulkRegistration=Ik={}));var zd=class{constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=en.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=yy.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Ok;(function(t){function e(){return new pc(void 0,[])}t.create=e})(Ok||(Fe.BulkUnregistration=Ok={}));var pc=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(K.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=en.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let i={unregisterations:[n]};return this._connection.sendRequest(K.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},Wd=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,r,n){return e instanceof zd?this.registerMany(e):e instanceof pc?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=en.string(r)?r:r.method,s=yy.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(K.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=en.string(e)?e:e.method,i=yy.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(K.RegistrationRequest.type,s).then(o=>K.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(K.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(K.RegistrationRequest.type,r).then(()=>new pc(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},by=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 r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(K.ApplyWorkspaceEditRequest.type,n)}},xk=(0,aj.FileOperationsFeature)((0,nj.WorkspaceFoldersFeature)((0,rj.ConfigurationFeature)(by))),Gd=class{constructor(){this._trace=K.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,r){this._trace!==K.Trace.Off&&this.connection.sendNotification(K.LogTraceNotification.type,{message:e,verbose:this._trace===K.Trace.Verbose?r:void 0}).catch(()=>{})}},Yd=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(K.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Kd=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Fe._LanguagesImpl=Kd;var Mk=(0,dj.FoldingRangeFeature)((0,mj.MonikerFeature)((0,pj.DiagnosticFeature)((0,fj.InlayHintFeature)((0,uj.InlineValueFeature)((0,lj.TypeHierarchyFeature)((0,cj.LinkedEditingRangeFeature)((0,sj.SemanticTokensFeature)((0,ij.CallHierarchyFeature)(Kd))))))))),Xd=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,he.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,he.attachPartialResult)(this.connection,r)}};Fe._NotebooksImpl=Xd;var qk=(0,hj.NotebookSyncFeature)(Xd);function Lk(t,e){return function(r){return e(t(r))}}Fe.combineConsoleFeatures=Lk;function $k(t,e){return function(r){return e(t(r))}}Fe.combineTelemetryFeatures=$k;function Bk(t,e){return function(r){return e(t(r))}}Fe.combineTracerFeatures=Bk;function Fk(t,e){return function(r){return e(t(r))}}Fe.combineClientFeatures=Fk;function jk(t,e){return function(r){return e(t(r))}}Fe.combineWindowFeatures=jk;function Uk(t,e){return function(r){return e(t(r))}}Fe.combineWorkspaceFeatures=Uk;function Hk(t,e){return function(r){return e(t(r))}}Fe.combineLanguagesFeatures=Hk;function Vk(t,e){return function(r){return e(t(r))}}Fe.combineNotebooksFeatures=Vk;function gj(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:r(t.console,e.console,Lk),tracer:r(t.tracer,e.tracer,Bk),telemetry:r(t.telemetry,e.telemetry,$k),client:r(t.client,e.client,Fk),window:r(t.window,e.window,jk),workspace:r(t.workspace,e.workspace,Uk),languages:r(t.languages,e.languages,Hk),notebooks:r(t.notebooks,e.notebooks,Vk)}}Fe.combineFeatures=gj;function yj(t,e,r){let n=r&&r.console?new(r.console(Vd)):new Vd,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(Gd)):new Gd,o=r&&r.telemetry?new(r.telemetry(Yd)):new Yd,a=r&&r.client?new(r.client(Wd)):new Wd,c=r&&r.window?new(r.window(Ak)):new Ak,l=r&&r.workspace?new(r.workspace(xk)):new xk,u=r&&r.languages?new(r.languages(Mk)):new Mk,d=r&&r.notebooks?new(r.notebooks(qk)):new qk,f=[n,s,o,a,c,l,u,d];function p(_){return _ instanceof Promise?_:en.thenable(_)?new Promise((T,P)=>{_.then(C=>T(C),C=>P(C))}):Promise.resolve(_)}let g,h,v,S={listen:()=>i.listen(),sendRequest:(_,...T)=>i.sendRequest(en.string(_)?_:_.method,...T),onRequest:(_,T)=>i.onRequest(_,T),sendNotification:(_,T)=>{let P=en.string(_)?_:_.method;return i.sendNotification(P,T)},onNotification:(_,T)=>i.onNotification(_,T),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:_=>(h=_,{dispose:()=>{h=void 0}}),onInitialized:_=>i.onNotification(K.InitializedNotification.type,_),onShutdown:_=>(g=_,{dispose:()=>{g=void 0}}),onExit:_=>(v=_,{dispose:()=>{v=void 0}}),get console(){return n},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:_=>i.onNotification(K.DidChangeConfigurationNotification.type,_),onDidChangeWatchedFiles:_=>i.onNotification(K.DidChangeWatchedFilesNotification.type,_),__textDocumentSync:void 0,onDidOpenTextDocument:_=>i.onNotification(K.DidOpenTextDocumentNotification.type,_),onDidChangeTextDocument:_=>i.onNotification(K.DidChangeTextDocumentNotification.type,_),onDidCloseTextDocument:_=>i.onNotification(K.DidCloseTextDocumentNotification.type,_),onWillSaveTextDocument:_=>i.onNotification(K.WillSaveTextDocumentNotification.type,_),onWillSaveTextDocumentWaitUntil:_=>i.onRequest(K.WillSaveTextDocumentWaitUntilRequest.type,_),onDidSaveTextDocument:_=>i.onNotification(K.DidSaveTextDocumentNotification.type,_),sendDiagnostics:_=>i.sendNotification(K.PublishDiagnosticsNotification.type,_),onHover:_=>i.onRequest(K.HoverRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),onCompletion:_=>i.onRequest(K.CompletionRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCompletionResolve:_=>i.onRequest(K.CompletionResolveRequest.type,_),onSignatureHelp:_=>i.onRequest(K.SignatureHelpRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),onDeclaration:_=>i.onRequest(K.DeclarationRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDefinition:_=>i.onRequest(K.DefinitionRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onTypeDefinition:_=>i.onRequest(K.TypeDefinitionRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onImplementation:_=>i.onRequest(K.ImplementationRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onReferences:_=>i.onRequest(K.ReferencesRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentHighlight:_=>i.onRequest(K.DocumentHighlightRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentSymbol:_=>i.onRequest(K.DocumentSymbolRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onWorkspaceSymbol:_=>i.onRequest(K.WorkspaceSymbolRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onWorkspaceSymbolResolve:_=>i.onRequest(K.WorkspaceSymbolResolveRequest.type,_),onCodeAction:_=>i.onRequest(K.CodeActionRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCodeActionResolve:_=>i.onRequest(K.CodeActionResolveRequest.type,(T,P)=>_(T,P)),onCodeLens:_=>i.onRequest(K.CodeLensRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onCodeLensResolve:_=>i.onRequest(K.CodeLensResolveRequest.type,(T,P)=>_(T,P)),onDocumentFormatting:_=>i.onRequest(K.DocumentFormattingRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),onDocumentRangeFormatting:_=>i.onRequest(K.DocumentRangeFormattingRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),onDocumentOnTypeFormatting:_=>i.onRequest(K.DocumentOnTypeFormattingRequest.type,(T,P)=>_(T,P)),onRenameRequest:_=>i.onRequest(K.RenameRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),onPrepareRename:_=>i.onRequest(K.PrepareRenameRequest.type,(T,P)=>_(T,P)),onDocumentLinks:_=>i.onRequest(K.DocumentLinkRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onDocumentLinkResolve:_=>i.onRequest(K.DocumentLinkResolveRequest.type,(T,P)=>_(T,P)),onDocumentColor:_=>i.onRequest(K.DocumentColorRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onColorPresentation:_=>i.onRequest(K.ColorPresentationRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onFoldingRanges:_=>i.onRequest(K.FoldingRangeRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onSelectionRanges:_=>i.onRequest(K.SelectionRangeRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),(0,he.attachPartialResult)(i,T))),onExecuteCommand:_=>i.onRequest(K.ExecuteCommandRequest.type,(T,P)=>_(T,P,(0,he.attachWorkDone)(i,T),void 0)),dispose:()=>i.dispose()};for(let _ of f)_.attach(S);return i.onRequest(K.InitializeRequest.type,_=>{e.initialize(_),en.string(_.trace)&&(s.trace=K.Trace.fromString(_.trace));for(let T of f)T.initialize(_.capabilities);if(h){let T=h(_,new K.CancellationTokenSource().token,(0,he.attachWorkDone)(i,_),void 0);return p(T).then(P=>{if(P instanceof K.ResponseError)return P;let C=P;C||(C={capabilities:{}});let $=C.capabilities;$||($={},C.capabilities=$),$.textDocumentSync===void 0||$.textDocumentSync===null?$.textDocumentSync=en.number(S.__textDocumentSync)?S.__textDocumentSync:K.TextDocumentSyncKind.None:!en.number($.textDocumentSync)&&!en.number($.textDocumentSync.change)&&($.textDocumentSync.change=en.number(S.__textDocumentSync)?S.__textDocumentSync:K.TextDocumentSyncKind.None);for(let F of f)F.fillServerCapabilities($);return C})}else{let T={capabilities:{textDocumentSync:K.TextDocumentSyncKind.None}};for(let P of f)P.fillServerCapabilities(T.capabilities);return T}}),i.onRequest(K.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,g)return g(new K.CancellationTokenSource().token)}),i.onNotification(K.ExitNotification.type,()=>{try{v&&v()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(K.SetTraceNotification.type,_=>{s.trace=K.Trace.fromString(_.value)}),S}Fe.createConnection=yj});var zk=R(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.resolveModulePath=wr.FileSystem=wr.resolveGlobalYarnPath=wr.resolveGlobalNodePath=wr.resolve=wr.uriToFilePath=void 0;var vj=require("url"),En=require("path"),Sy=require("fs"),ky=require("child_process");function Tj(t){let e=vj.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n<i;n++)r[n]=decodeURIComponent(r[n]);if(process.platform==="win32"&&r.length>1){let s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift()}return En.normalize(r.join("/"))}wr.uriToFilePath=Tj;function Ny(){return process.platform==="win32"}function Jd(t,e,r,n){let i="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&&Sy.existsSync(e)&&(l[i]?l[i]=e+En.delimiter+l[i]:l[i]=e,n&&n(`NODE_PATH value is: ${l[i]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,ky.fork)("",[],{cwd:r,env:l,execArgv:["-e",s]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} 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: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}wr.resolve=Jd;function Ry(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};Ny()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,ky.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?Ny()?En.join(o,"node_modules"):En.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}wr.resolveGlobalNodePath=Ry;function bj(t){let e="yarn",r={encoding:"utf8"};Ny()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0,ky.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.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 En.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}wr.resolveGlobalYarnPath=bj;var Py;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Sy.existsSync(__filename.toUpperCase())||!Sy.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?En.normalize(s).indexOf(En.normalize(i))===0:En.normalize(s).toLowerCase().indexOf(En.normalize(i).toLowerCase())===0}t.isParent=n})(Py||(wr.FileSystem=Py={}));function _j(t,e,r,n){return r?(En.isAbsolute(r)||(r=En.join(t,r)),Jd(e,r,r,n).then(i=>Py.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Jd(e,Ry(n),t,n))):Jd(e,Ry(n),t,n)}wr.resolveModulePath=_j});var Ey=R((aQ,Wk)=>{"use strict";Wk.exports=wt()});var Gk=R(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.InlineCompletionFeature=void 0;var Sj=wt(),Nj=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(Sj.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Qd.InlineCompletionFeature=Nj});var Xk=R(cr=>{"use strict";var Rj=cr&&cr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Kk=cr&&cr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rj(e,t,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.ProposedFeatures=cr.NotebookDocuments=cr.TextDocuments=cr.SemanticTokensBuilder=void 0;var Pj=ly();Object.defineProperty(cr,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Pj.SemanticTokensBuilder}});var kj=Gk();Kk(wt(),cr);var Ej=py();Object.defineProperty(cr,"TextDocuments",{enumerable:!0,get:function(){return Ej.TextDocuments}});var wj=my();Object.defineProperty(cr,"NotebookDocuments",{enumerable:!0,get:function(){return wj.NotebookDocuments}});Kk(_y(),cr);var Yk;(function(t){t.all={__brand:"features",languages:kj.InlineCompletionFeature}})(Yk||(cr.ProposedFeatures=Yk={}))});var j=R(tn=>{"use strict";var Cj=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eE=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cj(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});tn.createConnection=tn.Files=void 0;var Jk=require("node:util"),wy=$u(),Dj=_y(),hc=zk(),Fs=Ey();eE(Ey(),tn);eE(Xk(),tn);var Qk;(function(t){t.uriToFilePath=hc.uriToFilePath,t.resolveGlobalNodePath=hc.resolveGlobalNodePath,t.resolveGlobalYarnPath=hc.resolveGlobalYarnPath,t.resolve=hc.resolve,t.resolveModulePath=hc.resolveModulePath})(Qk||(tn.Files=Qk={}));var Zk;function Zd(){if(Zk!==void 0)try{Zk.end()}catch{}}var jo=!1,tE;function Aj(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(tE=setInterval(()=>{try{process.kill(n,0)}catch{Zd(),process.exit(jo?0:1)}},3e3))}catch{}}for(let r=2;r<process.argv.length;r++){let n=process.argv[r];if(n===t&&r+1<process.argv.length){e(process.argv[r+1]);return}else{let i=n.split("=");i[0]===t&&e(i[1])}}}Aj();var Ij={initialize:t=>{let e=t.processId;wy.number(e)&&tE===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(jo?0:1)}},3e3)},get shutdownReceived(){return jo},set shutdownReceived(t){jo=t},exit:t=>{Zd(),process.exit(t)}};function Oj(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),Fs.ConnectionStrategy.is(t)||Fs.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),xj(s,o,a,i)}tn.createConnection=Oj;function xj(t,e,r,n){let i=!1;if(!t&&!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"){t=new Fs.IPCMessageReader(process),e=new Fs.IPCMessageWriter(process);break}else if(f==="--stdio"){i=!0,t=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 s=f.split("=");if(s[0]==="--socket"){c=parseInt(s[1]);break}else if(s[0]==="--pipe"){l=s[1];break}}}if(c){let d=(0,Fs.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,Fs.createServerPipeTransport)(l);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(wy.func(t.read)&&wy.func(t.on)){let c=t;c.on("end",()=>{Zd(),process.exit(jo?0:1)}),c.on("close",()=>{Zd(),process.exit(jo?0:1)})}let a=c=>{let l=(0,Fs.createProtocolConnection)(t,e,c,r);return i&&Mj(c),l};return(0,Dj.createConnection)(a,Ij,n)}function Mj(t){function e(n){return n.map(i=>typeof i=="string"?i:(0,Jk.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=r.get(s)??0;o+=1,r.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Jk.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
|
|
37
|
+
${s}`)},console.warn=function(...i){t.warn(e(i))}}});var nE=R((fQ,rE)=>{"use strict";rE.exports=j()});var zI=R((TSe,VI)=>{"use strict";VI.exports=UI;function UI(t,e,r){t instanceof RegExp&&(t=jI(t,r)),e instanceof RegExp&&(e=jI(e,r));var n=HI(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function jI(t,e){var r=e.match(t);return r?r[0]:null}UI.range=HI;function HI(t,e,r){var n,i,s,o,a,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(n=[],s=r.length;u>=0&&!a;)u==c?(n.push(u),c=r.indexOf(t,u+1)):n.length==1?a=[n.pop(),l]:(i=n.pop(),i<s&&(s=i,o=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;n.length&&(a=[s,o])}return a}});var ZI=R((bSe,QI)=>{var WI=zI();QI.exports=XU;var GI="\0SLASH"+Math.random()+"\0",YI="\0OPEN"+Math.random()+"\0",fv="\0CLOSE"+Math.random()+"\0",KI="\0COMMA"+Math.random()+"\0",XI="\0PERIOD"+Math.random()+"\0";function dv(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function YU(t){return t.split("\\\\").join(GI).split("\\{").join(YI).split("\\}").join(fv).split("\\,").join(KI).split("\\.").join(XI)}function KU(t){return t.split(GI).join("\\").split(YI).join("{").split(fv).join("}").split(KI).join(",").split(XI).join(".")}function JI(t){if(!t)return[""];var e=[],r=WI("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var a=JI(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function XU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Wc(YU(t),!0).map(KU)):[]}function JU(t){return"{"+t+"}"}function QU(t){return/^-?0\d/.test(t)}function ZU(t,e){return t<=e}function eH(t,e){return t>=e}function Wc(t,e){var r=[],n=WI("{","}",t);if(!n)return[t];var i=n.pre,s=n.post.length?Wc(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var a=i+"{"+n.body+"}"+s[o];r.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=c||l,d=n.body.indexOf(",")>=0;if(!u&&!d)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+fv+n.post,Wc(t)):[t];var f;if(u)f=n.body.split(/\.\./);else if(f=JI(n.body),f.length===1&&(f=Wc(f[0],!1).map(JU),f.length===1))return s.map(function(Xe){return n.pre+f[0]+Xe});var p;if(u){var g=dv(f[0]),h=dv(f[1]),v=Math.max(f[0].length,f[1].length),S=f.length==3?Math.abs(dv(f[2])):1,_=ZU,T=h<g;T&&(S*=-1,_=eH);var P=f.some(QU);p=[];for(var C=g;_(C,h);C+=S){var $;if(l)$=String.fromCharCode(C),$==="\\"&&($="");else if($=String(C),P){var F=v-$.length;if(F>0){var U=new Array(F+1).join("0");C<0?$="-"+U+$.slice(1):$=U+$}}p.push($)}}else{p=[];for(var me=0;me<f.length;me++)p.push.apply(p,Wc(f[me],!1))}for(var me=0;me<p.length;me++)for(var o=0;o<s.length;o++){var a=i+p[me]+s[o];(!e||u||a)&&r.push(a)}}return r}});var xe=R(rr=>{"use strict";var Dv=Symbol.for("yaml.alias"),FO=Symbol.for("yaml.document"),Hp=Symbol.for("yaml.map"),jO=Symbol.for("yaml.pair"),Av=Symbol.for("yaml.scalar"),Vp=Symbol.for("yaml.seq"),wi=Symbol.for("yaml.node.type"),cV=t=>!!t&&typeof t=="object"&&t[wi]===Dv,lV=t=>!!t&&typeof t=="object"&&t[wi]===FO,uV=t=>!!t&&typeof t=="object"&&t[wi]===Hp,dV=t=>!!t&&typeof t=="object"&&t[wi]===jO,UO=t=>!!t&&typeof t=="object"&&t[wi]===Av,fV=t=>!!t&&typeof t=="object"&&t[wi]===Vp;function HO(t){if(t&&typeof t=="object")switch(t[wi]){case Hp:case Vp:return!0}return!1}function pV(t){if(t&&typeof t=="object")switch(t[wi]){case Dv:case Hp:case Av:case Vp:return!0}return!1}var hV=t=>(UO(t)||HO(t))&&!!t.anchor;rr.ALIAS=Dv;rr.DOC=FO;rr.MAP=Hp;rr.NODE_TYPE=wi;rr.PAIR=jO;rr.SCALAR=Av;rr.SEQ=Vp;rr.hasAnchor=hV;rr.isAlias=cV;rr.isCollection=HO;rr.isDocument=lV;rr.isMap=uV;rr.isNode=pV;rr.isPair=dV;rr.isScalar=UO;rr.isSeq=fV});var cl=R(Iv=>{"use strict";var Ut=xe(),xr=Symbol("break visit"),VO=Symbol("skip children"),oi=Symbol("remove node");function zp(t,e){let r=zO(e);Ut.isDocument(t)?Ta(null,t.contents,r,Object.freeze([t]))===oi&&(t.contents=null):Ta(null,t,r,Object.freeze([]))}zp.BREAK=xr;zp.SKIP=VO;zp.REMOVE=oi;function Ta(t,e,r,n){let i=WO(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return GO(t,n,i),Ta(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=Ta(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===xr)return xr;o===oi&&(e.items.splice(s,1),s-=1)}}}else if(Ut.isPair(e)){n=Object.freeze(n.concat(e));let s=Ta("key",e.key,r,n);if(s===xr)return xr;s===oi&&(e.key=null);let o=Ta("value",e.value,r,n);if(o===xr)return xr;o===oi&&(e.value=null)}}return i}async function Wp(t,e){let r=zO(e);Ut.isDocument(t)?await ba(null,t.contents,r,Object.freeze([t]))===oi&&(t.contents=null):await ba(null,t,r,Object.freeze([]))}Wp.BREAK=xr;Wp.SKIP=VO;Wp.REMOVE=oi;async function ba(t,e,r,n){let i=await WO(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return GO(t,n,i),ba(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await ba(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===xr)return xr;o===oi&&(e.items.splice(s,1),s-=1)}}}else if(Ut.isPair(e)){n=Object.freeze(n.concat(e));let s=await ba("key",e.key,r,n);if(s===xr)return xr;s===oi&&(e.key=null);let o=await ba("value",e.value,r,n);if(o===xr)return xr;o===oi&&(e.value=null)}}return i}function zO(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function WO(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ut.isMap(e))return r.Map?.(t,e,n);if(Ut.isSeq(e))return r.Seq?.(t,e,n);if(Ut.isPair(e))return r.Pair?.(t,e,n);if(Ut.isScalar(e))return r.Scalar?.(t,e,n);if(Ut.isAlias(e))return r.Alias?.(t,e,n)}function GO(t,e,r){let n=e[e.length-1];if(Ut.isCollection(n))n.items[t]=r;else if(Ut.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ut.isDocument(n))n.contents=r;else{let i=Ut.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Iv.visit=zp;Iv.visitAsync=Wp});var Ov=R(KO=>{"use strict";var YO=xe(),mV=cl(),gV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},yV=t=>t.replace(/[!,[\]{}]/g,e=>gV[e]),ll=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+yV(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&YO.isNode(e.contents)){let s={};mV.visit(e.contents,(o,a)=>{YO.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
|
|
38
|
+
`)}};ll.defaultYaml={explicit:!1,version:"1.2"};ll.defaultTags={"!!":"tag:yaml.org,2002:"};KO.Directives=ll});var Gp=R(ul=>{"use strict";var XO=xe(),vV=cl();function TV(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function JO(t){let e=new Set;return vV.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function QO(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function bV(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i||(i=JO(t));let o=QO(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(XO.isScalar(o.node)||XO.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:n}}ul.anchorIsValid=TV;ul.anchorNames=JO;ul.createNodeAnchors=bV;ul.findNewAnchor=QO});var xv=R(ZO=>{"use strict";function dl(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],a=dl(t,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=dl(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=dl(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let o=dl(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}ZO.applyReviver=dl});var ds=R(tx=>{"use strict";var _V=xe();function ex(t,e,r){if(Array.isArray(t))return t.map((n,i)=>ex(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!_V.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}tx.toJS=ex});var Yp=R(nx=>{"use strict";var SV=xv(),rx=xe(),NV=ds(),Mv=class{constructor(e){Object.defineProperty(this,rx.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:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!rx.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=NV.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?SV.applyReviver(s,{"":a},"",a):a}};nx.NodeBase=Mv});var fl=R(sx=>{"use strict";var RV=Gp(),ix=cl(),Kp=xe(),PV=Yp(),kV=ds(),qv=class extends PV.NodeBase{constructor(e){super(Kp.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let r;return ix.visit(e,{Node:(n,i)=>{if(i===this)return ix.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(kV.toJS(o,null,r),a=n.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=Xp(i,o,n)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(RV.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`${i} `}return i}};function Xp(t,e,r){if(Kp.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Kp.isCollection(e)){let n=0;for(let i of e.items){let s=Xp(t,i,r);s>n&&(n=s)}return n}else if(Kp.isPair(e)){let n=Xp(t,e.key,r),i=Xp(t,e.value,r);return Math.max(n,i)}return 1}sx.Alias=qv});var $t=R(Lv=>{"use strict";var EV=xe(),wV=Yp(),CV=ds(),DV=t=>!t||typeof t!="function"&&typeof t!="object",fs=class extends wV.NodeBase{constructor(e){super(EV.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:CV.toJS(this.value,e,r)}toString(){return String(this.value)}};fs.BLOCK_FOLDED="BLOCK_FOLDED";fs.BLOCK_LITERAL="BLOCK_LITERAL";fs.PLAIN="PLAIN";fs.QUOTE_DOUBLE="QUOTE_DOUBLE";fs.QUOTE_SINGLE="QUOTE_SINGLE";Lv.Scalar=fs;Lv.isScalarValue=DV});var pl=R(ax=>{"use strict";var AV=fl(),Gs=xe(),ox=$t(),IV="tag:yaml.org,2002:";function OV(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function xV(t,e,r){if(Gs.isDocument(t)&&(t=t.contents),Gs.isNode(t))return t;if(Gs.isPair(t)){let d=r.schema[Gs.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new AV.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=IV+e.slice(2));let l=OV(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new ox.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Gs.MAP]:Symbol.iterator in Object(t)?o[Gs.SEQ]:o[Gs.MAP]}s&&(s(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new ox.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}ax.createNode=xV});var Qp=R(Jp=>{"use strict";var MV=pl(),ai=xe(),qV=Yp();function $v(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return MV.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var cx=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Bv=class extends qV.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>ai.isNode(n)||ai.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(cx(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(ai.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,$v(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ai.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&ai.isScalar(s)?s.value:s:ai.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ai.isPair(r))return!1;let n=r.value;return n==null||e&&ai.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ai.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(ai.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,$v(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Jp.Collection=Bv;Jp.collectionFromPath=$v;Jp.isEmptyPath=cx});var hl=R(Zp=>{"use strict";var LV=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Fv(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var $V=(t,e,r)=>t.endsWith(`
|
|
39
|
+
`)?Fv(r,e):r.includes(`
|
|
40
40
|
`)?`
|
|
41
|
-
`+
|
|
42
|
-
`)r===
|
|
43
|
-
`&&p!==" "){let
|
|
44
|
-
`&&
|
|
45
|
-
${e}${t.slice(0,C)}`:(r===
|
|
46
|
-
${e}${t.slice(
|
|
47
|
-
`);n=e,i=e+1,s=t[i]}return n}
|
|
48
|
-
`){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function
|
|
41
|
+
`+Fv(r,e):(t.endsWith(" ")?"":" ")+r;Zp.indentComment=Fv;Zp.lineComment=$V;Zp.stringifyComment=LV});var ux=R(ml=>{"use strict";var BV="flow",jv="block",eh="quoted";function FV(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let l=[],u={},d=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?l.push(0):d=i-n);let f,p,g=!1,h=-1,v=-1,S=-1;r===jv&&(h=lx(t,h,e.length),h!==-1&&(d=h+c));for(let T;T=t[h+=1];){if(r===eh&&T==="\\"){switch(v=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}S=h}if(T===`
|
|
42
|
+
`)r===jv&&(h=lx(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(T===" "&&p&&p!==" "&&p!==`
|
|
43
|
+
`&&p!==" "){let P=t[h+1];P&&P!==" "&&P!==`
|
|
44
|
+
`&&P!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===eh){for(;p===" "||p===" ";)p=T,T=t[h+=1],g=!0;let P=h>S+1?h-2:v-1;if(u[P])return t;l.push(P),u[P]=!0,d=P+c,f=void 0}else g=!0}p=T}if(g&&a&&a(),l.length===0)return t;o&&o();let _=t.slice(0,l[0]);for(let T=0;T<l.length;++T){let P=l[T],C=l[T+1]||t.length;P===0?_=`
|
|
45
|
+
${e}${t.slice(0,C)}`:(r===eh&&u[P]&&(_+=`${t[P]}\\`),_+=`
|
|
46
|
+
${e}${t.slice(P+1,C)}`)}return _}function lx(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
47
|
+
`);n=e,i=e+1,s=t[i]}return n}ml.FOLD_BLOCK=jv;ml.FOLD_FLOW=BV;ml.FOLD_QUOTED=eh;ml.foldFlowLines=FV});var yl=R(dx=>{"use strict";var Ln=$t(),ps=ux(),rh=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),nh=t=>/^(%|---|\.\.\.)/m.test(t);function jV(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
|
|
48
|
+
`){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function gl(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(nh(t)?" ":""),o="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(a,c);let u=r.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+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<i)c+=1;else{for(o+=r.slice(a,c)+`
|
|
49
49
|
|
|
50
50
|
`;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
|
|
51
|
-
`,c+=2;o+=s,r[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+r.slice(a):r,n?o:
|
|
52
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
53
|
-
${r}`)+"'";return e.implicitKey?n:
|
|
51
|
+
`,c+=2;o+=s,r[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+r.slice(a):r,n?o:ps.foldFlowLines(o,s,ps.FOLD_QUOTED,rh(e,!1))}function Uv(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
52
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return gl(t,e);let r=e.indent||(nh(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
53
|
+
${r}`)+"'";return e.implicitKey?n:ps.foldFlowLines(n,r,ps.FOLD_FLOW,rh(e,!1))}function _a(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=gl;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=Uv:s&&!i?n=gl:n=r?Uv:gl}return n(t,e)}var Hv;try{Hv=new RegExp(`(^|(?<!
|
|
54
54
|
))
|
|
55
55
|
+(?!
|
|
56
|
-
|$)`,"g")}catch{
|
|
56
|
+
|$)`,"g")}catch{Hv=/\n+(?!\n|$)/g}function th({comment:t,type:e,value:r},n,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(r)||/^\s*$/.test(r))return _a(r,n);let l=n.indent||(n.forceBlockIndent||nh(r)?" ":""),u=o==="literal"?!0:o==="folded"||e===Ln.Scalar.BLOCK_FOLDED?!1:e===Ln.Scalar.BLOCK_LITERAL?!0:!jV(r,c,l.length);if(!r)return u?`|
|
|
57
57
|
`:`>
|
|
58
58
|
`;let d,f;for(f=r.length;f>0;--f){let C=r[f-1];if(C!==`
|
|
59
|
-
`&&C!==" "&&C!==" ")break}let p=r.substring(f),
|
|
60
|
-
`);
|
|
61
|
-
`&&(p=p.slice(0,-1)),p=p.replace(
|
|
62
|
-
`)S=v;else break}let _=r.substring(0,S<v?S+1:v);_&&(r=r.substring(_.length),_=_.replace(/\n+/g,`$&${l}`));let
|
|
63
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`)
|
|
64
|
-
${l}${
|
|
65
|
-
${l}${_}${r}${p}`}function
|
|
66
|
-
`)||u&&/[[\]{},]/.test(s))return
|
|
67
|
-
`)?
|
|
68
|
-
`))return
|
|
69
|
-
${c}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:
|
|
70
|
-
${e.indent}${a}`:a}
|
|
71
|
-
${a}:`):(v=`${v}:`,f&&(v+=
|
|
72
|
-
`:"",_){let
|
|
73
|
-
${
|
|
74
|
-
`&&(
|
|
59
|
+
`&&C!==" "&&C!==" ")break}let p=r.substring(f),g=p.indexOf(`
|
|
60
|
+
`);g===-1?d="-":r===p||g!==p.length-1?(d="+",s&&s()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===`
|
|
61
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Hv,`$&${l}`));let h=!1,v,S=-1;for(v=0;v<r.length;++v){let C=r[v];if(C===" ")h=!0;else if(C===`
|
|
62
|
+
`)S=v;else break}let _=r.substring(0,S<v?S+1:v);_&&(r=r.substring(_.length),_=_.replace(/\n+/g,`$&${l}`));let P=(h?l?"2":"1":"")+d;if(t&&(P+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=r.replace(/\n+/g,`
|
|
63
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),$=!1,F=rh(n,!0);o!=="folded"&&e!==Ln.Scalar.BLOCK_FOLDED&&(F.onOverflow=()=>{$=!0});let U=ps.foldFlowLines(`${_}${C}${p}`,l,ps.FOLD_BLOCK,F);if(!$)return`>${P}
|
|
64
|
+
${l}${U}`}return r=r.replace(/\n+/g,`$&${l}`),`|${P}
|
|
65
|
+
${l}${_}${r}${p}`}function UV(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
|
|
66
|
+
`)||u&&/[[\]{},]/.test(s))return _a(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
67
|
+
`)?_a(s,e):th(t,e,r,n);if(!a&&!u&&i!==Ln.Scalar.PLAIN&&s.includes(`
|
|
68
|
+
`))return th(t,e,r,n);if(nh(s)){if(c==="")return e.forceBlockIndent=!0,th(t,e,r,n);if(a&&c===l)return _a(s,e)}let d=s.replace(/\n+/g,`$&
|
|
69
|
+
${c}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:g}=e.doc.schema;if(g.some(f)||p?.some(f))return _a(s,e)}return a?d:ps.foldFlowLines(d,c,ps.FOLD_FLOW,rh(e,!1))}function HV(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;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 i||s?_a(o.value,e):th(o,e,r,n);case Ln.Scalar.QUOTE_DOUBLE:return gl(o.value,e);case Ln.Scalar.QUOTE_SINGLE:return Uv(o.value,e);case Ln.Scalar.PLAIN:return UV(o,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}dx.stringifyString=HV});var vl=R(Vv=>{"use strict";var VV=Gp(),hs=xe(),zV=hl(),WV=yl();function GV(t,e){let r=Object.assign({blockQuote:!0,commentString:zV.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},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function YV(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(hs.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??typeof n;throw new Error(`Tag not resolved for ${i} value`)}return r}function KV(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(hs.isScalar(t)||hs.isCollection(t))&&t.anchor;s&&VV.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function XV(t,e,r,n){if(hs.isPair(t))return t.toString(e,r,n);if(hs.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=hs.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=YV(e.doc.schema.tags,s));let o=KV(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,r,n):hs.isScalar(s)?WV.stringifyString(s,e,r,n):s.toString(e,r,n);return o?hs.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
70
|
+
${e.indent}${a}`:a}Vv.createStringifyContext=GV;Vv.stringify=XV});var mx=R(hx=>{"use strict";var Ci=xe(),fx=$t(),px=vl(),Tl=hl();function JV({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Ci.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Ci.isCollection(t)||!Ci.isNode(t)&&typeof t=="object"){let F="With simple keys, collection cannot be used as a key value";throw new Error(F)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Ci.isCollection(t)||(Ci.isScalar(t)?t.type===fx.Scalar.BLOCK_FOLDED||t.type===fx.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!s),indent:a+c});let g=!1,h=!1,v=px.stringify(t,r,()=>g=!0,()=>h=!0);if(!p&&!r.inFlow&&v.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(s||e==null)return g&&n&&n(),v===""?"?":p?`? ${v}`:v}else if(s&&!d||e==null&&p)return v=`? ${v}`,f&&!g?v+=Tl.lineComment(v,r.indent,l(f)):h&&i&&i(),v;g&&(f=null),p?(f&&(v+=Tl.lineComment(v,r.indent,l(f))),v=`? ${v}
|
|
71
|
+
${a}:`):(v=`${v}:`,f&&(v+=Tl.lineComment(v,r.indent,l(f))));let S,_,T;Ci.isNode(e)?(S=!!e.spaceBefore,_=e.commentBefore,T=e.comment):(S=!1,_=null,T=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!p&&!f&&Ci.isScalar(e)&&(r.indentAtStart=v.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Ci.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let P=!1,C=px.stringify(e,r,()=>P=!0,()=>h=!0),$=" ";if(f||S||_){if($=S?`
|
|
72
|
+
`:"",_){let F=l(_);$+=`
|
|
73
|
+
${Tl.indentComment(F,r.indent)}`}C===""&&!r.inFlow?$===`
|
|
74
|
+
`&&($=`
|
|
75
75
|
|
|
76
|
-
`)
|
|
77
|
-
${r.indent}`}else if(!p&&
|
|
78
|
-
`),me=
|
|
76
|
+
`):$+=`
|
|
77
|
+
${r.indent}`}else if(!p&&Ci.isCollection(e)){let F=C[0],U=C.indexOf(`
|
|
78
|
+
`),me=U!==-1,Xe=r.inFlow??e.flow??e.items.length===0;if(me||!Xe){let Ft=!1;if(me&&(F==="&"||F==="!")){let Ne=C.indexOf(" ");F==="&"&&Ne!==-1&&Ne<U&&C[Ne+1]==="!"&&(Ne=C.indexOf(" ",Ne+1)),(Ne===-1||U<Ne)&&(Ft=!0)}Ft||($=`
|
|
79
79
|
${r.indent}`)}}else(C===""||C[0]===`
|
|
80
|
-
`)&&(
|
|
80
|
+
`)&&($="");return v+=$+C,r.inFlow?P&&n&&n():T&&!P?v+=Tl.lineComment(v,r.indent,l(T)):h&&i&&i(),v}hx.stringifyPair=JV});var Wv=R(zv=>{"use strict";function QV(t,...e){t==="debug"&&console.log(...e)}function ZV(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}zv.debug=QV;zv.warn=ZV});var ah=R(oh=>{"use strict";var bl=xe(),gx=$t(),ih="<<",sh={identify:t=>t===ih||typeof t=="symbol"&&t.description===ih,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new gx.Scalar(Symbol(ih)),{addToJSMap:yx}),stringify:()=>ih},ez=(t,e)=>(sh.identify(e)||bl.isScalar(e)&&(!e.type||e.type===gx.Scalar.PLAIN)&&sh.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===sh.tag&&r.default);function yx(t,e,r){if(r=t&&bl.isAlias(r)?r.resolve(t.doc):r,bl.isSeq(r))for(let n of r.items)Gv(t,e,n);else if(Array.isArray(r))for(let n of r)Gv(t,e,n);else Gv(t,e,r)}function Gv(t,e,r){let n=t&&bl.isAlias(r)?r.resolve(t.doc):r;if(!bl.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)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}oh.addMergeToJSMap=yx;oh.isMergeKey=ez;oh.merge=sh});var Kv=R(bx=>{"use strict";var tz=Wv(),vx=ah(),rz=vl(),Tx=xe(),Yv=ds();function nz(t,e,{key:r,value:n}){if(Tx.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(vx.isMergeKey(t,r))vx.addMergeToJSMap(t,e,n);else{let i=Yv.toJS(r,"",t);if(e instanceof Map)e.set(i,Yv.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=iz(r,i,t),o=Yv.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function iz(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Tx.isNode(t)&&r?.doc){let n=rz.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),tz.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}bx.addPairToJSMap=nz});var ms=R(Xv=>{"use strict";var _x=pl(),sz=mx(),oz=Kv(),ch=xe();function az(t,e,r){let n=_x.createNode(t,void 0,r),i=_x.createNode(e,void 0,r);return new lh(n,i)}var lh=class t{constructor(e,r=null){Object.defineProperty(this,ch.NODE_TYPE,{value:ch.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return ch.isNode(r)&&(r=r.clone(e)),ch.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return oz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?sz.stringifyPair(this,e,r,n):JSON.stringify(this)}};Xv.Pair=lh;Xv.createPair=az});var Jv=R(Nx=>{"use strict";var Ys=xe(),Sx=vl(),uh=hl();function cz(t,e,r){return(e.inFlow??t.flow?uz:lz)(t,e,r)}function lz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:s,type:null}),d=!1,f=[];for(let g=0;g<e.length;++g){let h=e[g],v=null;if(Ys.isNode(h))!d&&h.spaceBefore&&f.push(""),dh(r,f,h.commentBefore,d),h.comment&&(v=h.comment);else if(Ys.isPair(h)){let _=Ys.isNode(h.key)?h.key:null;_&&(!d&&_.spaceBefore&&f.push(""),dh(r,f,_.commentBefore,d))}d=!1;let S=Sx.stringify(h,u,()=>v=null,()=>d=!0);v&&(S+=uh.lineComment(S,s,l(v))),d&&v&&(d=!1),f.push(n+S)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;g<f.length;++g){let h=f[g];p+=h?`
|
|
81
81
|
${c}${h}`:`
|
|
82
82
|
`}}return t?(p+=`
|
|
83
|
-
`+
|
|
84
|
-
`))&&(l=!0),d.push(S),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let
|
|
83
|
+
`+uh.indentComment(l(t),c),a&&a()):d&&o&&o(),p}function uz({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let g=0;g<t.length;++g){let h=t[g],v=null;if(Ys.isNode(h))h.spaceBefore&&d.push(""),dh(e,d,h.commentBefore,!1),h.comment&&(v=h.comment);else if(Ys.isPair(h)){let _=Ys.isNode(h.key)?h.key:null;_&&(_.spaceBefore&&d.push(""),dh(e,d,_.commentBefore,!1),_.comment&&(l=!0));let T=Ys.isNode(h.value)?h.value:null;T?(T.comment&&(v=T.comment),T.commentBefore&&(l=!0)):h.value==null&&_?.comment&&(v=_.comment)}v&&(l=!0);let S=Sx.stringify(h,c,()=>v=null);g<t.length-1&&(S+=","),v&&(S+=uh.lineComment(S,n,a(v))),!l&&(d.length>u||S.includes(`
|
|
84
|
+
`))&&(l=!0),d.push(S),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let g=d.reduce((h,v)=>h+v.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=f;for(let h of d)g+=h?`
|
|
85
85
|
${s}${i}${h}`:`
|
|
86
|
-
`;return`${
|
|
87
|
-
${i}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function
|
|
88
|
-
`:" ")}return
|
|
86
|
+
`;return`${g}
|
|
87
|
+
${i}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function dh({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=uh.indentComment(e(n),t);r.push(s.trimStart())}}Nx.stringifyCollection=cz});var ys=R(Zv=>{"use strict";var dz=Jv(),fz=Kv(),pz=Qp(),gs=xe(),fh=ms(),hz=$t();function _l(t,e){let r=gs.isScalar(e)?e.value:e;for(let n of t)if(gs.isPair(n)&&(n.key===e||n.key===r||gs.isScalar(n.key)&&n.key.value===r))return n}var Qv=class extends pz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(gs.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(r,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||i)&&o.items.push(fh.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;gs.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new fh.Pair(e,e?.value):n=new fh.Pair(e.key,e.value);let i=_l(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);gs.isScalar(i.value)&&hz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(a=>s(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=_l(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=_l(this.items,e)?.value;return(!r&&gs.isScalar(i)?i.value:i)??void 0}has(e){return!!_l(this.items,e)}set(e,r){this.add(new fh.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)fz.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!gs.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),dz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Zv.YAMLMap=Qv;Zv.findPair=_l});var Sa=R(Px=>{"use strict";var mz=xe(),Rx=ys(),gz={collection:"map",default:!0,nodeClass:Rx.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return mz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Rx.YAMLMap.from(t,e,r)};Px.map=gz});var vs=R(kx=>{"use strict";var yz=pl(),vz=Jv(),Tz=Qp(),hh=xe(),bz=$t(),_z=ds(),eT=class extends Tz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(hh.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=ph(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=ph(e);if(typeof n!="number")return;let i=this.items[n];return!r&&hh.isScalar(i)?i.value:i}has(e){let r=ph(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=ph(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];hh.isScalar(i)&&bz.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(_z.toJS(s,String(i++),r));return n}toString(e,r,n){return e?vz.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof i=="function"){let c=r instanceof Set?a:String(o++);a=i.call(r,c,a)}s.items.push(yz.createNode(a,void 0,n))}}return s}};function ph(t){let e=hh.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}kx.YAMLSeq=eT});var Na=R(wx=>{"use strict";var Sz=xe(),Ex=vs(),Nz={collection:"seq",default:!0,nodeClass:Ex.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Sz.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Ex.YAMLSeq.from(t,e,r)};wx.seq=Nz});var Sl=R(Cx=>{"use strict";var Rz=yl(),Pz={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Rz.stringifyString(t,e,r,n)}};Cx.string=Pz});var mh=R(Ix=>{"use strict";var Dx=$t(),Ax={identify:t=>t==null,createNode:()=>new Dx.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Dx.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Ax.test.test(t)?t:e.options.nullStr};Ix.nullTag=Ax});var tT=R(xx=>{"use strict";var kz=$t(),Ox={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new kz.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Ox.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};xx.boolTag=Ox});var Ra=R(Mx=>{"use strict";function Ez({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=JSON.stringify(n);if(!t&&e&&(!r||r==="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}Mx.stringifyNumber=Ez});var nT=R(gh=>{"use strict";var wz=$t(),rT=Ra(),Cz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:rT.stringifyNumber},Dz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():rT.stringifyNumber(t)}},Az={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new wz.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:rT.stringifyNumber};gh.float=Az;gh.floatExp=Dz;gh.floatNaN=Cz});var sT=R(vh=>{"use strict";var qx=Ra(),yh=t=>typeof t=="bigint"||Number.isInteger(t),iT=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Lx(t,e,r){let{value:n}=t;return yh(n)&&n>=0?r+n.toString(e):qx.stringifyNumber(t)}var Iz={identify:t=>yh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>iT(t,2,8,r),stringify:t=>Lx(t,8,"0o")},Oz={identify:yh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>iT(t,0,10,r),stringify:qx.stringifyNumber},xz={identify:t=>yh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>iT(t,2,16,r),stringify:t=>Lx(t,16,"0x")};vh.int=Oz;vh.intHex=xz;vh.intOct=Iz});var Bx=R($x=>{"use strict";var Mz=Sa(),qz=mh(),Lz=Na(),$z=Sl(),Bz=tT(),oT=nT(),aT=sT(),Fz=[Mz.map,Lz.seq,$z.string,qz.nullTag,Bz.boolTag,aT.intOct,aT.int,aT.intHex,oT.floatNaN,oT.floatExp,oT.float];$x.schema=Fz});var Ux=R(jx=>{"use strict";var jz=$t(),Uz=Sa(),Hz=Na();function Fx(t){return typeof t=="bigint"||Number.isInteger(t)}var Th=({value:t})=>JSON.stringify(t),Vz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Th},{identify:t=>t==null,createNode:()=>new jz.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Th},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Th},{identify:Fx,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Fx(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Th}],zz={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wz=[Uz.map,Hz.seq].concat(Vz,zz);jx.schema=Wz});var lT=R(Hx=>{"use strict";var cT=$t(),Gz=yl(),Yz={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){let o=r,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=cT.Scalar.BLOCK_LITERAL),e!==cT.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.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===cT.Scalar.BLOCK_LITERAL?`
|
|
88
|
+
`:" ")}return Gz.stringifyString({comment:t,type:e,value:a},n,i,s)}};Hx.binary=Yz});var Sh=R(_h=>{"use strict";var bh=xe(),uT=ms(),Kz=$t(),Xz=vs();function Vx(t,e){if(bh.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!bh.isPair(n)){if(bh.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new uT.Pair(new Kz.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
89
89
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
90
|
-
${s.comment}`:n.comment}n=i}t.items[r]=kh.isPair(n)?n:new TT.Pair(n)}}else e("Expected a sequence for this tag");return t}function Qx(t,e,r){let{replacer:n}=r,i=new n2.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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;i.items.push(TT.createPair(a,c,r))}return i}var i2={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jx,createNode:Qx};Ch.createPairs=Qx;Ch.pairs=i2;Ch.resolvePairs=Jx});var ST=P(_T=>{"use strict";var Zx=xe(),bT=ms(),Al=_s(),s2=Ss(),eM=Dh(),eo=class t extends s2.YAMLSeq{constructor(){super(),this.add=Al.YAMLMap.prototype.add.bind(this),this.delete=Al.YAMLMap.prototype.delete.bind(this),this.get=Al.YAMLMap.prototype.get.bind(this),this.has=Al.YAMLMap.prototype.has.bind(this),this.set=Al.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(Zx.isPair(i)?(s=bT.toJS(i.key,"",r),o=bT.toJS(i.value,s,r)):s=bT.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=eM.createPairs(e,r,n),s=new this;return s.items=i.items,s}};eo.tag="tag:yaml.org,2002:omap";var o2={collection:"seq",identify:t=>t instanceof Map,nodeClass:eo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=eM.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Zx.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new eo,r)},createNode:(t,e,r)=>eo.from(t,e,r)};_T.YAMLOMap=eo;_T.omap=o2});var sM=P(NT=>{"use strict";var tM=Lt();function rM({value:t,source:e},r){return e&&(t?nM:iM).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var nM={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new tM.Scalar(!0),stringify:rM},iM={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new tM.Scalar(!1),stringify:rM};NT.falseTag=iM;NT.trueTag=nM});var oM=P(Ah=>{"use strict";var a2=Lt(),PT=Ia(),c2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:PT.stringifyNumber},l2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():PT.stringifyNumber(t)}},u2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new a2.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:PT.stringifyNumber};Ah.float=u2;Ah.floatExp=l2;Ah.floatNaN=c2});var cM=P(Ol=>{"use strict";var aM=Ia(),Il=t=>typeof t=="bigint"||Number.isInteger(t);function Ih(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function RT(t,e,r){let{value:n}=t;if(Il(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return aM.stringifyNumber(t)}var d2={identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Ih(t,2,2,r),stringify:t=>RT(t,2,"0b")},f2={identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Ih(t,1,8,r),stringify:t=>RT(t,8,"0")},p2={identify:Il,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Ih(t,0,10,r),stringify:aM.stringifyNumber},h2={identify:Il,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Ih(t,2,16,r),stringify:t=>RT(t,16,"0x")};Ol.int=p2;Ol.intBin=d2;Ol.intHex=h2;Ol.intOct=f2});var wT=P(ET=>{"use strict";var Mh=xe(),Oh=Ts(),xh=_s(),to=class t extends xh.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Mh.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Oh.Pair(e.key,null):r=new Oh.Pair(e,null),xh.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=xh.findPair(this.items,e);return!r&&Mh.isPair(n)?Mh.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=xh.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Oh.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Oh.createPair(o,null,n));return s}};to.tag="tag:yaml.org,2002:set";var m2={collection:"map",identify:t=>t instanceof Set,nodeClass:to,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>to.from(t,e,r),resolve(t,e){if(Mh.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new to,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ET.YAMLSet=to;ET.set=m2});var CT=P(qh=>{"use strict";var g2=Ia();function kT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function lM(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return g2.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var y2={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>kT(t,r),stringify:lM},v2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>kT(t,!1),stringify:lM},uM={identify:t=>t 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(t){let e=t.match(uM.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=kT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};qh.floatTime=v2;qh.intTime=y2;qh.timestamp=uM});var pM=P(fM=>{"use strict";var T2=Da(),b2=Nh(),_2=Aa(),S2=Dl(),N2=vT(),dM=sM(),DT=oM(),Lh=cM(),P2=mh(),R2=ST(),E2=Dh(),w2=wT(),AT=CT(),k2=[T2.map,_2.seq,S2.string,b2.nullTag,dM.trueTag,dM.falseTag,Lh.intBin,Lh.intOct,Lh.int,Lh.intHex,DT.floatNaN,DT.floatExp,DT.float,N2.binary,P2.merge,R2.omap,E2.pairs,w2.set,AT.intTime,AT.floatTime,AT.timestamp];fM.schema=k2});var NM=P(xT=>{"use strict";var yM=Da(),C2=Nh(),vM=Aa(),D2=Dl(),A2=uT(),IT=fT(),OT=hT(),I2=Wx(),O2=Kx(),TM=vT(),xl=mh(),bM=ST(),_M=Dh(),hM=pM(),SM=wT(),$h=CT(),mM=new Map([["core",I2.schema],["failsafe",[yM.map,vM.seq,D2.string]],["json",O2.schema],["yaml11",hM.schema],["yaml-1.1",hM.schema]]),gM={binary:TM.binary,bool:A2.boolTag,float:IT.float,floatExp:IT.floatExp,floatNaN:IT.floatNaN,floatTime:$h.floatTime,int:OT.int,intHex:OT.intHex,intOct:OT.intOct,intTime:$h.intTime,map:yM.map,merge:xl.merge,null:C2.nullTag,omap:bM.omap,pairs:_M.pairs,seq:vM.seq,set:SM.set,timestamp:$h.timestamp},x2={"tag:yaml.org,2002:binary":TM.binary,"tag:yaml.org,2002:merge":xl.merge,"tag:yaml.org,2002:omap":bM.omap,"tag:yaml.org,2002:pairs":_M.pairs,"tag:yaml.org,2002:set":SM.set,"tag:yaml.org,2002:timestamp":$h.timestamp};function M2(t,e,r){let n=mM.get(e);if(n&&!t)return r&&!n.includes(xl.merge)?n.concat(xl.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(mM.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(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(xl.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?gM[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(gM).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},[])}xT.coreKnownTags=x2;xT.getTags=M2});var LT=P(PM=>{"use strict";var MT=xe(),q2=Da(),L2=Aa(),$2=Dl(),Bh=NM(),B2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,qT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Bh.getTags(e,"compat"):e?Bh.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Bh.coreKnownTags:{},this.tags=Bh.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,MT.MAP,{value:q2.map}),Object.defineProperty(this,MT.SCALAR,{value:$2.string}),Object.defineProperty(this,MT.SEQ,{value:L2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?B2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};PM.Schema=qT});var EM=P(RM=>{"use strict";var F2=xe(),$T=El(),Ml=Sl();function j2(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=$T.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(Ml.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(F2.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);r.push(Ml.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=$T.stringify(t.contents,i,()=>a=null,c);a&&(l+=Ml.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push($T.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
91
|
-
`)?(r.push("..."),r.push(
|
|
90
|
+
${s.comment}`:n.comment}n=i}t.items[r]=bh.isPair(n)?n:new uT.Pair(n)}}else e("Expected a sequence for this tag");return t}function zx(t,e,r){let{replacer:n}=r,i=new Xz.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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;i.items.push(uT.createPair(a,c,r))}return i}var Jz={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Vx,createNode:zx};_h.createPairs=zx;_h.pairs=Jz;_h.resolvePairs=Vx});var pT=R(fT=>{"use strict";var Wx=xe(),dT=ds(),Nl=ys(),Qz=vs(),Gx=Sh(),Ks=class t extends Qz.YAMLSeq{constructor(){super(),this.add=Nl.YAMLMap.prototype.add.bind(this),this.delete=Nl.YAMLMap.prototype.delete.bind(this),this.get=Nl.YAMLMap.prototype.get.bind(this),this.has=Nl.YAMLMap.prototype.has.bind(this),this.set=Nl.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(Wx.isPair(i)?(s=dT.toJS(i.key,"",r),o=dT.toJS(i.value,s,r)):s=dT.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=Gx.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Ks.tag="tag:yaml.org,2002:omap";var Zz={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ks,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Gx.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Wx.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ks,r)},createNode:(t,e,r)=>Ks.from(t,e,r)};fT.YAMLOMap=Ks;fT.omap=Zz});var Qx=R(hT=>{"use strict";var Yx=$t();function Kx({value:t,source:e},r){return e&&(t?Xx:Jx).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Xx={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Yx.Scalar(!0),stringify:Kx},Jx={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Yx.Scalar(!1),stringify:Kx};hT.falseTag=Jx;hT.trueTag=Xx});var Zx=R(Nh=>{"use strict";var e2=$t(),mT=Ra(),t2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mT.stringifyNumber},r2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():mT.stringifyNumber(t)}},n2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new e2.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:mT.stringifyNumber};Nh.float=n2;Nh.floatExp=r2;Nh.floatNaN=t2});var tM=R(Pl=>{"use strict";var eM=Ra(),Rl=t=>typeof t=="bigint"||Number.isInteger(t);function Rh(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function gT(t,e,r){let{value:n}=t;if(Rl(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return eM.stringifyNumber(t)}var i2={identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Rh(t,2,2,r),stringify:t=>gT(t,2,"0b")},s2={identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Rh(t,1,8,r),stringify:t=>gT(t,8,"0")},o2={identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Rh(t,0,10,r),stringify:eM.stringifyNumber},a2={identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Rh(t,2,16,r),stringify:t=>gT(t,16,"0x")};Pl.int=o2;Pl.intBin=i2;Pl.intHex=a2;Pl.intOct=s2});var vT=R(yT=>{"use strict";var Eh=xe(),Ph=ms(),kh=ys(),Xs=class t extends kh.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Eh.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ph.Pair(e.key,null):r=new Ph.Pair(e,null),kh.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=kh.findPair(this.items,e);return!r&&Eh.isPair(n)?Eh.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=kh.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ph.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Ph.createPair(o,null,n));return s}};Xs.tag="tag:yaml.org,2002:set";var c2={collection:"map",identify:t=>t instanceof Set,nodeClass:Xs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Xs.from(t,e,r),resolve(t,e){if(Eh.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Xs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};yT.YAMLSet=Xs;yT.set=c2});var bT=R(wh=>{"use strict";var l2=Ra();function TT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return r==="-"?i(-1)*s:s}function rM(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return l2.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var u2={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>TT(t,r),stringify:rM},d2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>TT(t,!1),stringify:rM},nM={identify:t=>t 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(t){let e=t.match(nM.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=TT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};wh.floatTime=d2;wh.intTime=u2;wh.timestamp=nM});var oM=R(sM=>{"use strict";var f2=Sa(),p2=mh(),h2=Na(),m2=Sl(),g2=lT(),iM=Qx(),_T=Zx(),Ch=tM(),y2=ah(),v2=pT(),T2=Sh(),b2=vT(),ST=bT(),_2=[f2.map,h2.seq,m2.string,p2.nullTag,iM.trueTag,iM.falseTag,Ch.intBin,Ch.intOct,Ch.int,Ch.intHex,_T.floatNaN,_T.floatExp,_T.float,g2.binary,y2.merge,v2.omap,T2.pairs,b2.set,ST.intTime,ST.floatTime,ST.timestamp];sM.schema=_2});var gM=R(PT=>{"use strict";var uM=Sa(),S2=mh(),dM=Na(),N2=Sl(),R2=tT(),NT=nT(),RT=sT(),P2=Bx(),k2=Ux(),fM=lT(),kl=ah(),pM=pT(),hM=Sh(),aM=oM(),mM=vT(),Dh=bT(),cM=new Map([["core",P2.schema],["failsafe",[uM.map,dM.seq,N2.string]],["json",k2.schema],["yaml11",aM.schema],["yaml-1.1",aM.schema]]),lM={binary:fM.binary,bool:R2.boolTag,float:NT.float,floatExp:NT.floatExp,floatNaN:NT.floatNaN,floatTime:Dh.floatTime,int:RT.int,intHex:RT.intHex,intOct:RT.intOct,intTime:Dh.intTime,map:uM.map,merge:kl.merge,null:S2.nullTag,omap:pM.omap,pairs:hM.pairs,seq:dM.seq,set:mM.set,timestamp:Dh.timestamp},E2={"tag:yaml.org,2002:binary":fM.binary,"tag:yaml.org,2002:merge":kl.merge,"tag:yaml.org,2002:omap":pM.omap,"tag:yaml.org,2002:pairs":hM.pairs,"tag:yaml.org,2002:set":mM.set,"tag:yaml.org,2002:timestamp":Dh.timestamp};function w2(t,e,r){let n=cM.get(e);if(n&&!t)return r&&!n.includes(kl.merge)?n.concat(kl.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(cM.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(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(kl.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?lM[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(lM).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},[])}PT.coreKnownTags=E2;PT.getTags=w2});var wT=R(yM=>{"use strict";var kT=xe(),C2=Sa(),D2=Na(),A2=Sl(),Ah=gM(),I2=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,ET=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ah.getTags(e,"compat"):e?Ah.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Ah.coreKnownTags:{},this.tags=Ah.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,kT.MAP,{value:C2.map}),Object.defineProperty(this,kT.SCALAR,{value:A2.string}),Object.defineProperty(this,kT.SEQ,{value:D2.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?I2:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};yM.Schema=ET});var TM=R(vM=>{"use strict";var O2=xe(),CT=vl(),El=hl();function x2(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=CT.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(El.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(O2.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);r.push(El.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=CT.stringify(t.contents,i,()=>a=null,c);a&&(l+=El.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(CT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
91
|
+
`)?(r.push("..."),r.push(El.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(El.indentComment(s(c),"")))}return r.join(`
|
|
92
92
|
`)+`
|
|
93
|
-
`}
|
|
93
|
+
`}vM.stringifyDocument=x2});var wl=R(bM=>{"use strict";var M2=fl(),Pa=Qp(),pn=xe(),q2=ms(),L2=ds(),$2=wT(),B2=TM(),DT=Gp(),F2=xv(),j2=pl(),AT=Ov(),IT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,pn.NODE_TYPE,{value:pn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new AT.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[pn.NODE_TYPE]:{value:pn.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=pn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ka(this.contents)&&this.contents.add(e)}addIn(e,r){ka(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=DT.anchorNames(this);e.anchor=!r||n.has(r)?DT.findNewAnchor(r||"a",n):r}return new M2.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let v=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,S=r.filter(v).map(String);S.length>0&&(r=r.concat(S)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=DT.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=j2.createNode(e,u,g);return a&&pn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new q2.Pair(i,s)}delete(e){return ka(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Pa.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ka(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return pn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Pa.isEmptyPath(e)?!r&&pn.isScalar(this.contents)?this.contents.value:this.contents:pn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return pn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Pa.isEmptyPath(e)?this.contents!==void 0:pn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Pa.collectionFromPath(this.schema,[e],r):ka(this.contents)&&this.contents.set(e,r)}setIn(e,r){Pa.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Pa.collectionFromPath(this.schema,Array.from(e),r):ka(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new AT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new AT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new $2.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=L2.toJS(this.contents,r??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?F2.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return B2.stringifyDocument(this,e)}};function ka(t){if(pn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}bM.Document=IT});var Al=R(Dl=>{"use strict";var Cl=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},OT=class extends Cl{constructor(e,r,n){super("YAMLParseError",e,r,n)}},xT=class extends Cl{constructor(e,r,n){super("YAMLWarning",e,r,n)}},U2=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).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"),n>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
94
94
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=r.linePos[1];c&&c.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(a);r.message+=`:
|
|
95
95
|
|
|
96
96
|
${o}
|
|
97
97
|
${l}
|
|
98
|
-
`}}
|
|
99
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(
|
|
100
|
-
`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||
|
|
101
|
-
`+T.comment:_.comment=T.comment);let
|
|
102
|
-
|
|
103
|
-
`+
|
|
104
|
-
`+me.comment:
|
|
105
|
-
`+v.comment:l.comment=v.comment),l.range=[n.offset,h,v.offset]}else l.range=[n.offset,h,h];return l}
|
|
98
|
+
`}};Dl.YAMLError=Cl;Dl.YAMLParseError=OT;Dl.YAMLWarning=xT;Dl.prettifyError=U2});var Il=R(_M=>{"use strict";function H2(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,g=!1,h=null,v=null,S=null,_=null,T=null,P=null,C=null;for(let U of t)switch(g&&(U.type!=="space"&&U.type!=="newline"&&U.type!=="comma"&&s(U.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&U.type!=="comment"&&U.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),U.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&U.source.includes(" ")&&(h=U),u=!0;break;case"comment":{u||s(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let me=U.source.substring(1)||" ";d?d+=f+me:d=me,f="",l=!1;break}case"newline":l?d?d+=U.source:c=!0:f+=U.source,l=!0,p=!0,(v||S)&&(_=U),u=!0;break;case"anchor":v&&s(U,"MULTIPLE_ANCHORS","A node can have at most one anchor"),U.source.endsWith(":")&&s(U.offset+U.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=U,C===null&&(C=U.offset),l=!1,u=!1,g=!0;break;case"tag":{S&&s(U,"MULTIPLE_TAGS","A node can have at most one tag"),S=U,C===null&&(C=U.offset),l=!1,u=!1,g=!0;break}case r:(v||S)&&s(U,"BAD_PROP_ORDER",`Anchors and tags must be after the ${U.source} indicator`),P&&s(U,"UNEXPECTED_TOKEN",`Unexpected ${U.source} in ${e??"collection"}`),P=U,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){T&&s(U,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=U,l=!1,u=!1;break}default:s(U,"UNEXPECTED_TOKEN",`Unexpected ${U.type} token`),l=!1,u=!1}let $=t[t.length-1],F=$?$.offset+$.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:P,spaceBefore:c,comment:d,hasNewline:p,anchor:v,tag:S,newlineAfterProp:_,end:F,start:C??F}}_M.resolveProps=H2});var Ih=R(SM=>{"use strict";function MT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
99
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(MT(e.key)||MT(e.value))return!0}return!1;default:return!0}}SM.containsNewline=MT});var qT=R(NM=>{"use strict";var V2=Ih();function z2(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&V2.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}NM.flowIndentCheck=z2});var LT=R(PM=>{"use strict";var RM=xe();function W2(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||RM.isScalar(s)&&RM.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}PM.mapIncludes=W2});var AM=R(DM=>{"use strict";var kM=ms(),G2=ys(),EM=Il(),Y2=Ih(),wM=qT(),K2=LT(),CM="All mapping items must start at the same column";function X2({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??G2.YAMLMap,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:g}=u,h=EM.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),v=!h.found;if(v){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",CM)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=`
|
|
100
|
+
`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Y2.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",CM);r.atKey=!0;let S=h.end,_=f?t(r,f,h,i):e(r,S,d,null,h,i);r.schema.compat&&wM.flowIndentCheck(n.indent,f,i),r.atKey=!1,K2.mapIncludes(r,a.items,_)&&i(S,"DUPLICATE_KEY","Map keys must be unique");let T=EM.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=T.end,T.found){v&&(g?.type==="block-map"&&!T.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<T.found.offset-1024&&i(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let P=g?t(r,g,T,i):e(r,c,p,null,T,i);r.schema.compat&&wM.flowIndentCheck(n.indent,g,i),c=P.range[2];let C=new kM.Pair(_,P);r.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{v&&i(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(_.comment?_.comment+=`
|
|
101
|
+
`+T.comment:_.comment=T.comment);let P=new kM.Pair(_);r.options.keepSourceTokens&&(P.srcToken=u),a.items.push(P)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}DM.resolveBlockMap=X2});var OM=R(IM=>{"use strict";var J2=vs(),Q2=Il(),Z2=qT();function eW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??J2.YAMLSeq,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Q2.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Z2.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}IM.resolveBlockSeq=eW});var Ea=R(xM=>{"use strict";function tW(t,e,r,n){let i="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{r&&!s&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}xM.resolveEnd=tW});var $M=R(LM=>{"use strict";var rW=xe(),nW=ms(),MM=ys(),iW=vs(),sW=Ea(),qM=Il(),oW=Ih(),aW=LT(),$T="Block collections are not allowed within flow collections",BT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function cW({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?MM.YAMLMap:iW.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){let S=n.items[v],{start:_,key:T,sep:P,value:C}=S,$=qM.resolveProps(_,{flow:a,indicator:"explicit-key-ind",next:T??P?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!P&&!C){v===0&&$.comma?i($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):v<n.items.length-1&&i($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),$.comment&&(l.comment?l.comment+=`
|
|
102
|
+
`+$.comment:l.comment=$.comment),d=$.end;continue}!o&&r.options.strict&&oW.containsNewline(T)&&i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)$.comma&&i($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if($.comma||i($.start,"MISSING_CHAR",`Missing , between ${a} items`),$.comment){let F="";e:for(let U of _)switch(U.type){case"comma":case"space":break;case"comment":F=U.source.substring(1);break e;default:break e}if(F){let U=l.items[l.items.length-1];rW.isPair(U)&&(U=U.value??U.key),U.comment?U.comment+=`
|
|
103
|
+
`+F:U.comment=F,$.comment=$.comment.substring(F.length+1)}}if(!o&&!P&&!$.found){let F=C?t(r,C,$,i):e(r,$.end,P,null,$,i);l.items.push(F),d=F.range[2],BT(C)&&i(F.range,"BLOCK_IN_FLOW",$T)}else{r.atKey=!0;let F=$.end,U=T?t(r,T,$,i):e(r,F,_,null,$,i);BT(T)&&i(U.range,"BLOCK_IN_FLOW",$T),r.atKey=!1;let me=qM.resolveProps(P??[],{flow:a,indicator:"map-value-ind",next:C,offset:U.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(me.found){if(!o&&!$.found&&r.options.strict){if(P)for(let Ne of P){if(Ne===me.found)break;if(Ne.type==="newline"){i(Ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<me.found.offset-1024&&i(me.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source&&C.source[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(me.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Xe=C?t(r,C,me,i):me.found?e(r,me.end,P,null,me,i):null;Xe?BT(C)&&i(Xe.range,"BLOCK_IN_FLOW",$T):me.comment&&(U.comment?U.comment+=`
|
|
104
|
+
`+me.comment:U.comment=me.comment);let Ft=new nW.Pair(U,Xe);if(r.options.keepSourceTokens&&(Ft.srcToken=S),o){let Ne=l;aW.mapIncludes(r,Ne.items,U)&&i(F,"DUPLICATE_KEY","Map keys must be unique"),Ne.items.push(Ft)}else{let Ne=new MM.YAMLMap(r.schema);Ne.flow=!0,Ne.items.push(Ft);let Kr=(Xe??U).range;Ne.range=[U.range[0],Kr[1],Kr[2]],l.items.push(Ne)}d=Xe?Xe.range[2]:me.end}}let f=o?"}":"]",[p,...g]=n.end,h=d;if(p&&p.source===f)h=p.offset+p.source.length;else{let v=a[0].toUpperCase()+a.substring(1),S=u?`${v} must end with a ${f}`:`${v} in block collection must be sufficiently indented and end with a ${f}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",S),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let v=sW.resolveEnd(g,h,r.options.strict,i);v.comment&&(l.comment?l.comment+=`
|
|
105
|
+
`+v.comment:l.comment=v.comment),l.range=[n.offset,h,v.offset]}else l.range=[n.offset,h,h];return l}LM.resolveFlowCollection=cW});var FM=R(BM=>{"use strict";var lW=xe(),uW=$t(),dW=ys(),fW=vs(),pW=AM(),hW=OM(),mW=$M();function FT(t,e,r,n,i,s){let o=r.type==="block-map"?pW.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?hW.resolveBlockSeq(t,e,r,n,s):mW.resolveFlowCollection(t,e,r,n,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function gW(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,g=f&&s?f.offset>s.offset?f:s:f??s;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===dW.YAMLMap.tagName&&a==="map"||o===fW.YAMLSeq.tagName&&a==="seq")return FT(t,e,r,i,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?i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),FT(t,e,r,i,o)}let l=FT(t,e,r,i,o,c),u=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,d=lW.isNode(u)?u:new uW.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}BM.composeCollection=gW});var UT=R(jM=>{"use strict";var jT=$t();function yW(t,e,r){let n=e.offset,i=vW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?jT.Scalar.BLOCK_FOLDED:jT.Scalar.BLOCK_LITERAL,o=e.source?TW(e.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let v=o[h][1];if(v===""||v==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&o.length>0?`
|
|
106
106
|
`.repeat(Math.max(1,o.length-1)):"",v=n+i.length;return e.source&&(v+=e.source.length),{value:h,type:s,comment:i.comment,range:[n,v,v]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;h<a;++h){let[v,S]=o[h];if(S===""||S==="\r")i.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&r(l+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=v.length),u=h,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=v.length+S.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;h<u;++h)d+=o[h][0].slice(c)+`
|
|
107
|
-
`;for(let h=u;h<a;++h){let[v,S]=o[h];l+=v.length+S.length+1;let _=S[S.length-1]==="\r";if(_&&(S=S.slice(0,-1)),S&&v.length<c){let
|
|
107
|
+
`;for(let h=u;h<a;++h){let[v,S]=o[h];l+=v.length+S.length+1;let _=S[S.length-1]==="\r";if(_&&(S=S.slice(0,-1)),S&&v.length<c){let P=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(l-S.length-(_?2:1),"BAD_INDENT",P),v=""}s===jT.Scalar.BLOCK_LITERAL?(d+=f+v.slice(c)+S,f=`
|
|
108
108
|
`):v.length>c||S[0]===" "?(f===" "?f=`
|
|
109
109
|
`:!p&&f===`
|
|
110
110
|
`&&(f=`
|
|
@@ -117,82 +117,82 @@ ${l}
|
|
|
117
117
|
`+o[h][0].slice(c);d[d.length-1]!==`
|
|
118
118
|
`&&(d+=`
|
|
119
119
|
`);break;default:d+=`
|
|
120
|
-
`}let
|
|
120
|
+
`}let g=n+i.length+e.source.length;return{value:d,type:s,comment:i.comment,range:[n,g,g]}}function vW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,a="",c=-1;for(let f=1;f<i.length;++f){let p=i[f];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!o&&g?o=g:c===-1&&(c=t+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",d=i.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":l=!0;case"newline":d+=p.source.length;break;case"comment":r&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",g);let h=p.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:d}}function TW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}jM.resolveBlockScalar=yW});var VT=R(HM=>{"use strict";var HT=$t(),bW=Ea();function _W(t,e,r){let{offset:n,type:i,source:s,end:o}=t,a,c,l=(f,p,g)=>r(n+f,p,g);switch(i){case"scalar":a=HT.Scalar.PLAIN,c=SW(s,l);break;case"single-quoted-scalar":a=HT.Scalar.QUOTE_SINGLE,c=NW(s,l);break;case"double-quoted-scalar":a=HT.Scalar.QUOTE_DOUBLE,c=RW(s,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let u=n+s.length,d=bW.resolveEnd(o,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function SW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),UM(t)}function NW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),UM(t.slice(1,-1)).replace(/''/g,"'")}function UM(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
121
121
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
122
122
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",o=e.lastIndex;for(r.lastIndex=o;n=r.exec(t);)n[1]===""?s===`
|
|
123
123
|
`?i+=s:s=`
|
|
124
|
-
`:(i+=s+n[1],s=" "),o=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+s+(n?.[1]??"")}function
|
|
124
|
+
`:(i+=s+n[1],s=" "),o=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(t),i+s+(n?.[1]??"")}function RW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
125
125
|
`))if(i===`
|
|
126
|
-
`){let{fold:s,offset:o}=
|
|
126
|
+
`){let{fold:s,offset:o}=PW(t,n);r+=s,n=o}else if(i==="\\"){let s=t[++n],o=kW[s];if(o)r+=o;else if(s===`
|
|
127
127
|
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
128
|
-
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];r+=
|
|
128
|
+
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let a={x:2,u:4,U:8}[s];r+=EW(t,n+1,a,e),n+=a}else{let a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(i===" "||i===" "){let s=n,o=t[n+1];for(;o===" "||o===" ";)o=t[++n+1];o!==`
|
|
129
129
|
`&&!(o==="\r"&&t[n+2]===`
|
|
130
|
-
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function
|
|
130
|
+
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function PW(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
131
131
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
132
132
|
`);)n===`
|
|
133
133
|
`&&(r+=`
|
|
134
|
-
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
135
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
134
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var kW={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 EW(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}HM.resolveFlowScalar=_W});var WM=R(zM=>{"use strict";var Js=xe(),VM=$t(),wW=UT(),CW=VT();function DW(t,e,r,n){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?wW.resolveBlockScalar(t,e,n):CW.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Js.SCALAR]:c?l=AW(t.schema,i,c,r,n):e.type==="scalar"?l=IW(t,i,e,n):l=t.schema[Js.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Js.isScalar(d)?d:new VM.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new VM.Scalar(i)}return u.range=a,u.source=i,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function AW(t,e,r,n,i){if(r==="!")return t[Js.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===r)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=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Js.SCALAR])}function IW({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Js.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Js.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(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}zM.composeScalar=DW});var YM=R(GM=>{"use strict";function OW(t,e,r){if(e){r===null&&(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}GM.emptyScalarPosition=OW});var JM=R(WT=>{"use strict";var xW=fl(),MW=xe(),qW=FM(),KM=WM(),LW=Ea(),$W=YM(),BW={composeNode:XM,composeEmptyNode:zT};function XM(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=FW(t,e,n),(a||c)&&n(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=KM.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=qW.composeCollection(BW,t,e,r,n),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=zT(t,e.offset,void 0,null,r,n),u=!1}}return a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!MW.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(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),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function zT(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:$W.emptyScalarPosition(e,r,n),indent:-1,source:""},d=KM.composeScalar(t,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=c),d}function FW({options:t},{offset:e,source:r,end:n},i){let s=new xW.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,a=LW.resolveEnd(n,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}WT.composeEmptyNode=zT;WT.composeNode=XM});var eq=R(ZM=>{"use strict";var jW=wl(),QM=JM(),UW=Ea(),HW=Il();function VW(t,e,{offset:r,start:n,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new jW.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=HW.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?QM.composeNode(l,i,u,o):QM.composeEmptyNode(l,u.end,n,null,u,o);let d=c.contents.range[2],f=UW.resolveEnd(s,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}ZM.composeDoc=VW});var YT=R(nq=>{"use strict";var zW=Ov(),WW=wl(),Ol=Al(),tq=xe(),GW=eq(),YW=Ea();function xl(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function rq(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
136
136
|
|
|
137
137
|
`:`
|
|
138
|
-
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
139
|
-
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(
|
|
138
|
+
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var GT=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=xl(r);s?this.warnings.push(new Ol.YAMLWarning(o,n,i)):this.errors.push(new Ol.YAMLParseError(o,n,i))},this.directives=new zW.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=rq(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
139
|
+
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(tq.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];tq.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
140
140
|
${a}`:n}else{let o=s.commentBefore;s.commentBefore=o?`${n}
|
|
141
|
-
${o}`:n}}r?(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:
|
|
142
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new
|
|
141
|
+
${o}`:n}}r?(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:rq(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=xl(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=GW.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ol.YAMLParseError(xl(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ol.YAMLParseError(xl(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=YW.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
142
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ol.YAMLParseError(xl(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new WW.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};nq.Composer=GT});var oq=R(Oh=>{"use strict";var KW=UT(),XW=VT(),JW=Al(),iq=yl();function QW(t,e=!0,r){if(t){let n=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,s,o);else throw new JW.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return XW.resolveFlowScalar(t,e,n);case"block-scalar":return KW.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function ZW(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=iq.stringifyString({type:o,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,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
|
-
`,f=[{type:"block-scalar-header",offset:s,indent:n,source:u}];return
|
|
146
|
-
`}),{type:"block-scalar",offset:s,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:a,end:c};default:return{type:"scalar",offset:s,indent:n,source:a,end:c}}}function
|
|
145
|
+
`,f=[{type:"block-scalar-header",offset:s,indent:n,source:u}];return sq(f,c)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
146
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:a,end:c};default:return{type:"scalar",offset:s,indent:n,source:a,end:c}}}function eG(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.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=iq.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":tG(t,c);break;case'"':KT(t,c,"double-quoted-scalar");break;case"'":KT(t,c,"single-quoted-scalar");break;default:KT(t,c,"scalar")}}function tG(t,e){let r=e.indexOf(`
|
|
147
147
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
148
|
-
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:n}];
|
|
149
|
-
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function
|
|
150
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}
|
|
148
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:n}];sq(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
149
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function sq(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function KT(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
150
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Oh.createScalarToken=ZW;Oh.resolveAsScalar=QW;Oh.setScalarValue=eG});var cq=R(aq=>{"use strict";var rG=t=>"type"in t?Mh(t):xh(t);function Mh(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Mh(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=xh(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=xh(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=xh(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function xh({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Mh(e)),r)for(let s of r)i+=s.source;return n&&(i+=Mh(n)),i}aq.stringify=rG});var fq=R(dq=>{"use strict";var XT=Symbol("break visit"),nG=Symbol("skip children"),lq=Symbol("remove item");function Qs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),uq(Object.freeze([]),t,e)}Qs.BREAK=XT;Qs.SKIP=nG;Qs.REMOVE=lq;Qs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};Qs.parentCollection=(t,e)=>{let r=Qs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function uq(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=uq(Object.freeze(t.concat([[i,o]])),s.items[o],r);if(typeof a=="number")o=a-1;else{if(a===XT)return XT;a===lq&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}dq.visit=Qs});var qh=R(Mr=>{"use strict";var JT=oq(),iG=cq(),sG=fq(),QT="\uFEFF",ZT="",eb="",tb="",oG=t=>!!t&&"items"in t,aG=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function cG(t){switch(t){case QT:return"<BOM>";case ZT:return"<DOC>";case eb:return"<FLOW_END>";case tb:return"<SCALAR>";default:return JSON.stringify(t)}}function lG(t){switch(t){case QT:return"byte-order-mark";case ZT:return"doc-mode";case eb:return"flow-error-end";case tb: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(t[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}
|
|
153
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
154
|
-
\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(t[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}Mr.createScalarToken=JT.createScalarToken;Mr.resolveAsScalar=JT.resolveAsScalar;Mr.setScalarValue=JT.setScalarValue;Mr.stringify=iG.stringify;Mr.visit=sG.visit;Mr.BOM=QT;Mr.DOCUMENT=ZT;Mr.FLOW_END=eb;Mr.SCALAR=tb;Mr.isCollection=oG;Mr.isScalar=aG;Mr.prettyToken=cG;Mr.tokenType=lG});var ib=R(hq=>{"use strict";var Ml=qh();function $n(t){switch(t){case void 0:case" ":case`
|
|
153
|
+
`:case"\r":case" ":return!0;default:return!1}}var pq=new Set("0123456789ABCDEFabcdef"),uG=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Lh=new Set(",[]{}"),dG=new Set(` ,[]{}
|
|
154
|
+
\r `),rb=t=>!t||dG.has(t),nb=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,r=!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=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
155
155
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
156
156
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
157
157
|
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
158
|
-
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")
|
|
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]===
|
|
158
|
+
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&$n(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]===Ml.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Ml.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 r=this.peek(3);if((r==="---"||r==="...")&&$n(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!$n(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&$n(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);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(rb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&$n(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Ml.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.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(rb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||$n(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),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
|
|
160
160
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
161
|
-
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r
|
|
161
|
+
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>$n(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
162
162
|
`:e=s,r=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
163
163
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
164
164
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
165
165
|
`;)n=this.buffer[++i];e=i-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+r>a)e=s;else break}while(!0);return yield
|
|
166
|
+
`&&s>=this.pos&&s+1+r>a)e=s;else break}while(!0);return yield Ml.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if($n(s)||e&&Lh.has(s))break;r=n}else if($n(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
167
167
|
`?(n+=1,i=`
|
|
168
|
-
`,s=this.buffer[n+1]):r=n),s==="#"||e&&
|
|
169
|
-
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&
|
|
168
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||e&&Lh.has(s))break;if(i===`
|
|
169
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Lh.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ml.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(rb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if($n(r)||e&&Lh.has(r))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,r=this.buffer[e];for(;!$n(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(uG.has(r))r=this.buffer[++e];else if(r==="%"&&pq.has(this.buffer[e+1])&&pq.has(this.buffer[e+2]))r=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 r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};
|
|
171
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};hq.Lexer=nb});var ob=R(mq=>{"use strict";var sb=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};mq.LineCounter=sb});var cb=R(bq=>{"use strict";var gq=qh(),fG=ib();function Zs(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function yq(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Tq(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $h(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function wa(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function vq(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Zs(e.start,"explicit-key-ind")&&!Zs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Tq(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 ab=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 fG.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",gq.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=gq.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&vq(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&yq(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.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":{yq(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=$h(this.peek(2)),n=wa(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};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 r=this.source.indexOf(`
|
|
172
172
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
173
|
-
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let a=0;a<r.sep.length;++a){let c=r.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=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(
|
|
173
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let a=0;a<r.sep.length;++a){let c=r.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=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Zs(r.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(Tq(r.key)&&!Zs(r.sep,"newline")){let o=wa(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Zs(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=wa(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Zs(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{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);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){n&&o.type!=="block-seq"&&e.items.push({start:s}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Zs(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=$h(n),s=wa(i);vq(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 r=this.source.indexOf(`
|
|
174
174
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
175
|
-
`,r)+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 r=Wh(e),n=qa(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Wh(e),n=qa(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};wq.Parser=gb});var Iq=P(zl=>{"use strict";var kq=nb(),bG=ql(),Vl=Bl(),_G=tT(),SG=xe(),NG=mb(),Cq=yb();function Dq(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new NG.LineCounter||null,prettyErrors:e}}function PG(t,e={}){let{lineCounter:r,prettyErrors:n}=Dq(e),i=new Cq.Parser(r?.addNewLine),s=new kq.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let a of o)a.errors.forEach(Vl.prettifyError(t,r)),a.warnings.forEach(Vl.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Aq(t,e={}){let{lineCounter:r,prettyErrors:n}=Dq(e),i=new Cq.Parser(r?.addNewLine),s=new kq.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Vl.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Vl.prettifyError(t,r)),o.warnings.forEach(Vl.prettifyError(t,r))),o}function RG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=Aq(t,r);if(!i)return null;if(i.warnings.forEach(s=>_G.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function EG(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return SG.isDocument(t)&&!n?t.toString(r):new bG.Document(t,n,r).toString(r)}zl.parse=RG;zl.parseAllDocuments=PG;zl.parseDocument=Aq;zl.stringify=EG});var Tb=P(Ge=>{"use strict";var wG=nb(),kG=ql(),CG=LT(),vb=Bl(),DG=bl(),Ns=xe(),AG=Ts(),IG=Lt(),OG=_s(),xG=Ss(),MG=Vh(),qG=pb(),LG=mb(),$G=yb(),Gh=Iq(),Oq=gl();Ge.Composer=wG.Composer;Ge.Document=kG.Document;Ge.Schema=CG.Schema;Ge.YAMLError=vb.YAMLError;Ge.YAMLParseError=vb.YAMLParseError;Ge.YAMLWarning=vb.YAMLWarning;Ge.Alias=DG.Alias;Ge.isAlias=Ns.isAlias;Ge.isCollection=Ns.isCollection;Ge.isDocument=Ns.isDocument;Ge.isMap=Ns.isMap;Ge.isNode=Ns.isNode;Ge.isPair=Ns.isPair;Ge.isScalar=Ns.isScalar;Ge.isSeq=Ns.isSeq;Ge.Pair=AG.Pair;Ge.Scalar=IG.Scalar;Ge.YAMLMap=OG.YAMLMap;Ge.YAMLSeq=xG.YAMLSeq;Ge.CST=MG;Ge.Lexer=qG.Lexer;Ge.LineCounter=LG.LineCounter;Ge.Parser=$G.Parser;Ge.parse=Gh.parse;Ge.parseAllDocuments=Gh.parseAllDocuments;Ge.parseDocument=Gh.parseDocument;Ge.stringify=Gh.stringify;Ge.visit=Oq.visit;Ge.visitAsync=Oq.visitAsync});var Yl=P(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.regexpCode=Le.getEsmExportName=Le.getProperty=Le.safeStringify=Le.stringify=Le.strConcat=Le.addCodeArg=Le.str=Le._=Le.nil=Le._Code=Le.Name=Le.IDENTIFIER=Le._CodeOrName=void 0;var Wl=class{};Le._CodeOrName=Wl;Le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var so=class extends Wl{constructor(e){if(super(),!Le.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}}};Le.Name=so;var mn=class extends Wl{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof so&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Le._Code=mn;Le.nil=new mn("");function xq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)_b(r,e[n]),r.push(t[++n]);return new mn(r)}Le._=xq;var bb=new mn("+");function Mq(t,...e){let r=[Gl(t[0])],n=0;for(;n<e.length;)r.push(bb),_b(r,e[n]),r.push(bb,Gl(t[++n]));return BG(r),new mn(r)}Le.str=Mq;function _b(t,e){e instanceof mn?t.push(...e._items):e instanceof so?t.push(e):t.push(UG(e))}Le.addCodeArg=_b;function BG(t){let e=1;for(;e<t.length-1;){if(t[e]===bb){let r=FG(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function FG(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof so||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof so))return`"${t}${e.slice(1)}`}function jG(t,e){return e.emptyStr()?t:t.emptyStr()?e:Mq`${t}${e}`}Le.strConcat=jG;function UG(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Gl(Array.isArray(t)?t.join(","):t)}function HG(t){return new mn(Gl(t))}Le.stringify=HG;function Gl(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Le.safeStringify=Gl;function VG(t){return typeof t=="string"&&Le.IDENTIFIER.test(t)?new mn(`.${t}`):xq`[${t}]`}Le.getProperty=VG;function zG(t){if(typeof t=="string"&&Le.IDENTIFIER.test(t))return new mn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Le.getEsmExportName=zG;function WG(t){return new mn(t.toString())}Le.regexpCode=WG});var Pb=P(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ValueScope=Fr.ValueScopeName=Fr.Scope=Fr.varKinds=Fr.UsedValueState=void 0;var Br=Yl(),Sb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Yh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Yh||(Fr.UsedValueState=Yh={}));Fr.varKinds={const:new Br.Name("const"),let:new Br.Name("let"),var:new Br.Name("var")};var Kh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Br.Name?e:this.name(e)}name(e){return new Br.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};Fr.Scope=Kh;var Xh=class extends Br.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Br._)`.${new Br.Name(r)}[${n}]`}};Fr.ValueScopeName=Xh;var GG=(0,Br._)`\n`,Nb=class extends Kh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?GG:Br.nil}}get(){return this._scope}name(e){return new Xh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Br._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Br.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Yh.Started);let u=r(l);if(u){let d=this.opts.es5?Fr.varKinds.var:Fr.varKinds.const;s=(0,Br._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,Br._)`${s}${u}${this.opts._n}`;else throw new Sb(l);c.set(l,Yh.Completed)})}return s}};Fr.ValueScope=Nb});var Te=P(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.or=_e.and=_e.not=_e.CodeGen=_e.operators=_e.varKinds=_e.ValueScopeName=_e.ValueScope=_e.Scope=_e.Name=_e.regexpCode=_e.stringify=_e.getProperty=_e.nil=_e.strConcat=_e.str=_e._=void 0;var Ae=Yl(),Fn=Pb(),Ps=Yl();Object.defineProperty(_e,"_",{enumerable:!0,get:function(){return Ps._}});Object.defineProperty(_e,"str",{enumerable:!0,get:function(){return Ps.str}});Object.defineProperty(_e,"strConcat",{enumerable:!0,get:function(){return Ps.strConcat}});Object.defineProperty(_e,"nil",{enumerable:!0,get:function(){return Ps.nil}});Object.defineProperty(_e,"getProperty",{enumerable:!0,get:function(){return Ps.getProperty}});Object.defineProperty(_e,"stringify",{enumerable:!0,get:function(){return Ps.stringify}});Object.defineProperty(_e,"regexpCode",{enumerable:!0,get:function(){return Ps.regexpCode}});Object.defineProperty(_e,"Name",{enumerable:!0,get:function(){return Ps.Name}});var em=Pb();Object.defineProperty(_e,"Scope",{enumerable:!0,get:function(){return em.Scope}});Object.defineProperty(_e,"ValueScope",{enumerable:!0,get:function(){return em.ValueScope}});Object.defineProperty(_e,"ValueScopeName",{enumerable:!0,get:function(){return em.ValueScopeName}});Object.defineProperty(_e,"varKinds",{enumerable:!0,get:function(){return em.varKinds}});_e.operators={GT:new Ae._Code(">"),GTE:new Ae._Code(">="),LT:new Ae._Code("<"),LTE:new Ae._Code("<="),EQ:new Ae._Code("==="),NEQ:new Ae._Code("!=="),NOT:new Ae._Code("!"),OR:new Ae._Code("||"),AND:new Ae._Code("&&"),ADD:new Ae._Code("+")};var xi=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Rb=class extends xi{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Fn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=$a(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ae._CodeOrName?this.rhs.names:{}}},Jh=class extends xi{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ae.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$a(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ae.Name?{}:{...this.lhs.names};return Zh(e,this.rhs)}},Eb=class extends Jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},wb=class extends xi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},kb=class extends xi{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Cb=class extends xi{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Db=class extends xi{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=$a(this.code,e,r),this}get names(){return this.code instanceof Ae._CodeOrName?this.code.names:{}}},Kl=class extends xi{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(YG(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>co(e,r.names),{})}},Mi=class extends Kl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Ab=class extends Kl{},La=class extends Mi{};La.kind="else";var oo=class t extends Mi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new La(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(qq(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=$a(this.condition,e,r),this}get names(){let e=super.names;return Zh(e,this.condition),this.else&&co(e,this.else.names),e}};oo.kind="if";var ao=class extends Mi{};ao.kind="for";var Ib=class extends ao{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=$a(this.iteration,e,r),this}get names(){return co(super.names,this.iteration.names)}},Ob=class extends ao{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Fn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Zh(super.names,this.from);return Zh(e,this.to)}},Qh=class extends ao{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=$a(this.iterable,e,r),this}get names(){return co(super.names,this.iterable.names)}},Xl=class extends Mi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Xl.kind="func";var Jl=class extends Kl{render(e){return"return "+super.render(e)}};Jl.kind="return";var xb=class extends Mi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&co(e,this.catch.names),this.finally&&co(e,this.finally.names),e}},Ql=class extends Mi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ql.kind="catch";var Zl=class extends Mi{render(e){return"finally"+super.render(e)}};Zl.kind="finally";var Mb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
176
|
-
`:""},this._extScope=e,this._scope=new Fn.Scope({parent:e}),this._nodes=[new Ab]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Rb(e,s,n)),s}const(e,r,n){return this._def(Fn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Fn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Fn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Jh(e,r,n))}add(e,r){return this._leafNode(new Eb(e,_e.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ae.nil&&this._leafNode(new Db(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ae.addCodeArg)(r,i));return r.push("}"),new Ae._Code(r)}if(e,r,n){if(this._blockNode(new oo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new oo(e))}else(){return this._elseNode(new La)}endIf(){return this._endBlockNode(oo,La)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Ib(e),r)}forRange(e,r,n,i,s=this.opts.es5?Fn.varKinds.var:Fn.varKinds.let){let o=this._scope.toName(e);return this._for(new Ob(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Fn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ae._)`${o}.length`,a=>{this.var(s,(0,Ae._)`${o}[${a}]`),n(s)})}return this._for(new Qh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Fn.varKinds.var:Fn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ae._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Qh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ao)}label(e){return this._leafNode(new wb(e))}break(e){return this._leafNode(new kb(e))}return(e){let r=new Jl;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Jl)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Ql(s),r(s)}return n&&(this._currNode=i.finally=new Zl,this.code(n)),this._endBlockNode(Ql,Zl)}throw(e){return this._leafNode(new Cb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ae.nil,n,i){return this._blockNode(new Xl(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Xl)}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,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof oo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};_e.CodeGen=Mb;function co(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Zh(t,e){return e instanceof Ae._CodeOrName?co(t,e.names):t}function $a(t,e,r){if(t instanceof Ae.Name)return n(t);if(!i(t))return t;return new Ae._Code(t._items.reduce((s,o)=>(o instanceof Ae.Name&&(o=n(o)),o instanceof Ae._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ae._Code&&s._items.some(o=>o instanceof Ae.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function YG(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function qq(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ae._)`!${qb(t)}`}_e.not=qq;var KG=Lq(_e.operators.AND);function XG(...t){return t.reduce(KG)}_e.and=XG;var JG=Lq(_e.operators.OR);function QG(...t){return t.reduce(JG)}_e.or=QG;function Lq(t){return(e,r)=>e===Ae.nil?r:r===Ae.nil?e:(0,Ae._)`${qb(e)} ${t} ${qb(r)}`}function qb(t){return t instanceof Ae.Name?t:(0,Ae._)`(${t})`}});var Ee=P(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.checkStrictMode=Se.getErrorPath=Se.Type=Se.useFunc=Se.setEvaluated=Se.evaluatedPropsToName=Se.mergeEvaluated=Se.eachItem=Se.unescapeJsonPointer=Se.escapeJsonPointer=Se.escapeFragment=Se.unescapeFragment=Se.schemaRefOrVal=Se.schemaHasRulesButRef=Se.schemaHasRules=Se.checkUnknownRules=Se.alwaysValidSchema=Se.toHash=void 0;var ot=Te(),ZG=Yl();function eY(t){let e={};for(let r of t)e[r]=!0;return e}Se.toHash=eY;function tY(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Fq(t,e),!jq(e,t.self.RULES.all))}Se.alwaysValidSchema=tY;function Fq(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||Vq(t,`unknown keyword: "${s}"`)}Se.checkUnknownRules=Fq;function jq(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Se.schemaHasRules=jq;function rY(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Se.schemaHasRulesButRef=rY;function nY({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ot._)`${r}`}return(0,ot._)`${t}${e}${(0,ot.getProperty)(n)}`}Se.schemaRefOrVal=nY;function iY(t){return Uq(decodeURIComponent(t))}Se.unescapeFragment=iY;function sY(t){return encodeURIComponent($b(t))}Se.escapeFragment=sY;function $b(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Se.escapeJsonPointer=$b;function Uq(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Se.unescapeJsonPointer=Uq;function oY(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Se.eachItem=oY;function $q({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof ot.Name?(s instanceof ot.Name?t(i,s,o):e(i,s,o),o):s instanceof ot.Name?(e(i,o,s),s):r(s,o);return a===ot.Name&&!(c instanceof ot.Name)?n(i,c):c}}Se.mergeEvaluated={props:$q({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ot._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ot._)`${r} || {}`).code((0,ot._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ot._)`${r} || {}`),Bb(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Hq}),items:$q({mergeNames:(t,e,r)=>t.if((0,ot._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ot._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ot._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ot._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Hq(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ot._)`{}`);return e!==void 0&&Bb(t,r,e),r}Se.evaluatedPropsToName=Hq;function Bb(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ot._)`${e}${(0,ot.getProperty)(n)}`,!0))}Se.setEvaluated=Bb;var Bq={};function aY(t,e){return t.scopeValue("func",{ref:e,code:Bq[e.code]||(Bq[e.code]=new ZG._Code(e.code))})}Se.useFunc=aY;var Lb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Lb||(Se.Type=Lb={}));function cY(t,e,r){if(t instanceof ot.Name){let n=e===Lb.Num;return r?n?(0,ot._)`"[" + ${t} + "]"`:(0,ot._)`"['" + ${t} + "']"`:n?(0,ot._)`"/" + ${t}`:(0,ot._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ot.getProperty)(t).toString():"/"+$b(t)}Se.getErrorPath=cY;function Vq(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Se.checkStrictMode=Vq});var gn=P(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var mr=Te(),lY={data:new mr.Name("data"),valCxt:new mr.Name("valCxt"),instancePath:new mr.Name("instancePath"),parentData:new mr.Name("parentData"),parentDataProperty:new mr.Name("parentDataProperty"),rootData:new mr.Name("rootData"),dynamicAnchors:new mr.Name("dynamicAnchors"),vErrors:new mr.Name("vErrors"),errors:new mr.Name("errors"),this:new mr.Name("this"),self:new mr.Name("self"),scope:new mr.Name("scope"),json:new mr.Name("json"),jsonPos:new mr.Name("jsonPos"),jsonLen:new mr.Name("jsonLen"),jsonPart:new mr.Name("jsonPart")};Fb.default=lY});var eu=P(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.extendErrors=gr.resetErrorsCount=gr.reportExtraError=gr.reportError=gr.keyword$DataError=gr.keywordError=void 0;var Me=Te(),tm=Ee(),Pr=gn();gr.keywordError={message:({keyword:t})=>(0,Me.str)`must pass "${t}" keyword validation`};gr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Me.str)`"${t}" keyword must be ${e} ($data)`:(0,Me.str)`"${t}" keyword is invalid ($data)`};function uY(t,e=gr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=Gq(t,e,r);n??(o||a)?zq(s,c):Wq(i,(0,Me._)`[${c}]`)}gr.reportError=uY;function dY(t,e=gr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=Gq(t,e,r);zq(i,a),s||o||Wq(n,Pr.default.vErrors)}gr.reportExtraError=dY;function fY(t,e){t.assign(Pr.default.errors,e),t.if((0,Me._)`${Pr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Me._)`${Pr.default.vErrors}.length`,e),()=>t.assign(Pr.default.vErrors,null)))}gr.resetErrorsCount=fY;function pY({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Pr.default.errors,a=>{t.const(o,(0,Me._)`${Pr.default.vErrors}[${a}]`),t.if((0,Me._)`${o}.instancePath === undefined`,()=>t.assign((0,Me._)`${o}.instancePath`,(0,Me.strConcat)(Pr.default.instancePath,s.errorPath))),t.assign((0,Me._)`${o}.schemaPath`,(0,Me.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Me._)`${o}.schema`,r),t.assign((0,Me._)`${o}.data`,n))})}gr.extendErrors=pY;function zq(t,e){let r=t.const("err",e);t.if((0,Me._)`${Pr.default.vErrors} === null`,()=>t.assign(Pr.default.vErrors,(0,Me._)`[${r}]`),(0,Me._)`${Pr.default.vErrors}.push(${r})`),t.code((0,Me._)`${Pr.default.errors}++`)}function Wq(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Me._)`new ${t.ValidationError}(${e})`):(r.assign((0,Me._)`${n}.errors`,e),r.return(!1))}var lo={keyword:new Me.Name("keyword"),schemaPath:new Me.Name("schemaPath"),params:new Me.Name("params"),propertyName:new Me.Name("propertyName"),message:new Me.Name("message"),schema:new Me.Name("schema"),parentSchema:new Me.Name("parentSchema")};function Gq(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Me._)`{}`:hY(t,e,r)}function hY(t,e,r={}){let{gen:n,it:i}=t,s=[mY(i,r),gY(t,r)];return yY(t,e,s),n.object(...s)}function mY({errorPath:t},{instancePath:e}){let r=e?(0,Me.str)`${t}${(0,tm.getErrorPath)(e,tm.Type.Str)}`:t;return[Pr.default.instancePath,(0,Me.strConcat)(Pr.default.instancePath,r)]}function gY({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Me.str)`${e}/${t}`;return r&&(i=(0,Me.str)`${i}${(0,tm.getErrorPath)(r,tm.Type.Str)}`),[lo.schemaPath,i]}function yY(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([lo.keyword,i],[lo.params,typeof e=="function"?e(t):e||(0,Me._)`{}`]),c.messages&&n.push([lo.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([lo.schema,o],[lo.parentSchema,(0,Me._)`${u}${d}`],[Pr.default.data,s]),l&&n.push([lo.propertyName,l])}});var Kq=P(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.boolOrEmptySchema=Ba.topBoolOrEmptySchema=void 0;var vY=eu(),TY=Te(),bY=gn(),_Y={message:"boolean schema is false"};function SY(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Yq(t,!1):typeof r=="object"&&r.$async===!0?e.return(bY.default.data):(e.assign((0,TY._)`${n}.errors`,null),e.return(!0))}Ba.topBoolOrEmptySchema=SY;function NY(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Yq(t)):r.var(e,!0)}Ba.boolOrEmptySchema=NY;function Yq(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,vY.reportError)(i,_Y,void 0,e)}});var jb=P(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.getRules=Fa.isJSONType=void 0;var PY=["string","number","integer","boolean","null","object","array"],RY=new Set(PY);function EY(t){return typeof t=="string"&&RY.has(t)}Fa.isJSONType=EY;function wY(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Fa.getRules=wY});var Ub=P(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.shouldUseRule=Rs.shouldUseGroup=Rs.schemaHasRulesForType=void 0;function kY({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Xq(t,n)}Rs.schemaHasRulesForType=kY;function Xq(t,e){return e.rules.some(r=>Jq(t,r))}Rs.shouldUseGroup=Xq;function Jq(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Rs.shouldUseRule=Jq});var tu=P(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.reportTypeError=yr.checkDataTypes=yr.checkDataType=yr.coerceAndCheckDataType=yr.getJSONTypes=yr.getSchemaTypes=yr.DataType=void 0;var CY=jb(),DY=Ub(),AY=eu(),be=Te(),Qq=Ee(),ja;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ja||(yr.DataType=ja={}));function IY(t){let e=Zq(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}yr.getSchemaTypes=IY;function Zq(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(CY.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}yr.getJSONTypes=Zq;function OY(t,e){let{gen:r,data:n,opts:i}=t,s=xY(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,DY.schemaHasRulesForType)(t,e[0]));if(o){let a=Vb(e,n,i.strictNumbers,ja.Wrong);r.if(a,()=>{s.length?MY(t,e,s):zb(t)})}return o}yr.coerceAndCheckDataType=OY;var eL=new Set(["string","number","integer","boolean","null"]);function xY(t,e){return e?t.filter(r=>eL.has(r)||e==="array"&&r==="array"):[]}function MY(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,be._)`typeof ${i}`),a=n.let("coerced",(0,be._)`undefined`);s.coerceTypes==="array"&&n.if((0,be._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,be._)`${i}[0]`).assign(o,(0,be._)`typeof ${i}`).if(Vb(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,be._)`${a} !== undefined`);for(let l of r)(eL.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),zb(t),n.endIf(),n.if((0,be._)`${a} !== undefined`,()=>{n.assign(i,a),qY(t,a)});function c(l){switch(l){case"string":n.elseIf((0,be._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,be._)`"" + ${i}`).elseIf((0,be._)`${i} === null`).assign(a,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${o} == "boolean" || ${i} === null
|
|
175
|
+
`,r)+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 r=$h(e),n=wa(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=$h(e),n=wa(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.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())}}};bq.Parser=ab});var Pq=R(Ll=>{"use strict";var _q=YT(),pG=wl(),ql=Al(),hG=Wv(),mG=xe(),gG=ob(),Sq=cb();function Nq(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new gG.LineCounter||null,prettyErrors:e}}function yG(t,e={}){let{lineCounter:r,prettyErrors:n}=Nq(e),i=new Sq.Parser(r?.addNewLine),s=new _q.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let a of o)a.errors.forEach(ql.prettifyError(t,r)),a.warnings.forEach(ql.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Rq(t,e={}){let{lineCounter:r,prettyErrors:n}=Nq(e),i=new Sq.Parser(r?.addNewLine),s=new _q.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ql.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(ql.prettifyError(t,r)),o.warnings.forEach(ql.prettifyError(t,r))),o}function vG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=Rq(t,r);if(!i)return null;if(i.warnings.forEach(s=>hG.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function TG(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return mG.isDocument(t)&&!n?t.toString(r):new pG.Document(t,n,r).toString(r)}Ll.parse=vG;Ll.parseAllDocuments=yG;Ll.parseDocument=Rq;Ll.stringify=TG});var ub=R(Ge=>{"use strict";var bG=YT(),_G=wl(),SG=wT(),lb=Al(),NG=fl(),Ts=xe(),RG=ms(),PG=$t(),kG=ys(),EG=vs(),wG=qh(),CG=ib(),DG=ob(),AG=cb(),Bh=Pq(),kq=cl();Ge.Composer=bG.Composer;Ge.Document=_G.Document;Ge.Schema=SG.Schema;Ge.YAMLError=lb.YAMLError;Ge.YAMLParseError=lb.YAMLParseError;Ge.YAMLWarning=lb.YAMLWarning;Ge.Alias=NG.Alias;Ge.isAlias=Ts.isAlias;Ge.isCollection=Ts.isCollection;Ge.isDocument=Ts.isDocument;Ge.isMap=Ts.isMap;Ge.isNode=Ts.isNode;Ge.isPair=Ts.isPair;Ge.isScalar=Ts.isScalar;Ge.isSeq=Ts.isSeq;Ge.Pair=RG.Pair;Ge.Scalar=PG.Scalar;Ge.YAMLMap=kG.YAMLMap;Ge.YAMLSeq=EG.YAMLSeq;Ge.CST=wG;Ge.Lexer=CG.Lexer;Ge.LineCounter=DG.LineCounter;Ge.Parser=AG.Parser;Ge.parse=Bh.parse;Ge.parseAllDocuments=Bh.parseAllDocuments;Ge.parseDocument=Bh.parseDocument;Ge.stringify=Bh.stringify;Ge.visit=kq.visit;Ge.visitAsync=kq.visitAsync});var Fl=R(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.regexpCode=Le.getEsmExportName=Le.getProperty=Le.safeStringify=Le.stringify=Le.strConcat=Le.addCodeArg=Le.str=Le._=Le.nil=Le._Code=Le.Name=Le.IDENTIFIER=Le._CodeOrName=void 0;var $l=class{};Le._CodeOrName=$l;Le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var eo=class extends $l{constructor(e){if(super(),!Le.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}}};Le.Name=eo;var hn=class extends $l{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof eo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Le._Code=hn;Le.nil=new hn("");function Eq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)fb(r,e[n]),r.push(t[++n]);return new hn(r)}Le._=Eq;var db=new hn("+");function wq(t,...e){let r=[Bl(t[0])],n=0;for(;n<e.length;)r.push(db),fb(r,e[n]),r.push(db,Bl(t[++n]));return IG(r),new hn(r)}Le.str=wq;function fb(t,e){e instanceof hn?t.push(...e._items):e instanceof eo?t.push(e):t.push(MG(e))}Le.addCodeArg=fb;function IG(t){let e=1;for(;e<t.length-1;){if(t[e]===db){let r=OG(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function OG(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof eo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof eo))return`"${t}${e.slice(1)}`}function xG(t,e){return e.emptyStr()?t:t.emptyStr()?e:wq`${t}${e}`}Le.strConcat=xG;function MG(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Bl(Array.isArray(t)?t.join(","):t)}function qG(t){return new hn(Bl(t))}Le.stringify=qG;function Bl(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Le.safeStringify=Bl;function LG(t){return typeof t=="string"&&Le.IDENTIFIER.test(t)?new hn(`.${t}`):Eq`[${t}]`}Le.getProperty=LG;function $G(t){if(typeof t=="string"&&Le.IDENTIFIER.test(t))return new hn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Le.getEsmExportName=$G;function BG(t){return new hn(t.toString())}Le.regexpCode=BG});var mb=R(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.ValueScope=Lr.ValueScopeName=Lr.Scope=Lr.varKinds=Lr.UsedValueState=void 0;var qr=Fl(),pb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fh||(Lr.UsedValueState=Fh={}));Lr.varKinds={const:new qr.Name("const"),let:new qr.Name("let"),var:new qr.Name("var")};var jh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof qr.Name?e:this.name(e)}name(e){return new qr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};Lr.Scope=jh;var Uh=class extends qr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,qr._)`.${new qr.Name(r)}[${n}]`}};Lr.ValueScopeName=Uh;var FG=(0,qr._)`\n`,hb=class extends jh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?FG:qr.nil}}get(){return this._scope}name(e){return new Uh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,qr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=qr.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Fh.Started);let u=r(l);if(u){let d=this.opts.es5?Lr.varKinds.var:Lr.varKinds.const;s=(0,qr._)`${s}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))s=(0,qr._)`${s}${u}${this.opts._n}`;else throw new pb(l);c.set(l,Fh.Completed)})}return s}};Lr.ValueScope=hb});var Te=R(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.or=_e.and=_e.not=_e.CodeGen=_e.operators=_e.varKinds=_e.ValueScopeName=_e.ValueScope=_e.Scope=_e.Name=_e.regexpCode=_e.stringify=_e.getProperty=_e.nil=_e.strConcat=_e.str=_e._=void 0;var Ae=Fl(),Bn=mb(),bs=Fl();Object.defineProperty(_e,"_",{enumerable:!0,get:function(){return bs._}});Object.defineProperty(_e,"str",{enumerable:!0,get:function(){return bs.str}});Object.defineProperty(_e,"strConcat",{enumerable:!0,get:function(){return bs.strConcat}});Object.defineProperty(_e,"nil",{enumerable:!0,get:function(){return bs.nil}});Object.defineProperty(_e,"getProperty",{enumerable:!0,get:function(){return bs.getProperty}});Object.defineProperty(_e,"stringify",{enumerable:!0,get:function(){return bs.stringify}});Object.defineProperty(_e,"regexpCode",{enumerable:!0,get:function(){return bs.regexpCode}});Object.defineProperty(_e,"Name",{enumerable:!0,get:function(){return bs.Name}});var Wh=mb();Object.defineProperty(_e,"Scope",{enumerable:!0,get:function(){return Wh.Scope}});Object.defineProperty(_e,"ValueScope",{enumerable:!0,get:function(){return Wh.ValueScope}});Object.defineProperty(_e,"ValueScopeName",{enumerable:!0,get:function(){return Wh.ValueScopeName}});Object.defineProperty(_e,"varKinds",{enumerable:!0,get:function(){return Wh.varKinds}});_e.operators={GT:new Ae._Code(">"),GTE:new Ae._Code(">="),LT:new Ae._Code("<"),LTE:new Ae._Code("<="),EQ:new Ae._Code("==="),NEQ:new Ae._Code("!=="),NOT:new Ae._Code("!"),OR:new Ae._Code("||"),AND:new Ae._Code("&&"),ADD:new Ae._Code("+")};var Di=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},gb=class extends Di{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Bn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Da(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ae._CodeOrName?this.rhs.names:{}}},Hh=class extends Di{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ae.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Da(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ae.Name?{}:{...this.lhs.names};return zh(e,this.rhs)}},yb=class extends Hh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},vb=class extends Di{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Tb=class extends Di{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},bb=class extends Di{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},_b=class extends Di{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Da(this.code,e,r),this}get names(){return this.code instanceof Ae._CodeOrName?this.code.names:{}}},jl=class extends Di{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(jG(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>no(e,r.names),{})}},Ai=class extends jl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Sb=class extends jl{},Ca=class extends Ai{};Ca.kind="else";var to=class t extends Ai{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ca(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Cq(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Da(this.condition,e,r),this}get names(){let e=super.names;return zh(e,this.condition),this.else&&no(e,this.else.names),e}};to.kind="if";var ro=class extends Ai{};ro.kind="for";var Nb=class extends ro{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Da(this.iteration,e,r),this}get names(){return no(super.names,this.iteration.names)}},Rb=class extends ro{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Bn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=zh(super.names,this.from);return zh(e,this.to)}},Vh=class extends ro{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Da(this.iterable,e,r),this}get names(){return no(super.names,this.iterable.names)}},Ul=class extends Ai{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ul.kind="func";var Hl=class extends jl{render(e){return"return "+super.render(e)}};Hl.kind="return";var Pb=class extends Ai{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&no(e,this.catch.names),this.finally&&no(e,this.finally.names),e}},Vl=class extends Ai{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Vl.kind="catch";var zl=class extends Ai{render(e){return"finally"+super.render(e)}};zl.kind="finally";var kb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
176
|
+
`:""},this._extScope=e,this._scope=new Bn.Scope({parent:e}),this._nodes=[new Sb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new gb(e,s,n)),s}const(e,r,n){return this._def(Bn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Bn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Bn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Hh(e,r,n))}add(e,r){return this._leafNode(new yb(e,_e.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ae.nil&&this._leafNode(new _b(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ae.addCodeArg)(r,i));return r.push("}"),new Ae._Code(r)}if(e,r,n){if(this._blockNode(new to(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new to(e))}else(){return this._elseNode(new Ca)}endIf(){return this._endBlockNode(to,Ca)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Nb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Bn.varKinds.var:Bn.varKinds.let){let o=this._scope.toName(e);return this._for(new Rb(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Bn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ae.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ae._)`${o}.length`,a=>{this.var(s,(0,Ae._)`${o}[${a}]`),n(s)})}return this._for(new Vh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Bn.varKinds.var:Bn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ae._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Vh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ro)}label(e){return this._leafNode(new vb(e))}break(e){return this._leafNode(new Tb(e))}return(e){let r=new Hl;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Hl)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Pb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Vl(s),r(s)}return n&&(this._currNode=i.finally=new zl,this.code(n)),this._endBlockNode(Vl,zl)}throw(e){return this._leafNode(new bb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ae.nil,n,i){return this._blockNode(new Ul(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Ul)}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,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof to))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};_e.CodeGen=kb;function no(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function zh(t,e){return e instanceof Ae._CodeOrName?no(t,e.names):t}function Da(t,e,r){if(t instanceof Ae.Name)return n(t);if(!i(t))return t;return new Ae._Code(t._items.reduce((s,o)=>(o instanceof Ae.Name&&(o=n(o)),o instanceof Ae._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ae._Code&&s._items.some(o=>o instanceof Ae.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function jG(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Cq(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ae._)`!${Eb(t)}`}_e.not=Cq;var UG=Dq(_e.operators.AND);function HG(...t){return t.reduce(UG)}_e.and=HG;var VG=Dq(_e.operators.OR);function zG(...t){return t.reduce(VG)}_e.or=zG;function Dq(t){return(e,r)=>e===Ae.nil?r:r===Ae.nil?e:(0,Ae._)`${Eb(e)} ${t} ${Eb(r)}`}function Eb(t){return t instanceof Ae.Name?t:(0,Ae._)`(${t})`}});var ke=R(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.checkStrictMode=Se.getErrorPath=Se.Type=Se.useFunc=Se.setEvaluated=Se.evaluatedPropsToName=Se.mergeEvaluated=Se.eachItem=Se.unescapeJsonPointer=Se.escapeJsonPointer=Se.escapeFragment=Se.unescapeFragment=Se.schemaRefOrVal=Se.schemaHasRulesButRef=Se.schemaHasRules=Se.checkUnknownRules=Se.alwaysValidSchema=Se.toHash=void 0;var st=Te(),WG=Fl();function GG(t){let e={};for(let r of t)e[r]=!0;return e}Se.toHash=GG;function YG(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Oq(t,e),!xq(e,t.self.RULES.all))}Se.alwaysValidSchema=YG;function Oq(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||Lq(t,`unknown keyword: "${s}"`)}Se.checkUnknownRules=Oq;function xq(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Se.schemaHasRules=xq;function KG(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Se.schemaHasRulesButRef=KG;function XG({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,st._)`${r}`}return(0,st._)`${t}${e}${(0,st.getProperty)(n)}`}Se.schemaRefOrVal=XG;function JG(t){return Mq(decodeURIComponent(t))}Se.unescapeFragment=JG;function QG(t){return encodeURIComponent(Cb(t))}Se.escapeFragment=QG;function Cb(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Se.escapeJsonPointer=Cb;function Mq(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Se.unescapeJsonPointer=Mq;function ZG(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Se.eachItem=ZG;function Aq({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof st.Name?(s instanceof st.Name?t(i,s,o):e(i,s,o),o):s instanceof st.Name?(e(i,o,s),s):r(s,o);return a===st.Name&&!(c instanceof st.Name)?n(i,c):c}}Se.mergeEvaluated={props:Aq({mergeNames:(t,e,r)=>t.if((0,st._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,st._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,st._)`${r} || {}`).code((0,st._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,st._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,st._)`${r} || {}`),Db(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:qq}),items:Aq({mergeNames:(t,e,r)=>t.if((0,st._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,st._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,st._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,st._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function qq(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,st._)`{}`);return e!==void 0&&Db(t,r,e),r}Se.evaluatedPropsToName=qq;function Db(t,e,r){Object.keys(r).forEach(n=>t.assign((0,st._)`${e}${(0,st.getProperty)(n)}`,!0))}Se.setEvaluated=Db;var Iq={};function eY(t,e){return t.scopeValue("func",{ref:e,code:Iq[e.code]||(Iq[e.code]=new WG._Code(e.code))})}Se.useFunc=eY;var wb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(wb||(Se.Type=wb={}));function tY(t,e,r){if(t instanceof st.Name){let n=e===wb.Num;return r?n?(0,st._)`"[" + ${t} + "]"`:(0,st._)`"['" + ${t} + "']"`:n?(0,st._)`"/" + ${t}`:(0,st._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,st.getProperty)(t).toString():"/"+Cb(t)}Se.getErrorPath=tY;function Lq(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Se.checkStrictMode=Lq});var mn=R(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var pr=Te(),rY={data:new pr.Name("data"),valCxt:new pr.Name("valCxt"),instancePath:new pr.Name("instancePath"),parentData:new pr.Name("parentData"),parentDataProperty:new pr.Name("parentDataProperty"),rootData:new pr.Name("rootData"),dynamicAnchors:new pr.Name("dynamicAnchors"),vErrors:new pr.Name("vErrors"),errors:new pr.Name("errors"),this:new pr.Name("this"),self:new pr.Name("self"),scope:new pr.Name("scope"),json:new pr.Name("json"),jsonPos:new pr.Name("jsonPos"),jsonLen:new pr.Name("jsonLen"),jsonPart:new pr.Name("jsonPart")};Ab.default=rY});var Wl=R(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.extendErrors=hr.resetErrorsCount=hr.reportExtraError=hr.reportError=hr.keyword$DataError=hr.keywordError=void 0;var Me=Te(),Gh=ke(),Sr=mn();hr.keywordError={message:({keyword:t})=>(0,Me.str)`must pass "${t}" keyword validation`};hr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Me.str)`"${t}" keyword must be ${e} ($data)`:(0,Me.str)`"${t}" keyword is invalid ($data)`};function nY(t,e=hr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=Fq(t,e,r);n??(o||a)?$q(s,c):Bq(i,(0,Me._)`[${c}]`)}hr.reportError=nY;function iY(t,e=hr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=Fq(t,e,r);$q(i,a),s||o||Bq(n,Sr.default.vErrors)}hr.reportExtraError=iY;function sY(t,e){t.assign(Sr.default.errors,e),t.if((0,Me._)`${Sr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Me._)`${Sr.default.vErrors}.length`,e),()=>t.assign(Sr.default.vErrors,null)))}hr.resetErrorsCount=sY;function oY({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Sr.default.errors,a=>{t.const(o,(0,Me._)`${Sr.default.vErrors}[${a}]`),t.if((0,Me._)`${o}.instancePath === undefined`,()=>t.assign((0,Me._)`${o}.instancePath`,(0,Me.strConcat)(Sr.default.instancePath,s.errorPath))),t.assign((0,Me._)`${o}.schemaPath`,(0,Me.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Me._)`${o}.schema`,r),t.assign((0,Me._)`${o}.data`,n))})}hr.extendErrors=oY;function $q(t,e){let r=t.const("err",e);t.if((0,Me._)`${Sr.default.vErrors} === null`,()=>t.assign(Sr.default.vErrors,(0,Me._)`[${r}]`),(0,Me._)`${Sr.default.vErrors}.push(${r})`),t.code((0,Me._)`${Sr.default.errors}++`)}function Bq(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Me._)`new ${t.ValidationError}(${e})`):(r.assign((0,Me._)`${n}.errors`,e),r.return(!1))}var io={keyword:new Me.Name("keyword"),schemaPath:new Me.Name("schemaPath"),params:new Me.Name("params"),propertyName:new Me.Name("propertyName"),message:new Me.Name("message"),schema:new Me.Name("schema"),parentSchema:new Me.Name("parentSchema")};function Fq(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Me._)`{}`:aY(t,e,r)}function aY(t,e,r={}){let{gen:n,it:i}=t,s=[cY(i,r),lY(t,r)];return uY(t,e,s),n.object(...s)}function cY({errorPath:t},{instancePath:e}){let r=e?(0,Me.str)`${t}${(0,Gh.getErrorPath)(e,Gh.Type.Str)}`:t;return[Sr.default.instancePath,(0,Me.strConcat)(Sr.default.instancePath,r)]}function lY({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Me.str)`${e}/${t}`;return r&&(i=(0,Me.str)`${i}${(0,Gh.getErrorPath)(r,Gh.Type.Str)}`),[io.schemaPath,i]}function uY(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([io.keyword,i],[io.params,typeof e=="function"?e(t):e||(0,Me._)`{}`]),c.messages&&n.push([io.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([io.schema,o],[io.parentSchema,(0,Me._)`${u}${d}`],[Sr.default.data,s]),l&&n.push([io.propertyName,l])}});var Uq=R(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.boolOrEmptySchema=Aa.topBoolOrEmptySchema=void 0;var dY=Wl(),fY=Te(),pY=mn(),hY={message:"boolean schema is false"};function mY(t){let{gen:e,schema:r,validateName:n}=t;r===!1?jq(t,!1):typeof r=="object"&&r.$async===!0?e.return(pY.default.data):(e.assign((0,fY._)`${n}.errors`,null),e.return(!0))}Aa.topBoolOrEmptySchema=mY;function gY(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),jq(t)):r.var(e,!0)}Aa.boolOrEmptySchema=gY;function jq(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,dY.reportError)(i,hY,void 0,e)}});var Ib=R(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.getRules=Ia.isJSONType=void 0;var yY=["string","number","integer","boolean","null","object","array"],vY=new Set(yY);function TY(t){return typeof t=="string"&&vY.has(t)}Ia.isJSONType=TY;function bY(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ia.getRules=bY});var Ob=R(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.shouldUseRule=_s.shouldUseGroup=_s.schemaHasRulesForType=void 0;function _Y({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Hq(t,n)}_s.schemaHasRulesForType=_Y;function Hq(t,e){return e.rules.some(r=>Vq(t,r))}_s.shouldUseGroup=Hq;function Vq(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}_s.shouldUseRule=Vq});var Gl=R(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.reportTypeError=mr.checkDataTypes=mr.checkDataType=mr.coerceAndCheckDataType=mr.getJSONTypes=mr.getSchemaTypes=mr.DataType=void 0;var SY=Ib(),NY=Ob(),RY=Wl(),be=Te(),zq=ke(),Oa;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Oa||(mr.DataType=Oa={}));function PY(t){let e=Wq(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}mr.getSchemaTypes=PY;function Wq(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(SY.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}mr.getJSONTypes=Wq;function kY(t,e){let{gen:r,data:n,opts:i}=t,s=EY(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,NY.schemaHasRulesForType)(t,e[0]));if(o){let a=Mb(e,n,i.strictNumbers,Oa.Wrong);r.if(a,()=>{s.length?wY(t,e,s):qb(t)})}return o}mr.coerceAndCheckDataType=kY;var Gq=new Set(["string","number","integer","boolean","null"]);function EY(t,e){return e?t.filter(r=>Gq.has(r)||e==="array"&&r==="array"):[]}function wY(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,be._)`typeof ${i}`),a=n.let("coerced",(0,be._)`undefined`);s.coerceTypes==="array"&&n.if((0,be._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,be._)`${i}[0]`).assign(o,(0,be._)`typeof ${i}`).if(Mb(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,be._)`${a} !== undefined`);for(let l of r)(Gq.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),qb(t),n.endIf(),n.if((0,be._)`${a} !== undefined`,()=>{n.assign(i,a),CY(t,a)});function c(l){switch(l){case"string":n.elseIf((0,be._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,be._)`"" + ${i}`).elseIf((0,be._)`${i} === null`).assign(a,(0,be._)`""`);return;case"number":n.elseIf((0,be._)`${o} == "boolean" || ${i} === null
|
|
177
177
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,be._)`+${i}`);return;case"integer":n.elseIf((0,be._)`${o} === "boolean" || ${i} === null
|
|
178
178
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,be._)`+${i}`);return;case"boolean":n.elseIf((0,be._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,be._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,be._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,be._)`${o} === "string" || ${o} === "number"
|
|
179
|
-
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,be._)`[${i}]`)}}}function qY({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,be._)`${e} !== undefined`,()=>t.assign((0,be._)`${e}[${r}]`,n))}function Hb(t,e,r,n=ja.Correct){let i=n===ja.Correct?be.operators.EQ:be.operators.NEQ,s;switch(t){case"null":return(0,be._)`${e} ${i} null`;case"array":s=(0,be._)`Array.isArray(${e})`;break;case"object":s=(0,be._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,be._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,be._)`typeof ${e} ${i} ${t}`}return n===ja.Correct?s:(0,be.not)(s);function o(a=be.nil){return(0,be.and)((0,be._)`typeof ${e} == "number"`,a,r?(0,be._)`isFinite(${e})`:be.nil)}}yr.checkDataType=Hb;function Vb(t,e,r,n){if(t.length===1)return Hb(t[0],e,r,n);let i,s=(0,Qq.toHash)(t);if(s.array&&s.object){let o=(0,be._)`typeof ${e} != "object"`;i=s.null?o:(0,be._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=be.nil;s.number&&delete s.integer;for(let o in s)i=(0,be.and)(i,Hb(o,e,r,n));return i}yr.checkDataTypes=Vb;var LY={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,be._)`{type: ${t}}`:(0,be._)`{type: ${e}}`};function zb(t){let e=$Y(t);(0,AY.reportError)(e,LY)}yr.reportTypeError=zb;function $Y(t){let{gen:e,data:r,schema:n}=t,i=(0,Qq.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var rL=P(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.assignDefaults=void 0;var Ua=Te(),BY=Ee();function FY(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)tL(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>tL(t,s,i.default))}rm.assignDefaults=FY;function tL(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,Ua._)`${s}${(0,Ua.getProperty)(e)}`;if(i){(0,BY.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Ua._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,Ua._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ua._)`${a} = ${(0,Ua.stringify)(r)}`)}});var yn=P(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.validateUnion=et.validateArray=et.usePattern=et.callValidateCode=et.schemaProperties=et.allSchemaProperties=et.noPropertyInData=et.propertyInData=et.isOwnProperty=et.hasPropFunc=et.reportMissingProp=et.checkMissingProp=et.checkReportMissingProp=void 0;var yt=Te(),Wb=Ee(),Es=gn(),jY=Ee();function UY(t,e){let{gen:r,data:n,it:i}=t;r.if(Yb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,yt._)`${e}`},!0),t.error()})}et.checkReportMissingProp=UY;function HY({gen:t,data:e,it:{opts:r}},n,i){return(0,yt.or)(...n.map(s=>(0,yt.and)(Yb(t,e,s,r.ownProperties),(0,yt._)`${i} = ${s}`)))}et.checkMissingProp=HY;function VY(t,e){t.setParams({missingProperty:e},!0),t.error()}et.reportMissingProp=VY;function nL(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,yt._)`Object.prototype.hasOwnProperty`})}et.hasPropFunc=nL;function Gb(t,e,r){return(0,yt._)`${nL(t)}.call(${e}, ${r})`}et.isOwnProperty=Gb;function zY(t,e,r,n){let i=(0,yt._)`${e}${(0,yt.getProperty)(r)} !== undefined`;return n?(0,yt._)`${i} && ${Gb(t,e,r)}`:i}et.propertyInData=zY;function Yb(t,e,r,n){let i=(0,yt._)`${e}${(0,yt.getProperty)(r)} === undefined`;return n?(0,yt.or)(i,(0,yt.not)(Gb(t,e,r))):i}et.noPropertyInData=Yb;function iL(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}et.allSchemaProperties=iL;function WY(t,e){return iL(e).filter(r=>!(0,Wb.alwaysValidSchema)(t,e[r]))}et.schemaProperties=WY;function GY({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,yt._)`${t}, ${e}, ${n}${i}`:e,d=[[Es.default.instancePath,(0,yt.strConcat)(Es.default.instancePath,s)],[Es.default.parentData,o.parentData],[Es.default.parentDataProperty,o.parentDataProperty],[Es.default.rootData,Es.default.rootData]];o.opts.dynamicRef&&d.push([Es.default.dynamicAnchors,Es.default.dynamicAnchors]);let f=(0,yt._)`${u}, ${r.object(...d)}`;return c!==yt.nil?(0,yt._)`${a}.call(${c}, ${f})`:(0,yt._)`${a}(${f})`}et.callValidateCode=GY;var YY=(0,yt._)`new RegExp`;function KY({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,yt._)`${i.code==="new RegExp"?YY:(0,jY.useFunc)(t,i)}(${r}, ${n})`})}et.usePattern=KY;function XY(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let c=e.const("len",(0,yt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:Wb.Type.Num},s),e.if((0,yt.not)(s),a)})}}et.validateArray=XY;function JY(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Wb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,yt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,yt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}et.validateUnion=JY});var aL=P(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.validateKeywordUsage=ui.validSchemaType=ui.funcKeywordCode=ui.macroKeywordCode=void 0;var Rr=Te(),uo=gn(),QY=yn(),ZY=eu();function eK(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=oL(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Rr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ui.macroKeywordCode=eK;function tK(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;nK(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=oL(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&sL(t),v(()=>t.error());else{let S=e.async?p():y();e.modifying&&sL(t),v(()=>rK(t,S))}}function p(){let S=n.let("ruleErrs",null);return n.try(()=>h((0,Rr._)`await `),_=>n.assign(d,!1).if((0,Rr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(S,(0,Rr._)`${_}.errors`),()=>n.throw(_))),S}function y(){let S=(0,Rr._)`${u}.errors`;return n.assign(S,null),h(Rr.nil),S}function h(S=e.async?(0,Rr._)`await `:Rr.nil){let _=c.opts.passContext?uo.default.this:uo.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Rr._)`${S}${(0,QY.callValidateCode)(t,u,_,T)}`,e.modifying)}function v(S){var _;n.if((0,Rr.not)((_=e.valid)!==null&&_!==void 0?_:d),S)}}ui.funcKeywordCode=tK;function sL(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Rr._)`${n.parentData}[${n.parentDataProperty}]`))}function rK(t,e){let{gen:r}=t;r.if((0,Rr._)`Array.isArray(${e})`,()=>{r.assign(uo.default.vErrors,(0,Rr._)`${uo.default.vErrors} === null ? ${e} : ${uo.default.vErrors}.concat(${e})`).assign(uo.default.errors,(0,Rr._)`${uo.default.vErrors}.length`),(0,ZY.extendErrors)(t)},()=>t.error())}function nK({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function oL(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Rr.stringify)(r)})}function iK(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ui.validSchemaType=iK;function sK({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ui.validateKeywordUsage=sK});var lL=P(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.extendSubschemaMode=ws.extendSubschemaData=ws.getSubschema=void 0;var di=Te(),cL=Ee();function oK(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,di._)`${t.schemaPath}${(0,di.getProperty)(e)}${(0,di.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,cL.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ws.getSubschema=oK;function aK(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,di._)`${e.data}${(0,di.getProperty)(r)}`,!0);c(f),t.errorPath=(0,di.str)`${l}${(0,cL.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,di._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof di.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ws.extendSubschemaData=aK;function cK(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ws.extendSubschemaMode=cK});var Kb=P((aRe,uL)=>{"use strict";uL.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var fL=P((cRe,dL)=>{"use strict";var ks=dL.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};nm(e,n,i,t,"",t)};ks.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ks.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ks.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ks.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 nm(t,e,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ks.arrayKeywords)for(var f=0;f<d.length;f++)nm(t,e,r,d[f],i+"/"+u+"/"+f,s,i,u,n,f)}else if(u in ks.propsKeywords){if(d&&typeof d=="object")for(var p in d)nm(t,e,r,d[p],i+"/"+u+"/"+lK(p),s,i,u,n,p)}else(u in ks.keywords||t.allKeys&&!(u in ks.skipKeywords))&&nm(t,e,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function lK(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ru=P(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.getSchemaRefs=jr.resolveUrl=jr.normalizeId=jr._getFullPath=jr.getFullPath=jr.inlineRef=void 0;var uK=Ee(),dK=Kb(),fK=fL(),pK=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function hK(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Xb(t):e?pL(t)<=e:!1}jr.inlineRef=hK;var mK=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Xb(t){for(let e in t){if(mK.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Xb)||typeof r=="object"&&Xb(r))return!0}return!1}function pL(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!pK.has(r)&&(typeof t[r]=="object"&&(0,uK.eachItem)(t[r],n=>e+=pL(n)),e===1/0))return 1/0}return e}function hL(t,e="",r){r!==!1&&(e=Ha(e));let n=t.parse(e);return mL(t,n)}jr.getFullPath=hL;function mL(t,e){return t.serialize(e).split("#")[0]+"#"}jr._getFullPath=mL;var gK=/#\/?$/;function Ha(t){return t?t.replace(gK,""):""}jr.normalizeId=Ha;function yK(t,e,r){return r=Ha(r),t.resolve(e,r)}jr.resolveUrl=yK;var vK=/^[a-z_][-a-z0-9._]*$/i;function TK(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ha(t[r]||e),s={"":i},o=hL(n,i,!1),a={},c=new Set;return fK(t,{allKeys:!0},(d,f,p,y)=>{if(y===void 0)return;let h=o+f,v=s[y];typeof d[r]=="string"&&(v=S.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[f]=v;function S(T){let R=this.opts.uriResolver.resolve;if(T=Ha(v?R(v,T):T),c.has(T))throw u(T);c.add(T);let C=this.refs[T];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,T):T!==Ha(h)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=h),T}function _(T){if(typeof T=="string"){if(!vK.test(T))throw new Error(`invalid anchor "${T}"`);S.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!dK(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}jr.getSchemaRefs=TK});var su=P(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.getData=Cs.KeywordCxt=Cs.validateFunctionCode=void 0;var bL=Kq(),gL=tu(),Qb=Ub(),im=tu(),bK=rL(),iu=aL(),Jb=lL(),oe=Te(),pe=gn(),_K=ru(),qi=Ee(),nu=eu();function SK(t){if(NL(t)&&(PL(t),SL(t))){RK(t);return}_L(t,()=>(0,bL.topBoolOrEmptySchema)(t))}Cs.validateFunctionCode=SK;function _L({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${yL(r,i)}`),PK(t,i),t.code(s)}):t.func(e,(0,oe._)`${pe.default.data}, ${NK(i)}`,n.$async,()=>t.code(yL(r,i)).code(s))}function NK(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function PK(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function RK(t){let{schema:e,opts:r,gen:n}=t;_L(t,()=>{r.$comment&&e.$comment&&EL(t),DK(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&EK(t),RL(t),OK(t)})}function EK(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function yL(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function wK(t,e){if(NL(t)&&(PL(t),SL(t))){kK(t,e);return}(0,bL.boolOrEmptySchema)(t,e)}function SL({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function NL(t){return typeof t.schema!="boolean"}function kK(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&EL(t),AK(t),IK(t);let s=n.const("_errs",pe.default.errors);RL(t,s),n.var(e,(0,oe._)`${s} === ${pe.default.errors}`)}function PL(t){(0,qi.checkUnknownRules)(t),CK(t)}function RL(t,e){if(t.opts.jtd)return vL(t,[],!1,e);let r=(0,gL.getSchemaTypes)(t.schema),n=(0,gL.coerceAndCheckDataType)(t,r);vL(t,r,!n,e)}function CK(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,qi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function DK(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,qi.checkStrictMode)(t,"default is ignored in the schema root")}function AK(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,_K.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function IK(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function EL({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function OK(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),s.unevaluated&&xK(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function xK({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function vL(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,qi.schemaHasRulesButRef)(s,u))){i.block(()=>kL(t,"$ref",u.all.$ref.definition));return}c.jtd||MK(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Qb.shouldUseGroup)(s,f)&&(f.type?(i.if((0,im.checkDataType)(f.type,o,c.strictNumbers)),TL(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,im.reportTypeError)(t)),i.endIf()):TL(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function TL(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,bK.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Qb.shouldUseRule)(n,s)&&kL(t,s.keyword,s.definition,e.type)})}function MK(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(qK(t,e),t.opts.allowUnionTypes||LK(t,e),$K(t,t.dataTypes))}function qK(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{wL(t.dataTypes,r)||Zb(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),FK(t,e)}}function LK(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Zb(t,"use allowUnionTypes to allow union type keyword")}function $K(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Qb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>BK(e,o))&&Zb(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function BK(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function wL(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function FK(t,e){let r=[];for(let n of t.dataTypes)wL(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Zb(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,qi.checkStrictMode)(t,e,t.opts.strictTypes)}var sm=class{constructor(e,r,n){if((0,iu.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,qi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",CL(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,iu.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}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:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?nu.reportExtraError:nu.reportError)(this,this.def.error,r)}$dataError(){(0,nu.reportError)(this,this.def.$dataError||nu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,nu.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,oe.or)(o(),a());function o(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,im.checkDataTypes)(c,r,s.opts.strictNumbers,im.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,Jb.getSubschema)(this.it,e);(0,Jb.extendSubschemaData)(n,this.it,e),(0,Jb.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return wK(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=qi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=qi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};Cs.KeywordCxt=sm;function kL(t,e,r,n){let i=new sm(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,iu.funcKeywordCode)(i,r):"macro"in r?(0,iu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,iu.funcKeywordCode)(i,r)}var jK=/^\/(?:[^~]|~0|~1)*$/,UK=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function CL(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!jK.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=pe.default.rootData}else{let l=UK.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,oe._)`${s}${(0,oe.getProperty)((0,qi.unescapeJsonPointer)(l))}`,o=(0,oe._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Cs.getData=CL});var om=P(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var e_=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};t_.default=e_});var ou=P(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var r_=ru(),n_=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,r_.resolveUrl)(e,r,n),this.missingSchema=(0,r_.normalizeId)((0,r_.getFullPath)(e,this.missingRef))}};i_.default=n_});var au=P(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.resolveSchema=vn.getCompilingSchema=vn.resolveRef=vn.compileSchema=vn.SchemaEnv=void 0;var jn=Te(),HK=om(),fo=gn(),Un=ru(),DL=Ee(),VK=su(),Va=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};vn.SchemaEnv=Va;function o_(t){let e=AL.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:HK.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:fo.default.data,parentData:fo.default.parentData,parentDataProperty:fo.default.parentDataProperty,dataNames:[fo.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,VK.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(fo.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${fo.default.self}`,`${fo.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:h}=l;p.evaluated={props:y instanceof jn.Name?void 0:y,items:h instanceof jn.Name?void 0:h,dynamicProps:y instanceof jn.Name,dynamicItems:h instanceof jn.Name},p.source&&(p.source.evaluated=(0,jn.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}vn.compileSchema=o_;function zK(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=YK.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new Va({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=WK.call(this,s)}vn.resolveRef=zK;function WK(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:o_.call(this,t)}function AL(t){for(let e of this._compilations)if(GK(e,t))return e}vn.getCompilingSchema=AL;function GK(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function YK(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||am.call(this,t,e)}function am(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return s_.call(this,r,t);let s=(0,Un.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=am.call(this,t,o);return typeof a?.schema!="object"?void 0:s_.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||o_.call(this,o),s===(0,Un.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,l)),new Va({schema:a,schemaId:c,root:t,baseId:i})}return s_.call(this,r,o)}}vn.resolveSchema=am;var KK=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function s_(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,DL.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!KK.has(a)&&l&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,DL.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=am.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new Va({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var IL=P((hRe,XK)=>{XK.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 xL=P((mRe,OL)=>{"use strict";var JK={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};OL.exports={HEX:JK}});var UL=P((gRe,jL)=>{"use strict";var{HEX:QK}=xL(),ZK=/^(?:(?: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 $L(t){if(FL(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(ZK)||[],[r]=e;return r?{host:t3(r,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function a_(t,e=!1){let r="",n=!0;for(let i of t){if(QK[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return e&&r.length===0&&(r="0"),r}function e3(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=a_(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){r.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(a_(i))),r.address=n.join(""),r}function BL(t){if(FL(t,":")<2)return{host:t,isIPV6:!1};let e=e3(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,escapedHost:n,isIPV6:!0}}}function t3(t,e){let r="",n=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&n?(s+1<=i&&t[s+1]===e||s+1===i)&&(r+=o,n=!1):(o===e?n=!0:n=!1,r+=o)}return r}function FL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}var ML=/^\.\.?\//u,qL=/^\/\.(?:\/|$)/u,LL=/^\/\.\.(?:\/|$)/u,r3=/^\/?(?:.|\n)*?(?=\/|$)/u;function n3(t){let e=[];for(;t.length;)if(t.match(ML))t=t.replace(ML,"");else if(t.match(qL))t=t.replace(qL,"/");else if(t.match(LL))t=t.replace(LL,"/"),e.pop();else if(t==="."||t==="..")t="";else{let r=t.match(r3);if(r){let n=r[0];t=t.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function i3(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function s3(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host),n=$L(r);if(n.isIPV4)r=n.host;else{let i=BL(n.host);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}jL.exports={recomposeAuthority:s3,normalizeComponentEncoding:i3,removeDotSegments:n3,normalizeIPv4:$L,normalizeIPv6:BL,stringArrayToHexStripped:a_}});var YL=P((yRe,GL)=>{"use strict";var o3=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,a3=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function HL(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function VL(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function zL(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function c3(t){return t.secure=HL(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function l3(t){if((t.port===(HL(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function u3(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(a3);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=c_[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function d3(t,e){let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=c_[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function f3(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!o3.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function p3(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var WL={scheme:"http",domainHost:!0,parse:VL,serialize:zL},h3={scheme:"https",domainHost:WL.domainHost,parse:VL,serialize:zL},cm={scheme:"ws",domainHost:!0,parse:c3,serialize:l3},m3={scheme:"wss",domainHost:cm.domainHost,parse:cm.parse,serialize:cm.serialize},g3={scheme:"urn",parse:u3,serialize:d3,skipNormalize:!0},y3={scheme:"urn:uuid",parse:f3,serialize:p3,skipNormalize:!0},c_={http:WL,https:h3,ws:cm,wss:m3,urn:g3,"urn:uuid":y3};GL.exports=c_});var XL=P((vRe,um)=>{"use strict";var{normalizeIPv6:v3,normalizeIPv4:T3,removeDotSegments:cu,recomposeAuthority:b3,normalizeComponentEncoding:lm}=UL(),l_=YL();function _3(t,e){return typeof t=="string"?t=fi(Li(t,e),e):typeof t=="object"&&(t=Li(fi(t,e),e)),t}function S3(t,e,r){let n=Object.assign({scheme:"null"},r),i=KL(Li(t,n),Li(e,n),n,!0);return fi(i,{...n,skipEscape:!0})}function KL(t,e,r,n){let i={};return n||(t=Li(fi(t,r),r),e=Li(fi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cu(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cu(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=cu(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=cu(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function N3(t,e,r){return typeof t=="string"?(t=unescape(t),t=fi(lm(Li(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=fi(lm(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=fi(lm(Li(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=fi(lm(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function fi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=l_[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=b3(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=cu(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var P3=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function R3(t){let e=0;for(let r=0,n=t.length;r<n;++r)if(e=t.charCodeAt(r),e>126||P3[e])return!0;return!1}var E3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Li(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(t=(r.scheme?r.scheme+":":"")+"//"+t);let o=t.match(E3);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=T3(n.host);if(c.isIPV4===!1){let l=v3(c.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=l_[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&R3(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var u_={SCHEMES:l_,normalize:_3,resolve:S3,resolveComponents:KL,equal:N3,serialize:fi,parse:Li};um.exports=u_;um.exports.default=u_;um.exports.fastUri=u_});var QL=P(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var JL=XL();JL.code='require("ajv/dist/runtime/uri").default';d_.default=JL});var o1=P(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var w3=su();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return w3.KeywordCxt}});var za=Te();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return za._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return za.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return za.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return za.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return za.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return za.CodeGen}});var k3=om(),n1=ou(),C3=jb(),lu=au(),D3=Te(),uu=ru(),dm=tu(),p_=Ee(),ZL=IL(),A3=QL(),i1=(t,e)=>new RegExp(t,e);i1.code="new RegExp";var I3=["removeAdditional","useDefaults","coerceTypes"],O3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x3={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."},M3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},e1=200;function q3(t){var e,r,n,i,s,o,a,c,l,u,d,f,p,y,h,v,S,_,T,R,C,B,U,H,me;let Je=t.strict,Ft=(e=t.code)===null||e===void 0?void 0:e.optimize,Ne=Ft===!0||Ft===void 0?1:Ft||0,Xr=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:i1,$i=(i=t.uriResolver)!==null&&i!==void 0?i:A3.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:Je)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Je)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Je)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Je)!==null&&f!==void 0?f:"log",strictRequired:(y=(p=t.strictRequired)!==null&&p!==void 0?p:Je)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:Ne,regExp:Xr}:{optimize:Ne,regExp:Xr},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:e1,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:e1,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(R=t.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(B=t.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(U=t.validateFormats)!==null&&U!==void 0?U:!0,unicodeRegExp:(H=t.unicodeRegExp)!==null&&H!==void 0?H:!0,int32range:(me=t.int32range)!==null&&me!==void 0?me:!0,uriResolver:$i}}var du=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...q3(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new D3.ValueScope({scope:{},prefixes:O3,es5:r,lines:n}),this.logger=U3(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,C3.getRules)(),t1.call(this,x3,e,"NOT SUPPORTED"),t1.call(this,M3,e,"DEPRECATED","warn"),this._metaOpts=F3.call(this),e.formats&&$3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&B3.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),L3.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=ZL;n==="id"&&(i={...ZL},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await s.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof n1.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 s.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,uu.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=r1.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new lu.SchemaEnv({schema:{},schemaId:n});if(r=lu.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}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 r=r1.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,uu.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(V3.call(this,n,r),!r)return(0,p_.eachItem)(n,s=>f_.call(this,s)),this;W3.call(this,r);let i={...r,type:(0,dm.getJSONTypes)(r.type),schemaType:(0,dm.getJSONTypes)(r.schemaType)};return(0,p_.eachItem)(n,i.type.length===0?s=>f_.call(this,s,i):s=>i.type.forEach(o=>f_.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=s1(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=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;n=(0,uu.normalizeId)(o||n);let l=uu.getSchemaRefs.call(this,e,n);return c=new lu.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&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):lu.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{lu.compileSchema.call(this,e)}finally{this.opts=r}}};du.ValidationError=k3.default;du.MissingRefError=n1.default;sr.default=du;function t1(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function r1(t){return t=(0,uu.normalizeId)(t),this.schemas[t]||this.refs[t]}function L3(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function $3(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function B3(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function F3(){let t={...this.opts};for(let e of I3)delete t[e];return t}var j3={log(){},warn(){},error(){}};function U3(t){if(t===!1)return j3;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var H3=/^[a-z_$][a-z0-9_$:-]*$/i;function V3(t,e){let{RULES:r}=this;if((0,p_.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!H3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function f_(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,dm.getJSONTypes)(e.type),schemaType:(0,dm.getJSONTypes)(e.schemaType)}};e.before?z3.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function z3(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function W3(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=s1(e)),t.validateSchema=this.compile(e,!0))}var G3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function s1(t){return{anyOf:[t,G3]}}});var a1=P(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var Y3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};h_.default=Y3});var hm=P(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.callRef=po.getValidate=void 0;var K3=ou(),c1=yn(),Ur=Te(),Wa=gn(),l1=au(),fm=Ee(),X3={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=l1.resolveRef.call(c,l,i,r);if(u===void 0)throw new K3.default(n.opts.uriResolver,i,r);if(u instanceof l1.SchemaEnv)return f(u);return p(u);function d(){if(s===l)return pm(t,o,s,s.$async);let y=e.scopeValue("root",{ref:l});return pm(t,(0,Ur._)`${y}.validate`,l,l.$async)}function f(y){let h=u1(t,y);pm(t,h,y,y.$async)}function p(y){let h=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Ur.stringify)(y)}:{ref:y}),v=e.name("valid"),S=t.subschema({schema:y,dataTypes:[],schemaPath:Ur.nil,topSchemaRef:h,errSchemaPath:r},v);t.mergeEvaluated(S),t.ok(v)}}};function u1(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ur._)`${r.scopeValue("wrapper",{ref:e})}.validate`}po.getValidate=u1;function pm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?Wa.default.this:Ur.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{i.code((0,Ur._)`await ${(0,c1.callValidateCode)(t,e,l)}`),p(e),o||i.assign(y,!0)},h=>{i.if((0,Ur._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),f(h),o||i.assign(y,!1)}),t.ok(y)}function d(){t.result((0,c1.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(y){let h=(0,Ur._)`${y}.errors`;i.assign(Wa.default.vErrors,(0,Ur._)`${Wa.default.vErrors} === null ? ${h} : ${Wa.default.vErrors}.concat(${h})`),i.assign(Wa.default.errors,(0,Ur._)`${Wa.default.vErrors}.length`)}function p(y){var h;if(!s.opts.unevaluated)return;let v=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=fm.mergeEvaluated.props(i,v.props,s.props));else{let S=i.var("props",(0,Ur._)`${y}.evaluated.props`);s.props=fm.mergeEvaluated.props(i,S,s.props,Ur.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=fm.mergeEvaluated.items(i,v.items,s.items));else{let S=i.var("items",(0,Ur._)`${y}.evaluated.items`);s.items=fm.mergeEvaluated.items(i,S,s.items,Ur.Name)}}}po.callRef=pm;po.default=X3});var d1=P(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var J3=a1(),Q3=hm(),Z3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",J3.default,Q3.default];m_.default=Z3});var f1=P(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var mm=Te(),Ds=mm.operators,gm={maximum:{okStr:"<=",ok:Ds.LTE,fail:Ds.GT},minimum:{okStr:">=",ok:Ds.GTE,fail:Ds.LT},exclusiveMaximum:{okStr:"<",ok:Ds.LT,fail:Ds.GTE},exclusiveMinimum:{okStr:">",ok:Ds.GT,fail:Ds.LTE}},eX={message:({keyword:t,schemaCode:e})=>(0,mm.str)`must be ${gm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,mm._)`{comparison: ${gm[t].okStr}, limit: ${e}}`},tX={keyword:Object.keys(gm),type:"number",schemaType:"number",$data:!0,error:eX,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,mm._)`${r} ${gm[e].fail} ${n} || isNaN(${r})`)}};g_.default=tX});var p1=P(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var fu=Te(),rX={message:({schemaCode:t})=>(0,fu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,fu._)`{multipleOf: ${t}}`},nX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:rX,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,fu._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,fu._)`${o} !== parseInt(${o})`;t.fail$data((0,fu._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};y_.default=nX});var m1=P(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});function h1(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}v_.default=h1;h1.code='require("ajv/dist/runtime/ucs2length").default'});var g1=P(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var ho=Te(),iX=Ee(),sX=m1(),oX={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ho.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ho._)`{limit: ${t}}`},aX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:oX,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ho.operators.GT:ho.operators.LT,o=i.opts.unicode===!1?(0,ho._)`${r}.length`:(0,ho._)`${(0,iX.useFunc)(t.gen,sX.default)}(${r})`;t.fail$data((0,ho._)`${o} ${s} ${n}`)}};T_.default=aX});var y1=P(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var cX=yn(),ym=Te(),lX={message:({schemaCode:t})=>(0,ym.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ym._)`{pattern: ${t}}`},uX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:lX,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=r?(0,ym._)`(new RegExp(${i}, ${o}))`:(0,cX.usePattern)(t,n);t.fail$data((0,ym._)`!${a}.test(${e})`)}};b_.default=uX});var v1=P(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var pu=Te(),dX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,pu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,pu._)`{limit: ${t}}`},fX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:dX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?pu.operators.GT:pu.operators.LT;t.fail$data((0,pu._)`Object.keys(${r}).length ${i} ${n}`)}};__.default=fX});var T1=P(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});var hu=yn(),mu=Te(),pX=Ee(),hX={message:({params:{missingProperty:t}})=>(0,mu.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,mu._)`{missingProperty: ${t}}`},mX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:hX,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:y}=t.it;for(let h of r)if(p?.[h]===void 0&&!y.has(h)){let v=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${h}" is not defined at "${v}" (strictRequired)`;(0,pX.checkStrictMode)(o,S,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(mu.nil,d);else for(let p of r)(0,hu.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||s){let y=e.let("valid",!0);t.block$data(y,()=>f(p,y)),t.ok(y)}else e.if((0,hu.checkMissingProp)(t,r,p)),(0,hu.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,hu.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,y){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(y,(0,hu.propertyInData)(e,i,p,a.ownProperties)),e.if((0,mu.not)(y),()=>{t.error(),e.break()})},mu.nil)}}};S_.default=mX});var b1=P(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var gu=Te(),gX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,gu.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,gu._)`{limit: ${t}}`},yX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:gX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?gu.operators.GT:gu.operators.LT;t.fail$data((0,gu._)`${r}.length ${i} ${n}`)}};N_.default=yX});var vm=P(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var _1=Kb();_1.code='require("ajv/dist/runtime/equal").default';P_.default=_1});var S1=P(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});var R_=tu(),or=Te(),vX=Ee(),TX=vm(),bX={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{i: ${t}, j: ${e}}`},_X={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:bX,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=s.items?(0,R_.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,or._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,or._)`${r}.length`),h=e.let("j");t.setParams({i:y,j:h}),e.assign(c,!0),e.if((0,or._)`${y} > 1`,()=>(d()?f:p)(y,h))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,h){let v=e.name("item"),S=(0,R_.checkDataTypes)(l,v,a.opts.strictNumbers,R_.DataType.Wrong),_=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${y}--;`,()=>{e.let(v,(0,or._)`${r}[${y}]`),e.if(S,(0,or._)`continue`),l.length>1&&e.if((0,or._)`typeof ${v} == "string"`,(0,or._)`${v} += "_"`),e.if((0,or._)`typeof ${_}[${v}] == "number"`,()=>{e.assign(h,(0,or._)`${_}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,or._)`${_}[${v}] = ${y}`)})}function p(y,h){let v=(0,vX.useFunc)(e,TX.default),S=e.name("outer");e.label(S).for((0,or._)`;${y}--;`,()=>e.for((0,or._)`${h} = ${y}; ${h}--;`,()=>e.if((0,or._)`${v}(${r}[${y}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};E_.default=_X});var N1=P(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var w_=Te(),SX=Ee(),NX=vm(),PX={message:"must be equal to constant",params:({schemaCode:t})=>(0,w_._)`{allowedValue: ${t}}`},RX={keyword:"const",$data:!0,error:PX,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,w_._)`!${(0,SX.useFunc)(e,NX.default)}(${r}, ${i})`):t.fail((0,w_._)`${s} !== ${r}`)}};k_.default=RX});var P1=P(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});var yu=Te(),EX=Ee(),wX=vm(),kX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,yu._)`{allowedValues: ${t}}`},CX={keyword:"enum",schemaType:"array",$data:!0,error:kX,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,EX.useFunc)(e,wX.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",s);u=(0,yu.or)(...i.map((y,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,p=>e.if((0,yu._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,y){let h=i[y];return typeof h=="object"&&h!==null?(0,yu._)`${l()}(${r}, ${p}[${y}])`:(0,yu._)`${r} === ${h}`}}};C_.default=CX});var R1=P(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var DX=f1(),AX=p1(),IX=g1(),OX=y1(),xX=v1(),MX=T1(),qX=b1(),LX=S1(),$X=N1(),BX=P1(),FX=[DX.default,AX.default,IX.default,OX.default,xX.default,MX.default,qX.default,LX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$X.default,BX.default];D_.default=FX});var I_=P(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.validateAdditionalItems=void 0;var mo=Te(),A_=Ee(),jX={message:({params:{len:t}})=>(0,mo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,mo._)`{limit: ${t}}`},UX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:jX,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,A_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}E1(t,n)}};function E1(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,mo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,mo._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,A_.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,mo._)`${a} <= ${e.length}`);r.if((0,mo.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:A_.Type.Num},l),o.allErrors||r.if((0,mo.not)(l),()=>r.break())})}}vu.validateAdditionalItems=E1;vu.default=UX});var O_=P(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.validateTuple=void 0;var w1=Te(),Tm=Ee(),HX=yn(),VX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return k1(t,"additionalItems",e);r.items=!0,!(0,Tm.alwaysValidSchema)(r,e)&&t.ok((0,HX.validateArray)(t))}};function k1(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Tm.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,w1._)`${s}.length`);r.forEach((d,f)=>{(0,Tm.alwaysValidSchema)(a,d)||(n.if((0,w1._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,y=r.length,h=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let v=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,Tm.checkStrictMode)(a,v,f.strictTuples)}}}Tu.validateTuple=k1;Tu.default=VX});var C1=P(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var zX=O_(),WX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,zX.validateTuple)(t,"items")};x_.default=WX});var A1=P(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var D1=Te(),GX=Ee(),YX=yn(),KX=I_(),XX={message:({params:{len:t}})=>(0,D1.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,D1._)`{limit: ${t}}`},JX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:XX,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,GX.alwaysValidSchema)(n,e)&&(i?(0,KX.validateAdditionalItems)(t,i):t.ok((0,YX.validateArray)(t)))}};M_.default=JX});var I1=P(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var Tn=Te(),bm=Ee(),QX={message:({params:{min:t,max:e}})=>e===void 0?(0,Tn.str)`must contain at least ${t} valid item(s)`:(0,Tn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Tn._)`{minContains: ${t}}`:(0,Tn._)`{minContains: ${t}, maxContains: ${e}}`},ZX={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:QX,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,Tn._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,bm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,bm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,bm.alwaysValidSchema)(s,r)){let h=(0,Tn._)`${u} >= ${o}`;a!==void 0&&(h=(0,Tn._)`${h} && ${u} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Tn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),v=e.let("count",0);p(h,()=>e.if(h,()=>y(v)))}function p(h,v){e.forRange("i",0,u,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:bm.Type.Num,compositeRule:!0},h),v()})}function y(h){e.code((0,Tn._)`${h}++`),a===void 0?e.if((0,Tn._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Tn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Tn._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};q_.default=ZX});var _m=P(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.validateSchemaDeps=pi.validatePropertyDeps=pi.error=void 0;var L_=Te(),e4=Ee(),bu=yn();pi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,L_.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,L_._)`{property: ${t},
|
|
179
|
+
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,be._)`[${i}]`)}}}function CY({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,be._)`${e} !== undefined`,()=>t.assign((0,be._)`${e}[${r}]`,n))}function xb(t,e,r,n=Oa.Correct){let i=n===Oa.Correct?be.operators.EQ:be.operators.NEQ,s;switch(t){case"null":return(0,be._)`${e} ${i} null`;case"array":s=(0,be._)`Array.isArray(${e})`;break;case"object":s=(0,be._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,be._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,be._)`typeof ${e} ${i} ${t}`}return n===Oa.Correct?s:(0,be.not)(s);function o(a=be.nil){return(0,be.and)((0,be._)`typeof ${e} == "number"`,a,r?(0,be._)`isFinite(${e})`:be.nil)}}mr.checkDataType=xb;function Mb(t,e,r,n){if(t.length===1)return xb(t[0],e,r,n);let i,s=(0,zq.toHash)(t);if(s.array&&s.object){let o=(0,be._)`typeof ${e} != "object"`;i=s.null?o:(0,be._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=be.nil;s.number&&delete s.integer;for(let o in s)i=(0,be.and)(i,xb(o,e,r,n));return i}mr.checkDataTypes=Mb;var DY={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,be._)`{type: ${t}}`:(0,be._)`{type: ${e}}`};function qb(t){let e=AY(t);(0,RY.reportError)(e,DY)}mr.reportTypeError=qb;function AY(t){let{gen:e,data:r,schema:n}=t,i=(0,zq.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Kq=R(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.assignDefaults=void 0;var xa=Te(),IY=ke();function OY(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Yq(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Yq(t,s,i.default))}Yh.assignDefaults=OY;function Yq(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,xa._)`${s}${(0,xa.getProperty)(e)}`;if(i){(0,IY.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,xa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,xa._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,xa._)`${a} = ${(0,xa.stringify)(r)}`)}});var gn=R(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateUnion=Ze.validateArray=Ze.usePattern=Ze.callValidateCode=Ze.schemaProperties=Ze.allSchemaProperties=Ze.noPropertyInData=Ze.propertyInData=Ze.isOwnProperty=Ze.hasPropFunc=Ze.reportMissingProp=Ze.checkMissingProp=Ze.checkReportMissingProp=void 0;var gt=Te(),Lb=ke(),Ss=mn(),xY=ke();function MY(t,e){let{gen:r,data:n,it:i}=t;r.if(Bb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,gt._)`${e}`},!0),t.error()})}Ze.checkReportMissingProp=MY;function qY({gen:t,data:e,it:{opts:r}},n,i){return(0,gt.or)(...n.map(s=>(0,gt.and)(Bb(t,e,s,r.ownProperties),(0,gt._)`${i} = ${s}`)))}Ze.checkMissingProp=qY;function LY(t,e){t.setParams({missingProperty:e},!0),t.error()}Ze.reportMissingProp=LY;function Xq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,gt._)`Object.prototype.hasOwnProperty`})}Ze.hasPropFunc=Xq;function $b(t,e,r){return(0,gt._)`${Xq(t)}.call(${e}, ${r})`}Ze.isOwnProperty=$b;function $Y(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} !== undefined`;return n?(0,gt._)`${i} && ${$b(t,e,r)}`:i}Ze.propertyInData=$Y;function Bb(t,e,r,n){let i=(0,gt._)`${e}${(0,gt.getProperty)(r)} === undefined`;return n?(0,gt.or)(i,(0,gt.not)($b(t,e,r))):i}Ze.noPropertyInData=Bb;function Jq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ze.allSchemaProperties=Jq;function BY(t,e){return Jq(e).filter(r=>!(0,Lb.alwaysValidSchema)(t,e[r]))}Ze.schemaProperties=BY;function FY({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?(0,gt._)`${t}, ${e}, ${n}${i}`:e,d=[[Ss.default.instancePath,(0,gt.strConcat)(Ss.default.instancePath,s)],[Ss.default.parentData,o.parentData],[Ss.default.parentDataProperty,o.parentDataProperty],[Ss.default.rootData,Ss.default.rootData]];o.opts.dynamicRef&&d.push([Ss.default.dynamicAnchors,Ss.default.dynamicAnchors]);let f=(0,gt._)`${u}, ${r.object(...d)}`;return c!==gt.nil?(0,gt._)`${a}.call(${c}, ${f})`:(0,gt._)`${a}(${f})`}Ze.callValidateCode=FY;var jY=(0,gt._)`new RegExp`;function UY({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,gt._)`${i.code==="new RegExp"?jY:(0,xY.useFunc)(t,i)}(${r}, ${n})`})}Ze.usePattern=UY;function HY(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let c=e.const("len",(0,gt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:Lb.Type.Num},s),e.if((0,gt.not)(s),a)})}}Ze.validateArray=HY;function VY(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Lb.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,gt._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,gt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ze.validateUnion=VY});var eL=R(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.validateKeywordUsage=ci.validSchemaType=ci.funcKeywordCode=ci.macroKeywordCode=void 0;var Nr=Te(),so=mn(),zY=gn(),WY=Wl();function GY(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),c=Zq(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Nr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ci.macroKeywordCode=GY;function YY(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=t;XY(c,e);let l=!a&&e.compile?e.compile.call(c.self,s,o,c):e.validate,u=Zq(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&Qq(t),v(()=>t.error());else{let S=e.async?p():g();e.modifying&&Qq(t),v(()=>KY(t,S))}}function p(){let S=n.let("ruleErrs",null);return n.try(()=>h((0,Nr._)`await `),_=>n.assign(d,!1).if((0,Nr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(S,(0,Nr._)`${_}.errors`),()=>n.throw(_))),S}function g(){let S=(0,Nr._)`${u}.errors`;return n.assign(S,null),h(Nr.nil),S}function h(S=e.async?(0,Nr._)`await `:Nr.nil){let _=c.opts.passContext?so.default.this:so.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Nr._)`${S}${(0,zY.callValidateCode)(t,u,_,T)}`,e.modifying)}function v(S){var _;n.if((0,Nr.not)((_=e.valid)!==null&&_!==void 0?_:d),S)}}ci.funcKeywordCode=YY;function Qq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Nr._)`${n.parentData}[${n.parentDataProperty}]`))}function KY(t,e){let{gen:r}=t;r.if((0,Nr._)`Array.isArray(${e})`,()=>{r.assign(so.default.vErrors,(0,Nr._)`${so.default.vErrors} === null ? ${e} : ${so.default.vErrors}.concat(${e})`).assign(so.default.errors,(0,Nr._)`${so.default.vErrors}.length`),(0,WY.extendErrors)(t)},()=>t.error())}function XY({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Zq(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Nr.stringify)(r)})}function JY(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ci.validSchemaType=JY;function QY({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ci.validateKeywordUsage=QY});var rL=R(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.extendSubschemaMode=Ns.extendSubschemaData=Ns.getSubschema=void 0;var li=Te(),tL=ke();function ZY(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,li._)`${t.schemaPath}${(0,li.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,li._)`${t.schemaPath}${(0,li.getProperty)(e)}${(0,li.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,tL.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Ns.getSubschema=ZY;function eK(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,li._)`${e.data}${(0,li.getProperty)(r)}`,!0);c(f),t.errorPath=(0,li.str)`${l}${(0,tL.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,li._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof li.Name?i:a.let("data",i,!0);c(l),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Ns.extendSubschemaData=eK;function tK(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Ns.extendSubschemaMode=tK});var Fb=R((JRe,nL)=>{"use strict";nL.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var sL=R((QRe,iL)=>{"use strict";var Rs=iL.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Kh(e,n,i,t,"",t)};Rs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Rs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Rs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Rs.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 Kh(t,e,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Rs.arrayKeywords)for(var f=0;f<d.length;f++)Kh(t,e,r,d[f],i+"/"+u+"/"+f,s,i,u,n,f)}else if(u in Rs.propsKeywords){if(d&&typeof d=="object")for(var p in d)Kh(t,e,r,d[p],i+"/"+u+"/"+rK(p),s,i,u,n,p)}else(u in Rs.keywords||t.allKeys&&!(u in Rs.skipKeywords))&&Kh(t,e,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function rK(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yl=R($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.getSchemaRefs=$r.resolveUrl=$r.normalizeId=$r._getFullPath=$r.getFullPath=$r.inlineRef=void 0;var nK=ke(),iK=Fb(),sK=sL(),oK=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function aK(t,e=!0){return typeof t=="boolean"?!0:e===!0?!jb(t):e?oL(t)<=e:!1}$r.inlineRef=aK;var cK=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function jb(t){for(let e in t){if(cK.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(jb)||typeof r=="object"&&jb(r))return!0}return!1}function oL(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!oK.has(r)&&(typeof t[r]=="object"&&(0,nK.eachItem)(t[r],n=>e+=oL(n)),e===1/0))return 1/0}return e}function aL(t,e="",r){r!==!1&&(e=Ma(e));let n=t.parse(e);return cL(t,n)}$r.getFullPath=aL;function cL(t,e){return t.serialize(e).split("#")[0]+"#"}$r._getFullPath=cL;var lK=/#\/?$/;function Ma(t){return t?t.replace(lK,""):""}$r.normalizeId=Ma;function uK(t,e,r){return r=Ma(r),t.resolve(e,r)}$r.resolveUrl=uK;var dK=/^[a-z_][-a-z0-9._]*$/i;function fK(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ma(t[r]||e),s={"":i},o=aL(n,i,!1),a={},c=new Set;return sK(t,{allKeys:!0},(d,f,p,g)=>{if(g===void 0)return;let h=o+f,v=s[g];typeof d[r]=="string"&&(v=S.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[f]=v;function S(T){let P=this.opts.uriResolver.resolve;if(T=Ma(v?P(v,T):T),c.has(T))throw u(T);c.add(T);let C=this.refs[T];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?l(d,C.schema,T):T!==Ma(h)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=h),T}function _(T){if(typeof T=="string"){if(!dK.test(T))throw new Error(`invalid anchor "${T}"`);S.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!iK(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}$r.getSchemaRefs=fK});var Jl=R(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.getData=Ps.KeywordCxt=Ps.validateFunctionCode=void 0;var pL=Uq(),lL=Gl(),Hb=Ob(),Xh=Gl(),pK=Kq(),Xl=eL(),Ub=rL(),oe=Te(),pe=mn(),hK=Yl(),Ii=ke(),Kl=Wl();function mK(t){if(gL(t)&&(yL(t),mL(t))){vK(t);return}hL(t,()=>(0,pL.topBoolOrEmptySchema)(t))}Ps.validateFunctionCode=mK;function hL({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${uL(r,i)}`),yK(t,i),t.code(s)}):t.func(e,(0,oe._)`${pe.default.data}, ${gK(i)}`,n.$async,()=>t.code(uL(r,i)).code(s))}function gK(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function yK(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function vK(t){let{schema:e,opts:r,gen:n}=t;hL(t,()=>{r.$comment&&e.$comment&&TL(t),NK(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&TK(t),vL(t),kK(t)})}function TK(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function uL(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function bK(t,e){if(gL(t)&&(yL(t),mL(t))){_K(t,e);return}(0,pL.boolOrEmptySchema)(t,e)}function mL({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function gL(t){return typeof t.schema!="boolean"}function _K(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&TL(t),RK(t),PK(t);let s=n.const("_errs",pe.default.errors);vL(t,s),n.var(e,(0,oe._)`${s} === ${pe.default.errors}`)}function yL(t){(0,Ii.checkUnknownRules)(t),SK(t)}function vL(t,e){if(t.opts.jtd)return dL(t,[],!1,e);let r=(0,lL.getSchemaTypes)(t.schema),n=(0,lL.coerceAndCheckDataType)(t,r);dL(t,r,!n,e)}function SK(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ii.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function NK(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ii.checkStrictMode)(t,"default is ignored in the schema root")}function RK(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,hK.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function PK(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function TL({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function kK(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),s.unevaluated&&EK(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function EK({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function dL(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Ii.schemaHasRulesButRef)(s,u))){i.block(()=>_L(t,"$ref",u.all.$ref.definition));return}c.jtd||wK(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Hb.shouldUseGroup)(s,f)&&(f.type?(i.if((0,Xh.checkDataType)(f.type,o,c.strictNumbers)),fL(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,Xh.reportTypeError)(t)),i.endIf()):fL(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function fL(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,pK.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Hb.shouldUseRule)(n,s)&&_L(t,s.keyword,s.definition,e.type)})}function wK(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(CK(t,e),t.opts.allowUnionTypes||DK(t,e),AK(t,t.dataTypes))}function CK(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{bL(t.dataTypes,r)||Vb(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),OK(t,e)}}function DK(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Vb(t,"use allowUnionTypes to allow union type keyword")}function AK(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Hb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>IK(e,o))&&Vb(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function IK(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function bL(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function OK(t,e){let r=[];for(let n of t.dataTypes)bL(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Vb(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ii.checkStrictMode)(t,e,t.opts.strictTypes)}var Jh=class{constructor(e,r,n){if((0,Xl.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ii.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",SL(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Xl.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}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:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Kl.reportExtraError:Kl.reportError)(this,this.def.error,r)}$dataError(){(0,Kl.reportError)(this,this.def.$dataError||Kl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Kl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,oe.or)(o(),a());function o(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,Xh.checkDataTypes)(c,r,s.opts.strictNumbers,Xh.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,Ub.getSubschema)(this.it,e);(0,Ub.extendSubschemaData)(n,this.it,e),(0,Ub.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return bK(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ii.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ii.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};Ps.KeywordCxt=Jh;function _L(t,e,r,n){let i=new Jh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Xl.funcKeywordCode)(i,r):"macro"in r?(0,Xl.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Xl.funcKeywordCode)(i,r)}var xK=/^\/(?:[^~]|~0|~1)*$/,MK=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function SL(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!xK.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=pe.default.rootData}else{let l=MK.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let l of a)l&&(s=(0,oe._)`${s}${(0,oe.getProperty)((0,Ii.unescapeJsonPointer)(l))}`,o=(0,oe._)`${o} && ${s}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Ps.getData=SL});var Qh=R(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var zb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Wb.default=zb});var Ql=R(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var Gb=Yl(),Yb=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Gb.resolveUrl)(e,r,n),this.missingSchema=(0,Gb.normalizeId)((0,Gb.getFullPath)(e,this.missingRef))}};Kb.default=Yb});var Zl=R(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.resolveSchema=yn.getCompilingSchema=yn.resolveRef=yn.compileSchema=yn.SchemaEnv=void 0;var Fn=Te(),qK=Qh(),oo=mn(),jn=Yl(),NL=ke(),LK=Jl(),qa=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,jn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};yn.SchemaEnv=qa;function Jb(t){let e=RL.call(this,t);if(e)return e;let r=(0,jn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Fn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:qK.default,code:(0,Fn._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:oo.default.data,parentData:oo.default.parentData,parentDataProperty:oo.default.parentDataProperty,dataNames:[oo.default.data],dataPathArr:[Fn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Fn.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Fn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Fn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,LK.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(oo.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${oo.default.self}`,`${oo.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:h}=l;p.evaluated={props:g instanceof Fn.Name?void 0:g,items:h instanceof Fn.Name?void 0:h,dynamicProps:g instanceof Fn.Name,dynamicItems:h instanceof Fn.Name},p.source&&(p.source.evaluated=(0,Fn.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}yn.compileSchema=Jb;function $K(t,e,r){var n;r=(0,jn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=jK.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new qa({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=BK.call(this,s)}yn.resolveRef=$K;function BK(t){return(0,jn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Jb.call(this,t)}function RL(t){for(let e of this._compilations)if(FK(e,t))return e}yn.getCompilingSchema=RL;function FK(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function jK(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Zh.call(this,t,e)}function Zh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,jn._getFullPath)(this.opts.uriResolver,r),i=(0,jn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Xb.call(this,r,t);let s=(0,jn.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Zh.call(this,t,o);return typeof a?.schema!="object"?void 0:Xb.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||Jb.call(this,o),s===(0,jn.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,jn.resolveUrl)(this.opts.uriResolver,i,l)),new qa({schema:a,schemaId:c,root:t,baseId:i})}return Xb.call(this,r,o)}}yn.resolveSchema=Zh;var UK=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Xb(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,NL.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!UK.has(a)&&l&&(e=(0,jn.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,NL.schemaHasRulesButRef)(r,this.RULES)){let a=(0,jn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Zh.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new qa({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var PL=R((iPe,HK)=>{HK.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 EL=R((sPe,kL)=>{"use strict";var VK={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};kL.exports={HEX:VK}});var ML=R((oPe,xL)=>{"use strict";var{HEX:zK}=EL(),WK=/^(?:(?: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 AL(t){if(OL(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(WK)||[],[r]=e;return r?{host:YK(r,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function Qb(t,e=!1){let r="",n=!0;for(let i of t){if(zK[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return e&&r.length===0&&(r="0"),r}function GK(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=!1;function c(){if(i.length){if(s===!1){let l=Qb(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,n.push(":"),e>7){r.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;s=!0}else{i.push(u);continue}}return i.length&&(s?r.zone=i.join(""):a?n.push(i.join("")):n.push(Qb(i))),r.address=n.join(""),r}function IL(t){if(OL(t,":")<2)return{host:t,isIPV6:!1};let e=GK(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,escapedHost:n,isIPV6:!0}}}function YK(t,e){let r="",n=!0,i=t.length;for(let s=0;s<i;s++){let o=t[s];o==="0"&&n?(s+1<=i&&t[s+1]===e||s+1===i)&&(r+=o,n=!1):(o===e?n=!0:n=!1,r+=o)}return r}function OL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}var wL=/^\.\.?\//u,CL=/^\/\.(?:\/|$)/u,DL=/^\/\.\.(?:\/|$)/u,KK=/^\/?(?:.|\n)*?(?=\/|$)/u;function XK(t){let e=[];for(;t.length;)if(t.match(wL))t=t.replace(wL,"");else if(t.match(CL))t=t.replace(CL,"/");else if(t.match(DL))t=t.replace(DL,"/"),e.pop();else if(t==="."||t==="..")t="";else{let r=t.match(KK);if(r){let n=r[0];t=t.slice(n.length),e.push(n)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function JK(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function QK(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host),n=AL(r);if(n.isIPV4)r=n.host;else{let i=IL(n.host);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}xL.exports={recomposeAuthority:QK,normalizeComponentEncoding:JK,removeDotSegments:XK,normalizeIPv4:AL,normalizeIPv6:IL,stringArrayToHexStripped:Qb}});var jL=R((aPe,FL)=>{"use strict";var ZK=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,e3=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function qL(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function LL(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function $L(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function t3(t){return t.secure=qL(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function r3(t){if((t.port===(qL(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function n3(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(e3);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=Zb[i];t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function i3(t,e){let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=Zb[i];s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function s3(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!ZK.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function o3(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var BL={scheme:"http",domainHost:!0,parse:LL,serialize:$L},a3={scheme:"https",domainHost:BL.domainHost,parse:LL,serialize:$L},em={scheme:"ws",domainHost:!0,parse:t3,serialize:r3},c3={scheme:"wss",domainHost:em.domainHost,parse:em.parse,serialize:em.serialize},l3={scheme:"urn",parse:n3,serialize:i3,skipNormalize:!0},u3={scheme:"urn:uuid",parse:s3,serialize:o3,skipNormalize:!0},Zb={http:BL,https:a3,ws:em,wss:c3,urn:l3,"urn:uuid":u3};FL.exports=Zb});var HL=R((cPe,rm)=>{"use strict";var{normalizeIPv6:d3,normalizeIPv4:f3,removeDotSegments:eu,recomposeAuthority:p3,normalizeComponentEncoding:tm}=ML(),e_=jL();function h3(t,e){return typeof t=="string"?t=ui(Oi(t,e),e):typeof t=="object"&&(t=Oi(ui(t,e),e)),t}function m3(t,e,r){let n=Object.assign({scheme:"null"},r),i=UL(Oi(t,n),Oi(e,n),n,!0);return ui(i,{...n,skipEscape:!0})}function UL(t,e,r,n){let i={};return n||(t=Oi(ui(t,r),r),e=Oi(ui(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=eu(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=eu(e.path||""),i.query=e.query):(e.path?(e.path.charAt(0)==="/"?i.path=eu(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=eu(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function g3(t,e,r){return typeof t=="string"?(t=unescape(t),t=ui(tm(Oi(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=ui(tm(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=ui(tm(Oi(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=ui(tm(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function ui(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=e_[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=p3(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=eu(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var y3=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function v3(t){let e=0;for(let r=0,n=t.length;r<n;++r)if(e=t.charCodeAt(r),e>126||y3[e])return!0;return!1}var T3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Oi(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=t.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(t=(r.scheme?r.scheme+":":"")+"//"+t);let o=t.match(T3);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host){let c=f3(n.host);if(c.isIPV4===!1){let l=d3(c.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=c.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=e_[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&v3(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var t_={SCHEMES:e_,normalize:h3,resolve:m3,resolveComponents:UL,equal:g3,serialize:ui,parse:Oi};rm.exports=t_;rm.exports.default=t_;rm.exports.fastUri=t_});var zL=R(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});var VL=HL();VL.code='require("ajv/dist/runtime/uri").default';r_.default=VL});var ZL=R(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CodeGen=nr.Name=nr.nil=nr.stringify=nr.str=nr._=nr.KeywordCxt=void 0;var b3=Jl();Object.defineProperty(nr,"KeywordCxt",{enumerable:!0,get:function(){return b3.KeywordCxt}});var La=Te();Object.defineProperty(nr,"_",{enumerable:!0,get:function(){return La._}});Object.defineProperty(nr,"str",{enumerable:!0,get:function(){return La.str}});Object.defineProperty(nr,"stringify",{enumerable:!0,get:function(){return La.stringify}});Object.defineProperty(nr,"nil",{enumerable:!0,get:function(){return La.nil}});Object.defineProperty(nr,"Name",{enumerable:!0,get:function(){return La.Name}});Object.defineProperty(nr,"CodeGen",{enumerable:!0,get:function(){return La.CodeGen}});var _3=Qh(),XL=Ql(),S3=Ib(),tu=Zl(),N3=Te(),ru=Yl(),nm=Gl(),i_=ke(),WL=PL(),R3=zL(),JL=(t,e)=>new RegExp(t,e);JL.code="new RegExp";var P3=["removeAdditional","useDefaults","coerceTypes"],k3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E3={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."},w3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},GL=200;function C3(t){var e,r,n,i,s,o,a,c,l,u,d,f,p,g,h,v,S,_,T,P,C,$,F,U,me;let Xe=t.strict,Ft=(e=t.code)===null||e===void 0?void 0:e.optimize,Ne=Ft===!0||Ft===void 0?1:Ft||0,Kr=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:JL,xi=(i=t.uriResolver)!==null&&i!==void 0?i:R3.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:Xe)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Xe)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Xe)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Xe)!==null&&f!==void 0?f:"log",strictRequired:(g=(p=t.strictRequired)!==null&&p!==void 0?p:Xe)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:Ne,regExp:Kr}:{optimize:Ne,regExp:Kr},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:GL,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:GL,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(P=t.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:($=t.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(F=t.validateFormats)!==null&&F!==void 0?F:!0,unicodeRegExp:(U=t.unicodeRegExp)!==null&&U!==void 0?U:!0,int32range:(me=t.int32range)!==null&&me!==void 0?me:!0,uriResolver:xi}}var nu=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...C3(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new N3.ValueScope({scope:{},prefixes:k3,es5:r,lines:n}),this.logger=M3(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,S3.getRules)(),YL.call(this,E3,e,"NOT SUPPORTED"),YL.call(this,w3,e,"DEPRECATED","warn"),this._metaOpts=O3.call(this),e.formats&&A3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&I3.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),D3.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=WL;n==="id"&&(i={...WL},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await s.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof XL.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 s.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,ru.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=KL.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new tu.SchemaEnv({schema:{},schemaId:n});if(r=tu.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}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 r=KL.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,ru.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L3.call(this,n,r),!r)return(0,i_.eachItem)(n,s=>n_.call(this,s)),this;B3.call(this,r);let i={...r,type:(0,nm.getJSONTypes)(r.type),schemaType:(0,nm.getJSONTypes)(r.schemaType)};return(0,i_.eachItem)(n,i.type.length===0?s=>n_.call(this,s,i):s=>i.type.forEach(o=>n_.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=QL(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=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;n=(0,ru.normalizeId)(o||n);let l=ru.getSchemaRefs.call(this,e,n);return c=new tu.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&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):tu.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{tu.compileSchema.call(this,e)}finally{this.opts=r}}};nu.ValidationError=_3.default;nu.MissingRefError=XL.default;nr.default=nu;function YL(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function KL(t){return t=(0,ru.normalizeId)(t),this.schemas[t]||this.refs[t]}function D3(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function A3(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function I3(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function O3(){let t={...this.opts};for(let e of P3)delete t[e];return t}var x3={log(){},warn(){},error(){}};function M3(t){if(t===!1)return x3;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var q3=/^[a-z_$][a-z0-9_$:-]*$/i;function L3(t,e){let{RULES:r}=this;if((0,i_.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!q3.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function n_(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,nm.getJSONTypes)(e.type),schemaType:(0,nm.getJSONTypes)(e.schemaType)}};e.before?$3.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function $3(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function B3(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=QL(e)),t.validateSchema=this.compile(e,!0))}var F3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function QL(t){return{anyOf:[t,F3]}}});var e1=R(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});var j3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};s_.default=j3});var om=R(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.callRef=ao.getValidate=void 0;var U3=Ql(),t1=gn(),Br=Te(),$a=mn(),r1=Zl(),im=ke(),H3={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=r1.resolveRef.call(c,l,i,r);if(u===void 0)throw new U3.default(n.opts.uriResolver,i,r);if(u instanceof r1.SchemaEnv)return f(u);return p(u);function d(){if(s===l)return sm(t,o,s,s.$async);let g=e.scopeValue("root",{ref:l});return sm(t,(0,Br._)`${g}.validate`,l,l.$async)}function f(g){let h=n1(t,g);sm(t,h,g,g.$async)}function p(g){let h=e.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Br.stringify)(g)}:{ref:g}),v=e.name("valid"),S=t.subschema({schema:g,dataTypes:[],schemaPath:Br.nil,topSchemaRef:h,errSchemaPath:r},v);t.mergeEvaluated(S),t.ok(v)}}};function n1(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Br._)`${r.scopeValue("wrapper",{ref:e})}.validate`}ao.getValidate=n1;function sm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?$a.default.this:Br.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=i.let("valid");i.try(()=>{i.code((0,Br._)`await ${(0,t1.callValidateCode)(t,e,l)}`),p(e),o||i.assign(g,!0)},h=>{i.if((0,Br._)`!(${h} instanceof ${s.ValidationError})`,()=>i.throw(h)),f(h),o||i.assign(g,!1)}),t.ok(g)}function d(){t.result((0,t1.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(g){let h=(0,Br._)`${g}.errors`;i.assign($a.default.vErrors,(0,Br._)`${$a.default.vErrors} === null ? ${h} : ${$a.default.vErrors}.concat(${h})`),i.assign($a.default.errors,(0,Br._)`${$a.default.vErrors}.length`)}function p(g){var h;if(!s.opts.unevaluated)return;let v=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=im.mergeEvaluated.props(i,v.props,s.props));else{let S=i.var("props",(0,Br._)`${g}.evaluated.props`);s.props=im.mergeEvaluated.props(i,S,s.props,Br.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=im.mergeEvaluated.items(i,v.items,s.items));else{let S=i.var("items",(0,Br._)`${g}.evaluated.items`);s.items=im.mergeEvaluated.items(i,S,s.items,Br.Name)}}}ao.callRef=sm;ao.default=H3});var i1=R(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});var V3=e1(),z3=om(),W3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",V3.default,z3.default];o_.default=W3});var s1=R(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var am=Te(),ks=am.operators,cm={maximum:{okStr:"<=",ok:ks.LTE,fail:ks.GT},minimum:{okStr:">=",ok:ks.GTE,fail:ks.LT},exclusiveMaximum:{okStr:"<",ok:ks.LT,fail:ks.GTE},exclusiveMinimum:{okStr:">",ok:ks.GT,fail:ks.LTE}},G3={message:({keyword:t,schemaCode:e})=>(0,am.str)`must be ${cm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,am._)`{comparison: ${cm[t].okStr}, limit: ${e}}`},Y3={keyword:Object.keys(cm),type:"number",schemaType:"number",$data:!0,error:G3,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,am._)`${r} ${cm[e].fail} ${n} || isNaN(${r})`)}};a_.default=Y3});var o1=R(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});var iu=Te(),K3={message:({schemaCode:t})=>(0,iu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,iu._)`{multipleOf: ${t}}`},X3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:K3,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,iu._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,iu._)`${o} !== parseInt(${o})`;t.fail$data((0,iu._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};c_.default=X3});var c1=R(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});function a1(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}l_.default=a1;a1.code='require("ajv/dist/runtime/ucs2length").default'});var l1=R(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var co=Te(),J3=ke(),Q3=c1(),Z3={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,co.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,co._)`{limit: ${t}}`},eX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Z3,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?co.operators.GT:co.operators.LT,o=i.opts.unicode===!1?(0,co._)`${r}.length`:(0,co._)`${(0,J3.useFunc)(t.gen,Q3.default)}(${r})`;t.fail$data((0,co._)`${o} ${s} ${n}`)}};u_.default=eX});var u1=R(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var tX=gn(),lm=Te(),rX={message:({schemaCode:t})=>(0,lm.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,lm._)`{pattern: ${t}}`},nX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:rX,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,o=s.opts.unicodeRegExp?"u":"",a=r?(0,lm._)`(new RegExp(${i}, ${o}))`:(0,tX.usePattern)(t,n);t.fail$data((0,lm._)`!${a}.test(${e})`)}};d_.default=nX});var d1=R(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var su=Te(),iX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,su.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,su._)`{limit: ${t}}`},sX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:iX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?su.operators.GT:su.operators.LT;t.fail$data((0,su._)`Object.keys(${r}).length ${i} ${n}`)}};f_.default=sX});var f1=R(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var ou=gn(),au=Te(),oX=ke(),aX={message:({params:{missingProperty:t}})=>(0,au.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,au._)`{missingProperty: ${t}}`},cX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:aX,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:g}=t.it;for(let h of r)if(p?.[h]===void 0&&!g.has(h)){let v=o.schemaEnv.baseId+o.errSchemaPath,S=`required property "${h}" is not defined at "${v}" (strictRequired)`;(0,oX.checkStrictMode)(o,S,o.opts.strictRequired)}}function l(){if(c||s)t.block$data(au.nil,d);else for(let p of r)(0,ou.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||s){let g=e.let("valid",!0);t.block$data(g,()=>f(p,g)),t.ok(g)}else e.if((0,ou.checkMissingProp)(t,r,p)),(0,ou.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,ou.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,g){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(g,(0,ou.propertyInData)(e,i,p,a.ownProperties)),e.if((0,au.not)(g),()=>{t.error(),e.break()})},au.nil)}}};p_.default=cX});var p1=R(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var cu=Te(),lX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,cu.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,cu._)`{limit: ${t}}`},uX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:lX,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?cu.operators.GT:cu.operators.LT;t.fail$data((0,cu._)`${r}.length ${i} ${n}`)}};h_.default=uX});var um=R(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var h1=Fb();h1.code='require("ajv/dist/runtime/equal").default';m_.default=h1});var m1=R(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var g_=Gl(),ir=Te(),dX=ke(),fX=um(),pX={message:({params:{i:t,j:e}})=>(0,ir.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ir._)`{i: ${t}, j: ${e}}`},hX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:pX,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=s.items?(0,g_.getSchemaTypes)(s.items):[];t.block$data(c,u,(0,ir._)`${o} === false`),t.ok(c);function u(){let g=e.let("i",(0,ir._)`${r}.length`),h=e.let("j");t.setParams({i:g,j:h}),e.assign(c,!0),e.if((0,ir._)`${g} > 1`,()=>(d()?f:p)(g,h))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function f(g,h){let v=e.name("item"),S=(0,g_.checkDataTypes)(l,v,a.opts.strictNumbers,g_.DataType.Wrong),_=e.const("indices",(0,ir._)`{}`);e.for((0,ir._)`;${g}--;`,()=>{e.let(v,(0,ir._)`${r}[${g}]`),e.if(S,(0,ir._)`continue`),l.length>1&&e.if((0,ir._)`typeof ${v} == "string"`,(0,ir._)`${v} += "_"`),e.if((0,ir._)`typeof ${_}[${v}] == "number"`,()=>{e.assign(h,(0,ir._)`${_}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,ir._)`${_}[${v}] = ${g}`)})}function p(g,h){let v=(0,dX.useFunc)(e,fX.default),S=e.name("outer");e.label(S).for((0,ir._)`;${g}--;`,()=>e.for((0,ir._)`${h} = ${g}; ${h}--;`,()=>e.if((0,ir._)`${v}(${r}[${g}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};y_.default=hX});var g1=R(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var v_=Te(),mX=ke(),gX=um(),yX={message:"must be equal to constant",params:({schemaCode:t})=>(0,v_._)`{allowedValue: ${t}}`},vX={keyword:"const",$data:!0,error:yX,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,v_._)`!${(0,mX.useFunc)(e,gX.default)}(${r}, ${i})`):t.fail((0,v_._)`${s} !== ${r}`)}};T_.default=vX});var y1=R(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var lu=Te(),TX=ke(),bX=um(),_X={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,lu._)`{allowedValues: ${t}}`},SX={keyword:"enum",schemaType:"array",$data:!0,error:_X,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,TX.useFunc)(e,bX.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",s);u=(0,lu.or)(...i.map((g,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",s,p=>e.if((0,lu._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,g){let h=i[g];return typeof h=="object"&&h!==null?(0,lu._)`${l()}(${r}, ${p}[${g}])`:(0,lu._)`${r} === ${h}`}}};b_.default=SX});var v1=R(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var NX=s1(),RX=o1(),PX=l1(),kX=u1(),EX=d1(),wX=f1(),CX=p1(),DX=m1(),AX=g1(),IX=y1(),OX=[NX.default,RX.default,PX.default,kX.default,EX.default,wX.default,CX.default,DX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AX.default,IX.default];__.default=OX});var N_=R(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.validateAdditionalItems=void 0;var lo=Te(),S_=ke(),xX={message:({params:{len:t}})=>(0,lo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,lo._)`{limit: ${t}}`},MX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:xX,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,S_.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}T1(t,n)}};function T1(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,lo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,lo._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,S_.alwaysValidSchema)(o,n)){let l=r.var("valid",(0,lo._)`${a} <= ${e.length}`);r.if((0,lo.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:S_.Type.Num},l),o.allErrors||r.if((0,lo.not)(l),()=>r.break())})}}uu.validateAdditionalItems=T1;uu.default=MX});var R_=R(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.validateTuple=void 0;var b1=Te(),dm=ke(),qX=gn(),LX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return _1(t,"additionalItems",e);r.items=!0,!(0,dm.alwaysValidSchema)(r,e)&&t.ok((0,qX.validateArray)(t))}};function _1(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=dm.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,b1._)`${s}.length`);r.forEach((d,f)=>{(0,dm.alwaysValidSchema)(a,d)||(n.if((0,b1._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,g=r.length,h=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let v=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,dm.checkStrictMode)(a,v,f.strictTuples)}}}du.validateTuple=_1;du.default=LX});var S1=R(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var $X=R_(),BX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,$X.validateTuple)(t,"items")};P_.default=BX});var R1=R(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var N1=Te(),FX=ke(),jX=gn(),UX=N_(),HX={message:({params:{len:t}})=>(0,N1.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,N1._)`{limit: ${t}}`},VX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:HX,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,FX.alwaysValidSchema)(n,e)&&(i?(0,UX.validateAdditionalItems)(t,i):t.ok((0,jX.validateArray)(t)))}};k_.default=VX});var P1=R(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});var vn=Te(),fm=ke(),zX={message:({params:{min:t,max:e}})=>e===void 0?(0,vn.str)`must contain at least ${t} valid item(s)`:(0,vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,vn._)`{minContains: ${t}}`:(0,vn._)`{minContains: ${t}, maxContains: ${e}}`},WX={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:zX,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:c,maxContains:l}=n;s.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,vn._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,fm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,fm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,fm.alwaysValidSchema)(s,r)){let h=(0,vn._)`${u} >= ${o}`;a!==void 0&&(h=(0,vn._)`${h} && ${u} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,vn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),v=e.let("count",0);p(h,()=>e.if(h,()=>g(v)))}function p(h,v){e.forRange("i",0,u,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:fm.Type.Num,compositeRule:!0},h),v()})}function g(h){e.code((0,vn._)`${h}++`),a===void 0?e.if((0,vn._)`${h} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,vn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,vn._)`${h} >= ${o}`,()=>e.assign(d,!0)))}}};E_.default=WX});var pm=R(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.validateSchemaDeps=di.validatePropertyDeps=di.error=void 0;var w_=Te(),GX=ke(),fu=gn();di.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,w_.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,w_._)`{property: ${t},
|
|
180
180
|
missingProperty: ${n},
|
|
181
181
|
depsCount: ${e},
|
|
182
|
-
deps: ${r}}`};var t4={keyword:"dependencies",type:"object",schemaType:"object",error:pi.error,code(t){let[e,r]=r4(t);O1(t,e),x1(t,r)}};function r4({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function O1(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,bu.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,bu.checkReportMissingProp)(t,l)}):(r.if((0,L_._)`${c} && (${(0,bu.checkMissingProp)(t,a,s)})`),(0,bu.reportMissingProp)(t,s),r.else())}}pi.validatePropertyDeps=O1;function x1(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,e4.alwaysValidSchema)(s,e[a])||(r.if((0,bu.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}pi.validateSchemaDeps=x1;pi.default=t4});var q1=P($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var M1=Te(),n4=Ee(),i4={message:"property name must be valid",params:({params:t})=>(0,M1._)`{propertyName: ${t.propertyName}}`},s4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:i4,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,n4.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,M1.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};$_.default=s4});var F_=P(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var Sm=yn(),Hn=Te(),o4=gn(),Nm=Ee(),a4={message:"must NOT have additional properties",params:({params:t})=>(0,Hn._)`{additionalProperty: ${t.additionalProperty}}`},c4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Nm.alwaysValidSchema)(o,r))return;let l=(0,Sm.allSchemaProperties)(n.properties),u=(0,Sm.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Hn._)`${s} === ${o4.default.errors}`);function d(){e.forIn("key",i,v=>{!l.length&&!u.length?y(v):e.if(f(v),()=>y(v))})}function f(v){let S;if(l.length>8){let _=(0,Nm.schemaRefOrVal)(o,n.properties,"properties");S=(0,Sm.isOwnProperty)(e,_,v)}else l.length?S=(0,Hn.or)(...l.map(_=>(0,Hn._)`${v} === ${_}`)):S=Hn.nil;return u.length&&(S=(0,Hn.or)(S,...u.map(_=>(0,Hn._)`${(0,Sm.usePattern)(t,_)}.test(${v})`))),(0,Hn.not)(S)}function p(v){e.code((0,Hn._)`delete ${i}[${v}]`)}function y(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Nm.alwaysValidSchema)(o,r)){let S=e.name("valid");c.removeAdditional==="failing"?(h(v,S,!1),e.if((0,Hn.not)(S),()=>{t.reset(),p(v)})):(h(v,S),a||e.if((0,Hn.not)(S),()=>e.break()))}}function h(v,S,_){let T={keyword:"additionalProperties",dataProp:v,dataPropType:Nm.Type.Str};_===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,S)}}};B_.default=c4});var B1=P(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var l4=su(),L1=yn(),j_=Ee(),$1=F_(),u4={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&$1.default.code(new l4.KeywordCxt(s,$1.default,"additionalProperties"));let o=(0,L1.allSchemaProperties)(r);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=j_.mergeEvaluated.props(e,(0,j_.toHash)(o),s.props));let a=o.filter(d=>!(0,j_.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,L1.propertyInData)(e,i,d,s.opts.ownProperties)),u(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};U_.default=u4});var H1=P(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var F1=yn(),Pm=Te(),j1=Ee(),U1=Ee(),d4={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,F1.allSchemaProperties)(r),c=a.filter(h=>(0,j1.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof Pm.Name)&&(s.props=(0,U1.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let h of a)l&&p(h),s.allErrors?y(h):(e.var(u,!0),y(h),e.if(u))}function p(h){for(let v in l)new RegExp(h).test(v)&&(0,j1.checkStrictMode)(s,`property ${v} matches pattern ${h} (use allowMatchingProperties)`)}function y(h){e.forIn("key",n,v=>{e.if((0,Pm._)`${(0,F1.usePattern)(t,h)}.test(${v})`,()=>{let S=c.includes(h);S||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:v,dataPropType:U1.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,Pm._)`${d}[${v}]`,!0):!S&&!s.allErrors&&e.if((0,Pm.not)(u),()=>e.break())})})}}};H_.default=d4});var V1=P(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var f4=Ee(),p4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,f4.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};V_.default=p4});var z1=P(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var h4=yn(),m4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:h4.validateUnion,error:{message:"must match a schema in anyOf"}};z_.default=m4});var W1=P(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var Rm=Te(),g4=Ee(),y4={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Rm._)`{passingSchemas: ${t.passing}}`},v4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:y4,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){s.forEach((u,d)=>{let f;(0,g4.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Rm._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Rm._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,Rm.Name)})})}}};W_.default=v4});var G1=P(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});var T4=Ee(),b4={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,T4.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};G_.default=b4});var X1=P(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var Em=Te(),K1=Ee(),_4={message:({params:t})=>(0,Em.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Em._)`{failingKeyword: ${t.ifClause}}`},S4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:_4,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,K1.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Y1(n,"then"),s=Y1(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,Em.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,Em._)`${u}`):t.setParams({ifClause:u})}}}};function Y1(t,e){let r=t.schema[e];return r!==void 0&&!(0,K1.alwaysValidSchema)(t,r)}Y_.default=S4});var J1=P(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var N4=Ee(),P4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,N4.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};K_.default=P4});var Q1=P(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var R4=I_(),E4=C1(),w4=O_(),k4=A1(),C4=I1(),D4=_m(),A4=q1(),I4=F_(),O4=B1(),x4=H1(),M4=V1(),q4=z1(),L4=W1(),$4=G1(),B4=X1(),F4=J1();function j4(t=!1){let e=[M4.default,q4.default,L4.default,$4.default,B4.default,F4.default,A4.default,I4.default,D4.default,O4.default,x4.default];return t?e.push(E4.default,k4.default):e.push(R4.default,w4.default),e.push(C4.default),e}X_.default=j4});var Z1=P(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});var Ot=Te(),U4={message:({schemaCode:t})=>(0,Ot.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ot._)`{format: ${t}}`},H4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:U4,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let y=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Ot._)`${y}[${o}]`),v=r.let("fType"),S=r.let("format");r.if((0,Ot._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(v,(0,Ot._)`${h}.type || "string"`).assign(S,(0,Ot._)`${h}.validate`),()=>r.assign(v,(0,Ot._)`"string"`).assign(S,h)),t.fail$data((0,Ot.or)(_(),T()));function _(){return c.strictSchema===!1?Ot.nil:(0,Ot._)`${o} && !${S}`}function T(){let R=u.$async?(0,Ot._)`(${h}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Ot._)`${S}(${n})`,C=(0,Ot._)`(typeof ${S} == "function" ? ${R} : ${S}.test(${n}))`;return(0,Ot._)`${S} && ${S} !== true && ${v} === ${e} && !${C}`}}function p(){let y=d.formats[s];if(!y){_();return}if(y===!0)return;let[h,v,S]=T(y);h===e&&t.pass(R());function _(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function T(C){let B=C instanceof RegExp?(0,Ot.regexpCode)(C):c.code.formats?(0,Ot._)`${c.code.formats}${(0,Ot.getProperty)(s)}`:void 0,U=r.scopeValue("formats",{key:s,ref:C,code:B});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,Ot._)`${U}.validate`]:["string",C,U]}function R(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ot._)`await ${S}(${n})`}return typeof v=="function"?(0,Ot._)`${S}(${n})`:(0,Ot._)`${S}.test(${n})`}}}};J_.default=H4});var e$=P(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});var V4=Z1(),z4=[V4.default];Q_.default=z4});var t$=P(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.contentVocabulary=Ga.metadataVocabulary=void 0;Ga.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ga.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n$=P(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var W4=d1(),G4=R1(),Y4=Q1(),K4=e$(),r$=t$(),X4=[W4.default,G4.default,(0,Y4.default)(),K4.default,r$.metadataVocabulary,r$.contentVocabulary];Z_.default=X4});var tS=P(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.dynamicAnchor=void 0;var eS=Te(),J4=gn(),i$=au(),Q4=hm(),Z4={keyword:"$dynamicAnchor",schemaType:"string",code:t=>s$(t,t.schema)};function s$(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,eS._)`${J4.default.dynamicAnchors}${(0,eS.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:e9(t);r.if((0,eS._)`!${i}`,()=>r.assign(i,s))}_u.dynamicAnchor=s$;function e9(t){let{schemaEnv:e,schema:r,self:n}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new i$.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return i$.compileSchema.call(n,l),(0,Q4.getValidate)(t,l)}_u.default=Z4});var rS=P(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.dynamicRef=void 0;var o$=Te(),t9=gn(),a$=hm(),r9={keyword:"$dynamicRef",schemaType:"string",code:t=>c$(t,t.schema)};function c$(t,e){let{gen:r,keyword:n,it:i}=t;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,o$._)`${t9.default.dynamicAnchors}${(0,o$.getProperty)(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{(0,a$.callRef)(t,c),r.let(l,!0)}):()=>(0,a$.callRef)(t,c)}}Su.dynamicRef=c$;Su.default=r9});var l$=P(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var n9=tS(),i9=Ee(),s9={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,n9.dynamicAnchor)(t,""):(0,i9.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};nS.default=s9});var u$=P(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var o9=rS(),a9={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,o9.dynamicRef)(t,t.schema)};iS.default=a9});var d$=P(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});var c9=tS(),l9=rS(),u9=l$(),d9=u$(),f9=[c9.default,l9.default,u9.default,d9.default];sS.default=f9});var p$=P(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var f$=_m(),p9={keyword:"dependentRequired",type:"object",schemaType:"object",error:f$.error,code:t=>(0,f$.validatePropertyDeps)(t)};oS.default=p9});var h$=P(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var h9=_m(),m9={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,h9.validateSchemaDeps)(t)};aS.default=m9});var m$=P(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var g9=Ee(),y9={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,g9.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};cS.default=y9});var g$=P(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});var v9=p$(),T9=h$(),b9=m$(),_9=[v9.default,T9.default,b9.default];lS.default=_9});var v$=P(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});var As=Te(),y$=Ee(),S9=gn(),N9={message:"must NOT have unevaluated properties",params:({params:t})=>(0,As._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},P9={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:N9,code(t){let{gen:e,schema:r,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof As.Name?e.if((0,As._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,As._)`${i} === ${S9.default.errors}`);function c(d){if(r===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,y$.alwaysValidSchema)(s,r)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:y$.Type.Str},f),o||e.if((0,As.not)(f),()=>e.break())}}function l(d,f){return(0,As._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let y in d)d[y]===!0&&p.push((0,As._)`${f} !== ${y}`);return(0,As.and)(...p)}}};uS.default=P9});var b$=P(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var go=Te(),T$=Ee(),R9={message:({params:{len:t}})=>(0,go.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,go._)`{limit: ${t}}`},E9={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:R9,code(t){let{gen:e,schema:r,data:n,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,go._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,go._)`${o} > ${s}`);else if(typeof r=="object"&&!(0,T$.alwaysValidSchema)(i,r)){let c=e.var("valid",(0,go._)`${o} <= ${s}`);e.if((0,go.not)(c),()=>a(c,s)),t.ok(c)}i.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:T$.Type.Num},c),i.allErrors||e.if((0,go.not)(c),()=>e.break())})}}};dS.default=E9});var _$=P(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});var w9=v$(),k9=b$(),C9=[w9.default,k9.default];fS.default=C9});var N$=P(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.DiscrError=void 0;var S$;(function(t){t.Tag="tag",t.Mapping="mapping"})(S$||(wm.DiscrError=S$={}))});var R$=P(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var Ya=Te(),pS=N$(),P$=au(),D9=ou(),A9=Ee(),I9={message:({params:{discrError:t,tagName:e}})=>t===pS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ya._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},O9={keyword:"discriminator",type:"object",schemaType:"object",error:I9,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.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,Ya._)`${r}${(0,Ya.getProperty)(a)}`);e.if((0,Ya._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:pS.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let y in p)e.elseIf((0,Ya._)`${l} === ${y}`),e.assign(c,d(p[y]));e.else(),t.error(!1,{discrError:pS.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let y=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},y);return t.mergeEvaluated(h,Ya.Name),y}function f(){var p;let y={},h=S(i),v=!0;for(let R=0;R<o.length;R++){let C=o[R];if(C?.$ref&&!(0,A9.schemaHasRulesButRef)(C,s.self.RULES)){let U=C.$ref;if(C=P$.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,U),C instanceof P$.SchemaEnv&&(C=C.schema),C===void 0)throw new D9.default(s.opts.uriResolver,s.baseId,U)}let B=(p=C?.properties)===null||p===void 0?void 0:p[a];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(h||S(C)),_(B,R)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return y;function S({required:R}){return Array.isArray(R)&&R.includes(a)}function _(R,C){if(R.const)T(R.const,C);else if(R.enum)for(let B of R.enum)T(B,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(R,C){if(typeof R!="string"||R in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[R]=C}}}};hS.default=O9});var E$=P((vEe,x9)=>{x9.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 w$=P((TEe,M9)=>{M9.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 k$=P((bEe,q9)=>{q9.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 C$=P((_Ee,L9)=>{L9.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 D$=P((SEe,$9)=>{$9.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 A$=P((NEe,B9)=>{B9.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 I$=P((PEe,F9)=>{F9.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 O$=P(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var j9=E$(),U9=w$(),H9=k$(),V9=C$(),z9=D$(),W9=A$(),G9=I$(),Y9=["/properties"];function K9(t){return[j9,U9,H9,V9,e(this,z9),W9,e(this,G9)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,Y9):n}}mS.default=K9});var x$=P((vt,yS)=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.MissingRefError=vt.ValidationError=vt.CodeGen=vt.Name=vt.nil=vt.stringify=vt.str=vt._=vt.KeywordCxt=vt.Ajv2019=void 0;var X9=o1(),J9=n$(),Q9=d$(),Z9=g$(),eJ=_$(),tJ=R$(),rJ=O$(),gS="https://json-schema.org/draft/2019-09/schema",Ka=class extends X9.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(Q9.default),J9.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(Z9.default),this.addVocabulary(eJ.default),this.opts.discriminator&&this.addKeyword(tJ.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(rJ.default.call(this,e),this.refs["http://json-schema.org/schema"]=gS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gS)?gS:void 0)}};vt.Ajv2019=Ka;yS.exports=vt=Ka;yS.exports.Ajv2019=Ka;Object.defineProperty(vt,"__esModule",{value:!0});vt.default=Ka;var nJ=su();Object.defineProperty(vt,"KeywordCxt",{enumerable:!0,get:function(){return nJ.KeywordCxt}});var Xa=Te();Object.defineProperty(vt,"_",{enumerable:!0,get:function(){return Xa._}});Object.defineProperty(vt,"str",{enumerable:!0,get:function(){return Xa.str}});Object.defineProperty(vt,"stringify",{enumerable:!0,get:function(){return Xa.stringify}});Object.defineProperty(vt,"nil",{enumerable:!0,get:function(){return Xa.nil}});Object.defineProperty(vt,"Name",{enumerable:!0,get:function(){return Xa.Name}});Object.defineProperty(vt,"CodeGen",{enumerable:!0,get:function(){return Xa.CodeGen}});var iJ=om();Object.defineProperty(vt,"ValidationError",{enumerable:!0,get:function(){return iJ.default}});var sJ=ou();Object.defineProperty(vt,"MissingRefError",{enumerable:!0,get:function(){return sJ.default}})});var tc=require("path"),ut=M(fw());var lf=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=hw(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=pw(n.text,!1,s);if(c-a===u.length)for(let f=0,p=u.length;f<p;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=n.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=pw(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},Qi;(function(t){function e(i,s,o,a){return new lf(i,s,o,a)}t.create=e;function r(i,s,o){if(i instanceof lf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let o=i.getText(),a=Ly(s.map(Hj),(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=i.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=i.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=n})(Qi||(Qi={}));function Ly(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Ly(n,e),Ly(i,e);let s=0,o=0,a=0;for(;s<n.length&&o<i.length;)e(n[s],i[o])<=0?t[a++]=n[s++]:t[a++]=i[o++];for(;s<n.length;)t[a++]=n[s++];for(;o<i.length;)t[a++]=i[o++];return t}function pw(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function hw(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Hj(t){let e=hw(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var uf=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],df=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var By=M(require("url")),gw=require("crypto"),yw=require("path"),Nc=M(F());var $y=M(F());var Ar=M(F());var j=class{constructor(e){this._children=[];this.syntaxIssues=[];this.resetableIssues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}get issues(){return[...this.syntaxIssues,...this.resetableIssues]}resetIssues(){this.resetableIssues=[],this.children.forEach(e=>e.resetIssues())}get serializeIssues(){return this.issues.map(e=>e())}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}getTopMostAstNodeForFile(e){return fe(e,this.uri)?[this]:this.children.flatMap(r=>r.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getDocumentSymbols(e)??[]);if(!fe(this.uri,e))return[];let r=ce(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:r,selectionRange:r,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Ar.SymbolKind.File,Ar.SymbolKind.Class,Ar.SymbolKind.Constant].some(n=>n===e))return[];let r=ce(this);return[{location:Ar.Location.create(ve(this.uri),r),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(n=>n.getWorkspaceSymbols()??[]).filter(n=>n.kind===Ar.SymbolKind.File||n.kind===Ar.SymbolKind.Class||n.kind===Ar.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(r=>r.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(bi(this.semanticTokenType),_i(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this.children.push(e)),this.allDescendantsCache=void 0}isAncestorOf(e){return this.children.some(r=>r===e||r.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Ar.Range.create(Ar.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Ar.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}get serializeUri(){return ve(this.uri)}serialize(e){return{uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var we=class extends j{toJson(){return-1}resolve(e){return ff(this.toString(),e)}evaluate(e){return Ie(this.resolve(e))}isTrue(e){return Ie(`!!(${this.resolve(e)})`)}toPrettyString(e){let r=this.evaluate(e);return`${r.toString()} /* ${this.toString()}${typeof r=="number"?` = 0x${r.toString(16)}`:""} */`}serialize(e){return{type:"EXPRESSION",value:this.toString(),evaluated:this.evaluate(e),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Kn=class extends we{constructor(r,n,i){super();this.expression=r;this.wrapped=n;this.addChild(r),i&&(this.addChild(i.operator),this.addChild(i.expression),this.join=[],this.join?.push(i))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(r,n){this.addChild(r),this.addChild(n),this.join??=[],this.join?.push({operator:r,expression:n})}toString(){let r=this.children.map(n=>n.toString()).join(" ");return this.wrapped?`(${r})`:`${r}`}isTrue(r){let n=`(${this.children.map(i=>i instanceof we?i.resolve(r):i.toString()).join(" ")})`;return Ie(`!!${n}`)}};var Xn=class extends we{constructor(r,n,i){super(n);this.value=r;this.docSymbolsMeta={name:`param${i+1}`,kind:$y.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},kn=class extends we{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return fe(this.uri,r)?[{name:this.functionName.name,kind:$y.SymbolKind.Function,range:ce(this),selectionRange:ce(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(r)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(r=>r?.toString()??"<NULL>").join(",")})`}isTrue(r){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&r.has(this.params[0].value)):super.isTrue(r)}};var zs=(t,e,r=!0,n=!0)=>({start:{line:t?.pos.line??0,character:r?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var ce=t=>zs(t.tokenIndexes.start,t.tokenIndexes.end),vw=" ",Tw=t=>{vw=t},Go=()=>vw,bi=t=>uf.findIndex(e=>e===t),_i=t=>df.findIndex(e=>e===t),Fy=(t,e,r)=>!fe(t.uri,e)||r.line<t.pos.line?!1:r.line>t.pos.line?!0:r.character>t.pos.colEnd,Vj=(t,e,r)=>fe(t.uri,e)?r.line<t.pos.line?!0:r.line>t.pos.line?!1:r.character<t.pos.col:!1,sn=(t,e,r)=>!!(fe(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<r.line||t.tokenIndexes.start.pos.line===r.line&&t.tokenIndexes.start.pos.col<=r.character)&&(t.tokenIndexes.end.pos.line>r.line||t.tokenIndexes.end.pos.line===r.line&&t.tokenIndexes.end.pos.colEnd>=r.character)),bw=(t,e,r)=>!!(fe(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===r.line||t.tokenIndexes.end.pos.line===r.line)&&r.character>=t.tokenIndexes.end.pos.colEnd),_w=(t,e,r)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===r.line).at(-1);return i&&i.pos.col>=r.character?!1:e.tokenIndexes?.end===i};var Jn=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>sn(s,e,r));return n},Pc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].find(s=>Vj(s.lastToken,e,r));return n===t?void 0:n},Rc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>Fy(s.firstToken,e,r));return n===t?void 0:n},Y=(t,e,r=Nc.DiagnosticSeverity.Error,n=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:r,linkedTo:n.map(d=>({ast:d,templateStrings:[]})),tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:ce(c.astElement),message:c.issues?c.issues.map(Gj).join(" or "):"",source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.syntaxIssues.push(u),{raw:c,diagnostic:u}},jt=(t,e,r=Nc.DiagnosticSeverity.Error,n=[],i=void 0,s=[],o,a,c=[])=>{let l={issues:Array.isArray(t)?t:[t],astElement:e,severity:r,linkedTo:n.map((f,p)=>({ast:f,templateStrings:c.at(p)??[]})),tags:i,templateStrings:s,edit:o,codeActionTitle:a},u,d=()=>(u??={severity:l.severity,range:ce(l.astElement),message:Yj(l),source:"devicetree",tags:l.tags,relatedInformation:[...l.linkedTo.map(f=>({message:l.issues.map(p=>Kj(p,f.templateStrings)).join(" or "),location:{uri:ve(f.ast.uri),range:ce(f.ast)}}))]},u);return l.astElement.resetableIssues.push(d),{raw:l,diagnostic:d}},$=(t,e,r=Nc.DiagnosticSeverity.Error,n=[],i=void 0,s=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:r,linkedTo:n.map(d=>({ast:d,templateStrings:[]})),tags:i,templateStrings:s,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:ce(c.astElement),message:Xj(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(Jj).join(" or "),location:{uri:ve(d.ast.uri),range:ce(d.ast)}}))],source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.resetableIssues.push(u),{raw:c,diagnostic:u}},Sw=(t,e)=>[...t].sort((n,i)=>{let s=e.getSortKey(n),o=e.getSortKey(i);if(s===void 0||o===void 0)throw new Error("Sort keys must be set");if(s!==o)return s-o;if(!n.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return n.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?n.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:n.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function St(t,e,r){let n=De(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(n,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),r(o,l=>{let u=t.position;return fe(l.uri,n)?!!(l.tokenIndexes?.end&&(l.tokenIndexes.end.pos.line<u.line||l.tokenIndexes.end.pos.line===u.line&&l.tokenIndexes.end.pos.colEnd<=u.character)):a!==void 0&&(e.getSortKey(l)??-1)<=a})}function G(t,e){return{start:t,end:e??t}}var V=(t,e)=>t?.tokens.some(r=>r===e),nt=(t,e=!1)=>r=>r?.value&&(e?t.toLowerCase()===r.value.toLowerCase():t===r.value)?"yes":zj(t)(r),je=t=>e=>e?.tokens.some(r=>r===t)?"yes":"no",zj=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",Cn=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&fe(t.uri,e.uri),Gt=(t,e)=>t?.adjacentToken&&t.adjacentToken.value===e?.value||e?.adjacentToken&&e.adjacentToken.value===t?.value?!0:!!t&&!!e&&Cn(t,e)&&t.pos.colEnd===e.pos.col,mf=t=>t.map((e,r)=>({index:r,context:e,files:e.getContextFiles()})),on=(t,e,r,n)=>{if("id"in e){let s=t?.find(o=>o.id===e.id);return s||void 0}if("name"in e){let s=t?.find(o=>o.ctxNames.includes(e.name));return s||void 0}return r?.getContextFiles().find(s=>fe(s,e.uri))?r:mf(t).sort(s=>s.context.id===n?-1:0).find(s=>s.files.some(o=>fe(o,e.uri)))?.context},jy=(t,e)=>mf(t).filter(n=>n.files.some(i=>fe(i,e))).map(n=>n.context),Nw=t=>{let e=/^(\w+)\s+(.+)$/,r=/^(\w+)\(([^)]*)\)\s+(.+)$/,n=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;if(i=n.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(i=r.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},ff=(t,e)=>{let r=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),n=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=r(s),i=n(i),i=i.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(i!==s);return i};function Wj(t){return t.replace(/'(.)'/g,(e,r)=>r.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Ie(t){try{return(0,eval)(Wj(t))}catch(e){console.log(e instanceof Error?e.message:e)}return t}var ve=t=>By.default.pathToFileURL(t).toString(),De=t=>rt(By.default.fileURLToPath(t)),fe=(t,e)=>!t||!e?!1:t===e,rt=t=>(0,yw.normalize)(process.platform==="win32"?t.toLowerCase():t),Si=t=>(0,gw.createHash)("sha256").update([rt(t.dtsFile),...t.includePaths.map(rt),...t.overlays.map(rt),t.bindingType,...t.zephyrBindings.map(rt),...t.deviceOrgBindingsMetaSchema.map(rt),...t.deviceOrgTreeBindings.map(rt)].join(":")).digest("hex"),Gj=t=>{switch(t){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 49:return"Node name shall start with a lower or upper case character";case 50:return"Node unit address should not start with 0x";case 51:return"Node unit address should not end with with ULL";case 8:return"Expected node address";case 9:return"Expected node path";case 48:return"Expected node path reference";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 52:return"Unknown Node Address syntax";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},Yj=t=>t.issues.map(e=>{switch(e){case 0:return`Property "${t.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 "${t.templateStrings[0]}" has been defined`;case 8:return`No node with name "${t.templateStrings[0]}" could be found in "/${t.templateStrings[1]}".`;case 4:return`Label name "${t.templateStrings[0]}" already defined`;case 6:return`Property "${t.templateStrings[0]}" was deleted`;case 7:return`Node "${t.templateStrings[0]}" was deleted`;case 9:return`The following node "${t.templateStrings[1]}" shall be present in "${t.templateStrings[0]}" node.`;case 10:return`The following node "${t.templateStrings[0]}" address range collides with another node. Address start: "${t.templateStrings[1]}", end: "${t.templateStrings[2]}".`}}).join(" or "),Kj=(t,e)=>{switch(t){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";case 10:return`Node "${e[0]}". Address start: "${e[1]}", end: "${e[2]}".`;default:return"TODO"}},Xj=t=>t.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${t.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 ${t.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 27:return"INTRO name is not permitted under this node";case 34:return"INTRO name is not defined in the type binding for this node";case 10:return"INTRO address 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 ${t.templateStrings[1]}'`;case 18:return"INTRO value must be unique in the entire Devicetree";case 19:return`INTRO should have format ${t.templateStrings[1]}`;case 16:return`INTRO requires property "${t.templateStrings[1]}" in node path "${t.templateStrings[2]}"`;case 17:return"Unable to resolve interrupt parent node";case 20:return`INTRO should have format ${t.templateStrings[1]}`;case 21:return"Node is disabled";case 22:return"Unable to resolve handle";case 23:return`Unable to find "${t.templateStrings[0]}" in ${t.templateStrings[1]}`;case 24:return t.templateStrings[0];case 25:return t.templateStrings[0];case 26:return t.templateStrings[0];case 28:return t.templateStrings[0];case 35:return"Unable to find mapping range for address";case 29:return`INTRO exceeds address space available for this mapping. The range ends at ${t.templateStrings[2]}, the node ends at ${t.templateStrings[1]}`;case 30:return"Map entry overlaps with others entries";case 31:return"Unable to match to a nexus map entry";case 32:return`Unknown node type "${t.templateStrings[0]}"`;case 33:return`Missing name for "${t.templateStrings[0]}" index ${t.templateStrings[1]}"`;case 36:return"Node address is missing";case 37:return`Binding should be used on bus type${t.templateStrings.length?"s":""}: ${t.templateStrings.join(" or ")}`}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),Jj=t=>{switch(t){case 16:case 0:return"Node";case 15:return"Ignored reason";case 18:return"Conflicting properties";case 8:return"Additional value";case 21:return"Disabled by";case 29:return"Mapping range";case 30:return"Map entry";case 31:return"Nexus map entries";case 33:return"Names property";case 35:return"Range property";default:return"TODO"}},nn=(t,e)=>{let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[t.length-r+n]??0,s=e[e.length-r+n]??0;if(i<s)return-1;if(i>s)return 1}return 0},Zi=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;n[r-1-s]=c>>>0,i=c>4294967295?1:0}return i&&n.unshift(1),n},Qj=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0;o-=i,o<a?(o+=4294967296,i=1):i=0,n[r-1-s]=o-a>>>0}for(;n.length>1&&n[0]===0;)n.shift();return n},Zj=(t,e)=>Zi(t,e),Pw=(t,e)=>{let r=[];for(let n of t){let i=n.childAddress,s=n.length,o=Zi(i,s);if(nn(e,i)>=0&&nn(e,o)<0){let a=Qj(e,i),c=n.parentAddress,l=Zj(c,a),u=Zi(c,s);r.push({start:l,end:u,ast:n.ast})}}return r};function Rw(t){return Array.isArray(t)&&Array.isArray(t[0])}function Ec(t){return!t||t instanceof kn?t:Ec(t.parentNode)}function Uy(t,e){let r=t.getText(),n=e.slice().sort((s,o)=>{let a=t.offsetAt(s.range.start),c=t.offsetAt(o.range.start);if(a!==c)return c-a;let l=t.offsetAt(s.range.end),u=t.offsetAt(o.range.end);if(l!==u)return u-l;let d=a===l&&s.newText.length>0,f=c===u&&o.newText.length>0;return d!==f?d?1:-1:0}),i=r;for(let s of n){let o=t.offsetAt(s.range.start),a=t.offsetAt(s.range.end);i=i.slice(0,o)+s.newText+i.slice(a)}return i}function mw(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}function Ew(t,e){return mw(t.end,e.start)>0&&mw(t.start,e.end)<0}var ww=(t,e)=>{let r=kw(t,e),n=Cw(t,e);r&&(t.topComment=r.comment),n&&(t.endComment=n.comment)},kw=(t,e)=>{let r=e.find(i=>i.lastToken===t.firstToken.prevToken&&(i.lastToken.pos.line===t.firstToken.pos.line||i.lastToken.pos.line+1===t.firstToken.pos.line));if(!r)return;r.astAfterComment=t;let n=kw(r,e);return n&&(n.comment.astAfterComment=t,r.astAfterComment=void 0),{comment:n?.comment??r,commentIsBefore:!0}},Cw=(t,e)=>{let r=e.find(i=>i.firstToken.prevToken===t.lastToken&&i.firstToken.pos.line===t.lastToken.pos.line);if(!r)return;r.astBeforeComment=t;let n=Cw(r,e);return n&&(n.comment.astBeforeComment=t,r.astBeforeComment=void 0),{comment:n?.comment??r,commentIsBefore:!1}},Yo=(t,e,r)=>{let n=[42,44,45,36];return r||n.push(52,32,8,49),t.severity===Nc.DiagnosticSeverity.Error&&fe(t.astElement.uri,e)&&!n.some(i=>t.issues.includes(i))};var jc=require("fs"),UC=require("path"),ca=M(F());var Dn=M(F());var xw=M(F());var Dw=M(F());var ie=class extends j{constructor(r,n){super(n);this.value=r;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Dw.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return{type:"STRING",value:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Iw=M(F());var Aw=M(F());var tr=class extends we{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value.toString(),kind:Aw.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(r){return this.value.toString(r)}toJson(){return this.value}toPrettyString(r){let n=this.evaluate(r);return`${n.toString()} /* ${typeof n=="number"?`0x${n.toString(16)}`:""} */`}serialize(){return{type:"NUMBER_VALUE",value:this.toString(),evaluated:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var qt=class extends j{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Cell Array",kind:Iw.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`<${this.values.map(r=>r.toString()).join(" ")}>`}toPrettyString(r){return`<${this.values.map(n=>n.toPrettyString(r)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(r=>r.value instanceof tr)){let r=new ArrayBuffer(8),n=new DataView(r);return this.values.map(i=>i.value.value).forEach((i,s)=>{n.setUint32(s*4,i)}),n.getBigUint64(0)}return this.values.map(r=>r.value?.toJson()??NaN)}serialize(r){return{type:"ARRAY_VALUE",value:this.values.map(n=>n.value?.serialize(r)??null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Ow=M(F());var Ni=class extends j{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Byte String Value",kind:Ow.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(r=>r.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(r=>r.value?.toJson()??NaN)}serialize(){return{type:"BYTESTRING",values:this.values.map(r=>r.value?{value:r.value.toString(16),range:r.value.range,evaluated:r.value.value}:null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Ze=class extends j{constructor(r,n){super(n);this.name=r;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return{value:this.name,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ye=class extends j{constructor(r,n=[]){super();this.propertyName=r;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:xw.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(r)}set values(r){if(this._values)throw new Error("Only one property name is allowed");this._values=r,this.addChild(r)}get values(){return this._values}get quickValues(){return this.values?.values.map(r=>r?r.value instanceof ie?r.value.value:r.value instanceof qt?r.value.values.map(n=>n.value instanceof tr?n.value.value:NaN):r.value instanceof Ni?r.value.values.map(n=>n.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(r=>r?r.value instanceof ie?r.value:r.value instanceof qt?r.value.values.map(n=>n.value):r.value instanceof Ni?r.value.values.map(n=>n.value):r.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(r){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toPrettyString(r)??"NULL").join(", ")??"NULL"}`:""};`}serialize(r){return{name:this.propertyName?.serialize()??null,values:this.values?.values.map(n=>n?.value?.serialize(r)??null)??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Mw=M(F());var br=class extends j{constructor(r,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:r,kind:Mw.SymbolKind.Function}}};var Ir=class extends br{constructor(r){super("Delete Node",r);this._nodeNameOrRef=null}set nodeNameOrRef(r){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=r,this.addChild(r)}get nodeNameOrRef(){return this._nodeNameOrRef}};var ht=class extends br{constructor(r){super("Delete Property",r);this._propertyName=null}set propertyName(r){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=r,this.addChild(r)}get propertyName(){return this._propertyName}};var qw=M(F());var se=class extends j{constructor(r){super();this.label=r;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:qw.SymbolKind.Key},this.addChild(r)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return{type:"LABEL_REF",label:this.label?.toString()??null,nodePath:this.linksTo?.pathString??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var lt=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof Nt)return[this.pathName];if(!(this.parentNode instanceof t))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof t)}get deleteNodes(){return this.children.filter(e=>e instanceof Ir)}addNodeChild(e){this.addChild(e)}},Nt=class extends lt{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Dn.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ye)}get name(){return new He("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof ht)}get nodes(){return this.children.filter(e=>e instanceof Ue)}get pathName(){return"/"}serialize(e){return{type:"ROOT",properties:this.properties.map(r=>r.serialize(e)),nodes:this.nodes.map(r=>r.serialize(e)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Yt=class extends lt{constructor(r=[]){super();this.labels=r;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:Dn.SymbolKind.Class},r.forEach(n=>{super.addChild(n)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(r=>r())}set reference(r){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=r;let n;r instanceof se?n=r.value:n=r?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:n??"DTC Name",kind:Dn.SymbolKind.Class},this.addChild(r)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(r=>r instanceof Ue)}get pathName(){if(this.reference instanceof se&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"REF",name:this.reference?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ue=class t extends lt{constructor(r=[],n){super();this.labels=r;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Dn.SymbolKind.Class},n&&this.addChild(n),r.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(r=>r())}set name(r){if(this._name)throw new Error("Only on label reference is allowed");this._name=r,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Dn.SymbolKind.Class},this.addChild(r)}get name(){return this._name}get nodes(){return this.children.filter(r=>r instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof ht)}serialize(r){return{type:"CHILD",name:this.name?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},wc=class extends j{constructor(r,n){super(n);this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((r,n)=>r.toString(16).padStart(n?8:0,"0")).join("")??"NaN"}serialize(){return{address:this.address,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},He=class extends j{constructor(r,n,i){super(n);this.name=r;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(r){if(this._address)throw new Error("Address can only be set once");r&&(this.lastToken=void 0,this._address=r,r.forEach(n=>this.addChild(n)))}get fullAddress(){return this._address?[...this._address.flatMap(r=>r.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(r=>r.toString()).join(",")}`:this.name}buildSemanticTokens(r){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let n={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};r(bi("type"),_i("declaration"),{start:n,end:n}),this.address!==void 0&&this.address.forEach(i=>{r(bi("decorator"),_i("declaration"),{start:i.firstToken,end:i.lastToken}),i.buildSemanticTokens(r)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(r=>r.issues)??[]].map(r=>r())}serialize(){return{fullName:this.toString(),name:{name:this.name,uri:this.serializeUri,range:Dn.Range.create(Dn.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),Dn.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),issues:this.serializeIssues},address:this.address?.map(r=>r.serialize())??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var un=M(F());var _r=class extends j{constructor(r,n,i,s){super();this.startLabels=r;this.value=n;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(n),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toPrettyString(r){return`${[this.value?.toPrettyString(r)??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Ut=t=>t instanceof br?!0:t instanceof lt?!1:t.parentNode?Ut(t.parentNode):!1;var Hy=t=>{if(t instanceof Ye)return t;if(!(t instanceof lt))return t.parentNode?Hy(t.parentNode):void 0},Ws=t=>!t||t instanceof Ye?!1:t instanceof _r||Ws(t.parentNode),Ko=t=>[...t.map(e=>{if(e instanceof Ue||e instanceof Nt)return e.name;if(e instanceof Yt)return e.reference})].filter(e=>!!e),Vy=(t,e)=>e?e.parentNode===t||Vy(t,e.parentNode):!1;var Ke=M(F());var Lw=M(F());var An=class extends j{constructor(){super();this._pathParts=[]}addPath(r,n){this._pathParts.push(r),n&&this.addChild(n),this.addChild(r)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(r=>r?.toString()??"<NULL>").join("/")}buildSemanticTokens(r){this._children.forEach(n=>{n instanceof He?n.buildSemanticTokens(r):r(bi("operator"),_i("declaration"),n.tokenIndexes)})}},it=class extends j{constructor(r){super();this.path=r;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:Lw.SymbolKind.Namespace},this.addChild(r)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return{type:"NODE_PATH",nodePath:this.path?.toString()??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var te=M(F());var $w=require("path"),gf=M(F());var Pi=class extends j{constructor(r,n){super();this.keyword=r;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:gf.SymbolKind.File},this.addChild(r),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(r){this.docSymbolsMeta={name:`Include ${r}`,kind:gf.SymbolKind.File},this._resolvedPath=r}},Xo=class extends j{constructor(r,n,i){super(i);this._path=r;this.relative=n;this.docSymbolsMeta={name:(0,$w.basename)(this.path),kind:gf.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var an=class extends j{constructor(r){super();this.comments=r;r.forEach(this.addChild.bind(this))}toString(){return this.comments.map(r=>r.toString()).join(`
|
|
183
|
-
`)}},cn=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}toString(){let e,r=this.firstToken,n="";for(;r!==this.lastToken;)n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "),e=r,r=r?.nextToken;r&&(n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "));let i=n.match(/^\s*(?:(?:\/\/|\/\*+)\s*)?(.*?)\s*(?:\*\/)?\s*$/s);return i?i[1]:""}};var Bw=M(F());var Ct=class extends we{constructor(r,n){super(n);this.name=r;this.docSymbolsMeta={name:this.name.toString(),kind:Bw.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Cf=M(F());var zy=M(F());var es=class extends j{constructor(r,n){super(n);this.label=r;this.docSymbolsMeta={name:this.label.value,kind:zy.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(r)}toString(){return`${this.label.toString()}:`}},rr=class extends j{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value,kind:zy.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(r){let n=this.parentNode;if(!(n instanceof se&&n.linksTo)){super.buildSemanticTokens(r);return}r(bi("type"),_i("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var mt=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var Fw=M(F());var yf=class extends j{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Values",kind:Fw.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}toString(){return this.values.map(r=>r?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(r=>r?.toJson())}};var jw=M(F());var vf=class extends j{constructor(r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:"DTS Document version",kind:jw.SymbolKind.Function}}};var Qn=class extends j{constructor(r,n){super();this.value=r;this.labels=n;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toString(r)??"NULL"}`}toPrettyString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toPrettyString(r)??"NULL"}`}};var Tf=class extends j{constructor(r,n){super(n);this.operator=r;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var Uw=M(F());var bf=class extends mt{toString(){return"..."}},Zn=class extends j{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return fe(this.uri,r)?[{name:this.functionName.name,kind:Uw.SymbolKind.Function,range:ce(this),selectionRange:ce(this),children:this.params.flatMap(n=>n.getDocumentSymbols(r))}]:[]}toString(){return`${this.functionName}(${this.params.map(r=>r.toString()).join(",")})`}};var ts=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,r=!0)=>{let n=e.pos.line;if(this.currentToken?.pos.line!==n||!fe(this.currentToken?.uri,e.uri))return;let i=this.currentToken,s=i;for(;this.currentToken?.pos.line===n&&fe(this.currentToken?.uri,e.uri);)s=this.moveToNextToken;if(r){let o=new j(G(i,s));this._issues.push(Y(22,o))}return s};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;if(e)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(),r=this.positionStack.pop();if(r===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=r}peekIndex(e=1){let r=this.positionStack.at(-1*e);if(r===void 0)throw new Error("Index out of bounds");return r}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let r=[];return e.every(n=>{let i=this.currentToken,s=n(i),o=!1;return s!=="no"&&i&&(r.push(i),this.moveToNextToken,o=Gt(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),r}consumeAnyConcurrentTokens(e){this.enqueueToStack();let r=[],n,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)r.push(this.currentToken),n=this.moveToNextToken,i=Gt(n,this.currentToken);return this.mergeStack(),r}getDocumentSymbols(e){return this.allAstItems.flatMap(r=>r.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,r){let n=[],i=(s,o,a)=>{if(!a?.start||!a?.end||!fe(a.start.uri,r)||!fe(a.end.uri,r))return;let c=a.end.pos.colEnd-a.start.pos.col;n.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(i)}),n.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(e,r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!n.length){this.popStack();return}let i=n.map(o=>o.value).join("");if(!i.match(/^[_A-Za-z]/)){this.popStack();return}let s=new Ct(i,G(n[0],n.at(-1)));return!r&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(Y(42,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let r=e,n;if(V(e,40)?(n="&",V(this.currentToken,40)&&(n="&&",r=this.moveToNextToken)):V(e,10)?(n="!",V(this.currentToken,0)&&(n="!=",r=this.moveToNextToken)):V(e,8)?(n="|",V(this.currentToken,8)&&(n="||",r=this.moveToNextToken)):V(e,9)?n="^":V(e,4)?(n=">",V(this.currentToken,4)?(n="<<",r=this.moveToNextToken):V(this.currentToken,0)&&(n=">=",r=this.moveToNextToken)):V(e,5)?(n="<",V(this.currentToken,5)?(n=">>",r=this.moveToNextToken):V(this.currentToken,0)&&(n="<=",r=this.moveToNextToken)):V(e,15)?n="+":V(e,16)?n="-":V(e,17)?n="*":V(e,13)?n="/":V(e,18)?n="%":V(e,46)?V(this.currentToken,46)&&(n="##",r=this.moveToNextToken):V(e,0)&&V(this.currentToken,0)&&(n="==",r=this.moveToNextToken),n){let i=new Tf(n,G(e,r));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,r,n){this.enqueueToStack();let i=this.moveToNextToken;if(!i||!e(i)){this.popStack();return}let s=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=s},a=y=>y.flatMap(h=>"items"in h?a(h.items):h),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!r(d);){if(n?.(d)){let y=this.peekIndex()+1,h=()=>{this.positionStack[this.positionStack.length-1]=y};c.push(d),l.push(d),u[u.length]={rewind:h,tokens:[]}}else if(e(d)){let y=this.parseScopedBlock(e,r,n);y&&(c.push(y),u[u.length-1].tokens.push(...a(y.items))),d=this.currentToken;continue}else c.push(d),u[u.length-1].tokens.push(d);this.moveToNextToken,d=this.currentToken}let f=d;f&&r(f)&&(this.moveToNextToken,c.push(f));let p={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),p}isFunctionCall(e){this.enqueueToStack();let r=this.processCIdentifier(e,!1);if(!r){this.popStack();return}if(!Gt(r.lastToken,this.currentToken)){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}if(r.name==="defined")n.length>1?this._issues.push(Y(44,r)):n.length<1&&this._issues.push(Y(45,r));else{let s=e.get(r.name)?.macro;s&&(s?.identifier instanceof Zn?n.length>s.identifier.params.length?this._issues.push(Y(44,r,void 0,[s])):n.length<s.identifier.params.length&&this._issues.push(Y(45,r,void 0,[s])):this._issues.push(Y(43,r)))}let i=new kn(r,n);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([nt("0"),nt("x",!0)]);if(e.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(je));if(!r.length){this.popStack();return}let n=Number.parseInt(r.map(s=>s.value).join(""),16),i=new tr(n,G(e[0],r.at(-1)));return this.mergeStack(),i}processDec(e=!1){this.enqueueToStack();let r;e&&(V(this.currentToken,16)||V(this.currentToken,15))&&Gt(this.currentToken,this.currentToken?.nextToken)&&(r=this.moveToNextToken);let n=this.consumeAnyConcurrentTokens([19].map(je));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(o=>o.value).join(""),10);r&&V(r,16)&&(i=4294967295-i);let s=new tr(i,G(r??n[0],n.at(-1)));return this.mergeStack(),s}processEnclosedExpression(e){this.enqueueToStack();let r,n;if(V(this.currentToken,42)){let i;r=this.moveToNextToken,n=r;let s=this.processExpression(e,!0);return s&&(i=new Kn(s,!0),s=new Kn(i,!1),i.openBracket=r),V(this.currentToken,43)?(n=this.moveToNextToken,i&&(i.closeBracket=n)):this._issues.push(Y(26,new j(G(r)))),this.mergeStack(),s}this.popStack()}processExpression(e,r=!1){this.enqueueToStack();let n;if(n=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(!0),!n){this.popStack();return}if(r){let i=this.isOperator();for(;i;){let s=this.processExpression(e);s?n instanceof Kn?n.addExpression(i,s):n=new Kn(n,!1,{operator:i,expression:s}):this._issues.push(Y(27,i)),i=this.isOperator()}}return this.mergeStack(),n}processMacroCallParams(){if(!V(this.currentToken,42))return;let e=this.parseScopedBlock(n=>!!V(n,42),n=>!!V(n,43),n=>!!V(n,24));return e?.items.length===2&&V(e.endToken,43)?[]:e?.splitTokens.map((n,i)=>{if(n.tokens.length===0)return null;let s=new Xn(n.tokens.map((o,a)=>{let c=o.value;return o.pos.line===n.tokens.at(a+1)?.pos.line?c=c.padEnd(n.tokens[a+1].pos.col-o.pos.col," "):o.value==="\\"&&(c=c.slice(0,-1)),c}).join(""),G(n.tokens[0],n.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var Yy=require("fs"),Zo=require("path"),Mc=M(F());var Dc=require("fs");var Jo=class t{constructor(e,r){this.text=e;this.uri=r;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
182
|
+
deps: ${r}}`};var YX={keyword:"dependencies",type:"object",schemaType:"object",error:di.error,code(t){let[e,r]=KX(t);k1(t,e),E1(t,r)}};function KX({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function k1(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,fu.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,fu.checkReportMissingProp)(t,l)}):(r.if((0,w_._)`${c} && (${(0,fu.checkMissingProp)(t,a,s)})`),(0,fu.reportMissingProp)(t,s),r.else())}}di.validatePropertyDeps=k1;function E1(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,GX.alwaysValidSchema)(s,e[a])||(r.if((0,fu.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}di.validateSchemaDeps=E1;di.default=YX});var C1=R(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});var w1=Te(),XX=ke(),JX={message:"property name must be valid",params:({params:t})=>(0,w1._)`{propertyName: ${t.propertyName}}`},QX={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:JX,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,XX.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,w1.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};C_.default=QX});var A_=R(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var hm=gn(),Un=Te(),ZX=mn(),mm=ke(),e4={message:"must NOT have additional properties",params:({params:t})=>(0,Un._)`{additionalProperty: ${t.additionalProperty}}`},t4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:e4,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,mm.alwaysValidSchema)(o,r))return;let l=(0,hm.allSchemaProperties)(n.properties),u=(0,hm.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Un._)`${s} === ${ZX.default.errors}`);function d(){e.forIn("key",i,v=>{!l.length&&!u.length?g(v):e.if(f(v),()=>g(v))})}function f(v){let S;if(l.length>8){let _=(0,mm.schemaRefOrVal)(o,n.properties,"properties");S=(0,hm.isOwnProperty)(e,_,v)}else l.length?S=(0,Un.or)(...l.map(_=>(0,Un._)`${v} === ${_}`)):S=Un.nil;return u.length&&(S=(0,Un.or)(S,...u.map(_=>(0,Un._)`${(0,hm.usePattern)(t,_)}.test(${v})`))),(0,Un.not)(S)}function p(v){e.code((0,Un._)`delete ${i}[${v}]`)}function g(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,mm.alwaysValidSchema)(o,r)){let S=e.name("valid");c.removeAdditional==="failing"?(h(v,S,!1),e.if((0,Un.not)(S),()=>{t.reset(),p(v)})):(h(v,S),a||e.if((0,Un.not)(S),()=>e.break()))}}function h(v,S,_){let T={keyword:"additionalProperties",dataProp:v,dataPropType:mm.Type.Str};_===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,S)}}};D_.default=t4});var I1=R(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});var r4=Jl(),D1=gn(),I_=ke(),A1=A_(),n4={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&A1.default.code(new r4.KeywordCxt(s,A1.default,"additionalProperties"));let o=(0,D1.allSchemaProperties)(r);for(let d of o)s.definedProperties.add(d);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=I_.mergeEvaluated.props(e,(0,I_.toHash)(o),s.props));let a=o.filter(d=>!(0,I_.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,D1.propertyInData)(e,i,d,s.opts.ownProperties)),u(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};O_.default=n4});var q1=R(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var O1=gn(),gm=Te(),x1=ke(),M1=ke(),i4={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,O1.allSchemaProperties)(r),c=a.filter(h=>(0,x1.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof gm.Name)&&(s.props=(0,M1.evaluatedPropsToName)(e,s.props));let{props:d}=s;f();function f(){for(let h of a)l&&p(h),s.allErrors?g(h):(e.var(u,!0),g(h),e.if(u))}function p(h){for(let v in l)new RegExp(h).test(v)&&(0,x1.checkStrictMode)(s,`property ${v} matches pattern ${h} (use allowMatchingProperties)`)}function g(h){e.forIn("key",n,v=>{e.if((0,gm._)`${(0,O1.usePattern)(t,h)}.test(${v})`,()=>{let S=c.includes(h);S||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:v,dataPropType:M1.Type.Str},u),s.opts.unevaluated&&d!==!0?e.assign((0,gm._)`${d}[${v}]`,!0):!S&&!s.allErrors&&e.if((0,gm.not)(u),()=>e.break())})})}}};x_.default=i4});var L1=R(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var s4=ke(),o4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,s4.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};M_.default=o4});var $1=R(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var a4=gn(),c4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:a4.validateUnion,error:{message:"must match a schema in anyOf"}};q_.default=c4});var B1=R(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var ym=Te(),l4=ke(),u4={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ym._)`{passingSchemas: ${t.passing}}`},d4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:u4,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){s.forEach((u,d)=>{let f;(0,l4.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ym._)`${c} && ${o}`).assign(o,!1).assign(a,(0,ym._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,ym.Name)})})}}};L_.default=d4});var F1=R($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var f4=ke(),p4={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,f4.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};$_.default=p4});var H1=R(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var vm=Te(),U1=ke(),h4={message:({params:t})=>(0,vm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,vm._)`{failingKeyword: ${t.ifClause}}`},m4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:h4,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,U1.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=j1(n,"then"),s=j1(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,vm.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,vm._)`${u}`):t.setParams({ifClause:u})}}}};function j1(t,e){let r=t.schema[e];return r!==void 0&&!(0,U1.alwaysValidSchema)(t,r)}B_.default=m4});var V1=R(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var g4=ke(),y4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,g4.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};F_.default=y4});var z1=R(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var v4=N_(),T4=S1(),b4=R_(),_4=R1(),S4=P1(),N4=pm(),R4=C1(),P4=A_(),k4=I1(),E4=q1(),w4=L1(),C4=$1(),D4=B1(),A4=F1(),I4=H1(),O4=V1();function x4(t=!1){let e=[w4.default,C4.default,D4.default,A4.default,I4.default,O4.default,R4.default,P4.default,N4.default,k4.default,E4.default];return t?e.push(T4.default,_4.default):e.push(v4.default,b4.default),e.push(S4.default),e}j_.default=x4});var W1=R(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var Ot=Te(),M4={message:({schemaCode:t})=>(0,Ot.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ot._)`{format: ${t}}`},q4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:M4,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Ot._)`${g}[${o}]`),v=r.let("fType"),S=r.let("format");r.if((0,Ot._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(v,(0,Ot._)`${h}.type || "string"`).assign(S,(0,Ot._)`${h}.validate`),()=>r.assign(v,(0,Ot._)`"string"`).assign(S,h)),t.fail$data((0,Ot.or)(_(),T()));function _(){return c.strictSchema===!1?Ot.nil:(0,Ot._)`${o} && !${S}`}function T(){let P=u.$async?(0,Ot._)`(${h}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,Ot._)`${S}(${n})`,C=(0,Ot._)`(typeof ${S} == "function" ? ${P} : ${S}.test(${n}))`;return(0,Ot._)`${S} && ${S} !== true && ${v} === ${e} && !${C}`}}function p(){let g=d.formats[s];if(!g){_();return}if(g===!0)return;let[h,v,S]=T(g);h===e&&t.pass(P());function _(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function T(C){let $=C instanceof RegExp?(0,Ot.regexpCode)(C):c.code.formats?(0,Ot._)`${c.code.formats}${(0,Ot.getProperty)(s)}`:void 0,F=r.scopeValue("formats",{key:s,ref:C,code:$});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,Ot._)`${F}.validate`]:["string",C,F]}function P(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ot._)`await ${S}(${n})`}return typeof v=="function"?(0,Ot._)`${S}(${n})`:(0,Ot._)`${S}.test(${n})`}}}};U_.default=q4});var G1=R(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var L4=W1(),$4=[L4.default];H_.default=$4});var Y1=R(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.contentVocabulary=Ba.metadataVocabulary=void 0;Ba.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ba.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var X1=R(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var B4=i1(),F4=v1(),j4=z1(),U4=G1(),K1=Y1(),H4=[B4.default,F4.default,(0,j4.default)(),U4.default,K1.metadataVocabulary,K1.contentVocabulary];V_.default=H4});var W_=R(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.dynamicAnchor=void 0;var z_=Te(),V4=mn(),J1=Zl(),z4=om(),W4={keyword:"$dynamicAnchor",schemaType:"string",code:t=>Q1(t,t.schema)};function Q1(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,z_._)`${V4.default.dynamicAnchors}${(0,z_.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:G4(t);r.if((0,z_._)`!${i}`,()=>r.assign(i,s))}pu.dynamicAnchor=Q1;function G4(t){let{schemaEnv:e,schema:r,self:n}=t.it,{root:i,baseId:s,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new J1.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return J1.compileSchema.call(n,l),(0,z4.getValidate)(t,l)}pu.default=W4});var G_=R(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.dynamicRef=void 0;var Z1=Te(),Y4=mn(),e$=om(),K4={keyword:"$dynamicRef",schemaType:"string",code:t=>t$(t,t.schema)};function t$(t,e){let{gen:r,keyword:n,it:i}=t;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),t.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,Z1._)`${Y4.default.dynamicAnchors}${(0,Z1.getProperty)(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{(0,e$.callRef)(t,c),r.let(l,!0)}):()=>(0,e$.callRef)(t,c)}}hu.dynamicRef=t$;hu.default=K4});var r$=R(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var X4=W_(),J4=ke(),Q4={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,X4.dynamicAnchor)(t,""):(0,J4.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};Y_.default=Q4});var n$=R(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});var Z4=G_(),e9={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,Z4.dynamicRef)(t,t.schema)};K_.default=e9});var i$=R(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var t9=W_(),r9=G_(),n9=r$(),i9=n$(),s9=[t9.default,r9.default,n9.default,i9.default];X_.default=s9});var o$=R(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});var s$=pm(),o9={keyword:"dependentRequired",type:"object",schemaType:"object",error:s$.error,code:t=>(0,s$.validatePropertyDeps)(t)};J_.default=o9});var a$=R(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});var a9=pm(),c9={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,a9.validateSchemaDeps)(t)};Q_.default=c9});var c$=R(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var l9=ke(),u9={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,l9.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};Z_.default=u9});var l$=R(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var d9=o$(),f9=a$(),p9=c$(),h9=[d9.default,f9.default,p9.default];eS.default=h9});var d$=R(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var Es=Te(),u$=ke(),m9=mn(),g9={message:"must NOT have unevaluated properties",params:({params:t})=>(0,Es._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},y9={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:g9,code(t){let{gen:e,schema:r,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=s;a instanceof Es.Name?e.if((0,Es._)`${a} !== true`,()=>e.forIn("key",n,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",n,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),s.props=!0,t.ok((0,Es._)`${i} === ${m9.default.errors}`);function c(d){if(r===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,u$.alwaysValidSchema)(s,r)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:u$.Type.Str},f),o||e.if((0,Es.not)(f),()=>e.break())}}function l(d,f){return(0,Es._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let g in d)d[g]===!0&&p.push((0,Es._)`${f} !== ${g}`);return(0,Es.and)(...p)}}};tS.default=y9});var p$=R(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var uo=Te(),f$=ke(),v9={message:({params:{len:t}})=>(0,uo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,uo._)`{limit: ${t}}`},T9={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:v9,code(t){let{gen:e,schema:r,data:n,it:i}=t,s=i.items||0;if(s===!0)return;let o=e.const("len",(0,uo._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,uo._)`${o} > ${s}`);else if(typeof r=="object"&&!(0,f$.alwaysValidSchema)(i,r)){let c=e.var("valid",(0,uo._)`${o} <= ${s}`);e.if((0,uo.not)(c),()=>a(c,s)),t.ok(c)}i.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:f$.Type.Num},c),i.allErrors||e.if((0,uo.not)(c),()=>e.break())})}}};rS.default=T9});var h$=R(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var b9=d$(),_9=p$(),S9=[b9.default,_9.default];nS.default=S9});var g$=R(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.DiscrError=void 0;var m$;(function(t){t.Tag="tag",t.Mapping="mapping"})(m$||(Tm.DiscrError=m$={}))});var v$=R(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});var Fa=Te(),iS=g$(),y$=Zl(),N9=Ql(),R9=ke(),P9={message:({params:{discrError:t,tagName:e}})=>t===iS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Fa._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},k9={keyword:"discriminator",type:"object",schemaType:"object",error:P9,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.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,Fa._)`${r}${(0,Fa.getProperty)(a)}`);e.if((0,Fa._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:iS.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let g in p)e.elseIf((0,Fa._)`${l} === ${g}`),e.assign(c,d(p[g]));e.else(),t.error(!1,{discrError:iS.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let g=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},g);return t.mergeEvaluated(h,Fa.Name),g}function f(){var p;let g={},h=S(i),v=!0;for(let P=0;P<o.length;P++){let C=o[P];if(C?.$ref&&!(0,R9.schemaHasRulesButRef)(C,s.self.RULES)){let F=C.$ref;if(C=y$.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,F),C instanceof y$.SchemaEnv&&(C=C.schema),C===void 0)throw new N9.default(s.opts.uriResolver,s.baseId,F)}let $=(p=C?.properties)===null||p===void 0?void 0:p[a];if(typeof $!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(h||S(C)),_($,P)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return g;function S({required:P}){return Array.isArray(P)&&P.includes(a)}function _(P,C){if(P.const)T(P.const,C);else if(P.enum)for(let $ of P.enum)T($,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(P,C){if(typeof P!="string"||P in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[P]=C}}}};sS.default=k9});var T$=R((cke,E9)=>{E9.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 b$=R((lke,w9)=>{w9.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 _$=R((uke,C9)=>{C9.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 S$=R((dke,D9)=>{D9.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 N$=R((fke,A9)=>{A9.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 R$=R((pke,I9)=>{I9.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 P$=R((hke,O9)=>{O9.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 k$=R(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});var x9=T$(),M9=b$(),q9=_$(),L9=S$(),$9=N$(),B9=R$(),F9=P$(),j9=["/properties"];function U9(t){return[x9,M9,q9,L9,e(this,$9),B9,e(this,F9)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,j9):n}}oS.default=U9});var E$=R((yt,cS)=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.MissingRefError=yt.ValidationError=yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=yt.Ajv2019=void 0;var H9=ZL(),V9=X1(),z9=i$(),W9=l$(),G9=h$(),Y9=v$(),K9=k$(),aS="https://json-schema.org/draft/2019-09/schema",ja=class extends H9.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(z9.default),V9.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(W9.default),this.addVocabulary(G9.default),this.opts.discriminator&&this.addKeyword(Y9.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(K9.default.call(this,e),this.refs["http://json-schema.org/schema"]=aS)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(aS)?aS:void 0)}};yt.Ajv2019=ja;cS.exports=yt=ja;cS.exports.Ajv2019=ja;Object.defineProperty(yt,"__esModule",{value:!0});yt.default=ja;var X9=Jl();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:function(){return X9.KeywordCxt}});var Ua=Te();Object.defineProperty(yt,"_",{enumerable:!0,get:function(){return Ua._}});Object.defineProperty(yt,"str",{enumerable:!0,get:function(){return Ua.str}});Object.defineProperty(yt,"stringify",{enumerable:!0,get:function(){return Ua.stringify}});Object.defineProperty(yt,"nil",{enumerable:!0,get:function(){return Ua.nil}});Object.defineProperty(yt,"Name",{enumerable:!0,get:function(){return Ua.Name}});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:function(){return Ua.CodeGen}});var J9=Qh();Object.defineProperty(yt,"ValidationError",{enumerable:!0,get:function(){return J9.default}});var Q9=Ql();Object.defineProperty(yt,"MissingRefError",{enumerable:!0,get:function(){return Q9.default}})});var Ga=require("path"),lt=L(nE());var ef=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=sE(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),c=Math.max(i.end.line,0),l=this._lineOffsets,u=iE(n.text,!1,s);if(c-a===u.length)for(let f=0,p=u.length;f<p;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=n.text.length-(o-s);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=iE(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},Yi;(function(t){function e(i,s,o,a){return new ef(i,s,o,a)}t.create=e;function r(i,s,o){if(i instanceof ef)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,s){let o=i.getText(),a=Cy(s.map(qj),(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=i.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=i.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=n})(Yi||(Yi={}));function Cy(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Cy(n,e),Cy(i,e);let s=0,o=0,a=0;for(;s<n.length&&o<i.length;)e(n[s],i[o])<=0?t[a++]=n[s++]:t[a++]=i[o++];for(;s<n.length;)t[a++]=n[s++];for(;o<i.length;)t[a++]=i[o++];return t}function iE(t,e,r=0){let n=e?[r]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function sE(t){let e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function qj(t){let e=sE(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var tf=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],rf=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var Ay=L(require("url")),aE=require("crypto"),cE=require("path"),Ki=L(j());var Dy=L(j());var Cr=L(j());var Z=class{constructor(e){this._children=[];this.syntaxIssues=[];this.resetableIssues=[];this._firstToken=e?.start,this._lastToken=e?.end}get issues(){return[...this.syntaxIssues,...this.resetableIssues]}resetIssues(){this.resetableIssues=[],this.children.forEach(e=>e.resetIssues())}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._firstToken??this._children[0].tokenIndexes.start}set firstToken(e){this._firstToken=e}get rangeTokens(){return{start:this.firstToken,end:this.lastToken}}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return de(e,this.uri)?[this]:this.children.flatMap(r=>r.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getDocumentSymbols(e)??[]);if(!de(this.uri,e))return[];let r=fe(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:r,selectionRange:r,children:[...this.children.flatMap(n=>n.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(n=>n.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Cr.SymbolKind.File,Cr.SymbolKind.Class,Cr.SymbolKind.Constant].some(n=>n===e))return[];let r=fe(this);return[{location:Cr.Location.create(ve(this.uri),r),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(n=>n.getWorkspaceSymbols()??[]).filter(n=>n.kind===Cr.SymbolKind.File||n.kind===Cr.SymbolKind.Class||n.kind===Cr.SymbolKind.Constant)]}buildSemanticTokens(e){this._children.forEach(r=>r.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(vi(this.semanticTokenType),Ti(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this.children.push(e)),this.allDescendantsCache=void 0}isAncestorOf(e){return this.children.some(r=>r===e||r.isAncestorOf(e))}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Cr.Range.create(Cr.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Cr.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}get serializeUri(){return ve(this.uri)}serialize(e){return{uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Ee=class extends Z{toJson(){return-1}resolve(e){return nf(this.toString(),e)}evaluate(e){return Ie(this.resolve(e))}isTrue(e){return Ie(`!!(${this.resolve(e)})`)}toPrettyString(e){let r=this.evaluate(e);return`${r.toString()} /* ${this.toString()}${typeof r=="number"?` = 0x${r.toString(16)}`:""} */`}serialize(e){return{type:"EXPRESSION",value:this.toString(),evaluated:this.evaluate(e),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Yn=class extends Ee{constructor(r,n,i){super();this.expression=r;this.wrapped=n;this.addChild(r),i&&(this.addChild(i.operator),this.addChild(i.expression),this.join=[],this.join?.push(i))}get firstToken(){return this.openBracket?this.openBracket:super.firstToken}get lastToken(){return this.closeBracket?this.closeBracket:super.lastToken}addExpression(r,n){this.addChild(r),this.addChild(n),this.join??=[],this.join?.push({operator:r,expression:n})}toString(){let r=this.children.map(n=>n.toString()).join(" ");return this.wrapped?`(${r})`:`${r}`}isTrue(r){let n=`(${this.children.map(i=>i instanceof Ee?i.resolve(r):i.toString()).join(" ")})`;return Ie(`!!${n}`)}};var Kn=class extends Ee{constructor(r,n,i){super(n);this.value=r;this.docSymbolsMeta={name:`param${i+1}`,kind:Dy.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},wn=class extends Ee{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return de(this.uri,r)?[{name:this.functionName.name,kind:Dy.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n?.getDocumentSymbols(r)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(r=>r?.toString()??"<NULL>").join(",")})`}isTrue(r){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&r.has(this.params[0].value)):super.isTrue(r)}};var Hr=(t,e,r=!0,n=!0)=>({start:{line:t?.pos.line??0,character:r?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:n?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var fe=t=>Hr(t.tokenIndexes.start,t.tokenIndexes.end),lE=" ",uE=t=>{lE=t},Uo=()=>lE,vi=t=>tf.findIndex(e=>e===t),Ti=t=>rf.findIndex(e=>e===t),Iy=(t,e,r)=>!de(t.uri,e)||r.line<t.pos.line?!1:r.line>t.pos.line?!0:r.character>t.pos.colEnd,Lj=(t,e,r)=>de(t.uri,e)?r.line<t.pos.line?!0:r.line>t.pos.line?!1:r.character<t.pos.col:!1,nn=(t,e,r)=>!!(de(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<r.line||t.tokenIndexes.start.pos.line===r.line&&t.tokenIndexes.start.pos.col<=r.character)&&(t.tokenIndexes.end.pos.line>r.line||t.tokenIndexes.end.pos.line===r.line&&t.tokenIndexes.end.pos.colEnd>=r.character)),dE=(t,e,r)=>!!(de(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===r.line||t.tokenIndexes.end.pos.line===r.line)&&r.character>=t.tokenIndexes.end.pos.colEnd),fE=(t,e,r)=>{if(!t)return!1;let i=t.filter(s=>s.pos.line===r.line).at(-1);return i&&i.pos.col>=r.character?!1:e.tokenIndexes?.end===i};var Xn=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>nn(s,e,r));return n},mc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].find(s=>Lj(s.lastToken,e,r));return n===t?void 0:n},gc=(t,e,r)=>{let n=t,i=t;for(;i;)n=i,i=[...n.children].reverse().find(s=>Iy(s.firstToken,e,r));return n===t?void 0:n},G=(t,e,r,{severity:n=Ki.DiagnosticSeverity.Error,linkedTo:i=[],tags:s,templateStrings:o=[],edit:a,codeActionTitle:c,inclusiveStart:l,inclusiveEnd:u}={severity:Ki.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let d=Hr(e.start,e.end,l,u),f={issues:Array.isArray(t)?t:[t],range:d,uri:e.start.uri,severity:n,linkedTo:i.map(({range:h,uri:v})=>({range:h,uri:v,templateStrings:[]})),tags:s,templateStrings:o,edit:a,codeActionTitle:c},p,g=()=>(p??={severity:f.severity,range:d,message:f.issues?f.issues.map(Fj).join(" or "):"",source:"devicetree",tags:f.tags,data:{firstToken:{pos:e.start.pos,tokens:e.start.tokens,value:e.start.value},lastToken:{pos:e.end.pos,tokens:e.end.tokens,value:e.end.value},issues:{type:"SyntaxIssue",items:f.issues,edit:f.edit,codeActionTitle:f.codeActionTitle}}},p);return r?.syntaxIssues.push(g),{raw:f,diagnostic:g}},qt=(t,e,r,{severity:n=Ki.DiagnosticSeverity.Error,linkedTo:i=[],tags:s,templateStrings:o=[],edit:a,codeActionTitle:c,linkedToTemplateStrings:l=[]}={severity:Ki.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[],linkedToTemplateStrings:[]})=>{let u=Hr(e.start,e.end),d={issues:Array.isArray(t)?t:[t],range:u,uri:e.start.uri,severity:n,linkedTo:i.map(({range:g,uri:h},v)=>({range:g,uri:h,templateStrings:l.at(v)??[]})),tags:s,templateStrings:o,edit:a,codeActionTitle:c},f,p=()=>(f??={severity:d.severity,range:u,message:jj(d),source:"devicetree",tags:d.tags,relatedInformation:[...d.linkedTo.map(g=>({message:d.issues.map(h=>Uj(h,g.templateStrings)).join(" or "),location:{uri:ve(g.uri),range:g.range}}))]},f);return r?.resetableIssues.push(p),{raw:d,diagnostic:p}},B=(t,e,r,{severity:n=Ki.DiagnosticSeverity.Error,linkedTo:i=[],tags:s,templateStrings:o=[],edit:a,codeActionTitle:c}={severity:Ki.DiagnosticSeverity.Error,linkedTo:[],templateStrings:[]})=>{let l=Hr(e.start,e.end),u={issues:Array.isArray(t)?t:[t],range:l,severity:n,uri:e.start.uri,linkedTo:i.map(({range:p,uri:g})=>({range:p,uri:g,templateStrings:[]})),tags:s,templateStrings:o,edit:a,codeActionTitle:c},d,f=()=>(d??={severity:u.severity,range:l,message:Hj(u),relatedInformation:[...u.linkedTo.map(p=>({message:u.issues.map(Vj).join(" or "),location:{uri:ve(p.uri),range:p.range}}))],source:"devicetree",tags:u.tags,data:{firstToken:{pos:e.start.pos,tokens:e.start.tokens,value:e.start.value},lastToken:{pos:e.end.pos,tokens:e.end.tokens,value:e.end.value},issues:{type:"StandardTypeIssue",items:u.issues,edit:u.edit,codeActionTitle:u.codeActionTitle}}},d);return r?.resetableIssues.push(f),{raw:u,diagnostic:f}},pE=(t,e)=>[...t].sort((n,i)=>{let s=e.getSortKey(n),o=e.getSortKey(i);if(s===void 0||o===void 0)throw new Error("Sort keys must be set");if(s!==o)return s-o;if(!n.tokenIndexes?.end||!i.tokenIndexes?.end)throw new Error("Must have token indexes");return n.tokenIndexes.end.pos.line!==i.tokenIndexes.end.pos.line?n.tokenIndexes.end.pos.line-i.tokenIndexes.end.pos.line:n.tokenIndexes.end.pos.col-i.tokenIndexes.end.pos.col});async function _t(t,e,r){let n=De(t.textDocument.uri);if(!e)return[];let i=performance.now(),o=(await e.getRuntime()).getDeepestAstNode(n,t.position),a=e.getSortKey(o?.ast);return console.log(`search: ${performance.now()-i}ms`),r(o,l=>{let u=t.position;return de(l.uri,n)?!!(l.tokenIndexes?.end&&(l.tokenIndexes.end.pos.line<u.line||l.tokenIndexes.end.pos.line===u.line&&l.tokenIndexes.end.pos.colEnd<=u.character)):a!==void 0&&(e.getSortKey(l)??-1)<=a})}function W(t,e){return{start:t,end:e??t}}var H=(t,e)=>t?.tokens.some(r=>r===e),rt=(t,e=!1)=>r=>r?.value&&(e?t.toLowerCase()===r.value.toLowerCase():t===r.value)?"yes":$j(t)(r),je=t=>e=>e?.tokens.some(r=>r===t)?"yes":"no",$j=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",Cn=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&de(t.uri,e.uri),zt=(t,e)=>t?.adjacentToken&&t.adjacentToken.value===e?.value||e?.adjacentToken&&e.adjacentToken.value===t?.value?!0:!!t&&!!e&&Cn(t,e)&&t.pos.colEnd===e.pos.col,af=t=>t.map((e,r)=>({index:r,context:e,files:e.getContextFiles()})),sn=(t,e,r,n)=>{if("id"in e){let s=t?.find(o=>o.id===e.id);return s||void 0}if("name"in e){let s=t?.find(o=>o.ctxNames.includes(e.name));return s||void 0}return r?.getContextFiles().find(s=>de(s,e.uri))?r:af(t).sort(s=>s.context.id===n?-1:0).find(s=>s.files.some(o=>de(o,e.uri)))?.context},Oy=(t,e)=>af(t).filter(n=>n.files.some(i=>de(i,e))).map(n=>n.context),hE=t=>{let e=/^(\w+)\s+(.+)$/,r=/^(\w+)\(([^)]*)\)\s+(.+)$/,n=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,i;if(i=n.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(i=r.exec(t)){let[,,s,o]=i,a=s.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(i=e.exec(t)){let[,,s]=i;return s.trim()}},nf=(t,e)=>{let r=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),n=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),i=t,s;do s=i,i=r(s),i=n(i),i=i.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(i!==s);return i};function Bj(t){return t.replace(/'(.)'/g,(e,r)=>r.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function Ie(t){try{return(0,eval)(Bj(t))}catch(e){console.log(e instanceof Error?e.message:e)}return t}var ve=t=>Ay.default.pathToFileURL(t).toString(),De=t=>tt(Ay.default.fileURLToPath(t)),de=(t,e)=>!t||!e?!1:t===e,tt=t=>(0,cE.normalize)(process.platform==="win32"?t.toLowerCase():t),bi=t=>(0,aE.createHash)("sha256").update([tt(t.dtsFile),...t.includePaths.map(tt),...t.overlays.map(tt),t.bindingType,...t.zephyrBindings.map(tt),...t.deviceOrgBindingsMetaSchema.map(tt),...t.deviceOrgTreeBindings.map(tt)].join(":")).digest("hex"),Fj=t=>{switch(t){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 49:return"Node name shall start with a lower or upper case character";case 50:return"Node unit address should not start with 0x";case 51:return"Node unit address should not end with with ULL";case 8:return"Expected node address";case 9:return"Expected node path";case 48:return"Expected node path reference";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 52:return"Unknown Node Address syntax";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},jj=t=>t.issues.map(e=>{switch(e){case 0:return`Property "${t.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 "${t.templateStrings[0]}" has been defined`;case 8:return`No node with name "${t.templateStrings[0]}" could be found in "/${t.templateStrings[1]}".`;case 4:return`Label name "${t.templateStrings[0]}" already defined`;case 6:return`Property "${t.templateStrings[0]}" was deleted`;case 7:return`Node "${t.templateStrings[0]}" was deleted`;case 9:return`The following node "${t.templateStrings[1]}" shall be present in "${t.templateStrings[0]}" node.`;case 10:return`The following node "${t.templateStrings[0]}" address range collides with another node. Address start: "${t.templateStrings[1]}", end: "${t.templateStrings[2]}".`}}).join(" or "),Uj=(t,e)=>{switch(t){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";case 10:return`Node "${e[0]}". Address start: "${e[1]}", end: "${e[2]}".`;default:return"TODO"}},Hj=t=>t.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${t.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 ${t.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 27:return"INTRO name is not permitted under this node";case 34:return"INTRO name is not defined in the type binding for this node";case 10:return"INTRO address 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 ${t.templateStrings[1]}'`;case 18:return"INTRO value must be unique in the entire Devicetree";case 19:return`INTRO should have format ${t.templateStrings[1]}`;case 16:return`INTRO requires property "${t.templateStrings[1]}" in node path "${t.templateStrings[2]}"`;case 17:return"Unable to resolve interrupt parent node";case 20:return`INTRO should have format ${t.templateStrings[1]}`;case 21:return"Node is disabled";case 22:return"Unable to resolve handle";case 23:return`Unable to find "${t.templateStrings[0]}" in ${t.templateStrings[1]}`;case 24:return t.templateStrings[0];case 25:return t.templateStrings[0];case 26:return t.templateStrings[0];case 28:return t.templateStrings[0];case 35:return"Unable to find mapping range for address";case 29:return`INTRO exceeds address space available for this mapping. The range ends at ${t.templateStrings[2]}, the node ends at ${t.templateStrings[1]}`;case 30:return"Map entry overlaps with others entries";case 31:return"Unable to match to a nexus map entry";case 32:return`Unknown node type "${t.templateStrings[0]}"`;case 33:return`Missing name for "${t.templateStrings[0]}" index ${t.templateStrings[1]}"`;case 36:return"Node address is missing";case 37:return`Binding should be used on bus type${t.templateStrings.length?"s":""}: ${t.templateStrings.join(" or ")}`}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),Vj=t=>{switch(t){case 16:case 0:return"Node";case 15:return"Ignored reason";case 18:return"Conflicting properties";case 8:return"Additional value";case 21:return"Disabled by";case 29:return"Mapping range";case 30:return"Map entry";case 31:return"Nexus map entries";case 33:return"Names property";case 35:return"Range property";default:return"TODO"}},rn=(t,e)=>{let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[t.length-r+n]??0,s=e[e.length-r+n]??0;if(i<s)return-1;if(i>s)return 1}return 0},Xi=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0,c=o+a+i;n[r-1-s]=c>>>0,i=c>4294967295?1:0}return i&&n.unshift(1),n},zj=(t,e)=>{let r=Math.max(t.length,e.length),n=new Array(r).fill(0),i=0;for(let s=0;s<r;s++){let o=t[t.length-1-s]??0,a=e[e.length-1-s]??0;o-=i,o<a?(o+=4294967296,i=1):i=0,n[r-1-s]=o-a>>>0}for(;n.length>1&&n[0]===0;)n.shift();return n},Wj=(t,e)=>Xi(t,e),mE=(t,e)=>{let r=[];for(let n of t){let i=n.childAddress,s=n.length,o=Xi(i,s);if(rn(e,i)>=0&&rn(e,o)<0){let a=zj(e,i),c=n.parentAddress,l=Wj(c,a),u=Xi(c,s);r.push({start:l,end:u,range:Hr(n.rangeTokens.start,n.rangeTokens.end),uri:n.rangeTokens.start.uri})}}return r};function gE(t){return Array.isArray(t)&&Array.isArray(t[0])}function yc(t){return!t||t instanceof wn?t:yc(t.parentNode)}function xy(t,e){let r=t.getText(),n=e.slice().sort((s,o)=>{let a=t.offsetAt(s.range.start),c=t.offsetAt(o.range.start);if(a!==c)return c-a;let l=t.offsetAt(s.range.end),u=t.offsetAt(o.range.end);if(l!==u)return u-l;let d=a===l&&s.newText.length>0,f=c===u&&o.newText.length>0;return d!==f?d?1:-1:0}),i=r;for(let s of n){let o=t.offsetAt(s.range.start),a=t.offsetAt(s.range.end);i=i.slice(0,o)+s.newText+i.slice(a)}return i}function oE(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}function yE(t,e){return oE(t.end,e.start)>0&&oE(t.start,e.end)<0}var vE=(t,e)=>{let r=TE(t,e),n=bE(t,e);r&&(t.topComment=r.comment),n&&(t.endComment=n.comment)},TE=(t,e)=>{let r=e.find(i=>i.lastToken===t.firstToken.prevToken&&(i.lastToken.pos.line===t.firstToken.pos.line||i.lastToken.pos.line+1===t.firstToken.pos.line));if(!r||r.astBeforeComment)return;r.astAfterComment=t;let n=TE(r,e);return n&&(n.comment.astAfterComment=t,r.astAfterComment=void 0),{comment:n?.comment??r,commentIsBefore:!0}},bE=(t,e)=>{let r=e.find(i=>i.firstToken.prevToken===t.lastToken&&i.firstToken.pos.line===t.lastToken.pos.line);if(!r)return;r.astBeforeComment=t;let n=bE(r,e);return n&&(n.comment.astBeforeComment=t,r.astBeforeComment=void 0),{comment:n?.comment??r,commentIsBefore:!1}},Ho=(t,e,r)=>{let n=[42,44,45,36];return r||n.push(52,32,8,49),t.severity===Ki.DiagnosticSeverity.Error&&de(t.uri,e)&&!n.some(i=>t.issues.includes(i))};var Oc=require("fs"),MC=require("path");var Dn=L(j());var PE=L(j());var _E=L(j());var ie=class extends Z{constructor(r,n){super(n);this.value=r;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:_E.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return{type:"STRING",value:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var NE=L(j());var SE=L(j());var Zt=class extends Ee{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value.toString(),kind:SE.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(r){return this.value.toString(r)}toJson(){return this.value}toPrettyString(r){let n=this.evaluate(r);return`${n.toString()} /* ${typeof n=="number"?`0x${n.toString(16)}`:""} */`}serialize(){return{type:"NUMBER_VALUE",value:this.toString(),evaluated:this.value,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Lt=class extends Z{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Cell Array",kind:NE.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`<${this.values.map(r=>r.toString()).join(" ")}>`}toPrettyString(r){return`<${this.values.map(n=>n.toPrettyString(r)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(r=>r.value instanceof Zt)){let r=new ArrayBuffer(8),n=new DataView(r);return this.values.map(i=>i.value.value).forEach((i,s)=>{n.setUint32(s*4,i)}),n.getBigUint64(0)}return this.values.map(r=>r.value?.toJson()??NaN)}serialize(r){return{type:"ARRAY_VALUE",value:this.values.map(n=>n.value?.serialize(r)??null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var RE=L(j());var _i=class extends Z{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Byte String Value",kind:RE.SymbolKind.Array},this.values.forEach(n=>this.addChild(n))}toString(){return`[${this.values.map(r=>r.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(r=>r.value?.toJson()??NaN)}serialize(){return{type:"BYTESTRING",values:this.values.map(r=>r.value?{value:r.value.toString(16),range:r.value.range,evaluated:r.value.value}:null),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var Qe=class extends Z{constructor(r,n){super(n);this.name=r;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return{value:this.name,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ye=class extends Z{constructor(r,n=[]){super();this.propertyName=r;this.labels=n;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:PE.SymbolKind.Property},this.labels.forEach(i=>this.addChild(i)),this.addChild(r)}set values(r){if(this._values)throw new Error("Only one property name is allowed");this._values=r,this.addChild(r)}get values(){return this._values}get quickValues(){return this.values?.values.map(r=>r?r.value instanceof ie?r.value.value:r.value instanceof Lt?r.value.values.map(n=>n.value instanceof Zt?n.value.value:NaN):r.value instanceof _i?r.value.values.map(n=>n.value?.value??NaN):NaN:null)}getFlatAstValues(){return this.values?.values.flatMap(r=>r?r.value instanceof ie?r.value:r.value instanceof Lt?r.value.values.map(n=>n.value):r.value instanceof _i?r.value.values.map(n=>n.value):r.value:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(r){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toPrettyString(r)??"NULL").join(", ")??"NULL"}`:""};`}serialize(r){return{name:this.propertyName?.serialize()??null,values:this.values?.values.map(n=>n?.value?.serialize(r)??null)??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var kE=L(j());var vr=class extends Z{constructor(r,n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:r,kind:kE.SymbolKind.Function}}};var Dr=class extends vr{constructor(r){super("Delete Node",r);this._nodeNameOrRef=null}set nodeNameOrRef(r){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=r,this.addChild(r)}get nodeNameOrRef(){return this._nodeNameOrRef}};var pt=class extends vr{constructor(r){super("Delete Property",r);this._propertyName=null}set propertyName(r){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=r,this.addChild(r)}get propertyName(){return this._propertyName}};var EE=L(j());var se=class extends Z{constructor(r){super();this.label=r;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:EE.SymbolKind.Key},this.addChild(r)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return{type:"LABEL_REF",label:this.label?.toString()??null,nodePath:this.linksTo?.pathString??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var ct=class t extends Z{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof St)return[this.pathName];if(!(this.parentNode instanceof t))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof t)}get deleteNodes(){return this.children.filter(e=>e instanceof Dr)}addNodeChild(e){this.addChild(e)}},St=class extends ct{constructor(){super(),this.docSymbolsMeta={name:"/",kind:Dn.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof Ye)}get name(){return new He("/",W(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof pt)}get nodes(){return this.children.filter(e=>e instanceof Ue)}get pathName(){return"/"}serialize(e){return{type:"ROOT",properties:this.properties.map(r=>r.serialize(e)),nodes:this.nodes.map(r=>r.serialize(e)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Wt=class extends ct{constructor(r=[]){super();this.labels=r;this._reference=null;this.docSymbolsMeta={name:"DTC Name",kind:Dn.SymbolKind.Class},r.forEach(n=>{super.addChild(n)})}get serializeIssues(){return[...this.issues,...this.reference?.issues??[]].map(r=>r())}set reference(r){if(this._reference)throw new Error("Only on label reference is allowed");this._reference=r;let n;r instanceof se?n=r.value:n=r?.path?.pathParts.at(-1)?.name??"DTC Name",this.docSymbolsMeta={name:n??"DTC Name",kind:Dn.SymbolKind.Class},this.addChild(r)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get reference(){return this._reference}get nodes(){return this.children.filter(r=>r instanceof Ue)}get pathName(){if(this.reference instanceof se&&this.reference.label?.value)return`&${this.reference.label.value}`}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof pt)}serialize(r){return{type:"REF",name:this.reference?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},Ue=class t extends ct{constructor(r=[],n){super();this.labels=r;this.omitIfNoRef=n;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:Dn.SymbolKind.Class},n&&this.addChild(n),r.forEach(i=>{this.addChild(i)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(r=>r())}set name(r){if(this._name)throw new Error("Only on label reference is allowed");this._name=r,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:Dn.SymbolKind.Class},this.addChild(r)}get name(){return this._name}get nodes(){return this.children.filter(r=>r instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(r=>r instanceof Ye)}get deleteProperties(){return this.children.filter(r=>r instanceof pt)}serialize(r){return{type:"CHILD",name:this.name?.serialize()??null,properties:this.properties.map(n=>n.serialize(r)),nodes:this.nodes.map(n=>n.serialize(r)),uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},vc=class extends Z{constructor(r,n){super(n);this.address=r;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((r,n)=>r.toString(16).padStart(n?8:0,"0")).join("")??"NaN"}serialize(){return{address:this.address,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}},He=class extends Z{constructor(r,n,i){super(n);this.name=r;this._address=i;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(r){if(this._address)throw new Error("Address can only be set once");r&&(this.lastToken=void 0,this._address=r,r.forEach(n=>this.addChild(n)))}get fullAddress(){return this._address?[...this._address.flatMap(r=>r.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(r=>r.toString()).join(",")}`:this.name}buildSemanticTokens(r){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let n={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};r(vi("type"),Ti("declaration"),{start:n,end:n}),this.address!==void 0&&this.address.forEach(i=>{r(vi("decorator"),Ti("declaration"),{start:i.firstToken,end:i.lastToken}),i.buildSemanticTokens(r)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(r=>r.issues)??[]].map(r=>r())}serialize(){return{fullName:this.toString(),name:{name:this.name,uri:this.serializeUri,range:Dn.Range.create(Dn.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),Dn.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),issues:this.serializeIssues},address:this.address?.map(r=>r.serialize())??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var ln=L(j());var Tr=class extends Z{constructor(r,n,i,s){super();this.startLabels=r;this.value=n;this.endLabels=i;this.bits=s;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(s),this.addChild(n),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toPrettyString(r){return`${[this.value?.toPrettyString(r)??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var jt=t=>t instanceof vr?!0:t instanceof ct?!1:t.parentNode?jt(t.parentNode):!1;var My=t=>{if(t instanceof Ye)return t;if(!(t instanceof ct))return t.parentNode?My(t.parentNode):void 0},js=t=>!t||t instanceof Ye?!1:t instanceof Tr||js(t.parentNode),Vo=t=>[...t.map(e=>{if(e instanceof Ue||e instanceof St)return e.name;if(e instanceof Wt)return e.reference})].filter(e=>!!e),qy=(t,e)=>e?e.parentNode===t||qy(t,e.parentNode):!1;var Et=L(j());var wE=L(j());var An=class extends Z{constructor(){super();this._pathParts=[]}addPath(r,n){this._pathParts.push(r),n&&this.addChild(n),this.addChild(r)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(r=>r?.toString()??"<NULL>").join("/")}buildSemanticTokens(r){this._children.forEach(n=>{n instanceof He?n.buildSemanticTokens(r):r(vi("operator"),Ti("declaration"),n.tokenIndexes)})}},nt=class extends Z{constructor(r){super();this.path=r;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:wE.SymbolKind.Namespace},this.addChild(r)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return{type:"NODE_PATH",nodePath:this.path?.toString()??null,uri:this.serializeUri,range:this.range,issues:this.serializeIssues}}};var te=L(j());var CE=require("path"),cf=L(j());var Si=class extends Z{constructor(r,n){super();this.keyword=r;this.path=n;this.docSymbolsMeta={name:`Include ${n}`,kind:cf.SymbolKind.File},this.addChild(r),this.addChild(n)}get resolvedPath(){return this._resolvedPath}set resolvedPath(r){this.docSymbolsMeta={name:`Include ${r}`,kind:cf.SymbolKind.File},this._resolvedPath=r}},zo=class extends Z{constructor(r,n,i){super(i);this._path=r;this.relative=n;this.docSymbolsMeta={name:(0,CE.basename)(this.path),kind:cf.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var on=class extends Z{constructor(r){super();this.comments=r;r.forEach(this.addChild.bind(this))}toString(){return this.comments.map(r=>r.toString()).join(`
|
|
183
|
+
`)}},an=class extends Z{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}toString(){let e,r=this.firstToken,n="";for(;r!==this.lastToken;)n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "),e=r,r=r?.nextToken;r&&(n+=r?.value.padStart(r.value.length+(e?r.pos.col-e.pos.colEnd:0)," "));let i=n.match(/^\s*(?:(?:\/\/|\/\*+)\s*)?(.*?)\s*(?:\*\/)?\s*$/s);return i?i[1]:""}};var DE=L(j());var Ct=class extends Ee{constructor(r,n){super(n);this.name=r;this.docSymbolsMeta={name:this.name.toString(),kind:DE.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var _f=L(j());var Ly=L(j());var Ji=class extends Z{constructor(r,n){super(n);this.label=r;this.docSymbolsMeta={name:this.label.value,kind:Ly.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(r)}toString(){return`${this.label.toString()}:`}},er=class extends Z{constructor(r,n){super(n);this.value=r;this.docSymbolsMeta={name:this.value,kind:Ly.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(r){let n=this.parentNode;if(!(n instanceof se&&n.linksTo)){super.buildSemanticTokens(r);return}r(vi("type"),Ti("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var ht=class extends Z{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var AE=L(j());var lf=class extends Z{constructor(r){super();this.values=r;this.docSymbolsMeta={name:"Values",kind:AE.SymbolKind.String},this.values.forEach(n=>this.addChild(n))}toString(){return this.values.map(r=>r?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(r=>r?.toJson())}};var IE=L(j());var uf=class extends Z{constructor(r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:"DTS Document version",kind:IE.SymbolKind.Function}}};var Jn=class extends Z{constructor(r,n){super();this.value=r;this.labels=n;this.labels.forEach(i=>{this.addChild(i)}),this.addChild(this.value)}toString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toString(r)??"NULL"}`}toPrettyString(r){return`${this.labels.map(n=>n.toString()).join(" ")}${this.value?.toPrettyString(r)??"NULL"}`}};var df=class extends Z{constructor(r,n){super(n);this.operator=r;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var OE=L(j());var ff=class extends ht{toString(){return"..."}},Qn=class extends Z{constructor(r,n){super();this.functionName=r;this.params=n;this.addChild(r),this.params.forEach(i=>this.addChild(i))}getDocumentSymbols(r){return de(this.uri,r)?[{name:this.functionName.name,kind:OE.SymbolKind.Function,range:fe(this),selectionRange:fe(this),children:this.params.flatMap(n=>n.getDocumentSymbols(r))}]:[]}toString(){return`${this.functionName}(${this.params.map(r=>r.toString()).join(",")})`}};var Qi=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,r=!0)=>{let n=e.pos.line;if(this.currentToken?.pos.line!==n||!de(this.currentToken?.uri,e.uri))return;let i=this.currentToken,s=i;for(;this.currentToken?.pos.line===n&&de(this.currentToken?.uri,e.uri);)s=this.moveToNextToken;return r&&this._issues.push(G(22,W(i,s),null)),s};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;if(e)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(),r=this.positionStack.pop();if(r===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=r}peekIndex(e=1){let r=this.positionStack.at(-1*e);if(r===void 0)throw new Error("Index out of bounds");return r}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let r=[];return e.every(n=>{let i=this.currentToken,s=n(i),o=!1;return s!=="no"&&i&&(r.push(i),this.moveToNextToken,o=zt(i,this.currentToken)),s==="yes"&&o}),this.mergeStack(),r}consumeAnyConcurrentTokens(e){this.enqueueToStack();let r=[],n,i=!0;for(;e.some(s=>s(this.currentToken)==="yes"&&i);)r.push(this.currentToken),n=this.moveToNextToken,i=zt(n,this.currentToken);return this.mergeStack(),r}getDocumentSymbols(e){return this.allAstItems.flatMap(r=>r.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,r){let n=[],i=(s,o,a)=>{if(!a?.start||!a?.end||!de(a.start.uri,r)||!de(a.end.uri,r))return;let c=a.end.pos.colEnd-a.start.pos.col;n.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(i)}),n.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(e,r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!n.length){this.popStack();return}let i=n.map(o=>o.value).join("");if(!i.match(/^[_A-Za-z]/)){this.popStack();return}let s=new Ct(i,W(n[0],n.at(-1)));return!r&&s.name!=="defined"&&(e.get(s.name)||this._issues.push(G(42,s.rangeTokens,s))),this.mergeStack(),s}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let r=e,n;if(H(e,40)?(n="&",H(this.currentToken,40)&&(n="&&",r=this.moveToNextToken)):H(e,10)?(n="!",H(this.currentToken,0)&&(n="!=",r=this.moveToNextToken)):H(e,8)?(n="|",H(this.currentToken,8)&&(n="||",r=this.moveToNextToken)):H(e,9)?n="^":H(e,4)?(n=">",H(this.currentToken,4)?(n="<<",r=this.moveToNextToken):H(this.currentToken,0)&&(n=">=",r=this.moveToNextToken)):H(e,5)?(n="<",H(this.currentToken,5)?(n=">>",r=this.moveToNextToken):H(this.currentToken,0)&&(n="<=",r=this.moveToNextToken)):H(e,15)?n="+":H(e,16)?n="-":H(e,17)?n="*":H(e,13)?n="/":H(e,18)?n="%":H(e,46)?H(this.currentToken,46)&&(n="##",r=this.moveToNextToken):H(e,0)&&H(this.currentToken,0)&&(n="==",r=this.moveToNextToken),n){let i=new df(n,W(e,r));return this.mergeStack(),i}this.popStack()}parseScopedBlock(e,r,n){this.enqueueToStack();let i=this.moveToNextToken;if(!i||!e(i)){this.popStack();return}let s=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=s},a=g=>g.flatMap(h=>"items"in h?a(h.items):h),c=[i],l=[],u=[];u[0]={rewind:o,tokens:[]};let d=this.currentToken;for(;d&&!r(d);){if(n?.(d)){let g=this.peekIndex()+1,h=()=>{this.positionStack[this.positionStack.length-1]=g};c.push(d),l.push(d),u[u.length]={rewind:h,tokens:[]}}else if(e(d)){let g=this.parseScopedBlock(e,r,n);g&&(c.push(g),u[u.length-1].tokens.push(...a(g.items))),d=this.currentToken;continue}else c.push(d),u[u.length-1].tokens.push(d);this.moveToNextToken,d=this.currentToken}let f=d;f&&r(f)&&(this.moveToNextToken,c.push(f));let p={startToken:i,items:c,splitTokens:u,endToken:f,separatorTokens:l};return this.mergeStack(),p}isFunctionCall(e){this.enqueueToStack();let r=this.processCIdentifier(e,!1);if(!r){this.popStack();return}if(!zt(r.lastToken,this.currentToken)){this.popStack();return}let n=this.processMacroCallParams();if(!n){this.popStack();return}if(r.name==="defined")n.length>1?this._issues.push(G(44,r.rangeTokens,r)):n.length<1&&this._issues.push(G(45,r.rangeTokens,r));else{let s=e.get(r.name)?.macro;s&&(s?.identifier instanceof Qn?n.length>s.identifier.params.length?this._issues.push(G(44,r.rangeTokens,r,{linkedTo:[s]})):n.length<s.identifier.params.length&&this._issues.push(G(45,r.rangeTokens,r,{linkedTo:[s]})):this._issues.push(G(43,r.rangeTokens,r)))}let i=new wn(r,n);return i.lastToken=this.prevToken,this.mergeStack(),i}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([rt("0"),rt("x",!0)]);if(e.length!==2){this.popStack();return}let r=this.consumeAnyConcurrentTokens([19,20].map(je));if(!r.length){this.popStack();return}let n=Number.parseInt(r.map(s=>s.value).join(""),16),i=new Zt(n,W(e[0],r.at(-1)));return this.mergeStack(),i}processDec(e=!1){this.enqueueToStack();let r;e&&(H(this.currentToken,16)||H(this.currentToken,15))&&zt(this.currentToken,this.currentToken?.nextToken)&&(r=this.moveToNextToken);let n=this.consumeAnyConcurrentTokens([19].map(je));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(o=>o.value).join(""),10);r&&H(r,16)&&(i=4294967295-i);let s=new Zt(i,W(r??n[0],n.at(-1)));return this.mergeStack(),s}processEnclosedExpression(e,r){this.enqueueToStack();let n,i;if(H(this.currentToken,42)){let s;n=this.moveToNextToken,i=n;let o=this.processExpression(e,r,!0);return o&&(s=new Yn(o,!0),o=new Yn(s,!1),s.openBracket=n),H(this.currentToken,43)?(i=this.moveToNextToken,s&&(s.closeBracket=i)):n&&this._issues.push(G(26,W(n),r)),this.mergeStack(),o}this.popStack()}processExpression(e,r,n=!1){this.enqueueToStack();let i;if(i=this.processEnclosedExpression(e,r)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(!0),!i){this.popStack();return}if(n){let s=this.isOperator();for(;s;){let o=this.processExpression(e,r);o?i instanceof Yn?i.addExpression(s,o):i=new Yn(i,!1,{operator:s,expression:o}):this._issues.push(G(27,s.rangeTokens,r)),s=this.isOperator()}}return this.mergeStack(),i}processMacroCallParams(){if(!H(this.currentToken,42))return;let e=this.parseScopedBlock(n=>!!H(n,42),n=>!!H(n,43),n=>!!H(n,24));return e?.items.length===2&&H(e.endToken,43)?[]:e?.splitTokens.map((n,i)=>{if(n.tokens.length===0)return null;let s=new Kn(n.tokens.map((o,a)=>{let c=o.value;return o.pos.line===n.tokens.at(a+1)?.pos.line?c=c.padEnd(n.tokens[a+1].pos.col-o.pos.col," "):o.value==="\\"&&(c=c.slice(0,-1)),c}).join(""),W(n.tokens[0],n.tokens.at(-1)),i);return s.splitToken=e.separatorTokens.at(i),s})}};var Fy=require("fs"),Yo=require("path"),kc=L(j());var _c=require("fs");var Wo=class t{constructor(e,r){this.text=e;this.uri=r;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this._tokens=[];this.lines=this.text.replace(`\r
|
|
184
184
|
`,`
|
|
185
185
|
`).split(/\n/).map(n=>`${n}
|
|
186
186
|
`),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
|
|
187
187
|
`)&&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.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==="X"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!t.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&t.isSyntaxChar(this.currentChar)){this.move();break}let r=this.lineNumber;if(!this.move()||this.lineNumber!==r)return e}return e==="/"&&(this.currentChar==="*"||this.currentChar==="/")?(this.inComment=!0,this.currentChar==="/"&&(this.inCommentLineStart=this.lineNumber)):(this.inComment&&e==="*"&&this.currentChar==="/"||this.inCommentLineStart!==void 0&&this.lineNumber!==this.inCommentLineStart)&&(this.inComment=!1,this.inCommentLineStart=void 0),e}getString(e){let r=e,n;for(;this.currentChar!==e;){if(this.currentChar===`
|
|
188
|
-
`){let a=this.lineNumber,c=this.columnNumber,l=r.length;this.pushToken({tokens:[21],value:r,pos:{col:c-l,line:a,len:l,colEnd:c},adjacentToken:n}),n=this._tokens.at(-1),r=""}else if(this.currentChar==="\\"){let a=this.lineNumber;if(r+=this.currentChar??"",this.move())a===this.lineNumber&&(r+=this.currentChar??"");else break}else r+=this.currentChar??"";if(!this.move())break}r+=e;let i=this.lineNumber,s=this.columnNumber+1,o=r.length;this.pushToken({tokens:[21],value:r,pos:{col:s-o,line:i,len:o,colEnd:s},adjacentToken:n}),this.move()}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let r=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(!r)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let n=this._tokens.at(-1);return r&&!n?.tokens.some(i=>i===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let r={...e,uri:this.uri},n=this._tokens.at(-1);r.prevToken=n,n&&(n.nextToken=r),this._tokens.push(r)}isLetters(e){let r=e.match(/^[A-Za-z]+/);return r?.[0]?(this.pushToken({tokens:[47],value:r?.[0],pos:this.generatePos(e,r?.[0])}),!0):!1}isDigit(e){let r=e.match(/^[0-9]/);return r?.[0]?(this.pushToken({tokens:[20,19],value:r[0],pos:this.generatePos(e,r[0])}),!0):!1}isHexDigit(e){let r=e.match(/^[A-Fa-f]/);return r?.[0]?(this.pushToken({tokens:[20,47],value:r[0],pos:this.generatePos(e,r[0])}),!0):!1}isCurlyOpen(e){let r="{";return e===r?(this.pushToken({tokens:[2],pos:this.generatePos(e,r),value:"{"}),!0):!1}isCurlyClose(e){let r="}";return e===r?(this.pushToken({tokens:[3],pos:this.generatePos(e,r),value:"}"}),!0):!1}isSemicolon(e){let r=";";return e===r?(this.pushToken({tokens:[1],pos:this.generatePos(e,r),value:r}),!0):!1}isColon(e){let r=":";return e===r?(this.pushToken({tokens:[50],pos:this.generatePos(e,r),value:r}),!0):!1}isHash(e){let r="#";return e.startsWith(r)?(this.pushToken({tokens:[46],pos:this.generatePos(e,r),value:r}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let r="=";return e===r?(this.pushToken({tokens:[0],pos:this.generatePos(e,r),value:r}),!0):!1}isGtSym(e){let r=">";return e===r?(this.pushToken({tokens:[4],pos:this.generatePos(e,r),value:r}),!0):!1}isLtSym(e){let r="<";return e===r?(this.pushToken({tokens:[5],pos:this.generatePos(e,r),value:r}),!0):!1}isLogicalNot(e){let r="!";return e===r?(this.pushToken({tokens:[6],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseOr(e){let r="|";return e===r?(this.pushToken({tokens:[8],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseXOr(e){let r="^";return e===r?(this.pushToken({tokens:[9],pos:this.generatePos(e,r),value:r}),!0):!1}isAmpersand(e){let r="&";return e===r?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseNot(e){let r="~";return e===r?(this.pushToken({tokens:[10],pos:this.generatePos(e,r),value:r}),!0):!1}isRoundOpen(e){let r="(";return e===r?(this.pushToken({tokens:[42],pos:this.generatePos(e,r),value:r}),!0):!1}isRoundClose(e){let r=")";return e===r?(this.pushToken({tokens:[43],pos:this.generatePos(e,r),value:r}),!0):!1}isSquareOpen(e){let r="[";return e===r?(this.pushToken({tokens:[11],pos:this.generatePos(e,r),value:r}),!0):!1}isSquareClose(e){let r="]";return e===r?(this.pushToken({tokens:[12],pos:this.generatePos(e,r),value:r}),!0):!1}isComma(e){let r=",";return e===r?(this.pushToken({tokens:[24],pos:this.generatePos(e,r),value:r}),!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 r=e.match(/^["']/);return r?.[0]?(this.rewind(e.slice(1)),this.getString(r[0]),!0):!1}isForwardSlash(e){let r="/";return e===r?(this.pushToken({tokens:[13],pos:this.generatePos(e,r),value:"/"}),!0):!1}isBackSlash(e){let r="\\";return e===r?(this.pushToken({tokens:[14],pos:this.generatePos(e,r),value:"\\"}),!0):!1}isAddOperator(e){let r="+";return e===r?(this.pushToken({tokens:[15],pos:this.generatePos(e,r),value:r}),!0):!1}isQuestionMark(e){let r="?";return e===r?(this.pushToken({tokens:[44],pos:this.generatePos(e,r),value:r}),!0):!1}isPeriod(e){let r=".";return e===r?(this.pushToken({tokens:[45],pos:this.generatePos(e,r),value:r}),!0):!1}isNegateOperator(e){let r="-";return e===r?(this.pushToken({tokens:[16],pos:this.generatePos(e,r),value:r}),!0):!1}isUnderScore(e){let r="_";return e===r?(this.pushToken({tokens:[48],pos:this.generatePos(e,r),value:r}),!0):!1}isAt(e){let r="@";return e===r?(this.pushToken({tokens:[49],pos:this.generatePos(e,r),value:r}),!0):!1}isMultiplicationOperator(e){let r="*";return e===r?(this.pushToken({tokens:[17],pos:this.generatePos(e,r),value:r}),!0):!1}isModulusOperator(e){let r="%";return e===r?(this.pushToken({tokens:[18],pos:this.generatePos(e,r),value:r}),!0):!1}isCDefine(e){let r="#define";return e.toLowerCase()===r?(this.pushToken({tokens:[25],pos:this.generatePos(e,r),value:r}),!0):!1}isCInclude(e){let r="#include";return e.toLowerCase()===r?(this.pushToken({tokens:[26],pos:this.generatePos(e,r),value:r}),!0):!1}isCLine(e){let r="#line";return e.toLowerCase()===r?(this.pushToken({tokens:[27],pos:this.generatePos(e,r),value:r}),!0):!1}isCUndef(e){let r="#undef";return e.toLowerCase()===r?(this.pushToken({tokens:[28],pos:this.generatePos(e,r),value:r}),!0):!1}isCError(e){let r="#error";return e.toLowerCase()===r?(this.pushToken({tokens:[29],pos:this.generatePos(e,r),value:r}),!0):!1}isCPragma(e){let r="#pragma";return e.toLowerCase()===r?(this.pushToken({tokens:[30],pos:this.generatePos(e,r),value:r}),!0):!1}isCDefined(e){let r="#defined";return e.toLowerCase()===r?(this.pushToken({tokens:[31],pos:this.generatePos(e,r),value:r}),!0):!1}isCIf(e){let r="#if";return e.toLowerCase()===r?(this.pushToken({tokens:[32],pos:this.generatePos(e,r),value:r}),!0):!1}isCIfDef(e){let r="#ifdef";return e.toLowerCase()===r?(this.pushToken({tokens:[33],pos:this.generatePos(e,r),value:r}),!0):!1}isCIfNDef(e){let r="#ifndef";return e.toLowerCase()===r?(this.pushToken({tokens:[34],pos:this.generatePos(e,r),value:r}),!0):!1}isCElIf(e){let r="#elif";return e.toLowerCase()===r?(this.pushToken({tokens:[35],pos:this.generatePos(e,r),value:r}),!0):!1}isCElse(e){let r="#else";return e.toLowerCase()===r?(this.pushToken({tokens:[36],pos:this.generatePos(e,r),value:r}),!0):!1}isCEndIf(e){let r="#endif";return e.toLowerCase()===r?(this.pushToken({tokens:[37],pos:this.generatePos(e,r),value:r}),!0):!1}isCTrue(e){let r="true";return e==r?(this.pushToken({tokens:[38],value:r,pos:this.generatePos(e,r)}),!0):!1}isCFalse(e){let r="false";return e==r?(this.pushToken({tokens:[39],value:r,pos:this.generatePos(e,r)}),!0):!1}generatePos(e,r){let n=this.columnNumber-e.length;return{line:this.lineNumber,col:n,len:r.length,colEnd:n+r.length}}};var Wy,_f=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,r,n,i){e=rt(e);let s=`${Array.from(n).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(n),o;console.log("No cpreprocess cache",e);let a=new Qo(e,r,n),c=this.includeOwners.get(a)??new Set;return c.add(i),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(s,a),a}reset(e){e=rt(e);let r=this.headerFiles.get(e);r&&Array.from(r).forEach(n=>{n[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(n[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function Cc(){return Wy??=new _f,Wy}function Hw(){Wy=new _f}var Gy,Sf=class t{constructor(){this.fileMap=new Map}static clone(e){let r=e.map(n=>({...n}));return r.forEach((n,i)=>{n.prevToken=r[i-1],n.nextToken=r[i+1]}),r}needsRenew(e,r){return e=rt(e),this.fileMap.get(e)?.text!==r}getDocument(e,r){return Qi.create(e,"devicetree",0,r??this.fileMap.get(e)?.text??(0,Dc.readFileSync)(e).toString())}renewLexer(e,r){if(e=rt(e),Cc().reset(e),!r&&!(0,Dc.existsSync)(e))return[];try{r??=(0,Dc.readFileSync)(e).toString();let n=new Jo(r,e);return this.fileMap.set(e,n),t.clone(n.tokens)}catch{}return[]}requestTokens(e,r){e=rt(e);let n=this.fileMap.get(e)?.tokens;return!n&&r?[...this.renewLexer(e)]:t.clone(n??[])}reset(e){e=rt(e),Cc().reset(e),this.fileMap.delete(e)}};function Or(){return Gy??=new Sf,Gy}function Vw(){Gy=new Sf}var Nf=class t extends ts{constructor(r,n=()=>Or().requestTokens(this.uri,!0)){super();this.uri=r;this.getTokens=n;this.comments=[];this.tokens=[]}cleanUpComments(){let r=[];for(let n=0;n<this.tokens.length;n++){let i=t.processBlockComment(this.tokens,n)||t.processLineComment(this.tokens,n);i&&(n=i.index,r.push(...i.tokenUsed),this.comments.push(i.comment))}r.reverse().forEach(n=>this.tokens.splice(n,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=this.getTokens(),this.cleanUpComments()}static processBlockComment(r,n){let i=[],s=()=>(i.push(n++),r[n]),o=()=>r[n],a=()=>r[n-1],c=o(),l=c;if(!c||!V(c,13)||(l=s(),!V(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!V(a(),17)||!V(o(),13)||!Gt(a(),o())),d=l.pos.line,f=c,p=[];l=s();do{if(o()?.pos.line!==d){let v=new cn(G(f,a()));p.push(v),d=o().pos.line??0,f=o()}l=s()}while(n<r.length&&!u());let y=new cn(G(f,o()));p.push(y);let h=new an(p);return s(),{comment:h,tokenUsed:i,index:n-1}}static processLineComment(r,n){let i=[];if(!V(r[n],13)||r.length===n+1||!V(r[n+1],13)||!Gt(r[n],r[n+1]))return;for(;r[n].pos.line===r.at(n+1)?.pos.line;)i.push(n++);return i.push(n++),{comment:new cn(G(r[i[0]],r[i.at(-1)])),tokenUsed:i,index:n-1}}};var zw=M(F());var Pf=class extends j{constructor(r,n){super(r);this.content=n}toString(){let r=this.content.filter(n=>!V(n,14));return r.map((n,i)=>{let s=n.value;return n.pos.line===r.at(i+1)?.pos.line?s=s.padEnd(r[i+1].pos.col-n.pos.col," "):r.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Ac=class extends j{constructor(r,n,i){super();this.keyword=r;this.identifier=n;this.content=i;this.addChild(r),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ct?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:zw.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
189
|
-
`)}}};var Gs=class extends j{constructor(e){super(e)}},Ic=class extends j{constructor(r,n){super();this.keyword=r;this.content=n;this.active=!1;this.addChild(r)}},Oc=class extends Ic{constructor(r,n,i){super(r,i);this.identifier=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.identifier&&r.has(this.identifier.name)}},Rf=class extends Ic{constructor(r,n,i){super(r,i);this.expression=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.expression instanceof kn?this.expression.functionName.name==="defined"?this.expression&&r.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(r):this.expression?.isTrue(r)}},Ef=class extends Oc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},xc=class extends Ic{};var rs=class extends j{constructor(r,n,i){super();this.ifDef=r;this.endIf=n;this.elseOption=i;this.addChild(r),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];i.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(r);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&i.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(i.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}},ns=class extends j{constructor(r,n,i){super();this.ifBlocks=r;this.endIf=n;this.elseOption=i;r.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach(a=>{i.push({start:s(a.tokenIndexes.start),end:s(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(r)?(a.active=!0,o=!0):a.content&&i.push({start:s(a.content.tokenIndexes.start),end:s(a.content.tokenIndexes.end)})}),this.elseOption&&(i.push({start:s(this.elseOption.keyword.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}};var Qo=class extends ts{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.getTokens=s;this.skipIncludes=o;this.tokens=[];this.nodes=[];this._comments=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([a,c])=>this.macroSnapShot.set(a,c)),Array.from(i).forEach(([a,c])=>this.macros.set(a,c)))}get comments(){return this._comments}get currentToken(){let r=this.prevToken,n=Cn(r,this.tokens.at(this.peekIndex()))||!r||V(r,14)&&r.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!n))return this.macroStart&&V(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(r){super.reset(),this.macros.clear(),r?(this.macroSnapShot.clear(),Array.from(r).forEach(([n,i])=>this.macroSnapShot.set(n,i)),Array.from(r).forEach(([n,i])=>this.macros.set(n,i))):Array.from(this.macroSnapShot).forEach(([n,i])=>this.macros.set(n,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(r){let n=this.stable;return this.parsing=new Promise(i=>{n.then(()=>{if(r&&r.size===this.macroSnapShot.size){let s=Array.from(r);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=s[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),i();return}}this.reset(r),this.parse().then(i)})}),this.parsing}async parse(){let r=new Nf(this.uri,this.getTokens);if(await r.stable,this.tokens=r.tokens,this._comments=r.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||!fe(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let n=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();n&&this.moveEndOfLine(n,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!V(n,25))return this.popStack(),!1;this.macroStart=!0;let i=new mt(G(n)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(Y(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Pf(G(o[0],o.at(-1)),o));let c=new Ac(i,s,a);this.macros.set(c.name,{macro:c,resolver:Nw(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(r,l-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!V(n,28))return this.popStack(),!1;this.macroStart=!0;let i=new mt(G(n)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(Y(30,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new Ac(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(r,a-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let r=[];for(;this.currentToken;){let n=this.moveToNextToken;n&&r.push(n)}return r}isFunctionDefinition(){this.enqueueToStack();let r=this.processCIdentifier(this.macros,!0);if(!r){this.popStack();return}let n=this.moveToNextToken;if(!V(n,42)||!Gt(r.lastToken,n)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!V(this.currentToken,24)&&!V(this.currentToken,43)?this._issues.push(Y(28,s)):V(this.currentToken,43)||(n=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Zn(r,i);return V(this.currentToken,43)?(n=this.moveToNextToken,o.lastToken=n):(o.lastToken=this.prevToken,this._issues.push(Y(26,i.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(45),je(45),je(45)]);if(r.length!==3){this.popStack();return}let n=new bf(G(r[0],r.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let r=this.peekIndex(),n=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>V(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[37].some(a=>V(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[36,35].some(a=>V(o,a))&&!Cn(o.prevToken,o));if(!n)return;let i;V(n.startToken,32)?i=this.processIfBlock(n,(o,a,c)=>new Rf(o,a??null,c)):i=this.processIfDefBlock(n,(o,a,c)=>V(n.startToken,33)?new Oc(o,a??null,c):new Ef(o,a??null,c)),this.nodes.push(i),i.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...i instanceof ns?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(Y(47,o.content,Mc.DiagnosticSeverity.Hint,[],[Mc.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=r}processIfDefBlock(r,n){this.enqueueToStack(),this.macroStart=!0;let i=new mt(G(r.startToken));r.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(Y(31,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&r.splitTokens[0].tokens.find(f=>f===a)&&(o=new Gs(G(a,r.splitTokens[0].tokens.at(-1))));let c=n(i,s??null,o??null),l;if(r.splitTokens.length>1){let f=r.splitTokens[1].tokens[0].prevToken,p=new mt(G(f)),y;r.splitTokens[1].tokens.length&&(y=new Gs(G(r.splitTokens[1].tokens[0],r.splitTokens[1].tokens.at(-1)))),l=new xc(p,y??null)}let u;r.endToken?u=new mt(G(r.endToken)):this._issues.push(Y(46,i));let d=new rs(c,u??null,l);return this.mergeStack(),d}processIfBlock(r,n){this.enqueueToStack();let i=new mt(G(r.startToken)),s=[],o;r.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new mt(G(d));this.macroStart=!0;let p=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===r.splitTokens.length-1&&V(d,36)){let h=d,v=new mt(G(h)),S;l.tokens.length&&(S=new Gs(G(l.tokens[0],l.tokens.at(-1)))),o=new xc(v,S??null)}else{p||this._issues.push(Y(31,i));let h,v=p?.lastToken.nextToken??i.lastToken.nextToken;v&&l.tokens.find(_=>_===v)&&(h=new Gs(G(v,r.splitTokens[u].tokens.at(-1))));let S=n(f,p??null,h??null);s.push(S)}});let a;r.endToken?a=new mt(G(r.endToken)):this._issues.push(Y(46,i));let c=new ns(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes,...this.comments]}resolveInclude(r){if(r.path.path)return r.path.relative?[(0,Zo.resolve)((0,Zo.dirname)(r.uri),r.path.path),...this.incudes.map(n=>(0,Zo.resolve)(n,r.path.path))].find(n=>(0,Yy.existsSync)(n)):this.incudes.map(n=>(0,Zo.resolve)(n,r.path.path)).find(n=>(0,Yy.existsSync)(n))}async processInclude(){this.enqueueToStack();let r=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let i=n,s=n;if(V(n,26))this.moveToNextToken;else{let h=this.checkConcurrentTokens([je(13),nt("include"),je(13)]);if(h.length!==3)return this.popStack(),!1;i=h[0],s=h.at(-1)}let o=i,a=new mt(G(i,s));n=this.moveToNextToken;let c=n,l=!!V(n,21);if(!c||!l&&!V(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!V(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new Xo(u,l,G(c,n)),f=new Pi(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!V(this.currentToken,4)?this._issues.push(Y(12,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let p=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(Y(36,f.path,Mc.DiagnosticSeverity.Warning)),y&&!this.skipIncludes){Or().requestTokens(y,!0);let h=await Cc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await h.stable,this._issues.push(...h.issues),this.macros.clear(),Array.from(h.macros).forEach(([v,S])=>this.macros.set(v,S)),y.endsWith(".h")?this.tokens.splice(r,p-r):this.tokens.splice(r,p-r,...h.tokens),this.nodes.push(...h.nodes),this.dtsIncludes.push(...h.dtsIncludes)}else this.tokens.splice(r,p-r);return this.positionStack[this.positionStack.length-1]=r,!0}};var Ww=M(F());var wf=class extends j{constructor(r,n,i){super();this.keyword=r;this.startAddress=n;this.endAddress=i;this.addChild(r),this.docSymbolsMeta={name:"Memreserve",kind:Ww.SymbolKind.Function},this.addChild(n),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var Gw=M(F());var kf=class extends j{constructor(r,n){super();this.keyword=r;this.bitsSize=n;this.addChild(r),this.docSymbolsMeta={name:"bits",kind:Gw.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var Ys=class extends ts{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new lt;this.unhandledStatements=new Nt;this.cPreprocessorParser=new Qo(this.uri,this.incudes,i,s,o)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(r=>r.resolvedPath).filter(r=>!!r)]}reset(){super.reset(),this.others=[],this.rootDocument=new lt,this._issues=[],this.unhandledStatements=new Nt}async reparse(){let r=performance.now(),n=this.stable;return this.parsing=new Promise(i=>{n.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-r),i()})}),this.parsing}async parse(){if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,rt(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)||this.isChildNode(this.unhandledStatements,"Name"))){let s=this.moveToNextToken;if(s){let o=new j(G(s));this._issues.push(Y(22,o)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();this.unhandledStatements.properties.forEach(s=>{this._issues.push(Y(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(Y(33,s))});let n=this.allAstItems.flatMap(s=>[s,...s.allDescendants]),i=this.cPreprocessorParser.comments;if(i.length&&n.forEach(s=>{(s instanceof lt||s instanceof Ye)&&ww(s,i)}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(r){this.enqueueToStack();let n=this.moveToNextToken,i=n,s=13;if(!n||!V(n,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!V(i,s))return this.popStack(),!1;let o=new Nt;o.openScope=i,r.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(r){let n=this.currentToken;if(V(n,3))this.moveToNextToken;else{let i=this.prevToken;if(i){let s=new j(G(i));this._issues.push(Y(3,s))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(r.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return V(this.currentToken,3)||V(this.currentToken,1)}endStatement(r=!0){let n=this.currentToken;if(!V(n,1)){let i=this.prevToken;if(i&&r){let s=new j(G(this.prevToken));return this._issues.push(Y(1,s)),i}}return this.moveToNextToken,this.reportExtraEndStatements(),n}reportExtraEndStatements(){for(;V(this.currentToken,1);){let r=this.moveToNextToken;if(r){let n=new j(G(r));this._issues.push(Y(23,n))}}}processNode(r,n){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(r,n)||this.isProperty(r)||this.isDeleteNode(r,n)||this.isDeleteProperty(r),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(G(o));this._issues.push(Y(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(r=!1){let n=[],i=this.isLabelAssign(r);for(;i;)n.push(i),i=this.isLabelAssign(r);return n}isChildNode(r,n){this.enqueueToStack();let i;n==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new Yt(s):new Ue(s,i);if(n==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(),!a||!V(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef()):n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!V(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(Y(n==="Name"?[7]:[10,48,11],c))}let l=!1;if(a&&c instanceof Yt?(c.reference=a,l=!0):o&&c instanceof Ue&&(l=o.address!==void 0,c.name=o),V(this.currentToken,2)){c.openScope=this.moveToNextToken;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(Y(2,u))}else return this.popStack(),!1;return r.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let r=this.prevToken;this.enqueueToStack();let n=this.checkConcurrentTokens([nt("0"),nt("x",!0)]);n.length!==2?(n=[],this.popStack()):(this._issues.push(Y(50,new j(G(n[0],n[1])),Cf.DiagnosticSeverity.Warning)),r=n.at(-1),this.mergeStack());let i=this.consumeAnyConcurrentTokens([19,20,48].map(je)),s=c=>{c.length%8!==0&&(c=c.padStart(Math.ceil(c.length/8)*8,"0"));let l=[];for(let u=0;u<c.length;u+=8){let d=c.slice(u,u+8);l.push(parseInt(d,16)>>>0)}return l},o=i.length?s(i.filter(c=>c.value!=="_").map(c=>c.value).join("")):[NaN];if(r){if(o.some(c=>Number.isNaN(c))){let c=new j(G(r));this._issues.push(Y(8,c))}else if(!Number.isNaN(o)&&!Gt(r,i[0])){let c=new j(G(r,i.at(0)));this._issues.push(Y(29,c))}}return this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(Y(51,new j(G(this.currentToken)),Cf.DiagnosticSeverity.Warning)),this.moveToNextToken),new wc(o,G(n.at(0)??i[0]??this.prevToken,this.prevToken))}processNodeAddresses(r){this.enqueueToStack();let n=this.checkConcurrentTokens([je(49)]);if(n.length){if(!Gt(r.lastToken,n[0])){let a=new j(G(r.lastToken,n[0]));this._issues.push(Y(29,a))}let i=[],s=()=>{if(i.push(this.processNodeAddress()),V(this.currentToken,24)){if(this.prevToken&&!Gt(this.prevToken,this.currentToken)){let a=new j(G(this.prevToken,this.currentToken));this._issues.push(Y(29,a))}this.moveToNextToken,s()}};s();let o=this.currentToken;for(;!V(this.currentToken,2)&&!V(this.currentToken,1)&&!V(this.currentToken,3)&&Cn(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(Y(52,new j(G(o,this.currentToken))));let a=new wc([],G(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(je));if(!r.length){this.popStack();return}let n=r.map(o=>o.value).join(""),i=new He(n,G(r[0],r.at(-1))),s=this.processNodeAddresses(i);return i.address=s,n.match(/^[A-Za-z]/)||this._issues.push(Y(49,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(je));if(!r.length){this.popStack();return}let n=new Ze(r.map(i=>i.value).join(""),G(r[0],r.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!r.length){this.popStack();return}let n=r.map(s=>s.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let i=new rr(n,G(r[0],r.at(-1)));return this.mergeStack(),i}isLabelAssign(r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!n.length){this.popStack();return}let i=n.map(c=>c.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&V(s,50),a=new es(new rr(i,G(n[0],n.at(-1))),G(n[0],o?s:n.at(-1)));if(o){let c=n.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(Y(29,new j(G(c,s)))),this.moveToNextToken}else if(r)this._issues.push(Y(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(V(this.currentToken,2)||V(this.currentToken,49))return this.popStack(),!1;let s=new Ye(i,n),o;V(this.currentToken,0)?(s.assignOperatorToken=this.moveToNextToken,o=this.processValue(),o?.values.filter(c=>!!c).length||this._issues.push(Y(0,s)),s.values=o??null):s.values=void 0;let a=this.endStatement();return s.lastToken=a,r.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),nt("d"),nt("ts"),je(16),nt("v"),nt("1")]);if(r.length!==6)return this.popStack(),!1;let n=r[0],i=n,s=new mt;s.firstToken=n;let o=new vf(s);if(this.others.push(o),V(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=r.at(-1),this._issues.push(Y(21,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),nt("memreserve")]);if(r.length!==2)return this.popStack(),!1;let n=new mt;n.firstToken=r[0];let s=r[0];V(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(Y(21,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new wf(n,o,a);return this.others.push(c),o||this._issues.push(Y(37,n)),a||this._issues.push(Y(38,o??n)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),nt("b"),nt("its")]);if(r.length!==3){this.popStack();return}let n=new mt;n.firstToken=r[0];let s=r[0];V(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(Y(21,n)));let o=this.processDec(),a=new kf(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(Y(40,o)):this._issues.push(Y(39,n)),this._issues.push(Y(41,a,Cf.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),nt("omit"),je(16),nt("if"),je(16),nt("no"),je(16),nt("ref"),je(13)]);if(r.length!==9){this.popStack();return}let n=new mt(G(r[0],r.at(-1)));return this.mergeStack(),n}isDeleteNode(r,n){this.enqueueToStack();let i=this.checkConcurrentTokens([je(13),nt("d"),nt("e"),nt("lete"),je(16),nt("node")]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new mt;if(a.firstToken=s,i.length===1&&!V(this.currentToken,2)){this._issues.push(Y(25,a)),a.lastToken=i.at(-1);let d=new Ir(a);return r.addNodeChild(d),this.mergeStack(),!0}let c=i.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=i.at(-1),c!=="/delete-node"?this._issues.push(Y(c.startsWith("/delete-n")?34:25,a)):V(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(Y(21,a));let l=new Ir(a);if(Cn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef();d&&n==="Name"&&this._issues.push(Y(7,d));let f=d?void 0:this.isLabelRef();f&&n==="Name"&&this._issues.push(Y(7,f));let p=d||f?void 0:this.isNodeName();p&&n==="Ref"&&this._issues.push(Y(10,p)),!d&&!p&&!f&&this._issues.push(Y([7,10],l)),l.nodeNameOrRef=d??f??p??null}else n==="Name"?this._issues.push(Y(7,a)):n==="Ref"&&this._issues.push(Y(10,a));let u=this.endStatement();return l.lastToken=u,r.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(r){this.enqueueToStack();let n=this.checkConcurrentTokens([je(13),nt("d"),nt("e"),nt("lete"),je(16),nt("property")]);if(!n.length)return this.popStack(),!1;let i=n[0],s=i,o=new mt;if(o.firstToken=i,n.length===1&&!V(this.currentToken,2)){this._issues.push(Y(25,o)),o.lastToken=n.at(-1);let u=new ht(o);return r.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(Y(a.startsWith("/delete-p")?35:25,o)):V(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(Y(21,o));let c=new ht(o);if(Cn(o.tokenIndexes?.end,i)){let u=this.isPropertyName();u||this._issues.push(Y(6,c)),c.propertyName=u??null}else this._issues.push(Y(6,o));let l=this.endStatement();return c.lastToken=l,r.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.processNodePathRef();if(!n){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&i.push(...this.processOptionalLabelAssign(!0));let s=new _r(r,n,i);return this.mergeStack(),s}processValue(){this.enqueueToStack();let n=(()=>{let s=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue()||this.arrayValues()||this.processByteStringValue()||this.isExpressionValue())??null,o=s();if(!o)return[];let a=[o];for(;!V(this.currentToken,1);){let c=this.prevToken,l=this.currentToken,u,d=V(this.currentToken,24);if(d)u=this.currentToken,this.moveToNextToken;else if(!Cn(this.prevToken,this.currentToken))break;let f=s();if(l&&f===null&&d){let y=new j(G(l,this.currentToken));this._issues.push(Y(0,y))}if(!d&&f===null)break;if(c&&!d&&f){let y=new j(G(c));this._issues.push(Y(28,y))}let p=a.at(-1);p&&(p.nextValueSeparator??=u),a.push(f)}return a})();if(n.length===0){this.popStack();return}return this.mergeStack(),new yf(n)}processStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.consumeAnyConcurrentTokens([je(21)]);if(!n.length){this.popStack();return}if(n.some(l=>!l?.value))throw new Error("Token must have value");let i=n.map(l=>l.value).join(`
|
|
190
|
-
`),s=i;s.match(/["']$/)&&(s=s.slice(1,-1));let o=new ie(s,
|
|
191
|
-
`))}async function
|
|
192
|
-
`),i=De(t.textDocument.uri),s=await e.getRuntime(),o=s.fileTopMostAsts(i);if(s.includes.filter(c=>
|
|
193
|
-
`))}else if(t.pos.line)return te.TextEdit.del(te.Range.create(te.Position.create(0,0),te.Position.create(t.pos.line,0)))},
|
|
194
|
-
${"".padStart(e*r.length,r)}${n}`)},
|
|
195
|
-
`)}function
|
|
188
|
+
`){let a=this.lineNumber,c=this.columnNumber,l=r.length;this.pushToken({tokens:[21],value:r,pos:{col:c-l,line:a,len:l,colEnd:c},adjacentToken:n}),n=this._tokens.at(-1),r=""}else if(this.currentChar==="\\"){let a=this.lineNumber;if(r+=this.currentChar??"",this.move())a===this.lineNumber&&(r+=this.currentChar??"");else break}else r+=this.currentChar??"";if(!this.move())break}r+=e;let i=this.lineNumber,s=this.columnNumber+1,o=r.length;this.pushToken({tokens:[21],value:r,pos:{col:s-o,line:i,len:o,colEnd:s},adjacentToken:n}),this.move()}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let r=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(!r)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let n=this._tokens.at(-1);return r&&!n?.tokens.some(i=>i===21)&&n&&n.pos.len<e.length?this.process(e.slice(n.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let r={...e,uri:this.uri},n=this._tokens.at(-1);r.prevToken=n,n&&(n.nextToken=r),this._tokens.push(r)}isLetters(e){let r=e.match(/^[A-Za-z]+/);return r?.[0]?(this.pushToken({tokens:[47],value:r?.[0],pos:this.generatePos(e,r?.[0])}),!0):!1}isDigit(e){let r=e.match(/^[0-9]/);return r?.[0]?(this.pushToken({tokens:[20,19],value:r[0],pos:this.generatePos(e,r[0])}),!0):!1}isHexDigit(e){let r=e.match(/^[A-Fa-f]/);return r?.[0]?(this.pushToken({tokens:[20,47],value:r[0],pos:this.generatePos(e,r[0])}),!0):!1}isCurlyOpen(e){let r="{";return e===r?(this.pushToken({tokens:[2],pos:this.generatePos(e,r),value:"{"}),!0):!1}isCurlyClose(e){let r="}";return e===r?(this.pushToken({tokens:[3],pos:this.generatePos(e,r),value:"}"}),!0):!1}isSemicolon(e){let r=";";return e===r?(this.pushToken({tokens:[1],pos:this.generatePos(e,r),value:r}),!0):!1}isColon(e){let r=":";return e===r?(this.pushToken({tokens:[50],pos:this.generatePos(e,r),value:r}),!0):!1}isHash(e){let r="#";return e.startsWith(r)?(this.pushToken({tokens:[46],pos:this.generatePos(e,r),value:r}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let r="=";return e===r?(this.pushToken({tokens:[0],pos:this.generatePos(e,r),value:r}),!0):!1}isGtSym(e){let r=">";return e===r?(this.pushToken({tokens:[4],pos:this.generatePos(e,r),value:r}),!0):!1}isLtSym(e){let r="<";return e===r?(this.pushToken({tokens:[5],pos:this.generatePos(e,r),value:r}),!0):!1}isLogicalNot(e){let r="!";return e===r?(this.pushToken({tokens:[6],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseOr(e){let r="|";return e===r?(this.pushToken({tokens:[8],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseXOr(e){let r="^";return e===r?(this.pushToken({tokens:[9],pos:this.generatePos(e,r),value:r}),!0):!1}isAmpersand(e){let r="&";return e===r?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,r),value:r}),!0):!1}isBitwiseNot(e){let r="~";return e===r?(this.pushToken({tokens:[10],pos:this.generatePos(e,r),value:r}),!0):!1}isRoundOpen(e){let r="(";return e===r?(this.pushToken({tokens:[42],pos:this.generatePos(e,r),value:r}),!0):!1}isRoundClose(e){let r=")";return e===r?(this.pushToken({tokens:[43],pos:this.generatePos(e,r),value:r}),!0):!1}isSquareOpen(e){let r="[";return e===r?(this.pushToken({tokens:[11],pos:this.generatePos(e,r),value:r}),!0):!1}isSquareClose(e){let r="]";return e===r?(this.pushToken({tokens:[12],pos:this.generatePos(e,r),value:r}),!0):!1}isComma(e){let r=",";return e===r?(this.pushToken({tokens:[24],pos:this.generatePos(e,r),value:r}),!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 r=e.match(/^["']/);return r?.[0]?(this.rewind(e.slice(1)),this.getString(r[0]),!0):!1}isForwardSlash(e){let r="/";return e===r?(this.pushToken({tokens:[13],pos:this.generatePos(e,r),value:"/"}),!0):!1}isBackSlash(e){let r="\\";return e===r?(this.pushToken({tokens:[14],pos:this.generatePos(e,r),value:"\\"}),!0):!1}isAddOperator(e){let r="+";return e===r?(this.pushToken({tokens:[15],pos:this.generatePos(e,r),value:r}),!0):!1}isQuestionMark(e){let r="?";return e===r?(this.pushToken({tokens:[44],pos:this.generatePos(e,r),value:r}),!0):!1}isPeriod(e){let r=".";return e===r?(this.pushToken({tokens:[45],pos:this.generatePos(e,r),value:r}),!0):!1}isNegateOperator(e){let r="-";return e===r?(this.pushToken({tokens:[16],pos:this.generatePos(e,r),value:r}),!0):!1}isUnderScore(e){let r="_";return e===r?(this.pushToken({tokens:[48],pos:this.generatePos(e,r),value:r}),!0):!1}isAt(e){let r="@";return e===r?(this.pushToken({tokens:[49],pos:this.generatePos(e,r),value:r}),!0):!1}isMultiplicationOperator(e){let r="*";return e===r?(this.pushToken({tokens:[17],pos:this.generatePos(e,r),value:r}),!0):!1}isModulusOperator(e){let r="%";return e===r?(this.pushToken({tokens:[18],pos:this.generatePos(e,r),value:r}),!0):!1}isCDefine(e){let r="#define";return e.toLowerCase()===r?(this.pushToken({tokens:[25],pos:this.generatePos(e,r),value:r}),!0):!1}isCInclude(e){let r="#include";return e.toLowerCase()===r?(this.pushToken({tokens:[26],pos:this.generatePos(e,r),value:r}),!0):!1}isCLine(e){let r="#line";return e.toLowerCase()===r?(this.pushToken({tokens:[27],pos:this.generatePos(e,r),value:r}),!0):!1}isCUndef(e){let r="#undef";return e.toLowerCase()===r?(this.pushToken({tokens:[28],pos:this.generatePos(e,r),value:r}),!0):!1}isCError(e){let r="#error";return e.toLowerCase()===r?(this.pushToken({tokens:[29],pos:this.generatePos(e,r),value:r}),!0):!1}isCPragma(e){let r="#pragma";return e.toLowerCase()===r?(this.pushToken({tokens:[30],pos:this.generatePos(e,r),value:r}),!0):!1}isCDefined(e){let r="#defined";return e.toLowerCase()===r?(this.pushToken({tokens:[31],pos:this.generatePos(e,r),value:r}),!0):!1}isCIf(e){let r="#if";return e.toLowerCase()===r?(this.pushToken({tokens:[32],pos:this.generatePos(e,r),value:r}),!0):!1}isCIfDef(e){let r="#ifdef";return e.toLowerCase()===r?(this.pushToken({tokens:[33],pos:this.generatePos(e,r),value:r}),!0):!1}isCIfNDef(e){let r="#ifndef";return e.toLowerCase()===r?(this.pushToken({tokens:[34],pos:this.generatePos(e,r),value:r}),!0):!1}isCElIf(e){let r="#elif";return e.toLowerCase()===r?(this.pushToken({tokens:[35],pos:this.generatePos(e,r),value:r}),!0):!1}isCElse(e){let r="#else";return e.toLowerCase()===r?(this.pushToken({tokens:[36],pos:this.generatePos(e,r),value:r}),!0):!1}isCEndIf(e){let r="#endif";return e.toLowerCase()===r?(this.pushToken({tokens:[37],pos:this.generatePos(e,r),value:r}),!0):!1}isCTrue(e){let r="true";return e==r?(this.pushToken({tokens:[38],value:r,pos:this.generatePos(e,r)}),!0):!1}isCFalse(e){let r="false";return e==r?(this.pushToken({tokens:[39],value:r,pos:this.generatePos(e,r)}),!0):!1}generatePos(e,r){let n=this.columnNumber-e.length;return{line:this.lineNumber,col:n,len:r.length,colEnd:n+r.length}}};var $y,pf=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,r,n,i){e=tt(e);let s=`${Array.from(n).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(s);if(o)return o.reparse(n),o;console.log("No cpreprocess cache",e);let a=new Go(e,r,n),c=this.includeOwners.get(a)??new Set;return c.add(i),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(s,a),a}reset(e){e=tt(e);let r=this.headerFiles.get(e);r&&Array.from(r).forEach(n=>{n[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(n[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function bc(){return $y??=new pf,$y}function xE(){$y=new pf}var By,hf=class t{constructor(){this.fileMap=new Map}static clone(e){let r=e.map(n=>({...n}));return r.forEach((n,i)=>{n.prevToken=r[i-1],n.nextToken=r[i+1]}),r}needsRenew(e,r){return e=tt(e),this.fileMap.get(e)?.text!==r}getDocument(e,r){return Yi.create(e,"devicetree",0,r??this.fileMap.get(e)?.text??(0,_c.readFileSync)(e).toString())}renewLexer(e,r){if(e=tt(e),bc().reset(e),!r&&!(0,_c.existsSync)(e))return[];try{r??=(0,_c.readFileSync)(e).toString();let n=new Wo(r,e);return this.fileMap.set(e,n),t.clone(n.tokens)}catch{}return[]}requestTokens(e,r){e=tt(e);let n=this.fileMap.get(e)?.tokens;return!n&&r?[...this.renewLexer(e)]:t.clone(n??[])}reset(e){e=tt(e),bc().reset(e),this.fileMap.delete(e)}};function Ar(){return By??=new hf,By}function ME(){By=new hf}var mf=class t extends Qi{constructor(r,n=()=>Ar().requestTokens(this.uri,!0)){super();this.uri=r;this.getTokens=n;this.comments=[];this.tokens=[]}cleanUpComments(){let r=[];for(let n=0;n<this.tokens.length;n++){let i=t.processBlockComment(this.tokens,n)||t.processLineComment(this.tokens,n);i&&(n=i.index,r.push(...i.tokenUsed),this.comments.push(i.comment))}r.reverse().forEach(n=>this.tokens.splice(n,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=this.getTokens(),this.cleanUpComments()}static processBlockComment(r,n){let i=[],s=()=>(i.push(n++),r[n]),o=()=>r[n],a=()=>r[n-1],c=o(),l=c;if(!c||!H(c,13)||(l=s(),!H(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!H(a(),17)||!H(o(),13)||!zt(a(),o())),d=l.pos.line,f=c,p=[];l=s();do{if(o()?.pos.line!==d){let v=new an(W(f,a()));p.push(v),d=o().pos.line??0,f=o()}l=s()}while(n<r.length&&!u());let g=new an(W(f,o()));p.push(g);let h=new on(p);return s(),{comment:h,tokenUsed:i,index:n-1}}static processLineComment(r,n){let i=[];if(!H(r[n],13)||r.length===n+1||!H(r[n+1],13)||!zt(r[n],r[n+1]))return;for(;r[n].pos.line===r.at(n+1)?.pos.line;)i.push(n++);return i.push(n++),{comment:new an(W(r[i[0]],r[i.at(-1)])),tokenUsed:i,index:n-1}}};var qE=L(j());var gf=class extends Z{constructor(r,n){super(r);this.content=n}toString(){let r=this.content.filter(n=>!H(n,14));return r.map((n,i)=>{let s=n.value;return n.pos.line===r.at(i+1)?.pos.line?s=s.padEnd(r[i+1].pos.col-n.pos.col," "):r.at(i+1)&&(s=s.padEnd(s.length+1," ")),s}).join("")}},Sc=class extends Z{constructor(r,n,i){super();this.keyword=r;this.identifier=n;this.content=i;this.addChild(r),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ct?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:qE.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
|
|
189
|
+
`)}}};var Us=class extends Z{constructor(e){super(e)}},Nc=class extends Z{constructor(r,n){super();this.keyword=r;this.content=n;this.active=!1;this.addChild(r)}},Rc=class extends Nc{constructor(r,n,i){super(r,i);this.identifier=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.identifier&&r.has(this.identifier.name)}},yf=class extends Nc{constructor(r,n,i){super(r,i);this.expression=n;this.addChild(n),this.addChild(i)}useBlock(r){return this.expression instanceof wn?this.expression.functionName.name==="defined"?this.expression&&r.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(r):this.expression?.isTrue(r)}},vf=class extends Rc{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},Pc=class extends Nc{};var Zi=class extends Z{constructor(r,n,i){super();this.ifDef=r;this.endIf=n;this.elseOption=i;this.addChild(r),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:s(this.tokenIndexes.start),end:s(this.tokenIndexes.end)}];i.push({start:s(this.ifDef.tokenIndexes.start),end:s(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(r);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&i.push({start:s(this.ifDef.content.tokenIndexes.start),end:s(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(i.push({start:s(this.elseOption.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)})),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}},es=class extends Z{constructor(r,n,i){super();this.ifBlocks=r;this.endIf=n;this.elseOption=i;r.forEach(s=>this.addChild(s)),i&&this.addChild(i),this.addChild(n)}getInValidTokenRange(r,n){let i=[],s=a=>n.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach(a=>{i.push({start:s(a.tokenIndexes.start),end:s(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(r)?(a.active=!0,o=!0):a.content&&i.push({start:s(a.content.tokenIndexes.start),end:s(a.content.tokenIndexes.end)})}),this.elseOption&&(i.push({start:s(this.elseOption.keyword.tokenIndexes.start),end:s(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?i.push({start:s(this.elseOption.content.tokenIndexes.start),end:s(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&i.push({start:s(this.endIf.tokenIndexes.start),end:s(this.endIf.tokenIndexes.end)}),i}};var Go=class extends Qi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.getTokens=s;this.skipIncludes=o;this.tokens=[];this.nodes=[];this._comments=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;i&&(Array.from(i).forEach(([a,c])=>this.macroSnapShot.set(a,c)),Array.from(i).forEach(([a,c])=>this.macros.set(a,c)))}get comments(){return this._comments}get currentToken(){let r=this.prevToken,n=Cn(r,this.tokens.at(this.peekIndex()))||!r||H(r,14)&&r.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!n))return this.macroStart&&H(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(r){super.reset(),this.macros.clear(),r?(this.macroSnapShot.clear(),Array.from(r).forEach(([n,i])=>this.macroSnapShot.set(n,i)),Array.from(r).forEach(([n,i])=>this.macros.set(n,i))):Array.from(this.macroSnapShot).forEach(([n,i])=>this.macros.set(n,i)),this.nodes=[],this.dtsIncludes=[]}async reparse(r){let n=this.stable;return this.parsing=new Promise(i=>{n.then(()=>{if(r&&r.size===this.macroSnapShot.size){let s=Array.from(r);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=s[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),i();return}}this.reset(r),this.parse().then(i)})}),this.parsing}async parse(){let r=new mf(this.uri,this.getTokens);if(await r.stable,this.tokens=r.tokens,this._comments=r.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||!de(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let n=this.currentToken,i=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();n&&this.moveEndOfLine(n,!!i),this.mergeStack()}processDefinitions(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!H(n,25))return this.popStack(),!1;this.macroStart=!0;let i=new ht(W(n)),s=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(G(30,i.rangeTokens,i)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new gf(W(o[0],o.at(-1)),o));let c=new Sc(i,s,a);this.macros.set(c.name,{macro:c,resolver:hE(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(r,l-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let r=this.peekIndex(),n=this.moveToNextToken;if(!n||!H(n,28))return this.popStack(),!1;this.macroStart=!0;let i=new ht(W(n)),s=this.processCIdentifier(this.macros,!0);if(!s)return this._issues.push(G(30,i.rangeTokens,i)),this.mergeStack(),this.macroStart=!1,!0;let o=new Sc(i,s);this.macros.delete(s.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(r,a-r),this.positionStack[this.positionStack.length-1]=r,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let r=[];for(;this.currentToken;){let n=this.moveToNextToken;n&&r.push(n)}return r}isFunctionDefinition(){this.enqueueToStack();let r=this.processCIdentifier(this.macros,!0);if(!r){this.popStack();return}let n=this.moveToNextToken;if(!H(n,42)||!zt(r.lastToken,n)){this.popStack();return}let i=[],s=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;s;)i.push(s),!H(this.currentToken,24)&&!H(this.currentToken,43)?this._issues.push(G(28,s.rangeTokens,s)):H(this.currentToken,43)||(n=this.moveToNextToken),s=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Qn(r,i);if(H(this.currentToken,43))n=this.moveToNextToken,o.lastToken=n;else{o.lastToken=this.prevToken;let a=i.at(-1)??o;this._issues.push(G(26,a.rangeTokens,a))}return this.mergeStack(),o}processVariadic(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(45),je(45),je(45)]);if(r.length!==3){this.popStack();return}let n=new ff(W(r[0],r.at(-1)));return this.mergeStack(),n}processIfDefBlocks(){let r=this.peekIndex(),n=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>H(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[37].some(a=>H(o,a))&&!Cn(o.prevToken,o),o=>!!o&&[36,35].some(a=>H(o,a))&&!Cn(o.prevToken,o));if(!n)return;let i;H(n.startToken,32)?i=this.processIfBlock(n,(o,a,c)=>new yf(o,a??null,c)):i=this.processIfDefBlock(n,(o,a,c)=>H(n.startToken,33)?new Rc(o,a??null,c):new vf(o,a??null,c)),this.nodes.push(i),i.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...i instanceof es?i.ifBlocks:[i.ifDef],...i.elseOption?[i.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(G(47,o.content.rangeTokens,o.content,{severity:kc.DiagnosticSeverity.Hint,tags:[kc.DiagnosticTag.Unnecessary]}))}),this.positionStack[this.positionStack.length-1]=r}processIfDefBlock(r,n){this.enqueueToStack(),this.macroStart=!0;let i=new ht(W(r.startToken));r.splitTokens[0].rewind();let s=this.processCIdentifier(this.macros,!0);s||this._issues.push(G(31,i.rangeTokens,i)),this.macroStart=!1;let o,a=s?.lastToken.nextToken??i.lastToken.nextToken;a&&r.splitTokens[0].tokens.find(f=>f===a)&&(o=new Us(W(a,r.splitTokens[0].tokens.at(-1))));let c=n(i,s??null,o??null),l;if(r.splitTokens.length>1){let f=r.splitTokens[1].tokens[0].prevToken,p=new ht(W(f)),g;r.splitTokens[1].tokens.length&&(g=new Us(W(r.splitTokens[1].tokens[0],r.splitTokens[1].tokens.at(-1)))),l=new Pc(p,g??null)}let u;r.endToken?u=new ht(W(r.endToken)):this._issues.push(G(46,i.rangeTokens,i));let d=new Zi(c,u??null,l);return this.mergeStack(),d}processIfBlock(r,n){this.enqueueToStack();let i=new ht(W(r.startToken)),s=[],o;r.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ht(W(d));this.macroStart=!0;let p=this.processExpression(this.macros,f,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===r.splitTokens.length-1&&H(d,36)){let h=d,v=new ht(W(h)),S;l.tokens.length&&(S=new Us(W(l.tokens[0],l.tokens.at(-1)))),o=new Pc(v,S??null)}else{p||this._issues.push(G(31,i.rangeTokens,i));let h,v=p?.lastToken.nextToken??i.lastToken.nextToken;v&&l.tokens.find(_=>_===v)&&(h=new Us(W(v,r.splitTokens[u].tokens.at(-1))));let S=n(f,p??null,h??null);s.push(S)}});let a;r.endToken?a=new ht(W(r.endToken)):this._issues.push(G(46,i.rangeTokens,i));let c=new es(s,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes,...this.comments]}resolveInclude(r){if(r.path.path)return r.path.relative?[(0,Yo.resolve)((0,Yo.dirname)(r.uri),r.path.path),...this.incudes.map(n=>(0,Yo.resolve)(n,r.path.path))].find(n=>(0,Fy.existsSync)(n)):this.incudes.map(n=>(0,Yo.resolve)(n,r.path.path)).find(n=>(0,Fy.existsSync)(n))}async processInclude(){this.enqueueToStack();let r=this.peekIndex(),n=this.currentToken;if(!n)return this.popStack(),!1;let i=n,s=n;if(H(n,26))this.moveToNextToken;else{let h=this.checkConcurrentTokens([je(13),rt("include"),je(13)]);if(h.length!==3)return this.popStack(),!1;i=h[0],s=h.at(-1)}let o=i,a=new ht(W(i,s));n=this.moveToNextToken;let c=n,l=!!H(n,21);if(!c||!l&&!H(n,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=n?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!H(this.currentToken,4);)u+=this.currentToken?.value??"",n=this.moveToNextToken;let d=new zo(u,l,W(c,n)),f=new Si(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!H(this.currentToken,4)?this._issues.push(G(12,f.rangeTokens,f)):(n=this.moveToNextToken,d.lastToken=n)),this.mergeStack();let p=this.peekIndex(),g=this.resolveInclude(f);if(f.resolvedPath=g,g||this._issues.push(G(36,f.path.rangeTokens,f.path,{severity:kc.DiagnosticSeverity.Warning})),g&&!this.skipIncludes){Ar().requestTokens(g,!0);let h=await bc().getCPreprocessorParser(g,this.incudes,this.macros,this.uri);await h.stable,this._issues.push(...h.issues),this.macros.clear(),Array.from(h.macros).forEach(([v,S])=>this.macros.set(v,S)),g.endsWith(".h")?this.tokens.splice(r,p-r):this.tokens.splice(r,p-r,...h.tokens),this.nodes.push(...h.nodes),this.dtsIncludes.push(...h.dtsIncludes)}else this.tokens.splice(r,p-r);return this.positionStack[this.positionStack.length-1]=r,!0}};var LE=L(j());var Tf=class extends Z{constructor(r,n,i){super();this.keyword=r;this.startAddress=n;this.endAddress=i;this.addChild(r),this.docSymbolsMeta={name:"Memreserve",kind:LE.SymbolKind.Function},this.addChild(n),this.addChild(i)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var $E=L(j());var bf=class extends Z{constructor(r,n){super();this.keyword=r;this.bitsSize=n;this.addChild(r),this.docSymbolsMeta={name:"bits",kind:$E.SymbolKind.Function},this.addChild(n)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var Hs=class extends Qi{constructor(r,n,i,s,o){super();this.uri=r;this.incudes=n;this.tokens=[];this.others=[];this.rootDocument=new ct;this.unhandledStatements=new St;this.cPreprocessorParser=new Go(this.uri,this.incudes,i,s,o)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(r=>r.resolvedPath).filter(r=>!!r)]}reset(){super.reset(),this.others=[],this.rootDocument=new ct,this._issues=[],this.unhandledStatements=new St}async reparse(){let r=performance.now(),n=this.stable;return this.parsing=new Promise(i=>{n.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-r),i()})}),this.parsing}async parse(){if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,tt(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)||this.isChildNode(this.unhandledStatements,"Name"))){let s=this.moveToNextToken;s&&(this._issues.push(G(22,W(s),null)),this.reportExtraEndStatements())}};for(;!this.done;)await r();this.unhandledStatements.properties.forEach(s=>{this._issues.push(G(32,s.rangeTokens,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(G(33,s.rangeTokens,s))});let n=this.allAstItems.flatMap(s=>[s,...s.allDescendants]),i=this.cPreprocessorParser.comments;if(i.length&&n.forEach(s=>{(s instanceof ct||s instanceof Ye)&&vE(s,i)}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(r){this.enqueueToStack();let n=this.moveToNextToken,i=n,s=13;if(!n||!H(n,s))return this.popStack(),!1;if(i=this.moveToNextToken,s=2,!i||!H(i,s))return this.popStack(),!1;let o=new St;o.openScope=i,r.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??i;return o.firstToken=n,o.lastToken=a,this.mergeStack(),!0}nodeEnd(r){let n=this.currentToken;if(H(n,3))this.moveToNextToken;else{let i=this.prevToken;return i&&this._issues.push(G(3,W(i),r)),this.endStatement(r,!1)}return this.prevToken?.value==="}"&&(r.closeScope=this.prevToken),this.endStatement(r)}isNodeEnd(){return H(this.currentToken,3)||H(this.currentToken,1)}endStatement(r,n=!0){let i=this.currentToken;if(!H(i,1)){let s=this.prevToken;if(s&&n)return this._issues.push(G(1,W(this.prevToken),r)),s}return this.moveToNextToken,this.reportExtraEndStatements(),i}reportExtraEndStatements(){for(;H(this.currentToken,1);){let r=this.moveToNextToken;r&&this._issues.push(G(23,W(r),null))}}processNode(r,n){if(this.done)return!1;let i=!1,s=!1;do{if(s=this.isChildNode(r,n)||this.isProperty(r)||this.isDeleteNode(r,n)||this.isDeleteProperty(r),!s&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;o&&(this._issues.push(G(22,W(o),null)),this.reportExtraEndStatements())}else if(this.done)break;i=i||s}while(!this.isNodeEnd());return i}processOptionalLabelAssign(r=!1){let n=[],i=this.isLabelAssign(r);for(;i;)n.push(i),i=this.isLabelAssign(r);return n}isChildNode(r,n){this.enqueueToStack();let i;n==="Name"&&(i=this.isOmitIfNoRefNode());let s=this.processOptionalLabelAssign(),o,a,c=n==="Ref"?new Wt(s):new Ue(s,i);if(n==="Ref"?(this.enqueueToStack(),a=this.processNodePathRef(c),!a||!H(this.currentToken,2)?(this.popStack(),a=void 0):this.mergeStack(),a??=this.isLabelRef(c)):n==="Name"&&(o=this.isNodeName()),!a&&!o){if(!H(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(G(n==="Name"?[7]:[10,48,11],W(c.firstToken,this.currentToken?.nextToken),c))}let l=!1;if(a&&c instanceof Wt?(c.reference=a,l=!0):o&&c instanceof Ue&&(l=o.address!==void 0,c.name=o),H(this.currentToken,2)){c.openScope=this.moveToNextToken;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(G(2,u.rangeTokens,u))}else return this.popStack(),!1;return r.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(r){let n=this.prevToken;this.enqueueToStack();let i=this.checkConcurrentTokens([rt("0"),rt("x",!0)]);i.length!==2?(i=[],this.popStack()):(this._issues.push(G(50,W(i[0],i[1]),r,{severity:_f.DiagnosticSeverity.Warning})),n=i.at(-1),this.mergeStack());let s=this.consumeAnyConcurrentTokens([19,20,48].map(je)),o=l=>{l.length%8!==0&&(l=l.padStart(Math.ceil(l.length/8)*8,"0"));let u=[];for(let d=0;d<l.length;d+=8){let f=l.slice(d,d+8);u.push(parseInt(f,16)>>>0)}return u},a=s.length?o(s.filter(l=>l.value!=="_").map(l=>l.value).join("")):[NaN];return n&&(a.some(l=>Number.isNaN(l))?this._issues.push(G(8,W(n),r)):!Number.isNaN(a)&&!zt(n,s[0])&&this._issues.push(G(29,W(n,s.at(0)),r,{inclusiveStart:!1,inclusiveEnd:!1}))),this.currentToken?.value.toUpperCase()==="ULL"&&(this._issues.push(G(51,W(this.currentToken),r,{severity:_f.DiagnosticSeverity.Warning})),this.moveToNextToken),new vc(a,W(i.at(0)??s[0]??this.prevToken,this.prevToken))}processNodeAddresses(r){this.enqueueToStack();let n=this.checkConcurrentTokens([je(49)]);if(n.length){zt(r.lastToken,n[0])||this._issues.push(G(29,W(r.lastToken,n[0]),r,{inclusiveStart:!1,inclusiveEnd:!1}));let i=[],s=()=>{i.push(this.processNodeAddress(r)),H(this.currentToken,24)&&(this.prevToken&&!zt(this.prevToken,this.currentToken)&&this._issues.push(G(29,W(this.prevToken,this.currentToken),r,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken,s())};s();let o=this.currentToken;for(;!H(this.currentToken,2)&&!H(this.currentToken,1)&&!H(this.currentToken,3)&&Cn(this.currentToken,i.at(-1)?.lastToken);)this.moveToNextToken;if(o&&o!==this.currentToken){this._issues.push(G(52,W(o,this.currentToken),r));let a=new vc([],W(o,this.prevToken));i.push(a)}return this.mergeStack(),i}this.popStack()}isNodeName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(je));if(!r.length){this.popStack();return}let n=r.map(o=>o.value).join(""),i=new He(n,W(r[0],r.at(-1))),s=this.processNodeAddresses(i);return i.address=s,n.match(/^[A-Za-z]/)||this._issues.push(G(49,i.rangeTokens,i)),this.mergeStack(),i}isPropertyName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(je));if(!r.length){this.popStack();return}let n=new Qe(r.map(i=>i.value).join(""),W(r[0],r.at(-1)));return this.mergeStack(),n}isLabelName(){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!r.length){this.popStack();return}let n=r.map(s=>s.value).join("");if(!n.match(/^[A-Za-z]/)){this.popStack();return}let i=new er(n,W(r[0],r.at(-1)));return this.mergeStack(),i}isLabelAssign(r){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(je));if(!n.length){this.popStack();return}let i=n.map(c=>c.value).join("");if(!i.match(/^[A-Za-z]/)){this.popStack();return}let s=this.currentToken,o=s&&H(s,50),a=new Ji(new er(i,W(n[0],n.at(-1))),W(n[0],o?s:n.at(-1)));if(o){let c=n.at(-1);c&&(s.pos.line!==a.firstToken.pos.line||s.pos.col!==c.pos.colEnd)&&this._issues.push(G(29,W(c,s),a,{inclusiveStart:!1,inclusiveEnd:!1})),this.moveToNextToken}else if(r)this._issues.push(G(24,a.rangeTokens,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(),i=this.isPropertyName();if(!i)return this.popStack(),!1;if(H(this.currentToken,2)||H(this.currentToken,49))return this.popStack(),!1;let s=new Ye(i,n),o;H(this.currentToken,0)?(s.assignOperatorToken=this.moveToNextToken,o=this.processValue(r),o?.values.filter(c=>!!c).length||this._issues.push(G(0,s.rangeTokens,s)),s.values=o??null):s.values=void 0;let a=this.endStatement(s);return s.lastToken=a,r.addNodeChild(s),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),rt("d"),rt("ts"),je(16),rt("v"),rt("1")]);if(r.length!==6)return this.popStack(),!1;let n=r[0],i=n,s=new ht;s.firstToken=n;let o=new uf(s);if(this.others.push(o),H(this.currentToken,13))i=this.moveToNextToken;else return s.lastToken=r.at(-1),this._issues.push(G(21,o.rangeTokens,o)),this.mergeStack(),!0;return s.lastToken=i,o.lastToken=this.endStatement(o),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),rt("memreserve")]);if(r.length!==2)return this.popStack(),!1;let n=new ht;n.firstToken=r[0];let s=r[0];H(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(G(21,n.rangeTokens,n)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new Tf(n,o,a);if(this.others.push(c),o||this._issues.push(G(37,n.rangeTokens,n)),!a){let l=o??n;this._issues.push(G(38,l.rangeTokens,c))}return c.lastToken=this.endStatement(c),this.mergeStack(),!0}processBits(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),rt("b"),rt("its")]);if(r.length!==3){this.popStack();return}let n=new ht;n.firstToken=r[0];let s=r[0];H(this.currentToken,13)?(s=this.moveToNextToken,n.lastToken=s):(n.lastToken=r.at(-1),this._issues.push(G(21,n.rangeTokens,n)));let o=this.processDec(),a=new bf(n,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(G(40,o.rangeTokens,o)):this._issues.push(G(39,n.rangeTokens,n)),this._issues.push(G(41,a.rangeTokens,a,{severity:_f.DiagnosticSeverity.Warning})),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let r=this.checkConcurrentTokens([je(13),rt("omit"),je(16),rt("if"),je(16),rt("no"),je(16),rt("ref"),je(13)]);if(r.length!==9){this.popStack();return}let n=new ht(W(r[0],r.at(-1)));return this.mergeStack(),n}isDeleteNode(r,n){this.enqueueToStack();let i=this.checkConcurrentTokens([je(13),rt("d"),rt("e"),rt("lete"),je(16),rt("node")]);if(!i.length)return this.popStack(),!1;let s=i[0],o=s,a=new ht;if(a.firstToken=s,i.length===1&&!H(this.currentToken,2)){this._issues.push(G(25,a.rangeTokens,a)),a.lastToken=i.at(-1);let d=new Dr(a);return r.addNodeChild(d),this.mergeStack(),!0}let c=i.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=i.at(-1),c!=="/delete-node"?this._issues.push(G(c.startsWith("/delete-n")?34:25,a.rangeTokens,a)):H(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(G(21,a.rangeTokens,a));let l=new Dr(a);if(Cn(a.tokenIndexes?.end,s)){let d=this.processNodePathRef(r);d&&n==="Name"&&this._issues.push(G(7,d.rangeTokens,d));let f=d?void 0:this.isLabelRef(r);f&&n==="Name"&&this._issues.push(G(7,f.rangeTokens,f));let p=d||f?void 0:this.isNodeName();p&&n==="Ref"&&this._issues.push(G(10,p.rangeTokens,p)),!d&&!p&&!f&&this._issues.push(G([7,10],l.rangeTokens,l)),l.nodeNameOrRef=d??f??p??null}else n==="Name"?this._issues.push(G(7,a.rangeTokens,a)):n==="Ref"&&this._issues.push(G(10,a.rangeTokens,a));let u=this.endStatement(l);return l.lastToken=u,r.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(r){this.enqueueToStack();let n=this.checkConcurrentTokens([je(13),rt("d"),rt("e"),rt("lete"),je(16),rt("property")]);if(!n.length)return this.popStack(),!1;let i=n[0],s=i,o=new ht;if(o.firstToken=i,n.length===1&&!H(this.currentToken,2)){this._issues.push(G(25,o.rangeTokens,o)),o.lastToken=n.at(-1);let u=new pt(o);return r.addNodeChild(u),this.mergeStack(),!0}let a=n.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=n.at(-1),a!=="/delete-property"?this._issues.push(G(a.startsWith("/delete-p")?35:25,o.rangeTokens,o)):H(this.currentToken,13)?(s=this.moveToNextToken,o.lastToken=s):this._issues.push(G(21,o.rangeTokens,o));let c=new pt(o);if(Cn(o.tokenIndexes?.end,i)){let u=this.isPropertyName();u||this._issues.push(G(6,c.rangeTokens,c)),c.propertyName=u??null}else this._issues.push(G(6,o.rangeTokens,o));let l=this.endStatement(c);return c.lastToken=l,r.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processNodePathRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let o=new Tr(n,i,s);return this.mergeStack(),o}processValue(r){this.enqueueToStack();let i=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef(r)||this.isLabelRefValue(r)||this.arrayValues(r)||this.processByteStringValue()||this.isExpressionValue(r))??null,a=o();if(!a)return[];let c=[a];for(;!H(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d,f=H(this.currentToken,24);if(f)d=this.currentToken,this.moveToNextToken;else if(!Cn(this.prevToken,this.currentToken))break;let p=o();if(u&&p===null&&f){let h=new Z(W(u,this.currentToken));this._issues.push(G(0,h.rangeTokens,h))}if(!f&&p===null)break;if(l&&!f&&p){let h=new Z(W(l));this._issues.push(G(28,h.rangeTokens,h))}let g=c.at(-1);g&&(g.nextValueSeparator??=d),c.push(p)}return c})();if(i.length===0){this.popStack();return}return this.mergeStack(),new lf(i)}processStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.consumeAnyConcurrentTokens([je(21)]);if(!n.length){this.popStack();return}if(n.some(l=>!l?.value))throw new Error("Token must have value");let i=n.map(l=>l.value).join(`
|
|
190
|
+
`),s=i;s.match(/["']$/)&&(s=s.slice(1,-1));let o=new ie(s,W(n[0],n.at(-1)));i.match(/["']$/)||this._issues.push(G(i.startsWith('"')?16:17,o.rangeTokens,o));let a=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(a=this.processOptionalLabelAssign(!0));let c=new Tr(r,o,a);return this.mergeStack(),c}arrayValues(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.processBits(),s=this.currentToken;if(H(s,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(r)??null;o.openBracket=s;let a=this.processOptionalLabelAssign(!0)??[],c=new Tr(n,o,a,i);if(!H(this.currentToken,4))this._issues.push(G(12,c.rangeTokens,c));else{let u=this.moveToNextToken;o&&(o.closeBracket=u)}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=s,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),n=this.moveToNextToken,i=n;if(!H(i,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(G(15,u.rangeTokens,u))});let a=new _i(s??[]);a.openBracket=i,a.values.length===0&&(a.firstToken=n,this._issues.push(G(14,a.rangeTokens,a)));let c=new Tr(r,a,o);H(this.currentToken,12)?a.closeBracket=this.moveToNextToken:this._issues.push(G(5,c.rangeTokens,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=n,a.lastToken=this.prevToken,c}processLabeledValue(r){this.enqueueToStack();let n=r(),i=[];if(!n)return this.popStack(),[];for(;n;)i=[...i,n],n=r();if(i){let s=r();s&&(i=[...i,s])}return this.mergeStack(),i}processArrayValues(r){this.enqueueToStack();let n=this.processLabeledValue(()=>this.processRefValue(r,!1)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1,r)),i=new Lt(n);return n.length===0&&(i.firstToken=this.currentToken),this.mergeStack(),i}processLabeledHex(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processHex();if(!i){this.popStack();return}let s=new Jn(i,n);return this.mergeStack(),s}processHexString(){this.enqueueToStack();let r=this.processOptionalLabelAssign(!1),n=this.checkConcurrentTokens([20,20].map(je));if(!n.length){this.popStack();return}let i=Number.parseInt(n.map(a=>a.value).join(""),16),s=new Zt(i,W(n[0],n.at(-1))),o=new Jn(s,r);return this.mergeStack(),o}processLabeledDec(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(r),i=this.processDec();if(!i){this.popStack();return}let s=new Jn(i,n);return this.mergeStack(),s}processLabeledExpression(r=!0,n=r,i){this.enqueueToStack();let s=[];r&&(s=this.processOptionalLabelAssign(n));let o=this.processExpression(this.cPreprocessorParser.macros,i);if(!o){this.popStack();return}let a=new Jn(o,s);return this.mergeStack(),a}isExpressionValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),i=this.processExpression(this.cPreprocessorParser.macros,r);if(!i){this.popStack();return}let s=this.processOptionalLabelAssign(!0),o=new Tr(n,i,s);return this.mergeStack(),o}isLabelRef(r){this.enqueueToStack();let n=this.currentToken;if(!n||!H(n,40)){this.popStack();return}else this.moveToNextToken;let i=this.isLabelName();if(!i){let o=new se(null);return this._issues.push(G(18,W(n),r)),o.firstToken=n,this.mergeStack(),o}n&&(i.firstToken.pos.line!==n.pos.line||i.firstToken.pos.col!==n.pos.colEnd)&&this._issues.push(G(29,W(n,i.firstToken),r,{inclusiveStart:!1,inclusiveEnd:!1}));let s=new se(i);return s.firstToken=n,this.mergeStack(),s}isLabelRefValue(r){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),i=this.isLabelRef(r);if(!i){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(s=this.processOptionalLabelAssign(!0));let o=new Tr(n,i,s);return this.mergeStack(),o}processRefValue(r,n){this.enqueueToStack();let i=this.processOptionalLabelAssign(n),s=this.currentToken;if(!s||!H(s,40)){this.popStack();return}let o=this.processNodePathRef(r);if(o!==void 0){let l=new Jn(o,i);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(G([18,9],W(s),r));let l=new Jn(null,i);return l.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),l}let c=new Jn(a,i);return c.firstToken=i.at(0)?.firstToken??s,this.mergeStack(),c}processNodePath(r=!0,n=new An){this.enqueueToStack();let i;if(H(this.currentToken,13))i=this.moveToNextToken;else{if(!r){this.popStack();return}this.prevToken&&this._issues.push(G(19,W(this.prevToken),n))}let s=this.isNodeName();if(s||this._issues.push(G(7,W(i??this.prevToken),n)),n.addPath(s??null,i?new Z(W(i)):void 0),r&&!i&&n.children.length===0){this.mergeStack();return}return this.processNodePath(!1,n),this.mergeStack(),n}processNodePathRef(r){this.enqueueToStack();let n=this.moveToNextToken,i=n;if(!H(i,40)){this.popStack();return}let s=this.moveToNextToken;if(i=s,!H(i,2)){this.popStack();return}n&&!zt(n,s)&&this._issues.push(G(29,W(n,s),r,{inclusiveStart:!1,inclusiveEnd:!1}));let o=this.processNodePath(),a=new nt(o??null),c=this.currentToken??this.prevToken,l=c;return o?.children.forEach((u,d)=>{if(d===o?.children.length-1&&u&&l&&!zt(u.lastToken,l)){this._issues.push(G(29,W(u.lastToken,l),r,{inclusiveStart:!1,inclusiveEnd:!1}));return}if(d===0&&s&&!zt(s,u?.firstToken)){this._issues.push(G(29,W(s,u?.firstToken),r,{inclusiveStart:!1,inclusiveEnd:!1}));return}let f=o?.children[d+1];u&&f&&!zt(u.lastToken,f.firstToken)&&this._issues.push(G(29,W(u.lastToken,f?.firstToken),r,{inclusiveStart:!1,inclusiveEnd:!1}))}),H(c,3)?this.moveToNextToken:this.prevToken&&this._issues.push(G(3,W(this.prevToken),r)),a.firstToken=n,a.lastToken=c??this.prevToken,this.mergeStack(),a}get includes(){return this.allAstItems.filter(r=>r instanceof Si)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties,...this.unhandledStatements.nodes]}};var Gj=async(t,e,r)=>{let n=te.Position.create(t.pos.line,t.pos.col),i=r.find(s=>nn(s,e,n));if(i)return Xn(i,e,n)},jy=t=>{if(t)return t instanceof ct?t:jy(t?.parentNode)},Xo=(t,e,r=0)=>{if(!e||!de(e.uri,t)||!e.parentNode?.uri)return r;let n=jy(e.parentNode);return Xo(t,n,r+1)},Yj=(t,e)=>async r=>{let n=t.filter(a=>!(a instanceof Si)&&!(a instanceof an)&&!(a instanceof on)&&!(a instanceof Zi)),i=await Gj(r.firstToken,e,n);if(!i||i===r||r.allDescendants.some(a=>a===i))return{level:0};let s=jy(i);return{level:Xo(e,s),inAst:i}};async function FE(t,e){let r=De(t.textDocument.uri),n=new Hs(r,[],void 0,()=>new Wo(e,r).tokens,!0);await n.stable;let i=n.issues.filter(s=>Ho(s.raw,r,!1));if(i?.length)throw new te.ResponseError(te.ErrorCodes.InternalError,"Unable to format. File has syntax issues.",i.map(s=>s.diagnostic()));return jE(t,n.allAstItems,r,e.split(`
|
|
191
|
+
`))}async function jE(t,e,r,n){let i=Yj(e,r),s=[];s.push(...(await Promise.all(e.flatMap(async a=>await VE(t,a,r,i,n)))).flat()),t.options.trimTrailingWhitespace&&s.push(...Jj(n,s));let o=Kj(e,n);return o.length?s.filter(a=>!Xj(a.range.start,o)):s}async function Uy(t,e,r){let n=r.split(`
|
|
192
|
+
`),i=De(t.textDocument.uri),s=await e.getRuntime(),o=s.fileTopMostAsts(i);if(s.includes.filter(c=>de(c.resolvedPath,i)).length>1){let c=[];o.forEach(l=>{c.some(u=>u.firstToken.pos.line===l.firstToken.pos.line&&u.firstToken.pos.col===l.firstToken.pos.col)||c.push(l)}),o=c}return jE(t,o,i,n)}var Kj=(t,e)=>{let r=te.Position.create(e.length-1,e.at(-1)?.length??0),n=[],i;return t.filter(o=>(o instanceof on||o instanceof an)&&/^dts-format (on|off)$/.test(o.toString().trim())).sort((o,a)=>o.firstToken.pos.line-a.firstToken.pos.line).forEach(o=>{let a=o.toString().trim();if(a==="dts-format off")i={start:te.Position.create(o.firstToken.pos.line,o instanceof on?o.firstToken.pos.colEnd:0)};else if(a==="dts-format on"&&i){let c=te.Position.create(o.lastToken.pos.line,o instanceof on?o.lastToken.pos.colEnd-1:e[o.lastToken.pos.line-1].length);n.push(te.Range.create(i.start,c)),i=void 0}}),i&&n.push(te.Range.create(i.start,r)),n};function BE(t,e){return t.line<e.line?-1:t.line>e.line?1:t.character<e.character?-1:t.character>e.character?1:0}var Xj=(t,e)=>e.some(r=>BE(t,r.start)>=0&&BE(t,r.end)<=0),Jj=(t,e)=>{let r=[];return t.forEach((n,i)=>{let s=n.trimEnd();if(s.length!==n.length){let o=te.Range.create(te.Position.create(i,s.length),te.Position.create(i,n.length));e.some(a=>yE(o,a.range))||r.push(te.TextEdit.del(o))}}),r},Nf=(t,e,r=1,n=!1,i=t.prevToken)=>{if(i){let s=t.pos.line-i.pos.line;if(s-r&&(s!==2&&r!==0||r===0||n))return te.TextEdit.replace(te.Range.create(te.Position.create(i.pos.line,i.pos.colEnd),te.Position.create(t.pos.line-(r?1:0),r?e[t.pos.line-(r?1:0)].length:t.pos.col)),"".padEnd(r-(n?1:0),`
|
|
193
|
+
`))}else if(t.pos.line)return te.TextEdit.del(te.Range.create(te.Position.create(0,0),te.Position.create(t.pos.line,0)))},UE=(t,e,r,n="",i=1)=>{let s=t.pos.line===t.prevToken?.pos.line;if(t.prevToken&&s)return te.TextEdit.replace(te.Range.create(te.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),te.Position.create(t.pos.line,t.pos.col)),`${`
|
|
194
|
+
`.repeat(i)}${"".padStart(e*r.length,r)}${n}`)},Hy=(t,e,r,n,i="")=>{let s=`${"".padStart(e*r.length,r)}${i}`,o=te.Range.create(te.Position.create(t.pos.line,0),te.Position.create(t.pos.line,t.pos.col)),a=dU(n,o);return s===a?[]:[te.TextEdit.replace(te.Range.create(te.Position.create(t.pos.line,0),te.Position.create(t.pos.line,t.pos.col)),s)]},mt=(t,e,r=1,n=!1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){if(n)return[];let i=Nf(t.nextToken,e,0);if(!i)throw new Error("remove new LinesEdit must be defined");return r&&(i.newText=`${"".padEnd(r," ")}${i.newText}`),[i]}return r===0?[te.TextEdit.del(te.Range.create(te.Position.create(t.pos.line,t.pos.colEnd),te.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)))]:t.nextToken.pos.line===t.pos.line&&t.pos.colEnd===t.nextToken.pos.col?[te.TextEdit.insert(te.Position.create(t.nextToken.pos.line,t.nextToken.pos.col),"".padEnd(r," "))]:[te.TextEdit.replace(te.Range.create(te.Position.create(t.pos.line,t.pos.colEnd),te.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)),"".padEnd(r," "))]},Ec=(t,e)=>t.slice(1).flatMap(r=>r.firstToken.prevToken?mt(r.firstToken.prevToken,e):[]),Qj=async(t,e,r,n,i,s,o)=>{if(!de(e.uri,r))return[];let a=[];if(a.push(...Vr(e.firstToken,n,i,s,void 0,e.firstToken.prevToken?.value==="{"&&!e.topComment||e.topComment?1:2,!0)),e instanceof Ue||e instanceof Wt)if(a.push(...Ec(e.labels,s)),e instanceof Ue){e.labels.length&&e.name&&e.name.firstToken.prevToken&&a.push(...mt(e.name.firstToken.prevToken,s));let c=e.name&&e.openScope?mt(e.name.lastToken,s):[];a.push(...c)}else{e.labels.length&&e.reference?.firstToken.prevToken&&a.push(...mt(e.reference.firstToken.prevToken,s));let c=e.reference&&e.openScope?mt(e.reference.lastToken,s):[];a.push(...c)}else e instanceof St&&e.firstToken.value==="/"&&e.openScope&&a.push(...mt(e.firstToken,s,1));return a.push(...(await Promise.all(e.children.flatMap(c=>VE(t,c,r,o,s,n+1)))).flat()),e.closeScope&&(e.openScope&&e.closeScope.prevToken===e.openScope?a.push(...mt(e.openScope,s,0)):a.push(...Vr(e.closeScope,n,i,s,void 0,1,!0))),e.lastToken.value===";"&&e.closeScope&&a.push(...wc(e.closeScope,e.lastToken)),a},Zj=(t,e,r,n,i,s)=>{let o=[];if(o.push(...Ec(e.labels,s)),e.labels.length&&e.value?.firstToken.prevToken&&o.push(...mt(e.value.firstToken.prevToken,s)),e.firstToken.prevToken)if(e.firstToken.pos.line!==e.firstToken.prevToken?.pos.line&&e.firstToken.prevToken!==i){let a=Nf(e.firstToken,s,1,!0);a&&o.push(a),o.push(...Hy(e.firstToken,r,n.singleIndent,s,Ko(n,t+4)))}else o.push(...mt(e.firstToken.prevToken,s,i&&e.firstToken.prevToken===i?0:1));return e.value instanceof Ee&&o.push(...Sf(e.value,s,r,n,t+4)),o},eU=(t,e,r,n,i)=>{let s=[];return e instanceof Lt||e instanceof _i?e.openBracket&&e.openBracket?.nextToken===e.closeBracket?s.push(...mt(e.openBracket,i,0)):(s.push(...e.values.flatMap(o=>Zj(t,o,r,n,e.openBracket,i))),e.closeBracket?.prevToken&&s.push(...mt(e.closeBracket.prevToken,i,e.closeBracket.prevToken===e.values.at(-1)?.lastToken?0:1))):e instanceof Ee&&s.push(...Sf(e,i,r,n,t)),s},Sf=(t,e,r,n,i)=>t instanceof wn?tU(t,e):t instanceof Yn?rU(t,e,r,n,i):[],tU=(t,e)=>{let r=[];return r.push(...mt(t.functionName.lastToken,e,0)),t.params.forEach((n,i)=>{n?.firstToken.prevToken&&r.push(...mt(n?.firstToken.prevToken,e,i?1:0)),n?.splitToken&&r.push(...wc(n.lastToken,n.splitToken))}),t.lastToken.value===")"&&t.lastToken.prevToken&&r.push(...mt(t.lastToken.prevToken,e,0)),r},rU=(t,e,r,n,i)=>{let s=[];return t.openBracket&&t.openBracket.nextToken&&(t.openBracket.pos.line===t.openBracket.nextToken.pos.line?s.push(...mt(t.openBracket,e,0)):s.push(...Vr(t.openBracket,r,n.singleIndent,e,Ko(n,i)))),s.push(...Sf(t.expression,e,r,n,i)),t.join?.forEach(o=>{o.operator.firstToken.prevToken&&s.push(...mt(o.operator.firstToken.prevToken,e)),o.expression.firstToken.prevToken?.pos.line===o.expression.firstToken.pos.line?s.push(...mt(o.expression.firstToken.prevToken,e)):s.push(...Vr(o.expression.firstToken,r,n.singleIndent,e,Ko(n,i))),s.push(...Sf(o.expression,e,r,n,i))}),!t.join?.length&&!(t.expression instanceof Yn)&&(t.expression instanceof wn||t.expression instanceof Ct)&&(t.openBracket&&s.push(te.TextEdit.del(te.Range.create(te.Position.create(t.openBracket.pos.line,t.openBracket.pos.col),te.Position.create(t.openBracket.pos.line,t.openBracket.pos.colEnd)))),t.closeBracket&&s.push(te.TextEdit.del(te.Range.create(te.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.col),te.Position.create(t.closeBracket.pos.line,t.closeBracket.pos.colEnd))))),t.closeBracket&&t.closeBracket.prevToken&&s.push(...mt(t.closeBracket.prevToken,e,0)),s},nU=(t,e,r,n,i)=>{let s=[];return s.push(...Ec(e.startLabels,i)),s.push(...eU(t,e.value,r,n,i)),s.push(...Ec(e.endLabels,i)),s},Ko=(t,e)=>{if(t.insertSpaces)return"".padStart(e," ");let r=Math.floor(e/t.tabSize),n=e%t.tabSize;return`${"".padStart(r," ")}${"".padStart(n," ")}`},iU=(t,e,r,n,i,s)=>{let o=[];return e.values.forEach((a,c)=>{if(!a)return[];let l=a.firstToken.prevToken,u=c?e.values.at(c-1):void 0;if(l)if(l.pos.line===a.firstToken.pos.line)if(l.value===","&&u?.lastToken.pos.line!==a.firstToken.pos.line&&l.prevToken?.pos.line!==a.firstToken.pos.line){let d=UE(a.firstToken,r,n.singleIndent,Ko(n,t+3));d&&o.push(d)}else o.push(...mt(l,i,1));else if(s&&a.firstToken.prevToken===s)o.push(...mt(s,i));else{let d=Nf(a.firstToken,i,1,!0);d&&o.push(d),o.push(...Hy(a.firstToken,r,n.singleIndent,i,Ko(n,t+3)))}o.push(...nU(t,a,r,n,i)),a.nextValueSeparator&&o.push(...wc(a.lastToken,a.nextValueSeparator))}),o},sU=(t,e,r,n,i)=>{if(!de(t.uri,i))return[];let s=[];return s.push(...Vr(t.firstToken,e,r.singleIndent,n,void 0,void 0,t.firstToken.prevToken?.value==="{")),s.push(...Ec(t.labels,n)),t.labels.length&&t.propertyName?.firstToken.prevToken&&s.push(...mt(t.propertyName.firstToken.prevToken,n)),t.values&&(t.propertyName&&s.push(...mt(t.propertyName?.lastToken,n)),s.push(...iU(t.propertyName?.name.length??0,t.values,e,r,n,t.assignOperatorToken))),t.lastToken.value===";"&&s.push(...wc(t.children.at(-1).lastToken,t.lastToken)),s},Vr=(t,e,r,n,i,s,o)=>{let a=[],c=UE(t,e,r,i,s);if(c)a.push(c);else{let l=Nf(t,n,s,o);l&&a.push(l),a.push(...Hy(t,e,r,n,i))}return a},wc=(t,e)=>t.pos.line===e.pos.line&&t.pos.colEnd+1===e.pos.colEnd?[]:t.nextToken===e?[te.TextEdit.replace(te.Range.create(te.Position.create(t.pos.line,t.pos.colEnd),te.Position.create(e.pos.line,e.pos.colEnd)),e.value)]:[te.TextEdit.insert(te.Position.create(t.pos.line,t.pos.colEnd),e.value),te.TextEdit.del(te.Range.create(te.Position.create(e.prevToken?.pos.line??e.pos.line,e.prevToken?.pos.colEnd??e.pos.col),te.Position.create(e.pos.line,e.pos.colEnd)))],oU=(t,e,r,n)=>{let i=[];i.push(...Vr(t.firstToken,e,r,n));let s=mt(t.keyword.lastToken,n);return i.push(...s),t.lastToken.value===";"&&i.push(...wc(t.children.at(-1).lastToken,t.lastToken)),i},aU=(t,e,r,n,i)=>{if(r===void 0)return[];if(!de(t.uri,e))return[];let s=[];s.push(...Vr(t.firstToken,r.level,n,i));let o=mt(t.keyword.lastToken,i);return s.push(...o),s},cU=(t,e,r,n,i)=>t.comments.length===1&&t.firstToken.pos.line===t.firstToken.prevToken?.pos.line?[]:t.comments.flatMap((s,o)=>lU(s,t,e,r,n,o?o===t.comments.length-1?"last":"comment":"first",i)),HE=(t,e,r="")=>{let n=e?My(e):void 0;if(!n)return r;let i=js(e),s=n.propertyName?.name.length??0;return`${`${Ko(t,s+(i?4:3)+(r.length-r.trimStart().length))}`}${r.trimStart()}`},lU=(t,e,r,n,i,s,o)=>{if(!t.firstToken.prevToken)return Vr(t.firstToken,r?.level??0,n,i);if(t.firstToken.pos.line===t.firstToken.prevToken?.pos.line)return mt(t.firstToken.prevToken,i,1);if(r===void 0)return[];let a,c;s==="first"&&!e.astBeforeComment&&e.astAfterComment instanceof ct&&(a=!0,c=e.firstToken.prevToken?.value==="{"?1:2);let l=[],u="",d=t.toString();switch(s==="last"&&d.trim()!==""&&t.lastToken.prevToken&&(s="comment",l.push(...Vr(t.lastToken.prevToken,r?.level??0,n,i," "))),s){case"comment":u=t.firstToken.value==="*"?" ":" * ";break;case"first":break;case"last":u=" ";break}return r?.inAst instanceof ct?l.push(...Vr(t.firstToken,r?.level??0,n,i,u,c,a)):l.push(...Vr(t.firstToken,r?.level??0,n,i,HE(o,r?.inAst,u),c,a)),l},uU=(t,e,r,n,i)=>{if(!t.firstToken.prevToken)return Vr(t.firstToken,e?.level??0,r,n);if(t.firstToken.pos.line===t.firstToken.prevToken.pos.line)return[];let o,a;return!t.astBeforeComment&&t.astAfterComment instanceof ct&&(o=!0,a=t.firstToken.prevToken?.value==="{"?1:2),Vr(t.firstToken,e?.level??0,r,n,HE(i,e?.inAst),a,o)},VE=async(t,e,r,n,i,s=0)=>{let o=t.options.tabSize,a=t.options.insertSpaces,c=a?"".padStart(o," "):" ",l={tabSize:o,insertSpaces:a,singleIndent:c};return uE(c),e instanceof ct?Qj(t,e,r,s,c,i,n):e instanceof Ye?sU(e,s,l,i,r):e instanceof vr?oU(e,s,c,i):e instanceof Si?aU(e,r,await n(e),c,i):e instanceof an?uU(e,await n(e),c,i,l):e instanceof on?cU(e,await n(e),c,i,l):[]};function dU(t,e){let r=t[e.start.line],n=t[e.end.line];if(e.start.line===e.end.line)return r.substring(e.start.character,e.end.character);let i=t.slice(e.start.line+1,e.end.line);return[r.substring(e.start.character),...i,n.substring(0,e.end.character)].join(`
|
|
195
|
+
`)}function fU(t){switch(t){case"EMPTY":return"EMPTY";case"U32":return"U32";case"U64":return"U64";case"STRING":return"STRING";case"PROP_ENCODED_ARRAY":return"PROP_ENCODED_ARRAY";case"STRINGLIST":return"STRINGLIST";case"BYTESTRING":return"BYTESTRING";case"ANY":return"ANY";case"UNKNOWN":return"UNKNOWN"}}var X=class{constructor(e,r,n="optional",i=void 0,s,o){this.name=e;this.type=r;this.def=i;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:Et.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(fU).join(" or ")).join(",")}
|
|
196
196
|
|
|
197
197
|
`,...this.bindingType?["**Binding type** ",`${this.bindingType}
|
|
198
198
|
|
|
@@ -201,9 +201,9 @@ ${"".padStart(e*r.length,r)}${n}`)},Jy=(t,e,r,n,i="")=>{let s=`${"".padStart(e*r
|
|
|
201
201
|
`)]:[],...this.examples?["### Example",this.examples.join(`
|
|
202
202
|
|
|
203
203
|
`)]:[]].join(`
|
|
204
|
-
`)});this.signatureArgsCyclic=!1;typeof n!="function"?this.required=()=>n:this.required=n,typeof s!="function"?(this.allowedValues=s,this.values=()=>s===void 0?i?[i]:[]:i&&s.indexOf(i)===-1?[i,...s]:s):this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,r,n,i){let s=this.required(r);if(i){if(s==="omitted")return[
|
|
205
|
-
${"".padEnd(
|
|
206
|
-
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[Ke.SignatureInformation.create(`${r.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(r){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(r)!=="omitted"&&typeof n.name=="string").map(n=>{let i=r&&n.required(r),s=!!r.property.some(a=>n.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${n.name}`,kind:Ke.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var Oe=t=>{if(!t?.values.some(e=>!(e?.value instanceof qt)))return t?.values.flatMap(e=>e.value.values.map(r=>r.value))??[]};var qe=(t,e,r,n)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof qt){let s=i.values.at(r);if(s?.value instanceof we){let o=s.value.evaluate(n);if(typeof o=="number")return o}}},ln=(t,e,r=0)=>{if(t instanceof _r){if(t?.value instanceof qt){let n=t.value.values.at(r);if(n?.value instanceof tr)return e.getPhandle(n.value.value);if(n?.value instanceof se)return n.value.linksTo;if(n?.value instanceof it)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof tr)return e.getPhandle(t.value);if(t instanceof se)return t.linksTo;if(t instanceof it)return t.path?.pathParts.at(-1)?.linksTo}},W=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var ek=()=>{let t=new J("compatible",W("STRINGLIST"));return t.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."],t.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."],t};var ra=M(F());var tk=()=>{let t=new J("device_type",W("STRING"),"optional",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 r=e.ast.values?.values.at(0)?.value;if(r instanceof ie&&r.value!==e.parent.name)return e.parent.name==="cpu"?[$(12,e.ast,ra.DiagnosticSeverity.Error,[],[],[e.name])]:[$(13,e.ast,ra.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[$(14,e.ast,ra.DiagnosticSeverity.Hint,[],[ra.DiagnosticTag.Deprecated],[e.name])]:[]});return t.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."],t};var rk=()=>{let t=new J("#interrupt-cells",W("U32"));return t.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],t};var nk=()=>{let t=new J("interrupt-controller",W("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var ik=()=>{let t=new J("interrupt-parent",W("U32"));return t.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."],t};var Ri=M(F());var sk=()=>{let t=new J("interrupts",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=Oe(e.ast.values);if(!i)return n;let s=e.parent;if(s.getProperty("interrupts-extended"))return n;let o=s.interruptsParent;if(!o?.parentInterruptNode)return o?.interruptParent?(n.push($(17,o.interruptParent.ast.values?.values.at(0)?.value??o.interruptParent.ast)),n):(n.push($(16,e.ast,Ri.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),n);let{parentInterruptNode:a}=o,c=a.getProperty("#interrupt-cells");if(!c)return n.push($(16,e.ast,Ri.DiagnosticSeverity.Error,[...a.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",a.pathString])),n;let l=qe(c,0,0,r);if(!l)return n;let u=[...Array.from({length:l},(y,h)=>`Interrupt${l>1?h:""}`)];t.signatureArgs=u.map(y=>Ri.ParameterInformation.create(y));let d=a.getProperty("interrupt-map"),f=s.parent?.getProperty("#address-cells");if(d&&!f&&n.push($(16,e.ast.propertyName??e.ast,Ri.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.parent?.pathString??"/"])),!c)return n.push($(16,e.ast,Ri.DiagnosticSeverity.Error,[...a.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",a.pathString])),n;let p=0;for(;p<i.length;){let y=i.length-p;if(l>y)return n.push($(19,i.at(-1),Ri.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:l},()=>"Interrupt")].join(" ")}> `])),n;let h=i.slice(p,p+l),v=s.mappedReg(r)?.at(0)?.startAddress,S={mappingValuesAst:h,target:a};if(e.nexusMapsTo.push(S),d&&v){let _=a.getNexusMapEntyMatch("interrupt",r,h,v);_?.match?S.mapItem=_.match:n.push($(31,_.entry,Ri.DiagnosticSeverity.Error,[d.ast]))}h.every(_=>_ instanceof we)&&a.interrupControlerMapping.push({expressions:h,node:s,property:e}),p+=l}return n});return t.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."],t.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```"],t};var Ei=M(F());var ok=()=>{let t=new J("interrupts-extended",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=i.getProperty("interrupts");s&&n.push($(15,s.ast,Ei.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let o=i.getProperty("interrupt-parent");o&&n.push($(15,o.ast,Ei.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=i.root,c=Oe(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=ln(c[l],a);if(!f)return n.push($(17,c[l],Ei.DiagnosticSeverity.Error)),n;let p=f.getProperty("#interrupt-cells");if(!p){n.push($(16,e.ast,Ei.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",f.pathString]));break}let y=qe(p,0,0,r);if(y==null)return n;let h=c.length-l-1;if(d.push([`${u}_phandel`,...Array.from({length:y},(R,C)=>`${u}_interrupt${y>1?C:""}`)]),y>h)return n.push($(19,c.at(-1),Ei.DiagnosticSeverity.Error,[],[],[e.name,`<${d.at(-1).join(" ")}>`])),n;let v=c.slice(l+1,l+1+y),S=f.getProperty("interrupt-map"),_={mappingValuesAst:v,target:f};e.nexusMapsTo.push(_);let T=i.mappedReg(r)?.at(0)?.startAddress;if(S&&T){let R=f.getNexusMapEntyMatch("interrupt",r,v,T);R?.match?_.mapItem=R.match:n.push($(31,R.entry,Ei.DiagnosticSeverity.Error,[S.ast]))}v.every(R=>R instanceof we)&&f.interrupControlerMapping.push({expressions:v,node:i,property:e}),l+=y+1,u++}return d.push([`${u}_phandel`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(p=>Ei.ParameterInformation.create(p))),n});return t.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."],t.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```"],t};var ak=()=>{let t=new J("dma-noncoherent",W("EMPTY"));return t.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."],t};var ck=()=>{let t=new J("dma-coherent",W("EMPTY"));return t.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."],t};var If=M(F());var lk=()=>{let t=new J("dma-ranges",W(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>If.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=Oe(e.ast.values);return c?.length?((c.length===0||c.length%(s+o+i)!==0)&&n.push($(19,c.at(c.length-c.length%(s+o+i))??e.ast,If.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:i},()=>"length")].join(" ")}>`])),n):[]});return t.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)."],t};var na=M(F());var Of=()=>{let t=new J("ranges",W(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>na.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=Oe(e.ast.values);return c?.length?((c.length===0||c.length%(s+o+i)!==0)&&n.push($(19,c.at(c.length-c.length%(s+o+i))??e.ast,na.DiagnosticSeverity.Error,[],[],[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:o},()=>"length")].join(" ")}>`])),n.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(r)?.forEach(d=>{if(d.missingMapping){let f=l.parent?.getProperty("ranges");n.push($(35,d.regAst,na.DiagnosticSeverity.Warning,f?[f.ast]:[]));return}!d?.mappingEnd||!d.mappedAst||d.inMappingRange||n.push($(29,d.regAst,na.DiagnosticSeverity.Warning,[d.mappedAst],[],[u.name,`0x${d.endAddress.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`]))})}),n):[]});return t.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."],t.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
204
|
+
`)});this.signatureArgsCyclic=!1;typeof n!="function"?this.required=()=>n:this.required=n,typeof s!="function"?(this.allowedValues=s,this.values=()=>s===void 0?i?[i]:[]:i&&s.indexOf(i)===-1?[i,...s]:s):this.values=s}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,r,n,i){let s=this.required(r);if(i){if(s==="omitted")return[B(11,i.ast.rangeTokens,i.ast,{templateStrings:[n]})]}else{if(s==="required"){let l=e.getOrderedNodeAst(r),u=Vo(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case"U32":case"U64":case"PROP_ENCODED_ARRAY":d=` = <${n==="reg"&&r.address?r.address.map(f=>`0x${f.toString(16)}`).join(" "):""}>`;break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,p)=>{let g=f.openScope??u[p].lastToken;return B(0,u[p].rangeTokens,u[p],{templateStrings:[n],edit:Et.TextEdit.insert(Et.Position.create(g.pos.line,g.pos.col+1),`
|
|
205
|
+
${"".padEnd(Xo(u[p].uri,f)*Uo().length,Uo())}${n}${d};`)})})]}return[]}let o=pU(i),a=[],c=(l,u,d)=>{if(d??=i.ast,!(l.some(p=>p==u)||l.some(p=>p=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(p=>p=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let p=[];l.forEach(g=>{switch(g){case"EMPTY":p.push(1);break;case"STRING":p.push(2);break;case"STRINGLIST":p.push(3);break;case"U32":p.push(5);break;case"U64":p.push(6);break;case"PROP_ENCODED_ARRAY":p.push(7);break}}),p.length&&a.push(B(p,d.rangeTokens,d,{templateStrings:[i.name]}))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;if(!this.list&&this.type.length!==o.length){let u=i.ast.values??i.ast;a.push(B(4,u.rangeTokens,u,{templateStrings:[n,this.type.length.toString()]}))}else o.forEach((u,d)=>{if(l[0].types.every(f=>f!==u)){let f=i.ast.values?.values[d]??i.ast;a.push(B(3,f.rangeTokens,f))}})}else{if(this.type[0].types.some(u=>u==="STRINGLIST"))o.some(u=>c(["STRINGLIST"],u,i.ast.values?.values[0]?.value));else if(this.list||this.type.length===1&&this.type[0].types.filter(u=>u!=="EMPTY").every(u=>u==="PROP_ENCODED_ARRAY"))o.some(u=>c(this.type[0].types,u,i.ast.values?.values[0]?.value));else if(o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")){let u=i.ast.propertyName??i.ast;a.push(B(8,u.rangeTokens,u,{linkedTo:(i.ast.values?.values.slice(1)??[]).filter(d=>!!d),templateStrings:[i.name]}))}else o.length===1&&c(this.type[0].types,o[0],i.ast.values?.values[0]?.value);let l=this.values(i);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(i,e.context.macros)??[]),l.length&&this.type[0].types.some(u=>u==="STRING"))){let u=i.ast.values?.values[0]?.value;if(!l.some(d=>u.value===d)){let d=i.ast.values?.values[0]?.value??i.ast;a.push(B(9,d.rangeTokens,d,{templateStrings:[this.values(i).map(f=>`'${f}'`).join(" or ")]}))}}}return a}getPropertyCompletionItems(e,r,n){let i=this.type.at(r);return i?.types.some(s=>s==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(s=>({label:`"${s}"`,kind:Et.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`"${s}"`})):i?.types.some(s=>s==="U32"||s==="U64")?this.values(e).map(s=>({label:`<${s}>`,kind:Et.CompletionItemKind.Variable,sortText:s===this.def?`A${s}`:`Z${s}`,insertText:n?`${s}`:`<${s}>`})):[]}},pU=t=>t.ast.values?t.ast.values.values.map(e=>hU(e)):["EMPTY"],hU=t=>t?t.value instanceof ie?"STRING":t.value instanceof Lt?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof se||t.value instanceof nt?"U32":"BYTESTRING":"UNKNOWN",Cc=class{constructor(){this.extends=new Set}},Nt=class extends Cc{constructor(r=()=>[]){super();this.additionalValidations=r;this.#e=[];this.noMismatchPropertiesAllowed=!1;this.warnMismatchProperties=!1}#e;#t;getIssue(r,n){let i=[];if(n.disabled){let a=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(c=>i.push(B(21,c.rangeTokens,c,{severity:Et.DiagnosticSeverity.Hint,linkedTo:[...a?.ast?[a?.ast]:[]],tags:[Et.DiagnosticTag.Unnecessary]}))),i}let s=new Set,o=this.properties.flatMap(a=>{if(a.name==="reg"&&a.required(n)==="required"&&!n.address&&n.properties.find(u=>u.name==="reg")){let u=n.regArray(r.context.macros)?.at(0)?.startAddress.map(f=>f.toString(16)).join(","),d=n.definitions.at(-1).name??n.definitions.at(-1);i.push(B(36,d.rangeTokens,d,{linkedTo:n.definitions.slice(0,-1).map(f=>f.name??f),edit:u?n.definitions.filter(f=>!!f.name).map(f=>Et.TextEdit.insert(Et.Position.create(f.name.lastToken.pos.line,f.name.lastToken.pos.colEnd),`@${u}`)):void 0,codeActionTitle:"Add Node Address"}))}if(typeof a.name=="string"){let u=n.getProperty(a.name);return u&&s.add(u),a.validateProperty(r,n,a.name,u)}let c=n.properties.filter(u=>a.getNameMatch(u.name));c.forEach(u=>s.add(u));let l=this.properties.filter(u=>u!==a)??[];return l.length&&c.some(u=>l.some(d=>d.getNameMatch(u.name)))?[]:c.flatMap(u=>a.validateProperty(r,n,u.name,u))});return s.size!==n.properties.length&&(this.noMismatchPropertiesAllowed||this.warnMismatchProperties)&&n.properties.filter(c=>!s.has(c)).forEach(c=>{i.push(B(this.warnMismatchProperties?34:27,c.ast.rangeTokens,c.ast,{severity:this.warnMismatchProperties?Et.DiagnosticSeverity.Warning:Et.DiagnosticSeverity.Error,templateStrings:[c.name],edit:Et.TextEdit.del(Hr(c.ast.firstToken.prevToken,c.ast.lastToken,!1))}))}),[...i,...o,...this.additionalValidations(r,n)]}get properties(){return this.#e}addProperty(r){Array.isArray(r)?r.forEach(n=>this.#e.push(n)):this.#e.push(r),this.#e.sort((n,i)=>typeof n.name=="string"&&typeof i.name=="string"||typeof n.name!="string"&&typeof i.name!="string"?0:typeof n.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(r){r&&(this.#t=n=>{let i=r(n);return i.bindingsPath=this.bindingsPath,i})}getOnPropertyHover(r){let n=this.properties.find(i=>i.getNameMatch(r));return n?.onHover.bind(n)()}getSignatureHelp(r,n,i,s){let o=this.properties.find(f=>f.getNameMatch(r.name)),a=o?.signatureArgs;if(!o||!a)return;let c=r.getArgumentIndex(i),l=r.getArgumentIndex(s),d=r.getArgumentIndex(n)??l??(c!==void 0?c+1:void 0);if(gE(a)){let f=0;if(d!==void 0){let p=d,g=d?a.findIndex(h=>f<=p&&h.length+f>p?!0:(f+=h.length,!1)):void 0;g!==void 0&&(g>1&&(d=d-a.slice(0,g-1).reduce((h,v)=>h+v.length,0)),a=a.slice(g?g-1:0,g+2))}return{signatures:[Et.SignatureInformation.create(`${r.name} = ${a.map(p=>`<${p.map(g=>g.label).join(" ")}>`).join(`,
|
|
206
|
+
`)};`,this.description,...a.flat())],activeSignature:0,activeParameter:d}}return o.signatureArgsCyclic&&d&&(d=d%a.length),{signatures:[Et.SignatureInformation.create(`${r.name} = <${a.map(f=>f.label).join(" ")}>;`,this.description,...a)],activeSignature:0,activeParameter:d}}getPropertyListCompletionItems(r){return this.properties.filter(n=>!n.hideAutoComplete&&n.required(r)!=="omitted"&&typeof n.name=="string").map(n=>{let i=r&&n.required(r),s=!!r.properties.some(a=>n.getNameMatch(a.name)),o="a";return i==="required"?o=s?"Y":"!":o=s?"Z":"B",{label:`${n.name}`,kind:Et.CompletionItemKind.Property,sortText:`${o}${n.name}`}})??[]}};var Oe=t=>{if(!t?.values.some(e=>!(e?.value instanceof Lt)))return t?.values.flatMap(e=>e.value.values.map(r=>r.value))??[]};var qe=(t,e,r,n)=>{let i=t.ast.values?.values.at(e)?.value;if(i instanceof Lt){let s=i.values.at(r);if(s?.value instanceof Ee){let o=s.value.evaluate(n);if(typeof o=="number")return o}}},cn=(t,e,r=0)=>{if(t instanceof Tr){if(t?.value instanceof Lt){let n=t.value.values.at(r);if(n?.value instanceof Zt)return e.getPhandle(n.value.value);if(n?.value instanceof se)return n.value.linksTo;if(n?.value instanceof nt)return n.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof Zt)return e.getPhandle(t.value);if(t instanceof se)return t.linksTo;if(t instanceof nt)return t.path?.pathParts.at(-1)?.linksTo}},z=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var zE=()=>{let t=new X("compatible",z("STRINGLIST"));return t.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."],t.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."],t};var Rf=L(j());var WE=()=>{let t=new X("device_type",z("STRING"),"optional",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 r=e.ast.values?.values.at(0)?.value;if(r instanceof ie&&r.value!==e.parent.name)return[B(e.parent.name==="cpu"?12:13,e.ast.rangeTokens,e.ast,{templateStrings:[e.name]})]}return t.required(e.parent)!=="required"?[B(14,e.ast.rangeTokens,e.ast,{severity:Rf.DiagnosticSeverity.Hint,tags:[Rf.DiagnosticTag.Deprecated],templateStrings:[e.name]})]:[]});return t.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."],t};var GE=()=>{let t=new X("#interrupt-cells",z("U32"));return t.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],t};var YE=()=>{let t=new X("interrupt-controller",z("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var KE=()=>{let t=new X("interrupt-parent",z("U32"));return t.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."],t};var XE=L(j());var JE=()=>{let t=new X("interrupts",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=Oe(e.ast.values);if(!i)return n;let s=e.parent;if(s.getProperty("interrupts-extended"))return n;let o=s.interruptsParent;if(!o?.parentInterruptNode){if(!o?.interruptParent)return n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"interrupt-parent",e.parent.pathString]})),n;let g=o.interruptParent.ast.values?.values.at(0)?.value??o.interruptParent.ast;return n.push(B(17,g.rangeTokens,g)),n}let{parentInterruptNode:a}=o,c=a.getProperty("#interrupt-cells");if(!c)return n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let l=qe(c,0,0,r);if(!l)return n;let u=[...Array.from({length:l},(g,h)=>`Interrupt${l>1?h:""}`)];t.signatureArgs=u.map(g=>XE.ParameterInformation.create(g));let d=a.getProperty("interrupt-map"),f=s.parent?.getProperty("#address-cells");if(d&&!f){let g=e.ast.propertyName??e.ast;n.push(B(16,g.rangeTokens,g,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",s.parent?.pathString??"/"]}))}if(!c)return n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...a.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",a.pathString]})),n;let p=0;for(;p<i.length;){let g=i.length-p;if(l>g)return n.push(B(19,i.at(-1).rangeTokens,i.at(-1),{templateStrings:[e.name,`<${[...Array.from({length:l},()=>"Interrupt")].join(" ")}> `]})),n;let h=i.slice(p,p+l),v=s.mappedReg(r)?.at(0)?.startAddress,S={mappingValuesAst:h,target:a};if(e.nexusMapsTo.push(S),d&&v){let _=a.getNexusMapEntryMatch("interrupt",r,h,v);_?.match?S.mapItem=_.match:n.push(B(31,_.entry.rangeTokens,_.entry,{linkedTo:[d.ast]}))}h.every(_=>_ instanceof Ee)&&a.interrupControlerMapping.push({expressions:h,node:s,property:e}),p+=l}return n});return t.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."],t.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```"],t};var Dc=L(j());var QE=()=>{let t=new X("interrupts-extended",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=i.getProperty("interrupts");s&&n.push(B(15,s.ast.rangeTokens,s.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[s.name,"is ignored when 'interrupts-extended' is used"]}));let o=i.getProperty("interrupt-parent");o&&n.push(B(15,o.ast.rangeTokens,o.ast,{severity:Dc.DiagnosticSeverity.Warning,linkedTo:[e.ast],templateStrings:[o.name,"is ignored when 'interrupts-extended' is used"]}));let a=i.root,c=Oe(e.ast.values);if(!c?.length)return[];let l=0,u=0,d=[];for(;l<c.length;){let f=cn(c[l],a);if(!f)return n.push(B(17,c[l].rangeTokens,c[l])),n;let p=f.getProperty("#interrupt-cells");if(!p){n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...f.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",f.pathString]}));break}let g=qe(p,0,0,r);if(g==null)return n;let h=c.length-l-1;if(d.push([`${u}_phandle`,...Array.from({length:g},(P,C)=>`${u}_interrupt${g>1?C:""}`)]),g>h)return n.push(B(19,c.at(-1).rangeTokens,c.at(-1),{templateStrings:[e.name,`<${d.at(-1).join(" ")}>`]})),n;let v=c.slice(l+1,l+1+g),S=f.getProperty("interrupt-map"),_={mappingValuesAst:v,target:f};e.nexusMapsTo.push(_);let T=i.mappedReg(r)?.at(0)?.startAddress;if(S&&T){let P=f.getNexusMapEntryMatch("interrupt",r,v,T);P?.match?_.mapItem=P.match:n.push(B(31,P.entry.rangeTokens,P.entry,{linkedTo:[S.ast]}))}v.every(P=>P instanceof Ee)&&f.interrupControlerMapping.push({expressions:v,node:i,property:e}),l+=g+1,u++}return d.push([`${u}_phandle`,`${u}_interrupt...`]),t.signatureArgs=d.map(f=>f.map(p=>Dc.ParameterInformation.create(p))),n});return t.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."],t.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```"],t};var ZE=()=>{let t=new X("dma-noncoherent",z("EMPTY"));return t.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."],t};var ew=()=>{let t=new X("dma-coherent",z("EMPTY"));return t.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."],t};var tw=L(j());var rw=()=>{let t=new X("dma-ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>tw.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=Oe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(B(19,l.rangeTokens,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:i},()=>"length")].join(" ")}>`]}))}return n});return t.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)."],t};var Ac=L(j());var Pf=()=>{let t=new X("ranges",z(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent.sizeCells(r),s=e.parent.addressCells(r),o=e.parent.parentAddressCells(r),a=[...Array.from({length:s},(l,u)=>`child-bus-address${s>1?u:""}`),...Array.from({length:o},(l,u)=>`parent-bus-address${o>1?u:""}`),...Array.from({length:i},(l,u)=>`length${i>1?u:""}`)];t.signatureArgs=a.map(l=>Ac.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let c=Oe(e.ast.values);if(!c?.length)return[];if(c.length===0||c.length%(s+o+i)!==0){let l=c.at(c.length-c.length%(s+o+i))??e.ast;n.push(B(19,l.rangeTokens,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"child-bus-address"),...Array.from({length:o},()=>"parent-bus-address"),...Array.from({length:o},()=>"length")].join(" ")}>`]}))}return n.length===0&&e.parent.nodes.forEach(l=>{let u=l.getProperty("reg");u&&l.mappedReg(r)?.forEach(d=>{if(d.missingMapping){let f=l.parent?.getProperty("ranges");n.push(B(35,d.regRangeTokens,e.ast,{severity:Ac.DiagnosticSeverity.Warning,linkedTo:f?[f.ast]:[]}));return}!d?.mappingEnd||!d.mappedAst||d.inMappingRange||n.push(B(29,d.regRangeTokens,e.ast,{severity:Ac.DiagnosticSeverity.Warning,linkedTo:[d.mappedAst],templateStrings:[u.name,`0x${d.endAddress.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`,`0x${d.mappingEnd.map((f,p)=>f.toString(16).padStart(p?8:0,"0")).join("")}`]}))})}),n});return t.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."],t.examples=["Address Translation Example:",["```devicetree",`soc {
|
|
207
207
|
compatible = "simple-bus";
|
|
208
208
|
#address-cells = <1>;
|
|
209
209
|
#size-cells = <1>;
|
|
@@ -218,7 +218,7 @@ ${"".padEnd(ta(u[p].uri,f)*Go().length,Go())}${n}${d};`))})]}return[]}let o=bU(i
|
|
|
218
218
|
};
|
|
219
219
|
};`,"```"].join(`
|
|
220
220
|
`),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
|
|
221
|
-
`),"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."],t};var
|
|
221
|
+
`),"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."],t};var nw=()=>{let t=new X("virtual-reg",z("U32"));return t.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."],t};var iw=L(j());var sw=()=>{let t=new X("reg",z("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,r)=>{let n=[],i=e.parent.parentSizeCells(r),s=e.parent.parentAddressCells(r),o=[...Array.from({length:s},(l,u)=>`address${s>1?u:""}`),...Array.from({length:i},(l,u)=>`size${i>1?u:""}`)];t.signatureArgs=o.map(l=>iw.ParameterInformation.create(l)),t.signatureArgsCyclic=!0;let a=Oe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let l=a.at(a.length-a.length%(i+s))??e.ast;return n.push(B(19,l.rangeTokens,l,{templateStrings:[e.name,`<${[...Array.from({length:s},()=>"address"),...Array.from({length:i},()=>"size")].join(" ")}>`]})),n}let c=a.slice(0,s).map((l,u)=>qe(e,0,u,r)??0);if(e.parent.address&&rn(e.parent.address,c)!==0){let l=e.ast.values?.values.at(0)?.value?.values?.at(0),u=e.ast.values?.values.at(0)?.value?.values?.at(s-1),f=(l&&u?new Z(W(l.firstToken,u.lastToken)):void 0)??e.ast.values??e.ast;n.push(B(10,f.rangeTokens,f,{templateStrings:[e.name]}))}return n});return t.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```"],t};var kf=()=>new X("#size-cells",z("U32"),"optional",1);var Ef=()=>{let t=new X("#address-cells",z("U32"),"optional",2);return t.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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
|
|
222
222
|
#address-cells = <1>;
|
|
223
223
|
#size-cells = <1>;
|
|
224
224
|
serial@4600 {
|
|
@@ -229,8 +229,8 @@ ${"".padEnd(ta(u[p].uri,f)*Go().length,Go())}${n}${d};`))})]}return[]}let o=bU(i
|
|
|
229
229
|
interrupt-parent = <&ipic>;
|
|
230
230
|
};
|
|
231
231
|
};`,"```"].join(`
|
|
232
|
-
`),"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)."],t};var
|
|
233
|
-
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var
|
|
232
|
+
`),"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)."],t};var ow=()=>{let t=new X("status",z("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
|
|
233
|
+
The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var aw=()=>{let t=new X("phandle",z("U32"),"optional",void 0,void 0,(e,r)=>{let n=qe(e,0,0,r);if(n){let i=e.parent.root.getAllPhandle(n);if(i.length>1&&i.at(-1)===e.parent){let s=e.ast.values?.values.at(0)??e.ast;return[B(18,s.rangeTokens,s,{linkedTo:i.slice(0,-1).flatMap(o=>o.getProperty("phandle")?.ast).filter(o=>!!o),templateStrings:[e.name]})]}}return[]});return t.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."],t.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
|
|
234
234
|
phandle = <1>;
|
|
235
235
|
interrupt-controller;
|
|
236
236
|
reg = <0x10000000 0x100>;
|
|
@@ -238,70 +238,70 @@ ${"".padEnd(ta(u[p].uri,f)*Go().length,Go())}${n}${d};`))})]}return[]}let o=bU(i
|
|
|
238
238
|
`),"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 {
|
|
239
239
|
interrupt-parent = <1>;
|
|
240
240
|
};`,"```"].join(`
|
|
241
|
-
`)],t};var mk=()=>{let t=new J("model",W("STRING"));return t.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.'],t.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],t};var qf=M(F());var gk=()=>{let t=new J("name",W("STRING"),"optional",void 0,void 0,e=>[$(14,e.ast,qf.DiagnosticSeverity.Warning,[],[qf.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var In=M(F());var yk=()=>{let t=new J("interrupt-map",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=e.parent.root,o=Oe(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||n.push($(16,e.ast,In.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.pathString]));let c=i.getProperty("#interrupt-cells");if(!c)return n.push($(16,e.ast,In.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`])),n;let l=i.addressCells(r),u=qe(c,0,0,r),d={};if(u==null)return n;let f=0,p=[],y=0,h=0;for(;f<o.length;){if(p.push([...Array.from({length:l},(U,H)=>`${y}_ChildAddr${l>1?H:""}`),...Array.from({length:u},(U,H)=>`${y}_ChildIntrpt${u>1?H:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),f+l+u>=o.length){let U=f+l+u;n.push($(20,o[o.length-1],In.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%U===0?U:(o.length-h)%U).join(" ")}`]));break}let v=new j(G(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),S="";for(let U=f;U<l+u+f;U++){let H=o[U];S+=`${H instanceof we?H.evaluate(r).toString():H.toString()}:`}d[S]??=[],d[S].push(v),f+=l+u;let _=l+u+1;if(o.length<f+1){n.push($(20,o[o.length-1],In.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%_===0?_:(o.length-h)%_).join(" ")}`]));break}let T=ln(o[f],s);if(!T){n.push($(17,o[f],In.DiagnosticSeverity.Error));break}let R=T.addressCells(r),C=T.getProperty("#interrupt-cells");if(!C){n.push($(16,o[f],In.DiagnosticSeverity.Error,[...T.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]));break}f++;let B=qe(C,0,0,r);if(B==null)break;if(p.splice(-1,1,[...Array.from({length:l},(U,H)=>`${y}_ChildAddr${l>1?H:""}`),...Array.from({length:u},(U,H)=>`${y}_ChildIntrpt${u>1?H:""}`),`${y}_IntrptParent`,...Array.from({length:R},(U,H)=>`${y}_ParentAddr${R>1?H:""}`),...Array.from({length:B},(U,H)=>`${y}_ParentIntrpt${B>1?H:""}`)]),f+=R+B,o.length<f){let U=l+u+1+R+B;n.push($(20,o[o.length-1],In.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%U===0?U:(o.length-h)%U).join(" ")}`]));break}h=f,y++}if(p.push([...Array.from({length:l},(v,S)=>`${y}_ChildAddr${l>1?S:""}`),...Array.from({length:u},(v,S)=>`${y}_ChildIntrpt${u>1?S:""}`),`${y}_IntrptParent`,`${y}_ParentAddr...`,`${y}_ParentIntrpt...`]),t.signatureArgs=p.map(v=>v.map(S=>In.ParameterInformation.create(S))),!e.ast.values)return[];for(let v=0;v<e.ast.values.values.length;v++){let S=e.ast.values.values.at(v);if(S&&(n.length||u==null||!(S.value instanceof qt)))return n}return Object.values(d).forEach(v=>{v.length>1&&n.push($(30,v[v.length-1],In.DiagnosticSeverity.Error,v.slice(0,-1)))}),n});return t.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."],t};var vk;(function(t){function e(r){return typeof r=="string"}t.is=e})(vk||(vk={}));var Qy;(function(t){function e(r){return typeof r=="string"}t.is=e})(Qy||(Qy={}));var Tk;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Tk||(Tk={}));var Lf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Lf||(Lf={}));var Gr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Lf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Lf.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.line)&&I.uinteger(i.character)}t.is=r})(Gr||(Gr={}));var Dt;(function(t){function e(n,i,s,o){if(I.uinteger(n)&&I.uinteger(i)&&I.uinteger(s)&&I.uinteger(o))return{start:Gr.create(n,i),end:Gr.create(s,o)};if(Gr.is(n)&&Gr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${o}]`)}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Gr.is(i.start)&&Gr.is(i.end)}t.is=r})(Dt||(Dt={}));var $f;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(I.string(i.uri)||I.undefined(i.uri))}t.is=r})($f||($f={}));var bk;(function(t){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.targetRange)&&I.string(i.targetUri)&&Dt.is(i.targetSelectionRange)&&(Dt.is(i.originSelectionRange)||I.undefined(i.originSelectionRange))}t.is=r})(bk||(bk={}));var Zy;(function(t){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.numberRange(i.red,0,1)&&I.numberRange(i.green,0,1)&&I.numberRange(i.blue,0,1)&&I.numberRange(i.alpha,0,1)}t.is=r})(Zy||(Zy={}));var _k;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&Zy.is(i.color)}t.is=r})(_k||(_k={}));var Sk;(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.undefined(i.textEdit)||sa.is(i))&&(I.undefined(i.additionalTextEdits)||I.typedArray(i.additionalTextEdits,sa.is))}t.is=r})(Sk||(Sk={}));var Nk;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Nk||(Nk={}));var Pk;(function(t){function e(n,i,s,o,a,c){let l={startLine:n,endLine:i};return I.defined(s)&&(l.startCharacter=s),I.defined(o)&&(l.endCharacter=o),I.defined(a)&&(l.kind=a),I.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.startLine)&&I.uinteger(i.startLine)&&(I.undefined(i.startCharacter)||I.uinteger(i.startCharacter))&&(I.undefined(i.endCharacter)||I.uinteger(i.endCharacter))&&(I.undefined(i.kind)||I.string(i.kind))}t.is=r})(Pk||(Pk={}));var ev;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&$f.is(i.location)&&I.string(i.message)}t.is=r})(ev||(ev={}));var xr;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(xr||(xr={}));var Rk;(function(t){t.Unnecessary=1,t.Deprecated=2})(Rk||(Rk={}));var Ek;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&I.string(n.href)}t.is=e})(Ek||(Ek={}));var Bf;(function(t){function e(n,i,s,o,a,c){let l={range:n,message:i};return I.defined(s)&&(l.severity=s),I.defined(o)&&(l.code=o),I.defined(a)&&(l.source=a),I.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let s=n;return I.defined(s)&&Dt.is(s.range)&&I.string(s.message)&&(I.number(s.severity)||I.undefined(s.severity))&&(I.integer(s.code)||I.string(s.code)||I.undefined(s.code))&&(I.undefined(s.codeDescription)||I.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(I.string(s.source)||I.undefined(s.source))&&(I.undefined(s.relatedInformation)||I.typedArray(s.relatedInformation,ev.is))}t.is=r})(Bf||(Bf={}));var ia;(function(t){function e(n,i,...s){let o={title:n,command:i};return I.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.title)&&I.string(i.command)}t.is=r})(ia||(ia={}));var sa;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function r(s,o){return{range:{start:s,end:s},newText:o}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let o=s;return I.objectLiteral(o)&&I.string(o.newText)&&Dt.is(o.range)}t.is=i})(sa||(sa={}));var tv;(function(t){function e(n,i,s){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(I.string(i.description)||i.description===void 0)}t.is=r})(tv||(tv={}));var oa;(function(t){function e(r){let n=r;return I.string(n)}t.is=e})(oa||(oa={}));var wk;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function r(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}t.del=n;function i(s){let o=s;return sa.is(o)&&(tv.is(o.annotationId)||oa.is(o.annotationId))}t.is=i})(wk||(wk={}));var rv;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&av.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(rv||(rv={}));var nv;(function(t){function e(n,i,s){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&I.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||oa.is(i.annotationId))}t.is=r})(nv||(nv={}));var iv;(function(t){function e(n,i,s,o){let a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&I.string(i.oldUri)&&I.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||oa.is(i.annotationId))}t.is=r})(iv||(iv={}));var sv;(function(t){function e(n,i,s){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&I.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||I.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||I.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||oa.is(i.annotationId))}t.is=r})(sv||(sv={}));var ov;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>I.string(i.kind)?nv.is(i)||iv.is(i)||sv.is(i):rv.is(i)))}t.is=e})(ov||(ov={}));var kk;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)}t.is=r})(kk||(kk={}));var Ck;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.integer(i.version)}t.is=r})(Ck||(Ck={}));var av;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&(i.version===null||I.integer(i.version))}t.is=r})(av||(av={}));var Dk;(function(t){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.string(i.languageId)&&I.integer(i.version)&&I.string(i.text)}t.is=r})(Dk||(Dk={}));var is;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(is||(is={}));var Fc;(function(t){function e(r){let n=r;return I.objectLiteral(r)&&is.is(n.kind)&&I.string(n.value)}t.is=e})(Fc||(Fc={}));var Ak;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ak||(Ak={}));var Ik;(function(t){t.PlainText=1,t.Snippet=2})(Ik||(Ik={}));var Ok;(function(t){t.Deprecated=1})(Ok||(Ok={}));var xk;(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&I.string(i.newText)&&Dt.is(i.insert)&&Dt.is(i.replace)}t.is=r})(xk||(xk={}));var Mk;(function(t){t.asIs=1,t.adjustIndentation=2})(Mk||(Mk={}));var qk;(function(t){function e(r){let n=r;return n&&(I.string(n.detail)||n.detail===void 0)&&(I.string(n.description)||n.description===void 0)}t.is=e})(qk||(qk={}));var Lk;(function(t){function e(r){return{label:r}}t.create=e})(Lk||(Lk={}));var $k;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})($k||($k={}));var Ff;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return I.string(i)||I.objectLiteral(i)&&I.string(i.language)&&I.string(i.value)}t.is=r})(Ff||(Ff={}));var Bk;(function(t){function e(r){let n=r;return!!n&&I.objectLiteral(n)&&(Fc.is(n.contents)||Ff.is(n.contents)||I.typedArray(n.contents,Ff.is))&&(r.range===void 0||Dt.is(r.range))}t.is=e})(Bk||(Bk={}));var Mr;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Mr||(Mr={}));var Fk;(function(t){function e(r,n,...i){let s={label:r};return I.defined(n)&&(s.documentation=n),I.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(Fk||(Fk={}));var jk;(function(t){t.Text=1,t.Read=2,t.Write=3})(jk||(jk={}));var Uk;(function(t){function e(r,n){let i={range:r};return I.number(n)&&(i.kind=n),i}t.create=e})(Uk||(Uk={}));var Hk;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Hk||(Hk={}));var Vk;(function(t){t.Deprecated=1})(Vk||(Vk={}));var zk;(function(t){function e(r,n,i,s,o){let a={name:r,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(zk||(zk={}));var Wk;(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(Wk||(Wk={}));var Gk;(function(t){function e(n,i,s,o,a,c){let l={name:n,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&I.string(i.name)&&I.number(i.kind)&&Dt.is(i.range)&&Dt.is(i.selectionRange)&&(i.detail===void 0||I.string(i.detail))&&(i.deprecated===void 0||I.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Gk||(Gk={}));var Yk;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Yk||(Yk={}));var jf;(function(t){t.Invoked=1,t.Automatic=2})(jf||(jf={}));var Kk;(function(t){function e(n,i,s){let o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.typedArray(i.diagnostics,Bf.is)&&(i.only===void 0||I.typedArray(i.only,I.string))&&(i.triggerKind===void 0||i.triggerKind===jf.Invoked||i.triggerKind===jf.Automatic)}t.is=r})(Kk||(Kk={}));var Xk;(function(t){function e(n,i,s){let o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):ia.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return i&&I.string(i.title)&&(i.diagnostics===void 0||I.typedArray(i.diagnostics,Bf.is))&&(i.kind===void 0||I.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ia.is(i.command))&&(i.isPreferred===void 0||I.boolean(i.isPreferred))&&(i.edit===void 0||ov.is(i.edit))}t.is=r})(Xk||(Xk={}));var Jk;(function(t){function e(n,i){let s={range:n};return I.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.command)||ia.is(i.command))}t.is=r})(Jk||(Jk={}));var Qk;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.uinteger(i.tabSize)&&I.boolean(i.insertSpaces)}t.is=r})(Qk||(Qk={}));var Zk;(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.target)||I.string(i.target))}t.is=r})(Zk||(Zk={}));var eC;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(eC||(eC={}));var tC;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(tC||(tC={}));var rC;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(rC||(rC={}));var nC;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(nC||(nC={}));var iC;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.string(i.text)}t.is=r})(iC||(iC={}));var sC;(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.boolean(i.caseSensitiveLookup)&&(I.string(i.variableName)||i.variableName===void 0)}t.is=r})(sC||(sC={}));var oC;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&(I.string(i.expression)||i.expression===void 0)}t.is=r})(oC||(oC={}));var aC;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(n.stoppedLocation)}t.is=r})(aC||(aC={}));var cv;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(cv||(cv={}));var lv;(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&(i.tooltip===void 0||I.string(i.tooltip)||Fc.is(i.tooltip))&&(i.location===void 0||$f.is(i.location))&&(i.command===void 0||ia.is(i.command))}t.is=r})(lv||(lv={}));var cC;(function(t){function e(n,i,s){let o={position:n,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Gr.is(i.position)&&(I.string(i.label)||I.typedArray(i.label,lv.is))&&(i.kind===void 0||cv.is(i.kind))&&i.textEdits===void 0||I.typedArray(i.textEdits,sa.is)&&(i.tooltip===void 0||I.string(i.tooltip)||Fc.is(i.tooltip))&&(i.paddingLeft===void 0||I.boolean(i.paddingLeft))&&(i.paddingRight===void 0||I.boolean(i.paddingRight))}t.is=r})(cC||(cC={}));var lC;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(lC||(lC={}));var uC;(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(uC||(uC={}));var dC;(function(t){function e(r){return{items:r}}t.create=e})(dC||(dC={}));var fC;(function(t){t.Invoked=0,t.Automatic=1})(fC||(fC={}));var pC;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(pC||(pC={}));var hC;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(hC||(hC={}));var mC;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&Qy.is(n.uri)&&I.string(n.name)}t.is=e})(mC||(mC={}));var gC;(function(t){function e(s,o,a,c){return new uv(s,o,a,c)}t.create=e;function r(s){let o=s;return!!(I.defined(o)&&I.string(o.uri)&&(I.undefined(o.languageId)||I.string(o.languageId))&&I.uinteger(o.lineCount)&&I.func(o.getText)&&I.func(o.positionAt)&&I.func(o.offsetAt))}t.is=r;function n(s,o){let a=s.getText(),c=i(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=l)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=n;function i(s,o){if(s.length<=1)return s;let a=s.length/2|0,c=s.slice(0,a),l=s.slice(a);i(c,o),i(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?s[f++]=c[u++]:s[f++]=l[d++];for(;u<c.length;)s[f++]=c[u++];for(;d<l.length;)s[f++]=l[d++];return s}})(gC||(gC={}));var uv=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
|
|
241
|
+
`)],t};var cw=()=>{let t=new X("model",z("STRING"));return t.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.'],t.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],t};var wf=L(j());var lw=()=>{let t=new X("name",z("STRING"),"optional",void 0,void 0,e=>[B(14,e.ast.rangeTokens,e.ast,{severity:wf.DiagnosticSeverity.Warning,tags:[wf.DiagnosticTag.Deprecated],templateStrings:[e.name]})]);return t.hideAutoComplete=!0,t};var uw=L(j());var dw=()=>{let t=new X("interrupt-map",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=e.parent.root,o=Oe(e.ast.values);if(!o?.length)return[];i.getProperty("#address-cells")||n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...e.parent.nodeNameOrLabelRef],templateStrings:[e.name,"#address-cells",i.pathString]}));let c=i.getProperty("#interrupt-cells");if(!c)return n.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...i.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]})),n;let l=i.addressCells(r),u=qe(c,0,0,r),d={};if(u==null)return n;let f=0,p=[],g=0,h=0;for(;f<o.length;){if(p.push([...Array.from({length:l},(F,U)=>`${g}_ChildAddr${l>1?U:""}`),...Array.from({length:u},(F,U)=>`${g}_ChildIntrpt${u>1?U:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),f+l+u>=o.length){let F=f+l+u;n.push(B(20,o[o.length-1].rangeTokens,o[o.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%F===0?F:(o.length-h)%F).join(" ")}`]}));break}let v=new Z(W(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),S="";for(let F=f;F<l+u+f;F++){let U=o[F];S+=`${U instanceof Ee?U.evaluate(r).toString():U.toString()}:`}d[S]??=[],d[S].push(v),f+=l+u;let _=l+u+1;if(o.length<f+1){n.push(B(20,o[o.length-1].rangeTokens,o[o.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%_===0?_:(o.length-h)%_).join(" ")}`]}));break}let T=cn(o[f],s);if(!T){n.push(B(17,o[f].rangeTokens,o[f]));break}let P=T.addressCells(r),C=T.getProperty("#interrupt-cells");if(!C){n.push(B(16,o[f].rangeTokens,o[f],{linkedTo:[...T.nodeNameOrLabelRef],templateStrings:[e.name,"#interrupt-cells",`/${i.path.slice(1).join("/")}`]}));break}f++;let $=qe(C,0,0,r);if($==null)break;if(p.splice(-1,1,[...Array.from({length:l},(F,U)=>`${g}_ChildAddr${l>1?U:""}`),...Array.from({length:u},(F,U)=>`${g}_ChildIntrpt${u>1?U:""}`),`${g}_IntrptParent`,...Array.from({length:P},(F,U)=>`${g}_ParentAddr${P>1?U:""}`),...Array.from({length:$},(F,U)=>`${g}_ParentIntrpt${$>1?U:""}`)]),f+=P+$,o.length<f){let F=l+u+1+P+$;n.push(B(20,o[o.length-1].rangeTokens,o[o.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((o.length-h)%F===0?F:(o.length-h)%F).join(" ")}`]}));break}h=f,g++}if(p.push([...Array.from({length:l},(v,S)=>`${g}_ChildAddr${l>1?S:""}`),...Array.from({length:u},(v,S)=>`${g}_ChildIntrpt${u>1?S:""}`),`${g}_IntrptParent`,`${g}_ParentAddr...`,`${g}_ParentIntrpt...`]),t.signatureArgs=p.map(v=>v.map(S=>uw.ParameterInformation.create(S))),!e.ast.values)return[];for(let v=0;v<e.ast.values.values.length;v++){let S=e.ast.values.values.at(v);if(S&&(n.length||u==null||!(S.value instanceof Lt)))return n}return Object.values(d).forEach(v=>{v.length>1&&n.push(B(30,v[v.length-1].rangeTokens,v[v.length-1],{linkedTo:v.slice(0,-1)}))}),n});return t.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."],t};var fw;(function(t){function e(r){return typeof r=="string"}t.is=e})(fw||(fw={}));var Vy;(function(t){function e(r){return typeof r=="string"}t.is=e})(Vy||(Vy={}));var pw;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(pw||(pw={}));var Cf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Cf||(Cf={}));var zr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Cf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Cf.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.line)&&I.uinteger(i.character)}t.is=r})(zr||(zr={}));var Dt;(function(t){function e(n,i,s,o){if(I.uinteger(n)&&I.uinteger(i)&&I.uinteger(s)&&I.uinteger(o))return{start:zr.create(n,i),end:zr.create(s,o)};if(zr.is(n)&&zr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${s}, ${o}]`)}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&zr.is(i.start)&&zr.is(i.end)}t.is=r})(Dt||(Dt={}));var Df;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(I.string(i.uri)||I.undefined(i.uri))}t.is=r})(Df||(Df={}));var hw;(function(t){function e(n,i,s,o){return{targetUri:n,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.targetRange)&&I.string(i.targetUri)&&Dt.is(i.targetSelectionRange)&&(Dt.is(i.originSelectionRange)||I.undefined(i.originSelectionRange))}t.is=r})(hw||(hw={}));var zy;(function(t){function e(n,i,s,o){return{red:n,green:i,blue:s,alpha:o}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.numberRange(i.red,0,1)&&I.numberRange(i.green,0,1)&&I.numberRange(i.blue,0,1)&&I.numberRange(i.alpha,0,1)}t.is=r})(zy||(zy={}));var mw;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&zy.is(i.color)}t.is=r})(mw||(mw={}));var gw;(function(t){function e(n,i,s){return{label:n,textEdit:i,additionalTextEdits:s}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.undefined(i.textEdit)||Qo.is(i))&&(I.undefined(i.additionalTextEdits)||I.typedArray(i.additionalTextEdits,Qo.is))}t.is=r})(gw||(gw={}));var yw;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(yw||(yw={}));var vw;(function(t){function e(n,i,s,o,a,c){let l={startLine:n,endLine:i};return I.defined(s)&&(l.startCharacter=s),I.defined(o)&&(l.endCharacter=o),I.defined(a)&&(l.kind=a),I.defined(c)&&(l.collapsedText=c),l}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.uinteger(i.startLine)&&I.uinteger(i.startLine)&&(I.undefined(i.startCharacter)||I.uinteger(i.startCharacter))&&(I.undefined(i.endCharacter)||I.uinteger(i.endCharacter))&&(I.undefined(i.kind)||I.string(i.kind))}t.is=r})(vw||(vw={}));var Wy;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Df.is(i.location)&&I.string(i.message)}t.is=r})(Wy||(Wy={}));var Tw;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Tw||(Tw={}));var bw;(function(t){t.Unnecessary=1,t.Deprecated=2})(bw||(bw={}));var _w;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&I.string(n.href)}t.is=e})(_w||(_w={}));var Af;(function(t){function e(n,i,s,o,a,c){let l={range:n,message:i};return I.defined(s)&&(l.severity=s),I.defined(o)&&(l.code=o),I.defined(a)&&(l.source=a),I.defined(c)&&(l.relatedInformation=c),l}t.create=e;function r(n){var i;let s=n;return I.defined(s)&&Dt.is(s.range)&&I.string(s.message)&&(I.number(s.severity)||I.undefined(s.severity))&&(I.integer(s.code)||I.string(s.code)||I.undefined(s.code))&&(I.undefined(s.codeDescription)||I.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(I.string(s.source)||I.undefined(s.source))&&(I.undefined(s.relatedInformation)||I.typedArray(s.relatedInformation,Wy.is))}t.is=r})(Af||(Af={}));var Jo;(function(t){function e(n,i,...s){let o={title:n,command:i};return I.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.title)&&I.string(i.command)}t.is=r})(Jo||(Jo={}));var Qo;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function r(s,o){return{range:{start:s,end:s},newText:o}}t.insert=r;function n(s){return{range:s,newText:""}}t.del=n;function i(s){let o=s;return I.objectLiteral(o)&&I.string(o.newText)&&Dt.is(o.range)}t.is=i})(Qo||(Qo={}));var Gy;(function(t){function e(n,i,s){let o={label:n};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&I.string(i.label)&&(I.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(I.string(i.description)||i.description===void 0)}t.is=r})(Gy||(Gy={}));var Zo;(function(t){function e(r){let n=r;return I.string(n)}t.is=e})(Zo||(Zo={}));var Sw;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function r(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}t.del=n;function i(s){let o=s;return Qo.is(o)&&(Gy.is(o.annotationId)||Zo.is(o.annotationId))}t.is=i})(Sw||(Sw={}));var Yy;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Zy.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(Yy||(Yy={}));var Ky;(function(t){function e(n,i,s){let o={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&I.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Zo.is(i.annotationId))}t.is=r})(Ky||(Ky={}));var Xy;(function(t){function e(n,i,s,o){let a={kind:"rename",oldUri:n,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&I.string(i.oldUri)&&I.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||I.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||I.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Zo.is(i.annotationId))}t.is=r})(Xy||(Xy={}));var Jy;(function(t){function e(n,i,s){let o={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&I.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||I.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||I.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Zo.is(i.annotationId))}t.is=r})(Jy||(Jy={}));var Qy;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>I.string(i.kind)?Ky.is(i)||Xy.is(i)||Jy.is(i):Yy.is(i)))}t.is=e})(Qy||(Qy={}));var Nw;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)}t.is=r})(Nw||(Nw={}));var Rw;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.integer(i.version)}t.is=r})(Rw||(Rw={}));var Zy;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&(i.version===null||I.integer(i.version))}t.is=r})(Zy||(Zy={}));var Pw;(function(t){function e(n,i,s,o){return{uri:n,languageId:i,version:s,text:o}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.string(i.uri)&&I.string(i.languageId)&&I.integer(i.version)&&I.string(i.text)}t.is=r})(Pw||(Pw={}));var ts;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(ts||(ts={}));var Ic;(function(t){function e(r){let n=r;return I.objectLiteral(r)&&ts.is(n.kind)&&I.string(n.value)}t.is=e})(Ic||(Ic={}));var kw;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(kw||(kw={}));var Ew;(function(t){t.PlainText=1,t.Snippet=2})(Ew||(Ew={}));var ww;(function(t){t.Deprecated=1})(ww||(ww={}));var Cw;(function(t){function e(n,i,s){return{newText:n,insert:i,replace:s}}t.create=e;function r(n){let i=n;return i&&I.string(i.newText)&&Dt.is(i.insert)&&Dt.is(i.replace)}t.is=r})(Cw||(Cw={}));var Dw;(function(t){t.asIs=1,t.adjustIndentation=2})(Dw||(Dw={}));var Aw;(function(t){function e(r){let n=r;return n&&(I.string(n.detail)||n.detail===void 0)&&(I.string(n.description)||n.description===void 0)}t.is=e})(Aw||(Aw={}));var Iw;(function(t){function e(r){return{label:r}}t.create=e})(Iw||(Iw={}));var Ow;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Ow||(Ow={}));var If;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){let i=n;return I.string(i)||I.objectLiteral(i)&&I.string(i.language)&&I.string(i.value)}t.is=r})(If||(If={}));var xw;(function(t){function e(r){let n=r;return!!n&&I.objectLiteral(n)&&(Ic.is(n.contents)||If.is(n.contents)||I.typedArray(n.contents,If.is))&&(r.range===void 0||Dt.is(r.range))}t.is=e})(xw||(xw={}));var Ir;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Ir||(Ir={}));var Mw;(function(t){function e(r,n,...i){let s={label:r};return I.defined(n)&&(s.documentation=n),I.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(Mw||(Mw={}));var qw;(function(t){t.Text=1,t.Read=2,t.Write=3})(qw||(qw={}));var Lw;(function(t){function e(r,n){let i={range:r};return I.number(n)&&(i.kind=n),i}t.create=e})(Lw||(Lw={}));var $w;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})($w||($w={}));var Bw;(function(t){t.Deprecated=1})(Bw||(Bw={}));var Fw;(function(t){function e(r,n,i,s,o){let a={name:r,kind:n,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(Fw||(Fw={}));var jw;(function(t){function e(r,n,i,s){return s!==void 0?{name:r,kind:n,location:{uri:i,range:s}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(jw||(jw={}));var Uw;(function(t){function e(n,i,s,o,a,c){let l={name:n,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function r(n){let i=n;return i&&I.string(i.name)&&I.number(i.kind)&&Dt.is(i.range)&&Dt.is(i.selectionRange)&&(i.detail===void 0||I.string(i.detail))&&(i.deprecated===void 0||I.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Uw||(Uw={}));var Hw;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Hw||(Hw={}));var Of;(function(t){t.Invoked=1,t.Automatic=2})(Of||(Of={}));var Vw;(function(t){function e(n,i,s){let o={diagnostics:n};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function r(n){let i=n;return I.defined(i)&&I.typedArray(i.diagnostics,Af.is)&&(i.only===void 0||I.typedArray(i.only,I.string))&&(i.triggerKind===void 0||i.triggerKind===Of.Invoked||i.triggerKind===Of.Automatic)}t.is=r})(Vw||(Vw={}));var zw;(function(t){function e(n,i,s){let o={title:n},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Jo.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return i&&I.string(i.title)&&(i.diagnostics===void 0||I.typedArray(i.diagnostics,Af.is))&&(i.kind===void 0||I.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Jo.is(i.command))&&(i.isPreferred===void 0||I.boolean(i.isPreferred))&&(i.edit===void 0||Qy.is(i.edit))}t.is=r})(zw||(zw={}));var Ww;(function(t){function e(n,i){let s={range:n};return I.defined(i)&&(s.data=i),s}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.command)||Jo.is(i.command))}t.is=r})(Ww||(Ww={}));var Gw;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&I.uinteger(i.tabSize)&&I.boolean(i.insertSpaces)}t.is=r})(Gw||(Gw={}));var Yw;(function(t){function e(n,i,s){return{range:n,target:i,data:s}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(i.range)&&(I.undefined(i.target)||I.string(i.target))}t.is=r})(Yw||(Yw={}));var Kw;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&Dt.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Kw||(Kw={}));var Xw;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Xw||(Xw={}));var Jw;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Jw||(Jw={}));var Qw;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(Qw||(Qw={}));var Zw;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.string(i.text)}t.is=r})(Zw||(Zw={}));var eC;(function(t){function e(n,i,s){return{range:n,variableName:i,caseSensitiveLookup:s}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&I.boolean(i.caseSensitiveLookup)&&(I.string(i.variableName)||i.variableName===void 0)}t.is=r})(eC||(eC={}));var tC;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){let i=n;return i!=null&&Dt.is(i.range)&&(I.string(i.expression)||i.expression===void 0)}t.is=r})(tC||(tC={}));var rC;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){let i=n;return I.defined(i)&&Dt.is(n.stoppedLocation)}t.is=r})(rC||(rC={}));var ev;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(ev||(ev={}));var tv;(function(t){function e(n){return{value:n}}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&(i.tooltip===void 0||I.string(i.tooltip)||Ic.is(i.tooltip))&&(i.location===void 0||Df.is(i.location))&&(i.command===void 0||Jo.is(i.command))}t.is=r})(tv||(tv={}));var nC;(function(t){function e(n,i,s){let o={position:n,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function r(n){let i=n;return I.objectLiteral(i)&&zr.is(i.position)&&(I.string(i.label)||I.typedArray(i.label,tv.is))&&(i.kind===void 0||ev.is(i.kind))&&i.textEdits===void 0||I.typedArray(i.textEdits,Qo.is)&&(i.tooltip===void 0||I.string(i.tooltip)||Ic.is(i.tooltip))&&(i.paddingLeft===void 0||I.boolean(i.paddingLeft))&&(i.paddingRight===void 0||I.boolean(i.paddingRight))}t.is=r})(nC||(nC={}));var iC;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(iC||(iC={}));var sC;(function(t){function e(r,n,i,s){return{insertText:r,filterText:n,range:i,command:s}}t.create=e})(sC||(sC={}));var oC;(function(t){function e(r){return{items:r}}t.create=e})(oC||(oC={}));var aC;(function(t){t.Invoked=0,t.Automatic=1})(aC||(aC={}));var cC;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(cC||(cC={}));var lC;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(lC||(lC={}));var uC;(function(t){function e(r){let n=r;return I.objectLiteral(n)&&Vy.is(n.uri)&&I.string(n.name)}t.is=e})(uC||(uC={}));var dC;(function(t){function e(s,o,a,c){return new rv(s,o,a,c)}t.create=e;function r(s){let o=s;return!!(I.defined(o)&&I.string(o.uri)&&(I.undefined(o.languageId)||I.string(o.languageId))&&I.uinteger(o.lineCount)&&I.func(o.getText)&&I.func(o.positionAt)&&I.func(o.offsetAt))}t.is=r;function n(s,o){let a=s.getText(),c=i(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=l)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=n;function i(s,o){if(s.length<=1)return s;let a=s.length/2|0,c=s.slice(0,a),l=s.slice(a);i(c,o),i(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?s[f++]=c[u++]:s[f++]=l[d++];for(;u<c.length;)s[f++]=c[u++];for(;d<l.length;)s[f++]=l[d++];return s}})(dC||(dC={}));var rv=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let s=r.charAt(i);n=s==="\r"||s===`
|
|
242
242
|
`,s==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
|
243
|
-
`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return
|
|
244
|
-
rialnumber.`],t};function
|
|
243
|
+
`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return zr.create(0,e);for(;n<i;){let o=Math.floor((n+i)/2);r[o]>e?i=o:n=o+1}let s=n-1;return zr.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}},I;(function(t){let e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,g,h){return e.call(p)==="[object Number]"&&g<=p&&p<=h}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function l(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=l;function u(p){return e.call(p)==="[object Function]"}t.func=u;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,g){return Array.isArray(p)&&p.every(g)}t.typedArray=f})(I||(I={}));var fC=()=>{let t=new X("interrupt-map-mask",z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=Oe(e.ast.values);if(!s?.length)return[];let o=i.getProperty("#interrupt-cells");if(!o)return n;let a=i.addressCells(r),c=qe(o,0,0,r);if(c==null)return n;let l=[...Array.from({length:a},(u,d)=>`AddressMask${a>1?d:""}`),...Array.from({length:c},(u,d)=>`InterruptMask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Ir.create(u)),s.length!==a+c){let u=e.ast.values??e.ast;return n.push(B(19,u.rangeTokens,u,{templateStrings:[e.name,`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}>`]})),n}return n});return t.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."],t};var pC=L(j());var hC=()=>{let t=new X(/^(?!interrupt-|no-).*?-map$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=e.name.split("-map",1)[0],i=[],s=e.parent,o=e.parent.root,a=s.getProperty(`#${n}-cells`);if(!a)return i.push(B(16,e.ast.rangeTokens,e.ast,{linkedTo:[...s.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i;let c=qe(a,0,0,r);if(c==null)return i;let l=Oe(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,p=[],g=0;for(;d<l.length;){if(p.push([...Array.from({length:c},(P,C)=>`${g}_Interrupt${c>1?C:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),d+c>=l.length){let P=d+c;i.push(B(20,l[l.length-1].rangeTokens,l[l.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%P===0?P:(l.length-f)%P).join(" ")}`]}));break}let h=new Z(W(l.at(d).firstToken,l.at(c+d-1)?.lastToken)),v="";for(let P=d;P<c+d;P++){let C=l[P];v+=`${C instanceof Ee?C.evaluate(r).toString():C.toString()}:`}if(u[v]??=[],u[v].push(h),d+=c,l.length<d+1){let P=c+1;i.push(B(20,l[l.length-1].rangeTokens,l[l.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%P===0?P:(l.length-f)%P).join(" ")}`]}));break}let S=cn(l[d],o);if(!S){i.push(B(17,l[d].rangeTokens,l[d]));break}let _=S.getProperty(`#${n}-cells`);if(!_)return i.push(B(16,l[d].rangeTokens,l[d],{linkedTo:[...S.nodeNameOrLabelRef],templateStrings:[e.name,`#${n}-cells`,`/${s.path.slice(1).join("/")}`]})),i;d++;let T=qe(_,0,0,r);if(T==null)break;if(p.splice(-1,1,[...Array.from({length:c},(P,C)=>`${g}_ChildSpecifier${c>1?C:""}`),`${g}_SpecifierParent`,...Array.from({length:T},(P,C)=>`${g}_ParentSpecifier${T>1?C:""}`)]),d+=T,l.length<d){let P=c+1+T;i.push(B(20,l[l.length-1].rangeTokens,l[l.length-1],{templateStrings:[e.name,`after the last value of ${p.at(-1).slice((l.length-f)%P===0?P:(l.length-f)%P).join(" ")}`]}));break}f=d,g++}return p.push([...Array.from({length:c},(h,v)=>`${g}_Interrupt${c>1?v:""}`),`${g}_SpecifierParent`,`${g}_ParentSpecifier...`]),t.signatureArgs=p.map(h=>h.map(v=>pC.ParameterInformation.create(v))),Object.values(u).forEach(h=>{h.length>1&&i.push(B(30,h[h.length-1].rangeTokens,h[h.length-1],{linkedTo:h.slice(0,-1)}))}),i});return t.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."],t.list=!0,t};var mC=()=>{let t=new X(/^(?!interrupt-).*?-map-mask$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=Oe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=qe(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Ir.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(B(19,u.rangeTokens,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.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."],t};var gC=()=>{let t=new X(/^(?!interrupt-).*?-map-pass-thru$/,z("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,r)=>{let n=[],i=e.parent,s=Oe(e.ast.values);if(!s?.length)return[];let o=e.name.split("-map",1)[0],a=i.getProperty(`#${o}-cells`);if(!a)return n;let c=qe(a,0,0,r);if(c==null)return n;let l=[...Array.from({length:c},(u,d)=>`mask${c>1?d:""}`)];if(t.signatureArgs=l.map(u=>Ir.create(u)),s.length!==c){let u=e.ast.values??e.ast;return n.push(B(19,u.rangeTokens,u,{templateStrings:[e.name,`<${[...Array.from({length:c},()=>"mask")].join(" ")}>`]})),n}return n});return t.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."],t};var yC=()=>{let t=new X(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,z("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function lr(){let t=new Nt;return t.addProperty([zE(),cw(),aw(),ow(),Ef(),kf(),sw(),nw(),Pf(),rw(),ew(),ZE(),lw(),WE(),JE(),KE(),QE(),GE(),YE(),dw(),fC(),hC(),mC(),gC(),yC()]),t}var vC=()=>{let t=new X("chassis-type",z("STRING"),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return t.description=["Specifies a string that identifies the form-factor of the system."],t};var TC=()=>{let t=new X("serial-number",z("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
|
|
244
|
+
rialnumber.`],t};function bC(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(s=>s.name==="#size-cells");r.required=()=>"required";let n=t.properties.find(s=>s.name==="model");n.required=()=>"required";let i=t.properties.find(s=>s.name==="compatible");return i.required=()=>"required",t.addProperty([vC(),TC()]),t}var _C=L(j());function SC(){let t=new Nt((r,n)=>{let i=[];return n.parent?.name!=="/"&&i.push(B(26,n.definitions[0].rangeTokens,n.definitions[0],{linkedTo:n.definitions.slice(1),templateStrings:["Aliases node can only be added to a root node"]})),n.nodes.forEach(s=>{s.definitions.forEach(o=>{i.push(B(26,o.tokenIndexes,o,{templateStrings:["Aliases node can not have child nodes"],edit:_C.TextEdit.del(Hr(o.firstToken.prevToken,o.lastToken,!1)),codeActionTitle:"Delete Node"}))})}),i});t.noMismatchPropertiesAllowed=!0;let e=new X(/^[-A-Za-z0-9]+$/,z(["STRING","U32"]),void 0,void 0,void 0,r=>{let n=[],i=r.ast.quickValues;if(i?.length===1&&typeof i[0]=="string"){let s=r.ast.values??r.ast;if(!i[0].startsWith("/"))return n.push(B(23,s.rangeTokens,s,{templateStrings:[i[0],r.name]})),n;if(i[0].trim().endsWith("/"))return n.push(B(23,s.rangeTokens,s,{templateStrings:["",i[0]]})),n;let o=r.parent.root,a=i[0].split("/").slice(1);for(;a[0];){let c=o,l=a.splice(0,1)[0],[u,d]=l.split("@"),f=d?.split(",").map(p=>Number.parseInt(p,16));if(o=u?c.getNode(u,f,!1):void 0,!o){n.push(B(23,s.rangeTokens,s,{templateStrings:[u,c.fullName]}));break}}}return n});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function NC(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(r=>r.name==="reg");return e.required=()=>"required",t}var RC=(t,e,r)=>{let n=t?.(e,r)??[],i=e.parent.root.getProperty(e.name),s=i?qe(i,0,0,r):void 0,o=e.parent.getProperty(e.name);return(o?qe(o,0,0,r):void 0)!==s&&n.push(B(28,e.ast.rangeTokens,e.ast,{linkedTo:[...i?.ast?[i.ast]:[]],templateStrings:[`${e.name} value in this node must match value of root node`]})),n};function PC(){let t=new Nt;t.noMismatchPropertiesAllowed=!0;let e=Ef(),r=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>RC(r,o,a),e.required=()=>"required";let n=kf(),i=n?.additionalTypeCheck;n.additionalTypeCheck=(o,a)=>RC(i,o,a),n.required=()=>"required";let s=Pf();return s.required=()=>"required",s.type=z("EMPTY"),s.additionalTypeCheck=void 0,t.addProperty([e,n,s]),t}function kC(){let t=lr();t.additionalValidations=(i,s)=>{let o=[];return s.parent?.name!=="/"&&o.push(B(26,s.definitions[0].rangeTokens,s.definitions[0],{linkedTo:s.definitions.slice(1),templateStrings:["Chosen node can only be added to a root node"]})),o};let e=new X("bootargs",z("STRING"));e.description=[`A string that specifies the boot arguments for
|
|
245
245
|
theclientprogram. Thevaluecouldpotentially
|
|
246
246
|
be a null string if no boot arguments are re-
|
|
247
|
-
quired.`];let r=new
|
|
247
|
+
quired.`];let r=new X("stdout-path ",z("STRING"));r.description=[`A string that specifies the full path to the node
|
|
248
248
|
representingthedevicetobeusedforbootcon-
|
|
249
249
|
soleoutput. Ifthecharacter\u201C:\u201Dispresentinthe
|
|
250
250
|
valueit terminates thepath. Thevalue maybe
|
|
251
251
|
an alias. If the stdin-path property is not spec-
|
|
252
252
|
ified, stdout-path should be assumed to define
|
|
253
|
-
theinput device.`];let n=new
|
|
253
|
+
theinput device.`];let n=new X("stdin-path ",z("STRING"));return n.description=[`A string that specifies the boot arguments for
|
|
254
254
|
theclientprogram. Thevaluecouldpotentially
|
|
255
255
|
be a null string if no boot arguments are re-
|
|
256
|
-
quired.`],t.addProperty([e,r,n]),t}
|
|
256
|
+
quired.`],t.addProperty([e,r,n]),t}function EC(){let t=lr();t.additionalValidations=(i,s)=>s.parent?.name!=="/"?[B(26,s.definitions[0].rangeTokens,s.definitions[0],{linkedTo:s.definitions.slice(1),templateStrings:["Cpus node can only be added to a root node"]})]:[];let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let r=t.properties.find(i=>i.name==="#size-cells");r.required=()=>"required";let n=r?.additionalTypeCheck;return r.additionalTypeCheck=(i,s)=>{let o=n?.(i,s)??[],a=i.parent.getProperty(i.name);return(a?qe(a,0,0,s):void 0)!==0&&o.push(B(28,i.ast.rangeTokens,i.ast,{templateStrings:[`${i.name} value in cpus node must be '0'`]})),o},t}function wC(){let t=lr();t.additionalValidations=(n,i)=>i.parent?.name!=="cpus"?[B(26,i.definitions[0].rangeTokens,i.definitions[0],{linkedTo:i.definitions.slice(1),templateStrings:["`cpu` node can only be a child of `cpus` node"]})]:[];let e=t.properties.find(n=>n.name==="device_type");e.required=()=>"required";let r=t.properties.find(n=>n.name==="reg");return r.required=()=>"required",r.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
|
|
257
257
|
CP U/threads represented by the CPU node.
|
|
258
258
|
If a CPU supports more than one thread (i.e. multiple streams of execution) the reg property is an array with 1 element per thread.
|
|
259
259
|
The #address-cells on the /cpus node specifies how many cells each element of the array takes. Software can determine the number of threads by dividing the size of reg by the parent node's #address-cells.
|
|
260
260
|
If a CPU/thread can be the target of an external interrupt the reg property value must be a unique CPU/thread id that is addressable by the interrupt controller.
|
|
261
261
|
If a CPU/thread cannot be the target of an external interrupt, then reg must be unique and out of bounds of the range addressed by the interrupt controller
|
|
262
262
|
If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
|
|
263
|
-
If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],t}var
|
|
264
|
-
any circumstances other than under the control of the device driver using the region.`],t};var $C=()=>{let t=new J("reusable",W("EMPTY"),"optional");return t.description=["The operating system can use the memory in this region with the limitation that the device driver(s) owning the region need to be able to reclaim it back. Typically that means that the operating system can use that region to store volatile or cached data that can be otherwise regenerated or migrated elsewhere."],t};var BC=()=>{let t=new J("size",W("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=Oe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];return t.signatureArgs=o.map(a=>Mr.create(a)),i?.length!==e.parent.sizeCells(r)&&n.push($(19,e.ast.values??e.ast,xr.Error,[],[],[e.name,`<${Array.from({length:s},()=>"size")}>`])),n});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function FC(){let t=dr(),e=t.properties.find(r=>r.name==="reg");return e.required=()=>"optional",t.addProperty([BC(),MC(),qC(),LC(),$C()]),t}function os(t){switch(t?.name){case"/":return PC();case"aliases":return RC();case"memory":return EC();case"reserved-memory":return CC();case"chosen":return AC();case"cpus":return IC();case"cpu":return xC()}return t?.parent?.name==="reserved-memory"?FC():dr()}var Q=class t{constructor(e,r,n,i=null){this.bindingLoader=e;this.name=r;this.address=n;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this.interrupControlerMapping=[];this.spesifierNexusMapping=[];this.missingBinding=[];i?.addNode(this)}static toJson(e){let r={};return e.property.forEach(n=>r[n.name]=n.ast.values?.toJson()??!0),e.nodes.forEach(n=>r[n.fullName]=t.toJson(n)),r}get disabled(){return this.getProperty("status")?.ast.quickValues?.at(0)==="disabled"}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=this.bindingLoader?.getNodeTypes(this).type??[os(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(r=>r===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(r=>r===e)?this:[...this._nodes,...this._deletedNodes.map(r=>r.node)].map(r=>r.getReferenceBy(e)).find(r=>r)}get nodeNameOrLabelRef(){return Ko([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,r){let n=[...this.definitions,...this.referencedBy].find(i=>sn(i,e,r));if(n){let i=this.deletes.map(c=>({item:this,ast:Jn(c,e,r),beforeAst:Rc(c,e,r),afterAst:Pc(c,e,r)})).find(c=>sn(c.ast,e,r));if(i)return i;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=>sn(c.ast,e,r)||c.ast.lastToken.value!==";"&&bw(c.ast,e,r));if(s)return s.item.getDeepestAstNode(e,r);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,r)).find(c=>c);if(o)return o;let a=Jn(n,e,r);return{item:this,ast:a,beforeAst:Rc(a,e,r),afterAst:Pc(a,e,r)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ue).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)]}getOverlappinNodeAddressesIssues(e){return this._nodes.filter(r=>!r.disabled).flatMap(r=>{let n=r.regArray(e),i=this._nodes.filter(s=>s!==r&&!s.disabled);return n?.flatMap(s=>{let o=i.flatMap(a=>a.regArray(e)?.filter(c=>nn(c.startAddress,s.endAddress)<0&&nn(s.startAddress,c.endAddress)<0).flatMap(c=>({reg:c,node:a}))).filter(a=>!!a);return o.length?jt(10,s.ast,un.DiagnosticSeverity.Information,o.map(a=>a.reg.ast),void 0,[r.fullName,`0x${s.startAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`,`0x${s.endAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`],void 0,void 0,o.map(a=>[a.node.fullName,`0x${a.reg.startAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`,`0x${a.reg.endAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`])):[]})??[]})}getIssues(e){let r=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.getIssues(e)),...this._deletedNodes.flatMap(n=>n.node.getIssues(e)),...this.deletedPropertiesIssues,...this.deletedNodesIssues,...this.missingBinding,...this.getOverlappinNodeAddressesIssues(e)];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||r.push(jt(9,this.definitions.at(-1).name??new j(G(this.definitions.at(-1).firstToken)),un.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),r}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[jt(6,e.property.ast,un.DiagnosticSeverity.Hint,[e.by],[un.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(r=>jt(6,r.ast,un.DiagnosticSeverity.Hint,[e.by],[un.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(r=>r instanceof Ue),...e.node.referencedBy].flatMap(r=>{let n;return r instanceof Ue?n=r.name.toString():r.reference instanceof se?n=r.reference.label.value:n=r.reference.path.pathParts.at(-1).name,jt(7,r,un.DiagnosticSeverity.Hint,[e.by],[un.DiagnosticTag.Deprecated],[n])})])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}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,r){return this._nodes.some(n=>n.name===e&&(n.address===r||n.address?.every((i,s)=>r?.at(s)===i)))}hasProperty(e){return this._properties.some(r=>r.name===e)}getProperty(e){return this._properties.find(r=>r.name===e)}deleteNode(e,r,n){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===n||n?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:r}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let r=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(r instanceof qt){let n=r.values[0].value;if(n instanceof tr&&n.value===e)return[this,...this._nodes.flatMap(i=>i.getAllPhandle(e))]}return this._nodes.flatMap(n=>n.getAllPhandle(e))}getPhandle(e){let r=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(r instanceof qt){let n=r.values[0].value;if(n instanceof tr&&n.value===e)return this}return this._nodes.flatMap(n=>n.getPhandle(e)).find(n=>!!n)}getNode(e,r,n=!0){let i=n||!!r||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===r||o.address?.every((a,c)=>r?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,r){let n=this._properties.findIndex(i=>i.name===e);n!==-1&&(this._deletedProperties.push({property:this._properties[n],by:r}),this._properties.splice(n,1))}addNode(e){this._nodes.push(e)}addProperty(e){let r=this._properties.findIndex(n=>n.name===e.name);if(r===-1)this._properties.push(e);else{let n=this._properties.splice(r,1)[0];this._properties.push(e),e.replaces=n,n.replacedBy=e}if(e.name==="compatible")if(this.bindingLoader){let n=this.bindingLoader.getNodeTypes(this);this._nodeTypes=n.type,this.missingBinding.push(...n.issues)}else this._nodeTypes=[os(this)]}getChild(e,r=!0){let n=[...e];n.splice(0,1);let i=n[0].split("@"),s=i[0],o=i[1]!==void 0?i[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(s,o,r);return n.length===1||!a?a:a.getChild(n)}getChildFromScope(e,r){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let n=[...e];return n.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!r(s.by)).map(s=>s.node)].find(s=>s.fullName===n[0])?.getChildFromScope(n,r)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;regArray(e){if(this.#e!==void 0)return this.#e;let r=this.getProperty("reg");if(!r){this.#e=null;return}let n=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=Oe(r.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:n}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(f=>f instanceof we))continue;let l=a.map(f=>f.evaluate(e)),u=c.map(f=>f.evaluate(e)),d=a.at(0)?.firstToken;!d||![...l,...u].every(f=>typeof f=="number")||s.push({startAddress:l,endAddress:Zi(l,u),size:u,ast:new j(G(d,c.at(-1)?.lastToken??a.at(-1)?.lastToken))})}return this.#e=s,this.#e}#t;rangeMap(e){if(this.#t!==void 0)return this.#t;let r=this.getProperty("ranges");if(!r){this.#t=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=Oe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof we))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),y=c.at(0)?.firstToken;!y||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,ast:new j(G(y,u.at(-1).lastToken))})}return this.#t=o,this.#t}#i;dmaRangeMap(e){if(this.#i!==void 0)return this.#i;let r=this.getProperty("dma-ranges");if(!r){this.#i=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=Oe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof we))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),y=c.at(0)?.firstToken;!y||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,ast:new j(G(y,u.at(-1).lastToken))})}return this.#i=o,this.#i}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#r;addressCells(e){if(this.#r!==void 0)return this.#r;let r=this?.getProperty("#address-cells");return this.#r=r?qe(r,0,0,e)??2:2,this.#r}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let r=this.getProperty("#size-cells");return this.#o=r?qe(r,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let r=this.parent?.rangeMap(e),n=this.regArray(e);return this.#f=n?.flatMap(i=>{let s=i.startAddress,o=i.size,a=Zi(s,o),c={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:i.ast,missingMapping:!1};if(!r)return[c];let l=Pw(r,s);return l.length?l.map(u=>(c.mappedAst=u.ast,c.startAddress=u.start,c.endAddress=Zi(u.start,o),c.inMappingRange=nn(c.endAddress,u.end)<=0,c.mappingEnd=u.end,{...c,mappedAst:u.ast,startAddress:u.start,endAddress:Zi(u.start,o),inMappingRange:nn(c.endAddress,u.end)<=0,mappingEnd:u.end})):(c.missingMapping=!0,[c])}).sort((i,s)=>nn(i.endAddress,s.endAddress))??[],this.#f}get interruptsParent(){if(this.getProperty("interrupts-extended"))return null;let e=this.bindingLoader?.type==="Zephyr",r=this.getProperty("interrupt-parent"),n=r?ln(r?.ast.values?.values.at(0),this.root):e?void 0:this.parent;return!e||r?{interruptParent:r,parentInterruptNode:n??null}:n?{interruptParent:r,parentInterruptNode:n??null}:this.parent?this.parent.interruptsParent:{parentInterruptNode:this}}getNexusMapEntyMatch(e,r,n,i=[]){let s=new j(G(n[0].firstToken,n.at(-1).lastToken)),o=this.getNexusMap(e,r);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...n.map((l,u)=>{let d=l instanceof we?l.evaluate(r):l;return(typeof d=="number"?d&(o.mapMask.at(u+i.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof we?u.evaluate(r):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,r){let n=this.getProperty(`${e}-map`),i=Oe(n?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=qe(o,0,0,r);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(r));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let p=ln(i[l],s);if(!p)break;let y=p.getProperty(`#${e}-cells`);if(!y)return;l++;let h=qe(y,0,0,r);if(h==null||(e==="interrupt"&&(h+=p.addressCells(r)),l+=h,i.length<l))break;let v=i.slice(l-h,l);c.push({mappingValues:f,node:p,parentValues:v})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,p)=>(u?qe(u,0,p,r):void 0)??4294967295),map:c}}uniqueLabels(){return Array.from(new Set(this.labels.map(e=>e.toString())))}toTooltipString(e){return`${this.uniqueLabels().join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
|
|
265
|
-
`:""}${this.
|
|
263
|
+
If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],t}var CC=()=>{let t=new X("alignment",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=Oe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Ir.create(a)),i?.length!==s){let a=e.ast.values??e.ast;n.push(B(19,a.rangeTokens,a,{templateStrings:[e.name,`<${Array.from({length:e.parent.sizeCells(r)},()=>"size")}>`]}))}return n});return t.description=["Address boundary for alignment of allocation."],t};var DC=()=>{let t=new X("alloc-ranges",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=e.parent.addressCells(r),s=e.parent.sizeCells(r),o=[...Array.from({length:i},(c,l)=>`address${i>1?l:""}`),...Array.from({length:s},(c,l)=>`size${s>1?l:""}`)];t.signatureArgs=o.map(c=>Ir.create(c)),t.signatureArgsCyclic=!0;let a=Oe(e.ast.values);if(!a)return[];if(a.length===0||a.length%(i+s)!==0){let c=a.at(a.length-a.length%(s+i))??e.ast;return n.push(B(19,c.rangeTokens,c,{templateStrings:[e.name,`<${[...Array.from({length:i},()=>"address"),...Array.from({length:s},()=>"size")].join(" ")}>`]})),n}return n});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var AC=()=>{let t=new X("no-map",z("EMPTY"),"optional");return t.description=[`Indicates the operating system must not create a virtual mapping of the region as part of its standard mapping of system memory, nor permit speculative access to it under
|
|
264
|
+
any circumstances other than under the control of the device driver using the region.`],t};var IC=()=>{let t=new X("reusable",z("EMPTY"),"optional");return t.description=["The operating system can use the memory in this region with the limitation that the device driver(s) owning the region need to be able to reclaim it back. Typically that means that the operating system can use that region to store volatile or cached data that can be otherwise regenerated or migrated elsewhere."],t};var OC=()=>{let t=new X("size",z("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,r)=>{let n=[],i=Oe(e.ast.values),s=e.parent.sizeCells(r),o=[...Array.from({length:s},(a,c)=>`size${s>1?c:""}`)];if(t.signatureArgs=o.map(a=>Ir.create(a)),i?.length!==e.parent.sizeCells(r)){let a=e.ast.values??e.ast;n.push(B(19,a.rangeTokens,a,{templateStrings:[e.name,`<${Array.from({length:s},()=>"size")}>`]}))}return n});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function xC(){let t=lr(),e=t.properties.find(r=>r.name==="reg");return e.required=()=>"optional",t.addProperty([OC(),CC(),DC(),AC(),IC()]),t}function rs(t){switch(t?.name){case"/":return bC();case"aliases":return SC();case"memory":return NC();case"reserved-memory":return PC();case"chosen":return kC();case"cpus":return EC();case"cpu":return wC()}return t?.parent?.name==="reserved-memory"?xC():lr()}var J=class t{constructor(e,r,n,i=null){this.bindingLoader=e;this.name=r;this.address=n;this.parent=i;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];this.interrupControlerMapping=[];this.spesifierNexusMapping=[];this.missingBinding=[];i?.addNode(this)}static toJson(e){let r={};return e.properties.forEach(n=>r[n.name]=n.ast.values?.toJson()??!0),e.nodes.forEach(n=>r[n.fullName]=t.toJson(n)),r}get disabled(){return this.getProperty("status")?.ast.quickValues?.at(0)==="disabled"}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=this.bindingLoader?.getNodeTypes(this).type??[rs(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(r=>r===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(r=>r===e)?this:[...this._nodes,...this._deletedNodes.map(r=>r.node)].map(r=>r.getReferenceBy(e)).find(r=>r)}get nodeNameOrLabelRef(){return Vo([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,r){let n=[...this.definitions,...this.referencedBy].find(i=>nn(i,e,r));if(n){let i=this.deletes.map(c=>({item:this,ast:Xn(c,e,r),beforeAst:gc(c,e,r),afterAst:mc(c,e,r)})).find(c=>nn(c.ast,e,r));if(i)return i;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=>nn(c.ast,e,r)||c.ast.lastToken.value!==";"&&dE(c.ast,e,r));if(s)return s.item.getDeepestAstNode(e,r);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,r)).find(c=>c);if(o)return o;let a=Xn(n,e,r);return{item:this,ast:a,beforeAst:gc(a,e,r),afterAst:mc(a,e,r)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ue).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)]}getOverlappingNodeAddressesIssues(e){return this._nodes.filter(r=>!r.disabled).flatMap(r=>{let n=r.regArray(e),i=this._nodes.filter(s=>s!==r&&!s.disabled);return n?.flatMap(s=>{let o=i.flatMap(a=>a.regArray(e)?.filter(c=>rn(c.startAddress,s.endAddress)<0&&rn(s.startAddress,c.endAddress)<0).flatMap(c=>({reg:c,node:a}))).filter(a=>!!a);return o.length?qt(10,s.rangeTokens,r.definitions[0],{severity:ln.DiagnosticSeverity.Information,linkedTo:o.map(a=>({range:Hr(a.reg.rangeTokens.start,a.reg.rangeTokens.end),uri:a.reg.rangeTokens.start.uri})),templateStrings:[r.fullName,`0x${s.startAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`,`0x${s.endAddress.map((a,c)=>a.toString(16).padStart(c?8:0,"0")).join("")}`],linkedToTemplateStrings:o.map(a=>[a.node.fullName,`0x${a.reg.startAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`,`0x${a.reg.endAddress.map((c,l)=>c.toString(16).padStart(l?8:0,"0")).join("")}`])}):[]})??[]})}getIssues(e){let r=[...this.properties.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.getIssues(e)),...this._deletedNodes.flatMap(n=>n.node.getIssues(e)),...this.deletedPropertiesIssues,...this.deletedNodesIssues,...this.missingBinding,...this.getOverlappingNodeAddressesIssues(e)];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||r.push(qt(9,this.definitions.at(-1).name?.rangeTokens??W(this.definitions.at(-1).firstToken),this.definitions.at(-1).name??this.definitions.at(-1),{severity:ln.DiagnosticSeverity.Error,linkedTo:this.definitions.slice(0,-1),templateStrings:["/","cpus"]}))),r}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[qt(6,e.property.ast.rangeTokens,e.property.ast,{severity:ln.DiagnosticSeverity.Hint,tags:[ln.DiagnosticTag.Deprecated],linkedTo:[e.by],templateStrings:[e.property.name]}),...e.property.allReplaced.map(r=>qt(6,r.ast.rangeTokens,r.ast,{severity:ln.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[ln.DiagnosticTag.Deprecated],templateStrings:[e.property.name]})),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(r=>r instanceof Ue),...e.node.referencedBy].flatMap(r=>{let n;return r instanceof Ue?n=r.name.toString():r.reference instanceof se?n=r.reference.label.value:n=r.reference.path.pathParts.at(-1).name,qt(7,r.rangeTokens,r,{severity:ln.DiagnosticSeverity.Hint,linkedTo:[e.by],tags:[ln.DiagnosticTag.Deprecated],templateStrings:[n]})})])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}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,r){return this._nodes.some(n=>n.name===e&&(n.address===r||n.address?.every((i,s)=>r?.at(s)===i)))}hasProperty(e){return this._properties.some(r=>r.name===e)}getProperty(e){return this._properties.find(r=>r.name===e)}deleteNode(e,r,n){let i=this._nodes.findIndex(s=>s.name===e&&(s.address===n||n?.every((o,a)=>s.address?.at(a)===o)));i!==-1&&(this._deletedNodes.push({node:this._nodes[i],by:r}),this._nodes.splice(i,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let r=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(r instanceof Lt){let n=r.values[0].value;if(n instanceof Zt&&n.value===e)return[this,...this._nodes.flatMap(i=>i.getAllPhandle(e))]}return this._nodes.flatMap(n=>n.getAllPhandle(e))}getPhandle(e){let r=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(r instanceof Lt){let n=r.values[0].value;if(n instanceof Zt&&n.value===e)return this}return this._nodes.flatMap(n=>n.getPhandle(e)).find(n=>!!n)}getNode(e,r,n=!0){let i=n||!!r||this._nodes.filter(o=>o.name===e).length>1,s=this._nodes.findIndex(o=>o.name===e&&(!i||o.address===r||o.address?.every((a,c)=>r?.at(c)===a)));if(s!==-1)return this._nodes[s]}deleteProperty(e,r){let n=this._properties.findIndex(i=>i.name===e);n!==-1&&(this._deletedProperties.push({property:this._properties[n],by:r}),this._properties.splice(n,1))}addNode(e){this._nodes.push(e)}addProperty(e){let r=this._properties.findIndex(n=>n.name===e.name);if(r===-1)this._properties.push(e);else{let n=this._properties.splice(r,1)[0];this._properties.push(e),e.replaces=n,n.replacedBy=e}if(e.name==="compatible")if(this.bindingLoader){let n=this.bindingLoader.getNodeTypes(this);this._nodeTypes=n.type,this.missingBinding.push(...n.issues)}else this._nodeTypes=[rs(this)]}getChild(e,r=!0){let n=[...e];n.splice(0,1);let i=n[0].split("@"),s=i[0],o=i[1]!==void 0?i[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(s,o,r);return n.length===1||!a?a:a.getChild(n)}getChildFromScope(e,r){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let n=[...e];return n.splice(0,1),[...this._nodes,...this._deletedNodes.filter(s=>!r(s.by)).map(s=>s.node)].find(s=>s.fullName===n[0])?.getChildFromScope(n,r)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;regArray(e){if(this.#e!==void 0)return this.#e;let r=this.getProperty("reg");if(!r){this.#e=null;return}let n=this.parentAddressCells(e),i=this.parentSizeCells(e),s=[],o=Oe(r.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:n}).map(()=>o.pop()),c=Array.from({length:i}).map(()=>o.pop());if(![...a,...c].every(f=>f instanceof Ee))continue;let l=a.map(f=>f.evaluate(e)),u=c.map(f=>f.evaluate(e)),d=a.at(0)?.firstToken;!d||![...l,...u].every(f=>typeof f=="number")||s.push({startAddress:l,endAddress:Xi(l,u),size:u,rangeTokens:W(d,c.at(-1)?.lastToken??a.at(-1)?.lastToken)})}return this.#e=s,this.#e}#t;rangeMap(e){if(this.#t!==void 0)return this.#t;let r=this.getProperty("ranges");if(!r){this.#t=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=Oe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof Ee))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:W(g,u.at(-1).lastToken)})}return this.#t=o,this.#t}#i;dmaRangeMap(e){if(this.#i!==void 0)return this.#i;let r=this.getProperty("dma-ranges");if(!r){this.#i=null;return}let n=this.sizeCells(e),i=this.addressCells(e),s=this.parentAddressCells(e),o=[],a=Oe(r.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:i}).map(()=>a.pop()),l=Array.from({length:s}).map(()=>a.pop()),u=Array.from({length:n}).map(()=>a.pop());if(![...c,...l,...u].every(h=>h instanceof Ee))continue;let d=c.map(h=>h.evaluate(e)),f=l.map(h=>h.evaluate(e)),p=u.map(h=>h.evaluate(e)),g=c.at(0)?.firstToken;!g||![...d,...f,...p].every(h=>typeof h=="number")||o.push({childAddress:d,parentAddress:f,length:p,rangeTokens:W(g,u.at(-1).lastToken)})}return this.#i=o,this.#i}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#r;addressCells(e){if(this.#r!==void 0)return this.#r;let r=this?.getProperty("#address-cells");return this.#r=r?qe(r,0,0,e)??2:2,this.#r}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let r=this.getProperty("#size-cells");return this.#o=r?qe(r,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let r=this.parent?.rangeMap(e),n=this.regArray(e);return this.#f=n?.flatMap(i=>{let s=i.startAddress,o=i.size,a=Xi(s,o),c={startAddress:s,startAddressRaw:s,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regRangeTokens:{start:i.rangeTokens.start,end:i.rangeTokens.end},missingMapping:!1};if(!r)return[c];let l=mE(r,s);return l.length?l.map(u=>(c.mappedAst={range:u.range,uri:u.uri},c.startAddress=u.start,c.endAddress=Xi(u.start,o),c.inMappingRange=rn(c.endAddress,u.end)<=0,c.mappingEnd=u.end,{...c,mappedAst:{range:u.range,uri:u.uri},startAddress:u.start,endAddress:Xi(u.start,o),inMappingRange:rn(c.endAddress,u.end)<=0,mappingEnd:u.end})):(c.missingMapping=!0,[c])}).sort((i,s)=>rn(i.endAddress,s.endAddress))??[],this.#f}get interruptsParent(){if(this.getProperty("interrupts-extended"))return null;let e=this.bindingLoader?.type==="Zephyr",r=this.getProperty("interrupt-parent"),n=r?cn(r?.ast.values?.values.at(0),this.root):e?void 0:this.parent;return!e||r?{interruptParent:r,parentInterruptNode:n??null}:n?{interruptParent:r,parentInterruptNode:n??null}:this.parent?this.parent.interruptsParent:{parentInterruptNode:this}}getNexusMapEntryMatch(e,r,n,i=[]){let s=new Z(W(n[0].firstToken,n.at(-1).lastToken)),o=this.getNexusMap(e,r);if(o){let a=[...i.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...n.map((l,u)=>{let d=l instanceof Ee?l.evaluate(r):l;return(typeof d=="number"?d&(o.mapMask.at(u+i.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof Ee?u.evaluate(r):u).toString()).join(":")===a);return{entry:s,match:c}}return{entry:s}}getNexusMap(e,r){let n=this.getProperty(`${e}-map`),i=Oe(n?.ast.values);if(!i?.length)return;let s=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=qe(o,0,0,r);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(r));let c=[],l=0;for(;l<i.length;){let f=i.slice(l,a+l);if(l+=a,i.length<l+1)break;let p=cn(i[l],s);if(!p)break;let g=p.getProperty(`#${e}-cells`);if(!g)return;l++;let h=qe(g,0,0,r);if(h==null||(e==="interrupt"&&(h+=p.addressCells(r)),l+=h,i.length<l))break;let v=i.slice(l-h,l);c.push({mappingValues:f,node:p,parentValues:v})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,p)=>(u?qe(u,0,p,r):void 0)??4294967295),map:c}}uniqueLabels(){return Array.from(new Set(this.labels.map(e=>e.toString())))}toTooltipString(e){return`${this.uniqueLabels().join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
|
|
265
|
+
`:""}${this.properties.map(r=>r.toPrettyString(e)).join(`
|
|
266
266
|
`)}${this.nodes.length?`
|
|
267
267
|
${this.nodes.map(r=>`${r.fullName}{ /* ... */ };`).join(`
|
|
268
268
|
`)}`:""}
|
|
269
|
-
};`}toMarkupContent(e){return{kind:
|
|
270
|
-
`)}}toFullString(e,r=1){let n=this.definitions.some(s=>s instanceof Ue&&s.omitIfNoRef),i=n&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return i?`/* /omit-if-no-ref/ ${this.labels.map(s=>s.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.
|
|
271
|
-
${" ".repeat(r)}`:""}${this.
|
|
269
|
+
};`}toMarkupContent(e){return{kind:ln.MarkupKind.Markdown,value:["### Path",this.pathString,"### Current State","```devicetree",this.toTooltipString(e),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
|
|
270
|
+
`)}}toFullString(e,r=1){let n=this.definitions.some(s=>s instanceof Ue&&s.omitIfNoRef),i=n&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return i?`/* /omit-if-no-ref/ ${this.labels.map(s=>s.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
|
|
271
|
+
${" ".repeat(r)}`:""}${this.properties.map(s=>s.toString()).join(`
|
|
272
272
|
${" ".repeat(r)}`)}${this.nodes.length?`
|
|
273
273
|
${" ".repeat(r)}${this.nodes.map(s=>`${s.fullName}{ ... };`).join(`
|
|
274
274
|
${" ".repeat(r)}`)}`:""}
|
|
275
275
|
${" ".repeat(r-1)}}; */`:`${i?"/* /omit-if-no-ref/ ":n?`/* /omit-if-no-ref/ */
|
|
276
|
-
${" ".repeat(r-1)}`:""}${this.uniqueLabels()}${this.labels.length?" ":""}${this.fullName} {${this.
|
|
277
|
-
${" ".repeat(r)}`:""}${this.
|
|
276
|
+
${" ".repeat(r-1)}`:""}${this.uniqueLabels()}${this.labels.length?" ":""}${this.fullName} {${this.properties.length?`
|
|
277
|
+
${" ".repeat(r)}`:""}${this.properties.map(s=>s.toPrettyString(e)).join(`
|
|
278
278
|
${" ".repeat(r)}`)}${this.nodes.length?`
|
|
279
279
|
${" ".repeat(r)}${this.nodes.map(s=>s.toFullString(e,r+1)).join(`
|
|
280
280
|
${" ".repeat(r)}`)}`:""}
|
|
281
|
-
${" ".repeat(r-1)}}; ${i?" */":""}`}serialize(e){let r=this.mappedReg(e),n=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof
|
|
282
|
-
`)}))}:void 0,issues:n.flatMap(s=>s.serializeIssues),path:this.pathString,disabled:this.disabled,name:this.fullName,labels:this.labels.map(s=>s.label.value),nodes:n.map(s=>s.serialize(e)),properties:this.
|
|
283
|
-
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var jC=M(F());var ti=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new Q(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let r=this.fileTopMostAstCache.get(e);if(r)return r;let n=[...this.context.parser.cPreprocessorParser.allAstItems,...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.overlayParsers.flatMap(i=>[...i.cPreprocessorParser.allAstItems,...i.unhandledStatements.children]),...this.context.parser.unhandledStatements.children].flatMap(i=>i.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,n),n}getDeepestAstNode(e,r){let i=this.fileTopMostAsts(e).find(s=>sn(s,e,r)||_w(Or().requestTokens(e,!1),s,r));if(i instanceof Yt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,r);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Jn(i,e,r)}}else if(i instanceof Nt&&i.path){let s=this.rootNode.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i instanceof Ue&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:Jn(i,e,r)}}static getNodeFromPath(e,r,n=!0){if(e.length===0)return r;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=r.getNode(s,a,n);return l?t.getNodeFromPath(c,l,n):void 0}resolvePath(e,r){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(r??=this.rootNode.allDescendantsLabels,r.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof lt)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.getIssues(this.context.macros)]}labelIssues(){let e=[],r=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{r.has(n.label.label.value)?r.get(n.label.label.value)?.push(n):r.set(n.label.label.value,[n])}),Array.from(r).forEach(n=>{let i=n[1];if(i.length>1){let s=i.find(a=>a.owner instanceof Q);(!i.every(a=>a&&a.owner===s?.owner)||!s)&&e.push(jt(4,i.at(0).label,jC.DiagnosticSeverity.Error,i.slice(1).map(a=>a.label),[],[i.at(0).label.label.value]))}}),e}get typesIssues(){let e=r=>[...r.nodeType?.getIssue(this,r)??[],...r.nodes.flatMap(n=>e(n))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return Sw([...e.definitions,...e.referencedBy],this.context)}};var Uf=class t{constructor(e,r){this.settings=e;this.bindingLoader=r;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let n={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,UC.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=n.overlays,this.overlays.filter(jc.existsSync),this.parser=new Ys(n.dtsFile,n.includePaths),this.ctxNames_.add(n.ctxName),this.id=Si(n),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(i=>new Ys(i,n.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,r=i=>({file:i,includes:(e.get(i)??[]).map(s=>r(s.resolvedPath??s.path))});return(await this.getRuntime()).includes.forEach(i=>{let s=e.get(i.uri);s||(s=[],e.set(i.uri,s)),s.push({path:i.path.path,resolvedPath:i.resolvedPath})}),{mainDtsPath:r(this.parser.uri),overlays:this.overlays.map(r)}}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.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(r=>fe(r,e))}getUriParser(e){let r=this.overlayParsers.find(n=>n.getFiles().some(i=>fe(i,e)));return r??=this.parser.getFiles().some(n=>fe(n,e))?this.parser:void 0,r}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,r){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>fe(s.ast.uri,e)&&(!r||sn(s.ast,e,r))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof ie&&l.compatible===o.value.value);return c?{range:ce(o.value),target:ve(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>fe(s.uri,e)&&(!r||sn(s,e,r))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:ce(s.path),target:ve(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let r=s=>[...s.property,...s.nodes.flatMap(r)],n=r(e.rootNode),i=e.rootNode.allDescendantsLabels;n.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof se){let a=e.resolvePath([`&${o.label?.value}`],i);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(jt(3,o,ca.DiagnosticSeverity.Error,[],[],[o.value]))}else o instanceof An&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,r){let n=r,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=n?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(jt(8,a,ca.DiagnosticSeverity.Error,[],[],[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]))),c?.linkedNodeNamePaths.push(a),n=c}else break}}async reevaluate(e){let r=this.getUriParser(e);return r?(this.sortKeys=new WeakMap,await r.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let r=new ti(this);this._issues=[],this.parser.rootDocument.resetIssues(),this.processRoot(this.parser.rootDocument,r);for(let n=0;n<this.overlayParsers.length;n++)this.overlayParsers[n].rootDocument.resetIssues(),this.processRoot(this.overlayParsers[n].rootDocument,r);return r.includes=this.parser.includes,r.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof cn),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,i)=>this.sortKeys.set(n,i)),this.linkPropertiesLabelsAndNodePaths(r),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),r}processRoot(e,r){for(let n=0;n<e.children.length;n++){let i=e.children[n];this.processChild(i,r.rootNode,r)}}processChild(e,r,n){e instanceof lt?this.processDtcBaseNode(e,r,n):e instanceof Ye?this.processDtcProperty(e,r,n):e instanceof Ir?this.processDeleteNode(e,r,n):e instanceof ht&&this.processDeleteProperty(e,r,n)}checkNodeUniqueNames(e,r){let n=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||nn(c.address,a.fullAddress)===0)),i=r.nodes.map(o=>({name:o.name,address:o.address})),s=[];e.children.forEach(o=>{if(o instanceof Ue&&o.name)n(s.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(jt(2,o.name)),s.push(o.name);else if(o instanceof Ir&&o.nodeNameOrRef instanceof He){let a=o.nodeNameOrRef;n(i,a)&&(s=s.filter(c=>n(s.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}getCompileCommands(){if(!(!this.settings.compileCommands||!(0,jc.existsSync)(this.settings.compileCommands)))return JSON.parse((0,jc.readFileSync)(this.settings.compileCommands).toString())}processDtcBaseNode(e,r,n){e instanceof Nt?this.processDtcRootNode(e,n):e instanceof Ue?this.processDtcChildNode(e,r,n):e instanceof Yt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,r){r.roots.push(e),r.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,r.rootNode),e.children.forEach(n=>this.processChild(n,r.rootNode,r))}processDtcChildNode(e,r,n){if(e.name?.name){let i=e.path?n.resolvePath(e.path):void 0,o=(i?n.rootNode.getChild(i):void 0)??new Q(this.bindingLoader,e.name.name,e.name.fullAddress,r);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),r=o,this.checkNodeUniqueNames(e,o)}e.children.forEach(i=>this.processChild(i,r,n))}processDtcRefNodeLabelRef(e,r,n){let i,s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=n.rootNode.getChild(s),r.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(r),i?.referencedBy.push(e),e.labels.forEach(o=>{n.labelsUsedCache.set(o.label.value,s)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):(this._issues.push(jt(3,r,ca.DiagnosticSeverity.Error,[],[],[r.label?.value??""])),n.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,r,n){let i;r.path&&this.linkNodePath(r.path,n.rootNode);let o=r.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=n.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{n.labelsUsedCache.set(a.label.value,o)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):n.unlinkedRefNodes.push(e),i}processDtcRefNode(e,r){let n;e.reference?e.reference instanceof se?n=this.processDtcRefNodeLabelRef(e,e.reference,r):n=this.processDtcRefNodeNodePathRef(e,e.reference,r):r.unlinkedRefNodes.push(e),e.children.forEach(i=>this.processChild(i,n??new Q(this.bindingLoader,""),r))}processDtcProperty(e,r,n){e.propertyName?.name&&r.addProperty(new Xe(e,r)),e.children.forEach(i=>this.processChild(i,r,n))}processDeleteNode(e,r,n){if(e.nodeNameOrRef instanceof He&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!r.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(jt(5,e.nodeNameOrRef));else{r.deletes.push(e);let i=r.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,r.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{n.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof se&&e.nodeNameOrRef.value){let i=n.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=n.rootNode.getChild(i),r.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(jt(3,e.nodeNameOrRef,ca.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof it&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=n.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let c=0;c<s.length&&s[c];c++){let l=s[c];if(l){let u=i?.getNode(l.name,l.fullAddress,!1);l.linksTo=u,u?.linkedNodeNamePaths.push(l),i=u}}let o=e.nodeNameOrRef.path.pathParts.find(c=>c&&!c.linksTo),a=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;a||(n.unlinkedDeletes.push(e),o&&this._issues.push(jt(8,o,ca.DiagnosticSeverity.Error,[],[],[o.toString(),`${e.nodeNameOrRef.path.pathParts.filter(c=>c?.linksTo).map(c=>c?.toString()).join("/")}`]))),r.deletes.push(e),a?.labels.forEach(c=>{n.labelsUsedCache.delete(c.label.value)}),a?.parent?.deleteNode(a.name,e,a.address),e.parentNode instanceof lt&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,r,n))}processDeleteProperty(e,r,n){e.propertyName?.name&&!r.hasProperty(e.propertyName.name)?this._issues.push(jt(1,e.propertyName)):e.propertyName?.name&&(r.deletes.push(e),r.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,r,n))}static#e(e,r,n){let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}async getSyntaxIssues(e=new Map,r){return(await this.getAllParsers()).forEach(n=>{r?n.issues.filter(i=>r(i.raw)).forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)):n.issues.forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e))}),e}async getDiagnostics(){let e=new Map;try{return await this.getSyntaxIssues(e),(await this.getContextIssues()??[]).forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)),(await this.getRuntime())?.typesIssues.forEach(i=>t.#e(i.diagnostic(),i.raw.astElement.uri,e)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
|
|
284
|
-
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return await this.stable,await this.getDiagnostics(),(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var
|
|
281
|
+
${" ".repeat(r-1)}}; ${i?" */":""}`}serialize(e){let r=this.mappedReg(e),n=[...this.definitions,...this.referencedBy],i=this.nodeType;return{nodeType:i instanceof Nt?{...this.nodeType,extends:Array.from(this.nodeType?.extends??[]),properties:i.properties.map(s=>({name:typeof s.name=="string"?s.name:s.name.toString(),nameIsRegex:typeof s.name!="string",allowedValues:s.allowedValues,type:s.type,description:s.description?.join(`
|
|
282
|
+
`),required:s.required(this)==="required"}))}:void 0,issues:n.flatMap(s=>s.serializeIssues),path:this.pathString,disabled:this.disabled,name:this.fullName,labels:this.labels.map(s=>s.label.value),nodes:n.map(s=>s.serialize(e)),properties:this.properties.map(s=>({...s.ast.serialize(e),nexusMapEnty:s.nexusMapsTo.map(o=>({mappingValuesAst:o.mappingValuesAst.map(a=>a.serialize(e)),specifierSpace:o.specifierSpace,target:o.target.pathString,mapItem:o.mapItem?{parentValues:o.mapItem?.parentValues.map(a=>a.serialize(e)),target:o.mapItem.node.pathString,mappingValues:o.mapItem.mappingValues.map(a=>a.serialize(e))}:void 0}))})),childNodes:this.nodes.map(s=>s.serialize(e)),reg:r?.map(s=>({mappedStartAddress:s?.startAddress,mappedEndAddress:s?.endAddress,startAddress:s?.startAddressRaw,endAddress:s?.endAddressRaw,size:s?.size,inMappingRange:s?.inMappingRange})),interruptControllerMappings:this.interrupControlerMapping.map(s=>({cells:s.expressions.map(o=>o.serialize(e)),path:s.node.pathString,property:s.property.ast.serialize(e)})),specifierNexusMappings:this.spesifierNexusMapping.map(s=>({cells:s.expressions.map(o=>o.serialize(e)),path:s.node.pathString,property:s.property.ast.serialize(e)}))}}};var ea=L(j());var Ke=class{constructor(e,r){this.ast=e;this.parent=r;this.nexusMapsTo=[]}getDeepestAstNode(e,r){let n=Xn(this.ast,e,r);return this.ast.assignOperatorToken&&Iy(this.ast.assignOperatorToken,e,r)?{item:this,ast:n,beforeAst:gc(this.ast,e,r),afterAst:mc(this.ast,e,r)}:{item:this,ast:n}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof Ji)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(r=>r===e)?this:null}))}getArgumentIndex(e){if(!e)return;let r=this.ast.getFlatAstValues()?.findIndex(n=>n===e||n?.isAncestorOf(e));return r===-1?void 0:r}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[qt(0,this.replaces.ast.rangeTokens,this.replaces.ast,{severity:ea.DiagnosticSeverity.Hint,linkedTo:[this.ast],tags:[ea.DiagnosticTag.Unnecessary],templateStrings:[this.name]})]:[]]}onHover(){if(this.nexusMapsTo.length)return{kind:ea.MarkupKind.Markdown,value:["### Nexus mappings",...this.nexusMapsTo.filter(e=>!!e.mapItem).flatMap(e=>["```",`${this.name} = <... ${e.mappingValuesAst.map(r=>r.toString()).join(" ")} ...> maps to <... ${e.mapItem.mappingValues.map(r=>r.toString()).join(" ")} ...>;`,"```",`[Mapping (${e.mappingValuesAst.map(r=>r.toString()).join(" ")})](${`${e.mapItem.mappingValues[0].uri}#L${e.mapItem.mappingValues[0].firstToken.pos.line+1}`})`])].join(`
|
|
283
|
+
`)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var Zn=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new J(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let r=this.fileTopMostAstCache.get(e);if(r)return r;let n=[...this.context.parser.cPreprocessorParser.allAstItems,...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.overlayParsers.flatMap(i=>[...i.cPreprocessorParser.allAstItems,...i.unhandledStatements.children]),...this.context.parser.unhandledStatements.children].flatMap(i=>i.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,n),n}getDeepestAstNode(e,r){let i=this.fileTopMostAsts(e).find(s=>nn(s,e,r)||fE(Ar().requestTokens(e,!1),s,r));if(i instanceof Wt){let o=this.rootNode.getReferenceBy(i)?.getDeepestAstNode(e,r);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Xn(i,e,r)}}else if(i instanceof St&&i.path){let s=this.rootNode.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i instanceof Ue&&i.path){let s=t.getNodeFromPath(i.path.slice(1),this.rootNode)?.getDeepestAstNode(e,r);return s?{...s,runtime:this}:void 0}else if(i)return{runtime:this,item:null,ast:Xn(i,e,r)}}static getNodeFromPath(e,r,n=!0){if(e.length===0)return r;let i=e[0].split("@"),s=i[0],a=i.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=r.getNode(s,a,n);return l?t.getNodeFromPath(c,l,n):void 0}resolvePath(e,r){if(!e.at(0)?.startsWith("&"))return e;let n=this.labelsUsedCache.get(e[0].slice(1));return n||(r??=this.rootNode.allDescendantsLabels,r.find(s=>s.label.value===e.at(0)?.slice(1)&&s.parentNode instanceof ct)?.lastLinkedTo?.path)}get issues(){return this.issuesCache??=[...this.labelIssues(),...this.rootNode.getIssues(this.context.macros)],this.issuesCache}labelIssues(){let e=[],r=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(n=>{r.has(n.label.label.value)?r.get(n.label.label.value)?.push(n):r.set(n.label.label.value,[n])}),Array.from(r).forEach(n=>{let i=n[1];if(i.length>1){let s=i.find(a=>a.owner instanceof J);(!i.every(a=>a&&a.owner===s?.owner)||!s)&&e.push(qt(4,i[0].label.rangeTokens,i[0].label,{linkedTo:i.slice(1).map(a=>a.label),templateStrings:[i.at(0).label.label.value]}))}}),e}get typesIssues(){let e=r=>[...r.nodeType?.getIssue(this,r)??[],...r.nodes.flatMap(n=>e(n))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return pE([...e.definitions,...e.referencedBy],this.context)}};var xf=class t{constructor(e,r){this.settings=e;this.bindingLoader=r;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let n={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,MC.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=n.overlays,this.overlays.filter(Oc.existsSync),this.parser=new Hs(n.dtsFile,n.includePaths),this.ctxNames_.add(n.ctxName),this.id=bi(n),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(i=>new Hs(i,n.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,r=i=>({file:i,includes:(e.get(i)??[]).map(s=>r(s.resolvedPath??s.path))});return(await this.getRuntime()).includes.forEach(i=>{let s=e.get(i.uri);s||(s=[],e.set(i.uri,s)),s.push({path:i.path.path,resolvedPath:i.resolvedPath})}),{mainDtsPath:r(this.parser.uri),overlays:this.overlays.map(r)}}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.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(r=>de(r,e))}getUriParser(e){let r=this.overlayParsers.find(n=>n.getFiles().some(i=>de(i,e)));return r??=this.parser.getFiles().some(n=>de(n,e))?this.parser:void 0,r}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,r){if(!this.isInContext(e))return[];let i=(await this.getRuntime()).rootNode.allBindingsProperties.filter(s=>de(s.ast.uri,e)&&(!r||nn(s.ast,e,r))).flatMap(s=>s.ast.values?.values.flatMap(o=>{let c=s.parent?.nodeTypes.find(l=>o?.value instanceof ie&&l.compatible===o.value.value);return c?{range:fe(o.value),target:ve(c.bindingsPath)}:void 0})).filter(s=>s)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(s=>de(s.uri,e)&&(!r||nn(s,e,r))).map(s=>{let o=this.parser.cPreprocessorParser.resolveInclude(s);if(o)return{range:fe(s.path),target:ve(o)}}).filter(s=>s)??[],...i]}linkPropertiesLabelsAndNodePaths(e){let r=s=>[...s.properties,...s.nodes.flatMap(r)],n=r(e.rootNode),i=e.rootNode.allDescendantsLabels;n.forEach(s=>s.ast.allDescendants.forEach(o=>{if(o instanceof se){let a=e.resolvePath([`&${o.label?.value}`],i);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(qt(3,o.rangeTokens,o,{templateStrings:[o.value]}))}else o instanceof An&&this.linkNodePath(o,e.rootNode)}))}linkNodePath(e,r){let n=r,i=e.pathParts;for(let s=0;s<i.length&&i[s];s++){let o=!1,a=i[s];if(a){let c=n?.getNode(a.name,a.fullAddress,!1);a.linksTo=c,!o&&!c&&(o=!0,this._issues.push(qt(8,a.rangeTokens,a,{templateStrings:[a.toString(),`${e.pathParts.filter(l=>l?.linksTo).map(l=>l?.toString()).join("/")}`]}))),c?.linkedNodeNamePaths.push(a),n=c}else break}}async reevaluate(e){let r=this.getUriParser(e);return r?(this.sortKeys=new WeakMap,await r.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let r=new Zn(this);this._issues=[],this.parser.rootDocument.resetIssues(),this.processRoot(this.parser.rootDocument,r);for(let n=0;n<this.overlayParsers.length;n++)this.overlayParsers[n].rootDocument.resetIssues(),this.processRoot(this.overlayParsers[n].rootDocument,r);return r.includes=this.parser.includes,r.comments=this.parser.cPreprocessorParser.allAstItems.filter(n=>n instanceof an),(await this.getAllParsers()).flatMap(n=>n.tokens).forEach((n,i)=>this.sortKeys.set(n,i)),this.linkPropertiesLabelsAndNodePaths(r),this.reportNodeNameAndPropertyClashes(r),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),r}reportNodeNameAndPropertyClashes(e){let r=n=>{n.properties.forEach(i=>{n.nodes.filter(o=>o.address===void 0&&o.name===i.ast.propertyName?.name&&o.definitions.at(-1)?.name).forEach(o=>this._issues.push(qt(2,o.definitions.at(-1).name.rangeTokens,o.definitions.at(-1).name,{linkedTo:[i.ast,...i.allReplaced.map(a=>a.ast)]})))}),n.nodes.forEach(r)};r(e.rootNode)}processRoot(e,r){for(let n=0;n<e.children.length;n++){let i=e.children[n];this.processChild(i,r.rootNode,r)}}processChild(e,r,n){e instanceof ct?this.processDtcBaseNode(e,r,n):e instanceof Ye?this.processDtcProperty(e,r,n):e instanceof Dr?this.processDeleteNode(e,r,n):e instanceof pt&&this.processDeleteProperty(e,r,n)}checkNodeUniqueNames(e,r){let n=(o,a)=>o.filter(c=>c.name===a.name&&(c.address===a.fullAddress&&c.address===void 0||rn(c.address??[],a.fullAddress??[])===0)).map(c=>c.issueAst),i=r.nodes.map(o=>({name:o.name,address:o.address,issueAst:o.definitions[0].name??o.definitions[0]})),s=[];e.children.forEach(o=>{if(o instanceof Ue&&o.name){let a=n(s.map(c=>({name:c.name,address:c.fullAddress,issueAst:c})),o.name);a.length&&this._issues.push(qt(2,o.name.rangeTokens,o.name,{linkedTo:a})),s.push(o.name)}else if(o instanceof Dr&&o.nodeNameOrRef instanceof He){let a=o.nodeNameOrRef;n(i,a)&&(s=s.filter(c=>n(s.map(l=>({name:l.name,address:l.fullAddress,issueAst:l})),c).length))}})}getCompileCommands(){if(!(!this.settings.compileCommands||!(0,Oc.existsSync)(this.settings.compileCommands)))return JSON.parse((0,Oc.readFileSync)(this.settings.compileCommands).toString())}processDtcBaseNode(e,r,n){e instanceof St?this.processDtcRootNode(e,n):e instanceof Ue?this.processDtcChildNode(e,r,n):e instanceof Wt&&this.processDtcRefNode(e,n)}processDtcRootNode(e,r){r.roots.push(e),r.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,r.rootNode),e.children.forEach(n=>this.processChild(n,r.rootNode,r))}processDtcChildNode(e,r,n){if(e.name?.name){let i=e.path?n.resolvePath(e.path):void 0,o=(i?n.rootNode.getChild(i):void 0)??new J(this.bindingLoader,e.name.name,e.name.fullAddress,r);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),r=o,this.checkNodeUniqueNames(e,o)}e.children.forEach(i=>this.processChild(i,r,n))}processDtcRefNodeLabelRef(e,r,n){let i,s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);return s?(e.resolveNodePath??=[...s],i=n.rootNode.getChild(s),r.linksTo=i,e.labels.forEach(o=>o.lastLinkedTo=i),i?.linkedRefLabels.push(r),i?.referencedBy.push(e),e.labels.forEach(o=>{n.labelsUsedCache.set(o.label.value,s)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):(this._issues.push(qt(3,r.rangeTokens,r,{templateStrings:[r.label?.value??""]})),n.unlinkedRefNodes.push(e)),i}processDtcRefNodeNodePathRef(e,r,n){let i;r.path&&this.linkNodePath(r.path,n.rootNode);let o=r.path?.pathParts.at(-1)?.linksTo?.path;return o?(e.resolveNodePath??=o,i=n.rootNode.getChild(o),e.labels.forEach(a=>a.lastLinkedTo=i),i?.referencedBy.push(e),e.labels.forEach(a=>{n.labelsUsedCache.set(a.label.value,o)}),i?(n.references.push(e),this.checkNodeUniqueNames(e,i)):n.unlinkedRefNodes.push(e)):n.unlinkedRefNodes.push(e),i}processDtcRefNode(e,r){let n;e.reference?e.reference instanceof se?n=this.processDtcRefNodeLabelRef(e,e.reference,r):n=this.processDtcRefNodeNodePathRef(e,e.reference,r):r.unlinkedRefNodes.push(e),e.children.forEach(i=>this.processChild(i,n??new J(this.bindingLoader,""),r))}processDtcProperty(e,r,n){e.propertyName?.name&&r.addProperty(new Ke(e,r)),e.children.forEach(i=>this.processChild(i,r,n))}processDeleteNode(e,r,n){if(e.nodeNameOrRef instanceof He&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!r.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(qt(5,e.nodeNameOrRef.rangeTokens,e.nodeNameOrRef));else{r.deletes.push(e);let i=r.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=i,r.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),i?.labels.forEach(s=>{n.labelsUsedCache.delete(s.label.value)})}}else if(e.nodeNameOrRef instanceof se&&e.nodeNameOrRef.value){let i=n.resolvePath([`&${e.nodeNameOrRef.value}`]),s;i?(s=n.rootNode.getChild(i),r.deletes.push(e),e.nodeNameOrRef.linksTo=s,s?.labels.forEach(o=>{n.labelsUsedCache.delete(o.label.value)}),s?.linkedRefLabels.push(e.nodeNameOrRef),s?.parent?.deleteNode(s.name,e,s.address),e.parentNode instanceof ct&&!e.parentNode.pathName&&n.globalDeletes.push(e)):(n.unlinkedDeletes.push(e),this._issues.push(qt(3,e.nodeNameOrRef.rangeTokens,e.nodeNameOrRef,{templateStrings:[e.nodeNameOrRef.value]})))}else if(e.nodeNameOrRef instanceof nt&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(i=>!i)){let i=n.rootNode,s=e.nodeNameOrRef.path.pathParts;for(let c=0;c<s.length&&s[c];c++){let l=s[c];if(l){let u=i?.getNode(l.name,l.fullAddress,!1);l.linksTo=u,u?.linkedNodeNamePaths.push(l),i=u}}let o=e.nodeNameOrRef.path.pathParts.find(c=>c&&!c.linksTo),a=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;a||(n.unlinkedDeletes.push(e),o&&this._issues.push(qt(8,o.rangeTokens,o,{templateStrings:[o.toString(),`${e.nodeNameOrRef.path.pathParts.filter(c=>c?.linksTo).map(c=>c?.toString()).join("/")}`]}))),r.deletes.push(e),a?.labels.forEach(c=>{n.labelsUsedCache.delete(c.label.value)}),a?.parent?.deleteNode(a.name,e,a.address),e.parentNode instanceof ct&&!e.parentNode.pathName&&n.globalDeletes.push(e)}else n.unlinkedDeletes.push(e);e.children.forEach(i=>this.processChild(i,r,n))}processDeleteProperty(e,r,n){e.propertyName?.name&&!r.hasProperty(e.propertyName.name)?this._issues.push(qt(1,e.propertyName.rangeTokens,e.propertyName)):e.propertyName?.name&&(r.deletes.push(e),r.deleteProperty(e.propertyName.name,e)),e.children.forEach(i=>this.processChild(i,r,n))}static#e(e,r,n){let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e)}async getSyntaxIssues(e=new Map,r){return(await this.getAllParsers()).forEach(n=>{r?n.issues.filter(i=>r(i.raw)).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)):n.issues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e))}),e}async getDiagnostics(){let e=new Map;try{return await this.getSyntaxIssues(e),(await this.getContextIssues()??[]).forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),(await this.getRuntime())?.typesIssues.forEach(i=>t.#e(i.diagnostic(),i.raw.uri,e)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
|
|
284
|
+
${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return await this.stable,await this.getDiagnostics(),(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var qC=require("fs"),ta=require("path"),At=L(j());function mU(t){if(!t||!(t.ast instanceof zo))return[];let e=n=>n.flatMap(i=>{try{return(0,qC.readdirSync)(i,{withFileTypes:!0,recursive:!0}).filter(s=>s.name.toLowerCase().endsWith(".dtsi")||s.name.toLowerCase().endsWith(".h")).map(s=>({label:`${(0,ta.join)((0,ta.relative)(i,s.parentPath),s.name)}`,kind:At.CompletionItemKind.File}))}catch{return[]}});if(t.ast.relative)return e([(0,ta.dirname)(t.ast.uri)]);let r=t.runtime.context.settings.includePaths??[];return e(r)}var Mf=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>Mf(r.node,e)),...t.nodes.flatMap(r=>Mf(r,e))],nv=(t,e)=>[...t.labels,...t.deletedNodes.filter(r=>!e(r.by)).flatMap(r=>nv(r.node,e)),...t.nodes.flatMap(r=>nv(r,e))];function gU(t,e){if(!t||!(t.item instanceof Ke)||!(t.ast instanceof se))return[];let r=i=>nv(i,e),n=new Map;return r(t.runtime.rootNode).forEach(i=>n.set(i.label.value,i)),Array.from(n).map(([,i])=>({label:`${i.label.value}`,kind:At.CompletionItemKind.Method,documentation:i.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function yU(t,e){if(!t||t.item!==null||!(t.ast instanceof se)||!(t.ast.parentNode instanceof Wt))return[];let r=n=>Mf(n,e).filter(i=>e(i));return[...Array.from(new Set(r(t.runtime.rootNode).map(n=>n.label.value))).map(n=>({label:n,insertText:t.ast.lastToken.nextToken?.value==="{"?n:`${n} {
|
|
285
285
|
$1
|
|
286
|
-
};`,kind:At.CompletionItemKind.Value,insertTextFormat:At.InsertTextFormat.Snippet}))]}function RU(t,e){let r=s=>s?s.parentNode instanceof Yt||s.parentNode instanceof Nt||s.parentNode instanceof Ue?!1:r(s.parentNode):!0;if(!t||t.item!==null||!Ut(t.ast)||!r(t.ast))return[];let n=s=>Hf(s,e).filter(o=>e(o));if(t.ast instanceof mt)return n(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[];let i=new Map;return n(t.runtime.rootNode).forEach(s=>i.set(s.label.value,s)),Array.from(i).map(([,s])=>({label:t.ast instanceof se?`${s.label.value}`:`&${s.label.value}`,kind:At.CompletionItemKind.Variable,documentation:s.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function EU(t,e){if(!t||!(t.item instanceof Q)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof br)||t.beforeAst?.parentNode instanceof ht))return[];let r=n=>[...n.nodes,...n.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>({node:i,astNodes:i.definitions.filter(s=>s instanceof Ue)})).filter(i=>i.astNodes.some(e));return t.ast instanceof He||t.ast instanceof Ir||t.beforeAst?.parentNode instanceof Ir?r(t.item).map(n=>({label:`${n.astNodes.at(0)?.name?.toString()}`,kind:At.CompletionItemKind.Variable,documentation:n.node.toMarkupContent(t.runtime.context.macros)})):r(t.item).length?[{label:"/delete-node/",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[]}function wU(t,e){if(!t||!(t.item instanceof Q)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof br)||t.beforeAst?.parentNode instanceof Ir))return[];let r=n=>[...n.property,...n.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));if(t.ast instanceof Ze||t.ast instanceof ht||t.beforeAst?.parentNode instanceof ht){let n=new Map;return r(t.item).forEach(i=>n.set(i.name,i)),Array.from(n).map(([,i])=>({label:`${i.name}`,kind:At.CompletionItemKind.Variable,documentation:i.ast.toPrettyString(t.runtime.context.macros)}))}return r(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:At.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:At.InsertTextFormat.Snippet}]:[]}function kU(t,e){let r=t?.ast instanceof An?t.ast:t?.ast.parentNode;if(!t||!r||!(r instanceof An))return[];let n=r.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let i=n.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!Ut(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]]})().map(o=>({label:`/${[...i,o.fullName].join("/")}`,kind:At.CompletionItemKind.Variable,documentation:o.toMarkupContent(t.runtime.context.macros)}))}function CU(t){return!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken)||t.ast instanceof ie?[]:!Ws(t?.ast)&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!Ws(t.beforeAst)&&!Ws(t.afterAst)?[]:t.item.parent.nodeType instanceof Pt?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([,n])=>n.macro.identifier instanceof Zn?{label:`${n.macro.identifier.toString()}`,insertText:`${n.macro.name}(${n.macro.identifier.params.map((i,s)=>i instanceof Ct?`$${s+1}`:"").join(", ")})`,kind:At.CompletionItemKind.Function,sortText:`~${n.macro.name}`,insertTextFormat:At.InsertTextFormat.Snippet}:{label:n.macro.identifier.name,kind:At.CompletionItemKind.Variable,sortText:`~${n.macro.name}`}):[]}async function VC(t,e){return St(t,e,(r,n)=>[...wU(r,n),...EU(r,n),...RU(r,n),...kU(r,n),...PU(r,n),...NU(r,n),...SU(r),...CU(r)])}var Np=M(F());var WC=require("child_process");var pv=t=>/[A-Za-z0-9_]/.test(t);function DU(t,e){let r=[];for(let n=0;n<e;n++){let i=t[n];i==="("?r.push(n):i===")"&&r.pop()}return r.length?r[r.length-1]:void 0}function zC(t,e){let r=1;for(let n=e+1;n<t.length;n++){let i=t[n];if(i==="(")r++;else if(i===")"&&(r--,r===0))return n}}function GC(t,e,r){let n=[],i=0,s=!1,o=!1,a=e;for(let f=e;f<r;f++){let p=t[f];if(p==="'"&&!o)s=!s;else if(p==='"'&&!s)o=!o;else if(!s&&!o){if(p==="(")i++;else if(p===")")i--;else if(p===","&&i===0){let y=a,h=f,v=y,S=h;for(;v<S&&/\s/.test(t[v]);)v++;for(;S>v&&/\s/.test(t[S-1]);)S--;n.push({start:y,end:h,text:t.slice(v,S)}),a=f+1}}}let c=a,l=r,u=c,d=l;for(;u<d&&/\s/.test(t[u]);)u++;for(;d>u&&/\s/.test(t[d-1]);)d--;return n.push({start:c,end:l,text:t.slice(u,d)}),n}function hv(t){let e=t.trim(),r=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(e);if(!r)return{macro:e};let n=r[1],i=r[2],s=GC(i,0,i.length),o={macro:n,args:[]};return o.args=s.map(a=>{let c=hv(a.text);return c.parent=o,c}),o}function wi(t,e){let r=t.getText(),n=t.offsetAt(e),i=n,s=n;for(;i>0&&pv(r[i-1]);)i--;for(;s<r.length&&pv(r[s]);)s++;if(r[s]==="("){let v=zC(r,s);v!==void 0&&(s=v+1)}let o=r.slice(i,s),a=o.trim().length?hv(o):void 0,c=DU(r,n);if(c===void 0)return a;let l=zC(r,c);if(l===void 0||!(c<n&&n<=l))return a;let u=c,d=u;for(;d>0&&pv(r[d-1]);)d--;let f=r.slice(d,u);if(!f)return a;let p=GC(r,c+1,l),y={macro:f,args:[]};y.args=p.map(v=>{let S=hv(v.text);return S.parent=y,S});let h=-1;for(let v=0;v<p.length;v++){let S=p[v];if(n>=S.start&&n<=S.end){h=v;break}}if(h>=0){let v=y.args[h];return v.argIndexInParent=h,v}return y}function AU(t,e,r){let i=t.getText().split(/\r?\n/),s=new RegExp(`^\\s*#\\s*define\\s+(${e})\\b(\\s*\\([^)]*\\))?\\s*(.*)$`);for(let o=Math.min(r.line,i.length-1);o>=0;o--){let a=i[o],c=s.exec(a);if(c){let l=a.indexOf(c[0]),u=a.indexOf(c[3],l);return Gr.create(o,u>=0?u:a.length)}}}async function as(t,e,r,n){let i=YC(t,e,r);if(i)return i;let s=await OU(e,n,De(t.uri));if(s)return[s,r]}function YC(t,e,r){if(e.startsWith("DT_"))return;let n=AU(t,e,r);if(!n)return;let i=wi(t,n);if(i)return[i,n]}var IU=(t,e)=>new Promise(r=>{let n=(0,WC.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),i="";n.stdout.on("data",s=>{i+=s.toString()}),n.on("close",s=>{r(s?"":i)})});async function OU(t,e,r){let n=e.getCompileCommands()?.find(s=>fe(s.file,r));if(!n)return;let i=`${n.command.replace(/-(o|c)\s+\S+/g,"")} -E -dM ${n.file}`;try{let[s,...o]=i.split(" "),a=await IU(s,o.filter(u=>!!u)),c=Qi.create(`macros://${n.file}`,"devicetree",0,a),l=YC(c,t,c.positionAt(a.length-1));if(l)return l[0]}catch(s){console.error(s)}}function ee(t){return t.toLowerCase().replace(/[@,-\.]/g,"_")}var Uc=M(F());async function KC({macro:t,context:e}){if(t.macro&&"DT_ALIAS".startsWith(t.macro))return[{label:"DT_ALIAS(...)",insertText:"DT_ALIAS($1)",kind:Uc.CompletionItemKind.Function,insertTextFormat:Uc.InsertTextFormat.Snippet}];if(t.parent?.macro!=="DT_ALIAS"||t.argIndexInParent!==0)return[];let r=await e.getRuntime();return r.rootNode.getNode("aliases")?.property.map(n=>{let i=n.ast.getFlatAstValues()?.at(0),s;return i instanceof se?s=i.linksTo:i instanceof An&&(s=i.pathParts.at(-1)?.linksTo),{label:ee(n.name),kind:Uc.CompletionItemKind.Property,documentation:s?.toMarkupContent(r.context.macros)}})??[]}var Hc=M(F());async function fr(t,e,r){if(!t)return;let i=t?.property.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();return i?.length===0?!0:i?.map(s=>{if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo;if(s instanceof se)return s.linksTo;if(s instanceof ie)return s.value;if(s instanceof we){let o=s.evaluate(r.macros);return typeof o=="number"?o:s.toString()}})}async function Vf({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?fr(o,s[1].macro,r):void 0}async function XC(t,e){let r=await Vf(t,e);if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof Q)return n}async function JC(t,e,r,n){if(r=typeof r=="number"?r:Ie(r),typeof r!="number")return;let i=await fr(t,e,n);if(i===!0)return!0;if(!i)return;let s=i.at(r);if(s)return i.length===1&&i[0]instanceof Q?i[0]:s}async function zf({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_BY_IDX"||e.args?.length!==3))return JC(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro,r)}async function QC(t,e){let r=await zf(t,e);if(typeof r!="boolean"&&r instanceof Q)return r}async function qr(t,{document:e,context:r,macro:n,position:i},s){return t||(await s({document:e,macro:n,context:r,position:i})??n.macro)}async function Wf(t,e,r,n){return qr(await fr(t,e,r.context),r,n)}async function ua({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_OR"||e.args?.length!==3)return;let[s,o,a]=e.args,c=await i({document:t,macro:s,context:r,position:n});return await Wf(c,o.macro,{macro:a,document:t,context:r,position:n},i)}async function ZC(t,e){let r=await ua(t,e);if(r instanceof Q)return r;if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof Q)return n}async function eD(t){let e=t?.nodeType?.onBus,r=t?.parent?.nodeType?.bus;return t&&r?.length&&r?.some(n=>n===e)?t.parent??void 0:void 0}async function Gf(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_BUS"||r?.length!==1)return;let n=await e({...t,macro:r[0]});return await eD(n)}async function Yf(t,e){let r=(await t.getRuntime()).rootNode.getChild(["/","chosen"]);if(!r)return;let s=r?.property.find(o=>ee(o.name)===e)?.ast.getFlatAstValues()?.at(0);if(s instanceof se)return s.linksTo;if(s instanceof it)return s.path?.pathParts.at(-1)?.linksTo}async function Kf(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_CHOSEN"||e?.length!==1))return await Yf(t.context,e[0].macro)}async function Xf(t,e){let r=await e?.getRuntime();if(r){let n=ti.getNodeFromPath(["aliases"],r.rootNode,!0),i=n?.property.find(o=>ee(o.name)===t);if(!i)return;let s=i.ast.getFlatAstValues();return s?.[0]instanceof ie?n=r.rootNode.getChild(s[0].value.split("/")):s?.[0]instanceof se?n=s[0].linksTo:s?.[0]instanceof it&&(n=s[0].path?.pathParts.at(-1)?.linksTo),n}}async function Jf({macro:t,context:e}){if(!(t.macro!=="DT_ALIAS"||t.args?.length!==1))return Xf(t.args[0].macro,e)}async function tD(t,e){return t?.nodes.find(r=>ee(r.name)===e)}async function Qf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD"||e.args?.length!==2)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return tD(s,e.args[1].macro)}var mv=(t,e)=>t.nodes.filter(r=>!r.disabled&&r.nodeType).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...mv(r,e)]:mv(r,e));async function rD(t,e){let r=await e?.getRuntime();if(r)return mv(r.rootNode,t)}async function gv({macro:t,context:e}){if(!(t.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.args?.length!==1))return rD(t.args[0].macro,e)}async function nD(t){return(await gv(t))?.at(0)}async function iD(t){return t?.parent?.parent??void 0}async function Zf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_GPARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return iD(s)}var yv=(t,e)=>t.nodes.filter(r=>r.nodeType).sort((r,n)=>r.disabled===n.disabled?0:r.disabled?1:-1).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...yv(r,e)]:yv(r,e));async function sD(t,e,r){let n=await r?.getRuntime();if(n)return yv(n.rootNode,e).at(t)}async function ep({macro:t,context:e}){if(t.macro!=="DT_INST"||t.args?.length!==2)return;let r=Ie(t.args[0].macro);if(typeof r=="number")return sD(r,t.args[1].macro,e)}async function oD(t,e){let r=await e?.getRuntime(),n=r?.resolvePath([`&${t.trim()}`]);if(r&&n)return ti.getNodeFromPath(n.slice(1),r.rootNode,!0)}async function tp({macro:t,context:e}){if(!(t.macro!=="DT_NODELABEL"||t.args?.length!==1))return oD(t.args[0].macro,e)}async function aD(t){return t?.parent??void 0}async function rp({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return aD(s)}var cD=(t,e)=>{if(!e.length)return t;let r=e.splice(0,1)[0],n=t.nodes.find(i=>ee(i.fullName)===r);return n?cD(n,e):void 0};async function np(t,e){let r=await e?.getRuntime();if(r)return cD(r.rootNode,t)}async function ip({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_PATH"||!r?.length))return np(r.map(n=>n.macro),e)}async function sp({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_ROOT"||r?.length))return(await e.getRuntime()).rootNode}async function da(t,e,r){let n=t?.property.find(c=>ee(c.name)===e);if(!n)return;let i=n?.ast.quickValues?.at(r),s=n.parent.nodeType;if(Array.isArray(i)||!s||!(s instanceof Pt))return;let a=s.properties.find(c=>c.getNameMatch(n.name))?.values(n).findIndex(c=>c===i)??-1;return a===-1?void 0:a}async function op(t,e,r,n,i){return qr(await da(t,e,r),n,i)}async function ap({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await op(o,s[1].macro,a,{macro:s[3],document:t,context:r,position:n},i)}async function cp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await op(o,s[1].macro,0,{macro:s[2],document:t,context:r,position:n},i)}async function cs(t,e,r,n,i){let s=t?.property.find(d=>ee(d.name)===e),o=s?.parent.nodeType;if(!o||!(o instanceof Pt))return;if(typeof r=="string"){let d=s.nexusMapsTo.at(0)?.specifierSpace;if(r=(d?s.parent.getProperty(`${d}-names`)?.ast.quickValues:void 0)?.findIndex(p=>typeof p=="string"&&p.toLowerCase()===r)??-1,r===-1)return}let a=s.nexusMapsTo.at(r),l=a?.target.nodeType?.cellsValues?.find(d=>a.specifierSpace&&d.specifier===a.specifierSpace)?.values?.indexOf(n);if(l===void 0||l===-1)return;let u=a?.mappingValuesAst.at(l);if(u instanceof we){let d=u.evaluate(i.macros);return typeof d!="number"?u.toString():d}}async function fa(t,e,r,n,i,s){return qr(await cs(t,e,r,n,i.context),i,s)}async function lp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return fa(o,s[1].macro,a,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function up({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n});return fa(o,s[1].macro,s[2].macro,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function ri(t,e,r=0){let n=t?.property.find(s=>ee(s.name)===e);if(r=typeof r=="number"?r:Ie(r??"0"),typeof r!="number")return;let i=n?.ast.getFlatAstValues()?.at(r);if(i instanceof se)return i.linksTo;if(i instanceof it)return i.path?.pathParts.at(-1)?.linksTo}async function ls({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,0)}async function ni({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ri(o,s[1].macro,s.at(2)?.macro)}async function lD(t,e,r){let n=t?.property.find(l=>ee(l.name)===e);if(!n)return;let i=n.parent.nodeType;if(!i||!(i instanceof Pt))return;let s=n.nexusMapsTo.at(0)?.specifierSpace,a=(s?n.parent.getProperty(`${s}-names`)?.ast.quickValues:void 0)?.findIndex(l=>typeof l=="string"&&l.toLowerCase()===r)??-1;return a===-1?void 0:n.nexusMapsTo.at(a)?.target}async function dp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_NAME"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await lD(o,s[1].macro,s[2].macro)}async function fp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return fa(o,s[1].macro,0,s[2].macro,{macro:s[3],document:t,context:r,position:n},i)}async function pp({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX_OR"||e.args?.length!==5)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return Wf(s,e.args[3].macro,{macro:e.args[4],document:t,context:r,position:n},i)}async function hp(t,e){if(!t)return;let r=t?.property.find(n=>ee(n.name)===e);return r?.nexusMapsTo.length?r.nexusMapsTo.length:r?.ast.getFlatAstValues()?.length}async function uD(t,e,r,n){if(t)return qr(await hp(t,e),r,n)}async function mp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?uD(o,s[1].macro,{macro:s[2],document:t,context:r,position:n},i):void 0}async function pa(t,e){if(!t)return;let n=t?.property.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ie)return ee(n[0].value)}async function dD(t,e,r,n){if(t)return qr(await pa(t,e),r,n)}async function gp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return dD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function yp(t,e){if(!t)return;let n=t?.property.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ie)return n[0].value}async function fD(t,e,r,n){if(t)return qr(await yp(t,e),r,n)}async function vp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return fD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function Tp(t,e){return(await pa(t,e))?.toUpperCase()}async function pD(t,e,r,n){if(t)return qr(await Tp(t,e),r,n)}async function bp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return pD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}function On(t){return async(e,r)=>{let n=await t(e,r);if(n instanceof Q)return n}}async function x({macro:t,document:e,context:r,position:n}){["DT_ALIAS","DT_NODELABEL"].some(a=>a===t.parent?.macro)||t.parent?.macro==="DT_CHILD"&&t.argIndexInParent===1?t=t.parent:t.parent?.macro==="DT_HAS_ALIAS"?(t=t.parent,t.macro="DT_ALIAS"):t.parent?.macro==="DT_PATH"&&(t.parent.args=t.parent.args?.slice(0,(t.argIndexInParent??0)+1)??[],t=t.parent);let s=await[Gf,Kf,Jf,Qf,nD,Zf,ep,tp,rp,ip,ls,ni,dp,QC,XC,ZC,sp,On(ap),On(cp),On(lp),On(up),On(fp),On(pp),On(mp),On(ua),On(gp),On(vp),On(bp)].reduce((a,c)=>a.then(l=>l||c({macro:t,document:e,context:r,position:n},x)),Promise.resolve(void 0));if(s)return Array.isArray(s)?s.at(0):s;let o=await as(e,t.macro,n,r);if(o)return x({document:e,macro:o[0],context:r,position:n})}async function hD({macro:t,document:e,context:r,position:n}){return t.macro&&t.macro&&"DT_CHILD".startsWith(t.macro)?[{label:"DT_CHILD(...)",insertText:"DT_CHILD($1, $2)",kind:Hc.CompletionItemKind.Function,insertTextFormat:Hc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_CHILD"||t.argIndexInParent!==1||!t.parent.args?.length?[]:(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.nodes.map(s=>({label:ee(s.fullName),kind:Hc.CompletionItemKind.Class,documentation:s.toMarkupContent(r.macros)}))??[]}var Vc=M(F());function mD({macro:t,context:e}){return t.macro&&"DT_COMPAT_GET_ANY_STATUS_OKAY".startsWith(t.macro)?[{label:"DT_COMPAT_GET_ANY_STATUS_OKAY(...)",insertText:"DT_COMPAT_GET_ANY_STATUS_OKAY($1)",kind:Vc.CompletionItemKind.Function,insertTextFormat:Vc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.argIndexInParent!==0?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:Vc.CompletionItemKind.Property}))??[]}var zc=M(F());function gD({macro:t,context:e}){return t.macro&&"DT_INST".startsWith(t.macro)?[{label:"DT_INST(...)",insertText:"DT_INST($1, $2)",kind:zc.CompletionItemKind.Function,insertTextFormat:zc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_INST"||t.argIndexInParent!==1?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:zc.CompletionItemKind.Property}))??[]}var Wc=M(F());async function yD({macro:t,context:e}){if(t.macro&&"DT_NODELABEL".startsWith(t.macro))return[{label:"DT_NODELABEL(...)",insertText:"DT_NODELABEL($1)",kind:Wc.CompletionItemKind.Function,insertTextFormat:Wc.InsertTextFormat.Snippet}];let r=await e.getRuntime();return t.parent?.macro!=="DT_NODELABEL"||t.argIndexInParent!==0?[]:await Promise.all(r.rootNode.allDescendantsLabels.map(async n=>({label:n.label.value,kind:Wc.CompletionItemKind.Property,documentation:n.lastLinkedTo?.toMarkupContent(r.context.macros)}))??[])}var Gc=M(F());async function vD({macro:t,context:e}){return t.macro&&t.macro&&"DT_PATH".startsWith(t.macro)?[{label:"DT_PATH(...)",insertText:"DT_PATH($1)",kind:Gc.CompletionItemKind.Function,insertTextFormat:Gc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_PATH"||!t.parent.args?.length?[]:(await np(t.parent.args.slice(0,-1).map(n=>n.macro),e))?.nodes.map(n=>({label:ee(n.fullName),kind:Gc.CompletionItemKind.Class,documentation:n.toMarkupContent(e.macros)}))??[]}var TD=M(F());async function bD({macro:t,context:e}){if(t.macro&&t.macro&&"DT_ROOT".startsWith(t.macro)){let r=await e.getRuntime();return[{label:"DT_ROOT",kind:TD.CompletionItemKind.Class,documentation:r.rootNode.toMarkupContent(r.context.macros)}]}return[]}var _p=M(F());function _D({macro:t}){return t.macro&&t.macro&&"DT_SAME_NODE".startsWith(t.macro)?[{label:"DT_SAME_NODE(...)",insertText:"DT_SAME_NODE($1, $2)",kind:_p.CompletionItemKind.Snippet,insertTextFormat:_p.InsertTextFormat.Snippet}]:[]}var Yc=M(F());async function Z({macro:t,document:e,position:r,context:n},i,s,o,a,c=l=>x({document:e,macro:l,context:n,position:r})){if(t.macro&&t.macro&&i.startsWith(t.macro))return[{label:`${i}(...)`,insertText:`${i}(${Array(o).map((d,f)=>`${f+1}`).join(", ")})`,kind:Yc.CompletionItemKind.Function,insertTextFormat:Yc.InsertTextFormat.Snippet}];if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let l=await c(t.parent.args[0]);return(a?l?.property.filter(a):l?.property)?.map(d=>({label:ee(d.name),kind:Yc.CompletionItemKind.Property,documentation:d.toPrettyString(n.macros)}))??[]}async function SD(t){return Z(t,"DT_ENUM_HAS_VALUE",1,3)}async function ND(t){return Z(t,"DT_ENUM_HAS_VALUE_BY_IDX",1,4)}async function PD(t){return Z(t,"DT_ENUM_IDX",1,2)}async function RD(t){return Z(t,"DT_ENUM_IDX_BY_IDX",1,3)}async function ED(t){return Z(t,"DT_ENUM_IDX_BY_IDX_OR",1,4)}async function wD(t){return Z(t,"DT_ENUM_IDX_OR",1,3)}var kD=M(F());async function ki({macro:t,document:e,context:r,position:n},i,s,o){if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let c=(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.property.find(f=>ee(f.name)===t.parent?.args?.at(1)?.macro),l=0;if(typeof o=="string"){let f=c?.nexusMapsTo.at(0)?.specifierSpace;if(l=(f?c.parent.getProperty(`${f}-names`)?.ast.quickValues:void 0)?.findIndex(y=>typeof y=="string"&&y.toLowerCase()===o)??-1,l===-1)return[]}let u=c?.nexusMapsTo.at(l);return u?.target.nodeType?.cellsValues?.find(f=>u.specifierSpace&&f.specifier===u.specifierSpace)?.values.map(f=>({label:ee(f),kind:kD.CompletionItemKind.Property}))??[]}async function CD(t){return t.macro.argIndexInParent===2?ki(t,"DT_PHA",2,0):Z(t,"DT_PHA",1,3,e=>!!e.nexusMapsTo.length)}var DD=M(F());async function xU({document:t,macro:e,position:r,context:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:n,position:r}))?.property.find(a=>ee(a.name)===e.parent?.args?.at(1)?.macro);return Array(o?.nexusMapsTo.length??0)?.map((a,c)=>({label:c.toString(),kind:DD.CompletionItemKind.Property}))??[]}async function AD(t){if(t.macro.argIndexInParent===2)return xU(t,"DT_PHA_BY_IDX");if(t.macro.argIndexInParent===3){let e=t.macro.parent?.args?Ie(t.macro.parent.args[2].macro):void 0;return typeof e!="number"?[]:ki(t,"DT_PHA_BY_IDX",3,e)}return Z(t,"DT_PHA_BY_IDX",1,3,e=>!!e.nexusMapsTo.length)}var ID=M(F());async function Kc({document:t,macro:e,context:r,position:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:r,position:n}))?.property.find(l=>ee(l.name)===e.parent?.args?.at(1)?.macro),a=o?.nexusMapsTo.at(0)?.specifierSpace;return(a?o.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.filter(l=>typeof l=="string")?.map(l=>({label:l,kind:ID.CompletionItemKind.Property}))??[]}async function OD(t){let{macro:e}=t;return e.argIndexInParent===2?Kc(t,"DT_PHA_BY_NAME"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?ki(t,"DT_PHA_BY_NAME",3,e.parent.args[2].macro):[]:Z(t,"DT_PHA_BY_NAME",1,3,r=>!!r.nexusMapsTo.length)}async function xD(t){let{macro:e}=t;return e.argIndexInParent===2?Kc(t,"DT_PHA_BY_NAME_OR"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?ki(t,"DT_PHA_BY_NAME_OR",3,e.parent.args[2].macro):[]:Z(t,"DT_PHA_BY_NAME_OR",1,3,r=>!!r.nexusMapsTo.length)}async function MD(t){let{macro:e}=t;return e.argIndexInParent===2?ki(t,"DT_PHA_OR",2,0):Z(t,"DT_PHA_OR",1,3,r=>!!r.nexusMapsTo.length)}async function Sp(t){return Z(t,"DT_PHANDLE",1,2,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof se||r instanceof it))}async function ha(t){return Z(t,"DT_PHANDLE_BY_IDX",1,3,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof se||r instanceof it))}async function qD(t){let{macro:e}=t;return e.argIndexInParent===2?Kc(t,"DT_PHANDLE_BY_NAME"):Z(t,"DT_PHANDLE_BY_NAME",1,3,r=>!!r.ast.getFlatAstValues()?.some(n=>n instanceof se||n instanceof it))}async function LD(t){return Z(t,"DT_PROP",1,2,e=>!e.nexusMapsTo.length)}async function $D(t){return Z(t,"DT_PROP_BY_IDX",1,3,e=>!e.nexusMapsTo.length)}async function BD(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX"?ha({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):Z(t,"DT_PROP_BY_PHANDLE_IDX",3,4,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function FD(t){let{macro:e}=t;return e.argIndexInParent===1&&e.parent?.macro==="DT_PROP_BY_PHANDLE"?Sp({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE"}:void 0}}):Z(t,"DT_PROP_BY_PHANDLE",2,3,r=>!r.nexusMapsTo.length,()=>ls({...t,macro:{macro:"DT_PHANDLE",args:e.parent?.args?.slice(0,2)}},x))}async function jD(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX_OR"?ha({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):Z(t,"DT_PROP_BY_PHANDLE_IDX_OR",3,5,r=>!r.nexusMapsTo.length,()=>ni({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function UD(t){return Z(t,"DT_PROP_HAS_IDX",1,3,e=>!e.nexusMapsTo.length)}async function HD(t){return Z(t,"DT_PROP_HAS_NAME",1,3,e=>!e.nexusMapsTo.length)}async function VD(t){return Z(t,"DT_PROP_LAST",1,2,e=>!e.nexusMapsTo.length)}async function zD(t){return Z(t,"DT_PROP_LEN",1,2,e=>!e.nexusMapsTo.length)}async function WD(t){return Z(t,"DT_PROP_LEN_OR",1,2,e=>!e.nexusMapsTo.length)}async function GD(t){return Z(t,"DT_PROP_OR",1,2,e=>!e.nexusMapsTo.length)}async function YD(t){return Z(t,"DT_STRING_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function KD(t){return Z(t,"DT_STRING_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function XD(t){return Z(t,"DT_STRING_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function JD(t){return Z(t,"DT_STRING_UNQUOTED",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function QD(t){return Z(t,"DT_STRING_UNQUOTED_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function ZD(t){return Z(t,"DT_STRING_UNQUOTED_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function eA(t){return Z(t,"DT_STRING_UPPER_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function tA(t){return Z(t,"DT_STRING_UPPER_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function rA(t){return Z(t,"DT_STRING_UPPER_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}var Xc=M(F());async function nA({macro:t,context:e}){return t.parent?.macro==="DT_ON_BUS"&&t.argIndexInParent===1?e.bindingLoader?.getBusTypes().map(r=>({label:ee(r),kind:Xc.CompletionItemKind.Enum}))??[]:t.macro&&"DT_ON_BUS".startsWith(t.macro)?[{label:"DT_ON_BUS(...)",insertText:"DT_ON_BUS($1, $2)",kind:Xc.CompletionItemKind.Function,insertTextFormat:Xc.InsertTextFormat.Snippet}]:[]}async function iA(t){return Z(t,"DT_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}async function sA(t){return Z(t,"DT_HAS_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}var MU=["DT_BUS","DT_CHILD_NUM","DT_CHILD_NUM_STATUS_OKAY","DT_GPARENT","DT_HAS_ALIAS","DT_NODE_CHILD_IDX","DT_NODE_FULL_NAME","DT_NODE_FULL_NAME_TOKEN","DT_NODE_FULL_NAME_UNQUOTED","DT_NODE_FULL_NAME_UPPER_TOKEN","DT_NODE_HASH","DT_NODE_PATH","DT_NODELABEL_STRING_ARRAY","DT_PARENT"];async function oA(t,e,r){if(!r)return[];let n=wi(r,t.position);return n?(await Promise.all([nA,iA,sA,KC,hD,mD,gD,qU,yD,vD,bD,_D,ND,SD,RD,ED,PD,wD,AD,OD,xD,CD,ha,qD,Sp,MD,$D,FD,BD,jD,LD,UD,HD,VD,zD,WD,GD,YD,KD,XD,JD,QD,ZD,eA,tA,rA].flatMap(async i=>await i({document:r,context:e,macro:n,position:t.position})))).flat():[]}function qU({macro:t}){return t.macro?MU.filter(e=>e.startsWith(t.macro)).map(e=>({label:`${e}(...)`,insertText:`${e}($1)`,kind:Np.CompletionItemKind.Function,insertTextFormat:Np.InsertTextFormat.Snippet})):[]}var ii=M(F());function LU(t){if(!t||t.item===null||!(t.ast instanceof Ze))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if(i instanceof Ye)return ii.Location.create(ve(i.uri),ce(i.propertyName??i));if(i instanceof ht)return ii.Location.create(ve(i.uri),ce(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof Ze)return r(e(t.item));if(t.item instanceof Q&&t.ast instanceof Ze&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function $U(t){if(!t)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===r)return!0}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&(o.by.nodeNameOrRef instanceof He?o.by.nodeNameOrRef!==t.ast:!r.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedRefLabels,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof Nt)return ii.Location.create(ve(o.uri),ce(o.name??o));if(o instanceof Ue)return ii.Location.create(ve(o.uri),ce(o.name??o));if(o instanceof He)return ii.Location.create(ve(o.uri),ce(o));if(o instanceof He)return ii.Location.create(ve(o.uri),ce(o));if(o instanceof se)return ii.Location.create(ve(o.uri),ce(o.label??o));if(o instanceof Ye)return ii.Location.create(ve((o.values??o)?.uri),ce(o.values??o))}).filter(o=>o)};if(t.item instanceof Q&&!Ut(t.ast))return e(t.item);if(t.ast instanceof rr&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return Ut(t.ast)?[...e(t.ast.linksTo),ii.Location.create(ve(t.ast.uri),ce(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return e(r)}return[]}async function aA(t,e){return St(t,e,r=>[...$U(r),...LU(r)])}var Ci=M(F());function cA(t){if(!t||t.item===null||!(t.ast instanceof Ze))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if((i instanceof Ye||i instanceof ht)&&i.propertyName)return Ci.Location.create(ve(i.uri),ce(i.propertyName))}).filter(i=>i);if(t.item instanceof Xe&&t.ast instanceof Ze)return r(e(t.item));if(t.item instanceof Q&&t.ast instanceof Ze&&t.ast.parentNode instanceof ht){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function lA(t,e){if(!e||!(e.ast instanceof rr))return[];"newName"in t&&(e.ast.parentNode instanceof se&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof es&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let r=e.ast.value,n=i=>[...i.definitions.filter(s=>s instanceof Ue).flatMap(s=>s.labels.map(o=>o.label)),...i.referencedBy.flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===r).map(s=>{if(s)return Ci.Location.create(ve(s.uri),ce(s))}).filter(s=>s);return e.item instanceof Q&&!Ut(e.ast)?n(e.item):e.ast instanceof rr&&e.ast.parentNode instanceof se&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function uA(t){if(!t||!(t.ast instanceof He))return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=t.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(r)||c===r)return!0}}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof Ue&&o.name)return Ci.Location.create(ve(o.uri),ce(o.name));if(o instanceof He)return Ci.Location.create(ve(o.uri),ce(o));if(o instanceof Ye&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof ie){let a=o.values.values[0].value,c=ce(a),l=a.value.split("/"),u=r.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,Ci.Location.create(ve(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof Q&&!Ut(t.ast)?e(t.item):t.ast instanceof He&&t.ast.linksTo?Ut(t.ast)?[...e(t.ast.linksTo),Ci.Location.create(ve(t.ast.uri),ce(t.ast))]:e(t.ast.linksTo):[]}async function dA(t,e){let r={};return(await St(t,e,i=>[...uA(i),...lA(t,i),...cA(i)])).forEach(i=>{r[i.uri]??=[],r[i.uri].push(Ci.TextEdit.replace(i.range,t.newName))}),{changes:r}}async function fA(t,e){let r=await St(t,e,n=>[...uA(n),...lA(t,n),...cA(n)]);if(r.some(n=>e?.settings.lockRenameEdits?.some(i=>De(n.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var ma=M(F());var Pp=t=>[...t.definitions,...t.referencedBy].map(e=>{if(e instanceof Nt)return ma.Location.create(ve(e.uri),ce(e));if(e instanceof Ue)return ma.Location.create(ve(e.uri),ce(e));if(e instanceof Yt)return ma.Location.create(ve(e.uri),ce(e))}).filter(e=>e),hA=t=>t.replacedBy?hA(t.replacedBy):t,pA=t=>[t.ast,...t.allReplaced.map(e=>e.ast)].map(e=>{if(e instanceof Ye)return ma.Location.create(ve(e.uri),ce(e.propertyName??e))}).filter(e=>e);function BU(t){if(!t||t.item===null||!(t.ast instanceof Ze))return[];if(t.item instanceof Xe&&t.ast instanceof Ze)return pA(hA(t.item));if(t.item instanceof Q&&t.ast instanceof Ze&&t.ast.parentNode instanceof ht){let e=t.item.deletedProperties.find(r=>r.by===t.ast.parentNode)?.property;if(e)return pA(e)}return[]}function FU(t){if(!t)return[];if(t.item instanceof Q&&!Ut(t.ast))return Pp(t.item);if(t.ast instanceof rr&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return Pp(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return Pp(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return Pp(e)}return[]}function jU(t){if(t?.ast instanceof Ct||t?.ast instanceof Xn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return[ma.Location.create(ve(e.macro.uri),ce(e.macro.identifier))]}return[]}async function mA(t,e){return St(t,e,r=>[...FU(r),...BU(r),...jU(r)])}var Jc=M(F());var us=t=>{let e=t.definitions.at(0);return e?Jc.Location.create(ve(e.uri),ce(e)):void 0},Rp=t=>t.replaces?Rp(t.replaces):t,Ep=t=>{let e=Rp(t);return e?Jc.Location.create(ve(e.ast.uri),ce(e.ast)):void 0};function UU(t){if(!t||t.item===null||!(t.ast instanceof Ze))return;let e=r=>Jc.Location.create(ve(r.ast.uri),ce(r.ast.propertyName??r.ast));if(t.item instanceof Xe&&t.ast instanceof Ze)return e(Rp(t.item));if(t.item instanceof Q&&t.ast instanceof Ze&&t.ast.parentNode instanceof ht){let r=t.item.deletedProperties.find(n=>n.by===t.ast.parentNode)?.property;if(r)return e(Rp(r))}}function HU(t){if(t){if(t.item instanceof Q&&!Ut(t.ast))return us(t.item);if(t.ast instanceof rr&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return us(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return us(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Xe&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return us(e)}}}function VU(t){if(t?.ast instanceof Ct||t?.ast instanceof Xn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return Jc.Location.create(ve(e.macro.uri),ce(e.macro.identifier))}}async function gA(t,e){return(await St(t,e,r=>[HU(r)||UU(r)||VU(r)])).at(0)}var zU=["DT_PROP","DT_PROP_LEN","DT_PROP_LEN_OR","DT_PROP_HAS_IDX","DT_PROP_HAS_NAME","DT_PROP_BY_IDX","DT_PROP_LAST","DT_PROP_OR","DT_ENUM_IDX_BY_IDX","DT_ENUM_IDX","DT_ENUM_IDX_BY_IDX_OR","DT_ENUM_IDX_OR","DT_ENUM_HAS_VALUE_BY_IDX","DT_ENUM_HAS_VALUE","DT_STRING_TOKEN","DT_STRING_TOKEN_OR","DT_STRING_UPPER_TOKEN","DT_STRING_UPPER_TOKEN_OR","DT_STRING_UNQUOTED","DT_STRING_UNQUOTED_OR","DT_STRING_TOKEN_BY_IDX","DT_STRING_UPPER_TOKEN_BY_IDX","DT_STRING_UNQUOTED_BY_IDX","DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR","DT_PROP_BY_PHANDLE","DT_PHA_BY_IDX","DT_PHA_BY_IDX_OR","DT_PHA","DT_PHA_OR","DT_PHA_BY_NAME","DT_PHA_BY_NAME_OR","DT_PHANDLE_BY_NAME","DT_PHANDLE_BY_IDX","DT_PHANDLE"];async function wp({macro:t,document:e,context:r,position:n}){if(zU.some(i=>i===t.parent?.macro)&&t.argIndexInParent===1&&t.parent?.args?.[0])return(await x({document:e,context:r,position:n,macro:t.parent.args[0]}))?.property.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===2&&t.parent?.args?.[0]&&t.parent?.args?.[1])return(await ls({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE",args:t.parent.args.slice(0,2)}},x))?.property.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===3&&t.parent?.args?.[0]&&t.parent?.args?.[1]&&t.parent?.args?.[3])return(await ni({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE_BY_IDX",args:t.parent.args.slice(0,3)}},x))?.property.find(s=>ee(s.name)===t.macro);if(["DT_CHOSEN","DT_HAS_CHOSEN"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===0&&t.parent?.args?.[0])return(await r.getRuntime()).rootNode.getChild(["/","chosen"])?.property.find(i=>ee(i.name)===t.macro)}async function yA(t,e,r){if(!r)return;let n=wi(r,t.position);return vA(n,t.position,e,r)}async function vA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return us(i);let s=await wp({document:n,macro:t,context:r,position:e});if(s)return Ep(s);let o=await as(n,t.macro,e,r);if(o)return vA(o[0],o[1],r,n)}async function TA(t,e,r){if(!r)return;let n=wi(r,t.position);return bA(n,t.position,e,r)}async function bA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return us(i);let s=await wp({document:n,macro:t,context:r,position:e});if(s)return Ep(s);let o=await as(n,t.macro,e,r);if(o)return bA(o[0],o[1],r,n)}var ue=M(F());var WU=(t,e,r,n,i)=>{switch(r){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(ue.Range.create(ue.Position.create(n.range.start.line,t.pos.colEnd),ue.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[ue.TextEdit.insert(ue.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},GU=(t,e,r,n,i)=>{if(!n?.length)return[];switch(t){case 0:return[{title:i??`Add Property "${n[0].newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 36:return[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 25:return n?[{title:i??"TODO",diagnostics:[e],kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}]:[];default:return}};function _A(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>WU(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>GU(l,a,t.textDocument.uri,c.issues.edit?Array.isArray(c.issues.edit)?c.issues.edit:[c.issues.edit]:void 0,c.issues.codeActionTitle))}}).filter(a=>!!a),r=e.filter(a=>a.kind===ue.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==ue.CodeActionKind.SourceFixAll),s=r.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[t.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)}),[...i,...r.map(a=>({...a,kind:ue.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:ue.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ue.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var SA=M(F());var kp=t=>!t||t instanceof Ye?!1:t instanceof _r||kp(t.parentNode);function YU(t){if(!t||!(t.item instanceof Xe&&t.item.ast.assignOperatorToken))return[];let e=kp(t?.ast);if(!e&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!kp(t.beforeAst)&&!kp(t.afterAst))return[];let r=-1;if(t.item.ast.values===null?r=0:r=(t.item.ast.values?.values.findIndex(i=>i&&Vy(i,t.beforeAst))??-1)+1,r===-1&&(r=0),t.item.name==="compatible"){let s=t.item.parent.nodeTypes.filter(c=>c).at(-1),o=t.item.ast.quickValues,a;return s instanceof Pt&&s.extends.size&&(a=Array.from(s.extends).filter(c=>!o||!o.includes(c))),o?.filter(c=>c)?.length&&!a?[]:(a??=t.runtime.context.bindingLoader?.getBindings()??[],a.filter(c=>!o||!o.includes(c)).map(c=>({label:`"${c}"`,kind:SA.CompletionItemKind.Variable,insertText:e?c:`"${c}"`})))}let n=t.item.parent.nodeType;return n instanceof Pt?n.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,r,e)??[]:[]}function KU(t){if(!t||!(t.item instanceof Xe&&t.ast instanceof Ze&&t.item.ast.values==null||t.item instanceof Q)||Ut(t.ast)||t.beforeAst?.parentNode instanceof br)return[];let e=r=>r.nodeType?.getPropertyListCompletionItems(r)??[];return t.item instanceof Xe?e(t.item.parent):e(t.item)}async function NA(t,e){return St(t,e,r=>[...YU(r),...KU(r)])}var Cp=M(F());async function XU(t){if(t?.ast instanceof Ct||t?.ast instanceof Xn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ct?t.ast.name:t.ast.value);if(e){let r=Ec(t.ast),n=(await t.runtime.context.getAllParsers()).at(-1);if(r){let i=r?.evaluate(n.cPreprocessorParser.macros);return{contents:{kind:Cp.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
|
|
287
|
-
`)},range:
|
|
288
|
-
`)},range:
|
|
289
|
-
${r?.value??""}`},range:
|
|
286
|
+
};`,kind:At.CompletionItemKind.Value,insertTextFormat:At.InsertTextFormat.Snippet}))]}function vU(t,e){let r=s=>s?s.parentNode instanceof Wt||s.parentNode instanceof St||s.parentNode instanceof Ue?!1:r(s.parentNode):!0;if(!t||t.item!==null||!jt(t.ast)||!r(t.ast))return[];let n=s=>Mf(s,e).filter(o=>e(o));if(t.ast instanceof ht)return n(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[];let i=new Map;return n(t.runtime.rootNode).forEach(s=>i.set(s.label.value,s)),Array.from(i).map(([,s])=>({label:t.ast instanceof se?`${s.label.value}`:`&${s.label.value}`,kind:At.CompletionItemKind.Variable,documentation:s.lastLinkedTo?.toMarkupContent(t.runtime.context.macros)}))}function TU(t,e){if(!t||!(t.item instanceof J)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof vr)||t.beforeAst?.parentNode instanceof pt))return[];let r=n=>[...n.nodes,...n.deletedNodes.filter(i=>!e(i.by)).map(i=>i.node)].flatMap(i=>({node:i,astNodes:i.definitions.filter(s=>s instanceof Ue)})).filter(i=>i.astNodes.some(e));return t.ast instanceof He||t.ast instanceof Dr||t.beforeAst?.parentNode instanceof Dr?r(t.item).map(n=>({label:`${n.astNodes.at(0)?.name?.toString()}`,kind:At.CompletionItemKind.Variable,documentation:n.node.toMarkupContent(t.runtime.context.macros)})):r(t.item).length?[{label:"/delete-node/",kind:At.CompletionItemKind.Keyword,insertTextFormat:At.InsertTextFormat.Snippet,sortText:"~"}]:[]}function bU(t,e){if(!t||!(t.item instanceof J)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof vr)||t.beforeAst?.parentNode instanceof Dr))return[];let r=n=>[...n.properties,...n.deletedProperties.filter(i=>!e(i.by)).map(i=>i.property)].flatMap(i=>[i,...i.allReplaced]).filter(i=>e(i.ast));if(t.ast instanceof Qe||t.ast instanceof pt||t.beforeAst?.parentNode instanceof pt){let n=new Map;return r(t.item).forEach(i=>n.set(i.name,i)),Array.from(n).map(([,i])=>({label:`${i.name}`,kind:At.CompletionItemKind.Variable,documentation:i.ast.toPrettyString(t.runtime.context.macros)}))}return r(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:At.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:At.InsertTextFormat.Snippet}]:[]}function _U(t,e){let r=t?.ast instanceof An?t.ast:t?.ast.parentNode;if(!t||!r||!(r instanceof An))return[];let n=r.pathParts.slice(0,-1);if(n.some(o=>!o))return[];let i=n.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...i],e);return[...o?.nodes.filter(a=>!jt(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]]})().map(o=>({label:`/${[...i,o.fullName].join("/")}`,kind:At.CompletionItemKind.Variable,documentation:o.toMarkupContent(t.runtime.context.macros)}))}function SU(t){return!t||!(t.item instanceof Ke&&t.item.ast.assignOperatorToken)||t.ast instanceof ie?[]:!js(t?.ast)&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!js(t.beforeAst)&&!js(t.afterAst)?[]:t.item.parent.nodeType instanceof Nt?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([,n])=>n.macro.identifier instanceof Qn?{label:`${n.macro.identifier.toString()}`,insertText:`${n.macro.name}(${n.macro.identifier.params.map((i,s)=>i instanceof Ct?`$${s+1}`:"").join(", ")})`,kind:At.CompletionItemKind.Function,sortText:`~${n.macro.name}`,insertTextFormat:At.InsertTextFormat.Snippet}:{label:n.macro.identifier.name,kind:At.CompletionItemKind.Variable,sortText:`~${n.macro.name}`}):[]}async function LC(t,e){return _t(t,e,(r,n)=>[...bU(r,n),...TU(r,n),...vU(r,n),..._U(r,n),...yU(r,n),...gU(r,n),...mU(r),...SU(r)])}var mp=L(j());var BC=require("child_process");var iv=t=>/[A-Za-z0-9_]/.test(t);function NU(t,e){let r=[];for(let n=0;n<e;n++){let i=t[n];i==="("?r.push(n):i===")"&&r.pop()}return r.length?r[r.length-1]:void 0}function $C(t,e){let r=1;for(let n=e+1;n<t.length;n++){let i=t[n];if(i==="(")r++;else if(i===")"&&(r--,r===0))return n}}function FC(t,e,r){let n=[],i=0,s=!1,o=!1,a=e;for(let f=e;f<r;f++){let p=t[f];if(p==="'"&&!o)s=!s;else if(p==='"'&&!s)o=!o;else if(!s&&!o){if(p==="(")i++;else if(p===")")i--;else if(p===","&&i===0){let g=a,h=f,v=g,S=h;for(;v<S&&/\s/.test(t[v]);)v++;for(;S>v&&/\s/.test(t[S-1]);)S--;n.push({start:g,end:h,text:t.slice(v,S)}),a=f+1}}}let c=a,l=r,u=c,d=l;for(;u<d&&/\s/.test(t[u]);)u++;for(;d>u&&/\s/.test(t[d-1]);)d--;return n.push({start:c,end:l,text:t.slice(u,d)}),n}function sv(t){let e=t.trim(),r=/^([A-Za-z_][A-Za-z0-9_]*)\s*\(([\s\S]*)\)$/.exec(e);if(!r)return{macro:e};let n=r[1],i=r[2],s=FC(i,0,i.length),o={macro:n,args:[]};return o.args=s.map(a=>{let c=sv(a.text);return c.parent=o,c}),o}function Ni(t,e){let r=t.getText(),n=t.offsetAt(e),i=n,s=n;for(;i>0&&iv(r[i-1]);)i--;for(;s<r.length&&iv(r[s]);)s++;if(r[s]==="("){let v=$C(r,s);v!==void 0&&(s=v+1)}let o=r.slice(i,s),a=o.trim().length?sv(o):void 0,c=NU(r,n);if(c===void 0)return a;let l=$C(r,c);if(l===void 0||!(c<n&&n<=l))return a;let u=c,d=u;for(;d>0&&iv(r[d-1]);)d--;let f=r.slice(d,u);if(!f)return a;let p=FC(r,c+1,l),g={macro:f,args:[]};g.args=p.map(v=>{let S=sv(v.text);return S.parent=g,S});let h=-1;for(let v=0;v<p.length;v++){let S=p[v];if(n>=S.start&&n<=S.end){h=v;break}}if(h>=0){let v=g.args[h];return v.argIndexInParent=h,v}return g}function RU(t,e,r){let i=t.getText().split(/\r?\n/),s=new RegExp(`^\\s*#\\s*define\\s+(${e})\\b(\\s*\\([^)]*\\))?\\s*(.*)$`);for(let o=Math.min(r.line,i.length-1);o>=0;o--){let a=i[o],c=s.exec(a);if(c){let l=a.indexOf(c[0]),u=a.indexOf(c[3],l);return zr.create(o,u>=0?u:a.length)}}}async function ns(t,e,r,n){let i=jC(t,e,r);if(i)return i;let s=await kU(e,n,De(t.uri));if(s)return[s,r]}function jC(t,e,r){if(e.startsWith("DT_"))return;let n=RU(t,e,r);if(!n)return;let i=Ni(t,n);if(i)return[i,n]}var PU=(t,e)=>new Promise(r=>{let n=(0,BC.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),i="";n.stdout.on("data",s=>{i+=s.toString()}),n.on("close",s=>{r(s?"":i)})});async function kU(t,e,r){let n=e.getCompileCommands()?.find(s=>de(s.file,r));if(!n)return;let i=`${n.command.replace(/-(o|c)\s+\S+/g,"")} -E -dM ${n.file}`;try{let[s,...o]=i.split(" "),a=await PU(s,o.filter(u=>!!u)),c=Yi.create(`macros://${n.file}`,"devicetree",0,a),l=jC(c,t,c.positionAt(a.length-1));if(l)return l[0]}catch(s){console.error(s)}}function ee(t){return t.toLowerCase().replace(/[@,-\.]/g,"_")}var xc=L(j());async function UC({macro:t,context:e}){if(t.macro&&"DT_ALIAS".startsWith(t.macro))return[{label:"DT_ALIAS(...)",insertText:"DT_ALIAS($1)",kind:xc.CompletionItemKind.Function,insertTextFormat:xc.InsertTextFormat.Snippet}];if(t.parent?.macro!=="DT_ALIAS"||t.argIndexInParent!==0)return[];let r=await e.getRuntime();return r.rootNode.getNode("aliases")?.properties.map(n=>{let i=n.ast.getFlatAstValues()?.at(0),s;return i instanceof se?s=i.linksTo:i instanceof An&&(s=i.pathParts.at(-1)?.linksTo),{label:ee(n.name),kind:xc.CompletionItemKind.Property,documentation:s?.toMarkupContent(r.context.macros)}})??[]}var Mc=L(j());async function ur(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();return i?.length===0?!0:i?.map(s=>{if(s instanceof nt)return s.path?.pathParts.at(-1)?.linksTo;if(s instanceof se)return s.linksTo;if(s instanceof ie)return s.value;if(s instanceof Ee){let o=s.evaluate(r.macros);return typeof o=="number"?o:s.toString()}})}async function qf({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?ur(o,s[1].macro,r):void 0}async function HC(t,e){let r=await qf(t,e);if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof J)return n}async function VC(t,e,r,n){if(r=typeof r=="number"?r:Ie(r),typeof r!="number")return;let i=await ur(t,e,n);if(i===!0)return!0;if(!i)return;let s=i.at(r);if(s)return i.length===1&&i[0]instanceof J?i[0]:s}async function Lf({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_BY_IDX"||e.args?.length!==3))return VC(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro,r)}async function zC(t,e){let r=await Lf(t,e);if(typeof r!="boolean"&&r instanceof J)return r}async function Or(t,{document:e,context:r,macro:n,position:i},s){return t||(await s({document:e,macro:n,context:r,position:i})??n.macro)}async function $f(t,e,r,n){return Or(await ur(t,e,r.context),r,n)}async function ra({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_OR"||e.args?.length!==3)return;let[s,o,a]=e.args,c=await i({document:t,macro:s,context:r,position:n});return await $f(c,o.macro,{macro:a,document:t,context:r,position:n},i)}async function WC(t,e){let r=await ra(t,e);if(r instanceof J)return r;if(typeof r=="boolean")return;let n=r?.at(0);if(r?.length===1&&n instanceof J)return n}async function GC(t){let e=t?.nodeType?.onBus,r=t?.parent?.nodeType?.bus;return t&&r?.length&&r?.some(n=>n===e)?t.parent??void 0:void 0}async function Bf(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_BUS"||r?.length!==1)return;let n=await e({...t,macro:r[0]});return await GC(n)}async function Ff(t,e){let r=(await t.getRuntime()).rootNode.getChild(["/","chosen"]);if(!r)return;let s=r?.properties.find(o=>ee(o.name)===e)?.ast.getFlatAstValues()?.at(0);if(s instanceof se)return s.linksTo;if(s instanceof nt)return s.path?.pathParts.at(-1)?.linksTo}async function jf(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_CHOSEN"||e?.length!==1))return await Ff(t.context,e[0].macro)}async function Uf(t,e){let r=await e?.getRuntime();if(r){let n=Zn.getNodeFromPath(["aliases"],r.rootNode,!0),i=n?.properties.find(o=>ee(o.name)===t);if(!i)return;let s=i.ast.getFlatAstValues();return s?.[0]instanceof ie?n=r.rootNode.getChild(s[0].value.split("/")):s?.[0]instanceof se?n=s[0].linksTo:s?.[0]instanceof nt&&(n=s[0].path?.pathParts.at(-1)?.linksTo),n}}async function Hf({macro:t,context:e}){if(!(t.macro!=="DT_ALIAS"||t.args?.length!==1))return Uf(t.args[0].macro,e)}async function YC(t,e){return t?.nodes.find(r=>ee(r.name)===e)}async function Vf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD"||e.args?.length!==2)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return YC(s,e.args[1].macro)}var ov=(t,e)=>t.nodes.filter(r=>!r.disabled&&r.nodeType).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...ov(r,e)]:ov(r,e));async function KC(t,e){let r=await e?.getRuntime();if(r)return ov(r.rootNode,t)}async function av({macro:t,context:e}){if(!(t.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.args?.length!==1))return KC(t.args[0].macro,e)}async function XC(t){return(await av(t))?.at(0)}async function JC(t){return t?.parent?.parent??void 0}async function zf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_GPARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return JC(s)}var cv=(t,e)=>t.nodes.filter(r=>r.nodeType).sort((r,n)=>r.disabled===n.disabled?0:r.disabled?1:-1).flatMap(r=>[r.nodeType.compatible,...Array.from(r.nodeType.extends)].filter(n=>!!n).map(n=>ee(n)).includes(e)?[r,...cv(r,e)]:cv(r,e));async function QC(t,e,r){let n=await r?.getRuntime();if(n)return cv(n.rootNode,e).at(t)}async function Wf({macro:t,context:e}){if(t.macro!=="DT_INST"||t.args?.length!==2)return;let r=Ie(t.args[0].macro);if(typeof r=="number")return QC(r,t.args[1].macro,e)}async function ZC(t,e){let r=await e?.getRuntime(),n=r?.resolvePath([`&${t.trim()}`]);if(r&&n)return Zn.getNodeFromPath(n.slice(1),r.rootNode,!0)}async function Gf({macro:t,context:e}){if(!(t.macro!=="DT_NODELABEL"||t.args?.length!==1))return ZC(t.args[0].macro,e)}async function eD(t){return t?.parent??void 0}async function Yf({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PARENT"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return eD(s)}var tD=(t,e)=>{if(!e.length)return t;let r=e.splice(0,1)[0],n=t.nodes.find(i=>ee(i.fullName)===r);return n?tD(n,e):void 0};async function Kf(t,e){let r=await e?.getRuntime();if(r)return tD(r.rootNode,t)}async function Xf({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_PATH"||!r?.length))return Kf(r.map(n=>n.macro),e)}async function Jf({macro:t,context:e}){let r=t.args;if(!(t.macro!=="DT_ROOT"||r?.length))return(await e.getRuntime()).rootNode}async function na(t,e,r){let n=t?.properties.find(c=>ee(c.name)===e);if(!n)return;let i=n?.ast.quickValues?.at(r),s=n.parent.nodeType;if(Array.isArray(i)||!s||!(s instanceof Nt))return;let a=s.properties.find(c=>c.getNameMatch(n.name))?.values(n).findIndex(c=>c===i)??-1;return a===-1?void 0:a}async function Qf(t,e,r,n,i){return Or(await na(t,e,r),n,i)}async function Zf({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await Qf(o,s[1].macro,a,{macro:s[3],document:t,context:r,position:n},i)}async function ep({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await Qf(o,s[1].macro,0,{macro:s[2],document:t,context:r,position:n},i)}async function is(t,e,r,n,i){let s=t?.properties.find(d=>ee(d.name)===e),o=s?.parent.nodeType;if(!o||!(o instanceof Nt))return;if(typeof r=="string"){let d=s.nexusMapsTo.at(0)?.specifierSpace;if(r=(d?s.parent.getProperty(`${d}-names`)?.ast.quickValues:void 0)?.findIndex(p=>typeof p=="string"&&p.toLowerCase()===r)??-1,r===-1)return}let a=s.nexusMapsTo.at(r),l=a?.target.nodeType?.cellsValues?.find(d=>a.specifierSpace&&d.specifier===a.specifierSpace)?.values?.indexOf(n);if(l===void 0||l===-1)return;let u=a?.mappingValuesAst.at(l);if(u instanceof Ee){let d=u.evaluate(i.macros);return typeof d!="number"?u.toString():d}}async function ia(t,e,r,n,i,s){return Or(await is(t,e,r,n,i.context),i,s)}async function tp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return ia(o,s[1].macro,a,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function rp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME_OR"||s?.length!==5)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ia(o,s[1].macro,s[2].macro,s[3].macro,{macro:s[4],document:t,context:r,position:n},i)}async function ei(t,e,r=0){let n=t?.properties.find(s=>ee(s.name)===e);if(r=typeof r=="number"?r:Ie(r??"0"),typeof r!="number")return;let i=n?.ast.getFlatAstValues()?.at(r);if(i instanceof se)return i.linksTo;if(i instanceof nt)return i.path?.pathParts.at(-1)?.linksTo}async function ss({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ei(o,s[1].macro,0)}async function ti({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ei(o,s[1].macro,s.at(2)?.macro)}async function rD(t,e,r){let n=t?.properties.find(l=>ee(l.name)===e);if(!n)return;let i=n.parent.nodeType;if(!i||!(i instanceof Nt))return;let s=n.nexusMapsTo.at(0)?.specifierSpace,a=(s?n.parent.getProperty(`${s}-names`)?.ast.quickValues:void 0)?.findIndex(l=>typeof l=="string"&&l.toLowerCase()===r)??-1;return a===-1?void 0:n.nexusMapsTo.at(a)?.target}async function np({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHANDLE_BY_NAME"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await rD(o,s[1].macro,s[2].macro)}async function ip({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_OR"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return ia(o,s[1].macro,0,s[2].macro,{macro:s[3],document:t,context:r,position:n},i)}async function sp({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX_OR"||e.args?.length!==5)return;let s=await ei(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return $f(s,e.args[3].macro,{macro:e.args[4],document:t,context:r,position:n},i)}async function op(t,e){if(!t)return;let r=t?.properties.find(n=>ee(n.name)===e);return r?.nexusMapsTo.length?r.nexusMapsTo.length:r?.ast.getFlatAstValues()?.length}async function nD(t,e,r,n){if(t)return Or(await op(t,e),r,n)}async function ap({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?nD(o,s[1].macro,{macro:s[2],document:t,context:r,position:n},i):void 0}async function sa(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ie)return ee(n[0].value)}async function iD(t,e,r,n){if(t)return Or(await sa(t,e),r,n)}async function cp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return iD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function lp(t,e){if(!t)return;let n=t?.properties.find(i=>ee(i.name)===e)?.ast.getFlatAstValues();if(n?.length===1&&n[0]instanceof ie)return n[0].value}async function sD(t,e,r,n){if(t)return Or(await lp(t,e),r,n)}async function up({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return sD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}async function dp(t,e){return(await sa(t,e))?.toUpperCase()}async function oD(t,e,r,n){if(t)return Or(await dp(t,e),r,n)}async function fp({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_OR"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return oD(o,s[1].macro,{document:t,macro:s[2],context:r,position:n},i)}function In(t){return async(e,r)=>{let n=await t(e,r);if(n instanceof J)return n}}async function x({macro:t,document:e,context:r,position:n}){["DT_ALIAS","DT_NODELABEL"].some(a=>a===t.parent?.macro)||t.parent?.macro==="DT_CHILD"&&t.argIndexInParent===1?t=t.parent:t.parent?.macro==="DT_HAS_ALIAS"?(t=t.parent,t.macro="DT_ALIAS"):t.parent?.macro==="DT_PATH"&&(t.parent.args=t.parent.args?.slice(0,(t.argIndexInParent??0)+1)??[],t=t.parent);let s=await[Bf,jf,Hf,Vf,XC,zf,Wf,Gf,Yf,Xf,ss,ti,np,zC,HC,WC,Jf,In(Zf),In(ep),In(tp),In(rp),In(ip),In(sp),In(ap),In(ra),In(cp),In(up),In(fp)].reduce((a,c)=>a.then(l=>l||c({macro:t,document:e,context:r,position:n},x)),Promise.resolve(void 0));if(s)return Array.isArray(s)?s.at(0):s;let o=await ns(e,t.macro,n,r);if(o)return x({document:e,macro:o[0],context:r,position:n})}async function aD({macro:t,document:e,context:r,position:n}){return t.macro&&t.macro&&"DT_CHILD".startsWith(t.macro)?[{label:"DT_CHILD(...)",insertText:"DT_CHILD($1, $2)",kind:Mc.CompletionItemKind.Function,insertTextFormat:Mc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_CHILD"||t.argIndexInParent!==1||!t.parent.args?.length?[]:(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.nodes.map(s=>({label:ee(s.fullName),kind:Mc.CompletionItemKind.Class,documentation:s.toMarkupContent(r.macros)}))??[]}var qc=L(j());function cD({macro:t,context:e}){return t.macro&&"DT_COMPAT_GET_ANY_STATUS_OKAY".startsWith(t.macro)?[{label:"DT_COMPAT_GET_ANY_STATUS_OKAY(...)",insertText:"DT_COMPAT_GET_ANY_STATUS_OKAY($1)",kind:qc.CompletionItemKind.Function,insertTextFormat:qc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_COMPAT_GET_ANY_STATUS_OKAY"||t.argIndexInParent!==0?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:qc.CompletionItemKind.Property}))??[]}var Lc=L(j());function lD({macro:t,context:e}){return t.macro&&"DT_INST".startsWith(t.macro)?[{label:"DT_INST(...)",insertText:"DT_INST($1, $2)",kind:Lc.CompletionItemKind.Function,insertTextFormat:Lc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_INST"||t.argIndexInParent!==1?[]:e.bindingLoader?.getBindings().map(r=>({label:ee(r),kind:Lc.CompletionItemKind.Property}))??[]}var $c=L(j());async function uD({macro:t,context:e}){if(t.macro&&"DT_NODELABEL".startsWith(t.macro))return[{label:"DT_NODELABEL(...)",insertText:"DT_NODELABEL($1)",kind:$c.CompletionItemKind.Function,insertTextFormat:$c.InsertTextFormat.Snippet}];let r=await e.getRuntime();return t.parent?.macro!=="DT_NODELABEL"||t.argIndexInParent!==0?[]:await Promise.all(r.rootNode.allDescendantsLabels.map(async n=>({label:n.label.value,kind:$c.CompletionItemKind.Property,documentation:n.lastLinkedTo?.toMarkupContent(r.context.macros)}))??[])}var Bc=L(j());async function dD({macro:t,context:e}){return t.macro&&t.macro&&"DT_PATH".startsWith(t.macro)?[{label:"DT_PATH(...)",insertText:"DT_PATH($1)",kind:Bc.CompletionItemKind.Function,insertTextFormat:Bc.InsertTextFormat.Snippet}]:t.parent?.macro!=="DT_PATH"||!t.parent.args?.length?[]:(await Kf(t.parent.args.slice(0,-1).map(n=>n.macro),e))?.nodes.map(n=>({label:ee(n.fullName),kind:Bc.CompletionItemKind.Class,documentation:n.toMarkupContent(e.macros)}))??[]}var fD=L(j());async function pD({macro:t,context:e}){if(t.macro&&t.macro&&"DT_ROOT".startsWith(t.macro)){let r=await e.getRuntime();return[{label:"DT_ROOT",kind:fD.CompletionItemKind.Class,documentation:r.rootNode.toMarkupContent(r.context.macros)}]}return[]}var pp=L(j());function hD({macro:t}){return t.macro&&t.macro&&"DT_SAME_NODE".startsWith(t.macro)?[{label:"DT_SAME_NODE(...)",insertText:"DT_SAME_NODE($1, $2)",kind:pp.CompletionItemKind.Snippet,insertTextFormat:pp.InsertTextFormat.Snippet}]:[]}var Fc=L(j());async function Q({macro:t,document:e,position:r,context:n},i,s,o,a,c=l=>x({document:e,macro:l,context:n,position:r})){if(t.macro&&t.macro&&i.startsWith(t.macro))return[{label:`${i}(...)`,insertText:`${i}(${Array(o).map((d,f)=>`${f+1}`).join(", ")})`,kind:Fc.CompletionItemKind.Function,insertTextFormat:Fc.InsertTextFormat.Snippet}];if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let l=await c(t.parent.args[0]);return(a?l?.properties.filter(a):l?.properties)?.map(d=>({label:ee(d.name),kind:Fc.CompletionItemKind.Property,documentation:d.toPrettyString(n.macros)}))??[]}async function mD(t){return Q(t,"DT_ENUM_HAS_VALUE",1,3)}async function gD(t){return Q(t,"DT_ENUM_HAS_VALUE_BY_IDX",1,4)}async function yD(t){return Q(t,"DT_ENUM_IDX",1,2)}async function vD(t){return Q(t,"DT_ENUM_IDX_BY_IDX",1,3)}async function TD(t){return Q(t,"DT_ENUM_IDX_BY_IDX_OR",1,4)}async function bD(t){return Q(t,"DT_ENUM_IDX_OR",1,3)}var _D=L(j());async function Ri({macro:t,document:e,context:r,position:n},i,s,o){if(t.parent?.macro!==i||t.argIndexInParent!==s||!t.parent.args?.length)return[];let c=(await x({document:e,macro:t.parent.args[0],context:r,position:n}))?.properties.find(f=>ee(f.name)===t.parent?.args?.at(1)?.macro),l=0;if(typeof o=="string"){let f=c?.nexusMapsTo.at(0)?.specifierSpace;if(l=(f?c.parent.getProperty(`${f}-names`)?.ast.quickValues:void 0)?.findIndex(g=>typeof g=="string"&&g.toLowerCase()===o)??-1,l===-1)return[]}let u=c?.nexusMapsTo.at(l);return u?.target.nodeType?.cellsValues?.find(f=>u.specifierSpace&&f.specifier===u.specifierSpace)?.values.map(f=>({label:ee(f),kind:_D.CompletionItemKind.Property}))??[]}async function SD(t){return t.macro.argIndexInParent===2?Ri(t,"DT_PHA",2,0):Q(t,"DT_PHA",1,3,e=>!!e.nexusMapsTo.length)}var ND=L(j());async function EU({document:t,macro:e,position:r,context:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:n,position:r}))?.properties.find(a=>ee(a.name)===e.parent?.args?.at(1)?.macro);return Array(o?.nexusMapsTo.length??0)?.map((a,c)=>({label:c.toString(),kind:ND.CompletionItemKind.Property}))??[]}async function RD(t){if(t.macro.argIndexInParent===2)return EU(t,"DT_PHA_BY_IDX");if(t.macro.argIndexInParent===3){let e=t.macro.parent?.args?Ie(t.macro.parent.args[2].macro):void 0;return typeof e!="number"?[]:Ri(t,"DT_PHA_BY_IDX",3,e)}return Q(t,"DT_PHA_BY_IDX",1,3,e=>!!e.nexusMapsTo.length)}var PD=L(j());async function jc({document:t,macro:e,context:r,position:n},i){if(e.parent?.macro!==i||!e.parent.args?.length)return[];let o=(await x({document:t,macro:e.parent.args[0],context:r,position:n}))?.properties.find(l=>ee(l.name)===e.parent?.args?.at(1)?.macro),a=o?.nexusMapsTo.at(0)?.specifierSpace;return(a?o.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.filter(l=>typeof l=="string")?.map(l=>({label:l,kind:PD.CompletionItemKind.Property}))??[]}async function kD(t){let{macro:e}=t;return e.argIndexInParent===2?jc(t,"DT_PHA_BY_NAME"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?Ri(t,"DT_PHA_BY_NAME",3,e.parent.args[2].macro):[]:Q(t,"DT_PHA_BY_NAME",1,3,r=>!!r.nexusMapsTo.length)}async function ED(t){let{macro:e}=t;return e.argIndexInParent===2?jc(t,"DT_PHA_BY_NAME_OR"):e.argIndexInParent===3?e.parent?.args?.[2]?.macro?Ri(t,"DT_PHA_BY_NAME_OR",3,e.parent.args[2].macro):[]:Q(t,"DT_PHA_BY_NAME_OR",1,3,r=>!!r.nexusMapsTo.length)}async function wD(t){let{macro:e}=t;return e.argIndexInParent===2?Ri(t,"DT_PHA_OR",2,0):Q(t,"DT_PHA_OR",1,3,r=>!!r.nexusMapsTo.length)}async function hp(t){return Q(t,"DT_PHANDLE",1,2,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof se||r instanceof nt))}async function oa(t){return Q(t,"DT_PHANDLE_BY_IDX",1,3,e=>!!e.ast.getFlatAstValues()?.some(r=>r instanceof se||r instanceof nt))}async function CD(t){let{macro:e}=t;return e.argIndexInParent===2?jc(t,"DT_PHANDLE_BY_NAME"):Q(t,"DT_PHANDLE_BY_NAME",1,3,r=>!!r.ast.getFlatAstValues()?.some(n=>n instanceof se||n instanceof nt))}async function DD(t){return Q(t,"DT_PROP",1,2,e=>!e.nexusMapsTo.length)}async function AD(t){return Q(t,"DT_PROP_BY_IDX",1,3,e=>!e.nexusMapsTo.length)}async function ID(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX"?oa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):Q(t,"DT_PROP_BY_PHANDLE_IDX",3,4,r=>!r.nexusMapsTo.length,()=>ti({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function OD(t){let{macro:e}=t;return e.argIndexInParent===1&&e.parent?.macro==="DT_PROP_BY_PHANDLE"?hp({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE"}:void 0}}):Q(t,"DT_PROP_BY_PHANDLE",2,3,r=>!r.nexusMapsTo.length,()=>ss({...t,macro:{macro:"DT_PHANDLE",args:e.parent?.args?.slice(0,2)}},x))}async function xD(t){let{macro:e}=t;return(e.argIndexInParent===1||e.argIndexInParent===2)&&e.parent?.macro==="DT_PROP_BY_PHANDLE_IDX_OR"?oa({...t,macro:{...e,parent:e.parent?{...e.parent,macro:"DT_PHANDLE_BY_IDX"}:void 0}}):Q(t,"DT_PROP_BY_PHANDLE_IDX_OR",3,5,r=>!r.nexusMapsTo.length,()=>ti({...t,macro:{macro:"DT_PHANDLE_BY_IDX",args:e.parent?.args?.slice(0,3)}},x))}async function MD(t){return Q(t,"DT_PROP_HAS_IDX",1,3,e=>!e.nexusMapsTo.length)}async function qD(t){return Q(t,"DT_PROP_HAS_NAME",1,3,e=>!e.nexusMapsTo.length)}async function LD(t){return Q(t,"DT_PROP_LAST",1,2,e=>!e.nexusMapsTo.length)}async function $D(t){return Q(t,"DT_PROP_LEN",1,2,e=>!e.nexusMapsTo.length)}async function BD(t){return Q(t,"DT_PROP_LEN_OR",1,2,e=>!e.nexusMapsTo.length)}async function FD(t){return Q(t,"DT_PROP_OR",1,2,e=>!e.nexusMapsTo.length)}async function jD(t){return Q(t,"DT_STRING_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function UD(t){return Q(t,"DT_STRING_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function HD(t){return Q(t,"DT_STRING_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function VD(t){return Q(t,"DT_STRING_UNQUOTED",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function zD(t){return Q(t,"DT_STRING_UNQUOTED_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function WD(t){return Q(t,"DT_STRING_UNQUOTED_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function GD(t){return Q(t,"DT_STRING_UPPER_TOKEN",1,2,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}async function YD(t){return Q(t,"DT_STRING_UPPER_TOKEN_BY_IDX",1,3,e=>{let r=e.ast.getFlatAstValues();return!!r?.length&&r.every(n=>n instanceof ie)})}async function KD(t){return Q(t,"DT_STRING_UPPER_TOKEN_OR",1,3,e=>{let r=e.ast.getFlatAstValues();return r?.length===1&&r[0]instanceof ie})}var Uc=L(j());async function XD({macro:t,context:e}){return t.parent?.macro==="DT_ON_BUS"&&t.argIndexInParent===1?e.bindingLoader?.getBusTypes().map(r=>({label:ee(r),kind:Uc.CompletionItemKind.Enum}))??[]:t.macro&&"DT_ON_BUS".startsWith(t.macro)?[{label:"DT_ON_BUS(...)",insertText:"DT_ON_BUS($1, $2)",kind:Uc.CompletionItemKind.Function,insertTextFormat:Uc.InsertTextFormat.Snippet}]:[]}async function JD(t){return Q(t,"DT_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}async function QD(t){return Q(t,"DT_HAS_CHOSEN",0,1,void 0,async()=>(await t.context.getRuntime()).rootNode.getChild(["/","chosen"]))}var wU=["DT_BUS","DT_CHILD_NUM","DT_CHILD_NUM_STATUS_OKAY","DT_GPARENT","DT_HAS_ALIAS","DT_NODE_CHILD_IDX","DT_NODE_FULL_NAME","DT_NODE_FULL_NAME_TOKEN","DT_NODE_FULL_NAME_UNQUOTED","DT_NODE_FULL_NAME_UPPER_TOKEN","DT_NODE_HASH","DT_NODE_PATH","DT_NODELABEL_STRING_ARRAY","DT_PARENT"];async function ZD(t,e,r){if(!r)return[];let n=Ni(r,t.position);return n?(await Promise.all([XD,JD,QD,UC,aD,cD,lD,CU,uD,dD,pD,hD,gD,mD,vD,TD,yD,bD,RD,kD,ED,SD,oa,CD,hp,wD,AD,OD,ID,xD,DD,MD,qD,LD,$D,BD,FD,jD,UD,HD,VD,zD,WD,GD,YD,KD].flatMap(async i=>await i({document:r,context:e,macro:n,position:t.position})))).flat():[]}function CU({macro:t}){return t.macro?wU.filter(e=>e.startsWith(t.macro)).map(e=>({label:`${e}(...)`,insertText:`${e}($1)`,kind:mp.CompletionItemKind.Function,insertTextFormat:mp.InsertTextFormat.Snippet})):[]}var ri=L(j());function DU(t){if(!t||t.item===null||!(t.ast instanceof Qe))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if(i instanceof Ye)return ri.Location.create(ve(i.uri),fe(i.propertyName??i));if(i instanceof pt)return ri.Location.create(ve(i.uri),fe(i.propertyName??i))}).filter(i=>i);if(t.item instanceof Ke&&t.ast instanceof Qe)return r(e(t.item));if(t.item instanceof J&&t.ast instanceof Qe&&t.ast.parentNode instanceof pt){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function AU(t){if(!t)return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===r)return!0}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&(o.by.nodeNameOrRef instanceof He?o.by.nodeNameOrRef!==t.ast:!r.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedRefLabels,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof St)return ri.Location.create(ve(o.uri),fe(o.name??o));if(o instanceof Ue)return ri.Location.create(ve(o.uri),fe(o.name??o));if(o instanceof He)return ri.Location.create(ve(o.uri),fe(o));if(o instanceof He)return ri.Location.create(ve(o.uri),fe(o));if(o instanceof se)return ri.Location.create(ve(o.uri),fe(o.label??o));if(o instanceof Ye)return ri.Location.create(ve((o.values??o)?.uri),fe(o.values??o))}).filter(o=>o)};if(t.item instanceof J&&!jt(t.ast))return e(t.item);if(t.ast instanceof er&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return jt(t.ast)?[...e(t.ast.linksTo),ri.Location.create(ve(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Ke&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return e(r)}return[]}async function eA(t,e){return _t(t,e,r=>[...AU(r),...DU(r)])}var Pi=L(j());function tA(t){if(!t||t.item===null||!(t.ast instanceof Qe))return[];let e=n=>n.replacedBy?e(n.replacedBy):n,r=n=>[n.ast,...n.allReplaced.map(i=>i.ast),n.parent.deletedProperties.find(i=>i.property===n)?.by??[]].map(i=>{if((i instanceof Ye||i instanceof pt)&&i.propertyName)return Pi.Location.create(ve(i.uri),fe(i.propertyName))}).filter(i=>i);if(t.item instanceof Ke&&t.ast instanceof Qe)return r(e(t.item));if(t.item instanceof J&&t.ast instanceof Qe&&t.ast.parentNode instanceof pt){let n=t.item.deletedProperties.find(i=>i.by===t.ast.parentNode)?.property;if(n)return r(n)}return[]}function rA(t,e){if(!e||!(e.ast instanceof er))return[];"newName"in t&&(e.ast.parentNode instanceof se&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof Ji&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let r=e.ast.value,n=i=>[...i.definitions.filter(s=>s instanceof Ue).flatMap(s=>s.labels.map(o=>o.label)),...i.referencedBy.flatMap(s=>s.labels.map(o=>o.label)),...i.linkedRefLabels.map(s=>s.label)].filter(s=>s?.value===r).map(s=>{if(s)return Pi.Location.create(ve(s.uri),fe(s))}).filter(s=>s);return e.item instanceof J&&!jt(e.ast)?n(e.item):e.ast instanceof er&&e.ast.parentNode instanceof se&&e.ast.parentNode.linksTo?n(e.ast.parentNode.linksTo):[]}function nA(t){if(!t||!(t.ast instanceof He))return[];let e=r=>{let i=t.runtime.rootNode.getNode("aliases")?.properties.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=t.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(r)||c===r)return!0}}).map(o=>o.ast)??[],s=r.parent?.deletedNodes.filter(o=>o.node===r&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...i,...r.linkedNodeNamePaths,...r.definitions,...s].map(o=>{if(o instanceof Ue&&o.name)return Pi.Location.create(ve(o.uri),fe(o.name));if(o instanceof He)return Pi.Location.create(ve(o.uri),fe(o));if(o instanceof Ye&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof ie){let a=o.values.values[0].value,c=fe(a),l=a.value.split("/"),u=r.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,Pi.Location.create(ve(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof J&&!jt(t.ast)?e(t.item):t.ast instanceof He&&t.ast.linksTo?jt(t.ast)?[...e(t.ast.linksTo),Pi.Location.create(ve(t.ast.uri),fe(t.ast))]:e(t.ast.linksTo):[]}async function iA(t,e){let r={};return(await _t(t,e,i=>[...nA(i),...rA(t,i),...tA(i)])).forEach(i=>{r[i.uri]??=[],r[i.uri].push(Pi.TextEdit.replace(i.range,t.newName))}),{changes:r}}async function sA(t,e){let r=await _t(t,e,n=>[...nA(n),...rA(t,n),...tA(n)]);if(r.some(n=>e?.settings.lockRenameEdits?.some(i=>De(n.uri).startsWith(i))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!r.length}}var aa=L(j());var gp=t=>[...t.definitions,...t.referencedBy].map(e=>{if(e instanceof St)return aa.Location.create(ve(e.uri),fe(e));if(e instanceof Ue)return aa.Location.create(ve(e.uri),fe(e));if(e instanceof Wt)return aa.Location.create(ve(e.uri),fe(e))}).filter(e=>e),aA=t=>t.replacedBy?aA(t.replacedBy):t,oA=t=>[t.ast,...t.allReplaced.map(e=>e.ast)].map(e=>{if(e instanceof Ye)return aa.Location.create(ve(e.uri),fe(e.propertyName??e))}).filter(e=>e);function IU(t){if(!t||t.item===null||!(t.ast instanceof Qe))return[];if(t.item instanceof Ke&&t.ast instanceof Qe)return oA(aA(t.item));if(t.item instanceof J&&t.ast instanceof Qe&&t.ast.parentNode instanceof pt){let e=t.item.deletedProperties.find(r=>r.by===t.ast.parentNode)?.property;if(e)return oA(e)}return[]}function OU(t){if(!t)return[];if(t.item instanceof J&&!jt(t.ast))return gp(t.item);if(t.ast instanceof er&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return gp(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return gp(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Ke&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return gp(e)}return[]}function xU(t){if(t?.ast instanceof Ct||t?.ast instanceof Kn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return[aa.Location.create(ve(e.macro.uri),fe(e.macro.identifier))]}return[]}async function cA(t,e){return _t(t,e,r=>[...OU(r),...IU(r),...xU(r)])}var Hc=L(j());var os=t=>{let e=t.definitions.at(0);return e?Hc.Location.create(ve(e.uri),fe(e)):void 0},yp=t=>t.replaces?yp(t.replaces):t,vp=t=>{let e=yp(t);return e?Hc.Location.create(ve(e.ast.uri),fe(e.ast)):void 0};function MU(t){if(!t||t.item===null||!(t.ast instanceof Qe))return;let e=r=>Hc.Location.create(ve(r.ast.uri),fe(r.ast.propertyName??r.ast));if(t.item instanceof Ke&&t.ast instanceof Qe)return e(yp(t.item));if(t.item instanceof J&&t.ast instanceof Qe&&t.ast.parentNode instanceof pt){let r=t.item.deletedProperties.find(n=>n.by===t.ast.parentNode)?.property;if(r)return e(yp(r))}}function qU(t){if(t){if(t.item instanceof J&&!jt(t.ast))return os(t.item);if(t.ast instanceof er&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo)return os(t.ast.parentNode.linksTo);if(t.ast instanceof He&&t.ast.linksTo)return os(t.ast.linksTo);if(t?.ast instanceof ie&&t.item instanceof Ke&&t.item.parent.name==="aliases"){let e=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(e)return os(e)}}}function LU(t){if(t?.ast instanceof Ct||t?.ast instanceof Kn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof Ct?t.ast.name:t.ast.value);if(e)return Hc.Location.create(ve(e.macro.uri),fe(e.macro.identifier))}}async function lA(t,e){return(await _t(t,e,r=>[qU(r)||MU(r)||LU(r)])).at(0)}var $U=["DT_PROP","DT_PROP_LEN","DT_PROP_LEN_OR","DT_PROP_HAS_IDX","DT_PROP_HAS_NAME","DT_PROP_BY_IDX","DT_PROP_LAST","DT_PROP_OR","DT_ENUM_IDX_BY_IDX","DT_ENUM_IDX","DT_ENUM_IDX_BY_IDX_OR","DT_ENUM_IDX_OR","DT_ENUM_HAS_VALUE_BY_IDX","DT_ENUM_HAS_VALUE","DT_STRING_TOKEN","DT_STRING_TOKEN_OR","DT_STRING_UPPER_TOKEN","DT_STRING_UPPER_TOKEN_OR","DT_STRING_UNQUOTED","DT_STRING_UNQUOTED_OR","DT_STRING_TOKEN_BY_IDX","DT_STRING_UPPER_TOKEN_BY_IDX","DT_STRING_UNQUOTED_BY_IDX","DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR","DT_PROP_BY_PHANDLE","DT_PHA_BY_IDX","DT_PHA_BY_IDX_OR","DT_PHA","DT_PHA_OR","DT_PHA_BY_NAME","DT_PHA_BY_NAME_OR","DT_PHANDLE_BY_NAME","DT_PHANDLE_BY_IDX","DT_PHANDLE"];async function Tp({macro:t,document:e,context:r,position:n}){if($U.some(i=>i===t.parent?.macro)&&t.argIndexInParent===1&&t.parent?.args?.[0])return(await x({document:e,context:r,position:n,macro:t.parent.args[0]}))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===2&&t.parent?.args?.[0]&&t.parent?.args?.[1])return(await ss({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE",args:t.parent.args.slice(0,2)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_PROP_BY_PHANDLE_IDX","DT_PROP_BY_PHANDLE_IDX_OR"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===3&&t.parent?.args?.[0]&&t.parent?.args?.[1]&&t.parent?.args?.[3])return(await ti({document:e,context:r,position:n,macro:{macro:"DT_PHANDLE_BY_IDX",args:t.parent.args.slice(0,3)}},x))?.properties.find(s=>ee(s.name)===t.macro);if(["DT_CHOSEN","DT_HAS_CHOSEN"].some(i=>i===t.parent?.macro)&&t.argIndexInParent===0&&t.parent?.args?.[0])return(await r.getRuntime()).rootNode.getChild(["/","chosen"])?.properties.find(i=>ee(i.name)===t.macro)}async function uA(t,e,r){if(!r)return;let n=Ni(r,t.position);return dA(n,t.position,e,r)}async function dA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return os(i);let s=await Tp({document:n,macro:t,context:r,position:e});if(s)return vp(s);let o=await ns(n,t.macro,e,r);if(o)return dA(o[0],o[1],r,n)}async function fA(t,e,r){if(!r)return;let n=Ni(r,t.position);return pA(n,t.position,e,r)}async function pA(t,e,r,n){if(!t?.macro)return;let i=await x({document:n,macro:t,context:r,position:e});if(i)return os(i);let s=await Tp({document:n,macro:t,context:r,position:e});if(s)return vp(s);let o=await ns(n,t.macro,e,r);if(o)return pA(o[0],o[1],r,n)}var le=L(j());var BU=(t,e,r,n,i)=>{switch(r){case 1:return[{title:"Add semicolon",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.replace(le.Range.create(le.Position.create(n.range.start.line,t.pos.colEnd),le.Position.create(n.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[n],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[n],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.del(n.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.replace(n.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.replace(n.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[n],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.replace(n.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[n],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.replace(n.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[n],kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[i]:[le.TextEdit.insert(le.Position.create(n.range.end.line,n.range.end.character),">")]}}}];default:return}},FU=(t,e,r,n,i)=>{if(!n?.length)return[];switch(t){case 0:return[{title:i??`Add Property "${n[0].newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 27:return[{title:i??"Remove Property",diagnostics:[e],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 26:return[{title:i??"TODO",diagnostics:[e],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 36:return[{title:i??"TODO",diagnostics:[e],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}];case 25:return n?[{title:i??"TODO",diagnostics:[e],kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[r]:n}}}]:[];default:return}};function hA(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>BU(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>FU(l,a,t.textDocument.uri,c.issues.edit?Array.isArray(c.issues.edit)?c.issues.edit:[c.issues.edit]:void 0,c.issues.codeActionTitle))}}).filter(a=>!!a),r=e.filter(a=>a.kind===le.CodeActionKind.SourceFixAll),n=e.filter(a=>a.title.startsWith("Add Property")),i=e.filter(a=>a.kind!==le.CodeActionKind.SourceFixAll),s=r.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return n.forEach(a=>{let c=a.edit.changes[t.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)}),[...i,...r.map(a=>({...a,kind:le.CodeActionKind.QuickFix})),...s.length?[{title:"Fix All",kind:le.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:s}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:le.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var mA=L(j());var bp=t=>!t||t instanceof Ye?!1:t instanceof Tr||bp(t.parentNode);function jU(t){if(!t||!(t.item instanceof Ke&&t.item.ast.assignOperatorToken))return[];let e=bp(t?.ast);if(!e&&!(t.ast instanceof Ye&&t.item.ast.values===null)&&!bp(t.beforeAst)&&!bp(t.afterAst))return[];let r=-1;if(t.item.ast.values===null?r=0:r=(t.item.ast.values?.values.findIndex(i=>i&&qy(i,t.beforeAst))??-1)+1,r===-1&&(r=0),t.item.name==="compatible"){let s=t.item.parent.nodeTypes.filter(c=>c).at(-1),o=t.item.ast.quickValues,a;return s instanceof Nt&&s.extends.size&&(a=Array.from(s.extends).filter(c=>!o||!o.includes(c))),o?.filter(c=>c)?.length&&!a?[]:(a??=t.runtime.context.bindingLoader?.getBindings()??[],a.filter(c=>!o||!o.includes(c)).map(c=>({label:`"${c}"`,kind:mA.CompletionItemKind.Variable,insertText:e?c:`"${c}"`})))}let n=t.item.parent.nodeType;return n instanceof Nt?n.properties.find(i=>i.name===t.item?.name)?.getPropertyCompletionItems(t.item,r,e)??[]:[]}function UU(t){if(!t||!(t.item instanceof Ke&&t.ast instanceof Qe&&t.item.ast.values==null||t.item instanceof J)||jt(t.ast)||t.beforeAst?.parentNode instanceof vr)return[];let e=r=>r.nodeType?.getPropertyListCompletionItems(r)??[];return t.item instanceof Ke?e(t.item.parent):e(t.item)}async function gA(t,e){return _t(t,e,r=>[...jU(r),...UU(r)])}var _p=L(j());async function HU(t){if(t?.ast instanceof Ct||t?.ast instanceof Kn){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof Ct?t.ast.name:t.ast.value);if(e){let r=yc(t.ast),n=(await t.runtime.context.getAllParsers()).at(-1);if(r){let i=r?.evaluate(n.cPreprocessorParser.macros);return{contents:{kind:_p.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${i}${typeof i=="number"?` (0x${i.toString(16)})`:""}`,"```"].join(`
|
|
287
|
+
`)},range:fe(t.ast)}}return{contents:{kind:_p.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t.ast?.evaluate(n.cPreprocessorParser.macros)}`,"```"].join(`
|
|
288
|
+
`)},range:fe(t.ast)}}}}async function VU(t){if(!t)return;let e=(await t.runtime.context.getAllParsers()).at(-1);if(t?.ast instanceof He){let r=t.ast.linksTo;if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.ast.parentNode instanceof se){let r=t.ast.parentNode.linksTo;if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.ast instanceof ie&&t.item instanceof Ke&&t.item.parent.name==="aliases"){let r=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(r)return{contents:r.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}if(t?.item instanceof J)return{contents:t.item.toMarkupContent(e.cPreprocessorParser.macros),range:fe(t.ast)}}function zU(t){if(t?.item instanceof Ke&&t.ast instanceof Qe){let e=t.item.onHover(),r=t.item.parent.nodeType?.getOnPropertyHover(t.item.name);if(e||r)return{contents:{kind:_p.MarkupKind.Markdown,value:`${e?.value??""}
|
|
289
|
+
${r?.value??""}`},range:fe(t.ast)}}}function yA(t,e){return _t(t,e,async r=>[await VU(r)||zU(r)||await HU(r)])}async function vA(t){let e=await Hf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function TA(t){let e=await Vf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var SA=L(j());async function bA(t){return t?.nodes.length??0}async function _A({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return bA(s)}async function NA(t){let e=await _A(t,x);return e!==void 0?{contents:{kind:SA.MarkupKind.Markdown,value:e.toString()}}:void 0}async function RA(t){let e=await av(t);if(e)return e?.length?{contents:{kind:ts.Markdown,value:e.map((r,n)=>{let i=r.toMarkupContent(t.context.macros);return`## Node ${n+1}
|
|
290
290
|
|
|
291
291
|
${i.value}
|
|
292
292
|
`}).join(`
|
|
293
293
|
|
|
294
|
-
`)}}:{contents:{kind:is.Markdown,value:`No node matched compat ${t.macro.args[0].macro}`}}}async function IA(t){let e=await Zf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function OA(t,e){return!!await Xf(t,e)}async function xA({macro:t,context:e}){if(!(t.macro!=="DT_HAS_ALIAS"||t.args?.length!==1))return OA(t.args[0].macro,e)}async function MA(t){let e=await xA(t);if(e!==void 0)return{contents:{kind:is.Markdown,value:e?"1":"0"}}}var LA=M(F());async function Qc(t,e){if(t)switch(e){case"Unquoted":return t.fullName;case"Quoted":return`"${t.fullName}"`;case"Token":return ee(t.fullName);case"Upper Token":return ee(t.fullName).toUpperCase()}}async function qA({document:t,macro:e,context:r,position:n},i){if(e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});switch(e.macro){case"DT_NODE_FULL_NAME":return Qc(s,"Quoted");case"DT_NODE_FULL_NAME_TOKEN":return Qc(s,"Token");case"DT_NODE_FULL_NAME_UNQUOTED":return Qc(s,"Unquoted");case"DT_NODE_FULL_NAME_UPPER_TOKEN":return Qc(s,"Upper Token")}}async function $A(t){let e=await qA(t,x);if(e)return{contents:{kind:LA.MarkupKind.Markdown,value:e}}}var jA=M(F());async function BA(t){return t?.pathString}async function FA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODE_PATH"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return BA(s)}async function UA(t){let e=await FA(t,x);if(e)return{contents:{kind:jA.MarkupKind.Markdown,value:`"${e}"`}}}async function HA(t){let e=await tp(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var WA=M(F());async function VA(t){return t?.labels.map(e=>e.label)}async function zA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODELABEL_STRING_ARRAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return VA(s)}async function GA(t){let e=await zA(t,x);if(e)return{contents:{kind:WA.MarkupKind.Markdown,value:`{ ${e.map(r=>`"${r}"`).join(", ")} }`}}}async function YA(t){let e=await rp(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function KA(t){let e=await ip(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var JA=M(F());async function XA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_SAME_NODE"||e.args?.length!==2)return;if(await r?.getRuntime()){let o=await i({document:t,macro:e.args[0],context:r,position:n}),a=await i({document:t,macro:e.args[1],context:r,position:n});return!!a&&!!o&&a===o}}async function QA(t){let e=await XA(t,x);if(e!==void 0)return{contents:{kind:JA.MarkupKind.Markdown,value:e?"1":"0"}}}var e0=M(F());async function ZA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await da(o,s[1].macro,a)}async function t0(t){let e=await ZA(t,x);return e?{contents:{kind:e0.MarkupKind.Markdown,value:e.toString()}}:void 0}var n0=M(F());async function r0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return cs(o,s[1].macro,a,s[3].macro,r)}async function i0(t){let e=await r0(t,x);return e?{contents:{kind:n0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function s0(t){let e=await ni(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function o0(t){let e=await dp(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var Zc=M(F());async function st(t,e){if(e){if(typeof e=="boolean")return{contents:{kind:Zc.MarkupKind.Markdown,value:e?"1":"0"}};if(typeof e=="string")return{contents:{kind:Zc.MarkupKind.Markdown,value:e}};if(e instanceof Q)return{contents:e.toMarkupContent(t.macros)};if(e.length===1&&e[0]instanceof Q)return{contents:e[0].toMarkupContent(t.macros)};if(e.every(r=>typeof r=="number"))return{contents:{kind:Zc.MarkupKind.Markdown,value:e.length===1?e[0].toString():`{${e.join(", ")}}`}};if(e.every(r=>typeof r=="string"))return{contents:{kind:Zc.MarkupKind.Markdown,value:e.length===1?`"${e[0]}"`:`{${e.map(r=>`"${r}"`).join(", ")}}`}}}}async function a0(t){let e=await Vf(t,x);return st(t.context,e)}var vv=M(F());async function c0(t){let e=await zf(t,x);if(e===!0)return{contents:{kind:vv.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof Q?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:vv.MarkupKind.Markdown,value:e.toString()}}}async function l0(t){let e=await ua(t,x);return st(t.context,e)}async function u0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX"||e.args?.length!==4)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return await fr(s,e.args[3].macro,r)}async function d0(t){return st(t.context,await u0(t,x))}async function f0(t){let e=await sp(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var m0=M(F());async function p0(t){return t?.nodes.filter(e=>!e.disabled).length??0}async function h0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM_STATUS_OKAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return p0(s)}async function g0(t){let e=await h0(t,x);return e!==void 0?{contents:{kind:m0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function y0(t){let e=await ls(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var T0=M(F());async function v0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return cs(o,s[1].macro,0,s[2].macro,r)}async function b0(t){let e=await v0(t,x);return e?{contents:{kind:T0.MarkupKind.Markdown,value:e.toString()}}:void 0}var _0=M(F());async function S0(t){let e=await lp(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:_0.MarkupKind.Markdown,value:e.toString()}}:void 0}var P0=M(F());async function N0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return cs(o,s[1].macro,s[2].macro,s[3].macro,r)}async function R0(t){let e=await N0(t,x);return e?{contents:{kind:P0.MarkupKind.Markdown,value:e.toString()}}:void 0}var E0=M(F());async function w0(t){let e=await up(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:E0.MarkupKind.Markdown,value:e.toString()}}:void 0}var k0=M(F());async function C0(t){let e=await fp(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:k0.MarkupKind.Markdown,value:e.toString()}}:void 0}var D0=M(F());async function A0(t){let e=await ap(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:D0.MarkupKind.Markdown,value:e.toString()}}:void 0}var O0=M(F());async function I0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await da(o,s[1].macro,0)}async function x0(t){let e=await I0(t,x);return e?{contents:{kind:O0.MarkupKind.Markdown,value:e.toString()}}:void 0}var M0=M(F());async function q0(t){let e=await cp(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:M0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function L0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE"||e.args?.length!==3)return;let s=await ri(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro);return fr(s,e.args[2].macro,r)}async function $0(t){return st(t.context,await L0(t,x))}async function B0(t){return st(t.context,await pp(t,x))}var U0=M(F());var F0=M(require("util"));async function Dp(t,e,r,n){let i=t?.property.find(o=>ee(o.name)===e);if(!i)return;let s=i?.ast.quickValues?.at(r);if(s!==void 0)return F0.default.isDeepStrictEqual(Ie(n),s)}async function j0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await Dp(o,s[1].macro,0,s[2].macro)}async function H0(t){let e=await j0(t,x);return e!==void 0?{contents:{kind:U0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var z0=M(F());async function V0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await Dp(o,s[1].macro,a,s[3].macro)}async function W0(t){let e=await V0(t,x);return e!==void 0?{contents:{kind:z0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var K0=M(F());async function G0(t,e,r,n){let i=await fr(t,e,n);if(i===void 0)return!1;if(r=typeof r=="number"?r:Ie(r??"0"),typeof r=="number")return Array.isArray(i)?i.length<r:r===0}async function Y0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_IDX"||s?.length!==3?void 0:!!await G0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function X0(t){let e=await Y0(t,x);return e===void 0?void 0:{contents:{kind:K0.MarkupKind.Markdown,value:e?"1":"0"}}}var Z0=M(F());async function J0(t,e,r,n){let i=t?.property.find(u=>ee(u.name)===e),s=i?.parent.nodeType;if(!s||!(s instanceof Pt)||await fr(t,e,n)===void 0)return;let a=i.nexusMapsTo.at(0)?.specifierSpace,l=(a?i.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.findIndex(u=>typeof u=="string"&&u.toLowerCase()===r)??-1;return l===-1?void 0:l}async function Q0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_NAME"||s?.length!==3?void 0:!!await J0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function eI(t){let e=await Q0(t,x);return e===void 0?void 0:{contents:{kind:Z0.MarkupKind.Markdown,value:e?"1":"0"}}}async function tI(t){let e=await ep(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var nI=M(F());async function rI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?hp(o,s[1].macro):void 0}async function iI(t){let e=await rI(t,x);return e?{contents:{kind:nI.MarkupKind.Markdown,value:e.toString()}}:void 0}var sI=M(F());async function oI(t){let e=await mp(t,x);return e instanceof Q?st(t.context,e):e?{contents:{kind:sI.MarkupKind.Markdown,value:e.toString()}}:void 0}var Tv=M(F());async function aI(t,e,r){let n=await fr(t,e,r);if(n===!0)return!0;if(!n)return;let i=n.at(-1);if(i)return n.length===1&&n[0]instanceof Q?n[0]:i}async function cI({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_LAST"||e.args?.length!==2))return aI(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,r)}async function lI(t){let e=await cI(t,x);if(e===!0)return{contents:{kind:Tv.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof Q?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:Tv.MarkupKind.Markdown,value:e.toString()}}}var dI=M(F());async function uI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?pa(o,s[1].macro):void 0}async function fI(t){let e=await uI(t,x);if(e)return{contents:{kind:dI.MarkupKind.Markdown,value:e.toString()}}}var hI=M(F());async function Ap(t,e,r){if(!t)return;let i=t?.property.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ie)return ee(i[r].value)}async function pI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?Ap(o,s[1].macro,a):void 0}async function mI(t){let e=await pI(t,x);if(e)return{contents:{kind:hI.MarkupKind.Markdown,value:e.toString()}}}var gI=M(F());async function yI(t){let e=await gp(t,x);if(e)return e instanceof Q?st(t.context,e):{contents:{kind:gI.MarkupKind.Markdown,value:e.toString()}}}var bI=M(F());async function vI(t,e,r){if(!t)return;let i=t?.property.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ie)return i[r].value}async function TI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?vI(o,s[1].macro,a):void 0}async function _I(t){let e=await TI(t,x);if(e)return{contents:{kind:bI.MarkupKind.Markdown,value:e.toString()}}}var NI=M(F());async function SI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?yp(o,s[1].macro):void 0}async function PI(t){let e=await SI(t,x);if(e)return{contents:{kind:NI.MarkupKind.Markdown,value:e.toString()}}}var RI=M(F());async function EI(t){let e=await vp(t,x);if(e)return e instanceof Q?st(t.context,e):{contents:{kind:RI.MarkupKind.Markdown,value:e.toString()}}}var CI=M(F());async function wI(t,e,r){return(await Ap(t,e,r))?.toUpperCase()}async function kI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?wI(o,s[1].macro,a):void 0}async function DI(t){let e=await kI(t,x);if(e)return{contents:{kind:CI.MarkupKind.Markdown,value:e.toString()}}}var II=M(F());async function AI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?Tp(o,s[1].macro):void 0}async function OI(t){let e=await AI(t,x);if(e)return{contents:{kind:II.MarkupKind.Markdown,value:e.toString()}}}var xI=M(F());async function MI(t){let e=await bp(t,x);if(e)return e instanceof Q?st(t.context,e):{contents:{kind:xI.MarkupKind.Markdown,value:e.toString()}}}async function qI(t){let e=await Gf(t,x);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var BI=M(F());async function LI(t,e){if(!t)return;let r=t.nodeType?.onBus;return r?ee(r)===e:!1}async function $I(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_ON_BUS"||r?.length!==2)return;let n=await e({...t,macro:r[0]});return await LI(n,r[1].macro)}async function FI(t){let e=await $I(t,x);return e!==void 0?{contents:{kind:BI.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function jI(t){let e=await Kf(t);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var VI=M(F());async function UI(t,e){return!!await Yf(t,e)}async function HI(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_HAS_CHOSEN"||e?.length!==1))return await UI(t.context,e[0].macro)}async function zI(t){let e=await HI(t);return e!==void 0?{contents:{kind:VI.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function ZU(t){return[qI,FI,jI,zI,RA,EA,DA,g0,AA,IA,MA,tI,f0,KA,UA,$A,HA,GA,YA,QA].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function eH(t){return[W0,H0,t0,A0,x0,q0,i0,S0,R0,w0,b0,s0,o0,y0,C0,c0,$0,d0,B0,X0,eI,a0,lI,iI,oI,l0,mI,fI,yI,_I,PI,EI,DI,OI,MI].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function WI(t,e,r){if(!r)return;let n=wi(r,t.position);return GI(n,t.position,e,r)}async function GI(t,e,r,n){if(!t?.macro)return;let i=await ZU({position:e,context:r,document:n,macro:t})||await eH({position:e,context:r,document:n,macro:t});if(i)return i;let s=await x({document:n,macro:t,context:r,position:e});if(s)return{contents:s.toMarkupContent(r.macros)};let o=await as(n,t.macro,e,r);if(o)return GI(o[0],o[1],r,n)}var TS=require("path"),bS=require("fs");var hO=M(oO(),1);var tl=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var cH={"[: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]},rl=t=>t.replace(/[[\]\\-]/g,"\\$&"),lH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),aO=t=>t.join(""),cO=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,d="";e:for(;s<t.length;){let h=t.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[v,[S,_,T]]of Object.entries(cH))if(t.startsWith(v,s)){if(d)return["$.",!1,t.length-r,!0];s+=v.length,T?i.push(S):n.push(S),a=a||_;continue e}}if(c=!1,d){h>d?n.push(rl(d)+"-"+rl(h)):h===d&&n.push(rl(h)),d="",s++;continue}if(t.startsWith("-]",s+1)){n.push(rl(h+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=h,s+=2;continue}n.push(rl(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[lH(h),!1,u-r,!1]}let f="["+(l?"^":"")+aO(n)+"]",p="["+(l?"":"^")+aO(i)+"]";return[n.length&&i.length?"("+f+"|"+p+")":n.length?f:p,a,u-r,!0]};var xn=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var uH=new Set(["!","?","+","*","@"]),lO=t=>uH.has(t),dH="(?!(?:^|/)\\.\\.?(?:$|/))",Ip="(?!\\.)",fH=new Set(["[","."]),pH=new Set(["..","."]),hH=new Set("().*{}+?[]^$\\!"),mH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Sv="[^/]",uO=Sv+"*?",dO=Sv+"+?",ga=class t{type;#e;#t;#i=!1;#r=[];#o;#f;#l;#d=!1;#a;#c;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=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("")}#y(){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 r=e,n=r.#o;for(;n;){for(let i=r.#f+1;!n.type&&i<n.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#r[i])}r=n,n=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#r.push(r)}}toJSON(){let e=this.type===null?this.#r.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#r.map(r=>r.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.#f===0)return!0;let e=this.#o;for(let r=0;r<this.#f;r++){let n=e.#r[r];if(!(n instanceof t&&n.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.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#r)r.copyIn(n);return r}static#v(e,r,n,i){let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let p=n,y="";for(;p<e.length;){let h=e.charAt(p++);if(s||h==="\\"){s=!s,y+=h;continue}if(o){p===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(p===a+2&&c)&&(o=!1),y+=h;continue}else if(h==="["){o=!0,a=p,c=!1,y+=h;continue}if(!i.noext&&lO(h)&&e.charAt(p)==="("){r.push(y),y="";let v=new t(h,r);p=t.#v(e,v,p,i),r.push(v);continue}y+=h}return r.push(y),p}let l=n+1,u=new t(null,r),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(s||p==="\\"){s=!s,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(lO(p)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(p,u);u.push(y),l=t.#v(e,y,l,i);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new t(null,r);continue}if(p===")")return f===""&&r.#r.length===0&&(r.#s=!0),u.push(f),f="",r.push(...d,u),l;f+=p}return r.type=null,r.#t=void 0,r.#r=[e.substring(n-1)],l}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#v(e,n,0,r),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#a}toRegExpSource(e){let r=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(p=>{let[y,h,v,S]=typeof p=="string"?t.#p(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||v,this.#i=this.#i||S,y}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&pH.has(this.#r[0]))){let y=fH,h=r&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),v=!r&&!e&&y.has(l.charAt(0));u=h?dH:v?Ip:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,xn(l),this.#t=!!this.#t,this.#i]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,xn(this.toString()),!1,!1]}let o=!n||e||r||!Ip?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?Ip:"")+dO;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Ip:"")+uO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,xn(s),this.#t=!!this.#t,this.#i]}#h(e){return this.#r.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(e);return this.#i=this.#i||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,s+=(hH.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=cO(e,a);if(d){s+=l,o=o||u,a+=d-1,r=r||f;continue}}if(c==="*"){n&&e==="*"?s+=dO:s+=uO,r=!0;continue}if(c==="?"){s+=Sv,r=!0;continue}s+=mH(c)}return[s,xn(e),!!r,o]}};var ya=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var Sr=(t,e,r={})=>(tl(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Yr(e,r).match(t)),gH=/^\*+([^+@!?\*\[\(]*)$/,yH=t=>e=>!e.startsWith(".")&&e.endsWith(t),vH=t=>e=>e.endsWith(t),TH=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),bH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),_H=/^\*+\.\*+$/,SH=t=>!t.startsWith(".")&&t.includes("."),NH=t=>t!=="."&&t!==".."&&t.includes("."),PH=/^\.\*+$/,RH=t=>t!=="."&&t!==".."&&t.startsWith("."),EH=/^\*+$/,wH=t=>t.length!==0&&!t.startsWith("."),kH=t=>t.length!==0&&t!=="."&&t!=="..",CH=/^\?+([^+@!?\*\[\(]*)?$/,DH=([t,e=""])=>{let r=mO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},AH=([t,e=""])=>{let r=gO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},IH=([t,e=""])=>{let r=gO([t]);return e?n=>r(n)&&n.endsWith(e):r},OH=([t,e=""])=>{let r=mO([t]);return e?n=>r(n)&&n.endsWith(e):r},mO=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},gO=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},yO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fO={win32:{sep:"\\"},posix:{sep:"/"}},xH=yO==="win32"?fO.win32.sep:fO.posix.sep;Sr.sep=xH;var nr=Symbol("globstar **");Sr.GLOBSTAR=nr;var MH="[^/]",qH=MH+"*?",LH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$H="(?:(?!(?:\\/|^)\\.).)*?",BH=(t,e={})=>r=>Sr(r,t,e);Sr.filter=BH;var dn=(t,e={})=>Object.assign({},t,e),FH=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Sr;let e=Sr;return Object.assign((n,i,s={})=>e(n,i,dn(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,dn(t,s))}static defaults(i){return e.defaults(dn(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,dn(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,dn(t,s))}},unescape:(n,i={})=>e.unescape(n,dn(t,i)),escape:(n,i={})=>e.escape(n,dn(t,i)),filter:(n,i={})=>e.filter(n,dn(t,i)),defaults:n=>e.defaults(dn(t,n)),makeRe:(n,i={})=>e.makeRe(n,dn(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,dn(t,i)),match:(n,i,s={})=>e.match(n,i,dn(t,s)),sep:e.sep,GLOBSTAR:nr})};Sr.defaults=FH;var vO=(t,e={})=>(tl(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,hO.default)(t));Sr.braceExpand=vO;var jH=(t,e={})=>new Yr(t,e).makeRe();Sr.makeRe=jH;var UH=(t,e,r={})=>{let n=new Yr(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Sr.match=UH;var pO=/[?*]|[+@!]\(.*?\)|\[|\]/,HH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Yr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){tl(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||yO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!pO.test(s[2]))&&!pO.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,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),v=!h&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),_=!S&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),T=v?3:h?0:void 0,R=_?3:S?0:void 0;if(typeof T=="number"&&typeof R=="number"){let[C,B]=[e[T],r[R]];C.toLowerCase()===B.toLowerCase()&&(r[R]=C,R>T?r=r.slice(R):T>R&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,c=e.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],d=e[o];if(this.debug(r,u,d),u===!1)return!1;if(u===nr){this.debug("GLOBSTAR",[r,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var y=e[f];if(this.debug(`
|
|
295
|
-
globstar while`,e,f,r,p,
|
|
296
|
-
>>> no match, partial?`,e,f,r,p),f===c))}let h;if(typeof u=="string"?(h=d===u,this.debug("string match",u,d,h)):(h=u.test(d),this.debug("pattern match",u,d,h)),!h)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return vO(this.pattern,this.options)}parse(e){tl(e);let r=this.options;if(e==="**")return nr;if(e==="")return"";let n,i=null;(n=e.match(EH))?i=r.dot?kH:wH:(n=e.match(gH))?i=(r.nocase?r.dot?bH:TH:r.dot?vH:yH)(n[1]):(n=e.match(CH))?i=(r.nocase?r.dot?AH:DH:r.dot?IH:OH)(n):(n=e.match(_H))?i=r.dot?NH:SH:(n=e.match(PH))&&(i=RH);let s=ga.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?qH:r.dot?LH:$H,i=new Set(r.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))i.add(d);return typeof u=="string"?HH(u):u===nr?nr:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==nr||p===nr||(p===void 0?f!==void 0&&f!==nr?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=p+"(?:\\/|"+n+")?":f!==nr&&(l[d-1]=p+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=nr))}),l.filter(u=>u!==nr).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let c=s[a],l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Sr.defaults(e).Minimatch}};Sr.AST=ga;Sr.Minimatch=Yr;Sr.escape=ya;Sr.unescape=xn;var UO=require("node:url");var va=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,bO=new Set,Nv=typeof process=="object"&&process?process:{},_O=(t,e,r,n)=>{typeof Nv.emitWarning=="function"?Nv.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},Op=globalThis.AbortController,TO=globalThis.AbortSignal;if(typeof Op>"u"){TO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Op=class{constructor(){e()}signal=new TO;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=Nv.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,_O("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 VH=t=>!bO.has(t),XSe=Symbol("type"),ds=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),SO=t=>ds(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ta:null:null,Ta=class extends Array{constructor(e){super(e),this.fill(0)}},Pv=class t{heap;length;static#e=!1;static create(e){let r=SO(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},nl=class t{#e;#t;#i;#r;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#y;#v;#h;#p;#N;#g;#P;#R;#b;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#R,ttls:e.#b,sizes:e.#P,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#y,prev:e.#v,get head(){return e.#h},get tail(){return e.#p},free:e.#N,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,n,i,s)=>e.#$(r,n,i,s),moveToTail:r=>e.#F(r),indexes:r=>e.#w(r),rindexes:r=>e.#k(r),isStale:r=>e.#T(r)}}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.#f}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:y=0,sizeCalculation:h,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:C,ignoreFetchAbort:B}=e;if(r!==0&&!ds(r))throw new TypeError("max option must be a nonnegative integer");let U=r?SO(r):Array;if(!U)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=p,this.maxEntrySize=y||this.#t,this.sizeCalculation=h,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=S,v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=v,this.#S=!!v,this.#a=new Map,this.#c=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new U(r),this.#v=new U(r),this.#h=0,this.#p=0,this.#N=Pv.create(r),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#_=!!this.#i,this.#m=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!ds(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ds(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ds(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!ds(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}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 H="LRU_CACHE_UNBOUNDED";VH(H)&&(bO.add(H),_O("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new Ta(this.#e),r=new Ta(this.#e);this.#b=e,this.#R=r,this.#I=(s,o,a=va.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#T(s)&&this.#A(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#E=s=>{r[s]=e[s]!==0?va.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=a-l}};let n=0,i=()=>{let s=va.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=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=r[o];if(!a||!c)return 1/0;let l=(n||i())-c;return a-l},this.#T=s=>{let o=r[s],a=e[s];return!!a&&!!o&&(n||i())-o>a}}#E=()=>{};#n=()=>{};#I=()=>{};#T=()=>!1;#D(){let e=new Ta(this.#e);this.#d=0,this.#P=e,this.#O=r=>{this.#d-=e[r],e[r]=0},this.#M=(r,n,i,s)=>{if(this.#u(n))return 0;if(!ds(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!ds(i))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 i},this.#x=(r,n,i)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#d>s;)this.#L(!0)}this.#d+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#O=e=>{};#x=(e,r,n)=>{};#M=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:e=this.allowStale}={}){if(this.#l)for(let r=this.#p;!(!this.#q(r)||((e||!this.#T(r))&&(yield r),r===this.#h));)r=this.#v[r]}*#k({allowStale:e=this.allowStale}={}){if(this.#l)for(let r=this.#h;!(!this.#q(r)||((e||!this.#T(r))&&(yield r),r===this.#p));)r=this.#y[r]}#q(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#w())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.#k())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.#w()){let r=this.#c[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#k()){let r=this.#c[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*values(){for(let e of this.#w())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#k())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[n],this))return this.get(this.#c[n],r)}}forEach(e,r=this){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#c[n],this)}}rforEach(e,r=this){for(let n of this.#k()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#c[n],this)}}purgeStale(){let e=!1;for(let r of this.#k({allowStale:!0}))this.#T(r)&&(this.#A(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#a.get(e);if(r===void 0)return;let n=this.#s[r],i=this.#u(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#R){let o=this.#b[r],a=this.#R[r];if(o&&a){let c=o-(va.now()-a);s.ttl=c,s.start=Date.now()}}return this.#P&&(s.size=this.#P[r]),s}dump(){let e=[];for(let r of this.#w({allowStale:!0})){let n=this.#c[r],i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#R){o.ttl=this.#b[r];let a=va.now()-this.#R[r];o.start=Math.floor(Date.now()-a)}this.#P&&(o.size=this.#P[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=va.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#M(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#p:this.#N.length!==0?this.#N.pop():this.#l===this.#e?this.#L(!1):this.#l,this.#c[d]=e,this.#s[d]=r,this.#a.set(e,d),this.#y[this.#p]=d,this.#v[d]=this.#p,this.#p=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(r!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#_&&this.#i?.(p,e,"set"),this.#m&&this.#g?.push([p,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#O(d),this.#x(d,u,c),this.#s[d]=r,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(i!==0&&!this.#b&&this.#C(),this.#b&&(l||this.#I(d,i,s),c&&this.#n(c,d)),!o&&this.#m&&this.#g){let f=this.#g,p;for(;p=f?.shift();)this.#r?.(...p)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#L(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#r?.(...r)}}}#L(e){let r=this.#h,n=this.#c[r],i=this.#s[r];return this.#S&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(i,n,"evict"),this.#m&&this.#g?.push([i,n,"evict"])),this.#O(r),e&&(this.#c[r]=void 0,this.#s[r]=void 0,this.#N.push(r)),this.#l===1?(this.#h=this.#p=0,this.#N.length=0):this.#h=this.#y[r],this.#a.delete(n),this.#l--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#a.get(e);if(s!==void 0){let o=this.#s[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#T(s))i&&(i.has="stale",this.#n(i,s));else return n&&this.#E(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#a.get(e);if(i===void 0||!n&&this.#T(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#$(e,r,n,i){let s=r===void 0?void 0:this.#s[r];if(this.#u(s))return s;let o=new Op,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},l=(h,v=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&h!==void 0;if(n.status&&(S&&!v?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!v)return d(o.signal.reason);let T=p;return this.#s[r]===p&&(h===void 0?T.__staleWhileFetching?this.#s[r]=T.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,h,c.options))),h},u=h=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=h),d(h)),d=h=>{let{aborted:v}=o.signal,S=v&&n.allowStaleOnFetchAbort,_=S||n.allowStaleOnFetchRejection,T=_||n.noDeleteOnFetchRejection,R=p;if(this.#s[r]===p&&(!T||R.__staleWhileFetching===void 0?this.#A(e,"fetch"):S||(this.#s[r]=R.__staleWhileFetching)),_)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw h},f=(h,v)=>{let S=this.#o?.(e,s,c);S&&S instanceof Promise&&S.then(_=>h(_===void 0?void 0:_),v),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(h(void 0),n.allowStaleOnFetchAbort&&(h=_=>l(_,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),y=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,y,{...c.options,status:void 0}),r=this.#a.get(e)):this.#s[r]=y,y}#u(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Op}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=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:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:h,forceRefresh:v=!1,status:S,signal:_}=r;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let T={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:S,signal:_},R=this.#a.get(e);if(R===void 0){S&&(S.fetch="miss");let C=this.#$(e,R,T,h);return C.__returned=C}else{let C=this.#s[R];if(this.#u(C)){let Je=n&&C.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",Je&&(S.returnedStale=!0)),Je?C.__staleWhileFetching:C.__returned=C}let B=this.#T(R);if(!v&&!B)return S&&(S.fetch="hit"),this.#F(R),i&&this.#E(R),S&&this.#n(S,R),C;let U=this.#$(e,R,T,h),me=U.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=B?"stale":"refresh",me&&B&&(S.returnedStale=!0)),me?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,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.#T(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#E(a),c))}else o&&(o.get="miss")}#B(e,r){this.#v[r]=e,this.#y[e]=r}#F(e){e!==this.#p&&(e===this.#h?this.#h=this.#y[e]:this.#B(this.#v[e],this.#y[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(n=!0,this.#l===1)this.#j(r);else{this.#O(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(s,e,r),this.#m&&this.#g?.push([s,e,r])),this.#a.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#p)this.#p=this.#v[i];else if(i===this.#h)this.#h=this.#y[i];else{let o=this.#v[i];this.#y[o]=this.#y[i];let a=this.#y[i];this.#v[a]=this.#v[i]}this.#l--,this.#N.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return n}clear(){return this.#j("delete")}#j(e){for(let r of this.#k({allowStale:!0})){let n=this.#s[r];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#c[r];this.#_&&this.#i?.(n,i,e),this.#m&&this.#g?.push([n,i,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#b&&this.#R&&(this.#b.fill(0),this.#R.fill(0)),this.#P&&this.#P.fill(0),this.#h=0,this.#p=0,this.#N.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#r?.(...n)}}};var Sa=require("node:path"),IO=require("node:url"),ai=require("fs"),eV=M(require("node:fs"),1),hs=require("node:fs/promises");var Fp=require("node:events"),Av=M(require("node:stream"),1),wO=require("node:string_decoder"),NO=typeof process=="object"&&process?process:{stdout:null,stderr:null},zH=t=>!!t&&typeof t=="object"&&(t instanceof ps||t instanceof Av.default||WH(t)||GH(t)),WH=t=>!!t&&typeof t=="object"&&t instanceof Fp.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Av.default.Writable.prototype.pipe,GH=t=>!!t&&typeof t=="object"&&t instanceof Fp.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",Di=Symbol("EOF"),Ai=Symbol("maybeEmitEnd"),fs=Symbol("emittedEnd"),xp=Symbol("emittingEnd"),il=Symbol("emittedError"),Mp=Symbol("closed"),PO=Symbol("read"),qp=Symbol("flush"),RO=Symbol("flushChunk"),Mn=Symbol("encoding"),ba=Symbol("decoder"),Kt=Symbol("flowing"),sl=Symbol("paused"),_a=Symbol("resume"),Xt=Symbol("buffer"),Nr=Symbol("pipes"),Jt=Symbol("bufferLength"),Rv=Symbol("bufferPush"),Lp=Symbol("bufferShift"),pr=Symbol("objectMode"),It=Symbol("destroyed"),Ev=Symbol("error"),wv=Symbol("emitData"),EO=Symbol("emitEnd"),kv=Symbol("emitEnd2"),si=Symbol("async"),Cv=Symbol("abort"),$p=Symbol("aborted"),ol=Symbol("signal"),Ks=Symbol("dataListeners"),Kr=Symbol("discarded"),al=t=>Promise.resolve().then(t),YH=t=>t(),KH=t=>t==="end"||t==="finish"||t==="prefinish",XH=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,JH=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Bp=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[_a](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Dv=class extends Bp{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},QH=t=>!!t.objectMode,ZH=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ps=class extends Fp.EventEmitter{[Kt]=!1;[sl]=!1;[Nr]=[];[Xt]=[];[pr];[Mn];[si];[ba];[Di]=!1;[fs]=!1;[xp]=!1;[Mp]=!1;[il]=null;[Jt]=0;[It]=!1;[ol];[$p]=!1;[Ks]=0;[Kr]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");QH(r)?(this[pr]=!0,this[Mn]=null):ZH(r)?(this[Mn]=r.encoding,this[pr]=!1):(this[pr]=!1,this[Mn]=null),this[si]=!!r.async,this[ba]=this[Mn]?new wO.StringDecoder(this[Mn]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Xt]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Nr]});let{signal:n}=r;n&&(this[ol]=n,n.aborted?this[Cv]():n.addEventListener("abort",()=>this[Cv]()))}get bufferLength(){return this[Jt]}get encoding(){return this[Mn]}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[pr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[si]}set async(e){this[si]=this[si]||!!e}[Cv](){this[$p]=!0,this.emit("abort",this[ol]?.reason),this.destroy(this[ol]?.reason)}get aborted(){return this[$p]}set aborted(e){}write(e,r,n){if(this[$p])return!1;if(this[Di])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 r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[si]?al:YH;if(!this[pr]&&!Buffer.isBuffer(e)){if(JH(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(XH(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[pr]?(this[Kt]&&this[Jt]!==0&&this[qp](!0),this[Kt]?this.emit("data",e):this[Rv](e),this[Jt]!==0&&this.emit("readable"),n&&i(n),this[Kt]):e.length?(typeof e=="string"&&!(r===this[Mn]&&!this[ba]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Mn]&&(e=this[ba].write(e)),this[Kt]&&this[Jt]!==0&&this[qp](!0),this[Kt]?this.emit("data",e):this[Rv](e),this[Jt]!==0&&this.emit("readable"),n&&i(n),this[Kt]):(this[Jt]!==0&&this.emit("readable"),n&&i(n),this[Kt])}read(e){if(this[It])return null;if(this[Kr]=!1,this[Jt]===0||e===0||e&&e>this[Jt])return this[Ai](),null;this[pr]&&(e=null),this[Xt].length>1&&!this[pr]&&(this[Xt]=[this[Mn]?this[Xt].join(""):Buffer.concat(this[Xt],this[Jt])]);let r=this[PO](e||null,this[Xt][0]);return this[Ai](),r}[PO](e,r){if(this[pr])this[Lp]();else{let n=r;e===n.length||e===null?this[Lp]():typeof n=="string"?(this[Xt][0]=n.slice(e),r=n.slice(0,e),this[Jt]-=e):(this[Xt][0]=n.subarray(e),r=n.subarray(0,e),this[Jt]-=e)}return this.emit("data",r),!this[Xt].length&&!this[Di]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[Di]=!0,this.writable=!1,(this[Kt]||!this[sl])&&this[Ai](),this}[_a](){this[It]||(!this[Ks]&&!this[Nr].length&&(this[Kr]=!0),this[sl]=!1,this[Kt]=!0,this.emit("resume"),this[Xt].length?this[qp]():this[Di]?this[Ai]():this.emit("drain"))}resume(){return this[_a]()}pause(){this[Kt]=!1,this[sl]=!0,this[Kr]=!1}get destroyed(){return this[It]}get flowing(){return this[Kt]}get paused(){return this[sl]}[Rv](e){this[pr]?this[Jt]+=1:this[Jt]+=e.length,this[Xt].push(e)}[Lp](){return this[pr]?this[Jt]-=1:this[Jt]-=this[Xt][0].length,this[Xt].shift()}[qp](e=!1){do;while(this[RO](this[Lp]())&&this[Xt].length);!e&&!this[Xt].length&&!this[Di]&&this.emit("drain")}[RO](e){return this.emit("data",e),this[Kt]}pipe(e,r){if(this[It])return e;this[Kr]=!1;let n=this[fs];return r=r||{},e===NO.stdout||e===NO.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Nr].push(r.proxyErrors?new Dv(this,e,r):new Bp(this,e,r)),this[si]?al(()=>this[_a]()):this[_a]()),e}unpipe(e){let r=this[Nr].find(n=>n.dest===e);r&&(this[Nr].length===1?(this[Kt]&&this[Ks]===0&&(this[Kt]=!1),this[Nr]=[]):this[Nr].splice(this[Nr].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Kr]=!1,this[Ks]++,!this[Nr].length&&!this[Kt]&&this[_a]();else if(e==="readable"&&this[Jt]!==0)super.emit("readable");else if(KH(e)&&this[fs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[il]){let i=r;this[si]?al(()=>i.call(this,this[il])):i.call(this,this[il])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Ks]=this.listeners("data").length,this[Ks]===0&&!this[Kr]&&!this[Nr].length&&(this[Kt]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ks]=0,!this[Kr]&&!this[Nr].length&&(this[Kt]=!1)),r}get emittedEnd(){return this[fs]}[Ai](){!this[xp]&&!this[fs]&&!this[It]&&this[Xt].length===0&&this[Di]&&(this[xp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Mp]&&this.emit("close"),this[xp]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==It&&this[It])return!1;if(e==="data")return!this[pr]&&!n?!1:this[si]?(al(()=>this[wv](n)),!0):this[wv](n);if(e==="end")return this[EO]();if(e==="close"){if(this[Mp]=!0,!this[fs]&&!this[It])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[il]=n,super.emit(Ev,n);let s=!this[ol]||this.listeners("error").length?super.emit("error",n):!1;return this[Ai](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ai](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Ai](),i}[wv](e){for(let n of this[Nr])n.dest.write(e)===!1&&this.pause();let r=this[Kr]?!1:super.emit("data",e);return this[Ai](),r}[EO](){return this[fs]?!1:(this[fs]=!0,this.readable=!1,this[si]?(al(()=>this[kv]()),!0):this[kv]())}[kv](){if(this[ba]){let r=this[ba].end();if(r){for(let n of this[Nr])n.dest.write(r);this[Kr]||super.emit("data",r)}}for(let r of this[Nr])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[pr]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[pr]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[pr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Mn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(It,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Kr]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Di])return r();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(It,u),r(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(It,u),this.pause(),s({value:d,done:!!this[Di]})},l=()=>{this.off("error",a),this.off("data",c),this.off(It,u),r(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(It,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Kr]=!1;let e=!1,r=()=>(this.pause(),this.off(Ev,r),this.off(It,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(Ev,r),this.once(It,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[It])return e?this.emit("error",e):this.emit(It),this;this[It]=!0,this[Kr]=!0,this[Xt].length=0,this[Jt]=0;let r=this;return typeof r.close=="function"&&!this[Mp]&&r.close(),e?this.emit("error",e):this.emit(It),this}static get isStream(){return zH}};var tV=ai.realpathSync.native,ll={lstatSync:ai.lstatSync,readdir:ai.readdir,readdirSync:ai.readdirSync,readlinkSync:ai.readlinkSync,realpathSync:tV,promises:{lstat:hs.lstat,readdir:hs.readdir,readlink:hs.readlink,realpath:hs.realpath}},OO=t=>!t||t===ll||t===eV?ll:{...ll,...t,promises:{...ll.promises,...t.promises||{}}},xO=/^\\\\\?\\([a-z]:)\\?$/i,rV=t=>t.replace(/\//g,"\\").replace(xO,"$1\\"),nV=/[\\\/]/,pn=0,MO=1,qO=2,oi=4,LO=6,$O=8,Xs=10,BO=12,fn=15,cl=~fn,Iv=16,kO=32,ul=64,qn=128,jp=256,Hp=512,CO=ul|qn|Hp,iV=1023,Ov=t=>t.isFile()?$O:t.isDirectory()?oi:t.isSymbolicLink()?Xs:t.isCharacterDevice()?qO:t.isBlockDevice()?LO:t.isSocket()?BO:t.isFIFO()?MO:pn,DO=new Map,dl=t=>{let e=DO.get(t);if(e)return e;let r=t.normalize("NFKD");return DO.set(t,r),r},AO=new Map,Up=t=>{let e=AO.get(t);if(e)return e;let r=dl(t.toLowerCase());return AO.set(t,r),r},Vp=class extends nl{constructor(){super({max:256})}},xv=class extends nl{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},FO=Symbol("PathScurry setAsCwd"),hr=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}#f;get gid(){return this.#f}#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}#y;get atimeMs(){return this.#y}#v;get mtimeMs(){return this.#v}#h;get ctimeMs(){return this.#h}#p;get birthtimeMs(){return this.#p}#N;get atime(){return this.#N}#g;get mtime(){return this.#g}#P;get ctime(){return this.#P}#R;get birthtime(){return this.#R}#b;#_;#S;#m;#C;#E;#n;#I;#T;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=pn,n,i,s,o,a){this.name=e,this.#b=s?Up(e):dl(e),this.#n=r&iV,this.nocase=s,this.roots=i,this.root=n||this,this.#I=o,this.#S=a.fullpath,this.#C=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=OO(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#I}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#O(i):this.#O(i)}#O(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#I.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#I.set(this,r),this.#n&=~Iv,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?Up(e):dl(e);for(let c of n)if(c.#b===i)return c;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,pn,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=qn),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,r=this.parent;if(!r)return this.#C=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,r=this.parent;if(!r)return this.#E=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#m=`//?/${i}`:this.#m=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#m=n}isUnknown(){return(this.#n&fn)===pn}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&fn)===$O}isDirectory(){return(this.#n&fn)===oi}isCharacterDevice(){return(this.#n&fn)===qO}isBlockDevice(){return(this.#n&fn)===LO}isFIFO(){return(this.#n&fn)===MO}isSocket(){return(this.#n&fn)===BO}isSymbolicLink(){return(this.#n&Xs)===Xs}lstatCached(){return this.#n&kO?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let e=this.#n&fn;return!(e!==pn&&e!==Xs||this.#n&jp||this.#n&qn)}calledReaddir(){return!!(this.#n&Iv)}isENOENT(){return!!(this.#n&qn)}isNamed(e){return this.nocase?this.#b===Up(e):this.#b===dl(e)}async readlink(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#T=n}catch(r){this.#u(r.code);return}}readlinkSync(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#T=n}catch(r){this.#u(r.code);return}}#x(e){this.#n|=Iv;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#M()}}#M(){this.#n&qn||(this.#n=(this.#n|qn)&cl,this.#w())}#w(){let e=this.children();e.provisional=0;for(let r of e)r.#M()}#k(){this.#n|=Hp,this.#q()}#q(){if(this.#n&ul)return;let e=this.#n;(e&fn)===oi&&(e&=cl),this.#n=e|ul,this.#w()}#L(e=""){e==="ENOTDIR"||e==="EPERM"?this.#q():e==="ENOENT"?this.#M():this.children().provisional=0}#$(e=""){e==="ENOTDIR"?this.parent.#q():e==="ENOENT"&&this.#M()}#u(e=""){let r=this.#n;r|=jp,e==="ENOENT"&&(r|=qn),(e==="EINVAL"||e==="UNKNOWN")&&(r&=cl),this.#n=r,e==="ENOTDIR"&&this.parent&&this.parent.#q()}#B(e,r){return this.#A(e,r)||this.#F(e,r)}#F(e,r){let n=Ov(e),i=this.newChild(e.name,n,{parent:this}),s=i.#n&fn;return s!==oi&&s!==Xs&&s!==pn&&(i.#n|=ul),r.unshift(i),r.provisional++,i}#A(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?Up(e.name):dl(e.name))===i.#b)return this.#j(e,i,n,r)}}#j(e,r,n,i){let s=r.name;return r.#n=r.#n&cl|Ov(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#n&qn)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#n&qn)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#z(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:y,mtimeMs:h,nlink:v,rdev:S,size:_,uid:T}=e;this.#N=r,this.#y=n,this.#R=i,this.#p=s,this.#d=o,this.#s=a,this.#P=c,this.#h=l,this.#t=u,this.#f=d,this.#a=f,this.#i=p,this.#g=y,this.#v=h,this.#r=v,this.#l=S,this.#c=_,this.#o=T;let R=Ov(e);this.#n=this.#n&cl|R|kO,R!==pn&&R!==oi&&R!==Xs&&(this.#n|=ul)}#H=[];#V=!1;#W(e){this.#V=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#V)return;this.#V=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#L(s.code),n.provisional=0;else{for(let a of o)this.#B(a,n);this.#x(n)}this.#W(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#B(i,e);this.#x(e)}catch(i){this.#L(i.code),e.provisional=0}this.#U=void 0,n()}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 r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#B(n,e);this.#x(e)}catch(n){this.#L(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&CO)return!1;let e=fn&this.#n;return e===pn||e===oi||e===Xs}shouldWalk(e,r){return(this.#n&oi)===oi&&!(this.#n&CO)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((Hp|jp|qn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#k()}}realpathSync(){if(this.#D)return this.#D;if(!((Hp|jp|qn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#k()}}[FO](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#C=n.join(this.sep),i.#E=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#C=void 0,i.#E=void 0,i=i.parent}},zp=class t extends hr{sep="\\";splitSep=nV;constructor(e,r=pn,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=pn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Sa.win32.parse(e).root}getRoot(e){if(e=rV(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new Na(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(xO,"$1\\"),e===r}},Wp=class t extends hr{splitSep="/";sep="/";constructor(e,r=pn,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=pn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Gp=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ll}={}){this.#r=OO(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,IO.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Vp,this.#t=new Vp,this.#i=new xv(s);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,f=this.rootPath,p=!1;for(let y of c){let h=u--;l=l.child(y,{relative:new Array(h).fill("..").join(d),relativePosix:new Array(h).fill("..").join("/"),fullpath:f+=(p?"":d)+y}),p=!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 r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#t.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,i),i}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,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.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:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,y)=>{if(p)return f(p);let h=y.length;if(!h)return f();let v=()=>{--h===0&&f()};for(let S of y)(!s||s(S))&&a.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,o)?l(_,v):v()):S.shouldWalk(c,o)?l(S,v):v()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?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(n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(i&&(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,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?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 n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(i&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new ps({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let y=(v,S,_=!1)=>{if(v)return a.emit("error",v);if(i&&!_){let T=[];for(let R of S)R.isSymbolicLink()&&T.push(R.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(T.length){Promise.all(T).then(()=>y(null,S,!0));return}}for(let T of S)T&&(!s||s(T))&&(a.write(n?T:T.fullpath())||(f=!0));u--;for(let T of S){let R=T.realpathCached()||T;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):h||d()},h=!0;p.readdirCB(y,!0),h=!1}};return d(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof hr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new ps({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let y=p.readdirSync();for(let h of y)(!s||s(h))&&(a.write(n?h:h.fullpath())||(f=!0));u--;for(let h of y){let v=h;if(h.isSymbolicLink()){if(!(i&&(v=h.realpathSync())))continue;v.isUnknown()&&v.lstatSync()}v.shouldWalk(c,o)&&l.push(v)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[FO](r)}},Na=class extends Gp{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Sa.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Sa.win32.parse(e).root.toUpperCase()}newRoot(e){return new zp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Pa=class extends Gp{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Sa.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Wp(this.rootPath,oi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},fl=class extends Pa{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},tNe=process.platform==="win32"?zp:Wp,jO=process.platform==="win32"?Na:process.platform==="darwin"?fl:Pa;var sV=t=>t.length>=1,oV=t=>t.length>=1,Ra=class t{#e;#t;#i;length;#r;#o;#f;#l;#d;#a;#c=!0;constructor(e,r,n,i){if(!sV(e))throw new TypeError("empty pattern list");if(!oV(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#i=n,this.#r=i,this.#i===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,p,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let h=[s,o,a,c,""].join("/"),v=[u,d,f,p,""].join("/");this.#e=[h,...l],this.#t=[v,...y],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.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===nr}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#f=this.#f||(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 t(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 aV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ea=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=aV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new Yr(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Ra(i,s,0,this.platform),a=new Yr(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 r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var Mv=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},qv=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},Lv=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},pl=class t{hasWalkedCache;matches=new qv;subwalks=new Lv;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new Mv}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,d);continue}else if(c===nr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(i,a,d===""||d===".");else if(d===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===nr?i.testGlobstar(s,o,l,a):c instanceof RegExp?i.testRegExp(s,c,l,a):i.testString(s,c,l,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var cV=(t,e)=>typeof t=="string"?new Ea([t],e):Array.isArray(t)?new Ea(t,e):t,Yp=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#i=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=cV(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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,r)}matchFinish(e,r){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new pl(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())s++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new pl(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())s++,this.walkCB2Sync(a,c,n.child(),o);o()}},hl=class extends Yp{matches=new Set;constructor(e,r,n){super(e,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},ml=class extends Yp{results;constructor(e,r,n){super(e,r,n),this.results=new ps({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 lV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ln=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,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,UO.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||lV,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?Na:r.platform==="darwin"?fl:r.platform?Pa:jO;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Yr(c,i)),[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 Ra(c,u,0,this.platform)})}async walk(){return[...await new hl(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 hl(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 ml(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 ml(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 $v=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Yr(r,e).hasMagic())return!0;return!1};function Kp(t,e={}){return new Ln(t,e).streamSync()}function VO(t,e={}){return new Ln(t,e).stream()}function zO(t,e={}){return new Ln(t,e).walkSync()}async function HO(t,e={}){return new Ln(t,e).walk()}function Xp(t,e={}){return new Ln(t,e).iterateSync()}function WO(t,e={}){return new Ln(t,e).iterate()}var uV=Kp,dV=Object.assign(VO,{sync:Kp}),fV=Xp,pV=Object.assign(WO,{sync:Xp}),hV=Object.assign(zO,{stream:Kp,iterate:Xp}),Js=Object.assign(HO,{glob:HO,globSync:zO,sync:hV,globStream:VO,stream:dV,globStreamSync:Kp,streamSync:uV,globIterate:WO,iterate:pV,globIterateSync:Xp,iterateSync:fV,Glob:Ln,hasMagic:$v,escape:ya,unescape:xn});Js.glob=Js;var _S=M(Tb()),L$=M(x$());var vS={};EB(vS,{$id:()=>aJ,$schema:()=>oJ,default:()=>fJ,definitions:()=>lJ,properties:()=>dJ,title:()=>cJ,type:()=>uJ});var oJ="http://json-schema.org/draft-07/schema#",aJ="http://json-schema.org/draft-07/schema#",cJ="Core schema meta-schema",lJ={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:[]}},uJ=["object","boolean"],dJ={$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:"#"}},fJ={$schema:oJ,$id:aJ,title:cJ,definitions:lJ,type:uJ,properties:dJ,default:!0};var Vt=M(F());var km=class extends $c{constructor(r,n){super();this.ajv=r;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(r,n){let i=[];if(n.disabled){let o=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(a=>i.push($(21,a,Vt.DiagnosticSeverity.Hint,[...o?.ast?[o?.ast]:[]],[Vt.DiagnosticTag.Unnecessary]))),i}let s=Q.toJson(n);try{this.validate?(this.validate(s),this.validate.errors&&(this.validate.errors.forEach(o=>i.push(...pJ(r,o,n,this.schemaKey))),console.log(this.schemaKey,`${n.pathString}`,this.validate.errors,s))):console.log("no validate")}catch(o){console.log(this.schemaKey,`${n.pathString}`,this.schemaKey,o)}return i}getOnPropertyHover(r){let n=(this.validate?.schema).properties?.[r];if(n&&typeof n=="object"&&"description"in n)return{kind:Vt.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
|
|
294
|
+
`)}}:{contents:{kind:ts.Markdown,value:`No node matched compat ${t.macro.args[0].macro}`}}}async function PA(t){let e=await zf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function kA(t,e){return!!await Uf(t,e)}async function EA({macro:t,context:e}){if(!(t.macro!=="DT_HAS_ALIAS"||t.args?.length!==1))return kA(t.args[0].macro,e)}async function wA(t){let e=await EA(t);if(e!==void 0)return{contents:{kind:ts.Markdown,value:e?"1":"0"}}}var DA=L(j());async function Vc(t,e){if(t)switch(e){case"Unquoted":return t.fullName;case"Quoted":return`"${t.fullName}"`;case"Token":return ee(t.fullName);case"Upper Token":return ee(t.fullName).toUpperCase()}}async function CA({document:t,macro:e,context:r,position:n},i){if(e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});switch(e.macro){case"DT_NODE_FULL_NAME":return Vc(s,"Quoted");case"DT_NODE_FULL_NAME_TOKEN":return Vc(s,"Token");case"DT_NODE_FULL_NAME_UNQUOTED":return Vc(s,"Unquoted");case"DT_NODE_FULL_NAME_UPPER_TOKEN":return Vc(s,"Upper Token")}}async function AA(t){let e=await CA(t,x);if(e)return{contents:{kind:DA.MarkupKind.Markdown,value:e}}}var xA=L(j());async function IA(t){return t?.pathString}async function OA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODE_PATH"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return IA(s)}async function MA(t){let e=await OA(t,x);if(e)return{contents:{kind:xA.MarkupKind.Markdown,value:`"${e}"`}}}async function qA(t){let e=await Gf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var BA=L(j());async function LA(t){return t?.labels.map(e=>e.label)}async function $A({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_NODELABEL_STRING_ARRAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return LA(s)}async function FA(t){let e=await $A(t,x);if(e)return{contents:{kind:BA.MarkupKind.Markdown,value:`{ ${e.map(r=>`"${r}"`).join(", ")} }`}}}async function jA(t){let e=await Yf(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function UA(t){let e=await Xf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var VA=L(j());async function HA({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_SAME_NODE"||e.args?.length!==2)return;if(await r?.getRuntime()){let o=await i({document:t,macro:e.args[0],context:r,position:n}),a=await i({document:t,macro:e.args[1],context:r,position:n});return!!a&&!!o&&a===o}}async function zA(t){let e=await HA(t,x);if(e!==void 0)return{contents:{kind:VA.MarkupKind.Markdown,value:e?"1":"0"}}}var GA=L(j());async function WA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await na(o,s[1].macro,a)}async function YA(t){let e=await WA(t,x);return e?{contents:{kind:GA.MarkupKind.Markdown,value:e.toString()}}:void 0}var XA=L(j());async function KA({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return is(o,s[1].macro,a,s[3].macro,r)}async function JA(t){let e=await KA(t,x);return e?{contents:{kind:XA.MarkupKind.Markdown,value:e.toString()}}:void 0}async function QA(t){let e=await ti(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}async function ZA(t){let e=await np(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var zc=L(j());async function it(t,e){if(e){if(typeof e=="boolean")return{contents:{kind:zc.MarkupKind.Markdown,value:e?"1":"0"}};if(typeof e=="string")return{contents:{kind:zc.MarkupKind.Markdown,value:e}};if(e instanceof J)return{contents:e.toMarkupContent(t.macros)};if(e.length===1&&e[0]instanceof J)return{contents:e[0].toMarkupContent(t.macros)};if(e.every(r=>typeof r=="number"))return{contents:{kind:zc.MarkupKind.Markdown,value:e.length===1?e[0].toString():`{${e.join(", ")}}`}};if(e.every(r=>typeof r=="string"))return{contents:{kind:zc.MarkupKind.Markdown,value:e.length===1?`"${e[0]}"`:`{${e.map(r=>`"${r}"`).join(", ")}}`}}}}async function e0(t){let e=await qf(t,x);return it(t.context,e)}var lv=L(j());async function t0(t){let e=await Lf(t,x);if(e===!0)return{contents:{kind:lv.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof J?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:lv.MarkupKind.Markdown,value:e.toString()}}}async function r0(t){let e=await ra(t,x);return it(t.context,e)}async function n0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE_IDX"||e.args?.length!==4)return;let s=await ei(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,e.args[2].macro);return await ur(s,e.args[3].macro,r)}async function i0(t){return it(t.context,await n0(t,x))}async function s0(t){let e=await Jf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var c0=L(j());async function o0(t){return t?.nodes.filter(e=>!e.disabled).length??0}async function a0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_CHILD_NUM_STATUS_OKAY"||e.args?.length!==1)return;let s=await i({document:t,macro:e.args[0],context:r,position:n});return o0(s)}async function l0(t){let e=await a0(t,x);return e!==void 0?{contents:{kind:c0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function u0(t){let e=await ss(t,x);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var f0=L(j());async function d0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return is(o,s[1].macro,0,s[2].macro,r)}async function p0(t){let e=await d0(t,x);return e?{contents:{kind:f0.MarkupKind.Markdown,value:e.toString()}}:void 0}var h0=L(j());async function m0(t){let e=await tp(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:h0.MarkupKind.Markdown,value:e.toString()}}:void 0}var y0=L(j());async function g0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PHA_BY_NAME"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n});return is(o,s[1].macro,s[2].macro,s[3].macro,r)}async function v0(t){let e=await g0(t,x);return e?{contents:{kind:y0.MarkupKind.Markdown,value:e.toString()}}:void 0}var T0=L(j());async function b0(t){let e=await rp(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:T0.MarkupKind.Markdown,value:e.toString()}}:void 0}var _0=L(j());async function S0(t){let e=await ip(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:_0.MarkupKind.Markdown,value:e.toString()}}:void 0}var N0=L(j());async function R0(t){let e=await Zf(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:N0.MarkupKind.Markdown,value:e.toString()}}:void 0}var k0=L(j());async function P0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_IDX"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await na(o,s[1].macro,0)}async function E0(t){let e=await P0(t,x);return e?{contents:{kind:k0.MarkupKind.Markdown,value:e.toString()}}:void 0}var w0=L(j());async function C0(t){let e=await ep(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:w0.MarkupKind.Markdown,value:e.toString()}}:void 0}async function D0({document:t,macro:e,context:r,position:n},i){if(e.macro!=="DT_PROP_BY_PHANDLE"||e.args?.length!==3)return;let s=await ei(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro);return ur(s,e.args[2].macro,r)}async function A0(t){return it(t.context,await D0(t,x))}async function I0(t){return it(t.context,await sp(t,x))}var M0=L(j());var O0=L(require("util"));async function Sp(t,e,r,n){let i=t?.properties.find(o=>ee(o.name)===e);if(!i)return;let s=i?.ast.quickValues?.at(r);if(s!==void 0)return O0.default.isDeepStrictEqual(Ie(n),s)}async function x0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n});return await Sp(o,s[1].macro,0,s[2].macro)}async function q0(t){let e=await x0(t,x);return e!==void 0?{contents:{kind:M0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var $0=L(j());async function L0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_ENUM_HAS_VALUE_BY_IDX"||s?.length!==4)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return await Sp(o,s[1].macro,a,s[3].macro)}async function B0(t){let e=await L0(t,x);return e!==void 0?{contents:{kind:$0.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}var U0=L(j());async function F0(t,e,r,n){let i=await ur(t,e,n);if(i===void 0)return!1;if(r=typeof r=="number"?r:Ie(r??"0"),typeof r=="number")return Array.isArray(i)?i.length<r:r===0}async function j0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_IDX"||s?.length!==3?void 0:!!await F0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function H0(t){let e=await j0(t,x);return e===void 0?void 0:{contents:{kind:U0.MarkupKind.Markdown,value:e?"1":"0"}}}var W0=L(j());async function V0(t,e,r,n){let i=t?.properties.find(u=>ee(u.name)===e),s=i?.parent.nodeType;if(!s||!(s instanceof Nt)||await ur(t,e,n)===void 0)return;let a=i.nexusMapsTo.at(0)?.specifierSpace,l=(a?i.parent.getProperty(`${a}-names`)?.ast.quickValues:void 0)?.findIndex(u=>typeof u=="string"&&u.toLowerCase()===r)??-1;return l===-1?void 0:l}async function z0({document:t,macro:e,context:r,position:n},i){let s=e.args;return e.macro!=="DT_PROP_HAS_NAME"||s?.length!==3?void 0:!!await V0(await i({document:t,macro:s[0],context:r,position:n}),s[1].macro,s[2].macro,r)}async function G0(t){let e=await z0(t,x);return e===void 0?void 0:{contents:{kind:W0.MarkupKind.Markdown,value:e?"1":"0"}}}async function Y0(t){let e=await Wf(t);if(e)return{contents:e.toMarkupContent(t.context.macros)}}var X0=L(j());async function K0({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_PROP_LEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?op(o,s[1].macro):void 0}async function J0(t){let e=await K0(t,x);return e?{contents:{kind:X0.MarkupKind.Markdown,value:e.toString()}}:void 0}var Q0=L(j());async function Z0(t){let e=await ap(t,x);return e instanceof J?it(t.context,e):e?{contents:{kind:Q0.MarkupKind.Markdown,value:e.toString()}}:void 0}var uv=L(j());async function eI(t,e,r){let n=await ur(t,e,r);if(n===!0)return!0;if(!n)return;let i=n.at(-1);if(i)return n.length===1&&n[0]instanceof J?n[0]:i}async function tI({document:t,macro:e,context:r,position:n},i){if(!(e.macro!=="DT_PROP_LAST"||e.args?.length!==2))return eI(await i({document:t,macro:e.args[0],context:r,position:n}),e.args[1].macro,r)}async function rI(t){let e=await tI(t,x);if(e===!0)return{contents:{kind:uv.MarkupKind.Markdown,value:"1"}};if(e)return e instanceof J?{contents:e.toMarkupContent(t.context.macros)}:{contents:{kind:uv.MarkupKind.Markdown,value:e.toString()}}}var iI=L(j());async function nI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?sa(o,s[1].macro):void 0}async function sI(t){let e=await nI(t,x);if(e)return{contents:{kind:iI.MarkupKind.Markdown,value:e.toString()}}}var aI=L(j());async function Np(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ie)return ee(i[r].value)}async function oI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?Np(o,s[1].macro,a):void 0}async function cI(t){let e=await oI(t,x);if(e)return{contents:{kind:aI.MarkupKind.Markdown,value:e.toString()}}}var lI=L(j());async function uI(t){let e=await cp(t,x);if(e)return e instanceof J?it(t.context,e):{contents:{kind:lI.MarkupKind.Markdown,value:e.toString()}}}var pI=L(j());async function dI(t,e,r){if(!t)return;let i=t?.properties.find(s=>ee(s.name)===e)?.ast.getFlatAstValues();if(!(!i||i.length<=1)&&i[r]instanceof ie)return i[r].value}async function fI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?dI(o,s[1].macro,a):void 0}async function hI(t){let e=await fI(t,x);if(e)return{contents:{kind:pI.MarkupKind.Markdown,value:e.toString()}}}var gI=L(j());async function mI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UNQUOTED"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?lp(o,s[1].macro):void 0}async function yI(t){let e=await mI(t,x);if(e)return{contents:{kind:gI.MarkupKind.Markdown,value:e.toString()}}}var vI=L(j());async function TI(t){let e=await up(t,x);if(e)return e instanceof J?it(t.context,e):{contents:{kind:vI.MarkupKind.Markdown,value:e.toString()}}}var SI=L(j());async function bI(t,e,r){return(await Np(t,e,r))?.toUpperCase()}async function _I({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN_BY_IDX"||s?.length!==3)return;let o=await i({document:t,macro:s[0],context:r,position:n}),a=Ie(s[2].macro);if(typeof a=="number")return o?bI(o,s[1].macro,a):void 0}async function NI(t){let e=await _I(t,x);if(e)return{contents:{kind:SI.MarkupKind.Markdown,value:e.toString()}}}var PI=L(j());async function RI({document:t,macro:e,context:r,position:n},i){let s=e.args;if(e.macro!=="DT_STRING_UPPER_TOKEN"||s?.length!==2)return;let o=await i({document:t,macro:s[0],context:r,position:n});return o?dp(o,s[1].macro):void 0}async function kI(t){let e=await RI(t,x);if(e)return{contents:{kind:PI.MarkupKind.Markdown,value:e.toString()}}}var EI=L(j());async function wI(t){let e=await fp(t,x);if(e)return e instanceof J?it(t.context,e):{contents:{kind:EI.MarkupKind.Markdown,value:e.toString()}}}async function CI(t){let e=await Bf(t,x);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var II=L(j());async function DI(t,e){if(!t)return;let r=t.nodeType?.onBus;return r?ee(r)===e:!1}async function AI(t,e){let r=t.macro.args;if(t.macro.macro!=="DT_ON_BUS"||r?.length!==2)return;let n=await e({...t,macro:r[0]});return await DI(n,r[1].macro)}async function OI(t){let e=await AI(t,x);return e!==void 0?{contents:{kind:II.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function xI(t){let e=await jf(t);return e?{contents:e.toMarkupContent(t.context.macros)}:void 0}var LI=L(j());async function MI(t,e){return!!await Ff(t,e)}async function qI(t){let e=t.macro.args;if(!(t.macro.macro!=="DT_HAS_CHOSEN"||e?.length!==1))return await MI(t.context,e[0].macro)}async function $I(t){let e=await qI(t);return e!==void 0?{contents:{kind:LI.MarkupKind.Markdown,value:e?"1":"0"}}:void 0}async function WU(t){return[CI,OI,xI,$I,vA,TA,NA,l0,RA,PA,wA,Y0,s0,UA,MA,AA,qA,FA,jA,zA].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function GU(t){return[B0,q0,YA,R0,E0,C0,JA,m0,v0,b0,p0,QA,ZA,u0,S0,t0,A0,i0,I0,H0,G0,e0,rI,J0,Z0,r0,cI,sI,uI,hI,yI,TI,NI,kI,wI].reduce((e,r)=>e.then(n=>n||r(t)),Promise.resolve(void 0))}async function BI(t,e,r){if(!r)return;let n=Ni(r,t.position);return FI(n,t.position,e,r)}async function FI(t,e,r,n){if(!t?.macro)return;let i=await WU({position:e,context:r,document:n,macro:t})||await GU({position:e,context:r,document:n,macro:t});if(i)return i;let s=await x({document:n,macro:t,context:r,position:e});if(s)return{contents:s.toMarkupContent(r.macros)};let o=await ns(n,t.macro,e,r);if(o)return FI(o[0],o[1],r,n)}var uS=require("path"),dS=require("fs");var aO=L(ZI(),1);var Gc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var tH={"[: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]},Yc=t=>t.replace(/[[\]\\-]/g,"\\$&"),rH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),eO=t=>t.join(""),tO=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,l=!1,u=r,d="";e:for(;s<t.length;){let h=t.charAt(s);if((h==="!"||h==="^")&&s===r+1){l=!0,s++;continue}if(h==="]"&&o&&!c){u=s+1;break}if(o=!0,h==="\\"&&!c){c=!0,s++;continue}if(h==="["&&!c){for(let[v,[S,_,T]]of Object.entries(tH))if(t.startsWith(v,s)){if(d)return["$.",!1,t.length-r,!0];s+=v.length,T?i.push(S):n.push(S),a=a||_;continue e}}if(c=!1,d){h>d?n.push(Yc(d)+"-"+Yc(h)):h===d&&n.push(Yc(h)),d="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Yc(h+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=h,s+=2;continue}n.push(Yc(h)),s++}if(u<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let h=n[0].length===2?n[0].slice(-1):n[0];return[rH(h),!1,u-r,!1]}let f="["+(l?"^":"")+eO(n)+"]",p="["+(l?"":"^")+eO(i)+"]";return[n.length&&i.length?"("+f+"|"+p+")":n.length?f:p,a,u-r,!0]};var On=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var nH=new Set(["!","?","+","*","@"]),rO=t=>nH.has(t),iH="(?!(?:^|/)\\.\\.?(?:$|/))",Rp="(?!\\.)",sH=new Set(["[","."]),oH=new Set(["..","."]),aH=new Set("().*{}+?[]^$\\!"),cH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),pv="[^/]",nO=pv+"*?",iO=pv+"+?",ca=class t{type;#e;#t;#i=!1;#r=[];#o;#f;#l;#d=!1;#a;#c;#s=!1;constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=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("")}#y(){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 r=e,n=r.#o;for(;n;){for(let i=r.#f+1;!n.type&&i<n.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#r[i])}r=n,n=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#r.push(r)}}toJSON(){let e=this.type===null?this.#r.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#r.map(r=>r.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.#f===0)return!0;let e=this.#o;for(let r=0;r<this.#f;r++){let n=e.#r[r];if(!(n instanceof t&&n.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.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#r)r.copyIn(n);return r}static#v(e,r,n,i){let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let p=n,g="";for(;p<e.length;){let h=e.charAt(p++);if(s||h==="\\"){s=!s,g+=h;continue}if(o){p===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(p===a+2&&c)&&(o=!1),g+=h;continue}else if(h==="["){o=!0,a=p,c=!1,g+=h;continue}if(!i.noext&&rO(h)&&e.charAt(p)==="("){r.push(g),g="";let v=new t(h,r);p=t.#v(e,v,p,i),r.push(v);continue}g+=h}return r.push(g),p}let l=n+1,u=new t(null,r),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(s||p==="\\"){s=!s,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(rO(p)&&e.charAt(l)==="("){u.push(f),f="";let g=new t(p,u);u.push(g),l=t.#v(e,g,l,i);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new t(null,r);continue}if(p===")")return f===""&&r.#r.length===0&&(r.#s=!0),u.push(f),f="",r.push(...d,u),l;f+=p}return r.type=null,r.#t=void 0,r.#r=[e.substring(n-1)],l}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#v(e,n,0,r),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#a}toRegExpSource(e){let r=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#r.map(p=>{let[g,h,v,S]=typeof p=="string"?t.#p(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||v,this.#i=this.#i||S,g}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&oH.has(this.#r[0]))){let g=sH,h=r&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),v=!r&&!e&&g.has(l.charAt(0));u=h?iH:v?Rp:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,On(l),this.#t=!!this.#t,this.#i]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#h(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#t=void 0,[c,On(this.toString()),!1,!1]}let o=!n||e||r||!Rp?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#s)a=(this.isStart()&&!r?Rp:"")+iO;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Rp:"")+nO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,On(s),this.#t=!!this.#t,this.#i]}#h(e){return this.#r.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(e);return this.#i=this.#i||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,s+=(aH.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){let[l,u,d,f]=tO(e,a);if(d){s+=l,o=o||u,a+=d-1,r=r||f;continue}}if(c==="*"){n&&e==="*"?s+=iO:s+=nO,r=!0;continue}if(c==="?"){s+=pv,r=!0;continue}s+=cH(c)}return[s,On(e),!!r,o]}};var la=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var br=(t,e,r={})=>(Gc(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Wr(e,r).match(t)),lH=/^\*+([^+@!?\*\[\(]*)$/,uH=t=>e=>!e.startsWith(".")&&e.endsWith(t),dH=t=>e=>e.endsWith(t),fH=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),pH=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),hH=/^\*+\.\*+$/,mH=t=>!t.startsWith(".")&&t.includes("."),gH=t=>t!=="."&&t!==".."&&t.includes("."),yH=/^\.\*+$/,vH=t=>t!=="."&&t!==".."&&t.startsWith("."),TH=/^\*+$/,bH=t=>t.length!==0&&!t.startsWith("."),_H=t=>t.length!==0&&t!=="."&&t!=="..",SH=/^\?+([^+@!?\*\[\(]*)?$/,NH=([t,e=""])=>{let r=cO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},RH=([t,e=""])=>{let r=lO([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},PH=([t,e=""])=>{let r=lO([t]);return e?n=>r(n)&&n.endsWith(e):r},kH=([t,e=""])=>{let r=cO([t]);return e?n=>r(n)&&n.endsWith(e):r},cO=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},lO=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},uO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",sO={win32:{sep:"\\"},posix:{sep:"/"}},EH=uO==="win32"?sO.win32.sep:sO.posix.sep;br.sep=EH;var tr=Symbol("globstar **");br.GLOBSTAR=tr;var wH="[^/]",CH=wH+"*?",DH="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",AH="(?:(?!(?:\\/|^)\\.).)*?",IH=(t,e={})=>r=>br(r,t,e);br.filter=IH;var un=(t,e={})=>Object.assign({},t,e),OH=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return br;let e=br;return Object.assign((n,i,s={})=>e(n,i,un(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,un(t,s))}static defaults(i){return e.defaults(un(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,un(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,un(t,s))}},unescape:(n,i={})=>e.unescape(n,un(t,i)),escape:(n,i={})=>e.escape(n,un(t,i)),filter:(n,i={})=>e.filter(n,un(t,i)),defaults:n=>e.defaults(un(t,n)),makeRe:(n,i={})=>e.makeRe(n,un(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,un(t,i)),match:(n,i,s={})=>e.match(n,i,un(t,s)),sep:e.sep,GLOBSTAR:tr})};br.defaults=OH;var dO=(t,e={})=>(Gc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,aO.default)(t));br.braceExpand=dO;var xH=(t,e={})=>new Wr(t,e).makeRe();br.makeRe=xH;var MH=(t,e,r={})=>{let n=new Wr(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};br.match=MH;var oO=/[?*]|[+@!]\(.*?\)|\[|\]/,qH=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Wr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){Gc(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||uO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!oO.test(s[2]))&&!oO.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,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let u=n.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let h=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),v=!h&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),S=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),_=!S&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),T=v?3:h?0:void 0,P=_?3:S?0:void 0;if(typeof T=="number"&&typeof P=="number"){let[C,$]=[e[T],r[P]];C.toLowerCase()===$.toLowerCase()&&(r[P]=C,P>T?r=r.slice(P):T>P&&(e=e.slice(T)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,c=e.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=r[a],d=e[o];if(this.debug(r,u,d),u===!1)return!1;if(u===tr){this.debug("GLOBSTAR",[r,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var g=e[f];if(this.debug(`
|
|
295
|
+
globstar while`,e,f,r,p,g),this.matchOne(e.slice(f),r.slice(p),n))return this.debug("globstar found match!",f,c,g),!0;if(g==="."||g===".."||!i.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,f,r,p);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(n&&(this.debug(`
|
|
296
|
+
>>> no match, partial?`,e,f,r,p),f===c))}let h;if(typeof u=="string"?(h=d===u,this.debug("string match",u,d,h)):(h=u.test(d),this.debug("pattern match",u,d,h)),!h)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return dO(this.pattern,this.options)}parse(e){Gc(e);let r=this.options;if(e==="**")return tr;if(e==="")return"";let n,i=null;(n=e.match(TH))?i=r.dot?_H:bH:(n=e.match(lH))?i=(r.nocase?r.dot?pH:fH:r.dot?dH:uH)(n[1]):(n=e.match(SH))?i=(r.nocase?r.dot?RH:NH:r.dot?PH:kH)(n):(n=e.match(hH))?i=r.dot?gH:mH:(n=e.match(yH))&&(i=vH);let s=ca.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?CH:r.dot?DH:AH,i=new Set(r.nocase?["i"]:[]),s=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))i.add(d);return typeof u=="string"?qH(u):u===tr?tr:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==tr||p===tr||(p===void 0?f!==void 0&&f!==tr?l[d+1]="(?:\\/|"+n+"\\/)?"+f:l[d]=n:f===void 0?l[d-1]=p+"(?:\\/|"+n+")?":f!==tr&&(l[d-1]=p+"(?:\\/|\\/"+n+"\\/)"+f,l[d+1]=tr))}),l.filter(u=>u!==tr).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let c=s[a],l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return br.defaults(e).Minimatch}};br.AST=ca;br.Minimatch=Wr;br.escape=la;br.unescape=On;var MO=require("node:url");var ua=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,pO=new Set,hv=typeof process=="object"&&process?process:{},hO=(t,e,r,n)=>{typeof hv.emitWarning=="function"?hv.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},Pp=globalThis.AbortController,fO=globalThis.AbortSignal;if(typeof Pp>"u"){fO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Pp=class{constructor(){e()}signal=new fO;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=hv.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,hO("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 LH=t=>!pO.has(t),FSe=Symbol("type"),as=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),mO=t=>as(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?da:null:null,da=class extends Array{constructor(e){super(e),this.fill(0)}},mv=class t{heap;length;static#e=!1;static create(e){let r=mO(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Kc=class t{#e;#t;#i;#r;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#s;#y;#v;#h;#p;#N;#g;#R;#P;#b;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#P,ttls:e.#b,sizes:e.#R,keyMap:e.#a,keyList:e.#c,valList:e.#s,next:e.#y,prev:e.#v,get head(){return e.#h},get tail(){return e.#p},free:e.#N,isBackgroundFetch:r=>e.#u(r),backgroundFetch:(r,n,i,s)=>e.#$(r,n,i,s),moveToTail:r=>e.#F(r),indexes:r=>e.#E(r),rindexes:r=>e.#w(r),isStale:r=>e.#T(r)}}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.#f}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:g=0,sizeCalculation:h,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:C,ignoreFetchAbort:$}=e;if(r!==0&&!as(r))throw new TypeError("max option must be a nonnegative integer");let F=r?mO(r):Array;if(!F)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=p,this.maxEntrySize=g||this.#t,this.sizeCalculation=h,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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=S,v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=v,this.#S=!!v,this.#a=new Map,this.#c=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new F(r),this.#v=new F(r),this.#h=0,this.#p=0,this.#N=mv.create(r),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#_=!!this.#i,this.#m=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(this.#t!==0&&!as(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!as(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=as(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!as(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}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 U="LRU_CACHE_UNBOUNDED";LH(U)&&(pO.add(U),hO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#C(){let e=new da(this.#e),r=new da(this.#e);this.#b=e,this.#P=r,this.#I=(s,o,a=ua.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#T(s)&&this.#A(this.#c[s],"expire")},o+1);c.unref&&c.unref()}},this.#k=s=>{r[s]=e[s]!==0?ua.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],c=r[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=a-l}};let n=0,i=()=>{let s=ua.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=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=r[o];if(!a||!c)return 1/0;let l=(n||i())-c;return a-l},this.#T=s=>{let o=r[s],a=e[s];return!!a&&!!o&&(n||i())-o>a}}#k=()=>{};#n=()=>{};#I=()=>{};#T=()=>!1;#D(){let e=new da(this.#e);this.#d=0,this.#R=e,this.#O=r=>{this.#d-=e[r],e[r]=0},this.#M=(r,n,i,s)=>{if(this.#u(n))return 0;if(!as(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!as(i))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 i},this.#x=(r,n,i)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#d>s;)this.#L(!0)}this.#d+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#d)}}#O=e=>{};#x=(e,r,n)=>{};#M=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#l)for(let r=this.#p;!(!this.#q(r)||((e||!this.#T(r))&&(yield r),r===this.#h));)r=this.#v[r]}*#w({allowStale:e=this.allowStale}={}){if(this.#l)for(let r=this.#h;!(!this.#q(r)||((e||!this.#T(r))&&(yield r),r===this.#p));)r=this.#y[r]}#q(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#E())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.#w())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.#E()){let r=this.#c[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#w()){let r=this.#c[e];r!==void 0&&!this.#u(this.#s[e])&&(yield r)}}*values(){for(let e of this.#E())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#w())this.#s[e]!==void 0&&!this.#u(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#E()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[n],this))return this.get(this.#c[n],r)}}forEach(e,r=this){for(let n of this.#E()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#c[n],this)}}rforEach(e,r=this){for(let n of this.#w()){let i=this.#s[n],s=this.#u(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#c[n],this)}}purgeStale(){let e=!1;for(let r of this.#w({allowStale:!0}))this.#T(r)&&(this.#A(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#a.get(e);if(r===void 0)return;let n=this.#s[r],i=this.#u(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#P){let o=this.#b[r],a=this.#P[r];if(o&&a){let c=o-(ua.now()-a);s.ttl=c,s.start=Date.now()}}return this.#R&&(s.size=this.#R[r]),s}dump(){let e=[];for(let r of this.#E({allowStale:!0})){let n=this.#c[r],i=this.#s[r],s=this.#u(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#P){o.ttl=this.#b[r];let a=ua.now()-this.#P[r];o.start=Math.floor(Date.now()-a)}this.#R&&(o.size=this.#R[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=ua.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#M(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#p:this.#N.length!==0?this.#N.pop():this.#l===this.#e?this.#L(!1):this.#l,this.#c[d]=e,this.#s[d]=r,this.#a.set(e,d),this.#y[this.#p]=d,this.#v[d]=this.#p,this.#p=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#s[d];if(r!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#_&&this.#i?.(p,e,"set"),this.#m&&this.#g?.push([p,e,"set"]))}else o||(this.#_&&this.#i?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#O(d),this.#x(d,u,c),this.#s[d]=r,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(i!==0&&!this.#b&&this.#C(),this.#b&&(l||this.#I(d,i,s),c&&this.#n(c,d)),!o&&this.#m&&this.#g){let f=this.#g,p;for(;p=f?.shift();)this.#r?.(...p)}return this}pop(){try{for(;this.#l;){let e=this.#s[this.#h];if(this.#L(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#r?.(...r)}}}#L(e){let r=this.#h,n=this.#c[r],i=this.#s[r];return this.#S&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(i,n,"evict"),this.#m&&this.#g?.push([i,n,"evict"])),this.#O(r),e&&(this.#c[r]=void 0,this.#s[r]=void 0,this.#N.push(r)),this.#l===1?(this.#h=this.#p=0,this.#N.length=0):this.#h=this.#y[r],this.#a.delete(n),this.#l--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#a.get(e);if(s!==void 0){let o=this.#s[s];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#T(s))i&&(i.has="stale",this.#n(i,s));else return n&&this.#k(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#a.get(e);if(i===void 0||!n&&this.#T(i))return;let s=this.#s[i];return this.#u(s)?s.__staleWhileFetching:s}#$(e,r,n,i){let s=r===void 0?void 0:this.#s[r];if(this.#u(s))return s;let o=new Pp,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},l=(h,v=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&h!==void 0;if(n.status&&(S&&!v?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!v)return d(o.signal.reason);let T=p;return this.#s[r]===p&&(h===void 0?T.__staleWhileFetching?this.#s[r]=T.__staleWhileFetching:this.#A(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,h,c.options))),h},u=h=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=h),d(h)),d=h=>{let{aborted:v}=o.signal,S=v&&n.allowStaleOnFetchAbort,_=S||n.allowStaleOnFetchRejection,T=_||n.noDeleteOnFetchRejection,P=p;if(this.#s[r]===p&&(!T||P.__staleWhileFetching===void 0?this.#A(e,"fetch"):S||(this.#s[r]=P.__staleWhileFetching)),_)return n.status&&P.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),P.__staleWhileFetching;if(P.__returned===P)throw h},f=(h,v)=>{let S=this.#o?.(e,s,c);S&&S instanceof Promise&&S.then(_=>h(_===void 0?void 0:_),v),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(h(void 0),n.allowStaleOnFetchAbort&&(h=_=>l(_,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),g=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,g,{...c.options,status:void 0}),r=this.#a.get(e)):this.#s[r]=g,g}#u(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Pp}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=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:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:h,forceRefresh:v=!1,status:S,signal:_}=r;if(!this.#S)return S&&(S.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let T={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:p,status:S,signal:_},P=this.#a.get(e);if(P===void 0){S&&(S.fetch="miss");let C=this.#$(e,P,T,h);return C.__returned=C}else{let C=this.#s[P];if(this.#u(C)){let Xe=n&&C.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",Xe&&(S.returnedStale=!0)),Xe?C.__staleWhileFetching:C.__returned=C}let $=this.#T(P);if(!v&&!$)return S&&(S.fetch="hit"),this.#F(P),i&&this.#k(P),S&&this.#n(S,P),C;let F=this.#$(e,P,T,h),me=F.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=$?"stale":"refresh",me&&$&&(S.returnedStale=!0)),me?F.__staleWhileFetching:F.__returned=F}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,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.#T(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#A(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),i&&this.#k(a),c))}else o&&(o.get="miss")}#B(e,r){this.#v[r]=e,this.#y[e]=r}#F(e){e!==this.#p&&(e===this.#h?this.#h=this.#y[e]:this.#B(this.#v[e],this.#y[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#A(e,"delete")}#A(e,r){let n=!1;if(this.#l!==0){let i=this.#a.get(e);if(i!==void 0)if(n=!0,this.#l===1)this.#j(r);else{this.#O(i);let s=this.#s[i];if(this.#u(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#i?.(s,e,r),this.#m&&this.#g?.push([s,e,r])),this.#a.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#p)this.#p=this.#v[i];else if(i===this.#h)this.#h=this.#y[i];else{let o=this.#v[i];this.#y[o]=this.#y[i];let a=this.#y[i];this.#v[a]=this.#v[i]}this.#l--,this.#N.push(i)}}if(this.#m&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return n}clear(){return this.#j("delete")}#j(e){for(let r of this.#w({allowStale:!0})){let n=this.#s[r];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#c[r];this.#_&&this.#i?.(n,i,e),this.#m&&this.#g?.push([n,i,e])}}if(this.#a.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#b&&this.#P&&(this.#b.fill(0),this.#P.fill(0)),this.#R&&this.#R.fill(0),this.#h=0,this.#p=0,this.#N.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#r?.(...n)}}};var ha=require("node:path"),PO=require("node:url"),si=require("fs"),GH=L(require("node:fs"),1),us=require("node:fs/promises");var Ip=require("node:events"),Sv=L(require("node:stream"),1),bO=require("node:string_decoder"),gO=typeof process=="object"&&process?process:{stdout:null,stderr:null},$H=t=>!!t&&typeof t=="object"&&(t instanceof ls||t instanceof Sv.default||BH(t)||FH(t)),BH=t=>!!t&&typeof t=="object"&&t instanceof Ip.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Sv.default.Writable.prototype.pipe,FH=t=>!!t&&typeof t=="object"&&t instanceof Ip.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",ki=Symbol("EOF"),Ei=Symbol("maybeEmitEnd"),cs=Symbol("emittedEnd"),kp=Symbol("emittingEnd"),Xc=Symbol("emittedError"),Ep=Symbol("closed"),yO=Symbol("read"),wp=Symbol("flush"),vO=Symbol("flushChunk"),xn=Symbol("encoding"),fa=Symbol("decoder"),Gt=Symbol("flowing"),Jc=Symbol("paused"),pa=Symbol("resume"),Yt=Symbol("buffer"),_r=Symbol("pipes"),Kt=Symbol("bufferLength"),gv=Symbol("bufferPush"),Cp=Symbol("bufferShift"),dr=Symbol("objectMode"),It=Symbol("destroyed"),yv=Symbol("error"),vv=Symbol("emitData"),TO=Symbol("emitEnd"),Tv=Symbol("emitEnd2"),ni=Symbol("async"),bv=Symbol("abort"),Dp=Symbol("aborted"),Qc=Symbol("signal"),Vs=Symbol("dataListeners"),Gr=Symbol("discarded"),Zc=t=>Promise.resolve().then(t),jH=t=>t(),UH=t=>t==="end"||t==="finish"||t==="prefinish",HH=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,VH=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Ap=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[pa](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},_v=class extends Ap{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},zH=t=>!!t.objectMode,WH=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ls=class extends Ip.EventEmitter{[Gt]=!1;[Jc]=!1;[_r]=[];[Yt]=[];[dr];[xn];[ni];[fa];[ki]=!1;[cs]=!1;[kp]=!1;[Ep]=!1;[Xc]=null;[Kt]=0;[It]=!1;[Qc];[Dp]=!1;[Vs]=0;[Gr]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");zH(r)?(this[dr]=!0,this[xn]=null):WH(r)?(this[xn]=r.encoding,this[dr]=!1):(this[dr]=!1,this[xn]=null),this[ni]=!!r.async,this[fa]=this[xn]?new bO.StringDecoder(this[xn]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Yt]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[_r]});let{signal:n}=r;n&&(this[Qc]=n,n.aborted?this[bv]():n.addEventListener("abort",()=>this[bv]()))}get bufferLength(){return this[Kt]}get encoding(){return this[xn]}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[dr]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ni]}set async(e){this[ni]=this[ni]||!!e}[bv](){this[Dp]=!0,this.emit("abort",this[Qc]?.reason),this.destroy(this[Qc]?.reason)}get aborted(){return this[Dp]}set aborted(e){}write(e,r,n){if(this[Dp])return!1;if(this[ki])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 r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[ni]?Zc:jH;if(!this[dr]&&!Buffer.isBuffer(e)){if(VH(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(HH(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[dr]?(this[Gt]&&this[Kt]!==0&&this[wp](!0),this[Gt]?this.emit("data",e):this[gv](e),this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):e.length?(typeof e=="string"&&!(r===this[xn]&&!this[fa]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[xn]&&(e=this[fa].write(e)),this[Gt]&&this[Kt]!==0&&this[wp](!0),this[Gt]?this.emit("data",e):this[gv](e),this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt]):(this[Kt]!==0&&this.emit("readable"),n&&i(n),this[Gt])}read(e){if(this[It])return null;if(this[Gr]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[Ei](),null;this[dr]&&(e=null),this[Yt].length>1&&!this[dr]&&(this[Yt]=[this[xn]?this[Yt].join(""):Buffer.concat(this[Yt],this[Kt])]);let r=this[yO](e||null,this[Yt][0]);return this[Ei](),r}[yO](e,r){if(this[dr])this[Cp]();else{let n=r;e===n.length||e===null?this[Cp]():typeof n=="string"?(this[Yt][0]=n.slice(e),r=n.slice(0,e),this[Kt]-=e):(this[Yt][0]=n.subarray(e),r=n.subarray(0,e),this[Kt]-=e)}return this.emit("data",r),!this[Yt].length&&!this[ki]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[ki]=!0,this.writable=!1,(this[Gt]||!this[Jc])&&this[Ei](),this}[pa](){this[It]||(!this[Vs]&&!this[_r].length&&(this[Gr]=!0),this[Jc]=!1,this[Gt]=!0,this.emit("resume"),this[Yt].length?this[wp]():this[ki]?this[Ei]():this.emit("drain"))}resume(){return this[pa]()}pause(){this[Gt]=!1,this[Jc]=!0,this[Gr]=!1}get destroyed(){return this[It]}get flowing(){return this[Gt]}get paused(){return this[Jc]}[gv](e){this[dr]?this[Kt]+=1:this[Kt]+=e.length,this[Yt].push(e)}[Cp](){return this[dr]?this[Kt]-=1:this[Kt]-=this[Yt][0].length,this[Yt].shift()}[wp](e=!1){do;while(this[vO](this[Cp]())&&this[Yt].length);!e&&!this[Yt].length&&!this[ki]&&this.emit("drain")}[vO](e){return this.emit("data",e),this[Gt]}pipe(e,r){if(this[It])return e;this[Gr]=!1;let n=this[cs];return r=r||{},e===gO.stdout||e===gO.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[_r].push(r.proxyErrors?new _v(this,e,r):new Ap(this,e,r)),this[ni]?Zc(()=>this[pa]()):this[pa]()),e}unpipe(e){let r=this[_r].find(n=>n.dest===e);r&&(this[_r].length===1?(this[Gt]&&this[Vs]===0&&(this[Gt]=!1),this[_r]=[]):this[_r].splice(this[_r].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Gr]=!1,this[Vs]++,!this[_r].length&&!this[Gt]&&this[pa]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(UH(e)&&this[cs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Xc]){let i=r;this[ni]?Zc(()=>i.call(this,this[Xc])):i.call(this,this[Xc])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Vs]=this.listeners("data").length,this[Vs]===0&&!this[Gr]&&!this[_r].length&&(this[Gt]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vs]=0,!this[Gr]&&!this[_r].length&&(this[Gt]=!1)),r}get emittedEnd(){return this[cs]}[Ei](){!this[kp]&&!this[cs]&&!this[It]&&this[Yt].length===0&&this[ki]&&(this[kp]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ep]&&this.emit("close"),this[kp]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==It&&this[It])return!1;if(e==="data")return!this[dr]&&!n?!1:this[ni]?(Zc(()=>this[vv](n)),!0):this[vv](n);if(e==="end")return this[TO]();if(e==="close"){if(this[Ep]=!0,!this[cs]&&!this[It])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Xc]=n,super.emit(yv,n);let s=!this[Qc]||this.listeners("error").length?super.emit("error",n):!1;return this[Ei](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ei](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Ei](),i}[vv](e){for(let n of this[_r])n.dest.write(e)===!1&&this.pause();let r=this[Gr]?!1:super.emit("data",e);return this[Ei](),r}[TO](){return this[cs]?!1:(this[cs]=!0,this.readable=!1,this[ni]?(Zc(()=>this[Tv]()),!0):this[Tv]())}[Tv](){if(this[fa]){let r=this[fa].end();if(r){for(let n of this[_r])n.dest.write(r);this[Gr]||super.emit("data",r)}}for(let r of this[_r])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[dr]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[dr]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[dr])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[xn]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(It,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Gr]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ki])return r();let s,o,a=d=>{this.off("data",c),this.off("end",l),this.off(It,u),r(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(It,u),this.pause(),s({value:d,done:!!this[ki]})},l=()=>{this.off("error",a),this.off("data",c),this.off(It,u),r(),s({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,s=d,this.once(It,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Gr]=!1;let e=!1,r=()=>(this.pause(),this.off(yv,r),this.off(It,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(yv,r),this.once(It,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[It])return e?this.emit("error",e):this.emit(It),this;this[It]=!0,this[Gr]=!0,this[Yt].length=0,this[Kt]=0;let r=this;return typeof r.close=="function"&&!this[Ep]&&r.close(),e?this.emit("error",e):this.emit(It),this}static get isStream(){return $H}};var YH=si.realpathSync.native,tl={lstatSync:si.lstatSync,readdir:si.readdir,readdirSync:si.readdirSync,readlinkSync:si.readlinkSync,realpathSync:YH,promises:{lstat:us.lstat,readdir:us.readdir,readlink:us.readlink,realpath:us.realpath}},kO=t=>!t||t===tl||t===GH?tl:{...tl,...t,promises:{...tl.promises,...t.promises||{}}},EO=/^\\\\\?\\([a-z]:)\\?$/i,KH=t=>t.replace(/\//g,"\\").replace(EO,"$1\\"),XH=/[\\\/]/,fn=0,wO=1,CO=2,ii=4,DO=6,AO=8,zs=10,IO=12,dn=15,el=~dn,Nv=16,_O=32,rl=64,Mn=128,Op=256,Mp=512,SO=rl|Mn|Mp,JH=1023,Rv=t=>t.isFile()?AO:t.isDirectory()?ii:t.isSymbolicLink()?zs:t.isCharacterDevice()?CO:t.isBlockDevice()?DO:t.isSocket()?IO:t.isFIFO()?wO:fn,NO=new Map,nl=t=>{let e=NO.get(t);if(e)return e;let r=t.normalize("NFKD");return NO.set(t,r),r},RO=new Map,xp=t=>{let e=RO.get(t);if(e)return e;let r=nl(t.toLowerCase());return RO.set(t,r),r},qp=class extends Kc{constructor(){super({max:256})}},Pv=class extends Kc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},OO=Symbol("PathScurry setAsCwd"),fr=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}#f;get gid(){return this.#f}#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}#y;get atimeMs(){return this.#y}#v;get mtimeMs(){return this.#v}#h;get ctimeMs(){return this.#h}#p;get birthtimeMs(){return this.#p}#N;get atime(){return this.#N}#g;get mtime(){return this.#g}#R;get ctime(){return this.#R}#P;get birthtime(){return this.#P}#b;#_;#S;#m;#C;#k;#n;#I;#T;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=fn,n,i,s,o,a){this.name=e,this.#b=s?xp(e):nl(e),this.#n=r&JH,this.nocase=s,this.roots=i,this.root=n||this,this.#I=o,this.#S=a.fullpath,this.#C=a.relative,this.#k=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=kO(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#I}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#O(i):this.#O(i)}#O(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#I.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#I.set(this,r),this.#n&=~Nv,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?xp(e):nl(e);for(let c of n)if(c.#b===i)return c;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,a=this.newChild(e,fn,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Mn),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,r=this.parent;if(!r)return this.#C=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#m=`//?/${i}`:this.#m=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#m=n}isUnknown(){return(this.#n&dn)===fn}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&dn)===AO}isDirectory(){return(this.#n&dn)===ii}isCharacterDevice(){return(this.#n&dn)===CO}isBlockDevice(){return(this.#n&dn)===DO}isFIFO(){return(this.#n&dn)===wO}isSocket(){return(this.#n&dn)===IO}isSymbolicLink(){return(this.#n&zs)===zs}lstatCached(){return this.#n&_O?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let e=this.#n&dn;return!(e!==fn&&e!==zs||this.#n&Op||this.#n&Mn)}calledReaddir(){return!!(this.#n&Nv)}isENOENT(){return!!(this.#n&Mn)}isNamed(e){return this.nocase?this.#b===xp(e):this.#b===nl(e)}async readlink(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#T=n}catch(r){this.#u(r.code);return}}readlinkSync(){let e=this.#T;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#T=n}catch(r){this.#u(r.code);return}}#x(e){this.#n|=Nv;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#M()}}#M(){this.#n&Mn||(this.#n=(this.#n|Mn)&el,this.#E())}#E(){let e=this.children();e.provisional=0;for(let r of e)r.#M()}#w(){this.#n|=Mp,this.#q()}#q(){if(this.#n&rl)return;let e=this.#n;(e&dn)===ii&&(e&=el),this.#n=e|rl,this.#E()}#L(e=""){e==="ENOTDIR"||e==="EPERM"?this.#q():e==="ENOENT"?this.#M():this.children().provisional=0}#$(e=""){e==="ENOTDIR"?this.parent.#q():e==="ENOENT"&&this.#M()}#u(e=""){let r=this.#n;r|=Op,e==="ENOENT"&&(r|=Mn),(e==="EINVAL"||e==="UNKNOWN")&&(r&=el),this.#n=r,e==="ENOTDIR"&&this.parent&&this.parent.#q()}#B(e,r){return this.#A(e,r)||this.#F(e,r)}#F(e,r){let n=Rv(e),i=this.newChild(e.name,n,{parent:this}),s=i.#n&dn;return s!==ii&&s!==zs&&s!==fn&&(i.#n|=rl),r.unshift(i),r.provisional++,i}#A(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?xp(e.name):nl(e.name))===i.#b)return this.#j(e,i,n,r)}}#j(e,r,n,i){let s=r.name;return r.#n=r.#n&el|Rv(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#n&Mn)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#$(e.code)}}lstatSync(){if((this.#n&Mn)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#$(e.code)}}#z(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:g,mtimeMs:h,nlink:v,rdev:S,size:_,uid:T}=e;this.#N=r,this.#y=n,this.#P=i,this.#p=s,this.#d=o,this.#s=a,this.#R=c,this.#h=l,this.#t=u,this.#f=d,this.#a=f,this.#i=p,this.#g=g,this.#v=h,this.#r=v,this.#l=S,this.#c=_,this.#o=T;let P=Rv(e);this.#n=this.#n&el|P|_O,P!==fn&&P!==ii&&P!==zs&&(this.#n|=rl)}#H=[];#V=!1;#W(e){this.#V=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#V)return;this.#V=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#L(s.code),n.provisional=0;else{for(let a of o)this.#B(a,n);this.#x(n)}this.#W(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#B(i,e);this.#x(e)}catch(i){this.#L(i.code),e.provisional=0}this.#U=void 0,n()}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 r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#B(n,e);this.#x(e)}catch(n){this.#L(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&SO)return!1;let e=dn&this.#n;return e===fn||e===ii||e===zs}shouldWalk(e,r){return(this.#n&ii)===ii&&!(this.#n&SO)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((Mp|Op|Mn)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#w()}}realpathSync(){if(this.#D)return this.#D;if(!((Mp|Op|Mn)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#w()}}[OO](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#C=n.join(this.sep),i.#k=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#C=void 0,i.#k=void 0,i=i.parent}},Lp=class t extends fr{sep="\\";splitSep=XH;constructor(e,r=fn,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=fn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ha.win32.parse(e).root}getRoot(e){if(e=KH(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new ma(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(EO,"$1\\"),e===r}},$p=class t extends fr{splitSep="/";sep="/";constructor(e,r=fn,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=fn,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Bp=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=tl}={}){this.#r=kO(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,PO.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new qp,this.#t=new qp,this.#i=new Pv(s);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,f=this.rootPath,p=!1;for(let g of c){let h=u--;l=l.child(g,{relative:new Array(h).fill("..").join(d),relativePosix:new Array(h).fill("..").join("/"),fullpath:f+=(p?"":d)+g}),p=!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 r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#t.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,i),i}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,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.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:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,g)=>{if(p)return f(p);let h=g.length;if(!h)return f();let v=()=>{--h===0&&f()};for(let S of g)(!s||s(S))&&a.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,o)?l(_,v):v()):S.shouldWalk(c,o)?l(S,v):v()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?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(n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(i&&(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,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?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 n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(i&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new ls({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=(v,S,_=!1)=>{if(v)return a.emit("error",v);if(i&&!_){let T=[];for(let P of S)P.isSymbolicLink()&&T.push(P.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(T.length){Promise.all(T).then(()=>g(null,S,!0));return}}for(let T of S)T&&(!s||s(T))&&(a.write(n?T:T.fullpath())||(f=!0));u--;for(let T of S){let P=T.realpathCached()||T;P.shouldWalk(c,o)&&l.push(P)}f&&!a.flowing?a.once("drain",d):h||d()},h=!0;p.readdirCB(g,!0),h=!1}};return d(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof fr||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new ls({objectMode:!0}),c=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let g=p.readdirSync();for(let h of g)(!s||s(h))&&(a.write(n?h:h.fullpath())||(f=!0));u--;for(let h of g){let v=h;if(h.isSymbolicLink()){if(!(i&&(v=h.realpathSync())))continue;v.isUnknown()&&v.lstatSync()}v.shouldWalk(c,o)&&l.push(v)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[OO](r)}},ma=class extends Bp{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,ha.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ha.win32.parse(e).root.toUpperCase()}newRoot(e){return new Lp(this.rootPath,ii,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ga=class extends Bp{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,ha.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new $p(this.rootPath,ii,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},il=class extends ga{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},zSe=process.platform==="win32"?Lp:$p,xO=process.platform==="win32"?ma:process.platform==="darwin"?il:ga;var QH=t=>t.length>=1,ZH=t=>t.length>=1,ya=class t{#e;#t;#i;length;#r;#o;#f;#l;#d;#a;#c=!0;constructor(e,r,n,i){if(!QH(e))throw new TypeError("empty pattern list");if(!ZH(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#i=n,this.#r=i,this.#i===0){if(this.isUNC()){let[s,o,a,c,...l]=this.#e,[u,d,f,p,...g]=this.#t;l[0]===""&&(l.shift(),g.shift());let h=[s,o,a,c,""].join("/"),v=[u,d,f,p,""].join("/");this.#e=[h,...l],this.#t=[v,...g],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.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===tr}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#f=this.#f||(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 t(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 eV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",va=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=eV}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new Wr(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new ya(i,s,0,this.platform),a=new Wr(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 r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var kv=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},Ev=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},wv=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},sl=class t{hasWalkedCache;matches=new Ev;subwalks=new wv;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new kv}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=s.pattern())=="string"&&(l=s.rest());)i=i.resolve(c),s=l,u=!0;if(c=s.pattern(),l=s.rest(),u){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,d);continue}else if(c===tr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(i,a,d===""||d===".");else if(d===".."){let p=i.parent||i;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===tr?i.testGlobstar(s,o,l,a):c instanceof RegExp?i.testRegExp(s,c,l,a):i.testString(s,c,l,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var tV=(t,e)=>typeof t=="string"?new va([t],e):Array.isArray(t)?new va(t,e):t,Fp=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#i=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=tV(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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,r)}matchFinish(e,r){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new sl(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||(s++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())s++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new sl(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,c,l]of n.matches.entries())this.#r(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())s++,this.walkCB2Sync(a,c,n.child(),o);o()}},ol=class extends Fp{matches=new Set;constructor(e,r,n){super(e,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},al=class extends Fp{results;constructor(e,r,n){super(e,r,n),this.results=new ls({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 rV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qn=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,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,MO.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||rV,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?ma:r.platform==="darwin"?il:r.platform?ga:xO;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Wr(c,i)),[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 ya(c,u,0,this.platform)})}async walk(){return[...await new ol(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 ol(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 al(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 al(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 Cv=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Wr(r,e).hasMagic())return!0;return!1};function jp(t,e={}){return new qn(t,e).streamSync()}function LO(t,e={}){return new qn(t,e).stream()}function $O(t,e={}){return new qn(t,e).walkSync()}async function qO(t,e={}){return new qn(t,e).walk()}function Up(t,e={}){return new qn(t,e).iterateSync()}function BO(t,e={}){return new qn(t,e).iterate()}var nV=jp,iV=Object.assign(LO,{sync:jp}),sV=Up,oV=Object.assign(BO,{sync:Up}),aV=Object.assign($O,{stream:jp,iterate:Up}),Ws=Object.assign(qO,{glob:qO,globSync:$O,sync:aV,globStream:LO,stream:iV,globStreamSync:jp,streamSync:nV,globIterate:BO,iterate:oV,globIterateSync:Up,iterateSync:sV,Glob:qn,hasMagic:Cv,escape:la,unescape:On});Ws.glob=Ws;var fS=L(ub()),D$=L(E$());var lS={};TB(lS,{$id:()=>eJ,$schema:()=>Z9,default:()=>sJ,definitions:()=>rJ,properties:()=>iJ,title:()=>tJ,type:()=>nJ});var Z9="http://json-schema.org/draft-07/schema#",eJ="http://json-schema.org/draft-07/schema#",tJ="Core schema meta-schema",rJ={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:[]}},nJ=["object","boolean"],iJ={$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:"#"}},sJ={$schema:Z9,$id:eJ,title:tJ,definitions:rJ,type:nJ,properties:iJ,default:!0};var Yr=L(j());var bm=class extends Cc{constructor(r,n){super();this.ajv=r;this.schemaKey=n;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(r,n){let i=[];if(n.disabled){let o=n.getProperty("status");return[...n.definitions,...n.referencedBy].forEach(a=>i.push(B(21,a.rangeTokens,a,{severity:Yr.DiagnosticSeverity.Hint,linkedTo:[...o?.ast?[o?.ast]:[]],tags:[Yr.DiagnosticTag.Unnecessary]}))),i}let s=J.toJson(n);try{this.validate?(this.validate(s),this.validate.errors&&(this.validate.errors.forEach(o=>i.push(...oJ(r,o,n,this.schemaKey))),console.log(this.schemaKey,`${n.pathString}`,this.validate.errors,s))):console.log("no validate")}catch(o){console.log(this.schemaKey,`${n.pathString}`,this.schemaKey,o)}return i}getOnPropertyHover(r){let n=(this.validate?.schema).properties?.[r];if(n&&typeof n=="object"&&"description"in n)return{kind:Yr.MarkupKind.Markdown,value:[...n.description?["### Description",Array.isArray(n.description)?n.description.join(`
|
|
297
297
|
|
|
298
298
|
`):n.description]:[]].join(`
|
|
299
|
-
`)}}getSignatureHelp(){}getPropertyListCompletionItems(r){let n=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return n.map(s=>{let o=r&&i.some(l=>l===s),a=!!r.
|
|
300
|
-
${"".padEnd(
|
|
299
|
+
`)}}getSignatureHelp(){}getPropertyListCompletionItems(r){let n=Object.keys((this.validate?.schema).properties),i=(this.validate?.schema).required;return n.map(s=>{let o=r&&i.some(l=>l===s),a=!!r.properties.some(l=>s===l.name),c="a";return o?c=a?"Y":"!":c=a?"Z":"B",{label:`${s}`,kind:Yr.CompletionItemKind.Property,sortText:`${c}${s}`}})??[]}},oJ=(t,e,r,n)=>{let i=aJ(r,e.instancePath),s=i.node;if(e.keyword==="additionalProperties"){let a=s.getProperty(e.params.additionalProperty);return a?[B(25,a.ast.rangeTokens,a.ast,{templateStrings:[`Node "${s.name}" ${e.message}: ${a.name}`],edit:Yr.TextEdit.del(Hr(a.ast.firstToken.prevToken,a.ast.lastToken,!1)),codeActionTitle:"Remove property"})]:[]}else if(e.keyword==="type"){let a=s.getProperty(e.instancePath.split("/")[1]);return a?[B(25,a.ast.rangeTokens,a.ast,{templateStrings:[`"${a.name}" ${e.message??"NO MESSAGE"}`]})]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let a=e.params.missingProperty,c=t.getOrderedNodeAst(s),l=Vo(c);return c.map((u,d)=>{let f=u.openScope??l[d].lastToken;return B(0,l[d].rangeTokens,l[d],{templateStrings:[a],edit:Yr.TextEdit.insert(Yr.Position.create(f.pos.line,f.pos.col+1),`
|
|
300
|
+
${"".padEnd(Xo(l[d].uri,u)*Uo().length,Uo())}${a};`)})})}else if(e.keyword==="const"){let a=i.property;return a?[B(25,a.ast.rangeTokens,a.ast,{templateStrings:[`Property "${a.name}" ${e.message}: ${e.params.allowedValue}`]})]:[]}else if(e.keyword==="enum"){let a=i.property;return a?[B(25,a.ast.rangeTokens,a.ast,{templateStrings:[`Property "${a.name}" ${e.message}:
|
|
301
301
|
${e.params.allowedValues.join(`
|
|
302
302
|
`)}
|
|
303
|
-
${n}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let
|
|
303
|
+
${n}`]})]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let a=s.getProperty(e.instancePath.split("/").at(-1)??"");return a?[B(25,a.ast.rangeTokens,a.ast,{templateStrings:[`Property "${a.name}" ${e.message}`]})]:[]}if(i.property)return[B(25,i.property.ast.rangeTokens,i.property.ast,{templateStrings:[`${e.message??"NO MESSAGE"}:
|
|
304
304
|
${JSON.stringify(e)}
|
|
305
|
-
${n}`])]
|
|
305
|
+
${n}`]})];let o=i.node.definitions[0]instanceof St?i.node.definitions[0]:i.node.definitions[0].name??i.node.definitions[0];return[B(25,o.rangeTokens,o,{templateStrings:[`${e.message??"NO MESSAGE"}:
|
|
306
306
|
${JSON.stringify(e)}
|
|
307
|
-
${n}`])]},hJ=(t,e)=>M$(t,e.split("/").filter(r=>r)),M$=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let r=e[0].split("@"),n=r[0],i=r.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(n,i);return s?M$(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var SS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(i=>!(i?.value instanceof ie)))return n?.values.map(i=>(i?.value).value)}parseMetaSchema(e,r){Js.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,TS.resolve)(e,i);try{let s=_S.default.parse((0,bS.readFileSync)(i,"utf-8"));r.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,r){Js.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,TS.resolve)(e,i);try{let s=_S.default.parse((0,bS.readFileSync)(i,"utf-8"));r.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,r,n){let i=`${e.join(";")}::${r.join(";")}`,s=this.ajvMap.get(i);return s||(s=new L$.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(vS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),r.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new km(s,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=s.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)??[]}getBindings(){return Array.from(this.schemaIdValidators.keys())}},q$,NS=()=>(q$??=new SS,q$);var Nu=require("path"),V$=require("fs"),z$=M(require("path")),W$=M(Tb());var $t=M(F());var $$=()=>{let t=new J("nonposted-mmio",W("EMPTY"),"optional");return t.description=["Specifies that direct children of this bus should use non-posted memory accesses (i.e. a non-posted mapping mode) for MMIO ranges."],t};function B$(){let t=dr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="compatible");e.required=()=>"required";let r=t.properties.find(n=>n.name==="ranges");return r.required=()=>"required",t.addProperty($$()),t}var F$=t=>{switch(t){case"string":return W("STRING");case"int":return W("U32");case"boolean":return W("EMPTY");case"array":return W("PROP_ENCODED_ARRAY");case"uint8-array":return W("BYTESTRING");case"string-array":return W("STRINGLIST");case"phandle":return W("U32");case"phandles":return W("PROP_ENCODED_ARRAY");case"phandle-array":return W("PROP_ENCODED_ARRAY");case"path":return W(["STRING","U32"]);case"compound":return W("ANY")}},j$=(t,e)=>{switch(t){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(r=>typeof r=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(r=>typeof r=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(r=>typeof r=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},Cm=(t,e)=>{if(e.extends??=[],e=e.include.reduce((r,n)=>{let i=t.find(s=>(0,Nu.basename)(s.filePath)===n.name);if(i){let s=n["property-blocklist"],o=n["property-allowlist"];return e.extends?.push(...r.include.map(a=>(0,Nu.basename)(a.name,".yaml"))),r.include=r.include.filter(a=>a!==n),mJ(t,i,r,s,o)??r}return console.warn(`Unable to find ${n.name}`),r},e),e["child-binding"]&&(e["child-binding"].include=G$(e["child-binding"].include),e["child-binding"]=Cm(t,e["child-binding"])),!e.include.length)return e},mJ=(t,e,r,n=[],i)=>{let s=Cm(t,e),o=Cm(t,r);if(!s||!o)return;let a=new Set;Object.keys(s?.properties??{}).forEach(f=>a.add(f)),Object.keys(o?.properties??{}).forEach(f=>a.add(f));let c={};Array.from(a).forEach(f=>{let p=n?.some(h=>h===f)||i&&!i.some(h=>h===f)?{}:s.properties?.[f]??{},y=o.properties?.[f]??{};c={...c,[f]:{...p,...y}}}),o.properties=c,o.extends??=[],o.extends.push(...s.extends??[]);let l=new Set;return Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Array.from(l).forEach(f=>{let p=s[f]??[],y=o[f]??[];o[f]=Array.from([...p,...y])}),o["on-bus"]??=s["on-bus"],o.bus?o.bus.push(...s.bus??[]):o.bus=s.bus,o},G$=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],PS=class t{constructor(){this.typeCache=new Map;this.processedFolders=new Set;this.zephyrBindingCache=new Map}static getCompatibleKeys(e,r){return!r||!r.nodeType?.bus?.length?[e]:[...r.nodeType.bus.map(n=>`${e}::${n}`),e]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values?.values.filter(s=>s&&s.value instanceof ie);if(i?.length)return i.map(s=>s?.value?{name:s.value.value,ast:s.value}:void 0)}getNodeTypes(e,r){let n=t.getNodeCompatible(e)?.filter(a=>a);if(!n?.length){if(e.name==="zephyr,user"){let a=r.split(":"),l=Array.from(this.zephyrBindingCache.keys()).filter(d=>a.some(f=>d.startsWith(f))).flatMap(d=>this.zephyrBindingCache.get(d)).find(d=>d.filePath.endsWith("/base.yaml")),u=l?RS(l,e):void 0;if(u){u.warnMismatchProperties=!1;let d=u.properties.find(f=>f.name==="compatible");d&&(d.required=()=>"optional")}return{type:[u??os(e)],issues:[]}}return{type:[os(e)],issues:[]}}let i=n.flatMap(a=>t.getCompatibleKeys(a.name,e.parent).map(c=>this.typeCache.get(r)?.get(c)?.(e)).filter(c=>!!c)),s=this.getBusTypes(),o=n.flatMap(a=>{let c=t.getCompatibleKeys(a.name,e.parent).some(l=>this.typeCache.get(r)?.has(l));if(!c){let l=s.filter(u=>this.typeCache.get(r)?.has(`${a.name}::${u}`));if(l.length)return $(37,a.ast,$t.DiagnosticSeverity.Error,[],[],l)}return c?[]:[$(32,a.ast,$t.DiagnosticSeverity.Hint,[],[$t.DiagnosticTag.Unnecessary],[a.name])]});return{type:i.length?i:[os(e)],issues:o}}loadTypeAndCache(e,r){e=Array.isArray(e)?e:[e];let n=e.filter(o=>this.processedFolders.has(o)).flatMap(o=>Array.from(this.zephyrBindingCache.entries()).flatMap(([a,c])=>a.startsWith(o)?[c]:[]));n.push(...e.filter(o=>!this.processedFolders.has(o)).flatMap(o=>(this.processedFolders.add(o),Js.sync("**/*.yaml",{cwd:o,ignore:"test/*"}).map(c=>{if(c=(0,Nu.resolve)(o,c),this.zephyrBindingCache.has(c))return this.zephyrBindingCache.get(c);try{let l=W$.default.parse((0,V$.readFileSync)(c,"utf-8")),u=G$(l?.include),d={...l,bus:l.bus?Array.isArray(l.bus)?l.bus:[l.bus]:void 0,include:u,rawInclude:[...u],filePath:c};return this.zephyrBindingCache.set(c,d),d}catch(l){console.warn(l)}}).filter(c=>!!c))));let i=n.map(o=>Cm(n,o)).filter(o=>!!o&&!o.include.length),s=this.typeCache.get(r);s||(s=new Map,s.set("simple-bus",()=>B$()),this.typeCache.set(r,s)),gJ(i,s)}getBindings(e){return Array.from(this.typeCache.get(e)?.keys()??[]).map(r=>r.split("::",1)[0])}getBusTypes(){let e=Array.from(this.zephyrBindingCache.values()).flatMap(r=>r.bus?.filter(n=>!!n)??[]).filter(r=>!!r);return Array.from(new Set(e))}getDocumentLinks(e,r){let n=this.zephyrBindingCache.get(De(e.uri));if(!n)return[];let i=e.getText();return n.rawInclude.map(o=>{let c=new RegExp(o.name).exec(i);if(c){let l=e.positionAt(c.index),u=e.positionAt(c.index+c[0].length),d=Array.from(this.zephyrBindingCache.keys()).find(f=>f.endsWith(`${z$.default.sep}${o.name}`)&&r.some(p=>f.startsWith(p)));return d?{range:$t.Range.create(l,u),target:ve(d)}:void 0}}).filter(o=>!!o)}},U$,Ja=()=>(U$??=new PS,U$),gJ=(t,e)=>t.forEach(r=>{r.compatible&&e.set(r["on-bus"]?`${r.compatible}::${r["on-bus"]}`:r.compatible,n=>RS(r,n))}),RS=(t,e)=>{let r=os(e);r.compatible=t.compatible,r.description=t.description,r.bindingsPath=t.filePath,r.bus=typeof t.bus=="string"?[t.bus]:Array.from(new Set(t.bus)),r.onBus=t["on-bus"],t.extends?.forEach(s=>r.extends.add(s)),r.warnMismatchProperties=!0;let i=Object.keys(t).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:t[s]}));if(t.properties&&Object.keys(t.properties).forEach(s=>{let o=t.properties[s];yJ(r,s,o),r.cellsValues=i}),t["child-binding"]){let s=t["child-binding"];r.childNodeType=o=>RS(s,o)}return r},yJ=(t,e,r)=>{let n=t.properties.find(i=>i.getNameMatch(e));if(n&&typeof n.name=="string"){n.required=()=>r.required?"required":"optional",n.values=()=>r.enum??[],n.constValue=j$(r.type,r.const),n.bindingType=r.type;let i=n.additionalTypeCheck;n.additionalTypeCheck=(s,o)=>[...H$(r,e,n)(s,o),...i?.(s,o)??[]]}else{let i=r.type==="compound"?n?.type:F$(r.type);i??=F$(r.type);let s=new J(e,i,r.required?"required":"optional",void 0,r.enum);s.additionalTypeCheck=(o,a)=>{let c=[...n?.additionalTypeCheck?.(o,a)??[],...H$(r,e,s)(o,a)];return s.signatureArgs??=n?.signatureArgs,s.signatureArgsCyclic??=!!n?.signatureArgsCyclic,c},s.description=r.description?[r.description]:n?.description,s.bindingType=r.type,s.constValue=j$(r.type,r.const),t.addProperty(s)}},H$=(t,e,r)=>{let n=t;return(i,s)=>{let o=i.parent.root,a=[];if(n.const){let l=i.ast.quickValues;if(l?.length==1){let u=Array.isArray(n.const)?n.const:[n.const];Array.isArray(l[0])&&u.length===l[0].length&&l[0].every((f,p)=>typeof f=="number"&&Number.isNaN(f)||u[p]===f)||a.push($(24,i.ast.values??i.ast,$t.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${n.type}" with value: ${n.const}`]))}}if(n.deprecated&&a.push($(14,i.ast,$t.DiagnosticSeverity.Warning,[],[$t.DiagnosticTag.Deprecated],[i.name])),(n.type==="phandle"||n.type==="phandles"||n.type==="path")&&Oe(i.ast.values)?.forEach(u=>{ln(u,o)||a.push($(22,u,$t.DiagnosticSeverity.Error))}),n.type==="path"&&i.ast.values?.values.at(0)?.value instanceof ie){let l=i.ast.values?.values.at(0)?.value,u=[];l.value.split("/").every(d=>{let f=o.getNode(d);return f?u.push(d):a.push($(23,l,$t.DiagnosticSeverity.Error,[],[],[d,`/${u.join("/")}`])),!f})}let c=i.name.match(/^(.*)-(\d+)$/);if(n.type==="phandles"&&c){let l="";e.endsWith("-gpios")?l="gpio":l=n["specifier-space"]??c[1];let u=Number.parseInt(c[2],10),d=i.parent.getProperty(`${l}-names`);d&&(d.ast.quickValues?.at(u)||a.push($(33,i.ast,$t.DiagnosticSeverity.Warning,[d.ast],[],[i.name,u.toString()])))}if(n.type==="phandle-array"){let l=Oe(i.ast.values),u=0,d=[],f=0;for(;l&&u<l.length;){let p=l.at(u),y=ln(p,o);if(!y){a.push($(22,p??i.ast,$t.DiagnosticSeverity.Error));break}let h="";e.endsWith("-gpios")?h="gpio":h=n["specifier-space"]??e.slice(0,-1);let v=y.getProperty(`#${h}-cells`);if(!v){a.push($(16,i.ast,$t.DiagnosticSeverity.Error,[...y.nodeNameOrLabelRef],[],[i.name,`#${h}-cells`,`/${y.path.slice(1).join("/")}`]));break}let S=v?qe(v,0,0,s)??0:0,_=y.nodeType?.cellsValues?.find(U=>U.specifier===h)?.values;if(d.push([`${f}_phandel`,..._?.map(U=>`${f}_${U}`)??[],...Array.from({length:S-(_?.length??0)},(U,H)=>`${f}_cell${S-(_?.length??0)?H:""}`)]),1+S>l.length-u){a.push($(19,p??i.ast,$t.DiagnosticSeverity.Error,[],[],[i.name,`<${d.at(-1).join(" ")}>`]));break}u+=1+S;let T=l.slice(u-S,u),R={mappingValuesAst:T,specifierSpace:h,target:y};i.nexusMapsTo.push(R);let C=y.getProperty(`${h}-map`);if(C){let U=y.getNexusMapEntyMatch(h,s,T);U?.match?R.mapItem=U.match:a.push($(31,U.entry,$t.DiagnosticSeverity.Error,[C.ast]))}T.every(U=>U instanceof we)&&y.spesifierNexusMapping.push({expressions:T,node:i.parent,property:i});let B=i.parent.getProperty(`${h}-names`);p&&B&&(B.ast.quickValues?.at(f)||a.push($(33,new j(G(p.firstToken,l.at(u-1)?.lastToken)),$t.DiagnosticSeverity.Warning,[B.ast],[],[i.name,f.toString()]))),f++}d.push([`${f}_phandel`,`${f}_cell...`]),r.signatureArgs=d.map(p=>p.map(y=>$t.ParameterInformation.create(y)))}return a}};var Y$=(t,e)=>{let r=t.zephyrBindings.join(":");return e==="Zephyr"&&Ja().loadTypeAndCache(t.zephyrBindings,r),{files:t,type:e,getNodeTypes:n=>{switch(e){case"Zephyr":return Ja().getNodeTypes(n,r);case"DevicetreeOrg":return{type:NS().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n),issues:[]}}},getBindings:()=>{switch(e){case"Zephyr":return Ja().getBindings(r);case"DevicetreeOrg":return NS().getBindings()}},getBusTypes:()=>{switch(e){case"Zephyr":return Ja().getBusTypes();case"DevicetreeOrg":return[]}},getDocumentLinks(n){if(!n)return[];switch(e){case"Zephyr":return Ja().getDocumentLinks(n,t.zephyrBindings);case"DevicetreeOrg":return[]}}}};var Dm=M(F());var vJ=t=>!t.lastToken.prevToken||!t.lastToken.prevToken.prevToken?[]:[{startLine:t.firstToken.pos.line,startCharacter:t.firstToken.pos.col,endLine:t.lastToken.prevToken.prevToken.pos.line,endCharacter:t.lastToken.prevToken.prevToken.pos.col,kind:Dm.FoldingRangeKind.Comment}],ES=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(ES):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Dm.FoldingRangeKind.Region},...t.nodes.flatMap(ES)],K$=t=>{let e=[];return[...t instanceof ns?t.ifBlocks.map(r=>({start:(r.expression??r.keyword).lastToken,end:r.content?.lastToken??(r.expression??r.keyword).lastToken})):[{start:(t.ifDef.identifier??t.ifDef.keyword).lastToken,end:t.ifDef.content?.lastToken}],t.elseOption?{start:t.elseOption.keyword.lastToken,end:t.elseOption.content?.lastToken}:null].forEach(r=>{!r||!r.end||e.push({startLine:r.start.pos.line,startCharacter:r.start.pos.col,endLine:r.end.pos.line,endCharacter:r.end.pos.colEnd,kind:Dm.FoldingRangeKind.Region})}),e},TJ=t=>t instanceof lt?ES(t):t instanceof rs||t instanceof ns?K$(t):t instanceof an?vJ(t):[];function X$(t,e){return e.allAstItems.flatMap(r=>[r,...r.allDescendants]).filter(r=>fe(r.uri,t)).flatMap(TJ)}var vo=M(F());function bJ(t){if(!t||!(t.ast instanceof He)&&!(t.ast instanceof rr))return[];let e=r=>r.nodeType?.bindingsPath?[vo.Location.create(ve(r.nodeType.bindingsPath),vo.Range.create(vo.Position.create(0,0),vo.Position.create(0,0)))]:[];return t.item instanceof Q&&!Ut(t.ast)?e(t.item):t.ast instanceof rr&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof He&&t.ast.linksTo?e(t.ast.linksTo):[]}async function J$(t,e){return St(t,e,r=>[...bJ(r)])}var Im=require("fs");var _J=(t,e)=>{Or().reset(t),Or().requestTokens(t,!0),e(t)},Am=class{constructor(e,r,n){this.file=e;this.cb=r;this.hasDocumentOpen=n}#e=0;watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,r=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),_J(e,r)},(0,Im.watchFile)(e,this.onChange)}}unwatch(){this.count===1&&(console.log("dispose watch for",this.file),(0,Im.unwatchFile)(this.file,this.onChange),this.onChange=void 0),this.count--}get count(){return this.#e}set count(e){this.#e=e,e<0&&(this.#e=0,console.warn("unwatching an un watched file",this.file))}};var Qt=M(require("path")),wS=require("fs");var Vn=t=>{if(t)return Array.isArray(t)?t:[t]},SJ=t=>({...t,deviceOrgBindingsMetaSchema:Vn(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Vn(t.deviceOrgTreeBindings),includePaths:Vn(t.includePaths),lockRenameEdits:Vn(t.lockRenameEdits),zephyrBindings:Vn(t.zephyrBindings),overlays:Vn(t.overlays)}),Q$=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Vn(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Vn(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Vn(t.defaultIncludePaths),defaultLockRenameEdits:Vn(t.defaultLockRenameEdits),defaultZephyrBindings:Vn(t.defaultZephyrBindings),contexts:t.contexts?.map(SJ)}),bn=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),To={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},kS=async(t,e,r)=>{let n=(t.cwd?await bn(t.cwd,r):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(p=>bn(p,r))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(p=>bn(p,r))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(p=>bn(p,r))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(p=>bn(p,r))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(p=>bn(p,r)));n&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[],f=t.compileCommands;return n&&(s=s.map(p=>(0,Qt.resolve)(n,p)).filter(p=>(0,wS.existsSync)(p)),a=a?.map(p=>(0,Qt.resolve)(n,p)),c=c.map(p=>(0,Qt.resolve)(n,p)),i=i.map(p=>(0,Qt.resolve)(n,p)),u=(0,Qt.resolve)(n,u),d=d.map(p=>(0,Qt.resolve)(n,p)),l=l.map(p=>(0,Qt.resolve)(n,p)),f=f?(0,Qt.resolve)(n,f):void 0),{ctxName:t.ctxName??(0,Qt.basename)(u),cwd:n?rt(n):void 0,includePaths:i.map(rt),zephyrBindings:s.map(rt),bindingType:o,deviceOrgTreeBindings:a.map(rt),deviceOrgBindingsMetaSchema:c.map(rt),dtsFile:rt(u),overlays:d.map(rt),lockRenameEdits:l.map(rt),compileCommands:f?rt(f):void 0}},Pu=async(t,e)=>{let r=t.cwd?await bn(t.cwd,e):void 0,n=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>bn(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>bn(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>bn(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>bn(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>bn(d,e)));r&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Qt.resolve)(r,d)),n==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Qt.resolve)(r,d)),i=i.map(d=>(0,Qt.resolve)(r,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Qt.resolve)(r,d)),c=c.map(d=>(0,Qt.resolve)(r,d)));let l={cwd:r,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:n,autoChangeContext:t.autoChangeContext??To.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??To.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>kS(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,wS.existsSync)(f)&&Qt.default.isAbsolute(f)));return{...l,contexts:u}};var Z$=t=>`DT_PROP(${CS(t.parent)}, ${t.name.replaceAll("-","_")}))`,eB=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var CS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,tB=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),rB=t=>{let e=[];return ti.getNodeFromPath(["aliases"],t.root)?.property.filter(i=>{if(i.ast.quickValues?.at(0)===t.pathString)return!0;let s=i.ast.values?.values.at(0)?.value;if(s instanceof se&&s.linksTo===t||s instanceof it&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function NJ(t,e){if(!t||!(t.item instanceof Xe)||!(t.ast instanceof Ze))return[];let r=[];return e.settings.bindingType==="Zephyr"&&(r.push({type:"dt_zephyr_macro_prop_node_path",data:Z$(t.item)}),eB(t.item).forEach(n=>{r.push({type:"dt_zephyr_macro_prop_node_label",data:n})})),r}function PJ(t,e){if(!t||t.item===null)return[];let r;if(t.item instanceof Q?r=t.item:t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo?r=t.ast.parentNode.linksTo:t.ast instanceof He&&t.ast.linksTo&&(r=t.ast.linksTo),!r)return[];let n=[{type:"path",data:r.pathString}];return e.settings.bindingType==="Zephyr"&&(tB(r).forEach(i=>{n.push({type:"dt_zephyr_macro_node_label",data:i})}),n.push({type:"dt_zephyr_macro_node_path",data:CS(r)}),rB(r).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),n}async function nB(t,e){return e?St(t,e,r=>[...PJ(r,e),...NJ(r,e)]):[]}var iB=M(F());function RJ(t){return!t||!(t.item instanceof Xe)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function EJ(t){let e=Ec(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let n=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!n||!(n instanceof Zn))return;let i=n.params.map(o=>({label:o instanceof Ct?o.name:"..."})),s=e.params.find(o=>o&&(t.ast===o||o.isAncestorOf(t.ast)));return s??=t.afterAst?e.params.find(o=>o&&(t.afterAst===o||o.isAncestorOf(t.afterAst))):void 0,s??=t.beforeAst?e.params.find(o=>o&&(t.beforeAst===o||o.isAncestorOf(t.beforeAst))):void 0,{signatures:[iB.SignatureInformation.create(`${e.functionName.name}(${i.map(o=>o.label).join(", ")})`,void 0,...i.flat())],activeSignature:0,activeParameter:s?e.params.indexOf(s):void 0}}async function sB(t,e){if(e)return(await St(t,e,async r=>[await EJ(r)||RJ(r)])).at(0)}var oB=require("timers"),aB=require("events");var DS=class extends aB.EventEmitter{constructor(e=3e3,r=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,oB.setInterval)(()=>{let n=process.memoryUsage().heapUsed;n>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(n/1024/1024).toFixed(2),thresholdMb:e})},r)}stop(){clearInterval(this.interval)}},wJ=new DS(3e3),cB=()=>{wJ.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),Vw(),Hw()})};var Ve=[],le,Za,Om=new WeakMap,Ru=new Map;cB();var uB=t=>{t.getContextFiles().forEach(e=>{Ru.has(e)||Ru.set(e,new Am(e,qS,r=>!!xm(r))),Ru.get(e)?.watch()})},xS=async t=>{let e=Ve.indexOf(t);if(e===-1)return;Mm(t,void 0,!0),Om.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let r=await Os(t);if(ne.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:le===t,type:r.type}),Ve.splice(e,1),await LS(),t===le&&(le=void 0,Ve.length)){let n=Za?on(Ve,{uri:Za}):void 0;n??=Ve[0],console.log("Active context was deleted. Forcing active to",n.id),await Zt({id:n.id},!0)}t.getContextFiles().map(n=>Ru.get(n)?.unwatch())},kJ=t=>{let e=Om.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},$e=async()=>{await Promise.all(Ve.map(kJ))},MS=async t=>(await dB()).indexOf(t)!==-1,dB=async()=>{let t=await fB();return Ve.filter(e=>!t.some(r=>r===e))},fB=async()=>{let t=await OS();return Ve.filter(e=>t.contexts.find(r=>Si(r)===e.id))},CJ=async()=>{let t=await xJ();return Ve.filter(e=>t.contexts.find(r=>Si(r)===e.id))},DJ=async t=>(await CJ()).indexOf(t)!==-1,AJ=async(t,e)=>{if(t===e)return!0;let r=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),n=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return n.some(i=>fe(i.resolvedPath,t.parser.uri))&&r.length?r.every(i=>n.some(s=>s.resolvedPath===i.resolvedPath&&s.firstToken.pos.col===i.firstToken.pos.col&&s.firstToken.pos.len===i.firstToken.pos.len&&s.firstToken.pos.line===i.firstToken.pos.line&&s.lastToken.pos.col===i.lastToken.pos.col&&s.lastToken.pos.len===i.lastToken.pos.len&&s.lastToken.pos.line===i.lastToken.pos.line)):e.getContextFiles().some(i=>fe(i,t.parser.uri))},IJ=async t=>{if(!await MS(t))return;let e=await dB(),r=await fB(),n=await mf(e);if(Ve.indexOf(t)===-1)return;let i=await Promise.all(n.flatMap(a=>[...r,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await AJ(a.context,c)})))),s=t.getContextFiles(),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&fe(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&await Promise.all(o.map(xS))},ne=(0,ut.createConnection)(ut.ProposedFeatures.all),vr=new ut.TextDocuments(Qi),pB=!1,AS=!1,hB=!1,mB=!1,gB=!1,IS;ne.onInitialize(t=>{IS=t.workspaceFolders??[],ne.console.log(`[Server(${process.pid}) ${IS?.at(0)?.uri} Version 0.5.4 ] Started and initialize received`);let e=t.capabilities;pB=!!(e.workspace&&e.workspace.configuration),AS=!!(e.workspace&&e.workspace.workspaceFolders),hB=!!e.workspace?.diagnostics?.refreshSupport,mB=!!e.workspace?.semanticTokens?.refreshSupport,gB=!!e.workspace?.foldingRange?.refreshSupport;let r={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:ut.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," ",'"',"(",","]},codeActionProvider:{codeActionKinds:[ut.CodeActionKind.QuickFix,ut.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:uf,tokenModifiers:df},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return AS&&(r.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),r});ne.onInitialized(()=>{pB&&ne.client.register(ut.DidChangeConfigurationNotification.type,{}),AS&&ne.workspace.onDidChangeWorkspaceFolders(async t=>{ne.console.log("Workspace folder change event received"),await Cu()})});var OJ=async()=>{let t=yB();return t={...To,...t},Pu(t,await ku())},OS=async()=>{let t=qJ();return t={...To,...t},Pu(t,await ku())},xJ=async()=>{let t=LJ();return t={...To,...t},Pu(t,await ku())},wu=async()=>{let t=MJ();return t={...To,...t},Pu(t,await ku())},ku=async()=>(await ne.workspace.getWorkspaceFolders()??IS)?.map(e=>De(e.uri))?.at(0),lB=async t=>{let e=on(Ve,{id:Si(t)});if(e)return e.ctxNames.includes(t.ctxName)||console.log(`(ID: ${e.id}) Adding name ${t.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(t.ctxName),e;let r=Si(t);console.log(`(ID: ${r}) New context [${t.ctxName}]`),console.log(`(ID: ${r}) Settings: ${JSON.stringify(t,void 0," ")}`);let n=(0,tc.join)((0,tc.dirname)(t.dtsFile),"dts","bindings"),i=new Uf(t,t.bindingType?Y$({zephyrBindings:t.zephyrBindings?[n,...t.zephyrBindings]:[n],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Ve.push(i),await i.stable(),uB(i);let s=await Os(i);return ne.sendNotification("devicetree/contextCreated",{ctxNames:i.ctxNames.map(o=>o.toString()),id:i.id,...await i.getFileTree(),settings:i.settings,active:i===le,type:s.type}),await IJ(i),await LS(),i},Cu=async()=>{let t=await OS(),e=await wu();e.allowAdhocContexts||(e=await OS());let r=e.contexts.map(Si),n=Ve.filter(i=>!r.includes(i.id));await Promise.all(n.map(xS)),await t.contexts?.reduce((i,s)=>i.then(async()=>{await lB(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await OJ()).contexts?.reduce((s,o)=>s.then(async()=>{on(Ve,{uri:o.dtsFile})||await lB(o)}),Promise.resolve()),Za?await Zt({uri:Za}):!le&&Ve.length&&(console.log(`No active context using first context (ID: ${Ve[0].id}) [${Ve[0].ctxNames.join(",")}]`),await Zt({id:Ve[0].id}))},_n,Is,Eu=new Map,Qa=new Map,MJ=()=>!Is&&!_n?void 0:{...Is,..._n,contexts:[..._n?.contexts??[],...Array.from(Qa.values()),...Array.from(Eu.values())]},yB=()=>!Is&&!_n?void 0:{...Is,..._n,contexts:[...Array.from(Eu.values())]},qJ=()=>!Is&&!_n?void 0:{...Is,..._n,contexts:[..._n?.contexts??[],...Array.from(Qa.values())]},LJ=()=>!Is&&!_n?void 0:{..._n,contexts:[..._n?.contexts??[]]};function $J(t){let e={...t};for(let r in e)e[r]===null&&delete e[r];return e}var vB=async()=>{let t=await wu();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ne.sendNotification("devicetree/settingsChanged",t),await Cu(),$e().then(()=>{hB&&ne.languages.diagnostics.refresh()})},BJ=async()=>{let t=le?.getContextFiles();await Promise.all(Array.from(vr.keys()).filter(Bt).map(async e=>{t?.some(r=>fe(r,De(e)))||await ne.sendDiagnostics({uri:e,version:vr.get(e)?.version,diagnostics:[{severity:ut.DiagnosticSeverity.Information,range:ut.Range.create(ut.Position.create(0,0),ut.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})}))},qS=async t=>{let e=jy(Ve,t);if(e.length)e.sort((r,n)=>r===le?-1:n===le?1:0).forEach(r=>{Om.get(r)?.abort.abort();let n=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(n.signal.aborted){s();return}let o=performance.now(),a=le===r,c=a?TB(r):[],l=r.getContextFiles();await r.reevaluate(t),uB(r),l.forEach(u=>Ru.get(u)?.unwatch()),a&&$S(r)?.length&&qm(r).then(u=>{let d=u.items.map(f=>({uri:f.uri,version:f.version??void 0,diagnostics:f.items}));Mm(r,c.filter(f=>d.every(p=>p.uri!==f.uri))),d.forEach(f=>{ne.sendDiagnostics(f)}),ec.set(r,!0)}),r.serialize().then(async u=>{let[d,f]=await Promise.all([Os(r),r.getFileTree()]),p={node:u,ctx:{ctxNames:r.ctxNames.map(y=>y.toString()),id:r.id,...f,settings:r.settings,active:a,type:d.type}};le===r&&ne.sendNotification("devicetree/activeContextStableNotification",p),ne.sendNotification("devicetree/contextStableNotification",p)}),s(),console.log("reevaluate",performance.now()-o)},50)});Om.set(r,{abort:n,promise:i})});else{if((await wu()).allowAdhocContexts===!1)return;await Cu(),await Zt({uri:t})}},FJ=t=>vr.keys().find(e=>fe(De(e),t)),xm=t=>{let e=FJ(t);if(e)return vr.get(e)},TB=t=>t.getContextFiles().map(e=>({uri:ve(e),version:xm(e)?.version,diagnostics:[]})),ec=new WeakMap,Mm=async(t,e=TB(t),r=!1)=>{if(!r&&t!==le)return;let n=performance.now();await Promise.all(e.filter(i=>t===le||!le?.getContextFiles().some(s=>fe(De(i.uri),s))).map(i=>ne.sendDiagnostics({uri:i.uri,version:vr.get(i.uri)?.version,diagnostics:[]}))),ec.delete(t),console.log(`(ID: ${t.id})`,"clear workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-n)},qm=async t=>{await t.stable();let e=performance.now(),r=await t.getDiagnostics(),n=t.getContextFiles().map(i=>({uri:ve(i),kind:ut.DocumentDiagnosticReportKind.Full,items:r.get(i)??[],version:xm(i)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...n]}},LS=async()=>{let t=await Promise.all(Ve.map(Os));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,le===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Os=async t=>{let e=await MS(t),r=!e&&await DJ(t);return{ctx:t,type:e?"Ad Hoc":r?"User":"3rd Party"}},Zt=async(t,e=!1)=>{if("uri"in t){if(!Bt(t.uri))return!1;Za=t.uri,console.log("Active File Uri",Za)}let r=await wu();if(le&&!e&&!r.autoChangeContext||(await $e(),!e&&le?.getContextFiles().find(o=>"uri"in t&&fe(o,t.uri))))return!1;let n=le,i=on(Ve,t),s=n!==i;return s&&(n&&Mm(n),le=i,i?(Os(i).then(async o=>{let a=await i.getFileTree();!i||i!==le&&!Ve.includes(i)||ne.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(c=>c.toString()),id:i.id,...a,settings:i.settings,active:le===i,type:o.type})}),$S(i)?.length&&qm(i).then(o=>{o.items.map(a=>({uri:a.uri,version:a.version??void 0,diagnostics:a.items})).forEach(a=>{ne.sendDiagnostics(a)})}).finally(()=>ec.set(i,!0)),await LS()):ne.sendNotification("devicetree/newActiveContext",void 0)),gB&&ne.languages.foldingRange.refresh(),mB&&ne.languages.semanticTokens.refresh(),s},Bt=t=>[".dts",".dtsi",".dtso",".overlay"].some(e=>t.endsWith(e));vr.listen(ne);var $S=t=>t?.getContextFiles()?.filter(e=>xm(e));vr.onDidClose(async t=>{let e=De(t.document.uri);if(!Bt(e))return;let r=jy(Ve,e);if(r.length===0){Eu.delete(e),ne.sendDiagnostics({uri:t.document.uri,version:vr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(r.map(async n=>{!!$S(n)?.filter(s=>s!==e).length?le?.getContextFiles().some(s=>fe(s,e))||ne.sendDiagnostics({uri:t.document.uri,version:vr.get(t.document.uri)?.version,diagnostics:[]}):await MS(n)?(await xS(n),Eu.delete(n.settings.dtsFile)):Mm(n)}))});vr.onDidOpen(async t=>{let e=De(t.document.uri);if(!Bt(e))return;await $e(),BJ();let r=on(Ve,{uri:e});if(console.log("onDidOpen",r?.id,e),r)r!==le?await Zt({id:r.id}):r===le&&!ec.get(r)&&qm(r).then(({items:n})=>n.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(async i=>{ne.sendDiagnostics(i)})).finally(()=>ec.set(r,!0));else{let n={ctxName:(0,tc.basename)(e),dtsFile:e};Eu.set(e,n),await qS(e)}});vr.onDidChangeContent(async t=>{let e=De(t.document.uri);if(!Bt(e))return;let r=t.document.getText(),n=Or();n.needsRenew(e,r)&&(console.log("Content changed"),n.renewLexer(e,r),await qS(e))});ne.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(_n=Q$($J(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await vB())});ne.listen();ne.languages.diagnostics.onWorkspace(async()=>{await $e();let t=le;return t?qm(t).finally(()=>{ec.set(t,!0)}):{items:[]}});ne.onDidChangeWatchedFiles(t=>{ne.console.log("We received a file change event")});ne.onCompletion(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&le&&le.bindingLoader?.type==="Zephyr")return oA(t,le,vr.get(t.textDocument.uri));if(!Bt(e))return[];await $e(),Zt({uri:e});let r=Tr(e);return r?[...await VC(t,r),...await NA(t,r)]:[]});ne.onCompletionResolve(t=>t);var Tr=t=>{let e=yB();return on(Ve,{uri:t},le,e?.preferredContext)};ne.onDocumentSymbol(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return[];await $e();let r=Tr(e);return r?r.getUriParser(e)?.getDocumentSymbols(e):[]});ne.onWorkspaceSymbol(async()=>{await $e();let t=le;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ne.languages.semanticTokens.on(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return{data:[]};try{await $e();let r=Tr(e),n=new ut.SemanticTokensBuilder,i=r?.isInContext(e);return!r||!i?{data:[]}:((await r.getAllParsers()).forEach(s=>s.buildSemanticTokens(n,e)),n.build())}catch(r){throw console.log(r),r}});ne.onDocumentLinks(async t=>{await $e();let e=De(t.textDocument.uri);return Bt(e)?Tr(e)?.getDocumentLinks(e):e.endsWith(".yaml")&&le?le.bindingLoader?.getDocumentLinks?.(vr.get(t.textDocument.uri))??[]:[]});ne.onPrepareRename(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return fA(t,r)});ne.onRenameRequest(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return dA(t,r)});ne.onReferences(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return aA(t,r)});ne.onDefinition(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&le&&le.bindingLoader?.type==="Zephyr")return yA(t,le,vr.get(t.textDocument.uri));if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e),n=(await r?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>ut.Location.create(i.target,i.range))??[];return n.length?n:mA(t,r)});ne.onDeclaration(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&le&&le.bindingLoader?.type==="Zephyr")return TA(t,le,vr.get(t.textDocument.uri));if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return gA(t,r)});ne.onCodeAction(async t=>{let e=De(t.textDocument.uri);if(Bt(e))return _A(t)});ne.onDocumentFormatting(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return r?(await r.getSyntaxIssues(void 0,i=>Yo(i,e,!1))).get(e)?.length?[]:Xy(t,r,Or().getDocument(e).getText()):[]});ne.onHover(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&le&&le.bindingLoader?.type==="Zephyr")return WI(t,le,vr.get(t.textDocument.uri));if(!Bt(e))return;await $e();let r=Tr(e);return(await PA(t,r)).at(0)});ne.onFoldingRanges(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e();let r=Tr(e),n=r?.isInContext(e);if(!r||!n)return[];let i=(await r.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?X$(e,i):[]});ne.onTypeDefinition(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return J$(t,r)});ne.onSignatureHelp(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Zt({uri:e});let r=Tr(e);return sB(t,r)});ne.onRequest("devicetree/getContexts",async()=>(await $e(),Promise.all(Ve.map(async t=>{let e=await Os(t);return{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:le===t,type:e.type}}))));ne.onRequest("devicetree/setActive",async t=>(await $e(),console.log("devicetree/setActive",t),await Zt(t,!0)));ne.onRequest("devicetree/getActiveContext",async()=>{if(await $e(),console.log("devicetree/getActiveContext"),!le)return;let t=await Os(le);return le?{ctxNames:le.ctxNames.map(e=>e.toString()),id:le.id,...await le.getFileTree(),settings:le.settings,active:!0,type:t.type}:void 0});ne.onRequest("devicetree/setDefaultSettings",async t=>{await $e(),Is=t,console.log("Integration Settings",t),await vB()});ne.onRequest("devicetree/requestContext",async t=>{await $e();let e=await wu(),r=await kS(t,e,await ku());console.log("devicetree/requestContext",r);let n=Si(r),i=Array.from(Qa).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];on(Ve,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),Qa.delete(i[0])}Qa.set(`${n}:${t.ctxName}`,t),await Cu();let s=Ve.find(a=>a.id===n);if(!s)throw new Error("Failed to create context");let o=await Os(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:n,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});ne.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await $e(),Qa.delete(`${t}:${e}`);let r=on(Ve,{id:t});if(r){if(r.removeCtxName(e),r.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Cu()}});ne.onRequest("devicetree/compiledDtsOutput",async t=>(await $e(),t?on(Ve,{id:t})?.toFullString():void 0));ne.onRequest("devicetree/serializedContext",async t=>(await $e(),t?on(Ve,{id:t})?.serialize():void 0));ne.onRequest("devicetree/activePath",async t=>{if(await $e(),!le)return;let e=r=>{if(r?.item)return r.item instanceof Q?{nodePath:r.item.pathString}:{nodePath:r.item.parent.pathString,propertyName:r.item.name}};return(await St(t,le,r=>[e(r)])).at(0)});ne.onRequest("devicetree/customActions",async t=>(await $e(),nB(t,le)));ne.onRequest("devicetree/activeFileUri",async t=>{await $e(),Zt({uri:t})});var jJ=async(t,e,r)=>{if((await e.getSyntaxIssues(void 0,a=>Yo(a,r,!1))).get(r)?.length)throw new Error("Unable to format. Files has syntax issues.");let i=Or().getDocument(r),s=await Xy(t,e,i.getText());return s.length===0?void 0:Uy(i,s)};ne.onRequest("devicetree/formattingText",async t=>{await $e();let e=De(t.textDocument.uri),r=Tr(e);if(r)return Zt({uri:e}),jJ(t,r,e);let n=Or().getDocument(e,t.text),i=await Kw(t,n.getText());return i.length===0?n.getText():Uy(n,i)});ne.onRequest("devicetree/diagnosticIssues",async({uri:t,full:e})=>{await $e();let r=De(t);Zt({uri:r});let n=Tr(r);if(!n)return[];let i=e?(await n.getDiagnostics()).get(r):(await n.getSyntaxIssues(void 0,s=>Yo(s,r,!!e))).get(r);if(i?.length)return i});ne.onRequest("devicetree/evalMacros",async({macros:t,ctxId:e})=>{await $e();let r=on(Ve,{id:e});return r?t.map(n=>{let i=ff(n,r.macros),s=Ie(i);return{macro:n,evaluated:typeof s=="number"?s:i}}):[]});
|
|
307
|
+
${n}`]})]},aJ=(t,e)=>w$(t,e.split("/").filter(r=>r)),w$=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let r=e[0].split("@"),n=r[0],i=r.at(1)?.split(",").map(o=>Number.parseInt(o,16)),s=t.getNode(n,i);return s?w$(s,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var pS=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let n=e.getProperty("compatible")?.ast.values;if(!n?.values.some(i=>!(i?.value instanceof ie)))return n?.values.map(i=>(i?.value).value)}parseMetaSchema(e,r){Ws.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,uS.resolve)(e,i);try{let s=fS.default.parse((0,dS.readFileSync)(i,"utf-8"));r.addMetaSchema(s),this.schemaIdValidators.set(s.$id,i)}catch{}})}parseBindings(e,r){Ws.sync("**/*.yaml",{cwd:e}).forEach(i=>{i=(0,uS.resolve)(e,i);try{let s=fS.default.parse((0,dS.readFileSync)(i,"utf-8"));r.addSchema(s),this.schemaIdValidators.set(s.$id,i)}catch(s){console.warn(i,s.message)}})}getNodeTypes(e,r,n){let i=`${e.join(";")}::${r.join(";")}`,s=this.ajvMap.get(i);return s||(s=new D$.default({strict:!1,strictSchema:!1,strictNumbers:!1}),s.addMetaSchema(lS),this.ajvMap.set(i,s),e.forEach(c=>this.parseMetaSchema(c,s)),r.forEach(c=>this.parseBindings(c,s))),t.getNodeCompatible(n)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new bm(s,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=s.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)??[]}getBindings(){return Array.from(this.schemaIdValidators.keys())}},C$,hS=()=>(C$??=new pS,C$);var mu=require("path"),L$=require("fs"),$$=L(require("path")),B$=L(ub());var Tn=L(j());var A$=()=>{let t=new X("nonposted-mmio",z("EMPTY"),"optional");return t.description=["Specifies that direct children of this bus should use non-posted memory accesses (i.e. a non-posted mapping mode) for MMIO ranges."],t};function I$(){let t=lr();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="compatible");e.required=()=>"required";let r=t.properties.find(n=>n.name==="ranges");return r.required=()=>"required",t.addProperty(A$()),t}var O$=t=>{switch(t){case"string":return z("STRING");case"int":return z("U32");case"boolean":return z("EMPTY");case"array":return z("PROP_ENCODED_ARRAY");case"uint8-array":return z("BYTESTRING");case"string-array":return z("STRINGLIST");case"phandle":return z("U32");case"phandles":return z("PROP_ENCODED_ARRAY");case"phandle-array":return z("PROP_ENCODED_ARRAY");case"path":return z(["STRING","U32"]);case"compound":return z("ANY");default:return z("ANY")}},x$=(t,e)=>{switch(t){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(r=>typeof r=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(r=>typeof r=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(r=>typeof r=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},_m=(t,e)=>{if(e.extends??=[],e=e.include.reduce((r,n)=>{let i=t.find(s=>(0,mu.basename)(s.filePath)===n.name);if(i){let s=n["property-blocklist"],o=n["property-allowlist"];return e.extends?.push(...r.include.map(a=>(0,mu.basename)(a.name,".yaml"))),r.include=r.include.filter(a=>a!==n),cJ(t,i,r,s,o)??r}return console.warn(`Unable to find ${n.name}`),r},e),e["child-binding"]&&(e["child-binding"].include=F$(e["child-binding"].include),e["child-binding"]=_m(t,e["child-binding"])),!e.include.length)return e},cJ=(t,e,r,n=[],i)=>{let s=_m(t,e),o=_m(t,r);if(!s||!o)return;let a=new Set;Object.keys(s?.properties??{}).forEach(f=>a.add(f)),Object.keys(o?.properties??{}).forEach(f=>a.add(f));let c={};Array.from(a).forEach(f=>{let p=n?.some(h=>h===f)||i&&!i.some(h=>h===f)?void 0:s.properties?.[f]??void 0,g=o.properties?.[f]??void 0;(p||g)&&(c={...c,[f]:{...p??g}})}),o.properties=c,o.extends??=[],o.extends.push(...s.extends??[]);let l=new Set;return Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Object.keys(s).filter(f=>f.endsWith("-cells")).forEach(f=>l.add(f)),Array.from(l).forEach(f=>{let p=s[f]??[],g=o[f]??[];o[f]=Array.from([...p,...g])}),o["on-bus"]??=s["on-bus"],o.bus?o.bus.push(...s.bus??[]):o.bus=s.bus,o},F$=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],mS=class t{constructor(){this.typeCache=new Map;this.processedFolders=new Set;this.zephyrBindingCache=new Map}static getCompatibleKeys(e,r){return!r||!r.nodeType?.bus?.length?[e]:[...r.nodeType.bus.map(n=>`${e}::${n}`),e]}static getNodeCompatible(e){let i=e.getProperty("compatible")?.ast.values?.values.filter(s=>s&&s.value instanceof ie);if(i?.length)return i.map(s=>s?.value?{name:s.value.value,ast:s.value}:void 0)}getNodeTypes(e,r){let n=t.getNodeCompatible(e)?.filter(a=>a);if(!n?.length){if(e.name==="zephyr,user"){let a=r.split(":"),l=Array.from(this.zephyrBindingCache.keys()).filter(d=>a.some(f=>d.startsWith(f))).flatMap(d=>this.zephyrBindingCache.get(d)).find(d=>d.filePath.endsWith("/base.yaml")),u=l?gS(l,e):void 0;if(u){u.warnMismatchProperties=!1;let d=u.properties.find(f=>f.name==="compatible");d&&(d.required=()=>"optional")}return{type:[u??rs(e)],issues:[]}}return{type:[rs(e)],issues:[]}}let i=n.flatMap(a=>t.getCompatibleKeys(a.name,e.parent).map(c=>this.typeCache.get(r)?.get(c)?.(e)).filter(c=>!!c)),s=this.getBusTypes(),o=n.flatMap(a=>{let c=t.getCompatibleKeys(a.name,e.parent).some(l=>this.typeCache.get(r)?.has(l));if(!c){let l=s.filter(u=>this.typeCache.get(r)?.has(`${a.name}::${u}`));if(l.length)return B(37,a.ast.rangeTokens,a.ast,{templateStrings:l})}return c?[]:[B(32,a.ast.rangeTokens,a.ast,{severity:Tn.DiagnosticSeverity.Hint,tags:[Tn.DiagnosticTag.Unnecessary],templateStrings:[a.name]})]});return{type:i.length?i:[rs(e)],issues:o}}loadTypeAndCache(e,r){e=Array.isArray(e)?e:[e];let n=e.filter(o=>this.processedFolders.has(o)).flatMap(o=>Array.from(this.zephyrBindingCache.entries()).flatMap(([a,c])=>a.startsWith(o)?[c]:[]));n.push(...e.filter(o=>!this.processedFolders.has(o)).flatMap(o=>(this.processedFolders.add(o),Ws.sync("**/*.yaml",{cwd:o,ignore:"test/*"}).map(c=>{if(c=(0,mu.resolve)(o,c),this.zephyrBindingCache.has(c))return this.zephyrBindingCache.get(c);try{let l=B$.default.parse((0,L$.readFileSync)(c,"utf-8")),u=F$(l?.include),d={...l,bus:l.bus?Array.isArray(l.bus)?l.bus:[l.bus]:void 0,include:u,rawInclude:[...u],filePath:c};return this.zephyrBindingCache.set(c,d),d}catch(l){console.warn(l)}}).filter(c=>!!c))));let i=n.map(o=>_m(n,o)).filter(o=>!!o&&!o.include.length),s=this.typeCache.get(r);s||(s=new Map,s.set("simple-bus",()=>I$()),this.typeCache.set(r,s)),lJ(i,s)}getBindings(e){return Array.from(this.typeCache.get(e)?.keys()??[]).map(r=>r.split("::",1)[0])}getBusTypes(){let e=Array.from(this.zephyrBindingCache.values()).flatMap(r=>r.bus?.filter(n=>!!n)??[]).filter(r=>!!r);return Array.from(new Set(e))}getDocumentLinks(e,r){let n=this.zephyrBindingCache.get(De(e.uri));if(!n)return[];let i=e.getText();return n.rawInclude.map(o=>{let c=new RegExp(o.name).exec(i);if(c){let l=e.positionAt(c.index),u=e.positionAt(c.index+c[0].length),d=Array.from(this.zephyrBindingCache.keys()).find(f=>f.endsWith(`${$$.default.sep}${o.name}`)&&r.some(p=>f.startsWith(p)));return d?{range:Tn.Range.create(l,u),target:ve(d)}:void 0}}).filter(o=>!!o)}},M$,Ha=()=>(M$??=new mS,M$),lJ=(t,e)=>t.forEach(r=>{r.compatible&&e.set(r["on-bus"]?`${r.compatible}::${r["on-bus"]}`:r.compatible,n=>gS(r,n))}),gS=(t,e)=>{let r=rs(e);r.compatible=t.compatible,r.description=t.description,r.bindingsPath=t.filePath,r.bus=typeof t.bus=="string"?[t.bus]:Array.from(new Set(t.bus)),r.onBus=t["on-bus"],t.extends?.forEach(s=>r.extends.add(s)),r.warnMismatchProperties=!0;let i=Object.keys(t).filter(s=>s.endsWith("-cells")).map(s=>({specifier:s.replace(/-cells$/,""),values:t[s]}));if(t.properties&&Object.keys(t.properties).forEach(s=>{let o=t.properties[s];uJ(r,s,o),r.cellsValues=i}),t["child-binding"]){let s=t["child-binding"];r.childNodeType=o=>gS(s,o)}return r},uJ=(t,e,r)=>{let n=t.properties.find(i=>i.getNameMatch(e));if(n&&typeof n.name=="string"){n.required=()=>r.required?"required":"optional",n.values=()=>r.enum??[],n.constValue=x$(r.type,r.const),n.bindingType=r.type;let i=n.additionalTypeCheck;n.additionalTypeCheck=(s,o)=>[...q$(r,e,n)(s,o),...i?.(s,o)??[]]}else{let i=r.type==="compound"?n?.type:O$(r.type);i??=O$(r.type);let s=new X(e,i,r.required?"required":"optional",void 0,r.enum);s.additionalTypeCheck=(o,a)=>{let c=[...n?.additionalTypeCheck?.(o,a)??[],...q$(r,e,s)(o,a)];return s.signatureArgs??=n?.signatureArgs,s.signatureArgsCyclic??=!!n?.signatureArgsCyclic,c},s.description=r.description?[r.description]:n?.description,s.bindingType=r.type,s.constValue=x$(r.type,r.const),t.addProperty(s)}},q$=(t,e,r)=>{let n=t;return(i,s)=>{let o=i.parent.root,a=[];if(n.const){let l=i.ast.quickValues;if(l?.length==1){let u=Array.isArray(n.const)?n.const:[n.const];if(!(Array.isArray(l[0])&&u.length===l[0].length&&l[0].every((f,p)=>typeof f=="number"&&Number.isNaN(f)||u[p]===f))){let f=i.ast.values??i.ast;a.push(B(24,f.rangeTokens,f,{templateStrings:[`Binding expects values to be "${n.type}" with value: ${n.const}`]}))}}}if(n.deprecated&&a.push(B(14,i.ast.rangeTokens,i.ast,{severity:Tn.DiagnosticSeverity.Warning,tags:[Tn.DiagnosticTag.Deprecated],templateStrings:[i.name]})),(n.type==="phandle"||n.type==="phandles"||n.type==="path")&&Oe(i.ast.values)?.forEach(u=>{cn(u,o)||a.push(B(22,u.rangeTokens,u))}),n.type==="path"&&i.ast.values?.values.at(0)?.value instanceof ie){let l=i.ast.values?.values.at(0)?.value,u=[];l.value.split("/").every(d=>{let f=o.getNode(d);return f?u.push(d):a.push(B(23,l.rangeTokens,l,{templateStrings:[d,`/${u.join("/")}`]})),!f})}let c=i.name.match(/^(.*)-(\d+)$/);if(n.type==="phandles"&&c){let l="";e.endsWith("-gpios")?l="gpio":l=n["specifier-space"]??c[1];let u=Number.parseInt(c[2],10),d=i.parent.getProperty(`${l}-names`);d&&(d.ast.quickValues?.at(u)||a.push(B(33,i.ast.rangeTokens,i.ast,{severity:Tn.DiagnosticSeverity.Warning,linkedTo:[d.ast],templateStrings:[i.name,u.toString()]})))}if(n.type==="phandle-array"){let l=Oe(i.ast.values),u=0,d=[],f=0;for(;l&&u<l.length;){let p=l.at(u),g=cn(p,o);if(!g){let F=p??i.ast;a.push(B(22,F.rangeTokens,F));break}let h="";e.endsWith("-gpios")?h="gpio":h=n["specifier-space"]??e.slice(0,-1);let v=g.getProperty(`#${h}-cells`);if(!v){a.push(B(16,i.ast.rangeTokens,i.ast,{linkedTo:[...g.nodeNameOrLabelRef],templateStrings:[i.name,`#${h}-cells`,`/${g.path.slice(1).join("/")}`]}));break}let S=v?qe(v,0,0,s)??0:0,_=g.nodeType?.cellsValues?.find(F=>F.specifier===h)?.values;if(d.push([`${f}_phandle`,..._?.map(F=>`${f}_${F}`)??[],...Array.from({length:S-(_?.length??0)},(F,U)=>`${f}_cell${S-(_?.length??0)?U:""}`)]),1+S>l.length-u){let F=p??i.ast;a.push(B(19,F.rangeTokens,F,{templateStrings:[i.name,`<${d.at(-1).join(" ")}>`]}));break}u+=1+S;let T=l.slice(u-S,u),P={mappingValuesAst:T,specifierSpace:h,target:g};i.nexusMapsTo.push(P);let C=g.getProperty(`${h}-map`);if(C){let F=g.getNexusMapEntryMatch(h,s,T);F?.match?P.mapItem=F.match:a.push(B(31,F.entry.rangeTokens,F.entry,{linkedTo:[C.ast]}))}T.every(F=>F instanceof Ee)&&g.spesifierNexusMapping.push({expressions:T,node:i.parent,property:i});let $=i.parent.getProperty(`${h}-names`);p&&$&&($.ast.quickValues?.at(f)||a.push(B(33,W(p.firstToken,l.at(u-1)?.lastToken),i.ast,{severity:Tn.DiagnosticSeverity.Warning,linkedTo:[$.ast],templateStrings:[i.name,f.toString()]}))),f++}d.push([`${f}_phandle`,`${f}_cell...`]),r.signatureArgs=d.map(p=>p.map(g=>Tn.ParameterInformation.create(g)))}return a}};var j$=(t,e)=>{let r=t.zephyrBindings.join(":");return e==="Zephyr"&&Ha().loadTypeAndCache(t.zephyrBindings,r),{files:t,type:e,getNodeTypes:n=>{switch(e){case"Zephyr":return Ha().getNodeTypes(n,r);case"DevicetreeOrg":return{type:hS().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n),issues:[]}}},getBindings:()=>{switch(e){case"Zephyr":return Ha().getBindings(r);case"DevicetreeOrg":return hS().getBindings()}},getBusTypes:()=>{switch(e){case"Zephyr":return Ha().getBusTypes();case"DevicetreeOrg":return[]}},getDocumentLinks(n){if(!n)return[];switch(e){case"Zephyr":return Ha().getDocumentLinks(n,t.zephyrBindings);case"DevicetreeOrg":return[]}}}};var Sm=L(j());var dJ=t=>!t.lastToken.prevToken||!t.lastToken.prevToken.prevToken?[]:[{startLine:t.firstToken.pos.line,startCharacter:t.firstToken.pos.col,endLine:t.lastToken.prevToken.prevToken.pos.line,endCharacter:t.lastToken.prevToken.prevToken.pos.col,kind:Sm.FoldingRangeKind.Comment}],yS=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(yS):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:Sm.FoldingRangeKind.Region},...t.nodes.flatMap(yS)],U$=t=>{let e=[];return[...t instanceof es?t.ifBlocks.map(r=>({start:(r.expression??r.keyword).lastToken,end:r.content?.lastToken??(r.expression??r.keyword).lastToken})):[{start:(t.ifDef.identifier??t.ifDef.keyword).lastToken,end:t.ifDef.content?.lastToken}],t.elseOption?{start:t.elseOption.keyword.lastToken,end:t.elseOption.content?.lastToken}:null].forEach(r=>{!r||!r.end||e.push({startLine:r.start.pos.line,startCharacter:r.start.pos.col,endLine:r.end.pos.line,endCharacter:r.end.pos.colEnd,kind:Sm.FoldingRangeKind.Region})}),e},fJ=t=>t instanceof ct?yS(t):t instanceof Zi||t instanceof es?U$(t):t instanceof on?dJ(t):[];function H$(t,e){return e.allAstItems.flatMap(r=>[r,...r.allDescendants]).filter(r=>de(r.uri,t)).flatMap(fJ)}var po=L(j());function pJ(t){if(!t||!(t.ast instanceof He)&&!(t.ast instanceof er))return[];let e=r=>r.nodeType?.bindingsPath?[po.Location.create(ve(r.nodeType.bindingsPath),po.Range.create(po.Position.create(0,0),po.Position.create(0,0)))]:[];return t.item instanceof J&&!jt(t.ast)?e(t.item):t.ast instanceof er&&t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof He&&t.ast.linksTo?e(t.ast.linksTo):[]}async function V$(t,e){return _t(t,e,r=>[...pJ(r)])}var Rm=require("fs");var hJ=(t,e)=>{Ar().reset(t),Ar().requestTokens(t,!0),e(t)},Nm=class{constructor(e,r,n){this.file=e;this.cb=r;this.hasDocumentOpen=n}#e=0;watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,r=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),hJ(e,r)},(0,Rm.watchFile)(e,this.onChange)}}unwatch(){this.count===1&&(console.log("dispose watch for",this.file),(0,Rm.unwatchFile)(this.file,this.onChange),this.onChange=void 0),this.count--}get count(){return this.#e}set count(e){this.#e=e,e<0&&(this.#e=0,console.warn("unwatching an un watched file",this.file))}};var Xt=L(require("path")),vS=require("fs");var Hn=t=>{if(t)return Array.isArray(t)?t:[t]},mJ=t=>({...t,deviceOrgBindingsMetaSchema:Hn(t.deviceOrgBindingsMetaSchema),deviceOrgTreeBindings:Hn(t.deviceOrgTreeBindings),includePaths:Hn(t.includePaths),lockRenameEdits:Hn(t.lockRenameEdits),zephyrBindings:Hn(t.zephyrBindings),overlays:Hn(t.overlays)}),z$=t=>({...t,defaultDeviceOrgBindingsMetaSchema:Hn(t.defaultDeviceOrgBindingsMetaSchema),defaultDeviceOrgTreeBindings:Hn(t.defaultDeviceOrgTreeBindings),defaultIncludePaths:Hn(t.defaultIncludePaths),defaultLockRenameEdits:Hn(t.defaultLockRenameEdits),defaultZephyrBindings:Hn(t.defaultZephyrBindings),contexts:t.contexts?.map(mJ)}),bn=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),ho={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},TS=async(t,e,r)=>{let n=(t.cwd?await bn(t.cwd,r):void 0)??e.cwd,i=await Promise.all((t.includePaths??e.defaultIncludePaths).map(p=>bn(p,r))),s=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(p=>bn(p,r))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(p=>bn(p,r))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(p=>bn(p,r))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(p=>bn(p,r)));n&&o==="Zephyr"&&(!s||s.length===0)&&(s=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[],f=t.compileCommands;return n&&(s=s.map(p=>(0,Xt.resolve)(n,p)).filter(p=>(0,vS.existsSync)(p)),a=a?.map(p=>(0,Xt.resolve)(n,p)),c=c.map(p=>(0,Xt.resolve)(n,p)),i=i.map(p=>(0,Xt.resolve)(n,p)),u=(0,Xt.resolve)(n,u),d=d.map(p=>(0,Xt.resolve)(n,p)),l=l.map(p=>(0,Xt.resolve)(n,p)),f=f?(0,Xt.resolve)(n,f):void 0),{ctxName:t.ctxName??(0,Xt.basename)(u),cwd:n?tt(n):void 0,includePaths:i.map(tt),zephyrBindings:s.map(tt),bindingType:o,deviceOrgTreeBindings:a.map(tt),deviceOrgBindingsMetaSchema:c.map(tt),dtsFile:tt(u),overlays:d.map(tt),lockRenameEdits:l.map(tt),compileCommands:f?tt(f):void 0}},gu=async(t,e)=>{let r=t.cwd?await bn(t.cwd,e):void 0,n=t.defaultBindingType,i=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>bn(d,e))),s=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>bn(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>bn(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>bn(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>bn(d,e)));r&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,Xt.resolve)(r,d)),n==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,Xt.resolve)(r,d)),i=i.map(d=>(0,Xt.resolve)(r,d)),s=(t.defaultDeviceOrgTreeBindings??[]).map(d=>(0,Xt.resolve)(r,d)),c=c.map(d=>(0,Xt.resolve)(r,d)));let l={cwd:r,defaultDeviceOrgBindingsMetaSchema:i,defaultDeviceOrgTreeBindings:s,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:n,autoChangeContext:t.autoChangeContext??ho.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??ho.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>TS(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,vS.existsSync)(f)&&Xt.default.isAbsolute(f)));return{...l,contexts:u}};var W$=t=>`DT_PROP(${bS(t.parent)}, ${t.name.replaceAll("-","_")}))`,G$=t=>t.parent.labels.map(e=>`DT_PROP(DT_NODELABEL(${e.label.toString()}), ${t.name.replaceAll("-","_")})`);var bS=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`,Y$=t=>t.labels.map(e=>`DT_NODELABEL(${e.label.toString()})`),K$=t=>{let e=[];return Zn.getNodeFromPath(["aliases"],t.root)?.properties.filter(i=>{if(i.ast.quickValues?.at(0)===t.pathString)return!0;let s=i.ast.values?.values.at(0)?.value;if(s instanceof se&&s.linksTo===t||s instanceof nt&&s.path?.pathParts.at(-1)?.linksTo===t)return!0})?.forEach(i=>e.push(`DT_ALIAS(${i.name.replaceAll("-","_")})`)),e};function gJ(t,e){if(!t||!(t.item instanceof Ke)||!(t.ast instanceof Qe))return[];let r=[];return e.settings.bindingType==="Zephyr"&&(r.push({type:"dt_zephyr_macro_prop_node_path",data:W$(t.item)}),G$(t.item).forEach(n=>{r.push({type:"dt_zephyr_macro_prop_node_label",data:n})})),r}function yJ(t,e){if(!t||t.item===null)return[];let r;if(t.item instanceof J?r=t.item:t.ast.parentNode instanceof se&&t.ast.parentNode.linksTo?r=t.ast.parentNode.linksTo:t.ast instanceof He&&t.ast.linksTo&&(r=t.ast.linksTo),!r)return[];let n=[{type:"path",data:r.pathString}];return e.settings.bindingType==="Zephyr"&&(Y$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_node_label",data:i})}),n.push({type:"dt_zephyr_macro_node_path",data:bS(r)}),K$(r).forEach(i=>{n.push({type:"dt_zephyr_macro_prop_node_alias",data:i})})),n}async function X$(t,e){return e?_t(t,e,r=>[...yJ(r,e),...gJ(r,e)]):[]}var J$=L(j());function vJ(t){return!t||!(t.item instanceof Ke)?void 0:t.item.parent.nodeType?.getSignatureHelp?.(t.item,t.ast,t.beforeAst,t.afterAst)}async function TJ(t){let e=yc(t?.ast);if(!e||!e.params.length||!t?.ast||t.ast===e.functionName)return;let n=(await t.runtime.context.getAllParsers()).at(-1).cPreprocessorParser.macros.get(e.functionName.name)?.macro.identifier;if(!n||!(n instanceof Qn))return;let i=n.params.map(o=>({label:o instanceof Ct?o.name:"..."})),s=e.params.find(o=>o&&(t.ast===o||o.isAncestorOf(t.ast)));return s??=t.afterAst?e.params.find(o=>o&&(t.afterAst===o||o.isAncestorOf(t.afterAst))):void 0,s??=t.beforeAst?e.params.find(o=>o&&(t.beforeAst===o||o.isAncestorOf(t.beforeAst))):void 0,{signatures:[J$.SignatureInformation.create(`${e.functionName.name}(${i.map(o=>o.label).join(", ")})`,void 0,...i.flat())],activeSignature:0,activeParameter:s?e.params.indexOf(s):void 0}}async function Q$(t,e){if(e)return(await _t(t,e,async r=>[await TJ(r)||vJ(r)])).at(0)}var Z$=require("timers"),eB=require("events");var _S=class extends eB.EventEmitter{constructor(e=3e3,r=1e3){super(),this.thresholdBytes=e*1024*1024,this.interval=(0,Z$.setInterval)(()=>{let n=process.memoryUsage().heapUsed;n>this.thresholdBytes&&this.emit("thresholdExceeded",{usedMb:(n/1024/1024).toFixed(2),thresholdMb:e})},r)}stop(){clearInterval(this.interval)}},bJ=new _S(3e3),tB=()=>{bJ.on("thresholdExceeded",({usedMb:t,thresholdMb:e})=>{console.warn(`[HeapMonitor] Heap usage exceeded ${e}MB: ${t}MB used`),ME(),xE()})};var Ve=[],ce,za,Pm=new WeakMap,yu=new Map;tB();var nB=t=>{t.getContextFiles().forEach(e=>{yu.has(e)||yu.set(e,new Nm(e,ES,r=>!!km(r))),yu.get(e)?.watch()})},PS=async t=>{let e=Ve.indexOf(t);if(e===-1)return;Em(t,void 0,!0),Pm.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let r=await Cs(t);if(ne.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:r.type}),Ve.splice(e,1),await wS(),t===ce&&(ce=void 0,Ve.length)){let n=za?sn(Ve,{uri:za}):void 0;n??=Ve[0],console.log("Active context was deleted. Forcing active to",n.id),await Jt({id:n.id},!0)}t.getContextFiles().map(n=>yu.get(n)?.unwatch())},_J=t=>{let e=Pm.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},$e=async()=>{await Promise.all(Ve.map(_J))},kS=async t=>(await iB()).indexOf(t)!==-1,iB=async()=>{let t=await sB();return Ve.filter(e=>!t.some(r=>r===e))},sB=async()=>{let t=await RS();return Ve.filter(e=>t.contexts.find(r=>bi(r)===e.id))},SJ=async()=>{let t=await EJ();return Ve.filter(e=>t.contexts.find(r=>bi(r)===e.id))},NJ=async t=>(await SJ()).indexOf(t)!==-1,RJ=async(t,e)=>{if(t===e)return!0;let r=(await t.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath),n=(await e.getAllParsers()).flatMap(i=>i.cPreprocessorParser.dtsIncludes).filter(i=>i.resolvedPath);return n.some(i=>de(i.resolvedPath,t.parser.uri))&&r.length?r.every(i=>n.some(s=>s.resolvedPath===i.resolvedPath&&s.firstToken.pos.col===i.firstToken.pos.col&&s.firstToken.pos.len===i.firstToken.pos.len&&s.firstToken.pos.line===i.firstToken.pos.line&&s.lastToken.pos.col===i.lastToken.pos.col&&s.lastToken.pos.len===i.lastToken.pos.len&&s.lastToken.pos.line===i.lastToken.pos.line)):e.getContextFiles().some(i=>de(i,t.parser.uri))},PJ=async t=>{if(!await kS(t))return;let e=await iB(),r=await sB(),n=await af(e);if(Ve.indexOf(t)===-1)return;let i=await Promise.all(n.flatMap(a=>[...r,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await RJ(a.context,c)})))),s=t.getContextFiles(),o=n.filter(a=>i.some(c=>c.context===a.context&&c.same)||a.context!==t&&de(a.context.parser.uri,t.parser.uri)&&s.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&await Promise.all(o.map(PS))},ne=(0,lt.createConnection)(lt.ProposedFeatures.all),gr=new lt.TextDocuments(Yi),oB=!1,SS=!1,aB=!1,cB=!1,lB=!1,NS;ne.onInitialize(t=>{NS=t.workspaceFolders??[],ne.console.log(`[Server(${process.pid}) ${NS?.at(0)?.uri} Version 0.5.5 ] Started and initialize received`);let e=t.capabilities;oB=!!(e.workspace&&e.workspace.configuration),SS=!!(e.workspace&&e.workspace.workspaceFolders),aB=!!e.workspace?.diagnostics?.refreshSupport,cB=!!e.workspace?.semanticTokens?.refreshSupport,lB=!!e.workspace?.foldingRange?.refreshSupport;let r={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:lt.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," ",'"',"(",","]},codeActionProvider:{codeActionKinds:[lt.CodeActionKind.QuickFix,lt.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:tf,tokenModifiers:rf},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0,signatureHelpProvider:{triggerCharacters:["<","("],retriggerCharacters:[" ",","]}}};return SS&&(r.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),r});ne.onInitialized(()=>{oB&&ne.client.register(lt.DidChangeConfigurationNotification.type,{}),SS&&ne.workspace.onDidChangeWorkspaceFolders(async t=>{ne.console.log("Workspace folder change event received"),await _u()})});var kJ=async()=>{let t=uB();return t={...ho,...t},gu(t,await bu())},RS=async()=>{let t=CJ();return t={...ho,...t},gu(t,await bu())},EJ=async()=>{let t=DJ();return t={...ho,...t},gu(t,await bu())},Tu=async()=>{let t=wJ();return t={...ho,...t},gu(t,await bu())},bu=async()=>(await ne.workspace.getWorkspaceFolders()??NS)?.map(e=>De(e.uri))?.at(0),rB=async t=>{let e=sn(Ve,{id:bi(t)});if(e)return e.ctxNames.includes(t.ctxName)||console.log(`(ID: ${e.id}) Adding name ${t.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(t.ctxName),e;let r=bi(t);console.log(`(ID: ${r}) New context [${t.ctxName}]`),console.log(`(ID: ${r}) Settings: ${JSON.stringify(t,void 0," ")}`);let n=(0,Ga.join)((0,Ga.dirname)(t.dtsFile),"dts","bindings"),i=new xf(t,t.bindingType?j$({zephyrBindings:t.zephyrBindings?[n,...t.zephyrBindings]:[n],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);Ve.push(i),await i.stable(),nB(i);let s=await Cs(i);return ne.sendNotification("devicetree/contextCreated",{ctxNames:i.ctxNames.map(o=>o.toString()),id:i.id,...await i.getFileTree(),settings:i.settings,active:i===ce,type:s.type}),await PJ(i),await wS(),i},_u=async()=>{let t=await RS(),e=await Tu();e.allowAdhocContexts||(e=await RS());let r=e.contexts.map(bi),n=Ve.filter(i=>!r.includes(i.id));await Promise.all(n.map(PS)),await t.contexts?.reduce((i,s)=>i.then(async()=>{await rB(s)}),Promise.resolve()),e.allowAdhocContexts&&await(await kJ()).contexts?.reduce((s,o)=>s.then(async()=>{sn(Ve,{uri:o.dtsFile})||await rB(o)}),Promise.resolve()),za?await Jt({uri:za}):!ce&&Ve.length&&(console.log(`No active context using first context (ID: ${Ve[0].id}) [${Ve[0].ctxNames.join(",")}]`),await Jt({id:Ve[0].id}))},_n,ws,vu=new Map,Va=new Map,wJ=()=>!ws&&!_n?void 0:{...ws,..._n,contexts:[..._n?.contexts??[],...Array.from(Va.values()),...Array.from(vu.values())]},uB=()=>!ws&&!_n?void 0:{...ws,..._n,contexts:[...Array.from(vu.values())]},CJ=()=>!ws&&!_n?void 0:{...ws,..._n,contexts:[..._n?.contexts??[],...Array.from(Va.values())]},DJ=()=>!ws&&!_n?void 0:{..._n,contexts:[..._n?.contexts??[]]};function AJ(t){let e={...t};for(let r in e)e[r]===null&&delete e[r];return e}var dB=async()=>{let t=await Tu();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ne.sendNotification("devicetree/settingsChanged",t),await _u(),$e().then(()=>{aB&&ne.languages.diagnostics.refresh()})},IJ=async()=>{let t=ce?.getContextFiles();await Promise.all(Array.from(gr.keys()).filter(Bt).map(async e=>{t?.some(r=>de(r,De(e)))||await ne.sendDiagnostics({uri:e,version:gr.get(e)?.version,diagnostics:[{severity:lt.DiagnosticSeverity.Information,range:lt.Range.create(lt.Position.create(0,0),lt.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})}))},ES=async t=>{let e=Oy(Ve,t);if(e.length)e.sort((r,n)=>r===ce?-1:n===ce?1:0).forEach(r=>{Pm.get(r)?.abort.abort();let n=new AbortController,i=new Promise(s=>{setTimeout(async()=>{if(n.signal.aborted){s();return}let o=performance.now(),a=ce===r,c=a?fB(r):[],l=r.getContextFiles();await r.reevaluate(t),nB(r),l.forEach(u=>yu.get(u)?.unwatch()),a&&CS(r)?.length&&wm(r).then(u=>{let d=u.items.map(f=>({uri:f.uri,version:f.version??void 0,diagnostics:f.items}));Em(r,c.filter(f=>d.every(p=>p.uri!==f.uri))),d.forEach(f=>{ne.sendDiagnostics(f)}),Wa.set(r,!0)}),r.serialize().then(async u=>{let[d,f]=await Promise.all([Cs(r),r.getFileTree()]),p={node:u,ctx:{ctxNames:r.ctxNames.map(g=>g.toString()),id:r.id,...f,settings:r.settings,active:a,type:d.type}};ce===r&&ne.sendNotification("devicetree/activeContextStableNotification",p),ne.sendNotification("devicetree/contextStableNotification",p)}),s(),console.log("reevaluate",performance.now()-o)},50)});Pm.set(r,{abort:n,promise:i})});else{if((await Tu()).allowAdhocContexts===!1)return;await _u(),await Jt({uri:t})}},OJ=t=>gr.keys().find(e=>de(De(e),t)),km=t=>{let e=OJ(t);if(e)return gr.get(e)},fB=t=>t.getContextFiles().map(e=>({uri:ve(e),version:km(e)?.version,diagnostics:[]})),Wa=new WeakMap,Em=async(t,e=fB(t),r=!1)=>{if(!r&&t!==ce)return;let n=performance.now();await Promise.all(e.filter(i=>t===ce||!ce?.getContextFiles().some(s=>de(De(i.uri),s))).map(i=>ne.sendDiagnostics({uri:i.uri,version:gr.get(i.uri)?.version,diagnostics:[]}))),Wa.delete(t),console.log(`(ID: ${t.id})`,"clear workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-n)},wm=async t=>{await t.stable();let e=performance.now(),r=await t.getDiagnostics(),n=t.getContextFiles().map(i=>({uri:ve(i),kind:lt.DocumentDiagnosticReportKind.Full,items:r.get(i)??[],version:km(i)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...n]}},wS=async()=>{let t=await Promise.all(Ve.map(Cs));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,ce===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Cs=async t=>{let e=await kS(t),r=!e&&await NJ(t);return{ctx:t,type:e?"Ad Hoc":r?"User":"3rd Party"}},Jt=async(t,e=!1)=>{if("uri"in t){if(!Bt(t.uri))return!1;za=t.uri,console.log("Active File Uri",za)}let r=await Tu();if(ce&&!e&&!r.autoChangeContext||(await $e(),!e&&ce?.getContextFiles().find(o=>"uri"in t&&de(o,t.uri))))return!1;let n=ce,i=sn(Ve,t),s=n!==i;return s&&(n&&Em(n),ce=i,i?(Cs(i).then(async o=>{let a=await i.getFileTree();!i||i!==ce&&!Ve.includes(i)||ne.sendNotification("devicetree/newActiveContext",{ctxNames:i.ctxNames.map(c=>c.toString()),id:i.id,...a,settings:i.settings,active:ce===i,type:o.type})}),CS(i)?.length&&wm(i).then(o=>{o.items.map(a=>({uri:a.uri,version:a.version??void 0,diagnostics:a.items})).forEach(a=>{ne.sendDiagnostics(a)})}).finally(()=>Wa.set(i,!0)),await wS()):ne.sendNotification("devicetree/newActiveContext",void 0)),lB&&ne.languages.foldingRange.refresh(),cB&&ne.languages.semanticTokens.refresh(),s},Bt=t=>[".dts",".dtsi",".dtso",".overlay"].some(e=>t.endsWith(e));gr.listen(ne);var CS=t=>t?.getContextFiles()?.filter(e=>km(e));gr.onDidClose(async t=>{let e=De(t.document.uri);if(!Bt(e))return;let r=Oy(Ve,e);if(r.length===0){vu.delete(e),ne.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(r.map(async n=>{!!CS(n)?.filter(s=>s!==e).length?ce?.getContextFiles().some(s=>de(s,e))||ne.sendDiagnostics({uri:t.document.uri,version:gr.get(t.document.uri)?.version,diagnostics:[]}):await kS(n)?(await PS(n),vu.delete(n.settings.dtsFile)):Em(n)}))});gr.onDidOpen(async t=>{let e=De(t.document.uri);if(!Bt(e))return;await $e(),IJ();let r=sn(Ve,{uri:e});if(console.log("onDidOpen",r?.id,e),r)r!==ce?await Jt({id:r.id}):r===ce&&!Wa.get(r)&&wm(r).then(({items:n})=>n.map(i=>({uri:i.uri,version:i.version??void 0,diagnostics:i.items})).forEach(async i=>{ne.sendDiagnostics(i)})).finally(()=>Wa.set(r,!0));else{let n={ctxName:(0,Ga.basename)(e),dtsFile:e};vu.set(e,n),await ES(e)}});gr.onDidChangeContent(async t=>{let e=De(t.document.uri);if(!Bt(e))return;let r=t.document.getText(),n=Ar();n.needsRenew(e,r)&&(console.log("Content changed"),n.renewLexer(e,r),await ES(e))});ne.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(_n=z$(AJ(t.settings.devicetree)),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await dB())});ne.listen();ne.languages.diagnostics.onWorkspace(async()=>{await $e();let t=ce;return t?wm(t).finally(()=>{Wa.set(t,!0)}):{items:[]}});ne.onDidChangeWatchedFiles(t=>{ne.console.log("We received a file change event")});ne.onCompletion(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return ZD(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return[];await $e(),Jt({uri:e});let r=yr(e);return r?[...await LC(t,r),...await gA(t,r)]:[]});ne.onCompletionResolve(t=>t);var yr=t=>{let e=uB();return sn(Ve,{uri:t},ce,e?.preferredContext)};ne.onDocumentSymbol(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return[];await $e();let r=yr(e);return r?r.getUriParser(e)?.getDocumentSymbols(e):[]});ne.onWorkspaceSymbol(async()=>{await $e();let t=ce;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ne.languages.semanticTokens.on(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return{data:[]};try{await $e();let r=yr(e),n=new lt.SemanticTokensBuilder,i=r?.isInContext(e);return!r||!i?{data:[]}:((await r.getAllParsers()).forEach(s=>s.buildSemanticTokens(n,e)),n.build())}catch(r){throw console.log(r),r}});ne.onDocumentLinks(async t=>{await $e();let e=De(t.textDocument.uri);return Bt(e)?yr(e)?.getDocumentLinks(e):e.endsWith(".yaml")&&ce?ce.bindingLoader?.getDocumentLinks?.(gr.get(t.textDocument.uri))??[]:[]});ne.onPrepareRename(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return sA(t,r)});ne.onRenameRequest(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return iA(t,r)});ne.onReferences(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return eA(t,r)});ne.onDefinition(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return uA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e),n=(await r?.getDocumentLinks(e,t.position))?.filter(i=>i.target).map(i=>lt.Location.create(i.target,i.range))??[];return n.length?n:cA(t,r)});ne.onDeclaration(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return fA(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return lA(t,r)});ne.onCodeAction(async t=>{let e=De(t.textDocument.uri);if(Bt(e))return hA(t)});ne.onDocumentFormatting(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return r?(await r.getSyntaxIssues(void 0,i=>Ho(i,e,!1))).get(e)?.length?[]:Uy(t,r,Ar().getDocument(e).getText()):[]});ne.onHover(async t=>{let e=De(t.textDocument.uri);if((e.endsWith(".c")||e.endsWith(".cpp"))&&ce&&ce.bindingLoader?.type==="Zephyr")return BI(t,ce,gr.get(t.textDocument.uri));if(!Bt(e))return;await $e();let r=yr(e);return(await yA(t,r)).at(0)});ne.onFoldingRanges(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e();let r=yr(e),n=r?.isInContext(e);if(!r||!n)return[];let i=(await r.getAllParsers()).find(s=>s.getFiles().some(o=>o===e));return i?H$(e,i):[]});ne.onTypeDefinition(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return V$(t,r)});ne.onSignatureHelp(async t=>{let e=De(t.textDocument.uri);if(!Bt(e))return;await $e(),Jt({uri:e});let r=yr(e);return Q$(t,r)});ne.onRequest("devicetree/getContexts",async()=>(await $e(),Promise.all(Ve.map(async t=>{let e=await Cs(t);return{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:ce===t,type:e.type}}))));ne.onRequest("devicetree/setActive",async t=>(await $e(),console.log("devicetree/setActive",t),await Jt(t,!0)));ne.onRequest("devicetree/getActiveContext",async()=>{if(await $e(),console.log("devicetree/getActiveContext"),!ce)return;let t=await Cs(ce);return ce?{ctxNames:ce.ctxNames.map(e=>e.toString()),id:ce.id,...await ce.getFileTree(),settings:ce.settings,active:!0,type:t.type}:void 0});ne.onRequest("devicetree/setDefaultSettings",async t=>{await $e(),ws=t,console.log("Integration Settings",t),await dB()});ne.onRequest("devicetree/requestContext",async t=>{await $e();let e=await Tu(),r=await TS(t,e,await bu());console.log("devicetree/requestContext",r);let n=bi(r),i=Array.from(Va).find(([,a])=>a.ctxName===t.ctxName);if(i){let a=i[0].split(":",1)[0];sn(Ve,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),Va.delete(i[0])}Va.set(`${n}:${t.ctxName}`,t),await _u();let s=Ve.find(a=>a.id===n);if(!s)throw new Error("Failed to create context");let o=await Cs(s);return{ctxNames:s.ctxNames.map(a=>a.toString()),id:n,...await s.getFileTree(),settings:s.settings,active:!0,type:o.type}});ne.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await $e(),Va.delete(`${t}:${e}`);let r=sn(Ve,{id:t});if(r){if(r.removeCtxName(e),r.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await _u()}});ne.onRequest("devicetree/compiledDtsOutput",async t=>(await $e(),t?sn(Ve,{id:t})?.toFullString():void 0));ne.onRequest("devicetree/serializedContext",async t=>(await $e(),t?sn(Ve,{id:t})?.serialize():void 0));ne.onRequest("devicetree/activePath",async t=>{if(await $e(),!ce)return;let e=r=>{if(r?.item)return r.item instanceof J?{nodePath:r.item.pathString}:{nodePath:r.item.parent.pathString,propertyName:r.item.name}};return(await _t(t,ce,r=>[e(r)])).at(0)});ne.onRequest("devicetree/customActions",async t=>(await $e(),X$(t,ce)));ne.onRequest("devicetree/activeFileUri",async t=>{await $e(),Jt({uri:t})});var xJ=async(t,e,r)=>{if((await e.getSyntaxIssues(void 0,a=>Ho(a,r,!1))).get(r)?.length)throw new Error("Unable to format. Files has syntax issues.");let i=Ar().getDocument(r),s=await Uy(t,e,i.getText());return s.length===0?void 0:xy(i,s)};ne.onRequest("devicetree/formattingText",async t=>{await $e();let e=De(t.textDocument.uri),r=yr(e);if(r)return Jt({uri:e}),xJ(t,r,e);let n=Ar().getDocument(e,t.text),i=await FE(t,n.getText());return i.length===0?n.getText():xy(n,i)});ne.onRequest("devicetree/diagnosticIssues",async({uri:t,full:e})=>{await $e();let r=De(t);Jt({uri:r});let n=yr(r);if(!n)return[];let i=e?(await n.getDiagnostics()).get(r):(await n.getSyntaxIssues(void 0,s=>Ho(s,r,!!e))).get(r);if(i?.length)return i});ne.onRequest("devicetree/evalMacros",async({macros:t,ctxId:e})=>{await $e();let r=sn(Ve,{id:e});return r?t.map(n=>{let i=nf(n,r.macros),s=Ie(i);return{macro:n,evaluated:typeof s=="number"?s:i}}):[]});
|